polotno-node 2.12.16 → 2.12.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +126 -21
- package/dist/assets/{html2canvas.esm-CBrSDip1.js → html2canvas.esm-BfxBtG_O.js} +1 -1
- package/dist/assets/index-Cn3AfcuE.js +627 -0
- package/dist/assets/index.es-DBuDDb35.js +18 -0
- package/dist/index.html +1 -1
- package/index.js +1 -1
- package/package.json +8 -8
- package/dist/assets/index-CuX31qNv.js +0 -620
- package/dist/assets/index.es-Uuln-F6j.js +0 -18
|
@@ -1,620 +0,0 @@
|
|
|
1
|
-
(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function t(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=t(a);fetch(a.href,i)}})();var bh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Zc(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var r=e.default;if(typeof r=="function"){var t=function n(){return this instanceof n?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};t.prototype=r.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}),t}var B0={exports:{}},zr={};/**
|
|
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 py;function n7(){if(py)return zr;py=1;var e=Symbol.for("react.element"),r=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function v(H){return H===null||typeof H!="object"?null:(H=p&&H[p]||H["@@iterator"],typeof H=="function"?H:null)}var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,E={};function w(H,U,D){this.props=H,this.context=U,this.refs=E,this.updater=D||f}w.prototype.isReactComponent={},w.prototype.setState=function(H,U){if(typeof H!="object"&&typeof H!="function"&&H!=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,H,U,"setState")},w.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function x(){}x.prototype=w.prototype;function y(H,U,D){this.props=H,this.context=U,this.refs=E,this.updater=D||f}var g=y.prototype=new x;g.constructor=y,_(g,w.prototype),g.isPureReactComponent=!0;var S=Array.isArray,b=Object.prototype.hasOwnProperty,R={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function T(H,U,D){var $,Q={},ee=null,te=null;if(U!=null)for($ in U.ref!==void 0&&(te=U.ref),U.key!==void 0&&(ee=""+U.key),U)b.call(U,$)&&!L.hasOwnProperty($)&&(Q[$]=U[$]);var ae=arguments.length-2;if(ae===1)Q.children=D;else if(1<ae){for(var se=Array(ae),ce=0;ce<ae;ce++)se[ce]=arguments[ce+2];Q.children=se}if(H&&H.defaultProps)for($ in ae=H.defaultProps,ae)Q[$]===void 0&&(Q[$]=ae[$]);return{$$typeof:e,type:H,key:ee,ref:te,props:Q,_owner:R.current}}function F(H,U){return{$$typeof:e,type:H.type,key:U,ref:H.ref,props:H.props,_owner:H._owner}}function I(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function O(H){var U={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(D){return U[D]})}var C=/\/+/g;function A(H,U){return typeof H=="object"&&H!==null&&H.key!=null?O(""+H.key):U.toString(36)}function j(H,U,D,$,Q){var ee=typeof H;(ee==="undefined"||ee==="boolean")&&(H=null);var te=!1;if(H===null)te=!0;else switch(ee){case"string":case"number":te=!0;break;case"object":switch(H.$$typeof){case e:case r:te=!0}}if(te)return te=H,Q=Q(te),H=$===""?"."+A(te,0):$,S(Q)?(D="",H!=null&&(D=H.replace(C,"$&/")+"/"),j(Q,U,D,"",function(ce){return ce})):Q!=null&&(I(Q)&&(Q=F(Q,D+(!Q.key||te&&te.key===Q.key?"":(""+Q.key).replace(C,"$&/")+"/")+H)),U.push(Q)),1;if(te=0,$=$===""?".":$+":",S(H))for(var ae=0;ae<H.length;ae++){ee=H[ae];var se=$+A(ee,ae);te+=j(ee,U,D,se,Q)}else if(se=v(H),typeof se=="function")for(H=se.call(H),ae=0;!(ee=H.next()).done;)ee=ee.value,se=$+A(ee,ae++),te+=j(ee,U,D,se,Q);else if(ee==="object")throw U=String(H),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.");return te}function N(H,U,D){if(H==null)return H;var $=[],Q=0;return j(H,$,"","",function(ee){return U.call(D,ee,Q++)}),$}function B(H){if(H._status===-1){var U=H._result;U=U(),U.then(function(D){(H._status===0||H._status===-1)&&(H._status=1,H._result=D)},function(D){(H._status===0||H._status===-1)&&(H._status=2,H._result=D)}),H._status===-1&&(H._status=0,H._result=U)}if(H._status===1)return H._result.default;throw H._result}var W={current:null},Y={transition:null},Z={ReactCurrentDispatcher:W,ReactCurrentBatchConfig:Y,ReactCurrentOwner:R};function V(){throw Error("act(...) is not supported in production builds of React.")}return zr.Children={map:N,forEach:function(H,U,D){N(H,function(){U.apply(this,arguments)},D)},count:function(H){var U=0;return N(H,function(){U++}),U},toArray:function(H){return N(H,function(U){return U})||[]},only:function(H){if(!I(H))throw Error("React.Children.only expected to receive a single React element child.");return H}},zr.Component=w,zr.Fragment=t,zr.Profiler=a,zr.PureComponent=y,zr.StrictMode=n,zr.Suspense=u,zr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z,zr.act=V,zr.cloneElement=function(H,U,D){if(H==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+H+".");var $=_({},H.props),Q=H.key,ee=H.ref,te=H._owner;if(U!=null){if(U.ref!==void 0&&(ee=U.ref,te=R.current),U.key!==void 0&&(Q=""+U.key),H.type&&H.type.defaultProps)var ae=H.type.defaultProps;for(se in U)b.call(U,se)&&!L.hasOwnProperty(se)&&($[se]=U[se]===void 0&&ae!==void 0?ae[se]:U[se])}var se=arguments.length-2;if(se===1)$.children=D;else if(1<se){ae=Array(se);for(var ce=0;ce<se;ce++)ae[ce]=arguments[ce+2];$.children=ae}return{$$typeof:e,type:H.type,key:Q,ref:ee,props:$,_owner:te}},zr.createContext=function(H){return H={$$typeof:o,_currentValue:H,_currentValue2:H,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},H.Provider={$$typeof:i,_context:H},H.Consumer=H},zr.createElement=T,zr.createFactory=function(H){var U=T.bind(null,H);return U.type=H,U},zr.createRef=function(){return{current:null}},zr.forwardRef=function(H){return{$$typeof:s,render:H}},zr.isValidElement=I,zr.lazy=function(H){return{$$typeof:h,_payload:{_status:-1,_result:H},_init:B}},zr.memo=function(H,U){return{$$typeof:c,type:H,compare:U===void 0?null:U}},zr.startTransition=function(H){var U=Y.transition;Y.transition={};try{H()}finally{Y.transition=U}},zr.unstable_act=V,zr.useCallback=function(H,U){return W.current.useCallback(H,U)},zr.useContext=function(H){return W.current.useContext(H)},zr.useDebugValue=function(){},zr.useDeferredValue=function(H){return W.current.useDeferredValue(H)},zr.useEffect=function(H,U){return W.current.useEffect(H,U)},zr.useId=function(){return W.current.useId()},zr.useImperativeHandle=function(H,U,D){return W.current.useImperativeHandle(H,U,D)},zr.useInsertionEffect=function(H,U){return W.current.useInsertionEffect(H,U)},zr.useLayoutEffect=function(H,U){return W.current.useLayoutEffect(H,U)},zr.useMemo=function(H,U){return W.current.useMemo(H,U)},zr.useReducer=function(H,U,D){return W.current.useReducer(H,U,D)},zr.useRef=function(H){return W.current.useRef(H)},zr.useState=function(H){return W.current.useState(H)},zr.useSyncExternalStore=function(H,U,D){return W.current.useSyncExternalStore(H,U,D)},zr.useTransition=function(){return W.current.useTransition()},zr.version="18.3.1",zr}var gy;function ai(){return gy||(gy=1,B0.exports=n7()),B0.exports}var ii=ai();const $r=yp(ii);var r1={},q0={exports:{}},hs={},z0={exports:{}},U0={};/**
|
|
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
|
-
*/var vy;function i7(){return vy||(vy=1,function(e){function r(Y,Z){var V=Y.length;Y.push(Z);e:for(;0<V;){var H=V-1>>>1,U=Y[H];if(0<a(U,Z))Y[H]=Z,Y[V]=U,V=H;else break e}}function t(Y){return Y.length===0?null:Y[0]}function n(Y){if(Y.length===0)return null;var Z=Y[0],V=Y.pop();if(V!==Z){Y[0]=V;e:for(var H=0,U=Y.length,D=U>>>1;H<D;){var $=2*(H+1)-1,Q=Y[$],ee=$+1,te=Y[ee];if(0>a(Q,V))ee<U&&0>a(te,Q)?(Y[H]=te,Y[ee]=V,H=ee):(Y[H]=Q,Y[$]=V,H=$);else if(ee<U&&0>a(te,V))Y[H]=te,Y[ee]=V,H=ee;else break e}}return Z}function a(Y,Z){var V=Y.sortIndex-Z.sortIndex;return V!==0?V:Y.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var u=[],c=[],h=1,p=null,v=3,f=!1,_=!1,E=!1,w=typeof setTimeout=="function"?setTimeout:null,x=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 g(Y){for(var Z=t(c);Z!==null;){if(Z.callback===null)n(c);else if(Z.startTime<=Y)n(c),Z.sortIndex=Z.expirationTime,r(u,Z);else break;Z=t(c)}}function S(Y){if(E=!1,g(Y),!_)if(t(u)!==null)_=!0,B(b);else{var Z=t(c);Z!==null&&W(S,Z.startTime-Y)}}function b(Y,Z){_=!1,E&&(E=!1,x(T),T=-1),f=!0;var V=v;try{for(g(Z),p=t(u);p!==null&&(!(p.expirationTime>Z)||Y&&!O());){var H=p.callback;if(typeof H=="function"){p.callback=null,v=p.priorityLevel;var U=H(p.expirationTime<=Z);Z=e.unstable_now(),typeof U=="function"?p.callback=U:p===t(u)&&n(u),g(Z)}else n(u);p=t(u)}if(p!==null)var D=!0;else{var $=t(c);$!==null&&W(S,$.startTime-Z),D=!1}return D}finally{p=null,v=V,f=!1}}var R=!1,L=null,T=-1,F=5,I=-1;function O(){return!(e.unstable_now()-I<F)}function C(){if(L!==null){var Y=e.unstable_now();I=Y;var Z=!0;try{Z=L(!0,Y)}finally{Z?A():(R=!1,L=null)}}else R=!1}var A;if(typeof y=="function")A=function(){y(C)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,N=j.port2;j.port1.onmessage=C,A=function(){N.postMessage(null)}}else A=function(){w(C,0)};function B(Y){L=Y,R||(R=!0,A())}function W(Y,Z){T=w(function(){Y(e.unstable_now())},Z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(Y){Y.callback=null},e.unstable_continueExecution=function(){_||f||(_=!0,B(b))},e.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<Y?Math.floor(1e3/Y):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return t(u)},e.unstable_next=function(Y){switch(v){case 1:case 2:case 3:var Z=3;break;default:Z=v}var V=v;v=Z;try{return Y()}finally{v=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Y,Z){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var V=v;v=Y;try{return Z()}finally{v=V}},e.unstable_scheduleCallback=function(Y,Z,V){var H=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?H+V:H):V=H,Y){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=V+U,Y={id:h++,callback:Z,priorityLevel:Y,startTime:V,expirationTime:U,sortIndex:-1},V>H?(Y.sortIndex=V,r(c,Y),t(u)===null&&Y===t(c)&&(E?(x(T),T=-1):E=!0,W(S,V-H))):(Y.sortIndex=U,r(u,Y),_||f||(_=!0,B(b))),Y},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(Y){var Z=v;return function(){var V=v;v=Z;try{return Y.apply(this,arguments)}finally{v=V}}}}(U0)),U0}var my;function B2(){return my||(my=1,z0.exports=i7()),z0.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 yy;function a7(){if(yy)return hs;yy=1;var e=ai(),r=B2();function t(l){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+l,k=1;k<arguments.length;k++)d+="&args[]="+encodeURIComponent(arguments[k]);return"Minified React error #"+l+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,a={};function i(l,d){o(l,d),o(l+"Capture",d)}function o(l,d){for(a[l]=d,l=0;l<d.length;l++)n.add(d[l])}var s=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,c=/^[: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]*$/,h={},p={};function v(l){return u.call(p,l)?!0:u.call(h,l)?!1:c.test(l)?p[l]=!0:(h[l]=!0,!1)}function f(l,d,k,z){if(k!==null&&k.type===0)return!1;switch(typeof d){case"function":case"symbol":return!0;case"boolean":return z?!1:k!==null?!k.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function _(l,d,k,z){if(d===null||typeof d>"u"||f(l,d,k,z))return!0;if(z)return!1;if(k!==null)switch(k.type){case 3:return!d;case 4:return d===!1;case 5:return isNaN(d);case 6:return isNaN(d)||1>d}return!1}function E(l,d,k,z,J,ie,pe){this.acceptsBooleans=d===2||d===3||d===4,this.attributeName=z,this.attributeNamespace=J,this.mustUseProperty=k,this.propertyName=l,this.type=d,this.sanitizeURL=ie,this.removeEmptyString=pe}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){w[l]=new E(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var d=l[0];w[d]=new E(d,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){w[l]=new E(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){w[l]=new E(l,2,!1,l,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(l){w[l]=new E(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){w[l]=new E(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){w[l]=new E(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){w[l]=new E(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){w[l]=new E(l,5,!1,l.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function y(l){return l[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(l){var d=l.replace(x,y);w[d]=new E(d,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var d=l.replace(x,y);w[d]=new E(d,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var d=l.replace(x,y);w[d]=new E(d,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){w[l]=new E(l,1,!1,l.toLowerCase(),null,!1,!1)}),w.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){w[l]=new E(l,1,!1,l.toLowerCase(),null,!0,!0)});function g(l,d,k,z){var J=w.hasOwnProperty(d)?w[d]:null;(J!==null?J.type!==0:z||!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(_(d,k,J,z)&&(k=null),z||J===null?v(d)&&(k===null?l.removeAttribute(d):l.setAttribute(d,""+k)):J.mustUseProperty?l[J.propertyName]=k===null?J.type===3?!1:"":k:(d=J.attributeName,z=J.attributeNamespace,k===null?l.removeAttribute(d):(J=J.type,k=J===3||J===4&&k===!0?"":""+k,z?l.setAttributeNS(z,d,k):l.setAttribute(d,k))))}var S=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,b=Symbol.for("react.element"),R=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),O=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),W=Symbol.for("react.offscreen"),Y=Symbol.iterator;function Z(l){return l===null||typeof l!="object"?null:(l=Y&&l[Y]||l["@@iterator"],typeof l=="function"?l:null)}var V=Object.assign,H;function U(l){if(H===void 0)try{throw Error()}catch(k){var d=k.stack.trim().match(/\n( *(at )?)/);H=d&&d[1]||""}return`
|
|
26
|
-
`+H+l}var D=!1;function $(l,d){if(!l||D)return"";D=!0;var k=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(d)if(d=function(){throw Error()},Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(ot){var z=ot}Reflect.construct(l,[],d)}else{try{d.call()}catch(ot){z=ot}l.call(d.prototype)}else{try{throw Error()}catch(ot){z=ot}l()}}catch(ot){if(ot&&z&&typeof ot.stack=="string"){for(var J=ot.stack.split(`
|
|
27
|
-
`),ie=z.stack.split(`
|
|
28
|
-
`),pe=J.length-1,Ne=ie.length-1;1<=pe&&0<=Ne&&J[pe]!==ie[Ne];)Ne--;for(;1<=pe&&0<=Ne;pe--,Ne--)if(J[pe]!==ie[Ne]){if(pe!==1||Ne!==1)do if(pe--,Ne--,0>Ne||J[pe]!==ie[Ne]){var Be=`
|
|
29
|
-
`+J[pe].replace(" at new "," at ");return l.displayName&&Be.includes("<anonymous>")&&(Be=Be.replace("<anonymous>",l.displayName)),Be}while(1<=pe&&0<=Ne);break}}}finally{D=!1,Error.prepareStackTrace=k}return(l=l?l.displayName||l.name:"")?U(l):""}function Q(l){switch(l.tag){case 5:return U(l.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return l=$(l.type,!1),l;case 11:return l=$(l.type.render,!1),l;case 1:return l=$(l.type,!0),l;default:return""}}function ee(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case L:return"Fragment";case R:return"Portal";case F:return"Profiler";case T:return"StrictMode";case A:return"Suspense";case j:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case O:return(l.displayName||"Context")+".Consumer";case I:return(l._context.displayName||"Context")+".Provider";case C:var d=l.render;return l=l.displayName,l||(l=d.displayName||d.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case N:return d=l.displayName||null,d!==null?d:ee(l.type)||"Memo";case B:d=l._payload,l=l._init;try{return ee(l(d))}catch{}}return null}function te(l){var d=l.type;switch(l.tag){case 24:return"Cache";case 9:return(d.displayName||"Context")+".Consumer";case 10:return(d._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=d.render,l=l.displayName||l.name||"",d.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return d;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ee(d);case 8:return d===T?"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 d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d}return null}function ae(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function se(l){var d=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function ce(l){var d=se(l)?"checked":"value",k=Object.getOwnPropertyDescriptor(l.constructor.prototype,d),z=""+l[d];if(!l.hasOwnProperty(d)&&typeof k<"u"&&typeof k.get=="function"&&typeof k.set=="function"){var J=k.get,ie=k.set;return Object.defineProperty(l,d,{configurable:!0,get:function(){return J.call(this)},set:function(pe){z=""+pe,ie.call(this,pe)}}),Object.defineProperty(l,d,{enumerable:k.enumerable}),{getValue:function(){return z},setValue:function(pe){z=""+pe},stopTracking:function(){l._valueTracker=null,delete l[d]}}}}function me(l){l._valueTracker||(l._valueTracker=ce(l))}function _e(l){if(!l)return!1;var d=l._valueTracker;if(!d)return!0;var k=d.getValue(),z="";return l&&(z=se(l)?l.checked?"true":"false":l.value),l=z,l!==k?(d.setValue(l),!0):!1}function Le(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Re(l,d){var k=d.checked;return V({},d,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:k??l._wrapperState.initialChecked})}function Pe(l,d){var k=d.defaultValue==null?"":d.defaultValue,z=d.checked!=null?d.checked:d.defaultChecked;k=ae(d.value!=null?d.value:k),l._wrapperState={initialChecked:z,initialValue:k,controlled:d.type==="checkbox"||d.type==="radio"?d.checked!=null:d.value!=null}}function ve(l,d){d=d.checked,d!=null&&g(l,"checked",d,!1)}function it(l,d){ve(l,d);var k=ae(d.value),z=d.type;if(k!=null)z==="number"?(k===0&&l.value===""||l.value!=k)&&(l.value=""+k):l.value!==""+k&&(l.value=""+k);else if(z==="submit"||z==="reset"){l.removeAttribute("value");return}d.hasOwnProperty("value")?be(l,d.type,k):d.hasOwnProperty("defaultValue")&&be(l,d.type,ae(d.defaultValue)),d.checked==null&&d.defaultChecked!=null&&(l.defaultChecked=!!d.defaultChecked)}function Se(l,d,k){if(d.hasOwnProperty("value")||d.hasOwnProperty("defaultValue")){var z=d.type;if(!(z!=="submit"&&z!=="reset"||d.value!==void 0&&d.value!==null))return;d=""+l._wrapperState.initialValue,k||d===l.value||(l.value=d),l.defaultValue=d}k=l.name,k!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,k!==""&&(l.name=k)}function be(l,d,k){(d!=="number"||Le(l.ownerDocument)!==l)&&(k==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+k&&(l.defaultValue=""+k))}var Ae=Array.isArray;function Te(l,d,k,z){if(l=l.options,d){d={};for(var J=0;J<k.length;J++)d["$"+k[J]]=!0;for(k=0;k<l.length;k++)J=d.hasOwnProperty("$"+l[k].value),l[k].selected!==J&&(l[k].selected=J),J&&z&&(l[k].defaultSelected=!0)}else{for(k=""+ae(k),d=null,J=0;J<l.length;J++){if(l[J].value===k){l[J].selected=!0,z&&(l[J].defaultSelected=!0);return}d!==null||l[J].disabled||(d=l[J])}d!==null&&(d.selected=!0)}}function he(l,d){if(d.dangerouslySetInnerHTML!=null)throw Error(t(91));return V({},d,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function Oe(l,d){var k=d.value;if(k==null){if(k=d.children,d=d.defaultValue,k!=null){if(d!=null)throw Error(t(92));if(Ae(k)){if(1<k.length)throw Error(t(93));k=k[0]}d=k}d==null&&(d=""),k=d}l._wrapperState={initialValue:ae(k)}}function Me(l,d){var k=ae(d.value),z=ae(d.defaultValue);k!=null&&(k=""+k,k!==l.value&&(l.value=k),d.defaultValue==null&&l.defaultValue!==k&&(l.defaultValue=k)),z!=null&&(l.defaultValue=""+z)}function ze(l){var d=l.textContent;d===l._wrapperState.initialValue&&d!==""&&d!==null&&(l.value=d)}function pt(l){switch(l){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 yt(l,d){return l==null||l==="http://www.w3.org/1999/xhtml"?pt(d):l==="http://www.w3.org/2000/svg"&&d==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var He,Qe=function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(d,k,z,J){MSApp.execUnsafeLocalFunction(function(){return l(d,k,z,J)})}:l}(function(l,d){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=d;else{for(He=He||document.createElement("div"),He.innerHTML="<svg>"+d.valueOf().toString()+"</svg>",d=He.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;d.firstChild;)l.appendChild(d.firstChild)}});function Ze(l,d){if(d){var k=l.firstChild;if(k&&k===l.lastChild&&k.nodeType===3){k.nodeValue=d;return}}l.textContent=d}var tt={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},Ht=["Webkit","ms","Moz","O"];Object.keys(tt).forEach(function(l){Ht.forEach(function(d){d=d+l.charAt(0).toUpperCase()+l.substring(1),tt[d]=tt[l]})});function Pt(l,d,k){return d==null||typeof d=="boolean"||d===""?"":k||typeof d!="number"||d===0||tt.hasOwnProperty(l)&&tt[l]?(""+d).trim():d+"px"}function It(l,d){l=l.style;for(var k in d)if(d.hasOwnProperty(k)){var z=k.indexOf("--")===0,J=Pt(k,d[k],z);k==="float"&&(k="cssFloat"),z?l.setProperty(k,J):l[k]=J}}var qt=V({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 Ie(l,d){if(d){if(qt[l]&&(d.children!=null||d.dangerouslySetInnerHTML!=null))throw Error(t(137,l));if(d.dangerouslySetInnerHTML!=null){if(d.children!=null)throw Error(t(60));if(typeof d.dangerouslySetInnerHTML!="object"||!("__html"in d.dangerouslySetInnerHTML))throw Error(t(61))}if(d.style!=null&&typeof d.style!="object")throw Error(t(62))}}function ke(l,d){if(l.indexOf("-")===-1)return typeof d.is=="string";switch(l){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 ut=null;function Nt(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var Ct=null,St=null,Jt=null;function nr(l){if(l=vu(l)){if(typeof Ct!="function")throw Error(t(280));var d=l.stateNode;d&&(d=_i(d),Ct(l.stateNode,l.type,d))}}function Tt(l){St?Jt?Jt.push(l):Jt=[l]:St=l}function Xt(){if(St){var l=St,d=Jt;if(Jt=St=null,nr(l),d)for(l=0;l<d.length;l++)nr(d[l])}}function Rr(l,d){return l(d)}function Je(){}var mt=!1;function Gt(l,d,k){if(mt)return l(d,k);mt=!0;try{return Rr(l,d,k)}finally{mt=!1,(St!==null||Jt!==null)&&(Je(),Xt())}}function bt(l,d){var k=l.stateNode;if(k===null)return null;var z=_i(k);if(z===null)return null;k=z[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(z=!z.disabled)||(l=l.type,z=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!z;break e;default:l=!1}if(l)return null;if(k&&typeof k!="function")throw Error(t(231,d,typeof k));return k}var Kt=!1;if(s)try{var Yt={};Object.defineProperty(Yt,"passive",{get:function(){Kt=!0}}),window.addEventListener("test",Yt,Yt),window.removeEventListener("test",Yt,Yt)}catch{Kt=!1}function ct(l,d,k,z,J,ie,pe,Ne,Be){var ot=Array.prototype.slice.call(arguments,3);try{d.apply(k,ot)}catch(At){this.onError(At)}}var _t=!1,xt=null,rt=!1,zt=null,gt={onError:function(l){_t=!0,xt=l}};function Ft(l,d,k,z,J,ie,pe,Ne,Be){_t=!1,xt=null,ct.apply(gt,arguments)}function br(l,d,k,z,J,ie,pe,Ne,Be){if(Ft.apply(this,arguments),_t){if(_t){var ot=xt;_t=!1,xt=null}else throw Error(t(198));rt||(rt=!0,zt=ot)}}function hr(l){var d=l,k=l;if(l.alternate)for(;d.return;)d=d.return;else{l=d;do d=l,(d.flags&4098)!==0&&(k=d.return),l=d.return;while(l)}return d.tag===3?k:null}function Qr(l){if(l.tag===13){var d=l.memoizedState;if(d===null&&(l=l.alternate,l!==null&&(d=l.memoizedState)),d!==null)return d.dehydrated}return null}function Sn(l){if(hr(l)!==l)throw Error(t(188))}function Ni(l){var d=l.alternate;if(!d){if(d=hr(l),d===null)throw Error(t(188));return d!==l?null:l}for(var k=l,z=d;;){var J=k.return;if(J===null)break;var ie=J.alternate;if(ie===null){if(z=J.return,z!==null){k=z;continue}break}if(J.child===ie.child){for(ie=J.child;ie;){if(ie===k)return Sn(J),l;if(ie===z)return Sn(J),d;ie=ie.sibling}throw Error(t(188))}if(k.return!==z.return)k=J,z=ie;else{for(var pe=!1,Ne=J.child;Ne;){if(Ne===k){pe=!0,k=J,z=ie;break}if(Ne===z){pe=!0,z=J,k=ie;break}Ne=Ne.sibling}if(!pe){for(Ne=ie.child;Ne;){if(Ne===k){pe=!0,k=ie,z=J;break}if(Ne===z){pe=!0,z=ie,k=J;break}Ne=Ne.sibling}if(!pe)throw Error(t(189))}}if(k.alternate!==z)throw Error(t(190))}if(k.tag!==3)throw Error(t(188));return k.stateNode.current===k?l:d}function Si(l){return l=Ni(l),l!==null?fa(l):null}function fa(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var d=fa(l);if(d!==null)return d;l=l.sibling}return null}var _s=r.unstable_scheduleCallback,Vo=r.unstable_cancelCallback,tu=r.unstable_shouldYield,mc=r.unstable_requestPaint,Fn=r.unstable_now,Bu=r.unstable_getCurrentPriorityLevel,oo=r.unstable_ImmediatePriority,dl=r.unstable_UserBlockingPriority,Gs=r.unstable_NormalPriority,qu=r.unstable_LowPriority,ru=r.unstable_IdlePriority,so=null,gi=null;function Jr(l){if(gi&&typeof gi.onCommitFiberRoot=="function")try{gi.onCommitFiberRoot(so,l,void 0,(l.current.flags&128)===128)}catch{}}var Nr=Math.clz32?Math.clz32:Ti,cn=Math.log,vi=Math.LN2;function Ti(l){return l>>>=0,l===0?32:31-(cn(l)/vi|0)|0}var Ia=64,ja=4194304;function oi(l){switch(l&-l){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 l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Ri(l,d){var k=l.pendingLanes;if(k===0)return 0;var z=0,J=l.suspendedLanes,ie=l.pingedLanes,pe=k&268435455;if(pe!==0){var Ne=pe&~J;Ne!==0?z=oi(Ne):(ie&=pe,ie!==0&&(z=oi(ie)))}else pe=k&~J,pe!==0?z=oi(pe):ie!==0&&(z=oi(ie));if(z===0)return 0;if(d!==0&&d!==z&&(d&J)===0&&(J=z&-z,ie=d&-d,J>=ie||J===16&&(ie&4194240)!==0))return d;if((z&4)!==0&&(z|=k&16),d=l.entangledLanes,d!==0)for(l=l.entanglements,d&=z;0<d;)k=31-Nr(d),J=1<<k,z|=l[k],d&=~J;return z}function pl(l,d){switch(l){case 1:case 2:case 4:return d+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 d+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 ha(l,d){for(var k=l.suspendedLanes,z=l.pingedLanes,J=l.expirationTimes,ie=l.pendingLanes;0<ie;){var pe=31-Nr(ie),Ne=1<<pe,Be=J[pe];Be===-1?((Ne&k)===0||(Ne&z)!==0)&&(J[pe]=pl(Ne,d)):Be<=d&&(l.expiredLanes|=Ne),ie&=~Ne}}function Wo(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function nu(){var l=Ia;return Ia<<=1,(Ia&4194240)===0&&(Ia=64),l}function da(l){for(var d=[],k=0;31>k;k++)d.push(l);return d}function Vs(l,d,k){l.pendingLanes|=d,d!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,d=31-Nr(d),l[d]=k}function af(l,d){var k=l.pendingLanes&~d;l.pendingLanes=d,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=d,l.mutableReadLanes&=d,l.entangledLanes&=d,d=l.entanglements;var z=l.eventTimes;for(l=l.expirationTimes;0<k;){var J=31-Nr(k),ie=1<<J;d[J]=0,z[J]=-1,l[J]=-1,k&=~ie}}function iu(l,d){var k=l.entangledLanes|=d;for(l=l.entanglements;k;){var z=31-Nr(k),J=1<<z;J&d|l[z]&d&&(l[z]|=d),k&=~J}}var Fr=0;function Ss(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var Ws,$s,yc,$o,xs,Es=!1,Ps=[],mn=null,Yo=null,Fa=null,Dt=new Map,Ys=new Map,lo=[],Oo="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 zu(l,d){switch(l){case"focusin":case"focusout":mn=null;break;case"dragenter":case"dragleave":Yo=null;break;case"mouseover":case"mouseout":Fa=null;break;case"pointerover":case"pointerout":Dt.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ys.delete(d.pointerId)}}function Xs(l,d,k,z,J,ie){return l===null||l.nativeEvent!==ie?(l={blockedOn:d,domEventName:k,eventSystemFlags:z,nativeEvent:ie,targetContainers:[J]},d!==null&&(d=vu(d),d!==null&&$s(d)),l):(l.eventSystemFlags|=z,d=l.targetContainers,J!==null&&d.indexOf(J)===-1&&d.push(J),l)}function Dn(l,d,k,z,J){switch(d){case"focusin":return mn=Xs(mn,l,d,k,z,J),!0;case"dragenter":return Yo=Xs(Yo,l,d,k,z,J),!0;case"mouseover":return Fa=Xs(Fa,l,d,k,z,J),!0;case"pointerover":var ie=J.pointerId;return Dt.set(ie,Xs(Dt.get(ie)||null,l,d,k,z,J)),!0;case"gotpointercapture":return ie=J.pointerId,Ys.set(ie,Xs(Ys.get(ie)||null,l,d,k,z,J)),!0}return!1}function Ks(l){var d=Ns(l.target);if(d!==null){var k=hr(d);if(k!==null){if(d=k.tag,d===13){if(d=Qr(k),d!==null){l.blockedOn=d,xs(l.priority,function(){yc(k)});return}}else if(d===3&&k.stateNode.current.memoizedState.isDehydrated){l.blockedOn=k.tag===3?k.stateNode.containerInfo:null;return}}}l.blockedOn=null}function au(l){if(l.blockedOn!==null)return!1;for(var d=l.targetContainers;0<d.length;){var k=gl(l.domEventName,l.eventSystemFlags,d[0],l.nativeEvent);if(k===null){k=l.nativeEvent;var z=new k.constructor(k.type,k);ut=z,k.target.dispatchEvent(z),ut=null}else return d=vu(k),d!==null&&$s(d),l.blockedOn=k,!1;d.shift()}return!0}function ou(l,d,k){au(l)&&k.delete(d)}function of(){Es=!1,mn!==null&&au(mn)&&(mn=null),Yo!==null&&au(Yo)&&(Yo=null),Fa!==null&&au(Fa)&&(Fa=null),Dt.forEach(ou),Ys.forEach(ou)}function uo(l,d){l.blockedOn===d&&(l.blockedOn=null,Es||(Es=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,of)))}function si(l){function d(J){return uo(J,l)}if(0<Ps.length){uo(Ps[0],l);for(var k=1;k<Ps.length;k++){var z=Ps[k];z.blockedOn===l&&(z.blockedOn=null)}}for(mn!==null&&uo(mn,l),Yo!==null&&uo(Yo,l),Fa!==null&&uo(Fa,l),Dt.forEach(d),Ys.forEach(d),k=0;k<lo.length;k++)z=lo[k],z.blockedOn===l&&(z.blockedOn=null);for(;0<lo.length&&(k=lo[0],k.blockedOn===null);)Ks(k),k.blockedOn===null&&lo.shift()}var Da=S.ReactCurrentBatchConfig,su=!0;function Mi(l,d,k,z){var J=Fr,ie=Da.transition;Da.transition=null;try{Fr=1,Ao(l,d,k,z)}finally{Fr=J,Da.transition=ie}}function Ba(l,d,k,z){var J=Fr,ie=Da.transition;Da.transition=null;try{Fr=4,Ao(l,d,k,z)}finally{Fr=J,Da.transition=ie}}function Ao(l,d,k,z){if(su){var J=gl(l,d,k,z);if(J===null)du(l,d,z,Os,k),zu(l,z);else if(Dn(J,l,d,k,z))z.stopPropagation();else if(zu(l,z),d&4&&-1<Oo.indexOf(l)){for(;J!==null;){var ie=vu(J);if(ie!==null&&Ws(ie),ie=gl(l,d,k,z),ie===null&&du(l,d,z,Os,k),ie===J)break;J=ie}J!==null&&z.stopPropagation()}else du(l,d,z,null,k)}}var Os=null;function gl(l,d,k,z){if(Os=null,l=Nt(z),l=Ns(l),l!==null)if(d=hr(l),d===null)l=null;else if(k=d.tag,k===13){if(l=Qr(d),l!==null)return l;l=null}else if(k===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;l=null}else d!==l&&(l=null);return Os=l,null}function Uu(l){switch(l){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(Bu()){case oo:return 1;case dl:return 4;case Gs:case qu:return 16;case ru:return 536870912;default:return 16}default:return 16}}var li=null,Ii=null,ji=null;function vl(){if(ji)return ji;var l,d=Ii,k=d.length,z,J="value"in li?li.value:li.textContent,ie=J.length;for(l=0;l<k&&d[l]===J[l];l++);var pe=k-l;for(z=1;z<=pe&&d[k-z]===J[ie-z];z++);return ji=J.slice(l,1<z?1-z:void 0)}function xa(l){var d=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&d===13&&(l=13)):l=d,l===10&&(l=13),32<=l||l===13?l:0}function xn(){return!0}function Fi(){return!1}function En(l){function d(k,z,J,ie,pe){this._reactName=k,this._targetInst=J,this.type=z,this.nativeEvent=ie,this.target=pe,this.currentTarget=null;for(var Ne in l)l.hasOwnProperty(Ne)&&(k=l[Ne],this[Ne]=k?k(ie):ie[Ne]);return this.isDefaultPrevented=(ie.defaultPrevented!=null?ie.defaultPrevented:ie.returnValue===!1)?xn:Fi,this.isPropagationStopped=Fi,this}return V(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var k=this.nativeEvent;k&&(k.preventDefault?k.preventDefault():typeof k.returnValue!="unknown"&&(k.returnValue=!1),this.isDefaultPrevented=xn)},stopPropagation:function(){var k=this.nativeEvent;k&&(k.stopPropagation?k.stopPropagation():typeof k.cancelBubble!="unknown"&&(k.cancelBubble=!0),this.isPropagationStopped=xn)},persist:function(){},isPersistent:xn}),d}var ea={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ta=En(ea),qa=V({},ea,{view:0,detail:0}),lu=En(qa),As,Zs,Xn,mi=V({},qa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ut,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==Xn&&(Xn&&l.type==="mousemove"?(As=l.screenX-Xn.screenX,Zs=l.screenY-Xn.screenY):Zs=As=0,Xn=l),As)},movementY:function(l){return"movementY"in l?l.movementY:Zs}}),nn=En(mi),Qs=V({},mi,{dataTransfer:0}),za=En(Qs),ml=V({},qa,{relatedTarget:0}),Xo=En(ml),yl=V({},ea,{animationName:0,elapsedTime:0,pseudoElement:0}),Ko=En(yl),uu=V({},ea,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),X=En(uu),fe=V({},ea,{data:0}),Ce=En(fe),Fe={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ke={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"},ht={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Et(l){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(l):(l=ht[l])?!!d[l]:!1}function Ut(){return Et}var sr=V({},qa,{key:function(l){if(l.key){var d=Fe[l.key]||l.key;if(d!=="Unidentified")return d}return l.type==="keypress"?(l=xa(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?Ke[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ut,charCode:function(l){return l.type==="keypress"?xa(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?xa(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),wr=En(sr),mr=V({},mi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Or=En(mr),Nn=V({},qa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ut}),Pn=En(Nn),Bn=V({},ea,{propertyName:0,elapsedTime:0,pseudoElement:0}),ei=En(Bn),ui=V({},mi,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),Ua=En(ui),Ea=[9,13,27,32],Pa=s&&"CompositionEvent"in window,Zo=null;s&&"documentMode"in document&&(Zo=document.documentMode);var Qo=s&&"TextEvent"in window&&!Zo,Di=s&&(!Pa||Zo&&8<Zo&&11>=Zo),Ha=" ",Js=!1;function bl(l,d){switch(l){case"keyup":return Ea.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ra(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var an=!1;function el(l,d){switch(l){case"compositionend":return ra(d);case"keypress":return d.which!==32?null:(Js=!0,Ha);case"textInput":return l=d.data,l===Ha&&Js?null:l;default:return null}}function wl(l,d){if(an)return l==="compositionend"||!Pa&&bl(l,d)?(l=vl(),ji=Ii=li=null,an=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return Di&&d.locale!=="ko"?null:d.data;default:return null}}var Oa={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 Ga(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d==="input"?!!Oa[l.type]:d==="textarea"}function xi(l,d,k,z){Tt(z),d=bc(d,"onChange"),0<d.length&&(k=new ta("onChange","change",null,k,z),l.push({event:k,listeners:d}))}var tl=null,co=null;function Hu(l){fu(l,0)}function yi(l){var d=fi(l);if(_e(d))return l}function Bi(l,d){if(l==="change")return d}var Cs=!1;if(s){var Co;if(s){var bi="oninput"in document;if(!bi){var Jo=document.createElement("div");Jo.setAttribute("oninput","return;"),bi=typeof Jo.oninput=="function"}Co=bi}else Co=!1;Cs=Co&&(!document.documentMode||9<document.documentMode)}function ci(){tl&&(tl.detachEvent("onpropertychange",qi),co=tl=null)}function qi(l){if(l.propertyName==="value"&&yi(co)){var d=[];xi(d,co,l,Nt(l)),Gt(Hu,d)}}function es(l,d,k){l==="focusin"?(ci(),tl=d,co=k,tl.attachEvent("onpropertychange",qi)):l==="focusout"&&ci()}function Xr(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return yi(co)}function fo(l,d){if(l==="click")return yi(d)}function rl(l,d){if(l==="input"||l==="change")return yi(d)}function ko(l,d){return l===d&&(l!==0||1/l===1/d)||l!==l&&d!==d}var Dr=typeof Object.is=="function"?Object.is:ko;function Lo(l,d){if(Dr(l,d))return!0;if(typeof l!="object"||l===null||typeof d!="object"||d===null)return!1;var k=Object.keys(l),z=Object.keys(d);if(k.length!==z.length)return!1;for(z=0;z<k.length;z++){var J=k[z];if(!u.call(d,J)||!Dr(l[J],d[J]))return!1}return!0}function Kn(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function Mr(l,d){var k=Kn(l);l=0;for(var z;k;){if(k.nodeType===3){if(z=l+k.textContent.length,l<=d&&z>=d)return{node:k,offset:d-l};l=z}e:{for(;k;){if(k.nextSibling){k=k.nextSibling;break e}k=k.parentNode}k=void 0}k=Kn(k)}}function On(l,d){return l&&d?l===d?!0:l&&l.nodeType===3?!1:d&&d.nodeType===3?On(l,d.parentNode):"contains"in l?l.contains(d):l.compareDocumentPosition?!!(l.compareDocumentPosition(d)&16):!1:!1}function Zn(){for(var l=window,d=Le();d instanceof l.HTMLIFrameElement;){try{var k=typeof d.contentWindow.location.href=="string"}catch{k=!1}if(k)l=d.contentWindow;else break;d=Le(l.document)}return d}function ts(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d&&(d==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||d==="textarea"||l.contentEditable==="true")}function No(l){var d=Zn(),k=l.focusedElem,z=l.selectionRange;if(d!==k&&k&&k.ownerDocument&&On(k.ownerDocument.documentElement,k)){if(z!==null&&ts(k)){if(d=z.start,l=z.end,l===void 0&&(l=d),"selectionStart"in k)k.selectionStart=d,k.selectionEnd=Math.min(l,k.value.length);else if(l=(d=k.ownerDocument||document)&&d.defaultView||window,l.getSelection){l=l.getSelection();var J=k.textContent.length,ie=Math.min(z.start,J);z=z.end===void 0?ie:Math.min(z.end,J),!l.extend&&ie>z&&(J=z,z=ie,ie=J),J=Mr(k,ie);var pe=Mr(k,z);J&&pe&&(l.rangeCount!==1||l.anchorNode!==J.node||l.anchorOffset!==J.offset||l.focusNode!==pe.node||l.focusOffset!==pe.offset)&&(d=d.createRange(),d.setStart(J.node,J.offset),l.removeAllRanges(),ie>z?(l.addRange(d),l.extend(pe.node,pe.offset)):(d.setEnd(pe.node,pe.offset),l.addRange(d)))}}for(d=[],l=k;l=l.parentNode;)l.nodeType===1&&d.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<d.length;k++)l=d[k],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var To=s&&"documentMode"in document&&11>=document.documentMode,Va=null,Tn=null,ho=null,Ro=!1;function Mo(l,d,k){var z=k.window===k?k.document:k.nodeType===9?k:k.ownerDocument;Ro||Va==null||Va!==Le(z)||(z=Va,"selectionStart"in z&&ts(z)?z={start:z.selectionStart,end:z.selectionEnd}:(z=(z.ownerDocument&&z.ownerDocument.defaultView||window).getSelection(),z={anchorNode:z.anchorNode,anchorOffset:z.anchorOffset,focusNode:z.focusNode,focusOffset:z.focusOffset}),ho&&Lo(ho,z)||(ho=z,z=bc(Tn,"onSelect"),0<z.length&&(d=new ta("onSelect","select",null,d,k),l.push({event:d,listeners:z}),d.target=Va)))}function zi(l,d){var k={};return k[l.toLowerCase()]=d.toLowerCase(),k["Webkit"+l]="webkit"+d,k["Moz"+l]="moz"+d,k}var fn={animationend:zi("Animation","AnimationEnd"),animationiteration:zi("Animation","AnimationIteration"),animationstart:zi("Animation","AnimationStart"),transitionend:zi("Transition","TransitionEnd")},Ei={},on={};s&&(on=document.createElement("div").style,"AnimationEvent"in window||(delete fn.animationend.animation,delete fn.animationiteration.animation,delete fn.animationstart.animation),"TransitionEvent"in window||delete fn.transitionend.transition);function Kr(l){if(Ei[l])return Ei[l];if(!fn[l])return l;var d=fn[l],k;for(k in d)if(d.hasOwnProperty(k)&&k in on)return Ei[l]=d[k];return l}var qn=Kr("animationend"),ti=Kr("animationiteration"),Io=Kr("animationstart"),_l=Kr("transitionend"),nl=new Map,cu="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 jo(l,d){nl.set(l,d),i(d,[l])}for(var Sl=0;Sl<cu.length;Sl++){var wi=cu[Sl],Wa=wi.toLowerCase(),xl=wi[0].toUpperCase()+wi.slice(1);jo(Wa,"on"+xl)}jo(qn,"onAnimationEnd"),jo(ti,"onAnimationIteration"),jo(Io,"onAnimationStart"),jo("dblclick","onDoubleClick"),jo("focusin","onFocus"),jo("focusout","onBlur"),jo(_l,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fo="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(" "),sf=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fo));function El(l,d,k){var z=l.type||"unknown-event";l.currentTarget=k,br(z,d,void 0,l),l.currentTarget=null}function fu(l,d){d=(d&4)!==0;for(var k=0;k<l.length;k++){var z=l[k],J=z.event;z=z.listeners;e:{var ie=void 0;if(d)for(var pe=z.length-1;0<=pe;pe--){var Ne=z[pe],Be=Ne.instance,ot=Ne.currentTarget;if(Ne=Ne.listener,Be!==ie&&J.isPropagationStopped())break e;El(J,Ne,ot),ie=Be}else for(pe=0;pe<z.length;pe++){if(Ne=z[pe],Be=Ne.instance,ot=Ne.currentTarget,Ne=Ne.listener,Be!==ie&&J.isPropagationStopped())break e;El(J,Ne,ot),ie=Be}}}if(rt)throw l=zt,rt=!1,zt=null,l}function hn(l,d){var k=d[pa];k===void 0&&(k=d[pa]=new Set);var z=l+"__bubble";k.has(z)||(hu(d,l,2,!1),k.add(z))}function Gu(l,d,k){var z=0;d&&(z|=4),hu(k,l,z,d)}var Pl="_reactListening"+Math.random().toString(36).slice(2);function ks(l){if(!l[Pl]){l[Pl]=!0,n.forEach(function(k){k!=="selectionchange"&&(sf.has(k)||Gu(k,!1,l),Gu(k,!0,l))});var d=l.nodeType===9?l:l.ownerDocument;d===null||d[Pl]||(d[Pl]=!0,Gu("selectionchange",!1,d))}}function hu(l,d,k,z){switch(Uu(d)){case 1:var J=Mi;break;case 4:J=Ba;break;default:J=Ao}k=J.bind(null,d,k,l),J=void 0,!Kt||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(J=!0),z?J!==void 0?l.addEventListener(d,k,{capture:!0,passive:J}):l.addEventListener(d,k,!0):J!==void 0?l.addEventListener(d,k,{passive:J}):l.addEventListener(d,k,!1)}function du(l,d,k,z,J){var ie=z;if((d&1)===0&&(d&2)===0&&z!==null)e:for(;;){if(z===null)return;var pe=z.tag;if(pe===3||pe===4){var Ne=z.stateNode.containerInfo;if(Ne===J||Ne.nodeType===8&&Ne.parentNode===J)break;if(pe===4)for(pe=z.return;pe!==null;){var Be=pe.tag;if((Be===3||Be===4)&&(Be=pe.stateNode.containerInfo,Be===J||Be.nodeType===8&&Be.parentNode===J))return;pe=pe.return}for(;Ne!==null;){if(pe=Ns(Ne),pe===null)return;if(Be=pe.tag,Be===5||Be===6){z=ie=pe;continue e}Ne=Ne.parentNode}}z=z.return}Gt(function(){var ot=ie,At=Nt(k),kt=[];e:{var Ot=nl.get(l);if(Ot!==void 0){var Zt=ta,ir=l;switch(l){case"keypress":if(xa(k)===0)break e;case"keydown":case"keyup":Zt=wr;break;case"focusin":ir="focus",Zt=Xo;break;case"focusout":ir="blur",Zt=Xo;break;case"beforeblur":case"afterblur":Zt=Xo;break;case"click":if(k.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Zt=nn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Zt=za;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Zt=Pn;break;case qn:case ti:case Io:Zt=Ko;break;case _l:Zt=ei;break;case"scroll":Zt=lu;break;case"wheel":Zt=Ua;break;case"copy":case"cut":case"paste":Zt=X;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Zt=Or}var ur=(d&4)!==0,Yi=!ur&&l==="scroll",et=ur?Ot!==null?Ot+"Capture":null:Ot;ur=[];for(var Ge=ot,nt;Ge!==null;){nt=Ge;var Rt=nt.stateNode;if(nt.tag===5&&Rt!==null&&(nt=Rt,et!==null&&(Rt=bt(Ge,et),Rt!=null&&ur.push(pu(Ge,Rt,nt)))),Yi)break;Ge=Ge.return}0<ur.length&&(Ot=new Zt(Ot,ir,null,k,At),kt.push({event:Ot,listeners:ur}))}}if((d&7)===0){e:{if(Ot=l==="mouseover"||l==="pointerover",Zt=l==="mouseout"||l==="pointerout",Ot&&k!==ut&&(ir=k.relatedTarget||k.fromElement)&&(Ns(ir)||ir[Gi]))break e;if((Zt||Ot)&&(Ot=At.window===At?At:(Ot=At.ownerDocument)?Ot.defaultView||Ot.parentWindow:window,Zt?(ir=k.relatedTarget||k.toElement,Zt=ot,ir=ir?Ns(ir):null,ir!==null&&(Yi=hr(ir),ir!==Yi||ir.tag!==5&&ir.tag!==6)&&(ir=null)):(Zt=null,ir=ot),Zt!==ir)){if(ur=nn,Rt="onMouseLeave",et="onMouseEnter",Ge="mouse",(l==="pointerout"||l==="pointerover")&&(ur=Or,Rt="onPointerLeave",et="onPointerEnter",Ge="pointer"),Yi=Zt==null?Ot:fi(Zt),nt=ir==null?Ot:fi(ir),Ot=new ur(Rt,Ge+"leave",Zt,k,At),Ot.target=Yi,Ot.relatedTarget=nt,Rt=null,Ns(At)===ot&&(ur=new ur(et,Ge+"enter",ir,k,At),ur.target=nt,ur.relatedTarget=Yi,Rt=ur),Yi=Rt,Zt&&ir)t:{for(ur=Zt,et=ir,Ge=0,nt=ur;nt;nt=il(nt))Ge++;for(nt=0,Rt=et;Rt;Rt=il(Rt))nt++;for(;0<Ge-nt;)ur=il(ur),Ge--;for(;0<nt-Ge;)et=il(et),nt--;for(;Ge--;){if(ur===et||et!==null&&ur===et.alternate)break t;ur=il(ur),et=il(et)}ur=null}else ur=null;Zt!==null&&Bf(kt,Ot,Zt,ur,!1),ir!==null&&Yi!==null&&Bf(kt,Yi,ir,ur,!0)}}e:{if(Ot=ot?fi(ot):window,Zt=Ot.nodeName&&Ot.nodeName.toLowerCase(),Zt==="select"||Zt==="input"&&Ot.type==="file")var cr=Bi;else if(Ga(Ot))if(Cs)cr=rl;else{cr=Xr;var pr=es}else(Zt=Ot.nodeName)&&Zt.toLowerCase()==="input"&&(Ot.type==="checkbox"||Ot.type==="radio")&&(cr=fo);if(cr&&(cr=cr(l,ot))){xi(kt,cr,k,At);break e}pr&&pr(l,Ot,ot),l==="focusout"&&(pr=Ot._wrapperState)&&pr.controlled&&Ot.type==="number"&&be(Ot,"number",Ot.value)}switch(pr=ot?fi(ot):window,l){case"focusin":(Ga(pr)||pr.contentEditable==="true")&&(Va=pr,Tn=ot,ho=null);break;case"focusout":ho=Tn=Va=null;break;case"mousedown":Ro=!0;break;case"contextmenu":case"mouseup":case"dragend":Ro=!1,Mo(kt,k,At);break;case"selectionchange":if(To)break;case"keydown":case"keyup":Mo(kt,k,At)}var gr;if(Pa)e:{switch(l){case"compositionstart":var Sr="onCompositionStart";break e;case"compositionend":Sr="onCompositionEnd";break e;case"compositionupdate":Sr="onCompositionUpdate";break e}Sr=void 0}else an?bl(l,k)&&(Sr="onCompositionEnd"):l==="keydown"&&k.keyCode===229&&(Sr="onCompositionStart");Sr&&(Di&&k.locale!=="ko"&&(an||Sr!=="onCompositionStart"?Sr==="onCompositionEnd"&&an&&(gr=vl()):(li=At,Ii="value"in li?li.value:li.textContent,an=!0)),pr=bc(ot,Sr),0<pr.length&&(Sr=new Ce(Sr,l,null,k,At),kt.push({event:Sr,listeners:pr}),gr?Sr.data=gr:(gr=ra(k),gr!==null&&(Sr.data=gr)))),(gr=Qo?el(l,k):wl(l,k))&&(ot=bc(ot,"onBeforeInput"),0<ot.length&&(At=new Ce("onBeforeInput","beforeinput",null,k,At),kt.push({event:At,listeners:ot}),At.data=gr))}fu(kt,d)})}function pu(l,d,k){return{instance:l,listener:d,currentTarget:k}}function bc(l,d){for(var k=d+"Capture",z=[];l!==null;){var J=l,ie=J.stateNode;J.tag===5&&ie!==null&&(J=ie,ie=bt(l,k),ie!=null&&z.unshift(pu(l,ie,J)),ie=bt(l,d),ie!=null&&z.push(pu(l,ie,J))),l=l.return}return z}function il(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function Bf(l,d,k,z,J){for(var ie=d._reactName,pe=[];k!==null&&k!==z;){var Ne=k,Be=Ne.alternate,ot=Ne.stateNode;if(Be!==null&&Be===z)break;Ne.tag===5&&ot!==null&&(Ne=ot,J?(Be=bt(k,ie),Be!=null&&pe.unshift(pu(k,Be,Ne))):J||(Be=bt(k,ie),Be!=null&&pe.push(pu(k,Be,Ne)))),k=k.return}pe.length!==0&&l.push({event:d,listeners:pe})}var qh=/\r\n?/g,qf=/\u0000|\uFFFD/g;function lf(l){return(typeof l=="string"?l:""+l).replace(qh,`
|
|
30
|
-
`).replace(qf,"")}function Vu(l,d,k){if(d=lf(d),lf(l)!==d&&k)throw Error(t(425))}function Ls(){}var Wu=null,Ol=null;function uf(l,d){return l==="textarea"||l==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var $a=typeof setTimeout=="function"?setTimeout:void 0,wc=typeof clearTimeout=="function"?clearTimeout:void 0,$u=typeof Promise=="function"?Promise:void 0,zf=typeof queueMicrotask=="function"?queueMicrotask:typeof $u<"u"?function(l){return $u.resolve(null).then(l).catch(Uf)}:$a;function Uf(l){setTimeout(function(){throw l})}function _c(l,d){var k=d,z=0;do{var J=k.nextSibling;if(l.removeChild(k),J&&J.nodeType===8)if(k=J.data,k==="/$"){if(z===0){l.removeChild(J),si(d);return}z--}else k!=="$"&&k!=="$?"&&k!=="$!"||z++;k=J}while(k);si(d)}function Ui(l){for(;l!=null;l=l.nextSibling){var d=l.nodeType;if(d===1||d===3)break;if(d===8){if(d=l.data,d==="$"||d==="$!"||d==="$?")break;if(d==="/$")return null}}return l}function Hi(l){l=l.previousSibling;for(var d=0;l;){if(l.nodeType===8){var k=l.data;if(k==="$"||k==="$!"||k==="$?"){if(d===0)return l;d--}else k==="/$"&&d++}l=l.previousSibling}return null}var na=Math.random().toString(36).slice(2),po="__reactFiber$"+na,gu="__reactProps$"+na,Gi="__reactContainer$"+na,pa="__reactEvents$"+na,Hf="__reactListeners$"+na,Gf="__reactHandles$"+na;function Ns(l){var d=l[po];if(d)return d;for(var k=l.parentNode;k;){if(d=k[Gi]||k[po]){if(k=d.alternate,d.child!==null||k!==null&&k.child!==null)for(l=Hi(l);l!==null;){if(k=l[po])return k;l=Hi(l)}return d}l=k,k=l.parentNode}return null}function vu(l){return l=l[po]||l[Gi],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function fi(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(t(33))}function _i(l){return l[gu]||null}var Sc=[],rs=-1;function go(l){return{current:l}}function en(l){0>rs||(l.current=Sc[rs],Sc[rs]=null,rs--)}function sn(l,d){rs++,Sc[rs]=l.current,l.current=d}var ns={},Pi=go(ns),ia=go(!1),al=ns;function Al(l,d){var k=l.type.contextTypes;if(!k)return ns;var z=l.stateNode;if(z&&z.__reactInternalMemoizedUnmaskedChildContext===d)return z.__reactInternalMemoizedMaskedChildContext;var J={},ie;for(ie in k)J[ie]=d[ie];return z&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=d,l.__reactInternalMemoizedMaskedChildContext=J),J}function aa(l){return l=l.childContextTypes,l!=null}function mu(){en(ia),en(Pi)}function cf(l,d,k){if(Pi.current!==ns)throw Error(t(168));sn(Pi,d),sn(ia,k)}function Yu(l,d,k){var z=l.stateNode;if(d=d.childContextTypes,typeof z.getChildContext!="function")return k;z=z.getChildContext();for(var J in z)if(!(J in d))throw Error(t(108,te(l)||"Unknown",J));return V({},k,z)}function is(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||ns,al=Pi.current,sn(Pi,l),sn(ia,ia.current),!0}function Vf(l,d,k){var z=l.stateNode;if(!z)throw Error(t(169));k?(l=Yu(l,d,al),z.__reactInternalMemoizedMergedChildContext=l,en(ia),en(Pi),sn(Pi,l)):en(ia),sn(ia,k)}var as=null,Cl=!1,M=!1;function G(l){as===null?as=[l]:as.push(l)}function re(l){Cl=!0,G(l)}function oe(){if(!M&&as!==null){M=!0;var l=0,d=Fr;try{var k=as;for(Fr=1;l<k.length;l++){var z=k[l];do z=z(!0);while(z!==null)}as=null,Cl=!1}catch(J){throw as!==null&&(as=as.slice(l+1)),_s(oo,oe),J}finally{Fr=d,M=!1}}return null}var ue=[],de=0,ge=null,ye=0,we=[],Ee=0,De=null,Xe=1,We="";function Ve(l,d){ue[de++]=ye,ue[de++]=ge,ge=l,ye=d}function wt(l,d,k){we[Ee++]=Xe,we[Ee++]=We,we[Ee++]=De,De=l;var z=Xe;l=We;var J=32-Nr(z)-1;z&=~(1<<J),k+=1;var ie=32-Nr(d)+J;if(30<ie){var pe=J-J%5;ie=(z&(1<<pe)-1).toString(32),z>>=pe,J-=pe,Xe=1<<32-Nr(d)+J|k<<J|z,We=ie+l}else Xe=1<<ie|k<<J|z,We=l}function st(l){l.return!==null&&(Ve(l,1),wt(l,1,0))}function je(l){for(;l===ge;)ge=ue[--de],ue[de]=null,ye=ue[--de],ue[de]=null;for(;l===De;)De=we[--Ee],we[Ee]=null,We=we[--Ee],we[Ee]=null,Xe=we[--Ee],we[Ee]=null}var qe=null,Ue=null,ft=!1,vt=null;function Vt(l,d){var k=ul(5,null,null,0);k.elementType="DELETED",k.stateNode=d,k.return=l,d=l.deletions,d===null?(l.deletions=[k],l.flags|=16):d.push(k)}function Bt(l,d){switch(l.tag){case 5:var k=l.type;return d=d.nodeType!==1||k.toLowerCase()!==d.nodeName.toLowerCase()?null:d,d!==null?(l.stateNode=d,qe=l,Ue=Ui(d.firstChild),!0):!1;case 6:return d=l.pendingProps===""||d.nodeType!==3?null:d,d!==null?(l.stateNode=d,qe=l,Ue=null,!0):!1;case 13:return d=d.nodeType!==8?null:d,d!==null?(k=De!==null?{id:Xe,overflow:We}:null,l.memoizedState={dehydrated:d,treeContext:k,retryLane:1073741824},k=ul(18,null,null,0),k.stateNode=d,k.return=l,l.child=k,qe=l,Ue=null,!0):!1;default:return!1}}function lr(l){return(l.mode&1)!==0&&(l.flags&128)===0}function jt(l){if(ft){var d=Ue;if(d){var k=d;if(!Bt(l,d)){if(lr(l))throw Error(t(418));d=Ui(k.nextSibling);var z=qe;d&&Bt(l,d)?Vt(z,k):(l.flags=l.flags&-4097|2,ft=!1,qe=l)}}else{if(lr(l))throw Error(t(418));l.flags=l.flags&-4097|2,ft=!1,qe=l}}}function Br(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;qe=l}function Ur(l){if(l!==qe)return!1;if(!ft)return Br(l),ft=!0,!1;var d;if((d=l.tag!==3)&&!(d=l.tag!==5)&&(d=l.type,d=d!=="head"&&d!=="body"&&!uf(l.type,l.memoizedProps)),d&&(d=Ue)){if(lr(l))throw Ir(),Error(t(418));for(;d;)Vt(l,d),d=Ui(d.nextSibling)}if(Br(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(t(317));e:{for(l=l.nextSibling,d=0;l;){if(l.nodeType===8){var k=l.data;if(k==="/$"){if(d===0){Ue=Ui(l.nextSibling);break e}d--}else k!=="$"&&k!=="$!"&&k!=="$?"||d++}l=l.nextSibling}Ue=null}}else Ue=qe?Ui(l.stateNode.nextSibling):null;return!0}function Ir(){for(var l=Ue;l;)l=Ui(l.nextSibling)}function xr(){Ue=qe=null,ft=!1}function Zr(l){vt===null?vt=[l]:vt.push(l)}var tn=S.ReactCurrentBatchConfig;function tr(l,d,k){if(l=k.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(k._owner){if(k=k._owner,k){if(k.tag!==1)throw Error(t(309));var z=k.stateNode}if(!z)throw Error(t(147,l));var J=z,ie=""+l;return d!==null&&d.ref!==null&&typeof d.ref=="function"&&d.ref._stringRef===ie?d.ref:(d=function(pe){var Ne=J.refs;pe===null?delete Ne[ie]:Ne[ie]=pe},d._stringRef=ie,d)}if(typeof l!="string")throw Error(t(284));if(!k._owner)throw Error(t(290,l))}return l}function Hr(l,d){throw l=Object.prototype.toString.call(d),Error(t(31,l==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":l))}function Rn(l){var d=l._init;return d(l._payload)}function zn(l){function d(et,Ge){if(l){var nt=et.deletions;nt===null?(et.deletions=[Ge],et.flags|=16):nt.push(Ge)}}function k(et,Ge){if(!l)return null;for(;Ge!==null;)d(et,Ge),Ge=Ge.sibling;return null}function z(et,Ge){for(et=new Map;Ge!==null;)Ge.key!==null?et.set(Ge.key,Ge):et.set(Ge.index,Ge),Ge=Ge.sibling;return et}function J(et,Ge){return et=jc(et,Ge),et.index=0,et.sibling=null,et}function ie(et,Ge,nt){return et.index=nt,l?(nt=et.alternate,nt!==null?(nt=nt.index,nt<Ge?(et.flags|=2,Ge):nt):(et.flags|=2,Ge)):(et.flags|=1048576,Ge)}function pe(et){return l&&et.alternate===null&&(et.flags|=2),et}function Ne(et,Ge,nt,Rt){return Ge===null||Ge.tag!==6?(Ge=R0(nt,et.mode,Rt),Ge.return=et,Ge):(Ge=J(Ge,nt),Ge.return=et,Ge)}function Be(et,Ge,nt,Rt){var cr=nt.type;return cr===L?At(et,Ge,nt.props.children,Rt,nt.key):Ge!==null&&(Ge.elementType===cr||typeof cr=="object"&&cr!==null&&cr.$$typeof===B&&Rn(cr)===Ge.type)?(Rt=J(Ge,nt.props),Rt.ref=tr(et,Ge,nt),Rt.return=et,Rt):(Rt=Yp(nt.type,nt.key,nt.props,null,et.mode,Rt),Rt.ref=tr(et,Ge,nt),Rt.return=et,Rt)}function ot(et,Ge,nt,Rt){return Ge===null||Ge.tag!==4||Ge.stateNode.containerInfo!==nt.containerInfo||Ge.stateNode.implementation!==nt.implementation?(Ge=M0(nt,et.mode,Rt),Ge.return=et,Ge):(Ge=J(Ge,nt.children||[]),Ge.return=et,Ge)}function At(et,Ge,nt,Rt,cr){return Ge===null||Ge.tag!==7?(Ge=mf(nt,et.mode,Rt,cr),Ge.return=et,Ge):(Ge=J(Ge,nt),Ge.return=et,Ge)}function kt(et,Ge,nt){if(typeof Ge=="string"&&Ge!==""||typeof Ge=="number")return Ge=R0(""+Ge,et.mode,nt),Ge.return=et,Ge;if(typeof Ge=="object"&&Ge!==null){switch(Ge.$$typeof){case b:return nt=Yp(Ge.type,Ge.key,Ge.props,null,et.mode,nt),nt.ref=tr(et,null,Ge),nt.return=et,nt;case R:return Ge=M0(Ge,et.mode,nt),Ge.return=et,Ge;case B:var Rt=Ge._init;return kt(et,Rt(Ge._payload),nt)}if(Ae(Ge)||Z(Ge))return Ge=mf(Ge,et.mode,nt,null),Ge.return=et,Ge;Hr(et,Ge)}return null}function Ot(et,Ge,nt,Rt){var cr=Ge!==null?Ge.key:null;if(typeof nt=="string"&&nt!==""||typeof nt=="number")return cr!==null?null:Ne(et,Ge,""+nt,Rt);if(typeof nt=="object"&&nt!==null){switch(nt.$$typeof){case b:return nt.key===cr?Be(et,Ge,nt,Rt):null;case R:return nt.key===cr?ot(et,Ge,nt,Rt):null;case B:return cr=nt._init,Ot(et,Ge,cr(nt._payload),Rt)}if(Ae(nt)||Z(nt))return cr!==null?null:At(et,Ge,nt,Rt,null);Hr(et,nt)}return null}function Zt(et,Ge,nt,Rt,cr){if(typeof Rt=="string"&&Rt!==""||typeof Rt=="number")return et=et.get(nt)||null,Ne(Ge,et,""+Rt,cr);if(typeof Rt=="object"&&Rt!==null){switch(Rt.$$typeof){case b:return et=et.get(Rt.key===null?nt:Rt.key)||null,Be(Ge,et,Rt,cr);case R:return et=et.get(Rt.key===null?nt:Rt.key)||null,ot(Ge,et,Rt,cr);case B:var pr=Rt._init;return Zt(et,Ge,nt,pr(Rt._payload),cr)}if(Ae(Rt)||Z(Rt))return et=et.get(nt)||null,At(Ge,et,Rt,cr,null);Hr(Ge,Rt)}return null}function ir(et,Ge,nt,Rt){for(var cr=null,pr=null,gr=Ge,Sr=Ge=0,Na=null;gr!==null&&Sr<nt.length;Sr++){gr.index>Sr?(Na=gr,gr=null):Na=gr.sibling;var gn=Ot(et,gr,nt[Sr],Rt);if(gn===null){gr===null&&(gr=Na);break}l&&gr&&gn.alternate===null&&d(et,gr),Ge=ie(gn,Ge,Sr),pr===null?cr=gn:pr.sibling=gn,pr=gn,gr=Na}if(Sr===nt.length)return k(et,gr),ft&&Ve(et,Sr),cr;if(gr===null){for(;Sr<nt.length;Sr++)gr=kt(et,nt[Sr],Rt),gr!==null&&(Ge=ie(gr,Ge,Sr),pr===null?cr=gr:pr.sibling=gr,pr=gr);return ft&&Ve(et,Sr),cr}for(gr=z(et,gr);Sr<nt.length;Sr++)Na=Zt(gr,et,Sr,nt[Sr],Rt),Na!==null&&(l&&Na.alternate!==null&&gr.delete(Na.key===null?Sr:Na.key),Ge=ie(Na,Ge,Sr),pr===null?cr=Na:pr.sibling=Na,pr=Na);return l&&gr.forEach(function(Fc){return d(et,Fc)}),ft&&Ve(et,Sr),cr}function ur(et,Ge,nt,Rt){var cr=Z(nt);if(typeof cr!="function")throw Error(t(150));if(nt=cr.call(nt),nt==null)throw Error(t(151));for(var pr=cr=null,gr=Ge,Sr=Ge=0,Na=null,gn=nt.next();gr!==null&&!gn.done;Sr++,gn=nt.next()){gr.index>Sr?(Na=gr,gr=null):Na=gr.sibling;var Fc=Ot(et,gr,gn.value,Rt);if(Fc===null){gr===null&&(gr=Na);break}l&&gr&&Fc.alternate===null&&d(et,gr),Ge=ie(Fc,Ge,Sr),pr===null?cr=Fc:pr.sibling=Fc,pr=Fc,gr=Na}if(gn.done)return k(et,gr),ft&&Ve(et,Sr),cr;if(gr===null){for(;!gn.done;Sr++,gn=nt.next())gn=kt(et,gn.value,Rt),gn!==null&&(Ge=ie(gn,Ge,Sr),pr===null?cr=gn:pr.sibling=gn,pr=gn);return ft&&Ve(et,Sr),cr}for(gr=z(et,gr);!gn.done;Sr++,gn=nt.next())gn=Zt(gr,et,Sr,gn.value,Rt),gn!==null&&(l&&gn.alternate!==null&&gr.delete(gn.key===null?Sr:gn.key),Ge=ie(gn,Ge,Sr),pr===null?cr=gn:pr.sibling=gn,pr=gn);return l&&gr.forEach(function(r7){return d(et,r7)}),ft&&Ve(et,Sr),cr}function Yi(et,Ge,nt,Rt){if(typeof nt=="object"&&nt!==null&&nt.type===L&&nt.key===null&&(nt=nt.props.children),typeof nt=="object"&&nt!==null){switch(nt.$$typeof){case b:e:{for(var cr=nt.key,pr=Ge;pr!==null;){if(pr.key===cr){if(cr=nt.type,cr===L){if(pr.tag===7){k(et,pr.sibling),Ge=J(pr,nt.props.children),Ge.return=et,et=Ge;break e}}else if(pr.elementType===cr||typeof cr=="object"&&cr!==null&&cr.$$typeof===B&&Rn(cr)===pr.type){k(et,pr.sibling),Ge=J(pr,nt.props),Ge.ref=tr(et,pr,nt),Ge.return=et,et=Ge;break e}k(et,pr);break}else d(et,pr);pr=pr.sibling}nt.type===L?(Ge=mf(nt.props.children,et.mode,Rt,nt.key),Ge.return=et,et=Ge):(Rt=Yp(nt.type,nt.key,nt.props,null,et.mode,Rt),Rt.ref=tr(et,Ge,nt),Rt.return=et,et=Rt)}return pe(et);case R:e:{for(pr=nt.key;Ge!==null;){if(Ge.key===pr)if(Ge.tag===4&&Ge.stateNode.containerInfo===nt.containerInfo&&Ge.stateNode.implementation===nt.implementation){k(et,Ge.sibling),Ge=J(Ge,nt.children||[]),Ge.return=et,et=Ge;break e}else{k(et,Ge);break}else d(et,Ge);Ge=Ge.sibling}Ge=M0(nt,et.mode,Rt),Ge.return=et,et=Ge}return pe(et);case B:return pr=nt._init,Yi(et,Ge,pr(nt._payload),Rt)}if(Ae(nt))return ir(et,Ge,nt,Rt);if(Z(nt))return ur(et,Ge,nt,Rt);Hr(et,nt)}return typeof nt=="string"&&nt!==""||typeof nt=="number"?(nt=""+nt,Ge!==null&&Ge.tag===6?(k(et,Ge.sibling),Ge=J(Ge,nt),Ge.return=et,et=Ge):(k(et,Ge),Ge=R0(nt,et.mode,Rt),Ge.return=et,et=Ge),pe(et)):k(et,Ge)}return Yi}var hi=zn(!0),Ar=zn(!1),Vi=go(null),An=null,Un=null,di=null;function Oi(){di=Un=An=null}function ga(l){var d=Vi.current;en(Vi),l._currentValue=d}function Ya(l,d,k){for(;l!==null;){var z=l.alternate;if((l.childLanes&d)!==d?(l.childLanes|=d,z!==null&&(z.childLanes|=d)):z!==null&&(z.childLanes&d)!==d&&(z.childLanes|=d),l===k)break;l=l.return}}function wn(l,d){An=l,di=Un=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&d)!==0&&(le=!0),l.firstContext=null)}function Hn(l){var d=l._currentValue;if(di!==l)if(l={context:l,memoizedValue:d,next:null},Un===null){if(An===null)throw Error(t(308));Un=l,An.dependencies={lanes:0,firstContext:l}}else Un=Un.next=l;return d}var oa=null;function Do(l){oa===null?oa=[l]:oa.push(l)}function vo(l,d,k,z){var J=d.interleaved;return J===null?(k.next=k,Do(d)):(k.next=J.next,J.next=k),d.interleaved=k,qr(l,z)}function qr(l,d){l.lanes|=d;var k=l.alternate;for(k!==null&&(k.lanes|=d),k=l,l=l.return;l!==null;)l.childLanes|=d,k=l.alternate,k!==null&&(k.childLanes|=d),k=l,l=l.return;return k.tag===3?k.stateNode:null}var mo=!1;function yu(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xu(l,d){l=l.updateQueue,d.updateQueue===l&&(d.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function Xa(l,d){return{eventTime:l,lane:d,tag:0,payload:null,callback:null,next:null}}function Aa(l,d,k){var z=l.updateQueue;if(z===null)return null;if(z=z.shared,(un&2)!==0){var J=z.pending;return J===null?d.next=d:(d.next=J.next,J.next=d),z.pending=d,qr(l,k)}return J=z.interleaved,J===null?(d.next=d,Do(z)):(d.next=J.next,J.next=d),z.interleaved=d,qr(l,k)}function kl(l,d,k){if(d=d.updateQueue,d!==null&&(d=d.shared,(k&4194240)!==0)){var z=d.lanes;z&=l.pendingLanes,k|=z,d.lanes=k,iu(l,k)}}function va(l,d){var k=l.updateQueue,z=l.alternate;if(z!==null&&(z=z.updateQueue,k===z)){var J=null,ie=null;if(k=k.firstBaseUpdate,k!==null){do{var pe={eventTime:k.eventTime,lane:k.lane,tag:k.tag,payload:k.payload,callback:k.callback,next:null};ie===null?J=ie=pe:ie=ie.next=pe,k=k.next}while(k!==null);ie===null?J=ie=d:ie=ie.next=d}else J=ie=d;k={baseState:z.baseState,firstBaseUpdate:J,lastBaseUpdate:ie,shared:z.shared,effects:z.effects},l.updateQueue=k;return}l=k.lastBaseUpdate,l===null?k.firstBaseUpdate=d:l.next=d,k.lastBaseUpdate=d}function Bo(l,d,k,z){var J=l.updateQueue;mo=!1;var ie=J.firstBaseUpdate,pe=J.lastBaseUpdate,Ne=J.shared.pending;if(Ne!==null){J.shared.pending=null;var Be=Ne,ot=Be.next;Be.next=null,pe===null?ie=ot:pe.next=ot,pe=Be;var At=l.alternate;At!==null&&(At=At.updateQueue,Ne=At.lastBaseUpdate,Ne!==pe&&(Ne===null?At.firstBaseUpdate=ot:Ne.next=ot,At.lastBaseUpdate=Be))}if(ie!==null){var kt=J.baseState;pe=0,At=ot=Be=null,Ne=ie;do{var Ot=Ne.lane,Zt=Ne.eventTime;if((z&Ot)===Ot){At!==null&&(At=At.next={eventTime:Zt,lane:0,tag:Ne.tag,payload:Ne.payload,callback:Ne.callback,next:null});e:{var ir=l,ur=Ne;switch(Ot=d,Zt=k,ur.tag){case 1:if(ir=ur.payload,typeof ir=="function"){kt=ir.call(Zt,kt,Ot);break e}kt=ir;break e;case 3:ir.flags=ir.flags&-65537|128;case 0:if(ir=ur.payload,Ot=typeof ir=="function"?ir.call(Zt,kt,Ot):ir,Ot==null)break e;kt=V({},kt,Ot);break e;case 2:mo=!0}}Ne.callback!==null&&Ne.lane!==0&&(l.flags|=64,Ot=J.effects,Ot===null?J.effects=[Ne]:Ot.push(Ne))}else Zt={eventTime:Zt,lane:Ot,tag:Ne.tag,payload:Ne.payload,callback:Ne.callback,next:null},At===null?(ot=At=Zt,Be=kt):At=At.next=Zt,pe|=Ot;if(Ne=Ne.next,Ne===null){if(Ne=J.shared.pending,Ne===null)break;Ot=Ne,Ne=Ot.next,Ot.next=null,J.lastBaseUpdate=Ot,J.shared.pending=null}}while(!0);if(At===null&&(Be=kt),J.baseState=Be,J.firstBaseUpdate=ot,J.lastBaseUpdate=At,d=J.shared.interleaved,d!==null){J=d;do pe|=J.lane,J=J.next;while(J!==d)}else ie===null&&(J.shared.lanes=0);df|=pe,l.lanes=pe,l.memoizedState=kt}}function yn(l,d,k){if(l=d.effects,d.effects=null,l!==null)for(d=0;d<l.length;d++){var z=l[d],J=z.callback;if(J!==null){if(z.callback=null,z=k,typeof J!="function")throw Error(t(191,J));J.call(z)}}}var _r={},rn=go(_r),Cn=go(_r),Mn=go(_r);function ri(l){if(l===_r)throw Error(t(174));return l}function qo(l,d){switch(sn(Mn,d),sn(Cn,l),sn(rn,_r),l=d.nodeType,l){case 9:case 11:d=(d=d.documentElement)?d.namespaceURI:yt(null,"");break;default:l=l===8?d.parentNode:d,d=l.namespaceURI||null,l=l.tagName,d=yt(d,l)}en(rn),sn(rn,d)}function dn(){en(rn),en(Cn),en(Mn)}function bu(l){ri(Mn.current);var d=ri(rn.current),k=yt(d,l.type);d!==k&&(sn(Cn,l),sn(rn,k))}function Ts(l){Cn.current===l&&(en(rn),en(Cn))}var pn=go(0);function Ka(l){for(var d=l;d!==null;){if(d.tag===13){var k=d.memoizedState;if(k!==null&&(k=k.dehydrated,k===null||k.data==="$?"||k.data==="$!"))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var Ll=[];function sa(){for(var l=0;l<Ll.length;l++)Ll[l]._workInProgressVersionPrimary=null;Ll.length=0}var wu=S.ReactCurrentDispatcher,_u=S.ReactCurrentBatchConfig,Ai=0,ln=null,Gn=null,Vn=null,Za=!1,yo=!1,Qa=0,xc=0;function Wn(){throw Error(t(321))}function Su(l,d){if(d===null)return!1;for(var k=0;k<d.length&&k<l.length;k++)if(!Dr(l[k],d[k]))return!1;return!0}function ol(l,d,k,z,J,ie){if(Ai=ie,ln=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,wu.current=l===null||l.memoizedState===null?p0:Eu,l=k(z,J),yo){ie=0;do{if(yo=!1,Qa=0,25<=ie)throw Error(t(301));ie+=1,Vn=Gn=null,d.updateQueue=null,wu.current=$f,l=k(z,J)}while(yo)}if(wu.current=Ac,d=Gn!==null&&Gn.next!==null,Ai=0,Vn=Gn=ln=null,Za=!1,d)throw Error(t(300));return l}function Ja(){var l=Qa!==0;return Qa=0,l}function _n(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vn===null?ln.memoizedState=Vn=l:Vn=Vn.next=l,Vn}function pi(){if(Gn===null){var l=ln.alternate;l=l!==null?l.memoizedState:null}else l=Gn.next;var d=Vn===null?ln.memoizedState:Vn.next;if(d!==null)Vn=d,Gn=l;else{if(l===null)throw Error(t(310));Gn=l,l={memoizedState:Gn.memoizedState,baseState:Gn.baseState,baseQueue:Gn.baseQueue,queue:Gn.queue,next:null},Vn===null?ln.memoizedState=Vn=l:Vn=Vn.next=l}return Vn}function la(l,d){return typeof d=="function"?d(l):d}function Wi(l){var d=pi(),k=d.queue;if(k===null)throw Error(t(311));k.lastRenderedReducer=l;var z=Gn,J=z.baseQueue,ie=k.pending;if(ie!==null){if(J!==null){var pe=J.next;J.next=ie.next,ie.next=pe}z.baseQueue=J=ie,k.pending=null}if(J!==null){ie=J.next,z=z.baseState;var Ne=pe=null,Be=null,ot=ie;do{var At=ot.lane;if((Ai&At)===At)Be!==null&&(Be=Be.next={lane:0,action:ot.action,hasEagerState:ot.hasEagerState,eagerState:ot.eagerState,next:null}),z=ot.hasEagerState?ot.eagerState:l(z,ot.action);else{var kt={lane:At,action:ot.action,hasEagerState:ot.hasEagerState,eagerState:ot.eagerState,next:null};Be===null?(Ne=Be=kt,pe=z):Be=Be.next=kt,ln.lanes|=At,df|=At}ot=ot.next}while(ot!==null&&ot!==ie);Be===null?pe=z:Be.next=Ne,Dr(z,d.memoizedState)||(le=!0),d.memoizedState=z,d.baseState=pe,d.baseQueue=Be,k.lastRenderedState=z}if(l=k.interleaved,l!==null){J=l;do ie=J.lane,ln.lanes|=ie,df|=ie,J=J.next;while(J!==l)}else J===null&&(k.lanes=0);return[d.memoizedState,k.dispatch]}function Rs(l){var d=pi(),k=d.queue;if(k===null)throw Error(t(311));k.lastRenderedReducer=l;var z=k.dispatch,J=k.pending,ie=d.memoizedState;if(J!==null){k.pending=null;var pe=J=J.next;do ie=l(ie,pe.action),pe=pe.next;while(pe!==J);Dr(ie,d.memoizedState)||(le=!0),d.memoizedState=ie,d.baseQueue===null&&(d.baseState=ie),k.lastRenderedState=ie}return[ie,z]}function Ec(){}function Ku(l,d){var k=ln,z=pi(),J=d(),ie=!Dr(z.memoizedState,J);if(ie&&(z.memoizedState=J,le=!0),z=z.queue,Oc(ff.bind(null,k,z,l),[l]),z.getSnapshot!==d||ie||Vn!==null&&Vn.memoizedState.tag&1){if(k.flags|=2048,Ca(9,os.bind(null,k,z,J,d),void 0,null),La===null)throw Error(t(349));(Ai&30)!==0||Wf(k,d,J)}return J}function Wf(l,d,k){l.flags|=16384,l={getSnapshot:d,value:k},d=ln.updateQueue,d===null?(d={lastEffect:null,stores:null},ln.updateQueue=d,d.stores=[l]):(k=d.stores,k===null?d.stores=[l]:k.push(l))}function os(l,d,k,z){d.value=k,d.getSnapshot=z,Nl(d)&&xu(l)}function ff(l,d,k){return k(function(){Nl(d)&&xu(l)})}function Nl(l){var d=l.getSnapshot;l=l.value;try{var k=d();return!Dr(l,k)}catch{return!0}}function xu(l){var d=qr(l,1);d!==null&&Il(d,l,1,-1)}function zo(l){var d=_n();return typeof l=="function"&&(l=l()),d.memoizedState=d.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:l},d.queue=l,l=l.dispatch=Mp.bind(null,ln,l),[d.memoizedState,l]}function Ca(l,d,k,z){return l={tag:l,create:d,destroy:k,deps:z,next:null},d=ln.updateQueue,d===null?(d={lastEffect:null,stores:null},ln.updateQueue=d,d.lastEffect=l.next=l):(k=d.lastEffect,k===null?d.lastEffect=l.next=l:(z=k.next,k.next=l,l.next=z,d.lastEffect=l)),l}function ss(){return pi().memoizedState}function eo(l,d,k,z){var J=_n();ln.flags|=l,J.memoizedState=Ca(1|d,k,void 0,z===void 0?null:z)}function ls(l,d,k,z){var J=pi();z=z===void 0?null:z;var ie=void 0;if(Gn!==null){var pe=Gn.memoizedState;if(ie=pe.destroy,z!==null&&Su(z,pe.deps)){J.memoizedState=Ca(d,k,ie,z);return}}ln.flags|=l,J.memoizedState=Ca(1|d,k,ie,z)}function Pc(l,d){return eo(8390656,8,l,d)}function Oc(l,d){return ls(2048,8,l,d)}function hf(l,d){return ls(4,2,l,d)}function Zu(l,d){return ls(4,4,l,d)}function us(l,d){if(typeof d=="function")return l=l(),d(l),function(){d(null)};if(d!=null)return l=l(),d.current=l,function(){d.current=null}}function Lp(l,d,k){return k=k!=null?k.concat([l]):null,ls(4,4,us.bind(null,d,l),k)}function Tl(){}function zh(l,d){var k=pi();d=d===void 0?null:d;var z=k.memoizedState;return z!==null&&d!==null&&Su(d,z[1])?z[0]:(k.memoizedState=[l,d],l)}function $n(l,d){var k=pi();d=d===void 0?null:d;var z=k.memoizedState;return z!==null&&d!==null&&Su(d,z[1])?z[0]:(l=l(),k.memoizedState=[l,d],l)}function Np(l,d,k){return(Ai&21)===0?(l.baseState&&(l.baseState=!1,le=!0),l.memoizedState=k):(Dr(k,d)||(k=nu(),ln.lanes|=k,df|=k,l.baseState=!0),d)}function Tp(l,d){var k=Fr;Fr=k!==0&&4>k?k:4,l(!0);var z=_u.transition;_u.transition={};try{l(!1),d()}finally{Fr=k,_u.transition=z}}function Rp(){return pi().memoizedState}function d0(l,d,k){var z=Mc(l);if(k={lane:z,action:k,hasEagerState:!1,eagerState:null,next:null},Uh(l))Ip(d,k);else if(k=vo(l,d,k,z),k!==null){var J=Ho();Il(k,l,z,J),Uo(k,d,z)}}function Mp(l,d,k){var z=Mc(l),J={lane:z,action:k,hasEagerState:!1,eagerState:null,next:null};if(Uh(l))Ip(d,J);else{var ie=l.alternate;if(l.lanes===0&&(ie===null||ie.lanes===0)&&(ie=d.lastRenderedReducer,ie!==null))try{var pe=d.lastRenderedState,Ne=ie(pe,k);if(J.hasEagerState=!0,J.eagerState=Ne,Dr(Ne,pe)){var Be=d.interleaved;Be===null?(J.next=J,Do(d)):(J.next=Be.next,Be.next=J),d.interleaved=J;return}}catch{}finally{}k=vo(l,d,J,z),k!==null&&(J=Ho(),Il(k,l,z,J),Uo(k,d,z))}}function Uh(l){var d=l.alternate;return l===ln||d!==null&&d===ln}function Ip(l,d){yo=Za=!0;var k=l.pending;k===null?d.next=d:(d.next=k.next,k.next=d),l.pending=d}function Uo(l,d,k){if((k&4194240)!==0){var z=d.lanes;z&=l.pendingLanes,k|=z,d.lanes=k,iu(l,k)}}var Ac={readContext:Hn,useCallback:Wn,useContext:Wn,useEffect:Wn,useImperativeHandle:Wn,useInsertionEffect:Wn,useLayoutEffect:Wn,useMemo:Wn,useReducer:Wn,useRef:Wn,useState:Wn,useDebugValue:Wn,useDeferredValue:Wn,useTransition:Wn,useMutableSource:Wn,useSyncExternalStore:Wn,useId:Wn,unstable_isNewReconciler:!1},p0={readContext:Hn,useCallback:function(l,d){return _n().memoizedState=[l,d===void 0?null:d],l},useContext:Hn,useEffect:Pc,useImperativeHandle:function(l,d,k){return k=k!=null?k.concat([l]):null,eo(4194308,4,us.bind(null,d,l),k)},useLayoutEffect:function(l,d){return eo(4194308,4,l,d)},useInsertionEffect:function(l,d){return eo(4,2,l,d)},useMemo:function(l,d){var k=_n();return d=d===void 0?null:d,l=l(),k.memoizedState=[l,d],l},useReducer:function(l,d,k){var z=_n();return d=k!==void 0?k(d):d,z.memoizedState=z.baseState=d,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:d},z.queue=l,l=l.dispatch=d0.bind(null,ln,l),[z.memoizedState,l]},useRef:function(l){var d=_n();return l={current:l},d.memoizedState=l},useState:zo,useDebugValue:Tl,useDeferredValue:function(l){return _n().memoizedState=l},useTransition:function(){var l=zo(!1),d=l[0];return l=Tp.bind(null,l[1]),_n().memoizedState=l,[d,l]},useMutableSource:function(){},useSyncExternalStore:function(l,d,k){var z=ln,J=_n();if(ft){if(k===void 0)throw Error(t(407));k=k()}else{if(k=d(),La===null)throw Error(t(349));(Ai&30)!==0||Wf(z,d,k)}J.memoizedState=k;var ie={value:k,getSnapshot:d};return J.queue=ie,Pc(ff.bind(null,z,ie,l),[l]),z.flags|=2048,Ca(9,os.bind(null,z,ie,k,d),void 0,null),k},useId:function(){var l=_n(),d=La.identifierPrefix;if(ft){var k=We,z=Xe;k=(z&~(1<<32-Nr(z)-1)).toString(32)+k,d=":"+d+"R"+k,k=Qa++,0<k&&(d+="H"+k.toString(32)),d+=":"}else k=xc++,d=":"+d+"r"+k.toString(32)+":";return l.memoizedState=d},unstable_isNewReconciler:!1},Eu={readContext:Hn,useCallback:zh,useContext:Hn,useEffect:Oc,useImperativeHandle:Lp,useInsertionEffect:hf,useLayoutEffect:Zu,useMemo:$n,useReducer:Wi,useRef:ss,useState:function(){return Wi(la)},useDebugValue:Tl,useDeferredValue:function(l){var d=pi();return Np(d,Gn.memoizedState,l)},useTransition:function(){var l=Wi(la)[0],d=pi().memoizedState;return[l,d]},useMutableSource:Ec,useSyncExternalStore:Ku,useId:Rp,unstable_isNewReconciler:!1},$f={readContext:Hn,useCallback:zh,useContext:Hn,useEffect:Oc,useImperativeHandle:Lp,useInsertionEffect:hf,useLayoutEffect:Zu,useMemo:$n,useReducer:Rs,useRef:ss,useState:function(){return Rs(la)},useDebugValue:Tl,useDeferredValue:function(l){var d=pi();return Gn===null?d.memoizedState=l:Np(d,Gn.memoizedState,l)},useTransition:function(){var l=Rs(la)[0],d=pi().memoizedState;return[l,d]},useMutableSource:Ec,useSyncExternalStore:Ku,useId:Rp,unstable_isNewReconciler:!1};function ma(l,d){if(l&&l.defaultProps){d=V({},d),l=l.defaultProps;for(var k in l)d[k]===void 0&&(d[k]=l[k]);return d}return d}function Cc(l,d,k,z){d=l.memoizedState,k=k(z,d),k=k==null?d:V({},d,k),l.memoizedState=k,l.lanes===0&&(l.updateQueue.baseState=k)}var kc={isMounted:function(l){return(l=l._reactInternals)?hr(l)===l:!1},enqueueSetState:function(l,d,k){l=l._reactInternals;var z=Ho(),J=Mc(l),ie=Xa(z,J);ie.payload=d,k!=null&&(ie.callback=k),d=Aa(l,ie,J),d!==null&&(Il(d,l,J,z),kl(d,l,J))},enqueueReplaceState:function(l,d,k){l=l._reactInternals;var z=Ho(),J=Mc(l),ie=Xa(z,J);ie.tag=1,ie.payload=d,k!=null&&(ie.callback=k),d=Aa(l,ie,J),d!==null&&(Il(d,l,J,z),kl(d,l,J))},enqueueForceUpdate:function(l,d){l=l._reactInternals;var k=Ho(),z=Mc(l),J=Xa(k,z);J.tag=2,d!=null&&(J.callback=d),d=Aa(l,J,z),d!==null&&(Il(d,l,z,k),kl(d,l,z))}};function Yf(l,d,k,z,J,ie,pe){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(z,ie,pe):d.prototype&&d.prototype.isPureReactComponent?!Lo(k,z)||!Lo(J,ie):!0}function jp(l,d,k){var z=!1,J=ns,ie=d.contextType;return typeof ie=="object"&&ie!==null?ie=Hn(ie):(J=aa(d)?al:Pi.current,z=d.contextTypes,ie=(z=z!=null)?Al(l,J):ns),d=new d(k,ie),l.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=kc,l.stateNode=d,d._reactInternals=l,z&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=J,l.__reactInternalMemoizedMaskedChildContext=ie),d}function Hh(l,d,k,z){l=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(k,z),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(k,z),d.state!==l&&kc.enqueueReplaceState(d,d.state,null)}function Xf(l,d,k,z){var J=l.stateNode;J.props=k,J.state=l.memoizedState,J.refs={},yu(l);var ie=d.contextType;typeof ie=="object"&&ie!==null?J.context=Hn(ie):(ie=aa(d)?al:Pi.current,J.context=Al(l,ie)),J.state=l.memoizedState,ie=d.getDerivedStateFromProps,typeof ie=="function"&&(Cc(l,d,ie,k),J.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof J.getSnapshotBeforeUpdate=="function"||typeof J.UNSAFE_componentWillMount!="function"&&typeof J.componentWillMount!="function"||(d=J.state,typeof J.componentWillMount=="function"&&J.componentWillMount(),typeof J.UNSAFE_componentWillMount=="function"&&J.UNSAFE_componentWillMount(),d!==J.state&&kc.enqueueReplaceState(J,J.state,null),Bo(l,k,J,z),J.state=l.memoizedState),typeof J.componentDidMount=="function"&&(l.flags|=4194308)}function Qu(l,d){try{var k="",z=d;do k+=Q(z),z=z.return;while(z);var J=k}catch(ie){J=`
|
|
31
|
-
Error generating stack: `+ie.message+`
|
|
32
|
-
`+ie.stack}return{value:l,source:d,stack:J,digest:null}}function Kf(l,d,k){return{value:l,source:null,stack:k??null,digest:d??null}}function Lc(l,d){try{console.error(d.value)}catch(k){setTimeout(function(){throw k})}}var g0=typeof WeakMap=="function"?WeakMap:Map;function Fp(l,d,k){k=Xa(-1,k),k.tag=3,k.payload={element:null};var z=d.value;return k.callback=function(){Up||(Up=!0,P0=z),Lc(l,d)},k}function m(l,d,k){k=Xa(-1,k),k.tag=3;var z=l.type.getDerivedStateFromError;if(typeof z=="function"){var J=d.value;k.payload=function(){return z(J)},k.callback=function(){Lc(l,d)}}var ie=l.stateNode;return ie!==null&&typeof ie.componentDidCatch=="function"&&(k.callback=function(){Lc(l,d),typeof z!="function"&&(Tc===null?Tc=new Set([this]):Tc.add(this));var pe=d.stack;this.componentDidCatch(d.value,{componentStack:pe!==null?pe:""})}),k}function P(l,d,k){var z=l.pingCache;if(z===null){z=l.pingCache=new g0;var J=new Set;z.set(d,J)}else J=z.get(d),J===void 0&&(J=new Set,z.set(d,J));J.has(k)||(J.add(k),l=V_.bind(null,l,d,k),d.then(l,l))}function q(l){do{var d;if((d=l.tag===13)&&(d=l.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return l;l=l.return}while(l!==null);return null}function K(l,d,k,z,J){return(l.mode&1)===0?(l===d?l.flags|=65536:(l.flags|=128,k.flags|=131072,k.flags&=-52805,k.tag===1&&(k.alternate===null?k.tag=17:(d=Xa(-1,1),d.tag=2,Aa(k,d,1))),k.lanes|=1),l):(l.flags|=65536,l.lanes=J,l)}var ne=S.ReactCurrentOwner,le=!1;function xe(l,d,k,z){d.child=l===null?Ar(d,null,k,z):hi(d,l.child,k,z)}function $e(l,d,k,z,J){k=k.render;var ie=d.ref;return wn(d,J),z=ol(l,d,k,z,ie,J),k=Ja(),l!==null&&!le?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~J,ka(l,d,J)):(ft&&k&&st(d),d.flags|=1,xe(l,d,z,J),d.child)}function lt(l,d,k,z,J){if(l===null){var ie=k.type;return typeof ie=="function"&&!T0(ie)&&ie.defaultProps===void 0&&k.compare===null&&k.defaultProps===void 0?(d.tag=15,d.type=ie,Lt(l,d,ie,z,J)):(l=Yp(k.type,null,z,d,d.mode,J),l.ref=d.ref,l.return=d,d.child=l)}if(ie=l.child,(l.lanes&J)===0){var pe=ie.memoizedProps;if(k=k.compare,k=k!==null?k:Lo,k(pe,z)&&l.ref===d.ref)return ka(l,d,J)}return d.flags|=1,l=jc(ie,z),l.ref=d.ref,l.return=d,d.child=l}function Lt(l,d,k,z,J){if(l!==null){var ie=l.memoizedProps;if(Lo(ie,z)&&l.ref===d.ref)if(le=!1,d.pendingProps=z=ie,(l.lanes&J)!==0)(l.flags&131072)!==0&&(le=!0);else return d.lanes=l.lanes,ka(l,d,J)}return Wt(l,d,k,z,J)}function er(l,d,k){var z=d.pendingProps,J=z.children,ie=l!==null?l.memoizedState:null;if(z.mode==="hidden")if((d.mode&1)===0)d.memoizedState={baseLanes:0,cachePool:null,transitions:null},sn(Qf,Ms),Ms|=k;else{if((k&1073741824)===0)return l=ie!==null?ie.baseLanes|k:k,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:l,cachePool:null,transitions:null},d.updateQueue=null,sn(Qf,Ms),Ms|=l,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},z=ie!==null?ie.baseLanes:k,sn(Qf,Ms),Ms|=z}else ie!==null?(z=ie.baseLanes|k,d.memoizedState=null):z=k,sn(Qf,Ms),Ms|=z;return xe(l,d,J,k),d.child}function Er(l,d){var k=d.ref;(l===null&&k!==null||l!==null&&l.ref!==k)&&(d.flags|=512,d.flags|=2097152)}function Wt(l,d,k,z,J){var ie=aa(k)?al:Pi.current;return ie=Al(d,ie),wn(d,J),k=ol(l,d,k,z,ie,J),z=Ja(),l!==null&&!le?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~J,ka(l,d,J)):(ft&&z&&st(d),d.flags|=1,xe(l,d,k,J),d.child)}function In(l,d,k,z,J){if(aa(k)){var ie=!0;is(d)}else ie=!1;if(wn(d,J),d.stateNode===null)Gr(l,d),jp(d,k,z),Xf(d,k,z,J),z=!0;else if(l===null){var pe=d.stateNode,Ne=d.memoizedProps;pe.props=Ne;var Be=pe.context,ot=k.contextType;typeof ot=="object"&&ot!==null?ot=Hn(ot):(ot=aa(k)?al:Pi.current,ot=Al(d,ot));var At=k.getDerivedStateFromProps,kt=typeof At=="function"||typeof pe.getSnapshotBeforeUpdate=="function";kt||typeof pe.UNSAFE_componentWillReceiveProps!="function"&&typeof pe.componentWillReceiveProps!="function"||(Ne!==z||Be!==ot)&&Hh(d,pe,z,ot),mo=!1;var Ot=d.memoizedState;pe.state=Ot,Bo(d,z,pe,J),Be=d.memoizedState,Ne!==z||Ot!==Be||ia.current||mo?(typeof At=="function"&&(Cc(d,k,At,z),Be=d.memoizedState),(Ne=mo||Yf(d,k,Ne,z,Ot,Be,ot))?(kt||typeof pe.UNSAFE_componentWillMount!="function"&&typeof pe.componentWillMount!="function"||(typeof pe.componentWillMount=="function"&&pe.componentWillMount(),typeof pe.UNSAFE_componentWillMount=="function"&&pe.UNSAFE_componentWillMount()),typeof pe.componentDidMount=="function"&&(d.flags|=4194308)):(typeof pe.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=z,d.memoizedState=Be),pe.props=z,pe.state=Be,pe.context=ot,z=Ne):(typeof pe.componentDidMount=="function"&&(d.flags|=4194308),z=!1)}else{pe=d.stateNode,Xu(l,d),Ne=d.memoizedProps,ot=d.type===d.elementType?Ne:ma(d.type,Ne),pe.props=ot,kt=d.pendingProps,Ot=pe.context,Be=k.contextType,typeof Be=="object"&&Be!==null?Be=Hn(Be):(Be=aa(k)?al:Pi.current,Be=Al(d,Be));var Zt=k.getDerivedStateFromProps;(At=typeof Zt=="function"||typeof pe.getSnapshotBeforeUpdate=="function")||typeof pe.UNSAFE_componentWillReceiveProps!="function"&&typeof pe.componentWillReceiveProps!="function"||(Ne!==kt||Ot!==Be)&&Hh(d,pe,z,Be),mo=!1,Ot=d.memoizedState,pe.state=Ot,Bo(d,z,pe,J);var ir=d.memoizedState;Ne!==kt||Ot!==ir||ia.current||mo?(typeof Zt=="function"&&(Cc(d,k,Zt,z),ir=d.memoizedState),(ot=mo||Yf(d,k,ot,z,Ot,ir,Be)||!1)?(At||typeof pe.UNSAFE_componentWillUpdate!="function"&&typeof pe.componentWillUpdate!="function"||(typeof pe.componentWillUpdate=="function"&&pe.componentWillUpdate(z,ir,Be),typeof pe.UNSAFE_componentWillUpdate=="function"&&pe.UNSAFE_componentWillUpdate(z,ir,Be)),typeof pe.componentDidUpdate=="function"&&(d.flags|=4),typeof pe.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof pe.componentDidUpdate!="function"||Ne===l.memoizedProps&&Ot===l.memoizedState||(d.flags|=4),typeof pe.getSnapshotBeforeUpdate!="function"||Ne===l.memoizedProps&&Ot===l.memoizedState||(d.flags|=1024),d.memoizedProps=z,d.memoizedState=ir),pe.props=z,pe.state=ir,pe.context=Be,z=ot):(typeof pe.componentDidUpdate!="function"||Ne===l.memoizedProps&&Ot===l.memoizedState||(d.flags|=4),typeof pe.getSnapshotBeforeUpdate!="function"||Ne===l.memoizedProps&&Ot===l.memoizedState||(d.flags|=1024),z=!1)}return bn(l,d,k,z,ie,J)}function bn(l,d,k,z,J,ie){Er(l,d);var pe=(d.flags&128)!==0;if(!z&&!pe)return J&&Vf(d,k,!1),ka(l,d,ie);z=d.stateNode,ne.current=d;var Ne=pe&&typeof k.getDerivedStateFromError!="function"?null:z.render();return d.flags|=1,l!==null&&pe?(d.child=hi(d,l.child,null,ie),d.child=hi(d,null,Ne,ie)):xe(l,d,Ne,ie),d.memoizedState=z.state,J&&Vf(d,k,!0),d.child}function to(l){var d=l.stateNode;d.pendingContext?cf(l,d.pendingContext,d.pendingContext!==d.context):d.context&&cf(l,d.context,!1),qo(l,d.containerInfo)}function sl(l,d,k,z,J){return xr(),Zr(J),d.flags|=256,xe(l,d,k,z),d.child}var at={dehydrated:null,treeContext:null,retryLane:0};function Ye(l){return{baseLanes:l,cachePool:null,transitions:null}}function dt(l,d,k){var z=d.pendingProps,J=pn.current,ie=!1,pe=(d.flags&128)!==0,Ne;if((Ne=pe)||(Ne=l!==null&&l.memoizedState===null?!1:(J&2)!==0),Ne?(ie=!0,d.flags&=-129):(l===null||l.memoizedState!==null)&&(J|=1),sn(pn,J&1),l===null)return jt(d),l=d.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((d.mode&1)===0?d.lanes=1:l.data==="$!"?d.lanes=8:d.lanes=1073741824,null):(pe=z.children,l=z.fallback,ie?(z=d.mode,ie=d.child,pe={mode:"hidden",children:pe},(z&1)===0&&ie!==null?(ie.childLanes=0,ie.pendingProps=pe):ie=Xp(pe,z,0,null),l=mf(l,z,k,null),ie.return=d,l.return=d,ie.sibling=l,d.child=ie,d.child.memoizedState=Ye(k),d.memoizedState=at,l):$t(d,pe));if(J=l.memoizedState,J!==null&&(Ne=J.dehydrated,Ne!==null))return Tr(l,d,pe,z,Ne,J,k);if(ie){ie=z.fallback,pe=d.mode,J=l.child,Ne=J.sibling;var Be={mode:"hidden",children:z.children};return(pe&1)===0&&d.child!==J?(z=d.child,z.childLanes=0,z.pendingProps=Be,d.deletions=null):(z=jc(J,Be),z.subtreeFlags=J.subtreeFlags&14680064),Ne!==null?ie=jc(Ne,ie):(ie=mf(ie,pe,k,null),ie.flags|=2),ie.return=d,z.return=d,z.sibling=ie,d.child=z,z=ie,ie=d.child,pe=l.child.memoizedState,pe=pe===null?Ye(k):{baseLanes:pe.baseLanes|k,cachePool:null,transitions:pe.transitions},ie.memoizedState=pe,ie.childLanes=l.childLanes&~k,d.memoizedState=at,z}return ie=l.child,l=ie.sibling,z=jc(ie,{mode:"visible",children:z.children}),(d.mode&1)===0&&(z.lanes=k),z.return=d,z.sibling=null,l!==null&&(k=d.deletions,k===null?(d.deletions=[l],d.flags|=16):k.push(l)),d.child=z,d.memoizedState=null,z}function $t(l,d){return d=Xp({mode:"visible",children:d},l.mode,0,null),d.return=l,l.child=d}function dr(l,d,k,z){return z!==null&&Zr(z),hi(d,l.child,null,k),l=$t(d,d.pendingProps.children),l.flags|=2,d.memoizedState=null,l}function Tr(l,d,k,z,J,ie,pe){if(k)return d.flags&256?(d.flags&=-257,z=Kf(Error(t(422))),dr(l,d,pe,z)):d.memoizedState!==null?(d.child=l.child,d.flags|=128,null):(ie=z.fallback,J=d.mode,z=Xp({mode:"visible",children:z.children},J,0,null),ie=mf(ie,J,pe,null),ie.flags|=2,z.return=d,ie.return=d,z.sibling=ie,d.child=z,(d.mode&1)!==0&&hi(d,l.child,null,pe),d.child.memoizedState=Ye(pe),d.memoizedState=at,ie);if((d.mode&1)===0)return dr(l,d,pe,null);if(J.data==="$!"){if(z=J.nextSibling&&J.nextSibling.dataset,z)var Ne=z.dgst;return z=Ne,ie=Error(t(419)),z=Kf(ie,z,void 0),dr(l,d,pe,z)}if(Ne=(pe&l.childLanes)!==0,le||Ne){if(z=La,z!==null){switch(pe&-pe){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&(z.suspendedLanes|pe))!==0?0:J,J!==0&&J!==ie.retryLane&&(ie.retryLane=J,qr(l,J),Il(z,l,J,-1))}return N0(),z=Kf(Error(t(421))),dr(l,d,pe,z)}return J.data==="$?"?(d.flags|=128,d.child=l.child,d=W_.bind(null,l),J._reactRetry=d,null):(l=ie.treeContext,Ue=Ui(J.nextSibling),qe=d,ft=!0,vt=null,l!==null&&(we[Ee++]=Xe,we[Ee++]=We,we[Ee++]=De,Xe=l.id,We=l.overflow,De=d),d=$t(d,z.children),d.flags|=4096,d)}function Pr(l,d,k){l.lanes|=d;var z=l.alternate;z!==null&&(z.lanes|=d),Ya(l.return,d,k)}function Wr(l,d,k,z,J){var ie=l.memoizedState;ie===null?l.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:z,tail:k,tailMode:J}:(ie.isBackwards=d,ie.rendering=null,ie.renderingStartTime=0,ie.last=z,ie.tail=k,ie.tailMode=J)}function $i(l,d,k){var z=d.pendingProps,J=z.revealOrder,ie=z.tail;if(xe(l,d,z.children,k),z=pn.current,(z&2)!==0)z=z&1|2,d.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=d.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&Pr(l,k,d);else if(l.tag===19)Pr(l,k,d);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===d)break e;for(;l.sibling===null;){if(l.return===null||l.return===d)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}z&=1}if(sn(pn,z),(d.mode&1)===0)d.memoizedState=null;else switch(J){case"forwards":for(k=d.child,J=null;k!==null;)l=k.alternate,l!==null&&Ka(l)===null&&(J=k),k=k.sibling;k=J,k===null?(J=d.child,d.child=null):(J=k.sibling,k.sibling=null),Wr(d,!1,J,k,ie);break;case"backwards":for(k=null,J=d.child,d.child=null;J!==null;){if(l=J.alternate,l!==null&&Ka(l)===null){d.child=J;break}l=J.sibling,J.sibling=k,k=J,J=l}Wr(d,!0,k,null,ie);break;case"together":Wr(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function Gr(l,d){(d.mode&1)===0&&l!==null&&(l.alternate=null,d.alternate=null,d.flags|=2)}function ka(l,d,k){if(l!==null&&(d.dependencies=l.dependencies),df|=d.lanes,(k&d.childLanes)===0)return null;if(l!==null&&d.child!==l.child)throw Error(t(153));if(d.child!==null){for(l=d.child,k=jc(l,l.pendingProps),d.child=k,k.return=d;l.sibling!==null;)l=l.sibling,k=k.sibling=jc(l,l.pendingProps),k.return=d;k.sibling=null}return d.child}function v0(l,d,k){switch(d.tag){case 3:to(d),xr();break;case 5:bu(d);break;case 1:aa(d.type)&&is(d);break;case 4:qo(d,d.stateNode.containerInfo);break;case 10:var z=d.type._context,J=d.memoizedProps.value;sn(Vi,z._currentValue),z._currentValue=J;break;case 13:if(z=d.memoizedState,z!==null)return z.dehydrated!==null?(sn(pn,pn.current&1),d.flags|=128,null):(k&d.child.childLanes)!==0?dt(l,d,k):(sn(pn,pn.current&1),l=ka(l,d,k),l!==null?l.sibling:null);sn(pn,pn.current&1);break;case 19:if(z=(k&d.childLanes)!==0,(l.flags&128)!==0){if(z)return $i(l,d,k);d.flags|=128}if(J=d.memoizedState,J!==null&&(J.rendering=null,J.tail=null,J.lastEffect=null),sn(pn,pn.current),z)break;return null;case 22:case 23:return d.lanes=0,er(l,d,k)}return ka(l,d,k)}var Bm,m0,qm,zm;Bm=function(l,d){for(var k=d.child;k!==null;){if(k.tag===5||k.tag===6)l.appendChild(k.stateNode);else if(k.tag!==4&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===d)break;for(;k.sibling===null;){if(k.return===null||k.return===d)return;k=k.return}k.sibling.return=k.return,k=k.sibling}},m0=function(){},qm=function(l,d,k,z){var J=l.memoizedProps;if(J!==z){l=d.stateNode,ri(rn.current);var ie=null;switch(k){case"input":J=Re(l,J),z=Re(l,z),ie=[];break;case"select":J=V({},J,{value:void 0}),z=V({},z,{value:void 0}),ie=[];break;case"textarea":J=he(l,J),z=he(l,z),ie=[];break;default:typeof J.onClick!="function"&&typeof z.onClick=="function"&&(l.onclick=Ls)}Ie(k,z);var pe;k=null;for(ot in J)if(!z.hasOwnProperty(ot)&&J.hasOwnProperty(ot)&&J[ot]!=null)if(ot==="style"){var Ne=J[ot];for(pe in Ne)Ne.hasOwnProperty(pe)&&(k||(k={}),k[pe]="")}else ot!=="dangerouslySetInnerHTML"&&ot!=="children"&&ot!=="suppressContentEditableWarning"&&ot!=="suppressHydrationWarning"&&ot!=="autoFocus"&&(a.hasOwnProperty(ot)?ie||(ie=[]):(ie=ie||[]).push(ot,null));for(ot in z){var Be=z[ot];if(Ne=J!=null?J[ot]:void 0,z.hasOwnProperty(ot)&&Be!==Ne&&(Be!=null||Ne!=null))if(ot==="style")if(Ne){for(pe in Ne)!Ne.hasOwnProperty(pe)||Be&&Be.hasOwnProperty(pe)||(k||(k={}),k[pe]="");for(pe in Be)Be.hasOwnProperty(pe)&&Ne[pe]!==Be[pe]&&(k||(k={}),k[pe]=Be[pe])}else k||(ie||(ie=[]),ie.push(ot,k)),k=Be;else ot==="dangerouslySetInnerHTML"?(Be=Be?Be.__html:void 0,Ne=Ne?Ne.__html:void 0,Be!=null&&Ne!==Be&&(ie=ie||[]).push(ot,Be)):ot==="children"?typeof Be!="string"&&typeof Be!="number"||(ie=ie||[]).push(ot,""+Be):ot!=="suppressContentEditableWarning"&&ot!=="suppressHydrationWarning"&&(a.hasOwnProperty(ot)?(Be!=null&&ot==="onScroll"&&hn("scroll",l),ie||Ne===Be||(ie=[])):(ie=ie||[]).push(ot,Be))}k&&(ie=ie||[]).push("style",k);var ot=ie;(d.updateQueue=ot)&&(d.flags|=4)}},zm=function(l,d,k,z){k!==z&&(d.flags|=4)};function Gh(l,d){if(!ft)switch(l.tailMode){case"hidden":d=l.tail;for(var k=null;d!==null;)d.alternate!==null&&(k=d),d=d.sibling;k===null?l.tail=null:k.sibling=null;break;case"collapsed":k=l.tail;for(var z=null;k!==null;)k.alternate!==null&&(z=k),k=k.sibling;z===null?d||l.tail===null?l.tail=null:l.tail.sibling=null:z.sibling=null}}function bo(l){var d=l.alternate!==null&&l.alternate.child===l.child,k=0,z=0;if(d)for(var J=l.child;J!==null;)k|=J.lanes|J.childLanes,z|=J.subtreeFlags&14680064,z|=J.flags&14680064,J.return=l,J=J.sibling;else for(J=l.child;J!==null;)k|=J.lanes|J.childLanes,z|=J.subtreeFlags,z|=J.flags,J.return=l,J=J.sibling;return l.subtreeFlags|=z,l.childLanes=k,d}function I_(l,d,k){var z=d.pendingProps;switch(je(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bo(d),null;case 1:return aa(d.type)&&mu(),bo(d),null;case 3:return z=d.stateNode,dn(),en(ia),en(Pi),sa(),z.pendingContext&&(z.context=z.pendingContext,z.pendingContext=null),(l===null||l.child===null)&&(Ur(d)?d.flags|=4:l===null||l.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,vt!==null&&(C0(vt),vt=null))),m0(l,d),bo(d),null;case 5:Ts(d);var J=ri(Mn.current);if(k=d.type,l!==null&&d.stateNode!=null)qm(l,d,k,z,J),l.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!z){if(d.stateNode===null)throw Error(t(166));return bo(d),null}if(l=ri(rn.current),Ur(d)){z=d.stateNode,k=d.type;var ie=d.memoizedProps;switch(z[po]=d,z[gu]=ie,l=(d.mode&1)!==0,k){case"dialog":hn("cancel",z),hn("close",z);break;case"iframe":case"object":case"embed":hn("load",z);break;case"video":case"audio":for(J=0;J<Fo.length;J++)hn(Fo[J],z);break;case"source":hn("error",z);break;case"img":case"image":case"link":hn("error",z),hn("load",z);break;case"details":hn("toggle",z);break;case"input":Pe(z,ie),hn("invalid",z);break;case"select":z._wrapperState={wasMultiple:!!ie.multiple},hn("invalid",z);break;case"textarea":Oe(z,ie),hn("invalid",z)}Ie(k,ie),J=null;for(var pe in ie)if(ie.hasOwnProperty(pe)){var Ne=ie[pe];pe==="children"?typeof Ne=="string"?z.textContent!==Ne&&(ie.suppressHydrationWarning!==!0&&Vu(z.textContent,Ne,l),J=["children",Ne]):typeof Ne=="number"&&z.textContent!==""+Ne&&(ie.suppressHydrationWarning!==!0&&Vu(z.textContent,Ne,l),J=["children",""+Ne]):a.hasOwnProperty(pe)&&Ne!=null&&pe==="onScroll"&&hn("scroll",z)}switch(k){case"input":me(z),Se(z,ie,!0);break;case"textarea":me(z),ze(z);break;case"select":case"option":break;default:typeof ie.onClick=="function"&&(z.onclick=Ls)}z=J,d.updateQueue=z,z!==null&&(d.flags|=4)}else{pe=J.nodeType===9?J:J.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=pt(k)),l==="http://www.w3.org/1999/xhtml"?k==="script"?(l=pe.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof z.is=="string"?l=pe.createElement(k,{is:z.is}):(l=pe.createElement(k),k==="select"&&(pe=l,z.multiple?pe.multiple=!0:z.size&&(pe.size=z.size))):l=pe.createElementNS(l,k),l[po]=d,l[gu]=z,Bm(l,d,!1,!1),d.stateNode=l;e:{switch(pe=ke(k,z),k){case"dialog":hn("cancel",l),hn("close",l),J=z;break;case"iframe":case"object":case"embed":hn("load",l),J=z;break;case"video":case"audio":for(J=0;J<Fo.length;J++)hn(Fo[J],l);J=z;break;case"source":hn("error",l),J=z;break;case"img":case"image":case"link":hn("error",l),hn("load",l),J=z;break;case"details":hn("toggle",l),J=z;break;case"input":Pe(l,z),J=Re(l,z),hn("invalid",l);break;case"option":J=z;break;case"select":l._wrapperState={wasMultiple:!!z.multiple},J=V({},z,{value:void 0}),hn("invalid",l);break;case"textarea":Oe(l,z),J=he(l,z),hn("invalid",l);break;default:J=z}Ie(k,J),Ne=J;for(ie in Ne)if(Ne.hasOwnProperty(ie)){var Be=Ne[ie];ie==="style"?It(l,Be):ie==="dangerouslySetInnerHTML"?(Be=Be?Be.__html:void 0,Be!=null&&Qe(l,Be)):ie==="children"?typeof Be=="string"?(k!=="textarea"||Be!=="")&&Ze(l,Be):typeof Be=="number"&&Ze(l,""+Be):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(a.hasOwnProperty(ie)?Be!=null&&ie==="onScroll"&&hn("scroll",l):Be!=null&&g(l,ie,Be,pe))}switch(k){case"input":me(l),Se(l,z,!1);break;case"textarea":me(l),ze(l);break;case"option":z.value!=null&&l.setAttribute("value",""+ae(z.value));break;case"select":l.multiple=!!z.multiple,ie=z.value,ie!=null?Te(l,!!z.multiple,ie,!1):z.defaultValue!=null&&Te(l,!!z.multiple,z.defaultValue,!0);break;default:typeof J.onClick=="function"&&(l.onclick=Ls)}switch(k){case"button":case"input":case"select":case"textarea":z=!!z.autoFocus;break e;case"img":z=!0;break e;default:z=!1}}z&&(d.flags|=4)}d.ref!==null&&(d.flags|=512,d.flags|=2097152)}return bo(d),null;case 6:if(l&&d.stateNode!=null)zm(l,d,l.memoizedProps,z);else{if(typeof z!="string"&&d.stateNode===null)throw Error(t(166));if(k=ri(Mn.current),ri(rn.current),Ur(d)){if(z=d.stateNode,k=d.memoizedProps,z[po]=d,(ie=z.nodeValue!==k)&&(l=qe,l!==null))switch(l.tag){case 3:Vu(z.nodeValue,k,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Vu(z.nodeValue,k,(l.mode&1)!==0)}ie&&(d.flags|=4)}else z=(k.nodeType===9?k:k.ownerDocument).createTextNode(z),z[po]=d,d.stateNode=z}return bo(d),null;case 13:if(en(pn),z=d.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(ft&&Ue!==null&&(d.mode&1)!==0&&(d.flags&128)===0)Ir(),xr(),d.flags|=98560,ie=!1;else if(ie=Ur(d),z!==null&&z.dehydrated!==null){if(l===null){if(!ie)throw Error(t(318));if(ie=d.memoizedState,ie=ie!==null?ie.dehydrated:null,!ie)throw Error(t(317));ie[po]=d}else xr(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;bo(d),ie=!1}else vt!==null&&(C0(vt),vt=null),ie=!0;if(!ie)return d.flags&65536?d:null}return(d.flags&128)!==0?(d.lanes=k,d):(z=z!==null,z!==(l!==null&&l.memoizedState!==null)&&z&&(d.child.flags|=8192,(d.mode&1)!==0&&(l===null||(pn.current&1)!==0?ya===0&&(ya=3):N0())),d.updateQueue!==null&&(d.flags|=4),bo(d),null);case 4:return dn(),m0(l,d),l===null&&ks(d.stateNode.containerInfo),bo(d),null;case 10:return ga(d.type._context),bo(d),null;case 17:return aa(d.type)&&mu(),bo(d),null;case 19:if(en(pn),ie=d.memoizedState,ie===null)return bo(d),null;if(z=(d.flags&128)!==0,pe=ie.rendering,pe===null)if(z)Gh(ie,!1);else{if(ya!==0||l!==null&&(l.flags&128)!==0)for(l=d.child;l!==null;){if(pe=Ka(l),pe!==null){for(d.flags|=128,Gh(ie,!1),z=pe.updateQueue,z!==null&&(d.updateQueue=z,d.flags|=4),d.subtreeFlags=0,z=k,k=d.child;k!==null;)ie=k,l=z,ie.flags&=14680066,pe=ie.alternate,pe===null?(ie.childLanes=0,ie.lanes=l,ie.child=null,ie.subtreeFlags=0,ie.memoizedProps=null,ie.memoizedState=null,ie.updateQueue=null,ie.dependencies=null,ie.stateNode=null):(ie.childLanes=pe.childLanes,ie.lanes=pe.lanes,ie.child=pe.child,ie.subtreeFlags=0,ie.deletions=null,ie.memoizedProps=pe.memoizedProps,ie.memoizedState=pe.memoizedState,ie.updateQueue=pe.updateQueue,ie.type=pe.type,l=pe.dependencies,ie.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),k=k.sibling;return sn(pn,pn.current&1|2),d.child}l=l.sibling}ie.tail!==null&&Fn()>Jf&&(d.flags|=128,z=!0,Gh(ie,!1),d.lanes=4194304)}else{if(!z)if(l=Ka(pe),l!==null){if(d.flags|=128,z=!0,k=l.updateQueue,k!==null&&(d.updateQueue=k,d.flags|=4),Gh(ie,!0),ie.tail===null&&ie.tailMode==="hidden"&&!pe.alternate&&!ft)return bo(d),null}else 2*Fn()-ie.renderingStartTime>Jf&&k!==1073741824&&(d.flags|=128,z=!0,Gh(ie,!1),d.lanes=4194304);ie.isBackwards?(pe.sibling=d.child,d.child=pe):(k=ie.last,k!==null?k.sibling=pe:d.child=pe,ie.last=pe)}return ie.tail!==null?(d=ie.tail,ie.rendering=d,ie.tail=d.sibling,ie.renderingStartTime=Fn(),d.sibling=null,k=pn.current,sn(pn,z?k&1|2:k&1),d):(bo(d),null);case 22:case 23:return L0(),z=d.memoizedState!==null,l!==null&&l.memoizedState!==null!==z&&(d.flags|=8192),z&&(d.mode&1)!==0?(Ms&1073741824)!==0&&(bo(d),d.subtreeFlags&6&&(d.flags|=8192)):bo(d),null;case 24:return null;case 25:return null}throw Error(t(156,d.tag))}function j_(l,d){switch(je(d),d.tag){case 1:return aa(d.type)&&mu(),l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 3:return dn(),en(ia),en(Pi),sa(),l=d.flags,(l&65536)!==0&&(l&128)===0?(d.flags=l&-65537|128,d):null;case 5:return Ts(d),null;case 13:if(en(pn),l=d.memoizedState,l!==null&&l.dehydrated!==null){if(d.alternate===null)throw Error(t(340));xr()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 19:return en(pn),null;case 4:return dn(),null;case 10:return ga(d.type._context),null;case 22:case 23:return L0(),null;case 24:return null;default:return null}}var Dp=!1,wo=!1,F_=typeof WeakSet=="function"?WeakSet:Set,rr=null;function Zf(l,d){var k=l.ref;if(k!==null)if(typeof k=="function")try{k(null)}catch(z){Ci(l,d,z)}else k.current=null}function y0(l,d,k){try{k()}catch(z){Ci(l,d,z)}}var Um=!1;function D_(l,d){if(Wu=su,l=Zn(),ts(l)){if("selectionStart"in l)var k={start:l.selectionStart,end:l.selectionEnd};else e:{k=(k=l.ownerDocument)&&k.defaultView||window;var z=k.getSelection&&k.getSelection();if(z&&z.rangeCount!==0){k=z.anchorNode;var J=z.anchorOffset,ie=z.focusNode;z=z.focusOffset;try{k.nodeType,ie.nodeType}catch{k=null;break e}var pe=0,Ne=-1,Be=-1,ot=0,At=0,kt=l,Ot=null;t:for(;;){for(var Zt;kt!==k||J!==0&&kt.nodeType!==3||(Ne=pe+J),kt!==ie||z!==0&&kt.nodeType!==3||(Be=pe+z),kt.nodeType===3&&(pe+=kt.nodeValue.length),(Zt=kt.firstChild)!==null;)Ot=kt,kt=Zt;for(;;){if(kt===l)break t;if(Ot===k&&++ot===J&&(Ne=pe),Ot===ie&&++At===z&&(Be=pe),(Zt=kt.nextSibling)!==null)break;kt=Ot,Ot=kt.parentNode}kt=Zt}k=Ne===-1||Be===-1?null:{start:Ne,end:Be}}else k=null}k=k||{start:0,end:0}}else k=null;for(Ol={focusedElem:l,selectionRange:k},su=!1,rr=d;rr!==null;)if(d=rr,l=d.child,(d.subtreeFlags&1028)!==0&&l!==null)l.return=d,rr=l;else for(;rr!==null;){d=rr;try{var ir=d.alternate;if((d.flags&1024)!==0)switch(d.tag){case 0:case 11:case 15:break;case 1:if(ir!==null){var ur=ir.memoizedProps,Yi=ir.memoizedState,et=d.stateNode,Ge=et.getSnapshotBeforeUpdate(d.elementType===d.type?ur:ma(d.type,ur),Yi);et.__reactInternalSnapshotBeforeUpdate=Ge}break;case 3:var nt=d.stateNode.containerInfo;nt.nodeType===1?nt.textContent="":nt.nodeType===9&&nt.documentElement&&nt.removeChild(nt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(Rt){Ci(d,d.return,Rt)}if(l=d.sibling,l!==null){l.return=d.return,rr=l;break}rr=d.return}return ir=Um,Um=!1,ir}function Vh(l,d,k){var z=d.updateQueue;if(z=z!==null?z.lastEffect:null,z!==null){var J=z=z.next;do{if((J.tag&l)===l){var ie=J.destroy;J.destroy=void 0,ie!==void 0&&y0(d,k,ie)}J=J.next}while(J!==z)}}function Bp(l,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var k=d=d.next;do{if((k.tag&l)===l){var z=k.create;k.destroy=z()}k=k.next}while(k!==d)}}function b0(l){var d=l.ref;if(d!==null){var k=l.stateNode;switch(l.tag){case 5:l=k;break;default:l=k}typeof d=="function"?d(l):d.current=l}}function Hm(l){var d=l.alternate;d!==null&&(l.alternate=null,Hm(d)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(d=l.stateNode,d!==null&&(delete d[po],delete d[gu],delete d[pa],delete d[Hf],delete d[Gf])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function Gm(l){return l.tag===5||l.tag===3||l.tag===4}function Vm(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Gm(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function w0(l,d,k){var z=l.tag;if(z===5||z===6)l=l.stateNode,d?k.nodeType===8?k.parentNode.insertBefore(l,d):k.insertBefore(l,d):(k.nodeType===8?(d=k.parentNode,d.insertBefore(l,k)):(d=k,d.appendChild(l)),k=k._reactRootContainer,k!=null||d.onclick!==null||(d.onclick=Ls));else if(z!==4&&(l=l.child,l!==null))for(w0(l,d,k),l=l.sibling;l!==null;)w0(l,d,k),l=l.sibling}function _0(l,d,k){var z=l.tag;if(z===5||z===6)l=l.stateNode,d?k.insertBefore(l,d):k.appendChild(l);else if(z!==4&&(l=l.child,l!==null))for(_0(l,d,k),l=l.sibling;l!==null;)_0(l,d,k),l=l.sibling}var ro=null,Rl=!1;function Nc(l,d,k){for(k=k.child;k!==null;)Wm(l,d,k),k=k.sibling}function Wm(l,d,k){if(gi&&typeof gi.onCommitFiberUnmount=="function")try{gi.onCommitFiberUnmount(so,k)}catch{}switch(k.tag){case 5:wo||Zf(k,d);case 6:var z=ro,J=Rl;ro=null,Nc(l,d,k),ro=z,Rl=J,ro!==null&&(Rl?(l=ro,k=k.stateNode,l.nodeType===8?l.parentNode.removeChild(k):l.removeChild(k)):ro.removeChild(k.stateNode));break;case 18:ro!==null&&(Rl?(l=ro,k=k.stateNode,l.nodeType===8?_c(l.parentNode,k):l.nodeType===1&&_c(l,k),si(l)):_c(ro,k.stateNode));break;case 4:z=ro,J=Rl,ro=k.stateNode.containerInfo,Rl=!0,Nc(l,d,k),ro=z,Rl=J;break;case 0:case 11:case 14:case 15:if(!wo&&(z=k.updateQueue,z!==null&&(z=z.lastEffect,z!==null))){J=z=z.next;do{var ie=J,pe=ie.destroy;ie=ie.tag,pe!==void 0&&((ie&2)!==0||(ie&4)!==0)&&y0(k,d,pe),J=J.next}while(J!==z)}Nc(l,d,k);break;case 1:if(!wo&&(Zf(k,d),z=k.stateNode,typeof z.componentWillUnmount=="function"))try{z.props=k.memoizedProps,z.state=k.memoizedState,z.componentWillUnmount()}catch(Ne){Ci(k,d,Ne)}Nc(l,d,k);break;case 21:Nc(l,d,k);break;case 22:k.mode&1?(wo=(z=wo)||k.memoizedState!==null,Nc(l,d,k),wo=z):Nc(l,d,k);break;default:Nc(l,d,k)}}function $m(l){var d=l.updateQueue;if(d!==null){l.updateQueue=null;var k=l.stateNode;k===null&&(k=l.stateNode=new F_),d.forEach(function(z){var J=$_.bind(null,l,z);k.has(z)||(k.add(z),z.then(J,J))})}}function Ml(l,d){var k=d.deletions;if(k!==null)for(var z=0;z<k.length;z++){var J=k[z];try{var ie=l,pe=d,Ne=pe;e:for(;Ne!==null;){switch(Ne.tag){case 5:ro=Ne.stateNode,Rl=!1;break e;case 3:ro=Ne.stateNode.containerInfo,Rl=!0;break e;case 4:ro=Ne.stateNode.containerInfo,Rl=!0;break e}Ne=Ne.return}if(ro===null)throw Error(t(160));Wm(ie,pe,J),ro=null,Rl=!1;var Be=J.alternate;Be!==null&&(Be.return=null),J.return=null}catch(ot){Ci(J,d,ot)}}if(d.subtreeFlags&12854)for(d=d.child;d!==null;)Ym(d,l),d=d.sibling}function Ym(l,d){var k=l.alternate,z=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Ml(d,l),Pu(l),z&4){try{Vh(3,l,l.return),Bp(3,l)}catch(ur){Ci(l,l.return,ur)}try{Vh(5,l,l.return)}catch(ur){Ci(l,l.return,ur)}}break;case 1:Ml(d,l),Pu(l),z&512&&k!==null&&Zf(k,k.return);break;case 5:if(Ml(d,l),Pu(l),z&512&&k!==null&&Zf(k,k.return),l.flags&32){var J=l.stateNode;try{Ze(J,"")}catch(ur){Ci(l,l.return,ur)}}if(z&4&&(J=l.stateNode,J!=null)){var ie=l.memoizedProps,pe=k!==null?k.memoizedProps:ie,Ne=l.type,Be=l.updateQueue;if(l.updateQueue=null,Be!==null)try{Ne==="input"&&ie.type==="radio"&&ie.name!=null&&ve(J,ie),ke(Ne,pe);var ot=ke(Ne,ie);for(pe=0;pe<Be.length;pe+=2){var At=Be[pe],kt=Be[pe+1];At==="style"?It(J,kt):At==="dangerouslySetInnerHTML"?Qe(J,kt):At==="children"?Ze(J,kt):g(J,At,kt,ot)}switch(Ne){case"input":it(J,ie);break;case"textarea":Me(J,ie);break;case"select":var Ot=J._wrapperState.wasMultiple;J._wrapperState.wasMultiple=!!ie.multiple;var Zt=ie.value;Zt!=null?Te(J,!!ie.multiple,Zt,!1):Ot!==!!ie.multiple&&(ie.defaultValue!=null?Te(J,!!ie.multiple,ie.defaultValue,!0):Te(J,!!ie.multiple,ie.multiple?[]:"",!1))}J[gu]=ie}catch(ur){Ci(l,l.return,ur)}}break;case 6:if(Ml(d,l),Pu(l),z&4){if(l.stateNode===null)throw Error(t(162));J=l.stateNode,ie=l.memoizedProps;try{J.nodeValue=ie}catch(ur){Ci(l,l.return,ur)}}break;case 3:if(Ml(d,l),Pu(l),z&4&&k!==null&&k.memoizedState.isDehydrated)try{si(d.containerInfo)}catch(ur){Ci(l,l.return,ur)}break;case 4:Ml(d,l),Pu(l);break;case 13:Ml(d,l),Pu(l),J=l.child,J.flags&8192&&(ie=J.memoizedState!==null,J.stateNode.isHidden=ie,!ie||J.alternate!==null&&J.alternate.memoizedState!==null||(E0=Fn())),z&4&&$m(l);break;case 22:if(At=k!==null&&k.memoizedState!==null,l.mode&1?(wo=(ot=wo)||At,Ml(d,l),wo=ot):Ml(d,l),Pu(l),z&8192){if(ot=l.memoizedState!==null,(l.stateNode.isHidden=ot)&&!At&&(l.mode&1)!==0)for(rr=l,At=l.child;At!==null;){for(kt=rr=At;rr!==null;){switch(Ot=rr,Zt=Ot.child,Ot.tag){case 0:case 11:case 14:case 15:Vh(4,Ot,Ot.return);break;case 1:Zf(Ot,Ot.return);var ir=Ot.stateNode;if(typeof ir.componentWillUnmount=="function"){z=Ot,k=Ot.return;try{d=z,ir.props=d.memoizedProps,ir.state=d.memoizedState,ir.componentWillUnmount()}catch(ur){Ci(z,k,ur)}}break;case 5:Zf(Ot,Ot.return);break;case 22:if(Ot.memoizedState!==null){Zm(kt);continue}}Zt!==null?(Zt.return=Ot,rr=Zt):Zm(kt)}At=At.sibling}e:for(At=null,kt=l;;){if(kt.tag===5){if(At===null){At=kt;try{J=kt.stateNode,ot?(ie=J.style,typeof ie.setProperty=="function"?ie.setProperty("display","none","important"):ie.display="none"):(Ne=kt.stateNode,Be=kt.memoizedProps.style,pe=Be!=null&&Be.hasOwnProperty("display")?Be.display:null,Ne.style.display=Pt("display",pe))}catch(ur){Ci(l,l.return,ur)}}}else if(kt.tag===6){if(At===null)try{kt.stateNode.nodeValue=ot?"":kt.memoizedProps}catch(ur){Ci(l,l.return,ur)}}else if((kt.tag!==22&&kt.tag!==23||kt.memoizedState===null||kt===l)&&kt.child!==null){kt.child.return=kt,kt=kt.child;continue}if(kt===l)break e;for(;kt.sibling===null;){if(kt.return===null||kt.return===l)break e;At===kt&&(At=null),kt=kt.return}At===kt&&(At=null),kt.sibling.return=kt.return,kt=kt.sibling}}break;case 19:Ml(d,l),Pu(l),z&4&&$m(l);break;case 21:break;default:Ml(d,l),Pu(l)}}function Pu(l){var d=l.flags;if(d&2){try{e:{for(var k=l.return;k!==null;){if(Gm(k)){var z=k;break e}k=k.return}throw Error(t(160))}switch(z.tag){case 5:var J=z.stateNode;z.flags&32&&(Ze(J,""),z.flags&=-33);var ie=Vm(l);_0(l,ie,J);break;case 3:case 4:var pe=z.stateNode.containerInfo,Ne=Vm(l);w0(l,Ne,pe);break;default:throw Error(t(161))}}catch(Be){Ci(l,l.return,Be)}l.flags&=-3}d&4096&&(l.flags&=-4097)}function B_(l,d,k){rr=l,Xm(l)}function Xm(l,d,k){for(var z=(l.mode&1)!==0;rr!==null;){var J=rr,ie=J.child;if(J.tag===22&&z){var pe=J.memoizedState!==null||Dp;if(!pe){var Ne=J.alternate,Be=Ne!==null&&Ne.memoizedState!==null||wo;Ne=Dp;var ot=wo;if(Dp=pe,(wo=Be)&&!ot)for(rr=J;rr!==null;)pe=rr,Be=pe.child,pe.tag===22&&pe.memoizedState!==null?Qm(J):Be!==null?(Be.return=pe,rr=Be):Qm(J);for(;ie!==null;)rr=ie,Xm(ie),ie=ie.sibling;rr=J,Dp=Ne,wo=ot}Km(l)}else(J.subtreeFlags&8772)!==0&&ie!==null?(ie.return=J,rr=ie):Km(l)}}function Km(l){for(;rr!==null;){var d=rr;if((d.flags&8772)!==0){var k=d.alternate;try{if((d.flags&8772)!==0)switch(d.tag){case 0:case 11:case 15:wo||Bp(5,d);break;case 1:var z=d.stateNode;if(d.flags&4&&!wo)if(k===null)z.componentDidMount();else{var J=d.elementType===d.type?k.memoizedProps:ma(d.type,k.memoizedProps);z.componentDidUpdate(J,k.memoizedState,z.__reactInternalSnapshotBeforeUpdate)}var ie=d.updateQueue;ie!==null&&yn(d,ie,z);break;case 3:var pe=d.updateQueue;if(pe!==null){if(k=null,d.child!==null)switch(d.child.tag){case 5:k=d.child.stateNode;break;case 1:k=d.child.stateNode}yn(d,pe,k)}break;case 5:var Ne=d.stateNode;if(k===null&&d.flags&4){k=Ne;var Be=d.memoizedProps;switch(d.type){case"button":case"input":case"select":case"textarea":Be.autoFocus&&k.focus();break;case"img":Be.src&&(k.src=Be.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(d.memoizedState===null){var ot=d.alternate;if(ot!==null){var At=ot.memoizedState;if(At!==null){var kt=At.dehydrated;kt!==null&&si(kt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}wo||d.flags&512&&b0(d)}catch(Ot){Ci(d,d.return,Ot)}}if(d===l){rr=null;break}if(k=d.sibling,k!==null){k.return=d.return,rr=k;break}rr=d.return}}function Zm(l){for(;rr!==null;){var d=rr;if(d===l){rr=null;break}var k=d.sibling;if(k!==null){k.return=d.return,rr=k;break}rr=d.return}}function Qm(l){for(;rr!==null;){var d=rr;try{switch(d.tag){case 0:case 11:case 15:var k=d.return;try{Bp(4,d)}catch(Be){Ci(d,k,Be)}break;case 1:var z=d.stateNode;if(typeof z.componentDidMount=="function"){var J=d.return;try{z.componentDidMount()}catch(Be){Ci(d,J,Be)}}var ie=d.return;try{b0(d)}catch(Be){Ci(d,ie,Be)}break;case 5:var pe=d.return;try{b0(d)}catch(Be){Ci(d,pe,Be)}}}catch(Be){Ci(d,d.return,Be)}if(d===l){rr=null;break}var Ne=d.sibling;if(Ne!==null){Ne.return=d.return,rr=Ne;break}rr=d.return}}var q_=Math.ceil,qp=S.ReactCurrentDispatcher,S0=S.ReactCurrentOwner,ll=S.ReactCurrentBatchConfig,un=0,La=null,ua=null,no=0,Ms=0,Qf=go(0),ya=0,Wh=null,df=0,zp=0,x0=0,$h=null,cs=null,E0=0,Jf=1/0,Ju=null,Up=!1,P0=null,Tc=null,Hp=!1,Rc=null,Gp=0,Yh=0,O0=null,Vp=-1,Wp=0;function Ho(){return(un&6)!==0?Fn():Vp!==-1?Vp:Vp=Fn()}function Mc(l){return(l.mode&1)===0?1:(un&2)!==0&&no!==0?no&-no:tn.transition!==null?(Wp===0&&(Wp=nu()),Wp):(l=Fr,l!==0||(l=window.event,l=l===void 0?16:Uu(l.type)),l)}function Il(l,d,k,z){if(50<Yh)throw Yh=0,O0=null,Error(t(185));Vs(l,k,z),((un&2)===0||l!==La)&&(l===La&&((un&2)===0&&(zp|=k),ya===4&&Ic(l,no)),fs(l,z),k===1&&un===0&&(d.mode&1)===0&&(Jf=Fn()+500,Cl&&oe()))}function fs(l,d){var k=l.callbackNode;ha(l,d);var z=Ri(l,l===La?no:0);if(z===0)k!==null&&Vo(k),l.callbackNode=null,l.callbackPriority=0;else if(d=z&-z,l.callbackPriority!==d){if(k!=null&&Vo(k),d===1)l.tag===0?re(ey.bind(null,l)):G(ey.bind(null,l)),zf(function(){(un&6)===0&&oe()}),k=null;else{switch(Ss(z)){case 1:k=oo;break;case 4:k=dl;break;case 16:k=Gs;break;case 536870912:k=ru;break;default:k=Gs}k=ly(k,Jm.bind(null,l))}l.callbackPriority=d,l.callbackNode=k}}function Jm(l,d){if(Vp=-1,Wp=0,(un&6)!==0)throw Error(t(327));var k=l.callbackNode;if(eh()&&l.callbackNode!==k)return null;var z=Ri(l,l===La?no:0);if(z===0)return null;if((z&30)!==0||(z&l.expiredLanes)!==0||d)d=$p(l,z);else{d=z;var J=un;un|=2;var ie=ry();(La!==l||no!==d)&&(Ju=null,Jf=Fn()+500,gf(l,d));do try{H_();break}catch(Ne){ty(l,Ne)}while(!0);Oi(),qp.current=ie,un=J,ua!==null?d=0:(La=null,no=0,d=ya)}if(d!==0){if(d===2&&(J=Wo(l),J!==0&&(z=J,d=A0(l,J))),d===1)throw k=Wh,gf(l,0),Ic(l,z),fs(l,Fn()),k;if(d===6)Ic(l,z);else{if(J=l.current.alternate,(z&30)===0&&!z_(J)&&(d=$p(l,z),d===2&&(ie=Wo(l),ie!==0&&(z=ie,d=A0(l,ie))),d===1))throw k=Wh,gf(l,0),Ic(l,z),fs(l,Fn()),k;switch(l.finishedWork=J,l.finishedLanes=z,d){case 0:case 1:throw Error(t(345));case 2:vf(l,cs,Ju);break;case 3:if(Ic(l,z),(z&130023424)===z&&(d=E0+500-Fn(),10<d)){if(Ri(l,0)!==0)break;if(J=l.suspendedLanes,(J&z)!==z){Ho(),l.pingedLanes|=l.suspendedLanes&J;break}l.timeoutHandle=$a(vf.bind(null,l,cs,Ju),d);break}vf(l,cs,Ju);break;case 4:if(Ic(l,z),(z&4194240)===z)break;for(d=l.eventTimes,J=-1;0<z;){var pe=31-Nr(z);ie=1<<pe,pe=d[pe],pe>J&&(J=pe),z&=~ie}if(z=J,z=Fn()-z,z=(120>z?120:480>z?480:1080>z?1080:1920>z?1920:3e3>z?3e3:4320>z?4320:1960*q_(z/1960))-z,10<z){l.timeoutHandle=$a(vf.bind(null,l,cs,Ju),z);break}vf(l,cs,Ju);break;case 5:vf(l,cs,Ju);break;default:throw Error(t(329))}}}return fs(l,Fn()),l.callbackNode===k?Jm.bind(null,l):null}function A0(l,d){var k=$h;return l.current.memoizedState.isDehydrated&&(gf(l,d).flags|=256),l=$p(l,d),l!==2&&(d=cs,cs=k,d!==null&&C0(d)),l}function C0(l){cs===null?cs=l:cs.push.apply(cs,l)}function z_(l){for(var d=l;;){if(d.flags&16384){var k=d.updateQueue;if(k!==null&&(k=k.stores,k!==null))for(var z=0;z<k.length;z++){var J=k[z],ie=J.getSnapshot;J=J.value;try{if(!Dr(ie(),J))return!1}catch{return!1}}}if(k=d.child,d.subtreeFlags&16384&&k!==null)k.return=d,d=k;else{if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Ic(l,d){for(d&=~x0,d&=~zp,l.suspendedLanes|=d,l.pingedLanes&=~d,l=l.expirationTimes;0<d;){var k=31-Nr(d),z=1<<k;l[k]=-1,d&=~z}}function ey(l){if((un&6)!==0)throw Error(t(327));eh();var d=Ri(l,0);if((d&1)===0)return fs(l,Fn()),null;var k=$p(l,d);if(l.tag!==0&&k===2){var z=Wo(l);z!==0&&(d=z,k=A0(l,z))}if(k===1)throw k=Wh,gf(l,0),Ic(l,d),fs(l,Fn()),k;if(k===6)throw Error(t(345));return l.finishedWork=l.current.alternate,l.finishedLanes=d,vf(l,cs,Ju),fs(l,Fn()),null}function k0(l,d){var k=un;un|=1;try{return l(d)}finally{un=k,un===0&&(Jf=Fn()+500,Cl&&oe())}}function pf(l){Rc!==null&&Rc.tag===0&&(un&6)===0&&eh();var d=un;un|=1;var k=ll.transition,z=Fr;try{if(ll.transition=null,Fr=1,l)return l()}finally{Fr=z,ll.transition=k,un=d,(un&6)===0&&oe()}}function L0(){Ms=Qf.current,en(Qf)}function gf(l,d){l.finishedWork=null,l.finishedLanes=0;var k=l.timeoutHandle;if(k!==-1&&(l.timeoutHandle=-1,wc(k)),ua!==null)for(k=ua.return;k!==null;){var z=k;switch(je(z),z.tag){case 1:z=z.type.childContextTypes,z!=null&&mu();break;case 3:dn(),en(ia),en(Pi),sa();break;case 5:Ts(z);break;case 4:dn();break;case 13:en(pn);break;case 19:en(pn);break;case 10:ga(z.type._context);break;case 22:case 23:L0()}k=k.return}if(La=l,ua=l=jc(l.current,null),no=Ms=d,ya=0,Wh=null,x0=zp=df=0,cs=$h=null,oa!==null){for(d=0;d<oa.length;d++)if(k=oa[d],z=k.interleaved,z!==null){k.interleaved=null;var J=z.next,ie=k.pending;if(ie!==null){var pe=ie.next;ie.next=J,z.next=pe}k.pending=z}oa=null}return l}function ty(l,d){do{var k=ua;try{if(Oi(),wu.current=Ac,Za){for(var z=ln.memoizedState;z!==null;){var J=z.queue;J!==null&&(J.pending=null),z=z.next}Za=!1}if(Ai=0,Vn=Gn=ln=null,yo=!1,Qa=0,S0.current=null,k===null||k.return===null){ya=1,Wh=d,ua=null;break}e:{var ie=l,pe=k.return,Ne=k,Be=d;if(d=no,Ne.flags|=32768,Be!==null&&typeof Be=="object"&&typeof Be.then=="function"){var ot=Be,At=Ne,kt=At.tag;if((At.mode&1)===0&&(kt===0||kt===11||kt===15)){var Ot=At.alternate;Ot?(At.updateQueue=Ot.updateQueue,At.memoizedState=Ot.memoizedState,At.lanes=Ot.lanes):(At.updateQueue=null,At.memoizedState=null)}var Zt=q(pe);if(Zt!==null){Zt.flags&=-257,K(Zt,pe,Ne,ie,d),Zt.mode&1&&P(ie,ot,d),d=Zt,Be=ot;var ir=d.updateQueue;if(ir===null){var ur=new Set;ur.add(Be),d.updateQueue=ur}else ir.add(Be);break e}else{if((d&1)===0){P(ie,ot,d),N0();break e}Be=Error(t(426))}}else if(ft&&Ne.mode&1){var Yi=q(pe);if(Yi!==null){(Yi.flags&65536)===0&&(Yi.flags|=256),K(Yi,pe,Ne,ie,d),Zr(Qu(Be,Ne));break e}}ie=Be=Qu(Be,Ne),ya!==4&&(ya=2),$h===null?$h=[ie]:$h.push(ie),ie=pe;do{switch(ie.tag){case 3:ie.flags|=65536,d&=-d,ie.lanes|=d;var et=Fp(ie,Be,d);va(ie,et);break e;case 1:Ne=Be;var Ge=ie.type,nt=ie.stateNode;if((ie.flags&128)===0&&(typeof Ge.getDerivedStateFromError=="function"||nt!==null&&typeof nt.componentDidCatch=="function"&&(Tc===null||!Tc.has(nt)))){ie.flags|=65536,d&=-d,ie.lanes|=d;var Rt=m(ie,Ne,d);va(ie,Rt);break e}}ie=ie.return}while(ie!==null)}iy(k)}catch(cr){d=cr,ua===k&&k!==null&&(ua=k=k.return);continue}break}while(!0)}function ry(){var l=qp.current;return qp.current=Ac,l===null?Ac:l}function N0(){(ya===0||ya===3||ya===2)&&(ya=4),La===null||(df&268435455)===0&&(zp&268435455)===0||Ic(La,no)}function $p(l,d){var k=un;un|=2;var z=ry();(La!==l||no!==d)&&(Ju=null,gf(l,d));do try{U_();break}catch(J){ty(l,J)}while(!0);if(Oi(),un=k,qp.current=z,ua!==null)throw Error(t(261));return La=null,no=0,ya}function U_(){for(;ua!==null;)ny(ua)}function H_(){for(;ua!==null&&!tu();)ny(ua)}function ny(l){var d=sy(l.alternate,l,Ms);l.memoizedProps=l.pendingProps,d===null?iy(l):ua=d,S0.current=null}function iy(l){var d=l;do{var k=d.alternate;if(l=d.return,(d.flags&32768)===0){if(k=I_(k,d,Ms),k!==null){ua=k;return}}else{if(k=j_(k,d),k!==null){k.flags&=32767,ua=k;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{ya=6,ua=null;return}}if(d=d.sibling,d!==null){ua=d;return}ua=d=l}while(d!==null);ya===0&&(ya=5)}function vf(l,d,k){var z=Fr,J=ll.transition;try{ll.transition=null,Fr=1,G_(l,d,k,z)}finally{ll.transition=J,Fr=z}return null}function G_(l,d,k,z){do eh();while(Rc!==null);if((un&6)!==0)throw Error(t(327));k=l.finishedWork;var J=l.finishedLanes;if(k===null)return null;if(l.finishedWork=null,l.finishedLanes=0,k===l.current)throw Error(t(177));l.callbackNode=null,l.callbackPriority=0;var ie=k.lanes|k.childLanes;if(af(l,ie),l===La&&(ua=La=null,no=0),(k.subtreeFlags&2064)===0&&(k.flags&2064)===0||Hp||(Hp=!0,ly(Gs,function(){return eh(),null})),ie=(k.flags&15990)!==0,(k.subtreeFlags&15990)!==0||ie){ie=ll.transition,ll.transition=null;var pe=Fr;Fr=1;var Ne=un;un|=4,S0.current=null,D_(l,k),Ym(k,l),No(Ol),su=!!Wu,Ol=Wu=null,l.current=k,B_(k),mc(),un=Ne,Fr=pe,ll.transition=ie}else l.current=k;if(Hp&&(Hp=!1,Rc=l,Gp=J),ie=l.pendingLanes,ie===0&&(Tc=null),Jr(k.stateNode),fs(l,Fn()),d!==null)for(z=l.onRecoverableError,k=0;k<d.length;k++)J=d[k],z(J.value,{componentStack:J.stack,digest:J.digest});if(Up)throw Up=!1,l=P0,P0=null,l;return(Gp&1)!==0&&l.tag!==0&&eh(),ie=l.pendingLanes,(ie&1)!==0?l===O0?Yh++:(Yh=0,O0=l):Yh=0,oe(),null}function eh(){if(Rc!==null){var l=Ss(Gp),d=ll.transition,k=Fr;try{if(ll.transition=null,Fr=16>l?16:l,Rc===null)var z=!1;else{if(l=Rc,Rc=null,Gp=0,(un&6)!==0)throw Error(t(331));var J=un;for(un|=4,rr=l.current;rr!==null;){var ie=rr,pe=ie.child;if((rr.flags&16)!==0){var Ne=ie.deletions;if(Ne!==null){for(var Be=0;Be<Ne.length;Be++){var ot=Ne[Be];for(rr=ot;rr!==null;){var At=rr;switch(At.tag){case 0:case 11:case 15:Vh(8,At,ie)}var kt=At.child;if(kt!==null)kt.return=At,rr=kt;else for(;rr!==null;){At=rr;var Ot=At.sibling,Zt=At.return;if(Hm(At),At===ot){rr=null;break}if(Ot!==null){Ot.return=Zt,rr=Ot;break}rr=Zt}}}var ir=ie.alternate;if(ir!==null){var ur=ir.child;if(ur!==null){ir.child=null;do{var Yi=ur.sibling;ur.sibling=null,ur=Yi}while(ur!==null)}}rr=ie}}if((ie.subtreeFlags&2064)!==0&&pe!==null)pe.return=ie,rr=pe;else e:for(;rr!==null;){if(ie=rr,(ie.flags&2048)!==0)switch(ie.tag){case 0:case 11:case 15:Vh(9,ie,ie.return)}var et=ie.sibling;if(et!==null){et.return=ie.return,rr=et;break e}rr=ie.return}}var Ge=l.current;for(rr=Ge;rr!==null;){pe=rr;var nt=pe.child;if((pe.subtreeFlags&2064)!==0&&nt!==null)nt.return=pe,rr=nt;else e:for(pe=Ge;rr!==null;){if(Ne=rr,(Ne.flags&2048)!==0)try{switch(Ne.tag){case 0:case 11:case 15:Bp(9,Ne)}}catch(cr){Ci(Ne,Ne.return,cr)}if(Ne===pe){rr=null;break e}var Rt=Ne.sibling;if(Rt!==null){Rt.return=Ne.return,rr=Rt;break e}rr=Ne.return}}if(un=J,oe(),gi&&typeof gi.onPostCommitFiberRoot=="function")try{gi.onPostCommitFiberRoot(so,l)}catch{}z=!0}return z}finally{Fr=k,ll.transition=d}}return!1}function ay(l,d,k){d=Qu(k,d),d=Fp(l,d,1),l=Aa(l,d,1),d=Ho(),l!==null&&(Vs(l,1,d),fs(l,d))}function Ci(l,d,k){if(l.tag===3)ay(l,l,k);else for(;d!==null;){if(d.tag===3){ay(d,l,k);break}else if(d.tag===1){var z=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof z.componentDidCatch=="function"&&(Tc===null||!Tc.has(z))){l=Qu(k,l),l=m(d,l,1),d=Aa(d,l,1),l=Ho(),d!==null&&(Vs(d,1,l),fs(d,l));break}}d=d.return}}function V_(l,d,k){var z=l.pingCache;z!==null&&z.delete(d),d=Ho(),l.pingedLanes|=l.suspendedLanes&k,La===l&&(no&k)===k&&(ya===4||ya===3&&(no&130023424)===no&&500>Fn()-E0?gf(l,0):x0|=k),fs(l,d)}function oy(l,d){d===0&&((l.mode&1)===0?d=1:(d=ja,ja<<=1,(ja&130023424)===0&&(ja=4194304)));var k=Ho();l=qr(l,d),l!==null&&(Vs(l,d,k),fs(l,k))}function W_(l){var d=l.memoizedState,k=0;d!==null&&(k=d.retryLane),oy(l,k)}function $_(l,d){var k=0;switch(l.tag){case 13:var z=l.stateNode,J=l.memoizedState;J!==null&&(k=J.retryLane);break;case 19:z=l.stateNode;break;default:throw Error(t(314))}z!==null&&z.delete(d),oy(l,k)}var sy;sy=function(l,d,k){if(l!==null)if(l.memoizedProps!==d.pendingProps||ia.current)le=!0;else{if((l.lanes&k)===0&&(d.flags&128)===0)return le=!1,v0(l,d,k);le=(l.flags&131072)!==0}else le=!1,ft&&(d.flags&1048576)!==0&&wt(d,ye,d.index);switch(d.lanes=0,d.tag){case 2:var z=d.type;Gr(l,d),l=d.pendingProps;var J=Al(d,Pi.current);wn(d,k),J=ol(null,d,z,l,J,k);var ie=Ja();return d.flags|=1,typeof J=="object"&&J!==null&&typeof J.render=="function"&&J.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,aa(z)?(ie=!0,is(d)):ie=!1,d.memoizedState=J.state!==null&&J.state!==void 0?J.state:null,yu(d),J.updater=kc,d.stateNode=J,J._reactInternals=d,Xf(d,z,l,k),d=bn(null,d,z,!0,ie,k)):(d.tag=0,ft&&ie&&st(d),xe(null,d,J,k),d=d.child),d;case 16:z=d.elementType;e:{switch(Gr(l,d),l=d.pendingProps,J=z._init,z=J(z._payload),d.type=z,J=d.tag=X_(z),l=ma(z,l),J){case 0:d=Wt(null,d,z,l,k);break e;case 1:d=In(null,d,z,l,k);break e;case 11:d=$e(null,d,z,l,k);break e;case 14:d=lt(null,d,z,ma(z.type,l),k);break e}throw Error(t(306,z,""))}return d;case 0:return z=d.type,J=d.pendingProps,J=d.elementType===z?J:ma(z,J),Wt(l,d,z,J,k);case 1:return z=d.type,J=d.pendingProps,J=d.elementType===z?J:ma(z,J),In(l,d,z,J,k);case 3:e:{if(to(d),l===null)throw Error(t(387));z=d.pendingProps,ie=d.memoizedState,J=ie.element,Xu(l,d),Bo(d,z,null,k);var pe=d.memoizedState;if(z=pe.element,ie.isDehydrated)if(ie={element:z,isDehydrated:!1,cache:pe.cache,pendingSuspenseBoundaries:pe.pendingSuspenseBoundaries,transitions:pe.transitions},d.updateQueue.baseState=ie,d.memoizedState=ie,d.flags&256){J=Qu(Error(t(423)),d),d=sl(l,d,z,k,J);break e}else if(z!==J){J=Qu(Error(t(424)),d),d=sl(l,d,z,k,J);break e}else for(Ue=Ui(d.stateNode.containerInfo.firstChild),qe=d,ft=!0,vt=null,k=Ar(d,null,z,k),d.child=k;k;)k.flags=k.flags&-3|4096,k=k.sibling;else{if(xr(),z===J){d=ka(l,d,k);break e}xe(l,d,z,k)}d=d.child}return d;case 5:return bu(d),l===null&&jt(d),z=d.type,J=d.pendingProps,ie=l!==null?l.memoizedProps:null,pe=J.children,uf(z,J)?pe=null:ie!==null&&uf(z,ie)&&(d.flags|=32),Er(l,d),xe(l,d,pe,k),d.child;case 6:return l===null&&jt(d),null;case 13:return dt(l,d,k);case 4:return qo(d,d.stateNode.containerInfo),z=d.pendingProps,l===null?d.child=hi(d,null,z,k):xe(l,d,z,k),d.child;case 11:return z=d.type,J=d.pendingProps,J=d.elementType===z?J:ma(z,J),$e(l,d,z,J,k);case 7:return xe(l,d,d.pendingProps,k),d.child;case 8:return xe(l,d,d.pendingProps.children,k),d.child;case 12:return xe(l,d,d.pendingProps.children,k),d.child;case 10:e:{if(z=d.type._context,J=d.pendingProps,ie=d.memoizedProps,pe=J.value,sn(Vi,z._currentValue),z._currentValue=pe,ie!==null)if(Dr(ie.value,pe)){if(ie.children===J.children&&!ia.current){d=ka(l,d,k);break e}}else for(ie=d.child,ie!==null&&(ie.return=d);ie!==null;){var Ne=ie.dependencies;if(Ne!==null){pe=ie.child;for(var Be=Ne.firstContext;Be!==null;){if(Be.context===z){if(ie.tag===1){Be=Xa(-1,k&-k),Be.tag=2;var ot=ie.updateQueue;if(ot!==null){ot=ot.shared;var At=ot.pending;At===null?Be.next=Be:(Be.next=At.next,At.next=Be),ot.pending=Be}}ie.lanes|=k,Be=ie.alternate,Be!==null&&(Be.lanes|=k),Ya(ie.return,k,d),Ne.lanes|=k;break}Be=Be.next}}else if(ie.tag===10)pe=ie.type===d.type?null:ie.child;else if(ie.tag===18){if(pe=ie.return,pe===null)throw Error(t(341));pe.lanes|=k,Ne=pe.alternate,Ne!==null&&(Ne.lanes|=k),Ya(pe,k,d),pe=ie.sibling}else pe=ie.child;if(pe!==null)pe.return=ie;else for(pe=ie;pe!==null;){if(pe===d){pe=null;break}if(ie=pe.sibling,ie!==null){ie.return=pe.return,pe=ie;break}pe=pe.return}ie=pe}xe(l,d,J.children,k),d=d.child}return d;case 9:return J=d.type,z=d.pendingProps.children,wn(d,k),J=Hn(J),z=z(J),d.flags|=1,xe(l,d,z,k),d.child;case 14:return z=d.type,J=ma(z,d.pendingProps),J=ma(z.type,J),lt(l,d,z,J,k);case 15:return Lt(l,d,d.type,d.pendingProps,k);case 17:return z=d.type,J=d.pendingProps,J=d.elementType===z?J:ma(z,J),Gr(l,d),d.tag=1,aa(z)?(l=!0,is(d)):l=!1,wn(d,k),jp(d,z,J),Xf(d,z,J,k),bn(null,d,z,!0,l,k);case 19:return $i(l,d,k);case 22:return er(l,d,k)}throw Error(t(156,d.tag))};function ly(l,d){return _s(l,d)}function Y_(l,d,k,z){this.tag=l,this.key=k,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=z,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ul(l,d,k,z){return new Y_(l,d,k,z)}function T0(l){return l=l.prototype,!(!l||!l.isReactComponent)}function X_(l){if(typeof l=="function")return T0(l)?1:0;if(l!=null){if(l=l.$$typeof,l===C)return 11;if(l===N)return 14}return 2}function jc(l,d){var k=l.alternate;return k===null?(k=ul(l.tag,d,l.key,l.mode),k.elementType=l.elementType,k.type=l.type,k.stateNode=l.stateNode,k.alternate=l,l.alternate=k):(k.pendingProps=d,k.type=l.type,k.flags=0,k.subtreeFlags=0,k.deletions=null),k.flags=l.flags&14680064,k.childLanes=l.childLanes,k.lanes=l.lanes,k.child=l.child,k.memoizedProps=l.memoizedProps,k.memoizedState=l.memoizedState,k.updateQueue=l.updateQueue,d=l.dependencies,k.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},k.sibling=l.sibling,k.index=l.index,k.ref=l.ref,k}function Yp(l,d,k,z,J,ie){var pe=2;if(z=l,typeof l=="function")T0(l)&&(pe=1);else if(typeof l=="string")pe=5;else e:switch(l){case L:return mf(k.children,J,ie,d);case T:pe=8,J|=8;break;case F:return l=ul(12,k,d,J|2),l.elementType=F,l.lanes=ie,l;case A:return l=ul(13,k,d,J),l.elementType=A,l.lanes=ie,l;case j:return l=ul(19,k,d,J),l.elementType=j,l.lanes=ie,l;case W:return Xp(k,J,ie,d);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case I:pe=10;break e;case O:pe=9;break e;case C:pe=11;break e;case N:pe=14;break e;case B:pe=16,z=null;break e}throw Error(t(130,l==null?l:typeof l,""))}return d=ul(pe,k,d,J),d.elementType=l,d.type=z,d.lanes=ie,d}function mf(l,d,k,z){return l=ul(7,l,z,d),l.lanes=k,l}function Xp(l,d,k,z){return l=ul(22,l,z,d),l.elementType=W,l.lanes=k,l.stateNode={isHidden:!1},l}function R0(l,d,k){return l=ul(6,l,null,d),l.lanes=k,l}function M0(l,d,k){return d=ul(4,l.children!==null?l.children:[],l.key,d),d.lanes=k,d.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},d}function K_(l,d,k,z,J){this.tag=d,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=da(0),this.expirationTimes=da(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=da(0),this.identifierPrefix=z,this.onRecoverableError=J,this.mutableSourceEagerHydrationData=null}function I0(l,d,k,z,J,ie,pe,Ne,Be){return l=new K_(l,d,k,Ne,Be),d===1?(d=1,ie===!0&&(d|=8)):d=0,ie=ul(3,null,null,d),l.current=ie,ie.stateNode=l,ie.memoizedState={element:z,isDehydrated:k,cache:null,transitions:null,pendingSuspenseBoundaries:null},yu(ie),l}function Z_(l,d,k){var z=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:z==null?null:""+z,children:l,containerInfo:d,implementation:k}}function uy(l){if(!l)return ns;l=l._reactInternals;e:{if(hr(l)!==l||l.tag!==1)throw Error(t(170));var d=l;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(aa(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(t(171))}if(l.tag===1){var k=l.type;if(aa(k))return Yu(l,k,d)}return d}function cy(l,d,k,z,J,ie,pe,Ne,Be){return l=I0(k,z,!0,l,J,ie,pe,Ne,Be),l.context=uy(null),k=l.current,z=Ho(),J=Mc(k),ie=Xa(z,J),ie.callback=d??null,Aa(k,ie,J),l.current.lanes=J,Vs(l,J,z),fs(l,z),l}function Kp(l,d,k,z){var J=d.current,ie=Ho(),pe=Mc(J);return k=uy(k),d.context===null?d.context=k:d.pendingContext=k,d=Xa(ie,pe),d.payload={element:l},z=z===void 0?null:z,z!==null&&(d.callback=z),l=Aa(J,d,pe),l!==null&&(Il(l,J,pe,ie),kl(l,J,pe)),pe}function Zp(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return l.child.stateNode;default:return l.child.stateNode}}function fy(l,d){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var k=l.retryLane;l.retryLane=k!==0&&k<d?k:d}}function j0(l,d){fy(l,d),(l=l.alternate)&&fy(l,d)}function Q_(){return null}var hy=typeof reportError=="function"?reportError:function(l){console.error(l)};function F0(l){this._internalRoot=l}Qp.prototype.render=F0.prototype.render=function(l){var d=this._internalRoot;if(d===null)throw Error(t(409));Kp(l,d,null,null)},Qp.prototype.unmount=F0.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var d=l.containerInfo;pf(function(){Kp(null,l,null,null)}),d[Gi]=null}};function Qp(l){this._internalRoot=l}Qp.prototype.unstable_scheduleHydration=function(l){if(l){var d=$o();l={blockedOn:null,target:l,priority:d};for(var k=0;k<lo.length&&d!==0&&d<lo[k].priority;k++);lo.splice(k,0,l),k===0&&Ks(l)}};function D0(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function Jp(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function dy(){}function J_(l,d,k,z,J){if(J){if(typeof z=="function"){var ie=z;z=function(){var ot=Zp(pe);ie.call(ot)}}var pe=cy(d,z,l,0,null,!1,!1,"",dy);return l._reactRootContainer=pe,l[Gi]=pe.current,ks(l.nodeType===8?l.parentNode:l),pf(),pe}for(;J=l.lastChild;)l.removeChild(J);if(typeof z=="function"){var Ne=z;z=function(){var ot=Zp(Be);Ne.call(ot)}}var Be=I0(l,0,!1,null,null,!1,!1,"",dy);return l._reactRootContainer=Be,l[Gi]=Be.current,ks(l.nodeType===8?l.parentNode:l),pf(function(){Kp(d,Be,k,z)}),Be}function e1(l,d,k,z,J){var ie=k._reactRootContainer;if(ie){var pe=ie;if(typeof J=="function"){var Ne=J;J=function(){var Be=Zp(pe);Ne.call(Be)}}Kp(d,pe,l,J)}else pe=J_(k,d,l,J,z);return Zp(pe)}Ws=function(l){switch(l.tag){case 3:var d=l.stateNode;if(d.current.memoizedState.isDehydrated){var k=oi(d.pendingLanes);k!==0&&(iu(d,k|1),fs(d,Fn()),(un&6)===0&&(Jf=Fn()+500,oe()))}break;case 13:pf(function(){var z=qr(l,1);if(z!==null){var J=Ho();Il(z,l,1,J)}}),j0(l,1)}},$s=function(l){if(l.tag===13){var d=qr(l,134217728);if(d!==null){var k=Ho();Il(d,l,134217728,k)}j0(l,134217728)}},yc=function(l){if(l.tag===13){var d=Mc(l),k=qr(l,d);if(k!==null){var z=Ho();Il(k,l,d,z)}j0(l,d)}},$o=function(){return Fr},xs=function(l,d){var k=Fr;try{return Fr=l,d()}finally{Fr=k}},Ct=function(l,d,k){switch(d){case"input":if(it(l,k),d=k.name,k.type==="radio"&&d!=null){for(k=l;k.parentNode;)k=k.parentNode;for(k=k.querySelectorAll("input[name="+JSON.stringify(""+d)+'][type="radio"]'),d=0;d<k.length;d++){var z=k[d];if(z!==l&&z.form===l.form){var J=_i(z);if(!J)throw Error(t(90));_e(z),it(z,J)}}}break;case"textarea":Me(l,k);break;case"select":d=k.value,d!=null&&Te(l,!!k.multiple,d,!1)}},Rr=k0,Je=pf;var e7={usingClientEntryPoint:!1,Events:[vu,fi,_i,Tt,Xt,k0]},Xh={findFiberByHostInstance:Ns,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},t7={bundleType:Xh.bundleType,version:Xh.version,rendererPackageName:Xh.rendererPackageName,rendererConfig:Xh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:S.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=Si(l),l===null?null:l.stateNode},findFiberByHostInstance:Xh.findFiberByHostInstance||Q_,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 t1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t1.isDisabled&&t1.supportsFiber)try{so=t1.inject(t7),gi=t1}catch{}}return hs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=e7,hs.createPortal=function(l,d){var k=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!D0(d))throw Error(t(200));return Z_(l,d,null,k)},hs.createRoot=function(l,d){if(!D0(l))throw Error(t(299));var k=!1,z="",J=hy;return d!=null&&(d.unstable_strictMode===!0&&(k=!0),d.identifierPrefix!==void 0&&(z=d.identifierPrefix),d.onRecoverableError!==void 0&&(J=d.onRecoverableError)),d=I0(l,1,!1,null,null,k,!1,z,J),l[Gi]=d.current,ks(l.nodeType===8?l.parentNode:l),new F0(d)},hs.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var d=l._reactInternals;if(d===void 0)throw typeof l.render=="function"?Error(t(188)):(l=Object.keys(l).join(","),Error(t(268,l)));return l=Si(d),l=l===null?null:l.stateNode,l},hs.flushSync=function(l){return pf(l)},hs.hydrate=function(l,d,k){if(!Jp(d))throw Error(t(200));return e1(null,l,d,!0,k)},hs.hydrateRoot=function(l,d,k){if(!D0(l))throw Error(t(405));var z=k!=null&&k.hydratedSources||null,J=!1,ie="",pe=hy;if(k!=null&&(k.unstable_strictMode===!0&&(J=!0),k.identifierPrefix!==void 0&&(ie=k.identifierPrefix),k.onRecoverableError!==void 0&&(pe=k.onRecoverableError)),d=cy(d,null,l,1,k??null,J,!1,ie,pe),l[Gi]=d.current,ks(l),z)for(l=0;l<z.length;l++)k=z[l],J=k._getVersion,J=J(k._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[k,J]:d.mutableSourceEagerHydrationData.push(k,J);return new Qp(d)},hs.render=function(l,d,k){if(!Jp(d))throw Error(t(200));return e1(null,l,d,!1,k)},hs.unmountComponentAtNode=function(l){if(!Jp(l))throw Error(t(40));return l._reactRootContainer?(pf(function(){e1(null,null,l,!1,function(){l._reactRootContainer=null,l[Gi]=null})}),!0):!1},hs.unstable_batchedUpdates=k0,hs.unstable_renderSubtreeIntoContainer=function(l,d,k,z){if(!Jp(k))throw Error(t(200));if(l==null||l._reactInternals===void 0)throw Error(t(38));return e1(l,d,k,!1,z)},hs.version="18.3.1-next-f1338f8080-20240426",hs}var by;function pw(){if(by)return q0.exports;by=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),q0.exports=a7(),q0.exports}var wy;function o7(){if(wy)return r1;wy=1;var e=pw();return r1.createRoot=e.createRoot,r1.hydrateRoot=e.hydrateRoot,r1}var s7=o7();const gw=yp(s7);var Kh={};function kr(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(t.length?" "+t.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var l7={};function z1(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:l7}var vw=Object.assign,P1=Object.getOwnPropertyDescriptor,Nu=Object.defineProperty,bp=Object.prototype,h2=[];Object.freeze(h2);var q2={};Object.freeze(q2);var u7=typeof Proxy<"u",c7=Object.toString();function mw(){u7||kr("Proxy not available")}function yw(e){var r=!1;return function(){if(!r)return r=!0,e.apply(this,arguments)}}var ch=function(){};function qs(e){return typeof e=="function"}function Af(e){var r=typeof e;switch(r){case"string":case"symbol":case"number":return!0}return!1}function U1(e){return e!==null&&typeof e=="object"}function dc(e){if(!U1(e))return!1;var r=Object.getPrototypeOf(e);if(r==null)return!0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t.toString()===c7}function bw(e){var r=e==null?void 0:e.constructor;return r?r.name==="GeneratorFunction"||r.displayName==="GeneratorFunction":!1}function wp(e,r,t){Nu(e,r,{enumerable:!1,writable:!0,configurable:!0,value:t})}function ww(e,r,t){Nu(e,r,{enumerable:!1,writable:!1,configurable:!0,value:t})}function Qc(e,r){var t="isMobX"+e;return r.prototype[t]=!0,function(n){return U1(n)&&n[t]===!0}}function Th(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function f7(e){var r=Object.getPrototypeOf(e),t=Object.getPrototypeOf(r),n=Object.getPrototypeOf(t);return n===null}function uc(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var _w=typeof Object.getOwnPropertySymbols<"u";function h7(e){var r=Object.keys(e);if(!_w)return r;var t=Object.getOwnPropertySymbols(e);return t.length?[].concat(r,t.filter(function(n){return bp.propertyIsEnumerable.call(e,n)})):r}var wh=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:_w?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Sw(e){return e===null?null:typeof e=="object"?""+e:e}function cc(e,r){return bp.hasOwnProperty.call(e,r)}var d7=Object.getOwnPropertyDescriptors||function(r){var t={};return wh(r).forEach(function(n){t[n]=P1(r,n)}),t};function Fs(e,r){return!!(e&r)}function Ds(e,r,t){return t?e|=r:e&=~r,e}function _y(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function p7(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,v7(n.key),n)}}function Rh(e,r,t){return r&&p7(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function fh(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=m7(e))||r){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
33
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $c(){return $c=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},$c.apply(null,arguments)}function xw(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,d2(e,r)}function d2(e,r){return d2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},d2(e,r)}function g7(e,r){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function v7(e){var r=g7(e,"string");return typeof r=="symbol"?r:r+""}function m7(e,r){if(e){if(typeof e=="string")return _y(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_y(e,r):void 0}}var ku=Symbol("mobx-stored-annotations");function Wl(e){function r(t,n){if(Sp(n))return e.decorate_20223_(t,n);_p(t,n,e)}return Object.assign(r,e)}function _p(e,r,t){cc(e,ku)||wp(e,ku,$c({},e[ku])),O7(t)||(e[ku][r]=t)}function y7(e){return cc(e,ku)||wp(e,ku,$c({},e[ku])),e[ku]}function Sp(e){return typeof e=="object"&&typeof e.kind=="string"}var fr=Symbol("mobx administration"),Jc=function(){function e(t){t===void 0&&(t="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=vn.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=t}var r=e.prototype;return r.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},r.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},r.reportObserved=function(){return Uw(this)},r.reportChanged=function(){ps(),Hw(this),gs()},r.toString=function(){return this.name_},Rh(e,[{key:"isBeingObserved",get:function(){return Fs(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return Fs(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return Fs(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Ds(this.flags_,e.diffValueMask_,n===1)}}])}();Jc.isBeingObservedMask_=1;Jc.isPendingUnobservationMask_=2;Jc.diffValueMask_=4;var z2=Qc("Atom",Jc);function fp(e,r,t){r===void 0&&(r=ch),t===void 0&&(t=ch);var n=new Jc(e);return r!==ch&&Qw(n,r),t!==ch&&$2(n,t),n}function b7(e,r){return e===r}function w7(e,r){return nm(e,r)}function _7(e,r){return nm(e,r,1)}function S7(e,r){return Object.is?Object.is(e,r):e===r?e!==0||1/e===1/r:e!==e&&r!==r}var Cf={identity:b7,structural:w7,default:S7,shallow:_7};function kf(e,r,t){return K1(e)?e:Array.isArray(e)?jn.array(e,{name:t}):dc(e)?jn.object(e,void 0,{name:t}):Th(e)?jn.map(e,{name:t}):uc(e)?jn.set(e,{name:t}):typeof e=="function"&&!xh(e)&&!Eh(e)?bw(e)?Nf(e):_h(t,e):e}function x7(e,r,t){if(e==null||Ra(e)||Go(e)||ao(e)||ba(e))return e;if(Array.isArray(e))return jn.array(e,{name:t,deep:!1});if(dc(e))return jn.object(e,void 0,{name:t,deep:!1});if(Th(e))return jn.map(e,{name:t,deep:!1});if(uc(e))return jn.set(e,{name:t,deep:!1})}function H1(e){return e}function E7(e,r){return nm(e,r)?r:e}var Ew="override",P7=Wl({annotationType_:Ew,make_:A7,extend_:C7,decorate_20223_:k7});function O7(e){return e.annotationType_===Ew}function A7(e,r){return 0}function C7(e,r,t,n){kr("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function k7(e,r){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}function xp(e,r){return{annotationType_:e,options_:r,make_:L7,extend_:N7,decorate_20223_:T7}}function L7(e,r,t,n){var a;if((a=this.options_)!=null&&a.bound)return this.extend_(e,r,t,!1)===null?0:1;if(n===e.target_)return this.extend_(e,r,t,!1)===null?0:2;if(xh(t.value))return 1;var i=Pw(e,this,r,t,!1);return Nu(n,r,i),2}function N7(e,r,t,n){var a=Pw(e,this,r,t);return e.defineProperty_(r,a,n)}function T7(e,r){var t=r.kind,n=r.name,a=r.addInitializer,i=this,o=function(c){var h,p,v,f;return Yc((h=(p=i.options_)==null?void 0:p.name)!=null?h:n.toString(),c,(v=(f=i.options_)==null?void 0:f.autoAction)!=null?v:!1)};if(t=="field")return function(u){var c,h=u;return xh(h)||(h=o(h)),(c=i.options_)!=null&&c.bound&&(h=h.bind(this),h.isMobxAction=!0),h};if(t=="method"){var s;return xh(e)||(e=o(e)),(s=this.options_)!=null&&s.bound&&a(function(){var u=this,c=u[n].bind(u);c.isMobxAction=!0,u[n]=c}),e}kr("Cannot apply '"+i.annotationType_+"' to '"+String(n)+"' (kind: "+t+"):"+(`
|
|
34
|
-
'`+i.annotationType_+"' can only be used on properties with a function value."))}function R7(e,r,t,n){r.annotationType_,n.value}function Pw(e,r,t,n,a){var i,o,s,u,c,h,p;a===void 0&&(a=Mt.safeDescriptors),R7(e,r,t,n);var v=n.value;if((i=r.options_)!=null&&i.bound){var f;v=v.bind((f=e.proxy_)!=null?f:e.target_)}return{value:Yc((o=(s=r.options_)==null?void 0:s.name)!=null?o:t.toString(),v,(u=(c=r.options_)==null?void 0:c.autoAction)!=null?u:!1,(h=r.options_)!=null&&h.bound?(p=e.proxy_)!=null?p:e.target_:void 0),configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function Ow(e,r){return{annotationType_:e,options_:r,make_:M7,extend_:I7,decorate_20223_:j7}}function M7(e,r,t,n){var a;if(n===e.target_)return this.extend_(e,r,t,!1)===null?0:2;if((a=this.options_)!=null&&a.bound&&(!cc(e.target_,r)||!Eh(e.target_[r]))&&this.extend_(e,r,t,!1)===null)return 0;if(Eh(t.value))return 1;var i=Aw(e,this,r,t,!1,!1);return Nu(n,r,i),2}function I7(e,r,t,n){var a,i=Aw(e,this,r,t,(a=this.options_)==null?void 0:a.bound);return e.defineProperty_(r,i,n)}function j7(e,r){var t,n=r.name,a=r.addInitializer;return Eh(e)||(e=Nf(e)),(t=this.options_)!=null&&t.bound&&a(function(){var i=this,o=i[n].bind(i);o.isMobXFlow=!0,i[n]=o}),e}function F7(e,r,t,n){r.annotationType_,n.value}function Aw(e,r,t,n,a,i){i===void 0&&(i=Mt.safeDescriptors),F7(e,r,t,n);var o=n.value;if(Eh(o)||(o=Nf(o)),a){var s;o=o.bind((s=e.proxy_)!=null?s:e.target_),o.isMobXFlow=!0}return{value:o,configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function U2(e,r){return{annotationType_:e,options_:r,make_:D7,extend_:B7,decorate_20223_:q7}}function D7(e,r,t){return this.extend_(e,r,t,!1)===null?0:1}function B7(e,r,t,n){return z7(e,this,r,t),e.defineComputedProperty_(r,$c({},this.options_,{get:t.get,set:t.set}),n)}function q7(e,r){var t=this,n=r.name,a=r.addInitializer;return a(function(){var i=Mf(this)[fr],o=$c({},t.options_,{get:e,context:this});o.name||(o.name="ObservableObject."+n.toString()),i.values_.set(n,new Xl(o))}),function(){return this[fr].getObservablePropValue_(n)}}function z7(e,r,t,n){r.annotationType_,n.get}function G1(e,r){return{annotationType_:e,options_:r,make_:U7,extend_:H7,decorate_20223_:G7}}function U7(e,r,t){return this.extend_(e,r,t,!1)===null?0:1}function H7(e,r,t,n){var a,i;return V7(e,this),e.defineObservableProperty_(r,t.value,(a=(i=this.options_)==null?void 0:i.enhancer)!=null?a:kf,n)}function G7(e,r){var t=this,n=r.kind,a=r.name,i=new WeakSet;function o(s,u){var c,h,p=Mf(s)[fr],v=new Vc(u,(c=(h=t.options_)==null?void 0:h.enhancer)!=null?c:kf,"ObservableObject."+a.toString(),!1);p.values_.set(a,v),i.add(s)}if(n=="accessor")return{get:function(){return i.has(this)||o(this,e.get.call(this)),this[fr].getObservablePropValue_(a)},set:function(u){return i.has(this)||o(this,u),this[fr].setObservablePropValue_(a,u)},init:function(u){return i.has(this)||o(this,u),u}}}function V7(e,r,t,n){r.annotationType_}var W7="true",$7=Cw();function Cw(e){return{annotationType_:W7,options_:e,make_:Y7,extend_:X7,decorate_20223_:K7}}function Y7(e,r,t,n){var a,i;if(t.get)return Tf.make_(e,r,t,n);if(t.set){var o=Yc(r.toString(),t.set);return n===e.target_?e.defineProperty_(r,{configurable:Mt.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(Nu(n,r,{configurable:!0,set:o}),2)}if(n!==e.target_&&typeof t.value=="function"){var s;if(bw(t.value)){var u,c=(u=this.options_)!=null&&u.autoBind?Nf.bound:Nf;return c.make_(e,r,t,n)}var h=(s=this.options_)!=null&&s.autoBind?_h.bound:_h;return h.make_(e,r,t,n)}var p=((a=this.options_)==null?void 0:a.deep)===!1?jn.ref:jn;if(typeof t.value=="function"&&(i=this.options_)!=null&&i.autoBind){var v;t.value=t.value.bind((v=e.proxy_)!=null?v:e.target_)}return p.make_(e,r,t,n)}function X7(e,r,t,n){var a,i;if(t.get)return Tf.extend_(e,r,t,n);if(t.set)return e.defineProperty_(r,{configurable:Mt.safeDescriptors?e.isPlainObject_:!0,set:Yc(r.toString(),t.set)},n);if(typeof t.value=="function"&&(a=this.options_)!=null&&a.autoBind){var o;t.value=t.value.bind((o=e.proxy_)!=null?o:e.target_)}var s=((i=this.options_)==null?void 0:i.deep)===!1?jn.ref:jn;return s.extend_(e,r,t,n)}function K7(e,r){kr("'"+this.annotationType_+"' cannot be used as a decorator")}var Z7="observable",Q7="observable.ref",J7="observable.shallow",e9="observable.struct",kw={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(kw);function n1(e){return e||kw}var p2=G1(Z7),t9=G1(Q7,{enhancer:H1}),r9=G1(J7,{enhancer:x7}),n9=G1(e9,{enhancer:E7}),Lw=Wl(p2);function i1(e){return e.deep===!0?kf:e.deep===!1?H1:a9(e.defaultDecorator)}function i9(e){var r;return e?(r=e.defaultDecorator)!=null?r:Cw(e):void 0}function a9(e){var r,t;return e&&(r=(t=e.options_)==null?void 0:t.enhancer)!=null?r:kf}function Nw(e,r,t){if(Sp(r))return p2.decorate_20223_(e,r);if(Af(r)){_p(e,r,p2);return}return K1(e)?e:dc(e)?jn.object(e,r,t):Array.isArray(e)?jn.array(e,r):Th(e)?jn.map(e,r):uc(e)?jn.set(e,r):typeof e=="object"&&e!==null?e:jn.box(e,r)}vw(Nw,Lw);var o9={box:function(r,t){var n=n1(t);return new Vc(r,i1(n),n.name,!0,n.equals)},array:function(r,t){var n=n1(t);return(Mt.useProxies===!1||n.proxy===!1?hS:rS)(r,i1(n),n.name)},map:function(r,t){var n=n1(t);return new Q1(r,i1(n),n.name)},set:function(r,t){var n=n1(t);return new tm(r,i1(n),n.name)},object:function(r,t,n){return ef(function(){return Y2(Mt.useProxies===!1||(n==null?void 0:n.proxy)===!1?Mf({},n):Q9({},n),r,t)})},ref:Wl(t9),shallow:Wl(r9),deep:Lw,struct:Wl(n9)},jn=vw(Nw,o9),Tw="computed",s9="computed.struct",g2=U2(Tw),l9=U2(s9,{equals:Cf.structural}),Tf=function(r,t){if(Sp(t))return g2.decorate_20223_(r,t);if(Af(t))return _p(r,t,g2);if(dc(r))return Wl(U2(Tw,r));var n=dc(t)?t:{};return n.get=r,n.name||(n.name=r.name||""),new Xl(n)};Object.assign(Tf,g2);Tf.struct=Wl(l9);var Sy,xy,O1=0,u9=1,c9=(Sy=(xy=P1(function(){},"name"))==null?void 0:xy.configurable)!=null?Sy:!1,Ey={value:"action",configurable:!0,writable:!1,enumerable:!1};function Yc(e,r,t,n){t===void 0&&(t=!1);function a(){return Rw(e,t,r,n||this,arguments)}return a.isMobxAction=!0,a.toString=function(){return r.toString()},c9&&(Ey.value=e,Nu(a,"name",Ey)),a}function Rw(e,r,t,n,a){var i=Mw(e,r);try{return t.apply(n,a)}catch(o){throw i.error_=o,o}finally{Iw(i)}}function Mw(e,r,t,n){var a=!1,i=0,o=Mt.trackingDerivation,s=!r||!o;ps();var u=Mt.allowStateChanges;s&&(Rf(),u=V1(!0));var c=$1(!0),h={runAsAction_:s,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:c,notifySpy_:a,startTime_:i,actionId_:u9++,parentActionId_:O1};return O1=h.actionId_,h}function Iw(e){O1!==e.actionId_&&kr(30),O1=e.parentActionId_,e.error_!==void 0&&(Mt.suppressReactionErrors=!0),W1(e.prevAllowStateChanges_),ph(e.prevAllowStateReads_),gs(),e.runAsAction_&&fc(e.prevDerivation_),Mt.suppressReactionErrors=!1}function H2(e,r){var t=V1(e);try{return r()}finally{W1(t)}}function V1(e){var r=Mt.allowStateChanges;return Mt.allowStateChanges=e,r}function W1(e){Mt.allowStateChanges=e}var Vc=function(e){function r(n,a,i,o,s){var u;return i===void 0&&(i="ObservableValue"),s===void 0&&(s=Cf.default),u=e.call(this,i)||this,u.enhancer=void 0,u.name_=void 0,u.equals=void 0,u.hasUnreportedChange_=!1,u.interceptors_=void 0,u.changeListeners_=void 0,u.value_=void 0,u.dehancer=void 0,u.enhancer=a,u.name_=i,u.equals=s,u.value_=a(n,void 0,i),u}xw(r,e);var t=r.prototype;return t.dehanceValue=function(a){return this.dehancer!==void 0?this.dehancer(a):a},t.set=function(a){this.value_,a=this.prepareNewValue_(a),a!==Mt.UNCHANGED&&this.setNewValue_(a)},t.prepareNewValue_=function(a){if(cl(this)){var i=fl(this,{object:this,type:Tu,newValue:a});if(!i)return Mt.UNCHANGED;a=i.newValue}return a=this.enhancer(a,this.value_,this.name_),this.equals(this.value_,a)?Mt.UNCHANGED:a},t.setNewValue_=function(a){var i=this.value_;this.value_=a,this.reportChanged(),$l(this)&&Yl(this,{type:Tu,object:this,newValue:a,oldValue:i})},t.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},t.intercept_=function(a){return Ep(this,a)},t.observe_=function(a,i){return i&&a({observableKind:"value",debugObjectName:this.name_,object:this,type:Tu,newValue:this.value_,oldValue:void 0}),Pp(this,a)},t.raw=function(){return this.value_},t.toJSON=function(){return this.get()},t.toString=function(){return this.name_+"["+this.value_+"]"},t.valueOf=function(){return Sw(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},r}(Jc),G2=Qc("ObservableValue",Vc),Xl=function(){function e(t){this.dependenciesState_=vn.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=vn.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new C1(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=A1.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,t.get||kr(31),this.derivation=t.get,this.name_=t.name||"ComputedValue",t.set&&(this.setter_=Yc("ComputedValue-setter",t.set)),this.equals_=t.equals||(t.compareStructural||t.struct?Cf.structural:Cf.default),this.scope_=t.context,this.requiresReaction_=t.requiresReaction,this.keepAlive_=!!t.keepAlive}var r=e.prototype;return r.onBecomeStale_=function(){w9(this)},r.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},r.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},r.get=function(){if(this.isComputing&&kr(32,this.name_,this.derivation),Mt.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)v2(this)&&(this.warnAboutUntrackedRead_(),ps(),this.value_=this.computeValue_(!1),gs());else if(Uw(this),v2(this)){var n=Mt.trackingContext;this.keepAlive_&&!n&&(Mt.trackingContext=this),this.trackAndCompute()&&b9(this),Mt.trackingContext=n}var a=this.value_;if(g1(a))throw a.cause;return a},r.set=function(n){if(this.setter_){this.isRunningSetter&&kr(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else kr(34,this.name_)},r.trackAndCompute=function(){var n=this.value_,a=this.dependenciesState_===vn.NOT_TRACKING_,i=this.computeValue_(!0),o=a||g1(n)||g1(i)||!this.equals_(n,i);return o&&(this.value_=i),o},r.computeValue_=function(n){this.isComputing=!0;var a=V1(!1),i;if(n)i=jw(this,this.derivation,this.scope_);else if(Mt.disableErrorBoundaries===!0)i=this.derivation.call(this.scope_);else try{i=this.derivation.call(this.scope_)}catch(o){i=new C1(o)}return W1(a),this.isComputing=!1,i},r.suspend_=function(){this.keepAlive_||(m2(this),this.value_=void 0)},r.observe_=function(n,a){var i=this,o=!0,s=void 0;return W2(function(){var u=i.get();if(!o||a){var c=Rf();n({observableKind:"computed",debugObjectName:i.name_,type:Tu,object:i,newValue:u,oldValue:s}),fc(c)}o=!1,s=u})},r.warnAboutUntrackedRead_=function(){},r.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},r.valueOf=function(){return Sw(this.get())},r[Symbol.toPrimitive]=function(){return this.valueOf()},Rh(e,[{key:"isComputing",get:function(){return Fs(this.flags_,e.isComputingMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return Fs(this.flags_,e.isRunningSetterMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return Fs(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return Fs(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return Fs(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Ds(this.flags_,e.diffValueMask_,n===1)}}])}();Xl.isComputingMask_=1;Xl.isRunningSetterMask_=2;Xl.isBeingObservedMask_=4;Xl.isPendingUnobservationMask_=8;Xl.diffValueMask_=16;var Lf=Qc("ComputedValue",Xl),vn;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(vn||(vn={}));var A1;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(A1||(A1={}));var C1=function(r){this.cause=void 0,this.cause=r};function g1(e){return e instanceof C1}function v2(e){switch(e.dependenciesState_){case vn.UP_TO_DATE_:return!1;case vn.NOT_TRACKING_:case vn.STALE_:return!0;case vn.POSSIBLY_STALE_:{for(var r=$1(!0),t=Rf(),n=e.observing_,a=n.length,i=0;i<a;i++){var o=n[i];if(Lf(o)){if(Mt.disableErrorBoundaries)o.get();else try{o.get()}catch{return fc(t),ph(r),!0}if(e.dependenciesState_===vn.STALE_)return fc(t),ph(r),!0}}return Fw(e),fc(t),ph(r),!1}}}function f9(){return Mt.trackingDerivation!==null}function jw(e,r,t){var n=$1(!0);Fw(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++Mt.runId;var a=Mt.trackingDerivation;Mt.trackingDerivation=e,Mt.inBatch++;var i;if(Mt.disableErrorBoundaries===!0)i=r.call(t);else try{i=r.call(t)}catch(o){i=new C1(o)}return Mt.inBatch--,Mt.trackingDerivation=a,h9(e),ph(n),i}function h9(e){for(var r=e.observing_,t=e.observing_=e.newObserving_,n=vn.UP_TO_DATE_,a=0,i=e.unboundDepsCount_,o=0;o<i;o++){var s=t[o];s.diffValue===0&&(s.diffValue=1,a!==o&&(t[a]=s),a++),s.dependenciesState_>n&&(n=s.dependenciesState_)}for(t.length=a,e.newObserving_=null,i=r.length;i--;){var u=r[i];u.diffValue===0&&qw(u,e),u.diffValue=0}for(;a--;){var c=t[a];c.diffValue===1&&(c.diffValue=0,y9(c,e))}n!==vn.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function m2(e){var r=e.observing_;e.observing_=[];for(var t=r.length;t--;)qw(r[t],e);e.dependenciesState_=vn.NOT_TRACKING_}function V2(e){var r=Rf();try{return e()}finally{fc(r)}}function Rf(){var e=Mt.trackingDerivation;return Mt.trackingDerivation=null,e}function fc(e){Mt.trackingDerivation=e}function $1(e){var r=Mt.allowStateReads;return Mt.allowStateReads=e,r}function ph(e){Mt.allowStateReads=e}function Fw(e){if(e.dependenciesState_!==vn.UP_TO_DATE_){e.dependenciesState_=vn.UP_TO_DATE_;for(var r=e.observing_,t=r.length;t--;)r[t].lowestObserverState_=vn.UP_TO_DATE_}}var d9=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],op=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},v1=!0,Dw=!1,Mt=function(){var e=z1();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(v1=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new op().version&&(v1=!1),v1?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new op):(setTimeout(function(){Dw||kr(35)},1),new op)}();function p9(){if((Mt.pendingReactions.length||Mt.inBatch||Mt.isRunningReactions)&&kr(36),Dw=!0,v1){var e=z1();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Mt=new op}}function Bw(){return Mt}function g9(){var e=new op;for(var r in e)d9.indexOf(r)===-1&&(Mt[r]=e[r]);Mt.allowStateChanges=!Mt.enforceActions}function v9(e){return e.observers_&&e.observers_.size>0}function m9(e){return e.observers_}function y9(e,r){e.observers_.add(r),e.lowestObserverState_>r.dependenciesState_&&(e.lowestObserverState_=r.dependenciesState_)}function qw(e,r){e.observers_.delete(r),e.observers_.size===0&&zw(e)}function zw(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,Mt.pendingUnobservations.push(e))}function ps(){Mt.inBatch++}function gs(){if(--Mt.inBatch===0){Gw();for(var e=Mt.pendingUnobservations,r=0;r<e.length;r++){var t=e[r];t.isPendingUnobservation=!1,t.observers_.size===0&&(t.isBeingObserved&&(t.isBeingObserved=!1,t.onBUO()),t instanceof Xl&&t.suspend_())}Mt.pendingUnobservations=[]}}function Uw(e){var r=Mt.trackingDerivation;return r!==null?(r.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=r.runId_,r.newObserving_[r.unboundDepsCount_++]=e,!e.isBeingObserved&&Mt.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&Mt.inBatch>0&&zw(e),!1)}function Hw(e){e.lowestObserverState_!==vn.STALE_&&(e.lowestObserverState_=vn.STALE_,e.observers_.forEach(function(r){r.dependenciesState_===vn.UP_TO_DATE_&&r.onBecomeStale_(),r.dependenciesState_=vn.STALE_}))}function b9(e){e.lowestObserverState_!==vn.STALE_&&(e.lowestObserverState_=vn.STALE_,e.observers_.forEach(function(r){r.dependenciesState_===vn.POSSIBLY_STALE_?r.dependenciesState_=vn.STALE_:r.dependenciesState_===vn.UP_TO_DATE_&&(e.lowestObserverState_=vn.UP_TO_DATE_)}))}function w9(e){e.lowestObserverState_===vn.UP_TO_DATE_&&(e.lowestObserverState_=vn.POSSIBLY_STALE_,e.observers_.forEach(function(r){r.dependenciesState_===vn.UP_TO_DATE_&&(r.dependenciesState_=vn.POSSIBLY_STALE_,r.onBecomeStale_())}))}var Kl=function(){function e(t,n,a,i){t===void 0&&(t="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=vn.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=A1.NONE,this.name_=t,this.onInvalidate_=n,this.errorHandler_=a,this.requiresObservable_=i}var r=e.prototype;return r.onBecomeStale_=function(){this.schedule_()},r.schedule_=function(){this.isScheduled||(this.isScheduled=!0,Mt.pendingReactions.push(this),Gw())},r.runReaction_=function(){if(!this.isDisposed){ps(),this.isScheduled=!1;var n=Mt.trackingContext;if(Mt.trackingContext=this,v2(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(a){this.reportExceptionInDerivation_(a)}}Mt.trackingContext=n,gs()}},r.track=function(n){if(!this.isDisposed){ps(),this.isRunning=!0;var a=Mt.trackingContext;Mt.trackingContext=this;var i=jw(this,n,void 0);Mt.trackingContext=a,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&m2(this),g1(i)&&this.reportExceptionInDerivation_(i.cause),gs()}},r.reportExceptionInDerivation_=function(n){var a=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(Mt.disableErrorBoundaries)throw n;var i="[mobx] uncaught error in '"+this+"'";Mt.suppressReactionErrors||console.error(i,n),Mt.globalReactionErrorHandlers.forEach(function(o){return o(n,a)})},r.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(ps(),m2(this),gs()))},r.getDisposer_=function(n){var a=this,i=function o(){a.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",o)};return n==null||n.addEventListener==null||n.addEventListener("abort",i),i[fr]=this,i},r.toString=function(){return"Reaction["+this.name_+"]"},r.trace=function(n){},Rh(e,[{key:"isDisposed",get:function(){return Fs(this.flags_,e.isDisposedMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isDisposedMask_,n)}},{key:"isScheduled",get:function(){return Fs(this.flags_,e.isScheduledMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isScheduledMask_,n)}},{key:"isTrackPending",get:function(){return Fs(this.flags_,e.isTrackPendingMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isTrackPendingMask_,n)}},{key:"isRunning",get:function(){return Fs(this.flags_,e.isRunningMask_)},set:function(n){this.flags_=Ds(this.flags_,e.isRunningMask_,n)}},{key:"diffValue",get:function(){return Fs(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Ds(this.flags_,e.diffValueMask_,n===1)}}])}();Kl.isDisposedMask_=1;Kl.isScheduledMask_=2;Kl.isTrackPendingMask_=4;Kl.isRunningMask_=8;Kl.diffValueMask_=16;function _9(e){return Mt.globalReactionErrorHandlers.push(e),function(){var r=Mt.globalReactionErrorHandlers.indexOf(e);r>=0&&Mt.globalReactionErrorHandlers.splice(r,1)}}var S9=100,y2=function(r){return r()};function Gw(){Mt.inBatch>0||Mt.isRunningReactions||y2(x9)}function x9(){Mt.isRunningReactions=!0;for(var e=Mt.pendingReactions,r=0;e.length>0;){++r===S9&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var t=e.splice(0),n=0,a=t.length;n<a;n++)t[n].runReaction_()}Mt.isRunningReactions=!1}var k1=Qc("Reaction",Kl);function E9(e){var r=y2;y2=function(n){return e(function(){return r(n)})}}function sp(){return!1}function Vw(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var Ww="action",P9="action.bound",$w="autoAction",O9="autoAction.bound",Yw="<unnamed action>",b2=xp(Ww),A9=xp(P9,{bound:!0}),w2=xp($w,{autoAction:!0}),C9=xp(O9,{autoAction:!0,bound:!0});function Xw(e){var r=function(n,a){if(qs(n))return Yc(n.name||Yw,n,e);if(qs(a))return Yc(n,a,e);if(Sp(a))return(e?w2:b2).decorate_20223_(n,a);if(Af(a))return _p(n,a,e?w2:b2);if(Af(n))return Wl(xp(e?$w:Ww,{name:n,autoAction:e}))};return r}var ca=Xw(!1);Object.assign(ca,b2);var _h=Xw(!0);Object.assign(_h,w2);ca.bound=Wl(A9);_h.bound=Wl(C9);function Sh(e){return Rw(e.name||Yw,!1,e,this,void 0)}function xh(e){return qs(e)&&e.isMobxAction===!0}function W2(e,r){var t,n,a,i;r===void 0&&(r=q2);var o=(t=(n=r)==null?void 0:n.name)!=null?t:"Autorun",s=!r.scheduler&&!r.delay,u;if(s)u=new Kl(o,function(){this.track(p)},r.onError,r.requiresObservable);else{var c=Kw(r),h=!1;u=new Kl(o,function(){h||(h=!0,c(function(){h=!1,u.isDisposed||u.track(p)}))},r.onError,r.requiresObservable)}function p(){e(u)}return(a=r)!=null&&(a=a.signal)!=null&&a.aborted||u.schedule_(),u.getDisposer_((i=r)==null?void 0:i.signal)}var k9=function(r){return r()};function Kw(e){return e.scheduler?e.scheduler:e.delay?function(r){return setTimeout(r,e.delay)}:k9}function Zw(e,r,t){var n,a,i;t===void 0&&(t=q2);var o=(n=t.name)!=null?n:"Reaction",s=ca(o,t.onError?L9(t.onError,r):r),u=!t.scheduler&&!t.delay,c=Kw(t),h=!0,p=!1,v,f=t.compareStructural?Cf.structural:t.equals||Cf.default,_=new Kl(o,function(){h||u?E():p||(p=!0,c(E))},t.onError,t.requiresObservable);function E(){if(p=!1,!_.isDisposed){var w=!1,x=v;_.track(function(){var y=H2(!1,function(){return e(_)});w=h||!f(v,y),v=y}),(h&&t.fireImmediately||!h&&w)&&s(v,x,_),h=!1}}return(a=t)!=null&&(a=a.signal)!=null&&a.aborted||_.schedule_(),_.getDisposer_((i=t)==null?void 0:i.signal)}function L9(e,r){return function(){try{return r.apply(this,arguments)}catch(t){e.call(this,t)}}}var N9="onBO",T9="onBUO";function Qw(e,r,t){return Jw(N9,e,r,t)}function $2(e,r,t){return Jw(T9,e,r,t)}function Jw(e,r,t,n){var a=typeof n=="function"?Mu(r,t):Mu(r),i=qs(n)?n:t,o=e+"L";return a[o]?a[o].add(i):a[o]=new Set([i]),function(){var s=a[o];s&&(s.delete(i),s.size===0&&delete a[o])}}var R9="never",a1="always",M9="observed";function e6(e){e.isolateGlobalState===!0&&p9();var r=e.useProxies,t=e.enforceActions;if(r!==void 0&&(Mt.useProxies=r===a1?!0:r===R9?!1:typeof Proxy<"u"),r==="ifavailable"&&(Mt.verifyProxies=!0),t!==void 0){var n=t===a1?a1:t===M9;Mt.enforceActions=n,Mt.allowStateChanges=!(n===!0||n===a1)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(a){a in e&&(Mt[a]=!!e[a])}),Mt.allowStateReads=!Mt.observableRequiresReaction,e.reactionScheduler&&E9(e.reactionScheduler)}function Y2(e,r,t,n){var a=d7(r);return ef(function(){var i=Mf(e,n)[fr];wh(a).forEach(function(o){i.extend_(o,a[o],t&&o in t?t[o]:!0)})}),e}function t6(e,r){return r6(Mu(e,r))}function r6(e){var r={name:e.name_};return e.observing_&&e.observing_.length>0&&(r.dependencies=j9(e.observing_).map(r6)),r}function I9(e,r){return n6(Mu(e,r))}function n6(e){var r={name:e.name_};return v9(e)&&(r.observers=Array.from(m9(e)).map(n6)),r}function j9(e){return Array.from(new Set(e))}var F9=0;function Y1(){this.message="FLOW_CANCELLED"}Y1.prototype=Object.create(Error.prototype);function D9(e){return e instanceof Y1}var H0=Ow("flow"),B9=Ow("flow.bound",{bound:!0}),Nf=Object.assign(function(r,t){if(Sp(t))return H0.decorate_20223_(r,t);if(Af(t))return _p(r,t,H0);var n=r,a=n.name||"<unnamed flow>",i=function(){var s=this,u=arguments,c=++F9,h=ca(a+" - runid: "+c+" - init",n).apply(s,u),p,v=void 0,f=new Promise(function(_,E){var w=0;p=E;function x(S){v=void 0;var b;try{b=ca(a+" - runid: "+c+" - yield "+w++,h.next).call(h,S)}catch(R){return E(R)}g(b)}function y(S){v=void 0;var b;try{b=ca(a+" - runid: "+c+" - yield "+w++,h.throw).call(h,S)}catch(R){return E(R)}g(b)}function g(S){if(qs(S==null?void 0:S.then)){S.then(g,E);return}return S.done?_(S.value):(v=Promise.resolve(S.value),v.then(x,y))}x(void 0)});return f.cancel=ca(a+" - runid: "+c+" - cancel",function(){try{v&&Py(v);var _=h.return(void 0),E=Promise.resolve(_.value);E.then(ch,ch),Py(E),p(new Y1)}catch(w){p(w)}}),f};return i.isMobXFlow=!0,i},H0);Nf.bound=Wl(B9);function Py(e){qs(e.cancel)&&e.cancel()}function q9(e){return e}function Eh(e){return(e==null?void 0:e.isMobXFlow)===!0}function X2(e,r,t){var n;return ao(e)||Go(e)||G2(e)?n=Zl(e):Ra(e)&&(n=Zl(e,r)),n.dehancer=typeof r=="function"?r:t,function(){n.dehancer=void 0}}function X1(e,r,t){return qs(t)?U9(e,r,t):z9(e,r)}function z9(e,r){return Zl(e).intercept_(r)}function U9(e,r,t){return Zl(e,r).intercept_(t)}function i6(e,r){if(r===void 0)return Lf(e);if(Ra(e)===!1||!e[fr].values_.has(r))return!1;var t=Mu(e,r);return Lf(t)}function H9(e){return i6(e)}function a6(e,r){return i6(e,r)}function o6(e,r){return e?r!==void 0?Ra(e)?e[fr].values_.has(r):!1:Ra(e)||!!e[fr]||z2(e)||k1(e)||Lf(e):!1}function K1(e){return o6(e)}function s6(e,r){return o6(e,r)}function hp(e){if(Ra(e))return e[fr].keys_();if(ao(e)||ba(e))return Array.from(e.keys());if(Go(e))return e.map(function(r,t){return t});kr(5)}function K2(e){if(Ra(e))return hp(e).map(function(r){return e[r]});if(ao(e))return hp(e).map(function(r){return e.get(r)});if(ba(e))return Array.from(e.values());if(Go(e))return e.slice();kr(6)}function l6(e){if(Ra(e))return hp(e).map(function(r){return[r,e[r]]});if(ao(e))return hp(e).map(function(r){return[r,e.get(r)]});if(ba(e))return Array.from(e.entries());if(Go(e))return e.map(function(r,t){return[t,r]});kr(7)}function Z2(e,r,t){if(arguments.length===2&&!ba(e)){ps();var n=r;try{for(var a in n)Z2(e,a,n[a])}finally{gs()}return}Ra(e)?e[fr].set_(r,t):ao(e)?e.set(r,t):ba(e)?e.add(r):Go(e)?(typeof r!="number"&&(r=parseInt(r,10)),r<0&&kr("Invalid index: '"+r+"'"),ps(),r>=e.length&&(e.length=r+1),e[r]=t,gs()):kr(8)}function G9(e,r){Ra(e)?e[fr].delete_(r):ao(e)||ba(e)?e.delete(r):Go(e)?(typeof r!="number"&&(r=parseInt(r,10)),e.splice(r,1)):kr(9)}function u6(e,r){if(Ra(e))return e[fr].has_(r);if(ao(e))return e.has(r);if(ba(e))return e.has(r);if(Go(e))return r>=0&&r<e.length;kr(10)}function V9(e,r){if(u6(e,r)){if(Ra(e))return e[fr].get_(r);if(ao(e))return e.get(r);if(Go(e))return e[r];kr(11)}}function Q2(e,r,t){if(Ra(e))return e[fr].defineProperty_(r,t);kr(39)}function c6(e){if(Ra(e))return e[fr].ownKeys_();kr(38)}function Z1(e,r,t,n){return qs(t)?$9(e,r,t,n):W9(e,r,t)}function W9(e,r,t){return Zl(e).observe_(r,t)}function $9(e,r,t,n){return Zl(e,r).observe_(t,n)}function o1(e,r,t){return e.set(r,t),t}function oh(e,r){if(e==null||typeof e!="object"||e instanceof Date||!K1(e))return e;if(G2(e)||Lf(e))return oh(e.get(),r);if(r.has(e))return r.get(e);if(Go(e)){var t=o1(r,e,new Array(e.length));return e.forEach(function(o,s){t[s]=oh(o,r)}),t}if(ba(e)){var n=o1(r,e,new Set);return e.forEach(function(o){n.add(oh(o,r))}),n}if(ao(e)){var a=o1(r,e,new Map);return e.forEach(function(o,s){a.set(s,oh(o,r))}),a}else{var i=o1(r,e,{});return c6(e).forEach(function(o){bp.propertyIsEnumerable.call(e,o)&&(i[o]=oh(e[o],r))}),i}}function Y9(e,r){return oh(e,new Map)}function X9(){}function Cu(e,r){r===void 0&&(r=void 0),ps();try{return e.apply(r)}finally{gs()}}function _2(e,r,t){return arguments.length===1||r&&typeof r=="object"?K9(e,r):f6(e,r,t||{})}function f6(e,r,t){var n;if(typeof t.timeout=="number"){var a=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!o[fr].isDisposed)if(o(),t.onError)t.onError(a);else throw a},t.timeout)}t.name="When";var i=Yc("When-effect",r),o=W2(function(s){var u=H2(!1,e);u&&(s.dispose(),n&&clearTimeout(n),i())},t);return o}function K9(e,r){var t;if(r!=null&&(t=r.signal)!=null&&t.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var n,a,i=new Promise(function(o,s){var u,c=f6(e,o,$c({},r,{onError:s}));n=function(){c(),s(new Error("WHEN_CANCELLED"))},a=function(){c(),s(new Error("WHEN_ABORTED"))},r==null||(u=r.signal)==null||u.addEventListener==null||u.addEventListener("abort",a)}).finally(function(){var o;return r==null||(o=r.signal)==null||o.removeEventListener==null?void 0:o.removeEventListener("abort",a)});return i.cancel=n,i}function th(e){return e[fr]}var Z9={has:function(r,t){return th(r).has_(t)},get:function(r,t){return th(r).get_(t)},set:function(r,t,n){var a;return Af(t)?(a=th(r).set_(t,n,!0))!=null?a:!0:!1},deleteProperty:function(r,t){var n;return Af(t)?(n=th(r).delete_(t,!0))!=null?n:!0:!1},defineProperty:function(r,t,n){var a;return(a=th(r).defineProperty_(t,n))!=null?a:!0},ownKeys:function(r){return th(r).ownKeys_()},preventExtensions:function(r){kr(13)}};function Q9(e,r){var t,n;return mw(),e=Mf(e,r),(n=(t=e[fr]).proxy_)!=null?n:t.proxy_=new Proxy(e,Z9)}function cl(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Ep(e,r){var t=e.interceptors_||(e.interceptors_=[]);return t.push(r),yw(function(){var n=t.indexOf(r);n!==-1&&t.splice(n,1)})}function fl(e,r){var t=Rf();try{for(var n=[].concat(e.interceptors_||[]),a=0,i=n.length;a<i&&(r=n[a](r),r&&!r.type&&kr(14),!!r);a++);return r}finally{fc(t)}}function $l(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Pp(e,r){var t=e.changeListeners_||(e.changeListeners_=[]);return t.push(r),yw(function(){var n=t.indexOf(r);n!==-1&&t.splice(n,1)})}function Yl(e,r){var t=Rf(),n=e.changeListeners_;if(n){n=n.slice();for(var a=0,i=n.length;a<i;a++)n[a](r);fc(t)}}function J2(e,r,t){return ef(function(){var n,a=Mf(e,t)[fr];(n=r)!=null||(r=y7(e)),wh(r).forEach(function(i){return a.make_(i,r[i])})}),e}var G0=Symbol("mobx-keys");function J9(e,r,t){return dc(e)?Y2(e,e,r,t):(ef(function(){var n=Mf(e,t)[fr];if(!e[G0]){var a=Object.getPrototypeOf(e),i=new Set([].concat(wh(e),wh(a)));i.delete("constructor"),i.delete(fr),wp(a,G0,i)}e[G0].forEach(function(o){return n.make_(o,r&&o in r?r[o]:!0)})}),e)}var Oy="splice",Tu="update",eS=1e4,tS={get:function(r,t){var n=r[fr];return t===fr?n:t==="length"?n.getArrayLength_():typeof t=="string"&&!isNaN(t)?n.get_(parseInt(t)):cc(L1,t)?L1[t]:r[t]},set:function(r,t,n){var a=r[fr];return t==="length"&&a.setArrayLength_(n),typeof t=="symbol"||isNaN(t)?r[t]=n:a.set_(parseInt(t),n),!0},preventExtensions:function(){kr(15)}},em=function(){function e(t,n,a,i){t===void 0&&(t="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_=a,this.legacyMode_=i,this.atom_=new Jc(t),this.enhancer_=function(o,s){return n(o,s,"ObservableArray[..]")}}var r=e.prototype;return r.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},r.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},r.intercept_=function(n){return Ep(this,n)},r.observe_=function(n,a){return a===void 0&&(a=!1),a&&n({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Pp(this,n)},r.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},r.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&kr("Out of range: "+n);var a=this.values_.length;if(n!==a)if(n>a){for(var i=new Array(n-a),o=0;o<n-a;o++)i[o]=void 0;this.spliceWithArray_(a,0,i)}else this.spliceWithArray_(n,a-n)},r.updateArrayLength_=function(n,a){n!==this.lastKnownLength_&&kr(16),this.lastKnownLength_+=a,this.legacyMode_&&a>0&&v6(n+a+1)},r.spliceWithArray_=function(n,a,i){var o=this;this.atom_;var s=this.values_.length;if(n===void 0?n=0:n>s?n=s:n<0&&(n=Math.max(0,s+n)),arguments.length===1?a=s-n:a==null?a=0:a=Math.max(0,Math.min(a,s-n)),i===void 0&&(i=h2),cl(this)){var u=fl(this,{object:this.proxy_,type:Oy,index:n,removedCount:a,added:i});if(!u)return h2;a=u.removedCount,i=u.added}if(i=i.length===0?i:i.map(function(p){return o.enhancer_(p,void 0)}),this.legacyMode_){var c=i.length-a;this.updateArrayLength_(s,c)}var h=this.spliceItemsIntoValues_(n,a,i);return(a!==0||i.length!==0)&&this.notifyArraySplice_(n,i,h),this.dehanceValues_(h)},r.spliceItemsIntoValues_=function(n,a,i){if(i.length<eS){var o;return(o=this.values_).splice.apply(o,[n,a].concat(i))}else{var s=this.values_.slice(n,n+a),u=this.values_.slice(n+a);this.values_.length+=i.length-a;for(var c=0;c<i.length;c++)this.values_[n+c]=i[c];for(var h=0;h<u.length;h++)this.values_[n+i.length+h]=u[h];return s}},r.notifyArrayChildUpdate_=function(n,a,i){var o=!this.owned_&&sp(),s=$l(this),u=s||o?{observableKind:"array",object:this.proxy_,type:Tu,debugObjectName:this.atom_.name_,index:n,newValue:a,oldValue:i}:null;this.atom_.reportChanged(),s&&Yl(this,u)},r.notifyArraySplice_=function(n,a,i){var o=!this.owned_&&sp(),s=$l(this),u=s||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Oy,index:n,removed:i,added:a,removedCount:i.length,addedCount:a.length}:null;this.atom_.reportChanged(),s&&Yl(this,u)},r.get_=function(n){if(this.legacyMode_&&n>=this.values_.length){console.warn("[mobx] Out of bounds read: "+n);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[n])},r.set_=function(n,a){var i=this.values_;if(this.legacyMode_&&n>i.length&&kr(17,n,i.length),n<i.length){this.atom_;var o=i[n];if(cl(this)){var s=fl(this,{type:Tu,object:this.proxy_,index:n,newValue:a});if(!s)return;a=s.newValue}a=this.enhancer_(a,o);var u=a!==o;u&&(i[n]=a,this.notifyArrayChildUpdate_(n,a,o))}else{for(var c=new Array(n+1-i.length),h=0;h<c.length-1;h++)c[h]=void 0;c[c.length-1]=a,this.spliceWithArray_(i.length,0,c)}},e}();function rS(e,r,t,n){return t===void 0&&(t="ObservableArray"),n===void 0&&(n=!1),mw(),ef(function(){var a=new em(t,r,n,!1);ww(a.values_,fr,a);var i=new Proxy(a.values_,tS);return a.proxy_=i,e&&e.length&&a.spliceWithArray_(0,0,e),i})}var L1={clear:function(){return this.splice(0)},replace:function(r){var t=this[fr];return t.spliceWithArray_(0,t.values_.length,r)},toJSON:function(){return this.slice()},splice:function(r,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i];var o=this[fr];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(r);case 2:return o.spliceWithArray_(r,t)}return o.spliceWithArray_(r,t,a)},spliceWithArray:function(r,t,n){return this[fr].spliceWithArray_(r,t,n)},push:function(){for(var r=this[fr],t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return r.spliceWithArray_(r.values_.length,0,n),r.values_.length},pop:function(){return this.splice(Math.max(this[fr].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var r=this[fr],t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return r.spliceWithArray_(0,0,n),r.values_.length},reverse:function(){return Mt.trackingDerivation&&kr(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Mt.trackingDerivation&&kr(37,"sort");var r=this.slice();return r.sort.apply(r,arguments),this.replace(r),this},remove:function(r){var t=this[fr],n=t.dehanceValues_(t.values_).indexOf(r);return n>-1?(this.splice(n,1),!0):!1}};Qn("at",zs);Qn("concat",zs);Qn("flat",zs);Qn("includes",zs);Qn("indexOf",zs);Qn("join",zs);Qn("lastIndexOf",zs);Qn("slice",zs);Qn("toString",zs);Qn("toLocaleString",zs);Qn("toSorted",zs);Qn("toSpliced",zs);Qn("with",zs);Qn("every",Ql);Qn("filter",Ql);Qn("find",Ql);Qn("findIndex",Ql);Qn("findLast",Ql);Qn("findLastIndex",Ql);Qn("flatMap",Ql);Qn("forEach",Ql);Qn("map",Ql);Qn("some",Ql);Qn("toReversed",Ql);Qn("reduce",h6);Qn("reduceRight",h6);function Qn(e,r){typeof Array.prototype[e]=="function"&&(L1[e]=r(e))}function zs(e){return function(){var r=this[fr];r.atom_.reportObserved();var t=r.dehanceValues_(r.values_);return t[e].apply(t,arguments)}}function Ql(e){return function(r,t){var n=this,a=this[fr];a.atom_.reportObserved();var i=a.dehanceValues_(a.values_);return i[e](function(o,s){return r.call(t,o,s,n)})}}function h6(e){return function(){var r=this,t=this[fr];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_),a=arguments[0];return arguments[0]=function(i,o,s){return a(i,o,s,r)},n[e].apply(n,arguments)}}var nS=Qc("ObservableArrayAdministration",em);function Go(e){return U1(e)&&nS(e[fr])}var iS={},Hc="add",N1="delete",Q1=function(){function e(t,n,a){var i=this;n===void 0&&(n=kf),a===void 0&&(a="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[fr]=iS,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=n,this.name_=a,qs(Map)||kr(18),ef(function(){i.keysAtom_=fp("ObservableMap.keys()"),i.data_=new Map,i.hasMap_=new Map,t&&i.merge(t)})}var r=e.prototype;return r.has_=function(n){return this.data_.has(n)},r.has=function(n){var a=this;if(!Mt.trackingDerivation)return this.has_(n);var i=this.hasMap_.get(n);if(!i){var o=i=new Vc(this.has_(n),H1,"ObservableMap.key?",!1);this.hasMap_.set(n,o),$2(o,function(){return a.hasMap_.delete(n)})}return i.get()},r.set=function(n,a){var i=this.has_(n);if(cl(this)){var o=fl(this,{type:i?Tu:Hc,object:this,newValue:a,name:n});if(!o)return this;a=o.newValue}return i?this.updateValue_(n,a):this.addValue_(n,a),this},r.delete=function(n){var a=this;if(this.keysAtom_,cl(this)){var i=fl(this,{type:N1,object:this,name:n});if(!i)return!1}if(this.has_(n)){var o=sp(),s=$l(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:N1,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return Cu(function(){var c;a.keysAtom_.reportChanged(),(c=a.hasMap_.get(n))==null||c.setNewValue_(!1);var h=a.data_.get(n);h.setNewValue_(void 0),a.data_.delete(n)}),s&&Yl(this,u),!0}return!1},r.updateValue_=function(n,a){var i=this.data_.get(n);if(a=i.prepareNewValue_(a),a!==Mt.UNCHANGED){var o=sp(),s=$l(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:Tu,object:this,oldValue:i.value_,name:n,newValue:a}:null;i.setNewValue_(a),s&&Yl(this,u)}},r.addValue_=function(n,a){var i=this;this.keysAtom_,Cu(function(){var c,h=new Vc(a,i.enhancer_,"ObservableMap.key",!1);i.data_.set(n,h),a=h.value_,(c=i.hasMap_.get(n))==null||c.setNewValue_(!0),i.keysAtom_.reportChanged()});var o=sp(),s=$l(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:Hc,object:this,name:n,newValue:a}:null;s&&Yl(this,u)},r.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},r.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},r.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},r.values=function(){var n=this,a=this.keys();return Ay({next:function(){var o=a.next(),s=o.done,u=o.value;return{done:s,value:s?void 0:n.get(u)}}})},r.entries=function(){var n=this,a=this.keys();return Ay({next:function(){var o=a.next(),s=o.done,u=o.value;return{done:s,value:s?void 0:[u,n.get(u)]}}})},r[Symbol.iterator]=function(){return this.entries()},r.forEach=function(n,a){for(var i=fh(this),o;!(o=i()).done;){var s=o.value,u=s[0],c=s[1];n.call(a,c,u,this)}},r.merge=function(n){var a=this;return ao(n)&&(n=new Map(n)),Cu(function(){dc(n)?h7(n).forEach(function(i){return a.set(i,n[i])}):Array.isArray(n)?n.forEach(function(i){var o=i[0],s=i[1];return a.set(o,s)}):Th(n)?(f7(n)||kr(19,n),n.forEach(function(i,o){return a.set(o,i)})):n!=null&&kr(20,n)}),this},r.clear=function(){var n=this;Cu(function(){V2(function(){for(var a=fh(n.keys()),i;!(i=a()).done;){var o=i.value;n.delete(o)}})})},r.replace=function(n){var a=this;return Cu(function(){for(var i=aS(n),o=new Map,s=!1,u=fh(a.data_.keys()),c;!(c=u()).done;){var h=c.value;if(!i.has(h)){var p=a.delete(h);if(p)s=!0;else{var v=a.data_.get(h);o.set(h,v)}}}for(var f=fh(i.entries()),_;!(_=f()).done;){var E=_.value,w=E[0],x=E[1],y=a.data_.has(w);if(a.set(w,x),a.data_.has(w)){var g=a.data_.get(w);o.set(w,g),y||(s=!0)}}if(!s)if(a.data_.size!==o.size)a.keysAtom_.reportChanged();else for(var S=a.data_.keys(),b=o.keys(),R=S.next(),L=b.next();!R.done;){if(R.value!==L.value){a.keysAtom_.reportChanged();break}R=S.next(),L=b.next()}a.data_=o}),this},r.toString=function(){return"[object ObservableMap]"},r.toJSON=function(){return Array.from(this)},r.observe_=function(n,a){return Pp(this,n)},r.intercept_=function(n){return Ep(this,n)},Rh(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),ao=Qc("ObservableMap",Q1);function Ay(e){return e[Symbol.toStringTag]="MapIterator",im(e)}function aS(e){if(Th(e)||ao(e))return e;if(Array.isArray(e))return new Map(e);if(dc(e)){var r=new Map;for(var t in e)r.set(t,e[t]);return r}else return kr(21,e)}var oS={},tm=function(){function e(t,n,a){var i=this;n===void 0&&(n=kf),a===void 0&&(a="ObservableSet"),this.name_=void 0,this[fr]=oS,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_=a,qs(Set)||kr(22),this.enhancer_=function(o,s){return n(o,s,a)},ef(function(){i.atom_=fp(i.name_),t&&i.replace(t)})}var r=e.prototype;return r.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},r.clear=function(){var n=this;Cu(function(){V2(function(){for(var a=fh(n.data_.values()),i;!(i=a()).done;){var o=i.value;n.delete(o)}})})},r.forEach=function(n,a){for(var i=fh(this),o;!(o=i()).done;){var s=o.value;n.call(a,s,s,this)}},r.add=function(n){var a=this;if(this.atom_,cl(this)){var i=fl(this,{type:Hc,object:this,newValue:n});if(!i)return this;n=i.newValue}if(!this.has(n)){Cu(function(){a.data_.add(a.enhancer_(n,void 0)),a.atom_.reportChanged()});var o=!1,s=$l(this),u=s||o?{observableKind:"set",debugObjectName:this.name_,type:Hc,object:this,newValue:n}:null;s&&Yl(this,u)}return this},r.delete=function(n){var a=this;if(cl(this)){var i=fl(this,{type:N1,object:this,oldValue:n});if(!i)return!1}if(this.has(n)){var o=!1,s=$l(this),u=s||o?{observableKind:"set",debugObjectName:this.name_,type:N1,object:this,oldValue:n}:null;return Cu(function(){a.atom_.reportChanged(),a.data_.delete(n)}),s&&Yl(this,u),!0}return!1},r.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},r.entries=function(){var n=this.values();return Cy({next:function(){var i=n.next(),o=i.value,s=i.done;return s?{value:void 0,done:s}:{value:[o,o],done:s}}})},r.keys=function(){return this.values()},r.values=function(){this.atom_.reportObserved();var n=this,a=this.data_.values();return Cy({next:function(){var o=a.next(),s=o.value,u=o.done;return u?{value:void 0,done:u}:{value:n.dehanceValue_(s),done:u}}})},r.intersection=function(n){if(uc(n)&&!ba(n))return n.intersection(this);var a=new Set(this);return a.intersection(n)},r.union=function(n){if(uc(n)&&!ba(n))return n.union(this);var a=new Set(this);return a.union(n)},r.difference=function(n){return new Set(this).difference(n)},r.symmetricDifference=function(n){if(uc(n)&&!ba(n))return n.symmetricDifference(this);var a=new Set(this);return a.symmetricDifference(n)},r.isSubsetOf=function(n){return new Set(this).isSubsetOf(n)},r.isSupersetOf=function(n){return new Set(this).isSupersetOf(n)},r.isDisjointFrom=function(n){if(uc(n)&&!ba(n))return n.isDisjointFrom(this);var a=new Set(this);return a.isDisjointFrom(n)},r.replace=function(n){var a=this;return ba(n)&&(n=new Set(n)),Cu(function(){Array.isArray(n)?(a.clear(),n.forEach(function(i){return a.add(i)})):uc(n)?(a.clear(),n.forEach(function(i){return a.add(i)})):n!=null&&kr("Cannot initialize set from "+n)}),this},r.observe_=function(n,a){return Pp(this,n)},r.intercept_=function(n){return Ep(this,n)},r.toJSON=function(){return Array.from(this)},r.toString=function(){return"[object ObservableSet]"},r[Symbol.iterator]=function(){return this.values()},Rh(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),ba=Qc("ObservableSet",tm);function Cy(e){return e[Symbol.toStringTag]="SetIterator",im(e)}var ky=Object.create(null),Ly="remove",d6=function(){function e(t,n,a,i){n===void 0&&(n=new Map),i===void 0&&(i=$7),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_=t,this.values_=n,this.name_=a,this.defaultAnnotation_=i,this.keysAtom_=new Jc("ObservableObject.keys"),this.isPlainObject_=dc(this.target_)}var r=e.prototype;return r.getObservablePropValue_=function(n){return this.values_.get(n).get()},r.setObservablePropValue_=function(n,a){var i=this.values_.get(n);if(i instanceof Xl)return i.set(a),!0;if(cl(this)){var o=fl(this,{type:Tu,object:this.proxy_||this.target_,name:n,newValue:a});if(!o)return null;a=o.newValue}if(a=i.prepareNewValue_(a),a!==Mt.UNCHANGED){var s=$l(this),u=!1,c=s||u?{type:Tu,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:i.value_,name:n,newValue:a}:null;i.setNewValue_(a),s&&Yl(this,c)}return!0},r.get_=function(n){return Mt.trackingDerivation&&!cc(this.target_,n)&&this.has_(n),this.target_[n]},r.set_=function(n,a,i){return i===void 0&&(i=!1),cc(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,a):i?Reflect.set(this.target_,n,a):(this.target_[n]=a,!0):this.extend_(n,{value:a,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,i)},r.has_=function(n){if(!Mt.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var a=this.pendingKeys_.get(n);return a||(a=new Vc(n in this.target_,H1,"ObservableObject.key?",!1),this.pendingKeys_.set(n,a)),a.get()},r.make_=function(n,a){if(a===!0&&(a=this.defaultAnnotation_),a!==!1){if(!(n in this.target_)){var i;if((i=this.target_[ku])!=null&&i[n])return;kr(1,a.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==bp;){var s=P1(o,n);if(s){var u=a.make_(this,n,s,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}Ty(this,a,n)}},r.extend_=function(n,a,i,o){if(o===void 0&&(o=!1),i===!0&&(i=this.defaultAnnotation_),i===!1)return this.defineProperty_(n,a,o);var s=i.extend_(this,n,a,o);return s&&Ty(this,i,n),s},r.defineProperty_=function(n,a,i){i===void 0&&(i=!1),this.keysAtom_;try{ps();var o=this.delete_(n);if(!o)return o;if(cl(this)){var s=fl(this,{object:this.proxy_||this.target_,name:n,type:Hc,newValue:a.value});if(!s)return null;var u=s.newValue;a.value!==u&&(a=$c({},a,{value:u}))}if(i){if(!Reflect.defineProperty(this.target_,n,a))return!1}else Nu(this.target_,n,a);this.notifyPropertyAddition_(n,a.value)}finally{gs()}return!0},r.defineObservableProperty_=function(n,a,i,o){o===void 0&&(o=!1),this.keysAtom_;try{ps();var s=this.delete_(n);if(!s)return s;if(cl(this)){var u=fl(this,{object:this.proxy_||this.target_,name:n,type:Hc,newValue:a});if(!u)return null;a=u.newValue}var c=Ny(n),h={configurable:Mt.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:c.get,set:c.set};if(o){if(!Reflect.defineProperty(this.target_,n,h))return!1}else Nu(this.target_,n,h);var p=new Vc(a,i,"ObservableObject.key",!1);this.values_.set(n,p),this.notifyPropertyAddition_(n,p.value_)}finally{gs()}return!0},r.defineComputedProperty_=function(n,a,i){i===void 0&&(i=!1),this.keysAtom_;try{ps();var o=this.delete_(n);if(!o)return o;if(cl(this)){var s=fl(this,{object:this.proxy_||this.target_,name:n,type:Hc,newValue:void 0});if(!s)return null}a.name||(a.name="ObservableObject.key"),a.context=this.proxy_||this.target_;var u=Ny(n),c={configurable:Mt.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:u.get,set:u.set};if(i){if(!Reflect.defineProperty(this.target_,n,c))return!1}else Nu(this.target_,n,c);this.values_.set(n,new Xl(a)),this.notifyPropertyAddition_(n,void 0)}finally{gs()}return!0},r.delete_=function(n,a){if(a===void 0&&(a=!1),this.keysAtom_,!cc(this.target_,n))return!0;if(cl(this)){var i=fl(this,{object:this.proxy_||this.target_,name:n,type:Ly});if(!i)return null}try{var o;ps();var s=$l(this),u=!1,c=this.values_.get(n),h=void 0;if(!c&&(s||u)){var p;h=(p=P1(this.target_,n))==null?void 0:p.value}if(a){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(c&&(this.values_.delete(n),c instanceof Vc&&(h=c.value_),Hw(c)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(n))==null||o.set(n in this.target_),s||u){var v={type:Ly,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:h,name:n};s&&Yl(this,v)}}finally{gs()}return!0},r.observe_=function(n,a){return Pp(this,n)},r.intercept_=function(n){return Ep(this,n)},r.notifyPropertyAddition_=function(n,a){var i,o=$l(this),s=!1;if(o||s){var u=o||s?{type:Hc,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:a}:null;o&&Yl(this,u)}(i=this.pendingKeys_)==null||(i=i.get(n))==null||i.set(!0),this.keysAtom_.reportChanged()},r.ownKeys_=function(){return this.keysAtom_.reportObserved(),wh(this.target_)},r.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Mf(e,r){var t;if(cc(e,fr))return e;var n=(t=r==null?void 0:r.name)!=null?t:"ObservableObject",a=new d6(e,new Map,String(n),i9(r));return wp(e,fr,a),e}var sS=Qc("ObservableObjectAdministration",d6);function Ny(e){return ky[e]||(ky[e]={get:function(){return this[fr].getObservablePropValue_(e)},set:function(t){return this[fr].setObservablePropValue_(e,t)}})}function Ra(e){return U1(e)?sS(e[fr]):!1}function Ty(e,r,t){var n;(n=e.target_[ku])==null||delete n[t]}var lS=g6(0),uS=function(){var e=!1,r={};return Object.defineProperty(r,"0",{set:function(){e=!0}}),Object.create(r)[0]=1,e===!1}(),V0=0,p6=function(){};function cS(e,r){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,r):e.prototype.__proto__!==void 0?e.prototype.__proto__=r:e.prototype=r}cS(p6,Array.prototype);var rm=function(e){function r(n,a,i,o){var s;return i===void 0&&(i="ObservableArray"),o===void 0&&(o=!1),s=e.call(this)||this,ef(function(){var u=new em(i,a,o,!0);u.proxy_=s,ww(s,fr,u),n&&n.length&&s.spliceWithArray(0,0,n),uS&&Object.defineProperty(s,"0",lS)}),s}xw(r,e);var t=r.prototype;return t.concat=function(){this[fr].atom_.reportObserved();for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),i.map(function(s){return Go(s)?s.slice():s}))},t[Symbol.iterator]=function(){var n=this,a=0;return im({next:function(){return a<n.length?{value:n[a++],done:!1}:{done:!0,value:void 0}}})},Rh(r,[{key:"length",get:function(){return this[fr].getArrayLength_()},set:function(a){this[fr].setArrayLength_(a)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(p6);Object.entries(L1).forEach(function(e){var r=e[0],t=e[1];r!=="concat"&&wp(rm.prototype,r,t)});function g6(e){return{enumerable:!1,configurable:!0,get:function(){return this[fr].get_(e)},set:function(t){this[fr].set_(e,t)}}}function fS(e){Nu(rm.prototype,""+e,g6(e))}function v6(e){if(e>V0){for(var r=V0;r<e+100;r++)fS(r);V0=e}}v6(1e3);function hS(e,r,t){return new rm(e,r,t)}function Mu(e,r){if(typeof e=="object"&&e!==null){if(Go(e))return r!==void 0&&kr(23),e[fr].atom_;if(ba(e))return e.atom_;if(ao(e)){if(r===void 0)return e.keysAtom_;var t=e.data_.get(r)||e.hasMap_.get(r);return t||kr(25,r,T1(e)),t}if(Ra(e)){if(!r)return kr(26);var n=e[fr].values_.get(r);return n||kr(27,r,T1(e)),n}if(z2(e)||Lf(e)||k1(e))return e}else if(qs(e)&&k1(e[fr]))return e[fr];kr(28)}function Zl(e,r){if(e||kr(29),r!==void 0)return Zl(Mu(e,r));if(z2(e)||Lf(e)||k1(e)||ao(e)||ba(e))return e;if(e[fr])return e[fr];kr(24,e)}function T1(e,r){var t;if(r!==void 0)t=Mu(e,r);else{if(xh(e))return e.name;Ra(e)||ao(e)||ba(e)?t=Zl(e):t=Mu(e)}return t.name_}function ef(e){var r=Rf(),t=V1(!0);ps();try{return e()}finally{gs(),W1(t),fc(r)}}var Ry=bp.toString;function nm(e,r,t){return t===void 0&&(t=-1),S2(e,r,t)}function S2(e,r,t,n,a){if(e===r)return e!==0||1/e===1/r;if(e==null||r==null)return!1;if(e!==e)return r!==r;var i=typeof e;if(i!=="function"&&i!=="object"&&typeof r!="object")return!1;var o=Ry.call(e);if(o!==Ry.call(r))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+r;case"[object Number]":return+e!=+e?+r!=+r:+e==0?1/+e===1/r:+e==+r;case"[object Date]":case"[object Boolean]":return+e==+r;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(r);case"[object Map]":case"[object Set]":t>=0&&t++;break}e=My(e),r=My(r);var s=o==="[object Array]";if(!s){if(typeof e!="object"||typeof r!="object")return!1;var u=e.constructor,c=r.constructor;if(u!==c&&!(qs(u)&&u instanceof u&&qs(c)&&c instanceof c)&&"constructor"in e&&"constructor"in r)return!1}if(t===0)return!1;t<0&&(t=-1),n=n||[],a=a||[];for(var h=n.length;h--;)if(n[h]===e)return a[h]===r;if(n.push(e),a.push(r),s){if(h=e.length,h!==r.length)return!1;for(;h--;)if(!S2(e[h],r[h],t-1,n,a))return!1}else{var p=Object.keys(e),v=p.length;if(Object.keys(r).length!==v)return!1;for(var f=0;f<v;f++){var _=p[f];if(!(cc(r,_)&&S2(e[_],r[_],t-1,n,a)))return!1}}return n.pop(),a.pop(),!0}function My(e){return Go(e)?e.slice():Th(e)||ao(e)||uc(e)||ba(e)?Array.from(e.entries()):e}var Iy,dS=((Iy=z1().Iterator)==null?void 0:Iy.prototype)||{};function im(e){return e[Symbol.iterator]=pS,Object.assign(Object.create(dS),e)}function pS(){return this}["Symbol","Map","Set"].forEach(function(e){var r=z1();typeof r[e]>"u"&&kr("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Vw,extras:{getDebugName:T1},$mobx:fr});const gS=Object.freeze(Object.defineProperty({__proto__:null,$mobx:fr,FlowCancellationError:Y1,ObservableMap:Q1,ObservableSet:tm,Reaction:Kl,_allowStateChanges:H2,_allowStateChangesInsideComputed:Sh,_allowStateReadsEnd:ph,_allowStateReadsStart:$1,_autoAction:_h,_endAction:Iw,_getAdministration:Zl,_getGlobalState:Bw,_interceptReads:X2,_isComputingDerivation:f9,_resetGlobalState:g9,_startAction:Mw,action:ca,autorun:W2,comparer:Cf,computed:Tf,configure:e6,createAtom:fp,defineProperty:Q2,entries:l6,extendObservable:Y2,flow:Nf,flowResult:q9,get:V9,getAtom:Mu,getDebugName:T1,getDependencyTree:t6,getObserverTree:I9,has:u6,intercept:X1,isAction:xh,isBoxedObservable:G2,isComputed:H9,isComputedProp:a6,isFlow:Eh,isFlowCancellationError:D9,isObservable:K1,isObservableArray:Go,isObservableMap:ao,isObservableObject:Ra,isObservableProp:s6,isObservableSet:ba,keys:hp,makeAutoObservable:J9,makeObservable:J2,observable:jn,observe:Z1,onBecomeObserved:Qw,onBecomeUnobserved:$2,onReactionError:_9,override:P7,ownKeys:c6,reaction:Zw,remove:G9,runInAction:Sh,set:Z2,spy:Vw,toJS:Y9,trace:X9,transaction:Cu,untracked:V2,values:K2,when:_2},Symbol.toStringTag,{value:"Module"}));if(!ii.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!J2)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var vS=pw();function mS(e){e()}function m6(e){e||(e=mS),e6({reactionScheduler:e})}var yS=function(){return!0};function bS(e){return t6(e)}var y6=!1;function b6(e){y6=e}function am(){return y6}var wS=1e4,_S=1e4,SS=function(){function e(r){var t=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(n){n===void 0&&(n=wS),clearTimeout(t.sweepTimeout),t.sweepTimeout=void 0;var a=Date.now();t.registrations.forEach(function(i,o){a-i.registeredAt>=n&&(t.finalize(i.value),t.registrations.delete(o))}),t.registrations.size>0&&t.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t,n){this.registrations.set(n,{value:t,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.registrations.delete(r)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,_S))}}),e}(),xS=typeof FinalizationRegistry<"u"?FinalizationRegistry:SS,R1=new xS(function(e){var r;(r=e.reaction)===null||r===void 0||r.dispose(),e.reaction=null}),W0={exports:{}},$0={};/**
|
|
35
|
-
* @license React
|
|
36
|
-
* use-sync-external-store-shim.production.js
|
|
37
|
-
*
|
|
38
|
-
* Copyright (c) Meta Platforms, Inc. and 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 jy;function ES(){if(jy)return $0;jy=1;var e=ai();function r(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var t=typeof Object.is=="function"?Object.is:r,n=e.useState,a=e.useEffect,i=e.useLayoutEffect,o=e.useDebugValue;function s(p,v){var f=v(),_=n({inst:{value:f,getSnapshot:v}}),E=_[0].inst,w=_[1];return i(function(){E.value=f,E.getSnapshot=v,u(E)&&w({inst:E})},[p,f,v]),a(function(){return u(E)&&w({inst:E}),p(function(){u(E)&&w({inst:E})})},[p]),o(f),f}function u(p){var v=p.getSnapshot;p=p.value;try{var f=v();return!t(p,f)}catch{return!0}}function c(p,v){return v()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return $0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,$0}var Fy;function PS(){return Fy||(Fy=1,W0.exports=ES()),W0.exports}var OS=PS();function Dy(e){e.reaction=new Kl("observer".concat(e.name),function(){var r;e.stateVersion=Symbol(),(r=e.onStoreChange)===null||r===void 0||r.call(e)})}function om(e,r){if(r===void 0&&(r="observed"),am())return e();var t=$r.useRef(null);if(!t.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:r,subscribe:function(s){return R1.unregister(n),n.onStoreChange=s,n.reaction||(Dy(n),n.stateVersion=Symbol()),function(){var u;n.onStoreChange=null,(u=n.reaction)===null||u===void 0||u.dispose(),n.reaction=null}},getSnapshot:function(){return n.stateVersion}};t.current=n}var a=t.current;a.reaction||(Dy(a),R1.register(t,a,a)),$r.useDebugValue(a.reaction,bS),OS.useSyncExternalStore(a.subscribe,a.getSnapshot,a.getSnapshot);var i,o;if(a.reaction.track(function(){try{i=e()}catch(s){o=s}}),o)throw o;return i}var Y0,X0,w6=typeof Symbol=="function"&&Symbol.for,AS=(X0=(Y0=Object.getOwnPropertyDescriptor(function(){},"name"))===null||Y0===void 0?void 0:Y0.configurable)!==null&&X0!==void 0?X0:!1,By=w6?Symbol.for("react.forward_ref"):typeof ii.forwardRef=="function"&&ii.forwardRef(function(e){return null}).$$typeof,qy=w6?Symbol.for("react.memo"):typeof ii.memo=="function"&&ii.memo(function(e){return null}).$$typeof;function CS(e,r){var t;if(qy&&e.$$typeof===qy)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(am())return e;var n=(t=r==null?void 0:r.forwardRef)!==null&&t!==void 0?t:!1,a=e,i=e.displayName||e.name;if(By&&e.$$typeof===By&&(n=!0,a=e.render,typeof a!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var o=function(s,u){return om(function(){return a(s,u)},i)};return o.displayName=e.displayName,AS&&Object.defineProperty(o,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(o.contextTypes=e.contextTypes),n&&(o=ii.forwardRef(o)),o=ii.memo(o),LS(e,o),o}var kS={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function LS(e,r){Object.keys(e).forEach(function(t){kS[t]||Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))})}function _6(e){var r=e.children,t=e.render;r&&t&&console.error("MobX Observer: Do not use children and render in the same time in `Observer`");var n=r||t;return typeof n!="function"?null:om(n)}_6.displayName="Observer";function NS(e,r){return ii.useState(function(){return jn(e(),r,{autoBind:!0})})[0]}function S6(e){var r=ii.useState(function(){return jn(e,{},{deep:!1})})[0];return Sh(function(){Object.assign(r,e)}),r}function TS(e,r){var t=r&&S6(r);return ii.useState(function(){return jn(e(t),void 0,{autoBind:!0})})[0]}var K0;m6(vS.unstable_batchedUpdates);var RS=(K0=R1.finalizeAllImmediately)!==null&&K0!==void 0?K0:function(){};function MS(e,r){return r===void 0&&(r="observed"),om(e,r)}function IS(e){b6(e)}const jS=Object.freeze(Object.defineProperty({__proto__:null,Observer:_6,_observerFinalizationRegistry:R1,clearTimers:RS,enableStaticRendering:b6,isObserverBatched:yS,isUsingStaticRendering:am,observer:CS,observerBatching:m6,useAsObservableSource:S6,useLocalObservable:NS,useLocalStore:TS,useObserver:MS,useStaticRendering:IS},Symbol.toStringTag,{value:"Module"})),Us=Zc(jS);var yf={};const vs=Zc(gS);var m1={exports:{}},Zh={},Z0={},Q0={},zy;function jr(){return zy||(zy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;const r=Math.PI/180;function t(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof bh<"u"?bh:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.3.20",isBrowser:t(),isUnminified:/param/.test((function(a){}).toString()),dblClickWindow:400,getAngle(a){return e.Konva.angleDeg?a*r:a},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_fixTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isTransforming(){var a;return(a=e.Konva.Transformer)===null||a===void 0?void 0:a.isTransforming()},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(a){e.glob.Konva=a}};const n=a=>{e.Konva[a.prototype.getClassName()]=a};e._registerNode=n,e.Konva._injectGlobal(e.Konva)}(Q0)),Q0}var J0={},Uy;function Li(){return Uy||(Uy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const r=jr();class t{constructor(S=[1,0,0,1,0,0]){this.dirty=!1,this.m=S&&S.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 t(this.m)}copyInto(S){S.m[0]=this.m[0],S.m[1]=this.m[1],S.m[2]=this.m[2],S.m[3]=this.m[3],S.m[4]=this.m[4],S.m[5]=this.m[5]}point(S){const b=this.m;return{x:b[0]*S.x+b[2]*S.y+b[4],y:b[1]*S.x+b[3]*S.y+b[5]}}translate(S,b){return this.m[4]+=this.m[0]*S+this.m[2]*b,this.m[5]+=this.m[1]*S+this.m[3]*b,this}scale(S,b){return this.m[0]*=S,this.m[1]*=S,this.m[2]*=b,this.m[3]*=b,this}rotate(S){const b=Math.cos(S),R=Math.sin(S),L=this.m[0]*b+this.m[2]*R,T=this.m[1]*b+this.m[3]*R,F=this.m[0]*-R+this.m[2]*b,I=this.m[1]*-R+this.m[3]*b;return this.m[0]=L,this.m[1]=T,this.m[2]=F,this.m[3]=I,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(S,b){const R=this.m[0]+this.m[2]*b,L=this.m[1]+this.m[3]*b,T=this.m[2]+this.m[0]*S,F=this.m[3]+this.m[1]*S;return this.m[0]=R,this.m[1]=L,this.m[2]=T,this.m[3]=F,this}multiply(S){const b=this.m[0]*S.m[0]+this.m[2]*S.m[1],R=this.m[1]*S.m[0]+this.m[3]*S.m[1],L=this.m[0]*S.m[2]+this.m[2]*S.m[3],T=this.m[1]*S.m[2]+this.m[3]*S.m[3],F=this.m[0]*S.m[4]+this.m[2]*S.m[5]+this.m[4],I=this.m[1]*S.m[4]+this.m[3]*S.m[5]+this.m[5];return this.m[0]=b,this.m[1]=R,this.m[2]=L,this.m[3]=T,this.m[4]=F,this.m[5]=I,this}invert(){const S=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),b=this.m[3]*S,R=-this.m[1]*S,L=-this.m[2]*S,T=this.m[0]*S,F=S*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),I=S*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=b,this.m[1]=R,this.m[2]=L,this.m[3]=T,this.m[4]=F,this.m[5]=I,this}getMatrix(){return this.m}decompose(){const S=this.m[0],b=this.m[1],R=this.m[2],L=this.m[3],T=this.m[4],F=this.m[5],I=S*L-b*R,O={x:T,y:F,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(S!=0||b!=0){const C=Math.sqrt(S*S+b*b);O.rotation=b>0?Math.acos(S/C):-Math.acos(S/C),O.scaleX=C,O.scaleY=I/C,O.skewX=(S*R+b*L)/I,O.skewY=0}else if(R!=0||L!=0){const C=Math.sqrt(R*R+L*L);O.rotation=Math.PI/2-(L>0?Math.acos(-R/C):-Math.acos(R/C)),O.scaleX=I/C,O.scaleY=C,O.skewX=0,O.skewY=(S*R+b*L)/I}return O.rotation=e.Util._getRotation(O.rotation),O}}e.Transform=t;const n="[object Array]",a="[object Number]",i="[object String]",o="[object Boolean]",s=Math.PI/180,u=180/Math.PI,c="#",h="",p="0",v="Konva warning: ",f="Konva error: ",_="rgb(",E={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},w=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let x=[];const y=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(g){setTimeout(g,60)};e.Util={_isElement(g){return!!(g&&g.nodeType==1)},_isFunction(g){return!!(g&&g.constructor&&g.call&&g.apply)},_isPlainObject(g){return!!g&&g.constructor===Object},_isArray(g){return Object.prototype.toString.call(g)===n},_isNumber(g){return Object.prototype.toString.call(g)===a&&!isNaN(g)&&isFinite(g)},_isString(g){return Object.prototype.toString.call(g)===i},_isBoolean(g){return Object.prototype.toString.call(g)===o},isObject(g){return g instanceof Object},isValidSelector(g){if(typeof g!="string")return!1;const S=g[0];return S==="#"||S==="."||S===S.toUpperCase()},_sign(g){return g===0||g>0?1:-1},requestAnimFrame(g){x.push(g),x.length===1&&y(function(){const S=x;x=[],S.forEach(function(b){b()})})},createCanvasElement(){const g=document.createElement("canvas");try{g.style=g.style||{}}catch{}return g},createImageElement(){return document.createElement("img")},_isInDocument(g){for(;g=g.parentNode;)if(g==document)return!0;return!1},_urlToImage(g,S){const b=e.Util.createImageElement();b.onload=function(){S(b)},b.src=g},_rgbToHex(g,S,b){return((1<<24)+(g<<16)+(S<<8)+b).toString(16).slice(1)},_hexToRgb(g){g=g.replace(c,h);const S=parseInt(g,16);return{r:S>>16&255,g:S>>8&255,b:S&255}},getRandomColor(){let g=(Math.random()*16777215<<0).toString(16);for(;g.length<6;)g=p+g;return c+g},getRGB(g){let S;return g in E?(S=E[g],{r:S[0],g:S[1],b:S[2]}):g[0]===c?this._hexToRgb(g.substring(1)):g.substr(0,4)===_?(S=w.exec(g.replace(/ /g,"")),{r:parseInt(S[1],10),g:parseInt(S[2],10),b:parseInt(S[3],10)}):{r:0,g:0,b:0}},colorToRGBA(g){return g=g||"black",e.Util._namedColorToRBA(g)||e.Util._hex3ColorToRGBA(g)||e.Util._hex4ColorToRGBA(g)||e.Util._hex6ColorToRGBA(g)||e.Util._hex8ColorToRGBA(g)||e.Util._rgbColorToRGBA(g)||e.Util._rgbaColorToRGBA(g)||e.Util._hslColorToRGBA(g)},_namedColorToRBA(g){const S=E[g.toLowerCase()];return S?{r:S[0],g:S[1],b:S[2],a:1}:null},_rgbColorToRGBA(g){if(g.indexOf("rgb(")===0){g=g.match(/rgb\(([^)]+)\)/)[1];const S=g.split(/ *, */).map(Number);return{r:S[0],g:S[1],b:S[2],a:1}}},_rgbaColorToRGBA(g){if(g.indexOf("rgba(")===0){g=g.match(/rgba\(([^)]+)\)/)[1];const S=g.split(/ *, */).map((b,R)=>b.slice(-1)==="%"?R===3?parseInt(b)/100:parseInt(b)/100*255:Number(b));return{r:S[0],g:S[1],b:S[2],a:S[3]}}},_hex8ColorToRGBA(g){if(g[0]==="#"&&g.length===9)return{r:parseInt(g.slice(1,3),16),g:parseInt(g.slice(3,5),16),b:parseInt(g.slice(5,7),16),a:parseInt(g.slice(7,9),16)/255}},_hex6ColorToRGBA(g){if(g[0]==="#"&&g.length===7)return{r:parseInt(g.slice(1,3),16),g:parseInt(g.slice(3,5),16),b:parseInt(g.slice(5,7),16),a:1}},_hex4ColorToRGBA(g){if(g[0]==="#"&&g.length===5)return{r:parseInt(g[1]+g[1],16),g:parseInt(g[2]+g[2],16),b:parseInt(g[3]+g[3],16),a:parseInt(g[4]+g[4],16)/255}},_hex3ColorToRGBA(g){if(g[0]==="#"&&g.length===4)return{r:parseInt(g[1]+g[1],16),g:parseInt(g[2]+g[2],16),b:parseInt(g[3]+g[3],16),a:1}},_hslColorToRGBA(g){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(g)){const[S,...b]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(g),R=Number(b[0])/360,L=Number(b[1])/100,T=Number(b[2])/100;let F,I,O;if(L===0)return O=T*255,{r:Math.round(O),g:Math.round(O),b:Math.round(O),a:1};T<.5?F=T*(1+L):F=T+L-T*L;const C=2*T-F,A=[0,0,0];for(let j=0;j<3;j++)I=R+1/3*-(j-1),I<0&&I++,I>1&&I--,6*I<1?O=C+(F-C)*6*I:2*I<1?O=F:3*I<2?O=C+(F-C)*(2/3-I)*6:O=C,A[j]=O*255;return{r:Math.round(A[0]),g:Math.round(A[1]),b:Math.round(A[2]),a:1}}},haveIntersection(g,S){return!(S.x>g.x+g.width||S.x+S.width<g.x||S.y>g.y+g.height||S.y+S.height<g.y)},cloneObject(g){const S={};for(const b in g)this._isPlainObject(g[b])?S[b]=this.cloneObject(g[b]):this._isArray(g[b])?S[b]=this.cloneArray(g[b]):S[b]=g[b];return S},cloneArray(g){return g.slice(0)},degToRad(g){return g*s},radToDeg(g){return g*u},_degToRad(g){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(g)},_radToDeg(g){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(g)},_getRotation(g){return r.Konva.angleDeg?e.Util.radToDeg(g):g},_capitalize(g){return g.charAt(0).toUpperCase()+g.slice(1)},throw(g){throw new Error(f+g)},error(g){console.error(f+g)},warn(g){r.Konva.showWarnings&&console.warn(v+g)},each(g,S){for(const b in g)S(b,g[b])},_inRange(g,S,b){return S<=g&&g<b},_getProjectionToSegment(g,S,b,R,L,T){let F,I,O;const C=(g-b)*(g-b)+(S-R)*(S-R);if(C==0)F=g,I=S,O=(L-b)*(L-b)+(T-R)*(T-R);else{const A=((L-g)*(b-g)+(T-S)*(R-S))/C;A<0?(F=g,I=S,O=(g-L)*(g-L)+(S-T)*(S-T)):A>1?(F=b,I=R,O=(b-L)*(b-L)+(R-T)*(R-T)):(F=g+A*(b-g),I=S+A*(R-S),O=(F-L)*(F-L)+(I-T)*(I-T))}return[F,I,O]},_getProjectionToLine(g,S,b){const R=e.Util.cloneObject(g);let L=Number.MAX_VALUE;return S.forEach(function(T,F){if(!b&&F===S.length-1)return;const I=S[(F+1)%S.length],O=e.Util._getProjectionToSegment(T.x,T.y,I.x,I.y,g.x,g.y),C=O[0],A=O[1],j=O[2];j<L&&(R.x=C,R.y=A,L=j)}),R},_prepareArrayForTween(g,S,b){const R=[],L=[];if(g.length>S.length){const F=S;S=g,g=F}for(let F=0;F<g.length;F+=2)R.push({x:g[F],y:g[F+1]});for(let F=0;F<S.length;F+=2)L.push({x:S[F],y:S[F+1]});const T=[];return L.forEach(function(F){const I=e.Util._getProjectionToLine(F,R,b);T.push(I.x),T.push(I.y)}),T},_prepareToStringify(g){let S;g.visitedByCircularReferenceRemoval=!0;for(const b in g)if(g.hasOwnProperty(b)&&g[b]&&typeof g[b]=="object"){if(S=Object.getOwnPropertyDescriptor(g,b),g[b].visitedByCircularReferenceRemoval||e.Util._isElement(g[b]))if(S.configurable)delete g[b];else return null;else if(e.Util._prepareToStringify(g[b])===null)if(S.configurable)delete g[b];else return null}return delete g.visitedByCircularReferenceRemoval,g},_assign(g,S){for(const b in S)g[b]=S[b];return g},_getFirstPointerId(g){return g.touches?g.changedTouches[0].identifier:g.pointerId||999},releaseCanvas(...g){r.Konva.releaseCanvasOnDestroy&&g.forEach(S=>{S.width=0,S.height=0})},drawRoundedRectPath(g,S,b,R){let L=0,T=0,F=0,I=0;typeof R=="number"?L=T=F=I=Math.min(R,S/2,b/2):(L=Math.min(R[0]||0,S/2,b/2),T=Math.min(R[1]||0,S/2,b/2),I=Math.min(R[2]||0,S/2,b/2),F=Math.min(R[3]||0,S/2,b/2)),g.moveTo(L,0),g.lineTo(S-T,0),g.arc(S-T,T,T,Math.PI*3/2,0,!1),g.lineTo(S,b-I),g.arc(S-I,b-I,I,0,Math.PI/2,!1),g.lineTo(F,b),g.arc(F,b-F,F,Math.PI/2,Math.PI,!1),g.lineTo(0,L),g.arc(L,L,L,Math.PI,Math.PI*3/2,!1)}}}(J0)),J0}var Qh={},eg={},ds={},Hy;function Yr(){if(Hy)return ds;Hy=1,Object.defineProperty(ds,"__esModule",{value:!0}),ds.RGBComponent=n,ds.alphaComponent=a,ds.getNumberValidator=i,ds.getNumberOrArrayOfNumbersValidator=o,ds.getNumberOrAutoValidator=s,ds.getStringValidator=u,ds.getStringOrGradientValidator=c,ds.getFunctionValidator=h,ds.getNumberArrayValidator=p,ds.getBooleanValidator=v,ds.getComponentValidator=f;const e=jr(),r=Li();function t(_){return r.Util._isString(_)?'"'+_+'"':Object.prototype.toString.call(_)==="[object Number]"||r.Util._isBoolean(_)?_:Object.prototype.toString.call(_)}function n(_){return _>255?255:_<0?0:Math.round(_)}function a(_){return _>1?1:_<1e-4?1e-4:_}function i(){if(e.Konva.isUnminified)return function(_,E){return r.Util._isNumber(_)||r.Util.warn(t(_)+' is a not valid value for "'+E+'" attribute. The value should be a number.'),_}}function o(_){if(e.Konva.isUnminified)return function(E,w){let x=r.Util._isNumber(E),y=r.Util._isArray(E)&&E.length==_;return!x&&!y&&r.Util.warn(t(E)+' is a not valid value for "'+w+'" attribute. The value should be a number or Array<number>('+_+")"),E}}function s(){if(e.Konva.isUnminified)return function(_,E){var w=r.Util._isNumber(_),x=_==="auto";return w||x||r.Util.warn(t(_)+' is a not valid value for "'+E+'" attribute. The value should be a number or "auto".'),_}}function u(){if(e.Konva.isUnminified)return function(_,E){return r.Util._isString(_)||r.Util.warn(t(_)+' is a not valid value for "'+E+'" attribute. The value should be a string.'),_}}function c(){if(e.Konva.isUnminified)return function(_,E){const w=r.Util._isString(_),x=Object.prototype.toString.call(_)==="[object CanvasGradient]"||_&&_.addColorStop;return w||x||r.Util.warn(t(_)+' is a not valid value for "'+E+'" attribute. The value should be a string or a native gradient.'),_}}function h(){if(e.Konva.isUnminified)return function(_,E){return r.Util._isFunction(_)||r.Util.warn(t(_)+' is a not valid value for "'+E+'" attribute. The value should be a function.'),_}}function p(){if(e.Konva.isUnminified)return function(_,E){const w=Int8Array?Object.getPrototypeOf(Int8Array):null;return w&&_ instanceof w||(r.Util._isArray(_)?_.forEach(function(x){r.Util._isNumber(x)||r.Util.warn('"'+E+'" attribute has non numeric element '+x+". Make sure that all elements are numbers.")}):r.Util.warn(t(_)+' is a not valid value for "'+E+'" attribute. The value should be a array of numbers.')),_}}function v(){if(e.Konva.isUnminified)return function(_,E){var w=_===!0||_===!1;return w||r.Util.warn(t(_)+' is a not valid value for "'+E+'" attribute. The value should be a boolean.'),_}}function f(_){if(e.Konva.isUnminified)return function(E,w){return E==null||r.Util.isObject(E)||r.Util.warn(t(E)+' is a not valid value for "'+w+'" attribute. The value should be an object with properties '+_),E}}return ds}var Gy;function Vr(){return Gy||(Gy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const r=Li(),t=Yr(),n="get",a="set";e.Factory={addGetterSetter(i,o,s,u,c){e.Factory.addGetter(i,o,s),e.Factory.addSetter(i,o,u,c),e.Factory.addOverloadedGetterSetter(i,o)},addGetter(i,o,s){var u=n+r.Util._capitalize(o);i.prototype[u]=i.prototype[u]||function(){const c=this.attrs[o];return c===void 0?s:c}},addSetter(i,o,s,u){var c=a+r.Util._capitalize(o);i.prototype[c]||e.Factory.overWriteSetter(i,o,s,u)},overWriteSetter(i,o,s,u){var c=a+r.Util._capitalize(o);i.prototype[c]=function(h){return s&&h!==void 0&&h!==null&&(h=s.call(this,h,o)),this._setAttr(o,h),u&&u.call(this),this}},addComponentsGetterSetter(i,o,s,u,c){const h=s.length,p=r.Util._capitalize,v=n+p(o),f=a+p(o);i.prototype[v]=function(){const E={};for(let w=0;w<h;w++){const x=s[w];E[x]=this.getAttr(o+p(x))}return E};const _=(0,t.getComponentValidator)(s);i.prototype[f]=function(E){const w=this.attrs[o];u&&(E=u.call(this,E,o)),_&&_.call(this,E,o);for(const x in E)E.hasOwnProperty(x)&&this._setAttr(o+p(x),E[x]);return E||s.forEach(x=>{this._setAttr(o+p(x),void 0)}),this._fireChangeEvent(o,w,E),c&&c.call(this),this},e.Factory.addOverloadedGetterSetter(i,o)},addOverloadedGetterSetter(i,o){var s=r.Util._capitalize(o),u=a+s,c=n+s;i.prototype[o]=function(){return arguments.length?(this[u](arguments[0]),this):this[c]()}},addDeprecatedGetterSetter(i,o,s,u){r.Util.error("Adding deprecated "+o);const c=n+r.Util._capitalize(o),h=o+" property is deprecated and will be removed soon. Look at Konva change log for more information.";i.prototype[c]=function(){r.Util.error(h);const p=this.attrs[o];return p===void 0?s:p},e.Factory.addSetter(i,o,u,function(){r.Util.error(h)}),e.Factory.addOverloadedGetterSetter(i,o)},backCompat(i,o){r.Util.each(o,function(s,u){const c=i.prototype[u],h=n+r.Util._capitalize(s),p=a+r.Util._capitalize(s);function v(){c.apply(this,arguments),r.Util.error('"'+s+'" method is deprecated and will be removed soon. Use ""'+u+'" instead.')}i.prototype[s]=v,i.prototype[h]=v,i.prototype[p]=v})},afterSetFilter(){this._filterUpToDate=!1}}}(eg)),eg}var ec={},tc={},Vy;function x6(){if(Vy)return tc;Vy=1,Object.defineProperty(tc,"__esModule",{value:!0}),tc.HitContext=tc.SceneContext=tc.Context=void 0;const e=Li(),r=jr();function t(x){const y=[],g=x.length,S=e.Util;for(let b=0;b<g;b++){let R=x[b];S._isNumber(R)?R=Math.round(R*1e3)/1e3:S._isString(R)||(R=R+""),y.push(R)}return y}const n=",",a="(",i=")",o="([",s="])",u=";",c="()",h="=",p=["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"],v=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"],f=100;let _=class{constructor(y){this.canvas=y,r.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(y){y.fillEnabled()&&this._fill(y)}_fill(y){}strokeShape(y){y.hasStroke()&&this._stroke(y)}_stroke(y){}fillStrokeShape(y){y.attrs.fillAfterStrokeEnabled?(this.strokeShape(y),this.fillShape(y)):(this.fillShape(y),this.strokeShape(y))}getTrace(y,g){let S=this.traceArr,b=S.length,R="",L,T,F,I;for(L=0;L<b;L++)T=S[L],F=T.method,F?(I=T.args,R+=F,y?R+=c:e.Util._isArray(I[0])?R+=o+I.join(n)+s:(g&&(I=I.map(O=>typeof O=="number"?Math.floor(O):O)),R+=a+I.join(n)+i)):(R+=T.property,y||(R+=h+T.val)),R+=u;return R}clearTrace(){this.traceArr=[]}_trace(y){let g=this.traceArr,S;g.push(y),S=g.length,S>=f&&g.shift()}reset(){const y=this.getCanvas().getPixelRatio();this.setTransform(1*y,0,0,1*y,0,0)}getCanvas(){return this.canvas}clear(y){const g=this.getCanvas();y?this.clearRect(y.x||0,y.y||0,y.width||0,y.height||0):this.clearRect(0,0,g.getWidth()/g.pixelRatio,g.getHeight()/g.pixelRatio)}_applyLineCap(y){const g=y.attrs.lineCap;g&&this.setAttr("lineCap",g)}_applyOpacity(y){const g=y.getAbsoluteOpacity();g!==1&&this.setAttr("globalAlpha",g)}_applyLineJoin(y){const g=y.attrs.lineJoin;g&&this.setAttr("lineJoin",g)}setAttr(y,g){this._context[y]=g}arc(y,g,S,b,R,L){this._context.arc(y,g,S,b,R,L)}arcTo(y,g,S,b,R){this._context.arcTo(y,g,S,b,R)}beginPath(){this._context.beginPath()}bezierCurveTo(y,g,S,b,R,L){this._context.bezierCurveTo(y,g,S,b,R,L)}clearRect(y,g,S,b){this._context.clearRect(y,g,S,b)}clip(...y){this._context.clip.apply(this._context,y)}closePath(){this._context.closePath()}createImageData(y,g){const S=arguments;if(S.length===2)return this._context.createImageData(y,g);if(S.length===1)return this._context.createImageData(y)}createLinearGradient(y,g,S,b){return this._context.createLinearGradient(y,g,S,b)}createPattern(y,g){return this._context.createPattern(y,g)}createRadialGradient(y,g,S,b,R,L){return this._context.createRadialGradient(y,g,S,b,R,L)}drawImage(y,g,S,b,R,L,T,F,I){const O=arguments,C=this._context;O.length===3?C.drawImage(y,g,S):O.length===5?C.drawImage(y,g,S,b,R):O.length===9&&C.drawImage(y,g,S,b,R,L,T,F,I)}ellipse(y,g,S,b,R,L,T,F){this._context.ellipse(y,g,S,b,R,L,T,F)}isPointInPath(y,g,S,b){return S?this._context.isPointInPath(S,y,g,b):this._context.isPointInPath(y,g,b)}fill(...y){this._context.fill.apply(this._context,y)}fillRect(y,g,S,b){this._context.fillRect(y,g,S,b)}strokeRect(y,g,S,b){this._context.strokeRect(y,g,S,b)}fillText(y,g,S,b){b?this._context.fillText(y,g,S,b):this._context.fillText(y,g,S)}measureText(y){return this._context.measureText(y)}getImageData(y,g,S,b){return this._context.getImageData(y,g,S,b)}lineTo(y,g){this._context.lineTo(y,g)}moveTo(y,g){this._context.moveTo(y,g)}rect(y,g,S,b){this._context.rect(y,g,S,b)}roundRect(y,g,S,b,R){this._context.roundRect(y,g,S,b,R)}putImageData(y,g,S){this._context.putImageData(y,g,S)}quadraticCurveTo(y,g,S,b){this._context.quadraticCurveTo(y,g,S,b)}restore(){this._context.restore()}rotate(y){this._context.rotate(y)}save(){this._context.save()}scale(y,g){this._context.scale(y,g)}setLineDash(y){this._context.setLineDash?this._context.setLineDash(y):"mozDash"in this._context?this._context.mozDash=y:"webkitLineDash"in this._context&&(this._context.webkitLineDash=y)}getLineDash(){return this._context.getLineDash()}setTransform(y,g,S,b,R,L){this._context.setTransform(y,g,S,b,R,L)}stroke(y){y?this._context.stroke(y):this._context.stroke()}strokeText(y,g,S,b){this._context.strokeText(y,g,S,b)}transform(y,g,S,b,R,L){this._context.transform(y,g,S,b,R,L)}translate(y,g){this._context.translate(y,g)}_enableTrace(){let y=this,g=p.length,S=this.setAttr,b,R;const L=function(T){let F=y[T],I;y[T]=function(){return R=t(Array.prototype.slice.call(arguments,0)),I=F.apply(y,arguments),y._trace({method:T,args:R}),I}};for(b=0;b<g;b++)L(p[b]);y.setAttr=function(){S.apply(y,arguments);const T=arguments[0];let F=arguments[1];(T==="shadowOffsetX"||T==="shadowOffsetY"||T==="shadowBlur")&&(F=F/this.canvas.getPixelRatio()),y._trace({property:T,val:F})}}_applyGlobalCompositeOperation(y){const g=y.attrs.globalCompositeOperation;!g||g==="source-over"||this.setAttr("globalCompositeOperation",g)}};tc.Context=_,v.forEach(function(x){Object.defineProperty(_.prototype,x,{get(){return this._context[x]},set(y){this._context[x]=y}})});class E extends _{constructor(y,{willReadFrequently:g=!1}={}){super(y),this._context=y._canvas.getContext("2d",{willReadFrequently:g})}_fillColor(y){const g=y.fill();this.setAttr("fillStyle",g),y._fillFunc(this)}_fillPattern(y){this.setAttr("fillStyle",y._getFillPattern()),y._fillFunc(this)}_fillLinearGradient(y){const g=y._getLinearGradient();g&&(this.setAttr("fillStyle",g),y._fillFunc(this))}_fillRadialGradient(y){const g=y._getRadialGradient();g&&(this.setAttr("fillStyle",g),y._fillFunc(this))}_fill(y){const g=y.fill(),S=y.getFillPriority();if(g&&S==="color"){this._fillColor(y);return}const b=y.getFillPatternImage();if(b&&S==="pattern"){this._fillPattern(y);return}const R=y.getFillLinearGradientColorStops();if(R&&S==="linear-gradient"){this._fillLinearGradient(y);return}const L=y.getFillRadialGradientColorStops();if(L&&S==="radial-gradient"){this._fillRadialGradient(y);return}g?this._fillColor(y):b?this._fillPattern(y):R?this._fillLinearGradient(y):L&&this._fillRadialGradient(y)}_strokeLinearGradient(y){const g=y.getStrokeLinearGradientStartPoint(),S=y.getStrokeLinearGradientEndPoint(),b=y.getStrokeLinearGradientColorStops(),R=this.createLinearGradient(g.x,g.y,S.x,S.y);if(b){for(let L=0;L<b.length;L+=2)R.addColorStop(b[L],b[L+1]);this.setAttr("strokeStyle",R)}}_stroke(y){const g=y.dash(),S=y.getStrokeScaleEnabled();if(y.hasStroke()){if(!S){this.save();const R=this.getCanvas().getPixelRatio();this.setTransform(R,0,0,R,0,0)}this._applyLineCap(y),g&&y.dashEnabled()&&(this.setLineDash(g),this.setAttr("lineDashOffset",y.dashOffset())),this.setAttr("lineWidth",y.strokeWidth()),y.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),y.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(y):this.setAttr("strokeStyle",y.stroke()),y._strokeFunc(this),S||this.restore()}}_applyShadow(y){var g,S,b;const R=(g=y.getShadowRGBA())!==null&&g!==void 0?g:"black",L=(S=y.getShadowBlur())!==null&&S!==void 0?S:5,T=(b=y.getShadowOffset())!==null&&b!==void 0?b:{x:0,y:0},F=y.getAbsoluteScale(),I=this.canvas.getPixelRatio(),O=F.x*I,C=F.y*I;this.setAttr("shadowColor",R),this.setAttr("shadowBlur",L*Math.min(Math.abs(O),Math.abs(C))),this.setAttr("shadowOffsetX",T.x*O),this.setAttr("shadowOffsetY",T.y*C)}}tc.SceneContext=E;class w extends _{constructor(y){super(y),this._context=y._canvas.getContext("2d",{willReadFrequently:!0})}_fill(y){this.save(),this.setAttr("fillStyle",y.colorKey),y._fillFuncHit(this),this.restore()}strokeShape(y){y.hasHitStroke()&&this._stroke(y)}_stroke(y){if(y.hasHitStroke()){const g=y.getStrokeScaleEnabled();if(!g){this.save();const R=this.getCanvas().getPixelRatio();this.setTransform(R,0,0,R,0,0)}this._applyLineCap(y);const S=y.hitStrokeWidth(),b=S==="auto"?y.strokeWidth():S;this.setAttr("lineWidth",b),this.setAttr("strokeStyle",y.colorKey),y._strokeFuncHit(this),g||this.restore()}}}return tc.HitContext=w,tc}var Wy;function J1(){if(Wy)return ec;Wy=1,Object.defineProperty(ec,"__esModule",{value:!0}),ec.HitCanvas=ec.SceneCanvas=ec.Canvas=void 0;const e=Li(),r=x6(),t=jr();let n;function a(){if(n)return n;const u=e.Util.createCanvasElement(),c=u.getContext("2d");return n=function(){const h=t.Konva._global.devicePixelRatio||1,p=c.webkitBackingStorePixelRatio||c.mozBackingStorePixelRatio||c.msBackingStorePixelRatio||c.oBackingStorePixelRatio||c.backingStorePixelRatio||1;return h/p}(),e.Util.releaseCanvas(u),n}let i=class{constructor(c){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const p=(c||{}).pixelRatio||t.Konva.pixelRatio||a();this.pixelRatio=p,this._canvas=e.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(c){const h=this.pixelRatio;this.pixelRatio=c,this.setSize(this.getWidth()/h,this.getHeight()/h)}setWidth(c){this.width=this._canvas.width=c*this.pixelRatio,this._canvas.style.width=c+"px";const h=this.pixelRatio;this.getContext()._context.scale(h,h)}setHeight(c){this.height=this._canvas.height=c*this.pixelRatio,this._canvas.style.height=c+"px";const h=this.pixelRatio;this.getContext()._context.scale(h,h)}getWidth(){return this.width}getHeight(){return this.height}setSize(c,h){this.setWidth(c||0),this.setHeight(h||0)}toDataURL(c,h){try{return this._canvas.toDataURL(c,h)}catch{try{return this._canvas.toDataURL()}catch(v){return e.Util.error("Unable to get data URL. "+v.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}};ec.Canvas=i;class o extends i{constructor(c={width:0,height:0,willReadFrequently:!1}){super(c),this.context=new r.SceneContext(this,{willReadFrequently:c.willReadFrequently}),this.setSize(c.width,c.height)}}ec.SceneCanvas=o;class s extends i{constructor(c={width:0,height:0}){super(c),this.hitCanvas=!0,this.context=new r.HitContext(this),this.setSize(c.width,c.height)}}return ec.HitCanvas=s,ec}var tg={},$y;function sm(){return $y||($y=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const r=jr(),t=Li();e.DD={get isDragging(){let n=!1;return e.DD._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(n=!0)}),n},justDragged:!1,get node(){let n;return e.DD._dragElements.forEach(a=>{n=a.node}),n},_dragElements:new Map,_drag(n){const a=[];e.DD._dragElements.forEach((i,o)=>{const{node:s}=i,u=s.getStage();u.setPointersPositions(n),i.pointerId===void 0&&(i.pointerId=t.Util._getFirstPointerId(n));const c=u._changedPointerPositions.find(h=>h.id===i.pointerId);if(c){if(i.dragStatus!=="dragging"){const h=s.dragDistance();if(Math.max(Math.abs(c.x-i.startPointerPos.x),Math.abs(c.y-i.startPointerPos.y))<h||(s.startDrag({evt:n}),!s.isDragging()))return}s._setDragPosition(n,i),a.push(s)}}),a.forEach(i=>{i.fire("dragmove",{type:"dragmove",target:i,evt:n},!0)})},_endDragBefore(n){const a=[];e.DD._dragElements.forEach(i=>{const{node:o}=i,s=o.getStage();if(n&&s.setPointersPositions(n),!s._changedPointerPositions.find(h=>h.id===i.pointerId))return;(i.dragStatus==="dragging"||i.dragStatus==="stopped")&&(e.DD.justDragged=!0,r.Konva._mouseListenClick=!1,r.Konva._touchListenClick=!1,r.Konva._pointerListenClick=!1,i.dragStatus="stopped");const c=i.node.getLayer()||i.node instanceof r.Konva.Stage&&i.node;c&&a.indexOf(c)===-1&&a.push(c)}),a.forEach(i=>{i.draw()})},_endDragAfter(n){e.DD._dragElements.forEach((a,i)=>{a.dragStatus==="stopped"&&a.node.fire("dragend",{type:"dragend",target:a.node,evt:n},!0),a.dragStatus!=="dragging"&&e.DD._dragElements.delete(i)})}},r.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("touchcancel",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1),window.addEventListener("touchcancel",e.DD._endDragAfter,!1))}(tg)),tg}var Yy;function Ji(){if(Yy)return Qh;Yy=1,Object.defineProperty(Qh,"__esModule",{value:!0}),Qh.Node=void 0;const e=Li(),r=Vr(),t=J1(),n=jr(),a=sm(),i=Yr(),o="absoluteOpacity",s="allEventListeners",u="absoluteTransform",c="absoluteScale",h="canvas",p="Change",v="children",f="konva",_="listening",E="mouseenter",w="mouseleave",x="set",y="Shape",g=" ",S="stage",b="transform",R="Stage",L="visible",T=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(g);let F=1;class I{constructor(A){this._id=F++,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(A),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(A){(A===b||A===u)&&this._cache.get(A)?this._cache.get(A).dirty=!0:A?this._cache.delete(A):this._cache.clear()}_getCache(A,j){let N=this._cache.get(A);return(N===void 0||(A===b||A===u)&&N.dirty===!0)&&(N=j.call(this),this._cache.set(A,N)),N}_calculate(A,j,N){if(!this._attachedDepsListeners.get(A)){const B=j.map(W=>W+"Change.konva").join(g);this.on(B,()=>{this._clearCache(A)}),this._attachedDepsListeners.set(A,!0)}return this._getCache(A,N)}_getCanvasCache(){return this._cache.get(h)}_clearSelfAndDescendantCache(A){this._clearCache(A),A===u&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(h)){const{scene:A,filter:j,hit:N}=this._cache.get(h);e.Util.releaseCanvas(A,j,N),this._cache.delete(h)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(A){const j=A||{};let N={};(j.x===void 0||j.y===void 0||j.width===void 0||j.height===void 0)&&(N=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let B=Math.ceil(j.width||N.width),W=Math.ceil(j.height||N.height),Y=j.pixelRatio,Z=j.x===void 0?Math.floor(N.x):j.x,V=j.y===void 0?Math.floor(N.y):j.y,H=j.offset||0,U=j.drawBorder||!1,D=j.hitCanvasPixelRatio||1;if(!B||!W){e.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const $=Math.abs(Math.round(N.x)-Z)>.5?1:0,Q=Math.abs(Math.round(N.y)-V)>.5?1:0;B+=H*2+$,W+=H*2+Q,Z-=H,V-=H;const ee=new t.SceneCanvas({pixelRatio:Y,width:B,height:W}),te=new t.SceneCanvas({pixelRatio:Y,width:0,height:0,willReadFrequently:!0}),ae=new t.HitCanvas({pixelRatio:D,width:B,height:W}),se=ee.getContext(),ce=ae.getContext();return ae.isCache=!0,ee.isCache=!0,this._cache.delete(h),this._filterUpToDate=!1,j.imageSmoothingEnabled===!1&&(ee.getContext()._context.imageSmoothingEnabled=!1,te.getContext()._context.imageSmoothingEnabled=!1),se.save(),ce.save(),se.translate(-Z,-V),ce.translate(-Z,-V),this._isUnderCache=!0,this._clearSelfAndDescendantCache(o),this._clearSelfAndDescendantCache(c),this.drawScene(ee,this),this.drawHit(ae,this),this._isUnderCache=!1,se.restore(),ce.restore(),U&&(se.save(),se.beginPath(),se.rect(0,0,B,W),se.closePath(),se.setAttr("strokeStyle","red"),se.setAttr("lineWidth",5),se.stroke(),se.restore()),this._cache.set(h,{scene:ee,filter:te,hit:ae,x:Z,y:V}),this._requestDraw(),this}isCached(){return this._cache.has(h)}getClientRect(A){throw new Error('abstract "getClientRect" method call')}_transformedRect(A,j){const N=[{x:A.x,y:A.y},{x:A.x+A.width,y:A.y},{x:A.x+A.width,y:A.y+A.height},{x:A.x,y:A.y+A.height}];let B=1/0,W=1/0,Y=-1/0,Z=-1/0;const V=this.getAbsoluteTransform(j);return N.forEach(function(H){const U=V.point(H);B===void 0&&(B=Y=U.x,W=Z=U.y),B=Math.min(B,U.x),W=Math.min(W,U.y),Y=Math.max(Y,U.x),Z=Math.max(Z,U.y)}),{x:B,y:W,width:Y-B,height:Z-W}}_drawCachedSceneCanvas(A){A.save(),A._applyOpacity(this),A._applyGlobalCompositeOperation(this);const j=this._getCanvasCache();A.translate(j.x,j.y);const N=this._getCachedSceneCanvas(),B=N.pixelRatio;A.drawImage(N._canvas,0,0,N.width/B,N.height/B),A.restore()}_drawCachedHitCanvas(A){const j=this._getCanvasCache(),N=j.hit;A.save(),A.translate(j.x,j.y),A.drawImage(N._canvas,0,0,N.width/N.pixelRatio,N.height/N.pixelRatio),A.restore()}_getCachedSceneCanvas(){let A=this.filters(),j=this._getCanvasCache(),N=j.scene,B=j.filter,W=B.getContext(),Y,Z,V,H;if(A){if(!this._filterUpToDate){const U=N.pixelRatio;B.setSize(N.width/N.pixelRatio,N.height/N.pixelRatio);try{for(Y=A.length,W.clear(),W.drawImage(N._canvas,0,0,N.getWidth()/U,N.getHeight()/U),Z=W.getImageData(0,0,B.getWidth(),B.getHeight()),V=0;V<Y;V++){if(H=A[V],typeof H!="function"){e.Util.error("Filter should be type of function, but got "+typeof H+" instead. Please check correct filters");continue}H.call(this,Z),W.putImageData(Z,0,0)}}catch(D){e.Util.error("Unable to apply filter. "+D.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return B}return N}on(A,j){if(this._cache&&this._cache.delete(s),arguments.length===3)return this._delegate.apply(this,arguments);let N=A.split(g),B=N.length,W,Y,Z,V,H;for(W=0;W<B;W++)Y=N[W],Z=Y.split("."),V=Z[0],H=Z[1]||"",this.eventListeners[V]||(this.eventListeners[V]=[]),this.eventListeners[V].push({name:H,handler:j});return this}off(A,j){let N=(A||"").split(g),B=N.length,W,Y,Z,V,H,U;if(this._cache&&this._cache.delete(s),!A)for(Y in this.eventListeners)this._off(Y);for(W=0;W<B;W++)if(Z=N[W],V=Z.split("."),H=V[0],U=V[1],H)this.eventListeners[H]&&this._off(H,U,j);else for(Y in this.eventListeners)this._off(Y,U,j);return this}dispatchEvent(A){const j={target:this,type:A.type,evt:A};return this.fire(A.type,j),this}addEventListener(A,j){return this.on(A,function(N){j.call(this,N.evt)}),this}removeEventListener(A){return this.off(A),this}_delegate(A,j,N){const B=this;this.on(A,function(W){const Y=W.target.findAncestors(j,!0,B);for(let Z=0;Z<Y.length;Z++)W=e.Util.cloneObject(W),W.currentTarget=Y[Z],N.call(Y[Z],W)})}remove(){return this.isDragging()&&this.stopDrag(),a.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(u),this._clearSelfAndDescendantCache(o),this._clearSelfAndDescendantCache(c),this._clearSelfAndDescendantCache(S),this._clearSelfAndDescendantCache(L),this._clearSelfAndDescendantCache(_)}_remove(){this._clearCaches();const A=this.getParent();A&&A.children&&(A.children.splice(this.index,1),A._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(A){const j="get"+e.Util._capitalize(A);return e.Util._isFunction(this[j])?this[j]():this.attrs[A]}getAncestors(){let A=this.getParent(),j=[];for(;A;)j.push(A),A=A.getParent();return j}getAttrs(){return this.attrs||{}}setAttrs(A){return this._batchTransformChanges(()=>{let j,N;if(!A)return this;for(j in A)j!==v&&(N=x+e.Util._capitalize(j),e.Util._isFunction(this[N])?this[N](A[j]):this._setAttr(j,A[j]))}),this}isListening(){return this._getCache(_,this._isListening)}_isListening(A){if(!this.listening())return!1;const N=this.getParent();return N&&N!==A&&this!==A?N._isListening(A):!0}isVisible(){return this._getCache(L,this._isVisible)}_isVisible(A){if(!this.visible())return!1;const N=this.getParent();return N&&N!==A&&this!==A?N._isVisible(A):!0}shouldDrawHit(A,j=!1){if(A)return this._isVisible(A)&&this._isListening(A);const N=this.getLayer();let B=!1;a.DD._dragElements.forEach(Y=>{Y.dragStatus==="dragging"&&(Y.node.nodeType==="Stage"||Y.node.getLayer()===N)&&(B=!0)});const W=!j&&!n.Konva.hitOnDragEnabled&&(B||n.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!W}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let A=this.getDepth(),j=this,N=0,B,W,Y,Z;function V(U){for(B=[],W=U.length,Y=0;Y<W;Y++)Z=U[Y],N++,Z.nodeType!==y&&(B=B.concat(Z.getChildren().slice())),Z._id===j._id&&(Y=W);B.length>0&&B[0].getDepth()<=A&&V(B)}const H=this.getStage();return j.nodeType!==R&&H&&V(H.getChildren()),N}getDepth(){let A=0,j=this.parent;for(;j;)A++,j=j.parent;return A}_batchTransformChanges(A){this._batchingTransformChange=!0,A(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(b),this._clearSelfAndDescendantCache(u)),this._needClearTransformCache=!1}setPosition(A){return this._batchTransformChanges(()=>{this.x(A.x),this.y(A.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const A=this.getStage();if(!A)return null;const j=A.getPointerPosition();if(!j)return null;const N=this.getAbsoluteTransform().copy();return N.invert(),N.point(j)}getAbsolutePosition(A){let j=!1,N=this.parent;for(;N;){if(N.isCached()){j=!0;break}N=N.parent}j&&!A&&(A=!0);const B=this.getAbsoluteTransform(A).getMatrix(),W=new e.Transform,Y=this.offset();return W.m=B.slice(),W.translate(Y.x,Y.y),W.getTranslation()}setAbsolutePosition(A){const{x:j,y:N,...B}=this._clearTransform();this.attrs.x=j,this.attrs.y=N,this._clearCache(b);const W=this._getAbsoluteTransform().copy();return W.invert(),W.translate(A.x,A.y),A={x:this.attrs.x+W.getTranslation().x,y:this.attrs.y+W.getTranslation().y},this._setTransform(B),this.setPosition({x:A.x,y:A.y}),this._clearCache(b),this._clearSelfAndDescendantCache(u),this}_setTransform(A){let j;for(j in A)this.attrs[j]=A[j]}_clearTransform(){const A={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,A}move(A){let j=A.x,N=A.y,B=this.x(),W=this.y();return j!==void 0&&(B+=j),N!==void 0&&(W+=N),this.setPosition({x:B,y:W}),this}_eachAncestorReverse(A,j){let N=[],B=this.getParent(),W,Y;if(!(j&&j._id===this._id)){for(N.unshift(this);B&&(!j||B._id!==j._id);)N.unshift(B),B=B.parent;for(W=N.length,Y=0;Y<W;Y++)A(N[Y])}}rotate(A){return this.rotation(this.rotation()+A),this}moveToTop(){if(!this.parent)return e.Util.warn("Node has no parent. moveToTop function is ignored."),!1;const A=this.index,j=this.parent.getChildren().length;return A<j-1?(this.parent.children.splice(A,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return e.Util.warn("Node has no parent. moveUp function is ignored."),!1;const A=this.index,j=this.parent.getChildren().length;return A<j-1?(this.parent.children.splice(A,1),this.parent.children.splice(A+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return e.Util.warn("Node has no parent. moveDown function is ignored."),!1;const A=this.index;return A>0?(this.parent.children.splice(A,1),this.parent.children.splice(A-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return e.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;const A=this.index;return A>0?(this.parent.children.splice(A,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(A){if(!this.parent)return e.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(A<0||A>=this.parent.children.length)&&e.Util.warn("Unexpected value "+A+" 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 j=this.index;return this.parent.children.splice(j,1),this.parent.children.splice(A,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(o,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let A=this.opacity();const j=this.getParent();return j&&!j._isUnderCache&&(A*=j.getAbsoluteOpacity()),A}moveTo(A){return this.getParent()!==A&&(this._remove(),A.add(this)),this}toObject(){let A=this.getAttrs(),j,N,B,W,Y;const Z={attrs:{},className:this.getClassName()};for(j in A)N=A[j],Y=e.Util.isObject(N)&&!e.Util._isPlainObject(N)&&!e.Util._isArray(N),!Y&&(B=typeof this[j]=="function"&&this[j],delete A[j],W=B?B.call(this):null,A[j]=N,W!==N&&(Z.attrs[j]=N));return e.Util._prepareToStringify(Z)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(A,j,N){const B=[];j&&this._isMatch(A)&&B.push(this);let W=this.parent;for(;W;){if(W===N)return B;W._isMatch(A)&&B.push(W),W=W.parent}return B}isAncestorOf(A){return!1}findAncestor(A,j,N){return this.findAncestors(A,j,N)[0]}_isMatch(A){if(!A)return!1;if(typeof A=="function")return A(this);let j=A.replace(/ /g,"").split(","),N=j.length,B,W;for(B=0;B<N;B++)if(W=j[B],e.Util.isValidSelector(W)||(e.Util.warn('Selector "'+W+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),e.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),e.Util.warn("Konva is awesome, right?")),W.charAt(0)==="#"){if(this.id()===W.slice(1))return!0}else if(W.charAt(0)==="."){if(this.hasName(W.slice(1)))return!0}else if(this.className===W||this.nodeType===W)return!0;return!1}getLayer(){const A=this.getParent();return A?A.getLayer():null}getStage(){return this._getCache(S,this._getStage)}_getStage(){const A=this.getParent();return A?A.getStage():null}fire(A,j={},N){return j.target=j.target||this,N?this._fireAndBubble(A,j):this._fire(A,j),this}getAbsoluteTransform(A){return A?this._getAbsoluteTransform(A):this._getCache(u,this._getAbsoluteTransform)}_getAbsoluteTransform(A){let j;if(A)return j=new e.Transform,this._eachAncestorReverse(function(N){const B=N.transformsEnabled();B==="all"?j.multiply(N.getTransform()):B==="position"&&j.translate(N.x()-N.offsetX(),N.y()-N.offsetY())},A),j;{j=this._cache.get(u)||new e.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(j):j.reset();const N=this.transformsEnabled();if(N==="all")j.multiply(this.getTransform());else if(N==="position"){const B=this.attrs.x||0,W=this.attrs.y||0,Y=this.attrs.offsetX||0,Z=this.attrs.offsetY||0;j.translate(B-Y,W-Z)}return j.dirty=!1,j}}getAbsoluteScale(A){let j=this;for(;j;)j._isUnderCache&&(A=j),j=j.getParent();const B=this.getAbsoluteTransform(A).decompose();return{x:B.scaleX,y:B.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(b,this._getTransform)}_getTransform(){var A,j;const N=this._cache.get(b)||new e.Transform;N.reset();const B=this.x(),W=this.y(),Y=n.Konva.getAngle(this.rotation()),Z=(A=this.attrs.scaleX)!==null&&A!==void 0?A:1,V=(j=this.attrs.scaleY)!==null&&j!==void 0?j:1,H=this.attrs.skewX||0,U=this.attrs.skewY||0,D=this.attrs.offsetX||0,$=this.attrs.offsetY||0;return(B!==0||W!==0)&&N.translate(B,W),Y!==0&&N.rotate(Y),(H!==0||U!==0)&&N.skew(H,U),(Z!==1||V!==1)&&N.scale(Z,V),(D!==0||$!==0)&&N.translate(-1*D,-1*$),N.dirty=!1,N}clone(A){let j=e.Util.cloneObject(this.attrs),N,B,W,Y,Z;for(N in A)j[N]=A[N];const V=new this.constructor(j);for(N in this.eventListeners)for(B=this.eventListeners[N],W=B.length,Y=0;Y<W;Y++)Z=B[Y],Z.name.indexOf(f)<0&&(V.eventListeners[N]||(V.eventListeners[N]=[]),V.eventListeners[N].push(Z));return V}_toKonvaCanvas(A){A=A||{};const j=this.getClientRect(),N=this.getStage(),B=A.x!==void 0?A.x:Math.floor(j.x),W=A.y!==void 0?A.y:Math.floor(j.y),Y=A.pixelRatio||1,Z=new t.SceneCanvas({width:A.width||Math.ceil(j.width)||(N?N.width():0),height:A.height||Math.ceil(j.height)||(N?N.height():0),pixelRatio:Y}),V=Z.getContext(),H=new t.SceneCanvas({width:Z.width/Z.pixelRatio+Math.abs(B),height:Z.height/Z.pixelRatio+Math.abs(W),pixelRatio:Z.pixelRatio});return A.imageSmoothingEnabled===!1&&(V._context.imageSmoothingEnabled=!1),V.save(),(B||W)&&V.translate(-1*B,-1*W),this.drawScene(Z,void 0,H),V.restore(),Z}toCanvas(A){return this._toKonvaCanvas(A)._canvas}toDataURL(A){A=A||{};const j=A.mimeType||null,N=A.quality||null,B=this._toKonvaCanvas(A).toDataURL(j,N);return A.callback&&A.callback(B),B}toImage(A){return new Promise((j,N)=>{try{const B=A==null?void 0:A.callback;B&&delete A.callback,e.Util._urlToImage(this.toDataURL(A),function(W){j(W),B==null||B(W)})}catch(B){N(B)}})}toBlob(A){return new Promise((j,N)=>{try{const B=A==null?void 0:A.callback;B&&delete A.callback,this.toCanvas(A).toBlob(W=>{j(W),B==null||B(W)},A==null?void 0:A.mimeType,A==null?void 0:A.quality)}catch(B){N(B)}})}setSize(A){return this.width(A.width),this.height(A.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():n.Konva.dragDistance}_off(A,j,N){let B=this.eventListeners[A],W,Y,Z;for(W=0;W<B.length;W++)if(Y=B[W].name,Z=B[W].handler,(Y!=="konva"||j==="konva")&&(!j||Y===j)&&(!N||N===Z)){if(B.splice(W,1),B.length===0){delete this.eventListeners[A];break}W--}}_fireChangeEvent(A,j,N){this._fire(A+p,{oldVal:j,newVal:N})}addName(A){if(!this.hasName(A)){const j=this.name(),N=j?j+" "+A:A;this.name(N)}return this}hasName(A){if(!A)return!1;const j=this.name();return j?(j||"").split(/\s/g).indexOf(A)!==-1:!1}removeName(A){const j=(this.name()||"").split(/\s/g),N=j.indexOf(A);return N!==-1&&(j.splice(N,1),this.name(j.join(" "))),this}setAttr(A,j){const N=this[x+e.Util._capitalize(A)];return e.Util._isFunction(N)?N.call(this,j):this._setAttr(A,j),this}_requestDraw(){if(n.Konva.autoDrawEnabled){const A=this.getLayer()||this.getStage();A==null||A.batchDraw()}}_setAttr(A,j){const N=this.attrs[A];N===j&&!e.Util.isObject(j)||(j==null?delete this.attrs[A]:this.attrs[A]=j,this._shouldFireChangeEvents&&this._fireChangeEvent(A,N,j),this._requestDraw())}_setComponentAttr(A,j,N){let B;N!==void 0&&(B=this.attrs[A],B||(this.attrs[A]=this.getAttr(A)),this.attrs[A][j]=N,this._fireChangeEvent(A,B,N))}_fireAndBubble(A,j,N){if(j&&this.nodeType===y&&(j.target=this),!((A===E||A===w)&&(N&&(this===N||this.isAncestorOf&&this.isAncestorOf(N))||this.nodeType==="Stage"&&!N))){this._fire(A,j);const W=(A===E||A===w)&&N&&N.isAncestorOf&&N.isAncestorOf(this)&&!N.isAncestorOf(this.parent);(j&&!j.cancelBubble||!j)&&this.parent&&this.parent.isListening()&&!W&&(N&&N.parent?this._fireAndBubble.call(this.parent,A,j,N):this._fireAndBubble.call(this.parent,A,j))}}_getProtoListeners(A){var j,N,B;const W=(j=this._cache.get(s))!==null&&j!==void 0?j:{};let Y=W==null?void 0:W[A];if(Y===void 0){Y=[];let Z=Object.getPrototypeOf(this);for(;Z;){const V=(B=(N=Z.eventListeners)===null||N===void 0?void 0:N[A])!==null&&B!==void 0?B:[];Y.push(...V),Z=Object.getPrototypeOf(Z)}W[A]=Y,this._cache.set(s,W)}return Y}_fire(A,j){j=j||{},j.currentTarget=this,j.type=A;const N=this._getProtoListeners(A);if(N)for(var B=0;B<N.length;B++)N[B].handler.call(this,j);const W=this.eventListeners[A];if(W)for(var B=0;B<W.length;B++)W[B].handler.call(this,j)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(A){const j=A?A.pointerId:void 0,N=this.getStage(),B=this.getAbsolutePosition();if(!N)return;const W=N._getPointerById(j)||N._changedPointerPositions[0]||B;a.DD._dragElements.set(this._id,{node:this,startPointerPos:W,offset:{x:W.x-B.x,y:W.y-B.y},dragStatus:"ready",pointerId:j})}startDrag(A,j=!0){a.DD._dragElements.has(this._id)||this._createDragElement(A);const N=a.DD._dragElements.get(this._id);N.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:A&&A.evt},j)}_setDragPosition(A,j){const N=this.getStage()._getPointerById(j.pointerId);if(!N)return;let B={x:N.x-j.offset.x,y:N.y-j.offset.y};const W=this.dragBoundFunc();if(W!==void 0){const Y=W.call(this,B,A);Y?B=Y:e.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!==B.x||this._lastPos.y!==B.y)&&(this.setAbsolutePosition(B),this._requestDraw()),this._lastPos=B}stopDrag(A){const j=a.DD._dragElements.get(this._id);j&&(j.dragStatus="stopped"),a.DD._endDragBefore(A),a.DD._endDragAfter(A)}setDraggable(A){this._setAttr("draggable",A),this._dragChange()}isDragging(){const A=a.DD._dragElements.get(this._id);return A?A.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(A){if(!(!(A.evt.button!==void 0)||n.Konva.dragButtons.indexOf(A.evt.button)>=0)||this.isDragging())return;let B=!1;a.DD._dragElements.forEach(W=>{this.isAncestorOf(W.node)&&(B=!0)}),B||this._createDragElement(A)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const j=a.DD._dragElements.get(this._id),N=j&&j.dragStatus==="dragging",B=j&&j.dragStatus==="ready";N?this.stopDrag():B&&a.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(A={x:0,y:0}){const j=this.getStage();if(!j)return!1;const N={x:-A.x,y:-A.y,width:j.width()+2*A.x,height:j.height()+2*A.y};return e.Util.haveIntersection(N,this.getClientRect())}static create(A,j){return e.Util._isString(A)&&(A=JSON.parse(A)),this._createNode(A,j)}static _createNode(A,j){let N=I.prototype.getClassName.call(A),B=A.children,W,Y,Z;j&&(A.attrs.container=j),n.Konva[N]||(e.Util.warn('Can not find a node with class name "'+N+'". Fallback to "Shape".'),N="Shape");const V=n.Konva[N];if(W=new V(A.attrs),B)for(Y=B.length,Z=0;Z<Y;Z++)W.add(I._createNode(B[Z]));return W}}Qh.Node=I,I.prototype.nodeType="Node",I.prototype._attrsAffectingSize=[],I.prototype.eventListeners={},I.prototype.on.call(I.prototype,T,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(b),this._clearSelfAndDescendantCache(u)}),I.prototype.on.call(I.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(L)}),I.prototype.on.call(I.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(_)}),I.prototype.on.call(I.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(o)});const O=r.Factory.addGetterSetter;return O(I,"zIndex"),O(I,"absolutePosition"),O(I,"position"),O(I,"x",0,(0,i.getNumberValidator)()),O(I,"y",0,(0,i.getNumberValidator)()),O(I,"globalCompositeOperation","source-over",(0,i.getStringValidator)()),O(I,"opacity",1,(0,i.getNumberValidator)()),O(I,"name","",(0,i.getStringValidator)()),O(I,"id","",(0,i.getStringValidator)()),O(I,"rotation",0,(0,i.getNumberValidator)()),r.Factory.addComponentsGetterSetter(I,"scale",["x","y"]),O(I,"scaleX",1,(0,i.getNumberValidator)()),O(I,"scaleY",1,(0,i.getNumberValidator)()),r.Factory.addComponentsGetterSetter(I,"skew",["x","y"]),O(I,"skewX",0,(0,i.getNumberValidator)()),O(I,"skewY",0,(0,i.getNumberValidator)()),r.Factory.addComponentsGetterSetter(I,"offset",["x","y"]),O(I,"offsetX",0,(0,i.getNumberValidator)()),O(I,"offsetY",0,(0,i.getNumberValidator)()),O(I,"dragDistance",void 0,(0,i.getNumberValidator)()),O(I,"width",0,(0,i.getNumberValidator)()),O(I,"height",0,(0,i.getNumberValidator)()),O(I,"listening",!0,(0,i.getBooleanValidator)()),O(I,"preventDefault",!0,(0,i.getBooleanValidator)()),O(I,"filters",void 0,function(C){return this._filterUpToDate=!1,C}),O(I,"visible",!0,(0,i.getBooleanValidator)()),O(I,"transformsEnabled","all",(0,i.getStringValidator)()),O(I,"size"),O(I,"dragBoundFunc"),O(I,"draggable",!1,(0,i.getBooleanValidator)()),r.Factory.backCompat(I,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"}),Qh}var Jh={},Xy;function e0(){if(Xy)return Jh;Xy=1,Object.defineProperty(Jh,"__esModule",{value:!0}),Jh.Container=void 0;const e=Vr(),r=Ji(),t=Yr();let n=class extends r.Node{constructor(){super(...arguments),this.children=[]}getChildren(i){if(!i)return this.children||[];const o=this.children||[],s=[];return o.forEach(function(u){i(u)&&s.push(u)}),s}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(i=>{i.parent=null,i.index=0,i.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(i=>{i.parent=null,i.index=0,i.destroy()}),this.children=[],this._requestDraw(),this}add(...i){if(i.length===0)return this;if(i.length>1){for(let s=0;s<i.length;s++)this.add(i[s]);return this}const o=i[0];return o.getParent()?(o.moveTo(this),this):(this._validateAdd(o),o.index=this.getChildren().length,o.parent=this,o._clearCaches(),this.getChildren().push(o),this._fire("add",{child:o}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(i){return this._generalFind(i,!1)}findOne(i){const o=this._generalFind(i,!0);return o.length>0?o[0]:void 0}_generalFind(i,o){const s=[];return this._descendants(u=>{const c=u._isMatch(i);return c&&s.push(u),!!(c&&o)}),s}_descendants(i){let o=!1;const s=this.getChildren();for(const u of s){if(o=i(u),o)return!0;if(u.hasChildren()&&(o=u._descendants(i),o))return!0}return!1}toObject(){const i=r.Node.prototype.toObject.call(this);return i.children=[],this.getChildren().forEach(o=>{i.children.push(o.toObject())}),i}isAncestorOf(i){let o=i.getParent();for(;o;){if(o._id===this._id)return!0;o=o.getParent()}return!1}clone(i){const o=r.Node.prototype.clone.call(this,i);return this.getChildren().forEach(function(s){o.add(s.clone())}),o}getAllIntersections(i){const o=[];return this.find("Shape").forEach(s=>{s.isVisible()&&s.intersects(i)&&o.push(s)}),o}_clearSelfAndDescendantCache(i){var o;super._clearSelfAndDescendantCache(i),!this.isCached()&&((o=this.children)===null||o===void 0||o.forEach(function(s){s._clearSelfAndDescendantCache(i)}))}_setChildrenIndices(){var i;(i=this.children)===null||i===void 0||i.forEach(function(o,s){o.index=s}),this._requestDraw()}drawScene(i,o,s){const u=this.getLayer(),c=i||u&&u.getCanvas(),h=c&&c.getContext(),p=this._getCanvasCache(),v=p&&p.scene,f=c&&c.isCache;if(!this.isVisible()&&!f)return this;if(v){h.save();const _=this.getAbsoluteTransform(o).getMatrix();h.transform(_[0],_[1],_[2],_[3],_[4],_[5]),this._drawCachedSceneCanvas(h),h.restore()}else this._drawChildren("drawScene",c,o,s);return this}drawHit(i,o){if(!this.shouldDrawHit(o))return this;const s=this.getLayer(),u=i||s&&s.hitCanvas,c=u&&u.getContext(),h=this._getCanvasCache();if(h&&h.hit){c.save();const v=this.getAbsoluteTransform(o).getMatrix();c.transform(v[0],v[1],v[2],v[3],v[4],v[5]),this._drawCachedHitCanvas(c),c.restore()}else this._drawChildren("drawHit",u,o);return this}_drawChildren(i,o,s,u){var c;const h=o&&o.getContext(),p=this.clipWidth(),v=this.clipHeight(),f=this.clipFunc(),_=typeof p=="number"&&typeof v=="number"||f,E=s===this;if(_){h.save();const x=this.getAbsoluteTransform(s);let y=x.getMatrix();h.transform(y[0],y[1],y[2],y[3],y[4],y[5]),h.beginPath();let g;if(f)g=f.call(this,h,this);else{const S=this.clipX(),b=this.clipY();h.rect(S||0,b||0,p,v)}h.clip.apply(h,g),y=x.copy().invert().getMatrix(),h.transform(y[0],y[1],y[2],y[3],y[4],y[5])}const w=!E&&this.globalCompositeOperation()!=="source-over"&&i==="drawScene";w&&(h.save(),h._applyGlobalCompositeOperation(this)),(c=this.children)===null||c===void 0||c.forEach(function(x){x[i](o,s,u)}),w&&h.restore(),_&&h.restore()}getClientRect(i={}){var o;const s=i.skipTransform,u=i.relativeTo;let c,h,p,v,f={x:1/0,y:1/0,width:0,height:0};const _=this;(o=this.children)===null||o===void 0||o.forEach(function(x){if(!x.visible())return;const y=x.getClientRect({relativeTo:_,skipShadow:i.skipShadow,skipStroke:i.skipStroke});y.width===0&&y.height===0||(c===void 0?(c=y.x,h=y.y,p=y.x+y.width,v=y.y+y.height):(c=Math.min(c,y.x),h=Math.min(h,y.y),p=Math.max(p,y.x+y.width),v=Math.max(v,y.y+y.height)))});const E=this.find("Shape");let w=!1;for(let x=0;x<E.length;x++)if(E[x]._isVisible(this)){w=!0;break}return w&&c!==void 0?f={x:c,y:h,width:p-c,height:v-h}:f={x:0,y:0,width:0,height:0},s?f:this._transformedRect(f,u)}};return Jh.Container=n,e.Factory.addComponentsGetterSetter(n,"clip",["x","y","width","height"]),e.Factory.addGetterSetter(n,"clipX",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipY",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipWidth",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipHeight",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipFunc"),Jh}var rg={},Dc={},Ky;function E6(){if(Ky)return Dc;Ky=1,Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.getCapturedShape=n,Dc.createEvent=a,Dc.hasPointerCapture=i,Dc.setPointerCapture=o,Dc.releaseCapture=s;const e=jr(),r=new Map,t=e.Konva._global.PointerEvent!==void 0;function n(u){return r.get(u)}function a(u){return{evt:u,pointerId:u.pointerId}}function i(u,c){return r.get(u)===c}function o(u,c){s(u),c.getStage()&&(r.set(u,c),t&&c._fire("gotpointercapture",a(new PointerEvent("gotpointercapture"))))}function s(u,c){const h=r.get(u);if(!h)return;const p=h.getStage();p&&p.content,r.delete(u),t&&h._fire("lostpointercapture",a(new PointerEvent("lostpointercapture")))}return Dc}var Zy;function FS(){return Zy||(Zy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const r=Li(),t=Vr(),n=e0(),a=jr(),i=J1(),o=sm(),s=jr(),u=E6(),c="Stage",h="string",p="px",v="mouseout",f="mouseleave",_="mouseover",E="mouseenter",w="mousemove",x="mousedown",y="mouseup",g="pointermove",S="pointerdown",b="pointerup",R="pointercancel",L="lostpointercapture",T="pointerout",F="pointerleave",I="pointerover",O="pointerenter",C="contextmenu",A="touchstart",j="touchend",N="touchmove",B="touchcancel",W="wheel",Y=5,Z=[[E,"_pointerenter"],[x,"_pointerdown"],[w,"_pointermove"],[y,"_pointerup"],[f,"_pointerleave"],[A,"_pointerdown"],[N,"_pointermove"],[j,"_pointerup"],[B,"_pointercancel"],[_,"_pointerover"],[W,"_wheel"],[C,"_contextmenu"],[S,"_pointerdown"],[g,"_pointermove"],[b,"_pointerup"],[R,"_pointercancel"],[L,"_lostpointercapture"]],V={mouse:{[T]:v,[F]:f,[I]:_,[O]:E,[g]:w,[S]:x,[b]:y,[R]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[T]:"touchout",[F]:"touchleave",[I]:"touchover",[O]:"touchenter",[g]:N,[S]:A,[b]:j,[R]:B,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[T]:T,[F]:F,[I]:I,[O]:O,[g]:g,[S]:S,[b]:b,[R]:R,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},H=ee=>ee.indexOf("pointer")>=0?"pointer":ee.indexOf("touch")>=0?"touch":"mouse",U=ee=>{const te=H(ee);if(te==="pointer")return a.Konva.pointerEventsEnabled&&V.pointer;if(te==="touch")return V.touch;if(te==="mouse")return V.mouse};function D(ee={}){return(ee.clipFunc||ee.clipWidth||ee.clipHeight)&&r.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),ee}const $="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";e.stages=[];class Q extends n.Container{constructor(te){super(D(te)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),e.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{D(this.attrs)}),this._checkVisibility()}_validateAdd(te){const ae=te.getType()==="Layer",se=te.getType()==="FastLayer";ae||se||r.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const te=this.visible()?"":"none";this.content.style.display=te}setContainer(te){if(typeof te===h){if(te.charAt(0)==="."){const se=te.slice(1);te=document.getElementsByClassName(se)[0]}else{var ae;te.charAt(0)!=="#"?ae=te:ae=te.slice(1),te=document.getElementById(ae)}if(!te)throw"Can not find container in document with id "+ae}return this._setAttr("container",te),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),te.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const te=this.children,ae=te.length;for(let se=0;se<ae;se++)te[se].clear();return this}clone(te){return te||(te={}),te.container=typeof document<"u"&&document.createElement("div"),n.Container.prototype.clone.call(this,te)}destroy(){super.destroy();const te=this.content;te&&r.Util._isInDocument(te)&&this.container().removeChild(te);const ae=e.stages.indexOf(this);return ae>-1&&e.stages.splice(ae,1),r.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const te=this._pointerPositions[0]||this._changedPointerPositions[0];return te?{x:te.x,y:te.y}:(r.Util.warn($),null)}_getPointerById(te){return this._pointerPositions.find(ae=>ae.id===te)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(te){te=te||{},te.x=te.x||0,te.y=te.y||0,te.width=te.width||this.width(),te.height=te.height||this.height();const ae=new i.SceneCanvas({width:te.width,height:te.height,pixelRatio:te.pixelRatio||1}),se=ae.getContext()._context,ce=this.children;return(te.x||te.y)&&se.translate(-1*te.x,-1*te.y),ce.forEach(function(me){if(!me.isVisible())return;const _e=me._toKonvaCanvas(te);se.drawImage(_e._canvas,te.x,te.y,_e.getWidth()/_e.getPixelRatio(),_e.getHeight()/_e.getPixelRatio())}),ae}getIntersection(te){if(!te)return null;const ae=this.children,se=ae.length,ce=se-1;for(let me=ce;me>=0;me--){const _e=ae[me].getIntersection(te);if(_e)return _e}return null}_resizeDOM(){const te=this.width(),ae=this.height();this.content&&(this.content.style.width=te+p,this.content.style.height=ae+p),this.bufferCanvas.setSize(te,ae),this.bufferHitCanvas.setSize(te,ae),this.children.forEach(se=>{se.setSize({width:te,height:ae}),se.draw()})}add(te,...ae){if(arguments.length>1){for(let ce=0;ce<arguments.length;ce++)this.add(arguments[ce]);return this}super.add(te);const se=this.children.length;return se>Y&&r.Util.warn("The stage has "+se+" 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."),te.setSize({width:this.width(),height:this.height()}),te.draw(),a.Konva.isBrowser&&this.content.appendChild(te.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(te){return u.hasPointerCapture(te,this)}setPointerCapture(te){u.setPointerCapture(te,this)}releaseCapture(te){u.releaseCapture(te,this)}getLayers(){return this.children}_bindContentEvents(){a.Konva.isBrowser&&Z.forEach(([te,ae])=>{this.content.addEventListener(te,se=>{this[ae](se)},{passive:!1})})}_pointerenter(te){this.setPointersPositions(te);const ae=U(te.type);ae&&this._fire(ae.pointerenter,{evt:te,target:this,currentTarget:this})}_pointerover(te){this.setPointersPositions(te);const ae=U(te.type);ae&&this._fire(ae.pointerover,{evt:te,target:this,currentTarget:this})}_getTargetShape(te){let ae=this[te+"targetShape"];return ae&&!ae.getStage()&&(ae=null),ae}_pointerleave(te){const ae=U(te.type),se=H(te.type);if(!ae)return;this.setPointersPositions(te);const ce=this._getTargetShape(se),me=!(a.Konva.isDragging()||a.Konva.isTransforming())||a.Konva.hitOnDragEnabled;ce&&me?(ce._fireAndBubble(ae.pointerout,{evt:te}),ce._fireAndBubble(ae.pointerleave,{evt:te}),this._fire(ae.pointerleave,{evt:te,target:this,currentTarget:this}),this[se+"targetShape"]=null):me&&(this._fire(ae.pointerleave,{evt:te,target:this,currentTarget:this}),this._fire(ae.pointerout,{evt:te,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(te){const ae=U(te.type),se=H(te.type);if(!ae)return;this.setPointersPositions(te);let ce=!1;this._changedPointerPositions.forEach(me=>{const _e=this.getIntersection(me);if(o.DD.justDragged=!1,a.Konva["_"+se+"ListenClick"]=!0,!_e||!_e.isListening()){this[se+"ClickStartShape"]=void 0;return}a.Konva.capturePointerEventsEnabled&&_e.setPointerCapture(me.id),this[se+"ClickStartShape"]=_e,_e._fireAndBubble(ae.pointerdown,{evt:te,pointerId:me.id}),ce=!0;const Le=te.type.indexOf("touch")>=0;_e.preventDefault()&&te.cancelable&&Le&&te.preventDefault()}),ce||this._fire(ae.pointerdown,{evt:te,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(te){const ae=U(te.type),se=H(te.type);if(!ae||(a.Konva.isDragging()&&o.DD.node.preventDefault()&&te.cancelable&&te.preventDefault(),this.setPointersPositions(te),!(!(a.Konva.isDragging()||a.Konva.isTransforming())||a.Konva.hitOnDragEnabled)))return;const me={};let _e=!1;const Le=this._getTargetShape(se);this._changedPointerPositions.forEach(Re=>{const Pe=u.getCapturedShape(Re.id)||this.getIntersection(Re),ve=Re.id,it={evt:te,pointerId:ve},Se=Le!==Pe;if(Se&&Le&&(Le._fireAndBubble(ae.pointerout,{...it},Pe),Le._fireAndBubble(ae.pointerleave,{...it},Pe)),Pe){if(me[Pe._id])return;me[Pe._id]=!0}Pe&&Pe.isListening()?(_e=!0,Se&&(Pe._fireAndBubble(ae.pointerover,{...it},Le),Pe._fireAndBubble(ae.pointerenter,{...it},Le),this[se+"targetShape"]=Pe),Pe._fireAndBubble(ae.pointermove,{...it})):Le&&(this._fire(ae.pointerover,{evt:te,target:this,currentTarget:this,pointerId:ve}),this[se+"targetShape"]=null)}),_e||this._fire(ae.pointermove,{evt:te,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(te){const ae=U(te.type),se=H(te.type);if(!ae)return;this.setPointersPositions(te);const ce=this[se+"ClickStartShape"],me=this[se+"ClickEndShape"],_e={};let Le=!1;this._changedPointerPositions.forEach(Re=>{const Pe=u.getCapturedShape(Re.id)||this.getIntersection(Re);if(Pe){if(Pe.releaseCapture(Re.id),_e[Pe._id])return;_e[Pe._id]=!0}const ve=Re.id,it={evt:te,pointerId:ve};let Se=!1;a.Konva["_"+se+"InDblClickWindow"]?(Se=!0,clearTimeout(this[se+"DblTimeout"])):o.DD.justDragged||(a.Konva["_"+se+"InDblClickWindow"]=!0,clearTimeout(this[se+"DblTimeout"])),this[se+"DblTimeout"]=setTimeout(function(){a.Konva["_"+se+"InDblClickWindow"]=!1},a.Konva.dblClickWindow),Pe&&Pe.isListening()?(Le=!0,this[se+"ClickEndShape"]=Pe,Pe._fireAndBubble(ae.pointerup,{...it}),a.Konva["_"+se+"ListenClick"]&&ce&&ce===Pe&&(Pe._fireAndBubble(ae.pointerclick,{...it}),Se&&me&&me===Pe&&Pe._fireAndBubble(ae.pointerdblclick,{...it}))):(this[se+"ClickEndShape"]=null,a.Konva["_"+se+"ListenClick"]&&this._fire(ae.pointerclick,{evt:te,target:this,currentTarget:this,pointerId:ve}),Se&&this._fire(ae.pointerdblclick,{evt:te,target:this,currentTarget:this,pointerId:ve}))}),Le||this._fire(ae.pointerup,{evt:te,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),a.Konva["_"+se+"ListenClick"]=!1,te.cancelable&&se!=="touch"&&se!=="pointer"&&te.preventDefault()}_contextmenu(te){this.setPointersPositions(te);const ae=this.getIntersection(this.getPointerPosition());ae&&ae.isListening()?ae._fireAndBubble(C,{evt:te}):this._fire(C,{evt:te,target:this,currentTarget:this})}_wheel(te){this.setPointersPositions(te);const ae=this.getIntersection(this.getPointerPosition());ae&&ae.isListening()?ae._fireAndBubble(W,{evt:te}):this._fire(W,{evt:te,target:this,currentTarget:this})}_pointercancel(te){this.setPointersPositions(te);const ae=u.getCapturedShape(te.pointerId)||this.getIntersection(this.getPointerPosition());ae&&ae._fireAndBubble(b,u.createEvent(te)),u.releaseCapture(te.pointerId)}_lostpointercapture(te){u.releaseCapture(te.pointerId)}setPointersPositions(te){const ae=this._getContentPosition();let se=null,ce=null;te=te||window.event,te.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(te.touches,me=>{this._pointerPositions.push({id:me.identifier,x:(me.clientX-ae.left)/ae.scaleX,y:(me.clientY-ae.top)/ae.scaleY})}),Array.prototype.forEach.call(te.changedTouches||te.touches,me=>{this._changedPointerPositions.push({id:me.identifier,x:(me.clientX-ae.left)/ae.scaleX,y:(me.clientY-ae.top)/ae.scaleY})})):(se=(te.clientX-ae.left)/ae.scaleX,ce=(te.clientY-ae.top)/ae.scaleY,this.pointerPos={x:se,y:ce},this._pointerPositions=[{x:se,y:ce,id:r.Util._getFirstPointerId(te)}],this._changedPointerPositions=[{x:se,y:ce,id:r.Util._getFirstPointerId(te)}])}_setPointerPosition(te){r.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(te)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const te=this.content.getBoundingClientRect();return{top:te.top,left:te.left,scaleX:te.width/this.content.clientWidth||1,scaleY:te.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new i.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new i.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!a.Konva.isBrowser)return;const te=this.container();if(!te)throw"Stage has no container. A container is required.";te.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"),te.appendChild(this.content),this._resizeDOM()}cache(){return r.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(te){te.batchDraw()}),this}}e.Stage=Q,Q.prototype.nodeType=c,(0,s._registerNode)(Q),t.Factory.addGetterSetter(Q,"container"),a.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach(ee=>{ee.batchDraw()})})}(rg)),rg}var ed={},ng={},Qy;function Ma(){return Qy||(Qy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const r=jr(),t=Li(),n=Vr(),a=Ji(),i=Yr(),o=jr(),s=E6(),u="hasShadow",c="shadowRGBA",h="patternImage",p="linearGradient",v="radialGradient";let f;function _(){return f||(f=t.Util.createCanvasElement().getContext("2d"),f)}e.shapes={};function E(F){const I=this.attrs.fillRule;I?F.fill(I):F.fill()}function w(F){F.stroke()}function x(F){const I=this.attrs.fillRule;I?F.fill(I):F.fill()}function y(F){F.stroke()}function g(){this._clearCache(u)}function S(){this._clearCache(c)}function b(){this._clearCache(h)}function R(){this._clearCache(p)}function L(){this._clearCache(v)}class T extends a.Node{constructor(I){super(I);let O;for(;O=t.Util.getRandomColor(),!(O&&!(O in e.shapes)););this.colorKey=O,e.shapes[O]=this}getContext(){return t.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return t.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(u,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(h,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const O=_().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(O&&O.setTransform){const C=new t.Transform;C.translate(this.fillPatternX(),this.fillPatternY()),C.rotate(r.Konva.getAngle(this.fillPatternRotation())),C.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),C.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const A=C.getMatrix(),j=typeof DOMMatrix>"u"?{a:A[0],b:A[1],c:A[2],d:A[3],e:A[4],f:A[5]}:new DOMMatrix(A);O.setTransform(j)}return O}}_getLinearGradient(){return this._getCache(p,this.__getLinearGradient)}__getLinearGradient(){const I=this.fillLinearGradientColorStops();if(I){const O=_(),C=this.fillLinearGradientStartPoint(),A=this.fillLinearGradientEndPoint(),j=O.createLinearGradient(C.x,C.y,A.x,A.y);for(let N=0;N<I.length;N+=2)j.addColorStop(I[N],I[N+1]);return j}}_getRadialGradient(){return this._getCache(v,this.__getRadialGradient)}__getRadialGradient(){const I=this.fillRadialGradientColorStops();if(I){const O=_(),C=this.fillRadialGradientStartPoint(),A=this.fillRadialGradientEndPoint(),j=O.createRadialGradient(C.x,C.y,this.fillRadialGradientStartRadius(),A.x,A.y,this.fillRadialGradientEndRadius());for(let N=0;N<I.length;N+=2)j.addColorStop(I[N],I[N+1]);return j}}getShadowRGBA(){return this._getCache(c,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const I=t.Util.colorToRGBA(this.shadowColor());if(I)return"rgba("+I.r+","+I.g+","+I.b+","+I.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 I=this.hitStrokeWidth();return I==="auto"?this.hasStroke():this.strokeEnabled()&&!!I}intersects(I){const O=this.getStage();if(!O)return!1;const C=O.bufferHitCanvas;return C.getContext().clear(),this.drawHit(C,void 0,!0),C.context.getImageData(Math.round(I.x),Math.round(I.y),1,1).data[3]>0}destroy(){return a.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(I){var O;if(!((O=this.attrs.perfectDrawEnabled)!==null&&O!==void 0?O:!0))return!1;const A=I||this.hasFill(),j=this.hasStroke(),N=this.getAbsoluteOpacity()!==1;if(A&&j&&N)return!0;const B=this.hasShadow(),W=this.shadowForStrokeEnabled();return!!(A&&j&&B&&W)}setStrokeHitEnabled(I){t.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),I?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const I=this.size();return{x:this._centroid?-I.width/2:0,y:this._centroid?-I.height/2:0,width:I.width,height:I.height}}getClientRect(I={}){let O=!1,C=this.getParent();for(;C;){if(C.isCached()){O=!0;break}C=C.getParent()}const A=I.skipTransform,j=I.relativeTo||O&&this.getStage()||void 0,N=this.getSelfRect(),W=!I.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,Y=N.width+W,Z=N.height+W,V=!I.skipShadow&&this.hasShadow(),H=V?this.shadowOffsetX():0,U=V?this.shadowOffsetY():0,D=Y+Math.abs(H),$=Z+Math.abs(U),Q=V&&this.shadowBlur()||0,ee=D+Q*2,te=$+Q*2,ae={width:ee,height:te,x:-(W/2+Q)+Math.min(H,0)+N.x,y:-(W/2+Q)+Math.min(U,0)+N.y};return A?ae:this._transformedRect(ae,j)}drawScene(I,O,C){const A=this.getLayer();let j=I||A.getCanvas(),N=j.getContext(),B=this._getCanvasCache(),W=this.getSceneFunc(),Y=this.hasShadow(),Z,V;const H=j.isCache,U=O===this;if(!this.isVisible()&&!U)return this;if(B){N.save();const $=this.getAbsoluteTransform(O).getMatrix();return N.transform($[0],$[1],$[2],$[3],$[4],$[5]),this._drawCachedSceneCanvas(N),N.restore(),this}if(!W)return this;if(N.save(),this._useBufferCanvas()&&!H){Z=this.getStage();const $=C||Z.bufferCanvas;V=$.getContext(),V.clear(),V.save(),V._applyLineJoin(this);var D=this.getAbsoluteTransform(O).getMatrix();V.transform(D[0],D[1],D[2],D[3],D[4],D[5]),W.call(this,V,this),V.restore();const Q=$.pixelRatio;Y&&N._applyShadow(this),N._applyOpacity(this),N._applyGlobalCompositeOperation(this),N.drawImage($._canvas,0,0,$.width/Q,$.height/Q)}else{if(N._applyLineJoin(this),!U){var D=this.getAbsoluteTransform(O).getMatrix();N.transform(D[0],D[1],D[2],D[3],D[4],D[5]),N._applyOpacity(this),N._applyGlobalCompositeOperation(this)}Y&&N._applyShadow(this),W.call(this,N,this)}return N.restore(),this}drawHit(I,O,C=!1){if(!this.shouldDrawHit(O,C))return this;const A=this.getLayer(),j=I||A.hitCanvas,N=j&&j.getContext(),B=this.hitFunc()||this.sceneFunc(),W=this._getCanvasCache(),Y=W&&W.hit;if(this.colorKey||t.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()"),Y){N.save();const V=this.getAbsoluteTransform(O).getMatrix();return N.transform(V[0],V[1],V[2],V[3],V[4],V[5]),this._drawCachedHitCanvas(N),N.restore(),this}if(!B)return this;if(N.save(),N._applyLineJoin(this),!(this===O)){const V=this.getAbsoluteTransform(O).getMatrix();N.transform(V[0],V[1],V[2],V[3],V[4],V[5])}return B.call(this,N,this),N.restore(),this}drawHitFromCache(I=0){const O=this._getCanvasCache(),C=this._getCachedSceneCanvas(),A=O.hit,j=A.getContext(),N=A.getWidth(),B=A.getHeight();j.clear(),j.drawImage(C._canvas,0,0,N,B);try{const W=j.getImageData(0,0,N,B),Y=W.data,Z=Y.length,V=t.Util._hexToRgb(this.colorKey);for(let H=0;H<Z;H+=4)Y[H+3]>I?(Y[H]=V.r,Y[H+1]=V.g,Y[H+2]=V.b,Y[H+3]=255):Y[H+3]=0;j.putImageData(W,0,0)}catch(W){t.Util.error("Unable to draw hit graph from cached scene canvas. "+W.message)}return this}hasPointerCapture(I){return s.hasPointerCapture(I,this)}setPointerCapture(I){s.setPointerCapture(I,this)}releaseCapture(I){s.releaseCapture(I,this)}}e.Shape=T,T.prototype._fillFunc=E,T.prototype._strokeFunc=w,T.prototype._fillFuncHit=x,T.prototype._strokeFuncHit=y,T.prototype._centroid=!1,T.prototype.nodeType="Shape",(0,o._registerNode)(T),T.prototype.eventListeners={},T.prototype.on.call(T.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",g),T.prototype.on.call(T.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",S),T.prototype.on.call(T.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",b),T.prototype.on.call(T.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",R),T.prototype.on.call(T.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",L),n.Factory.addGetterSetter(T,"stroke",void 0,(0,i.getStringOrGradientValidator)()),n.Factory.addGetterSetter(T,"strokeWidth",2,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(T,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(T,"hitStrokeWidth","auto",(0,i.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(T,"strokeHitEnabled",!0,(0,i.getBooleanValidator)()),n.Factory.addGetterSetter(T,"perfectDrawEnabled",!0,(0,i.getBooleanValidator)()),n.Factory.addGetterSetter(T,"shadowForStrokeEnabled",!0,(0,i.getBooleanValidator)()),n.Factory.addGetterSetter(T,"lineJoin"),n.Factory.addGetterSetter(T,"lineCap"),n.Factory.addGetterSetter(T,"sceneFunc"),n.Factory.addGetterSetter(T,"hitFunc"),n.Factory.addGetterSetter(T,"dash"),n.Factory.addGetterSetter(T,"dashOffset",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(T,"shadowColor",void 0,(0,i.getStringValidator)()),n.Factory.addGetterSetter(T,"shadowBlur",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(T,"shadowOpacity",1,(0,i.getNumberValidator)()),n.Factory.addComponentsGetterSetter(T,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(T,"shadowOffsetX",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(T,"shadowOffsetY",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(T,"fillPatternImage"),n.Factory.addGetterSetter(T,"fill",void 0,(0,i.getStringOrGradientValidator)()),n.Factory.addGetterSetter(T,"fillPatternX",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(T,"fillPatternY",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(T,"fillLinearGradientColorStops"),n.Factory.addGetterSetter(T,"strokeLinearGradientColorStops"),n.Factory.addGetterSetter(T,"fillRadialGradientStartRadius",0),n.Factory.addGetterSetter(T,"fillRadialGradientEndRadius",0),n.Factory.addGetterSetter(T,"fillRadialGradientColorStops"),n.Factory.addGetterSetter(T,"fillPatternRepeat","repeat"),n.Factory.addGetterSetter(T,"fillEnabled",!0),n.Factory.addGetterSetter(T,"strokeEnabled",!0),n.Factory.addGetterSetter(T,"shadowEnabled",!0),n.Factory.addGetterSetter(T,"dashEnabled",!0),n.Factory.addGetterSetter(T,"strokeScaleEnabled",!0),n.Factory.addGetterSetter(T,"fillPriority","color"),n.Factory.addComponentsGetterSetter(T,"fillPatternOffset",["x","y"]),n.Factory.addGetterSetter(T,"fillPatternOffsetX",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(T,"fillPatternOffsetY",0,(0,i.getNumberValidator)()),n.Factory.addComponentsGetterSetter(T,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(T,"fillPatternScaleX",1,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(T,"fillPatternScaleY",1,(0,i.getNumberValidator)()),n.Factory.addComponentsGetterSetter(T,"fillLinearGradientStartPoint",["x","y"]),n.Factory.addComponentsGetterSetter(T,"strokeLinearGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(T,"fillLinearGradientStartPointX",0),n.Factory.addGetterSetter(T,"strokeLinearGradientStartPointX",0),n.Factory.addGetterSetter(T,"fillLinearGradientStartPointY",0),n.Factory.addGetterSetter(T,"strokeLinearGradientStartPointY",0),n.Factory.addComponentsGetterSetter(T,"fillLinearGradientEndPoint",["x","y"]),n.Factory.addComponentsGetterSetter(T,"strokeLinearGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(T,"fillLinearGradientEndPointX",0),n.Factory.addGetterSetter(T,"strokeLinearGradientEndPointX",0),n.Factory.addGetterSetter(T,"fillLinearGradientEndPointY",0),n.Factory.addGetterSetter(T,"strokeLinearGradientEndPointY",0),n.Factory.addComponentsGetterSetter(T,"fillRadialGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(T,"fillRadialGradientStartPointX",0),n.Factory.addGetterSetter(T,"fillRadialGradientStartPointY",0),n.Factory.addComponentsGetterSetter(T,"fillRadialGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(T,"fillRadialGradientEndPointX",0),n.Factory.addGetterSetter(T,"fillRadialGradientEndPointY",0),n.Factory.addGetterSetter(T,"fillPatternRotation",0),n.Factory.addGetterSetter(T,"fillRule",void 0,(0,i.getStringValidator)()),n.Factory.backCompat(T,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})}(ng)),ng}var Jy;function P6(){if(Jy)return ed;Jy=1,Object.defineProperty(ed,"__esModule",{value:!0}),ed.Layer=void 0;const e=Li(),r=e0(),t=Ji(),n=Vr(),a=J1(),i=Yr(),o=Ma(),s=jr(),u="#",c="beforeDraw",h="draw",p=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],v=p.length;class f extends r.Container{constructor(E){super(E),this.canvas=new a.SceneCanvas,this.hitCanvas=new a.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 w=this.getStage();return w&&w.content&&(w.content.removeChild(this.getNativeCanvasElement()),E<w.children.length-1?w.content.insertBefore(this.getNativeCanvasElement(),w.children[E+1].getCanvas()._canvas):w.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){t.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(!t.Node.prototype.moveUp.call(this))return!1;const w=this.getStage();return!w||!w.content?!1:(w.content.removeChild(this.getNativeCanvasElement()),this.index<w.children.length-1?w.content.insertBefore(this.getNativeCanvasElement(),w.children[this.index+1].getCanvas()._canvas):w.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(t.Node.prototype.moveDown.call(this)){const E=this.getStage();if(E){const w=E.children;E.content&&(E.content.removeChild(this.getNativeCanvasElement()),E.content.insertBefore(this.getNativeCanvasElement(),w[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(t.Node.prototype.moveToBottom.call(this)){const E=this.getStage();if(E){const w=E.children;E.content&&(E.content.removeChild(this.getNativeCanvasElement()),E.content.insertBefore(this.getNativeCanvasElement(),w[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const E=this.getNativeCanvasElement();return t.Node.prototype.remove.call(this),E&&E.parentNode&&e.Util._isInDocument(E)&&E.parentNode.removeChild(E),this}getStage(){return this.parent}setSize({width:E,height:w}){return this.canvas.setSize(E,w),this.hitCanvas.setSize(E,w),this._setSmoothEnabled(),this}_validateAdd(E){const w=E.getType();w!=="Group"&&w!=="Shape"&&e.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(),t.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(){e.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){e.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,e.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(E){if(!this.isListening()||!this.isVisible())return null;let w=1,x=!1;for(;;){for(let y=0;y<v;y++){const g=p[y],S=this._getIntersection({x:E.x+g.x*w,y:E.y+g.y*w}),b=S.shape;if(b)return b;if(x=!!S.antialiased,!S.antialiased)break}if(x)w+=1;else return null}}_getIntersection(E){const w=this.hitCanvas.pixelRatio,x=this.hitCanvas.context.getImageData(Math.round(E.x*w),Math.round(E.y*w),1,1).data,y=x[3];if(y===255){const g=e.Util._rgbToHex(x[0],x[1],x[2]),S=o.shapes[u+g];return S?{shape:S}:{antialiased:!0}}else if(y>0)return{antialiased:!0};return{}}drawScene(E,w){const x=this.getLayer(),y=E||x&&x.getCanvas();return this._fire(c,{node:this}),this.clearBeforeDraw()&&y.getContext().clear(),r.Container.prototype.drawScene.call(this,y,w),this._fire(h,{node:this}),this}drawHit(E,w){const x=this.getLayer(),y=E||x&&x.hitCanvas;return x&&x.clearBeforeDraw()&&x.getHitCanvas().getContext().clear(),r.Container.prototype.drawHit.call(this,y,w),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(E){e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(E)}getHitGraphEnabled(E){return e.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 e.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}return ed.Layer=f,f.prototype.nodeType="Layer",(0,s._registerNode)(f),n.Factory.addGetterSetter(f,"imageSmoothingEnabled",!0),n.Factory.addGetterSetter(f,"clearBeforeDraw",!0),n.Factory.addGetterSetter(f,"hitGraphEnabled",!0,(0,i.getBooleanValidator)()),ed}var td={},e5;function DS(){if(e5)return td;e5=1,Object.defineProperty(td,"__esModule",{value:!0}),td.FastLayer=void 0;const e=Li(),r=P6(),t=jr();class n extends r.Layer{constructor(i){super(i),this.listening(!1),e.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}return td.FastLayer=n,n.prototype.nodeType="FastLayer",(0,t._registerNode)(n),td}var rd={},t5;function lm(){if(t5)return rd;t5=1,Object.defineProperty(rd,"__esModule",{value:!0}),rd.Group=void 0;const e=Li(),r=e0(),t=jr();class n extends r.Container{_validateAdd(i){const o=i.getType();o!=="Group"&&o!=="Shape"&&e.Util.throw("You may only add groups and shapes to groups.")}}return rd.Group=n,n.prototype.nodeType="Group",(0,t._registerNode)(n),rd}var nd={},r5;function um(){if(r5)return nd;r5=1,Object.defineProperty(nd,"__esModule",{value:!0}),nd.Animation=void 0;const e=jr(),r=Li(),t=function(){return e.glob.performance&&e.glob.performance.now?function(){return e.glob.performance.now()}:function(){return new Date().getTime()}}();let n=class sh{constructor(i,o){this.id=sh.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:t(),frameRate:0},this.func=i,this.setLayers(o)}setLayers(i){let o=[];return i&&(o=Array.isArray(i)?i:[i]),this.layers=o,this}getLayers(){return this.layers}addLayer(i){const o=this.layers,s=o.length;for(let u=0;u<s;u++)if(o[u]._id===i._id)return!1;return this.layers.push(i),!0}isRunning(){const o=sh.animations,s=o.length;for(let u=0;u<s;u++)if(o[u].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=t(),sh._addAnimation(this),this}stop(){return sh._removeAnimation(this),this}_updateFrameObject(i){this.frame.timeDiff=i-this.frame.lastTime,this.frame.lastTime=i,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(i){this.animations.push(i),this._handleAnimation()}static _removeAnimation(i){const o=i.id,s=this.animations,u=s.length;for(let c=0;c<u;c++)if(s[c].id===o){this.animations.splice(c,1);break}}static _runFrames(){const i={},o=this.animations;for(let s=0;s<o.length;s++){const u=o[s],c=u.layers,h=u.func;u._updateFrameObject(t());const p=c.length;let v;if(h?v=h.call(u,u.frame)!==!1:v=!0,!!v)for(let f=0;f<p;f++){const _=c[f];_._id!==void 0&&(i[_._id]=_)}}for(const s in i)i.hasOwnProperty(s)&&i[s].batchDraw()}static _animationLoop(){const i=sh;i.animations.length?(i._runFrames(),r.Util.requestAnimFrame(i._animationLoop)):i.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,r.Util.requestAnimFrame(this._animationLoop))}};return nd.Animation=n,n.animations=[],n.animIdCounter=0,n.animRunning=!1,nd}var ig={},n5;function BS(){return n5||(n5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const r=Li(),t=um(),n=Ji(),a=jr(),i={node:1,duration:1,easing:1,onFinish:1,yoyo:1},o=1,s=2,u=3,c=["fill","stroke","shadowColor"];let h=0;class p{constructor(_,E,w,x,y,g,S){this.prop=_,this.propFunc=E,this.begin=x,this._pos=x,this.duration=g,this._change=0,this.prevPos=0,this.yoyo=S,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=w,this._change=y-this.begin,this.pause()}fire(_){const E=this[_];E&&E()}setTime(_){_>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():_<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=_,this.update())}getTime(){return this._time}setPosition(_){this.prevPos=this._pos,this.propFunc(_),this._pos=_}getPosition(_){return _===void 0&&(_=this._time),this.func(_,this.begin,this._change,this.duration)}play(){this.state=s,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=u,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(_){this.pause(),this._time=_,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 _=this.getTimer()-this._startTime;this.state===s?this.setTime(_):this.state===u&&this.setTime(this.duration-_)}pause(){this.state=o,this.fire("onPause")}getTimer(){return new Date().getTime()}}class v{constructor(_){const E=this,w=_.node,x=w._id,y=_.easing||e.Easings.Linear,g=!!_.yoyo;let S,b;typeof _.duration>"u"?S=.3:_.duration===0?S=.001:S=_.duration,this.node=w,this._id=h++;const R=w.getLayer()||(w instanceof a.Konva.Stage?w.getLayers():null);R||r.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new t.Animation(function(){E.tween.onEnterFrame()},R),this.tween=new p(b,function(L){E._tweenFunc(L)},y,0,1,S*1e3,g),this._addListeners(),v.attrs[x]||(v.attrs[x]={}),v.attrs[x][this._id]||(v.attrs[x][this._id]={}),v.tweens[x]||(v.tweens[x]={});for(b in _)i[b]===void 0&&this._addAttr(b,_[b]);this.reset(),this.onFinish=_.onFinish,this.onReset=_.onReset,this.onUpdate=_.onUpdate}_addAttr(_,E){const w=this.node,x=w._id;let y,g,S,b,R;const L=v.tweens[x][_];L&&delete v.attrs[x][L][_];let T=w.getAttr(_);if(r.Util._isArray(E))if(y=[],g=Math.max(E.length,T.length),_==="points"&&E.length!==T.length&&(E.length>T.length?(b=T,T=r.Util._prepareArrayForTween(T,E,w.closed())):(S=E,E=r.Util._prepareArrayForTween(E,T,w.closed()))),_.indexOf("fill")===0)for(let F=0;F<g;F++)if(F%2===0)y.push(E[F]-T[F]);else{const I=r.Util.colorToRGBA(T[F]);R=r.Util.colorToRGBA(E[F]),T[F]=I,y.push({r:R.r-I.r,g:R.g-I.g,b:R.b-I.b,a:R.a-I.a})}else for(let F=0;F<g;F++)y.push(E[F]-T[F]);else c.indexOf(_)!==-1?(T=r.Util.colorToRGBA(T),R=r.Util.colorToRGBA(E),y={r:R.r-T.r,g:R.g-T.g,b:R.b-T.b,a:R.a-T.a}):y=E-T;v.attrs[x][this._id][_]={start:T,diff:y,end:E,trueEnd:S,trueStart:b},v.tweens[x][_]=this._id}_tweenFunc(_){const E=this.node,w=v.attrs[E._id][this._id];let x,y,g,S,b,R,L,T;for(x in w){if(y=w[x],g=y.start,S=y.diff,T=y.end,r.Util._isArray(g))if(b=[],L=Math.max(g.length,T.length),x.indexOf("fill")===0)for(R=0;R<L;R++)R%2===0?b.push((g[R]||0)+S[R]*_):b.push("rgba("+Math.round(g[R].r+S[R].r*_)+","+Math.round(g[R].g+S[R].g*_)+","+Math.round(g[R].b+S[R].b*_)+","+(g[R].a+S[R].a*_)+")");else for(R=0;R<L;R++)b.push((g[R]||0)+S[R]*_);else c.indexOf(x)!==-1?b="rgba("+Math.round(g.r+S.r*_)+","+Math.round(g.g+S.g*_)+","+Math.round(g.b+S.b*_)+","+(g.a+S.a*_)+")":b=g+S*_;E.setAttr(x,b)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const _=this.node,E=v.attrs[_._id][this._id];E.points&&E.points.trueEnd&&_.setAttr("points",E.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const _=this.node,E=v.attrs[_._id][this._id];E.points&&E.points.trueStart&&_.points(E.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(_){return this.tween.seek(_*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const _=this.node._id,E=this._id,w=v.tweens[_];this.pause();for(const x in w)delete v.tweens[_][x];delete v.attrs[_][E]}}e.Tween=v,v.attrs={},v.tweens={},n.Node.prototype.to=function(f){const _=f.onFinish;f.node=this,f.onFinish=function(){this.destroy(),_&&_()},new v(f).play()},e.Easings={BackEaseIn(f,_,E,w){return E*(f/=w)*f*((1.70158+1)*f-1.70158)+_},BackEaseOut(f,_,E,w){return E*((f=f/w-1)*f*((1.70158+1)*f+1.70158)+1)+_},BackEaseInOut(f,_,E,w){let x=1.70158;return(f/=w/2)<1?E/2*(f*f*(((x*=1.525)+1)*f-x))+_:E/2*((f-=2)*f*(((x*=1.525)+1)*f+x)+2)+_},ElasticEaseIn(f,_,E,w,x,y){let g=0;return f===0?_:(f/=w)===1?_+E:(y||(y=w*.3),!x||x<Math.abs(E)?(x=E,g=y/4):g=y/(2*Math.PI)*Math.asin(E/x),-(x*Math.pow(2,10*(f-=1))*Math.sin((f*w-g)*(2*Math.PI)/y))+_)},ElasticEaseOut(f,_,E,w,x,y){let g=0;return f===0?_:(f/=w)===1?_+E:(y||(y=w*.3),!x||x<Math.abs(E)?(x=E,g=y/4):g=y/(2*Math.PI)*Math.asin(E/x),x*Math.pow(2,-10*f)*Math.sin((f*w-g)*(2*Math.PI)/y)+E+_)},ElasticEaseInOut(f,_,E,w,x,y){let g=0;return f===0?_:(f/=w/2)===2?_+E:(y||(y=w*(.3*1.5)),!x||x<Math.abs(E)?(x=E,g=y/4):g=y/(2*Math.PI)*Math.asin(E/x),f<1?-.5*(x*Math.pow(2,10*(f-=1))*Math.sin((f*w-g)*(2*Math.PI)/y))+_:x*Math.pow(2,-10*(f-=1))*Math.sin((f*w-g)*(2*Math.PI)/y)*.5+E+_)},BounceEaseOut(f,_,E,w){return(f/=w)<1/2.75?E*(7.5625*f*f)+_:f<2/2.75?E*(7.5625*(f-=1.5/2.75)*f+.75)+_:f<2.5/2.75?E*(7.5625*(f-=2.25/2.75)*f+.9375)+_:E*(7.5625*(f-=2.625/2.75)*f+.984375)+_},BounceEaseIn(f,_,E,w){return E-e.Easings.BounceEaseOut(w-f,0,E,w)+_},BounceEaseInOut(f,_,E,w){return f<w/2?e.Easings.BounceEaseIn(f*2,0,E,w)*.5+_:e.Easings.BounceEaseOut(f*2-w,0,E,w)*.5+E*.5+_},EaseIn(f,_,E,w){return E*(f/=w)*f+_},EaseOut(f,_,E,w){return-E*(f/=w)*(f-2)+_},EaseInOut(f,_,E,w){return(f/=w/2)<1?E/2*f*f+_:-E/2*(--f*(f-2)-1)+_},StrongEaseIn(f,_,E,w){return E*(f/=w)*f*f*f*f+_},StrongEaseOut(f,_,E,w){return E*((f=f/w-1)*f*f*f*f+1)+_},StrongEaseInOut(f,_,E,w){return(f/=w/2)<1?E/2*f*f*f*f*f+_:E/2*((f-=2)*f*f*f*f+2)+_},Linear(f,_,E,w){return E*f/w+_}}}(ig)),ig}var i5;function x2(){return i5||(i5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const r=jr(),t=Li(),n=Ji(),a=e0(),i=FS(),o=P6(),s=DS(),u=lm(),c=sm(),h=Ma(),p=um(),v=BS(),f=x6(),_=J1();e.Konva=t.Util._assign(r.Konva,{Util:t.Util,Transform:t.Transform,Node:n.Node,Container:a.Container,Stage:i.Stage,stages:i.stages,Layer:o.Layer,FastLayer:s.FastLayer,Group:u.Group,DD:c.DD,Shape:h.Shape,shapes:h.shapes,Animation:p.Animation,Tween:v.Tween,Easings:v.Easings,Context:f.Context,Canvas:_.Canvas}),e.default=e.Konva}(Z0)),Z0}var id={},a5;function qS(){if(a5)return id;a5=1,Object.defineProperty(id,"__esModule",{value:!0}),id.Arc=void 0;const e=Vr(),r=Ma(),t=jr(),n=Yr(),a=jr();class i extends r.Shape{_sceneFunc(s){const u=t.Konva.getAngle(this.angle()),c=this.clockwise();s.beginPath(),s.arc(0,0,this.outerRadius(),0,u,c),s.arc(0,0,this.innerRadius(),u,0,!c),s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(s){this.outerRadius(s/2)}setHeight(s){this.outerRadius(s/2)}getSelfRect(){const s=this.innerRadius(),u=this.outerRadius(),c=this.clockwise(),h=t.Konva.getAngle(c?360-this.angle():this.angle()),p=Math.cos(Math.min(h,Math.PI)),v=1,f=Math.sin(Math.min(Math.max(Math.PI,h),3*Math.PI/2)),_=Math.sin(Math.min(h,Math.PI/2)),E=p*(p>0?s:u),w=v*u,x=f*(f>0?s:u),y=_*(_>0?u:s);return{x:E,y:c?-1*y:x,width:w-E,height:y-x}}}return id.Arc=i,i.prototype._centroid=!0,i.prototype.className="Arc",i.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"],(0,a._registerNode)(i),e.Factory.addGetterSetter(i,"innerRadius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(i,"outerRadius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(i,"angle",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(i,"clockwise",!1,(0,n.getBooleanValidator)()),id}var ad={},od={},o5;function O6(){if(o5)return od;o5=1,Object.defineProperty(od,"__esModule",{value:!0}),od.Line=void 0;const e=Vr(),r=jr(),t=Ma(),n=Yr();function a(s,u,c,h,p,v,f){const _=Math.sqrt(Math.pow(c-s,2)+Math.pow(h-u,2)),E=Math.sqrt(Math.pow(p-c,2)+Math.pow(v-h,2)),w=f*_/(_+E),x=f*E/(_+E),y=c-w*(p-s),g=h-w*(v-u),S=c+x*(p-s),b=h+x*(v-u);return[y,g,S,b]}function i(s,u){const c=s.length,h=[];for(let p=2;p<c-2;p+=2){const v=a(s[p-2],s[p-1],s[p],s[p+1],s[p+2],s[p+3],u);isNaN(v[0])||(h.push(v[0]),h.push(v[1]),h.push(s[p]),h.push(s[p+1]),h.push(v[2]),h.push(v[3]))}return h}class o extends t.Shape{constructor(u){super(u),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(u){let c=this.points(),h=c.length,p=this.tension(),v=this.closed(),f=this.bezier(),_,E,w;if(h){if(u.beginPath(),u.moveTo(c[0],c[1]),p!==0&&h>4){for(_=this.getTensionPoints(),E=_.length,w=v?0:4,v||u.quadraticCurveTo(_[0],_[1],_[2],_[3]);w<E-2;)u.bezierCurveTo(_[w++],_[w++],_[w++],_[w++],_[w++],_[w++]);v||u.quadraticCurveTo(_[E-2],_[E-1],c[h-2],c[h-1])}else if(f)for(w=2;w<h;)u.bezierCurveTo(c[w++],c[w++],c[w++],c[w++],c[w++],c[w++]);else for(w=2;w<h;w+=2)u.lineTo(c[w],c[w+1]);v?(u.closePath(),u.fillStrokeShape(this)):u.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():i(this.points(),this.tension())}_getTensionPointsClosed(){const u=this.points(),c=u.length,h=this.tension(),p=a(u[c-2],u[c-1],u[0],u[1],u[2],u[3],h),v=a(u[c-4],u[c-3],u[c-2],u[c-1],u[0],u[1],h),f=i(u,h);return[p[2],p[3]].concat(f).concat([v[0],v[1],u[c-2],u[c-1],v[2],v[3],p[0],p[1],u[0],u[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let u=this.points();if(u.length<4)return{x:u[0]||0,y:u[1]||0,width:0,height:0};this.tension()!==0?u=[u[0],u[1],...this._getTensionPoints(),u[u.length-2],u[u.length-1]]:u=this.points();let c=u[0],h=u[0],p=u[1],v=u[1],f,_;for(let E=0;E<u.length/2;E++)f=u[E*2],_=u[E*2+1],c=Math.min(c,f),h=Math.max(h,f),p=Math.min(p,_),v=Math.max(v,_);return{x:c,y:p,width:h-c,height:v-p}}}return od.Line=o,o.prototype.className="Line",o.prototype._attrsAffectingSize=["points","bezier","tension"],(0,r._registerNode)(o),e.Factory.addGetterSetter(o,"closed",!1),e.Factory.addGetterSetter(o,"bezier",!1),e.Factory.addGetterSetter(o,"tension",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(o,"points",[],(0,n.getNumberArrayValidator)()),od}var sd={},ag={},s5;function zS(){return s5||(s5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const r=(o,s,u)=>{let c,h;const v=u/2;c=0;for(let f=0;f<20;f++)h=v*e.tValues[20][f]+v,c+=e.cValues[20][f]*n(o,s,h);return v*c};e.getCubicArcLength=r;const t=(o,s,u)=>{u===void 0&&(u=1);const c=o[0]-2*o[1]+o[2],h=s[0]-2*s[1]+s[2],p=2*o[1]-2*o[0],v=2*s[1]-2*s[0],f=4*(c*c+h*h),_=4*(c*p+h*v),E=p*p+v*v;if(f===0)return u*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(s[2]-s[0],2));const w=_/(2*f),x=E/f,y=u+w,g=x-w*w,S=y*y+g>0?Math.sqrt(y*y+g):0,b=w*w+g>0?Math.sqrt(w*w+g):0,R=w+Math.sqrt(w*w+g)!==0?g*Math.log(Math.abs((y+S)/(w+b))):0;return Math.sqrt(f)/2*(y*S-w*b+R)};e.getQuadraticArcLength=t;function n(o,s,u){const c=a(1,u,o),h=a(1,u,s),p=c*c+h*h;return Math.sqrt(p)}const a=(o,s,u)=>{const c=u.length-1;let h,p;if(c===0)return 0;if(o===0){p=0;for(let v=0;v<=c;v++)p+=e.binomialCoefficients[c][v]*Math.pow(1-s,c-v)*Math.pow(s,v)*u[v];return p}else{h=new Array(c);for(let v=0;v<c;v++)h[v]=c*(u[v+1]-u[v]);return a(o-1,s,h)}},i=(o,s,u)=>{let c=1,h=o/s,p=(o-u(h))/s,v=0;for(;c>.001;){const f=u(h+p),_=Math.abs(o-f)/s;if(_<c)c=_,h+=p;else{const E=u(h-p),w=Math.abs(o-E)/s;w<c?(c=w,h-=p):p/=2}if(v++,v>500)break}return h};e.t2length=i}(ag)),ag}var l5;function cm(){if(l5)return sd;l5=1,Object.defineProperty(sd,"__esModule",{value:!0}),sd.Path=void 0;const e=Vr(),r=Ma(),t=jr(),n=zS();class a extends r.Shape{constructor(o){super(o),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=a.parsePathData(this.data()),this.pathLength=a.getPathLength(this.dataArray)}_sceneFunc(o){const s=this.dataArray;o.beginPath();let u=!1;for(let S=0;S<s.length;S++){const b=s[S].command,R=s[S].points;switch(b){case"L":o.lineTo(R[0],R[1]);break;case"M":o.moveTo(R[0],R[1]);break;case"C":o.bezierCurveTo(R[0],R[1],R[2],R[3],R[4],R[5]);break;case"Q":o.quadraticCurveTo(R[0],R[1],R[2],R[3]);break;case"A":var c=R[0],h=R[1],p=R[2],v=R[3],f=R[4],_=R[5],E=R[6],w=R[7],x=p>v?p:v,y=p>v?1:p/v,g=p>v?v/p:1;o.translate(c,h),o.rotate(E),o.scale(y,g),o.arc(0,0,x,f,f+_,1-w),o.scale(1/y,1/g),o.rotate(-E),o.translate(-c,-h);break;case"z":u=!0,o.closePath();break}}!u&&!this.hasFill()?o.strokeShape(this):o.fillStrokeShape(this)}getSelfRect(){let o=[];this.dataArray.forEach(function(f){if(f.command==="A"){const _=f.points[4],E=f.points[5],w=f.points[4]+E;let x=Math.PI/180;if(Math.abs(_-w)<x&&(x=Math.abs(_-w)),E<0)for(let y=_-x;y>w;y-=x){const g=a.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],y,0);o.push(g.x,g.y)}else for(let y=_+x;y<w;y+=x){const g=a.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],y,0);o.push(g.x,g.y)}}else if(f.command==="C")for(let _=0;_<=1;_+=.01){const E=a.getPointOnCubicBezier(_,f.start.x,f.start.y,f.points[0],f.points[1],f.points[2],f.points[3],f.points[4],f.points[5]);o.push(E.x,E.y)}else o=o.concat(f.points)});let s=o[0],u=o[0],c=o[1],h=o[1],p,v;for(let f=0;f<o.length/2;f++)p=o[f*2],v=o[f*2+1],isNaN(p)||(s=Math.min(s,p),u=Math.max(u,p)),isNaN(v)||(c=Math.min(c,v),h=Math.max(h,v));return{x:s,y:c,width:u-s,height:h-c}}getLength(){return this.pathLength}getPointAtLength(o){return a.getPointAtLengthOfDataArray(o,this.dataArray)}static getLineLength(o,s,u,c){return Math.sqrt((u-o)*(u-o)+(c-s)*(c-s))}static getPathLength(o){let s=0;for(let u=0;u<o.length;++u)s+=o[u].pathLength;return s}static getPointAtLengthOfDataArray(o,s){let u,c=0,h=s.length;if(!h)return null;for(;c<h&&o>s[c].pathLength;)o-=s[c].pathLength,++c;if(c===h)return u=s[c-1].points.slice(-2),{x:u[0],y:u[1]};if(o<.01)return u=s[c].points.slice(0,2),{x:u[0],y:u[1]};const p=s[c],v=p.points;switch(p.command){case"L":return a.getPointOnLine(o,p.start.x,p.start.y,v[0],v[1]);case"C":return a.getPointOnCubicBezier((0,n.t2length)(o,a.getPathLength(s),S=>(0,n.getCubicArcLength)([p.start.x,v[0],v[2],v[4]],[p.start.y,v[1],v[3],v[5]],S)),p.start.x,p.start.y,v[0],v[1],v[2],v[3],v[4],v[5]);case"Q":return a.getPointOnQuadraticBezier((0,n.t2length)(o,a.getPathLength(s),S=>(0,n.getQuadraticArcLength)([p.start.x,v[0],v[2]],[p.start.y,v[1],v[3]],S)),p.start.x,p.start.y,v[0],v[1],v[2],v[3]);case"A":var f=v[0],_=v[1],E=v[2],w=v[3],x=v[4],y=v[5],g=v[6];return x+=y*o/p.pathLength,a.getPointOnEllipticalArc(f,_,E,w,x,g)}return null}static getPointOnLine(o,s,u,c,h,p,v){p=p??s,v=v??u;const f=this.getLineLength(s,u,c,h);if(f<1e-10)return{x:s,y:u};if(c===s)return{x:p,y:v+(h>u?o:-o)};const _=(h-u)/(c-s),E=Math.sqrt(o*o/(1+_*_))*(c<s?-1:1),w=_*E;if(Math.abs(v-u-_*(p-s))<1e-10)return{x:p+E,y:v+w};const x=((p-s)*(c-s)+(v-u)*(h-u))/(f*f),y=s+x*(c-s),g=u+x*(h-u),S=this.getLineLength(p,v,y,g),b=Math.sqrt(o*o-S*S),R=Math.sqrt(b*b/(1+_*_))*(c<s?-1:1),L=_*R;return{x:y+R,y:g+L}}static getPointOnCubicBezier(o,s,u,c,h,p,v,f,_){function E(b){return b*b*b}function w(b){return 3*b*b*(1-b)}function x(b){return 3*b*(1-b)*(1-b)}function y(b){return(1-b)*(1-b)*(1-b)}const g=f*E(o)+p*w(o)+c*x(o)+s*y(o),S=_*E(o)+v*w(o)+h*x(o)+u*y(o);return{x:g,y:S}}static getPointOnQuadraticBezier(o,s,u,c,h,p,v){function f(y){return y*y}function _(y){return 2*y*(1-y)}function E(y){return(1-y)*(1-y)}const w=p*f(o)+c*_(o)+s*E(o),x=v*f(o)+h*_(o)+u*E(o);return{x:w,y:x}}static getPointOnEllipticalArc(o,s,u,c,h,p){const v=Math.cos(p),f=Math.sin(p),_={x:u*Math.cos(h),y:c*Math.sin(h)};return{x:o+(_.x*v-_.y*f),y:s+(_.x*f+_.y*v)}}static parsePathData(o){if(!o)return[];let s=o;const u=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];s=s.replace(new RegExp(" ","g"),",");for(var c=0;c<u.length;c++)s=s.replace(new RegExp(u[c],"g"),"|"+u[c]);const h=s.split("|"),p=[],v=[];let f=0,_=0;const E=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let w;for(c=1;c<h.length;c++){let A=h[c],j=A.charAt(0);for(A=A.slice(1),v.length=0;w=E.exec(A);)v.push(w[0]);const N=[];for(let B=0,W=v.length;B<W;B++){if(v[B]==="00"){N.push(0,0);continue}const Y=parseFloat(v[B]);isNaN(Y)?N.push(0):N.push(Y)}for(;N.length>0&&!isNaN(N[0]);){let B="",W=[];const Y=f,Z=_;var x,y,g,S,b,R,L,T,F,I;switch(j){case"l":f+=N.shift(),_+=N.shift(),B="L",W.push(f,_);break;case"L":f=N.shift(),_=N.shift(),W.push(f,_);break;case"m":var O=N.shift(),C=N.shift();if(f+=O,_+=C,B="M",p.length>2&&p[p.length-1].command==="z"){for(let V=p.length-2;V>=0;V--)if(p[V].command==="M"){f=p[V].points[0]+O,_=p[V].points[1]+C;break}}W.push(f,_),j="l";break;case"M":f=N.shift(),_=N.shift(),B="M",W.push(f,_),j="L";break;case"h":f+=N.shift(),B="L",W.push(f,_);break;case"H":f=N.shift(),B="L",W.push(f,_);break;case"v":_+=N.shift(),B="L",W.push(f,_);break;case"V":_=N.shift(),B="L",W.push(f,_);break;case"C":W.push(N.shift(),N.shift(),N.shift(),N.shift()),f=N.shift(),_=N.shift(),W.push(f,_);break;case"c":W.push(f+N.shift(),_+N.shift(),f+N.shift(),_+N.shift()),f+=N.shift(),_+=N.shift(),B="C",W.push(f,_);break;case"S":y=f,g=_,x=p[p.length-1],x.command==="C"&&(y=f+(f-x.points[2]),g=_+(_-x.points[3])),W.push(y,g,N.shift(),N.shift()),f=N.shift(),_=N.shift(),B="C",W.push(f,_);break;case"s":y=f,g=_,x=p[p.length-1],x.command==="C"&&(y=f+(f-x.points[2]),g=_+(_-x.points[3])),W.push(y,g,f+N.shift(),_+N.shift()),f+=N.shift(),_+=N.shift(),B="C",W.push(f,_);break;case"Q":W.push(N.shift(),N.shift()),f=N.shift(),_=N.shift(),W.push(f,_);break;case"q":W.push(f+N.shift(),_+N.shift()),f+=N.shift(),_+=N.shift(),B="Q",W.push(f,_);break;case"T":y=f,g=_,x=p[p.length-1],x.command==="Q"&&(y=f+(f-x.points[0]),g=_+(_-x.points[1])),f=N.shift(),_=N.shift(),B="Q",W.push(y,g,f,_);break;case"t":y=f,g=_,x=p[p.length-1],x.command==="Q"&&(y=f+(f-x.points[0]),g=_+(_-x.points[1])),f+=N.shift(),_+=N.shift(),B="Q",W.push(y,g,f,_);break;case"A":S=N.shift(),b=N.shift(),R=N.shift(),L=N.shift(),T=N.shift(),F=f,I=_,f=N.shift(),_=N.shift(),B="A",W=this.convertEndpointToCenterParameterization(F,I,f,_,L,T,S,b,R);break;case"a":S=N.shift(),b=N.shift(),R=N.shift(),L=N.shift(),T=N.shift(),F=f,I=_,f+=N.shift(),_+=N.shift(),B="A",W=this.convertEndpointToCenterParameterization(F,I,f,_,L,T,S,b,R);break}p.push({command:B||j,points:W,start:{x:Y,y:Z},pathLength:this.calcLength(Y,Z,B||j,W)})}(j==="z"||j==="Z")&&p.push({command:"z",points:[],start:void 0,pathLength:0})}return p}static calcLength(o,s,u,c){let h,p,v,f;const _=a;switch(u){case"L":return _.getLineLength(o,s,c[0],c[1]);case"C":return(0,n.getCubicArcLength)([o,c[0],c[2],c[4]],[s,c[1],c[3],c[5]],1);case"Q":return(0,n.getQuadraticArcLength)([o,c[0],c[2]],[s,c[1],c[3]],1);case"A":h=0;var E=c[4],w=c[5],x=c[4]+w,y=Math.PI/180;if(Math.abs(E-x)<y&&(y=Math.abs(E-x)),p=_.getPointOnEllipticalArc(c[0],c[1],c[2],c[3],E,0),w<0)for(f=E-y;f>x;f-=y)v=_.getPointOnEllipticalArc(c[0],c[1],c[2],c[3],f,0),h+=_.getLineLength(p.x,p.y,v.x,v.y),p=v;else for(f=E+y;f<x;f+=y)v=_.getPointOnEllipticalArc(c[0],c[1],c[2],c[3],f,0),h+=_.getLineLength(p.x,p.y,v.x,v.y),p=v;return v=_.getPointOnEllipticalArc(c[0],c[1],c[2],c[3],x,0),h+=_.getLineLength(p.x,p.y,v.x,v.y),h}return 0}static convertEndpointToCenterParameterization(o,s,u,c,h,p,v,f,_){const E=_*(Math.PI/180),w=Math.cos(E)*(o-u)/2+Math.sin(E)*(s-c)/2,x=-1*Math.sin(E)*(o-u)/2+Math.cos(E)*(s-c)/2,y=w*w/(v*v)+x*x/(f*f);y>1&&(v*=Math.sqrt(y),f*=Math.sqrt(y));let g=Math.sqrt((v*v*(f*f)-v*v*(x*x)-f*f*(w*w))/(v*v*(x*x)+f*f*(w*w)));h===p&&(g*=-1),isNaN(g)&&(g=0);const S=g*v*x/f,b=g*-f*w/v,R=(o+u)/2+Math.cos(E)*S-Math.sin(E)*b,L=(s+c)/2+Math.sin(E)*S+Math.cos(E)*b,T=function(N){return Math.sqrt(N[0]*N[0]+N[1]*N[1])},F=function(N,B){return(N[0]*B[0]+N[1]*B[1])/(T(N)*T(B))},I=function(N,B){return(N[0]*B[1]<N[1]*B[0]?-1:1)*Math.acos(F(N,B))},O=I([1,0],[(w-S)/v,(x-b)/f]),C=[(w-S)/v,(x-b)/f],A=[(-1*w-S)/v,(-1*x-b)/f];let j=I(C,A);return F(C,A)<=-1&&(j=Math.PI),F(C,A)>=1&&(j=0),p===0&&j>0&&(j=j-2*Math.PI),p===1&&j<0&&(j=j+2*Math.PI),[R,L,v,f,O,j,E,p]}}return sd.Path=a,a.prototype.className="Path",a.prototype._attrsAffectingSize=["data"],(0,t._registerNode)(a),e.Factory.addGetterSetter(a,"data"),sd}var u5;function US(){if(u5)return ad;u5=1,Object.defineProperty(ad,"__esModule",{value:!0}),ad.Arrow=void 0;const e=Vr(),r=O6(),t=Yr(),n=jr(),a=cm();class i extends r.Line{_sceneFunc(s){super._sceneFunc(s);const u=Math.PI*2,c=this.points();let h=c;const p=this.tension()!==0&&c.length>4;p&&(h=this.getTensionPoints());const v=this.pointerLength(),f=c.length;let _,E;if(p){const y=[h[h.length-4],h[h.length-3],h[h.length-2],h[h.length-1],c[f-2],c[f-1]],g=a.Path.calcLength(h[h.length-4],h[h.length-3],"C",y),S=a.Path.getPointOnQuadraticBezier(Math.min(1,1-v/g),y[0],y[1],y[2],y[3],y[4],y[5]);_=c[f-2]-S.x,E=c[f-1]-S.y}else _=c[f-2]-c[f-4],E=c[f-1]-c[f-3];const w=(Math.atan2(E,_)+u)%u,x=this.pointerWidth();this.pointerAtEnding()&&(s.save(),s.beginPath(),s.translate(c[f-2],c[f-1]),s.rotate(w),s.moveTo(0,0),s.lineTo(-v,x/2),s.lineTo(-v,-x/2),s.closePath(),s.restore(),this.__fillStroke(s)),this.pointerAtBeginning()&&(s.save(),s.beginPath(),s.translate(c[0],c[1]),p?(_=(h[0]+h[2])/2-c[0],E=(h[1]+h[3])/2-c[1]):(_=c[2]-c[0],E=c[3]-c[1]),s.rotate((Math.atan2(-E,-_)+u)%u),s.moveTo(0,0),s.lineTo(-v,x/2),s.lineTo(-v,-x/2),s.closePath(),s.restore(),this.__fillStroke(s))}__fillStroke(s){const u=this.dashEnabled();u&&(this.attrs.dashEnabled=!1,s.setLineDash([])),s.fillStrokeShape(this),u&&(this.attrs.dashEnabled=!0)}getSelfRect(){const s=super.getSelfRect(),u=this.pointerWidth()/2;return{x:s.x,y:s.y-u,width:s.width,height:s.height+u*2}}}return ad.Arrow=i,i.prototype.className="Arrow",(0,n._registerNode)(i),e.Factory.addGetterSetter(i,"pointerLength",10,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(i,"pointerWidth",10,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(i,"pointerAtBeginning",!1),e.Factory.addGetterSetter(i,"pointerAtEnding",!0),ad}var ld={},c5;function HS(){if(c5)return ld;c5=1,Object.defineProperty(ld,"__esModule",{value:!0}),ld.Circle=void 0;const e=Vr(),r=Ma(),t=Yr(),n=jr();class a extends r.Shape{_sceneFunc(o){o.beginPath(),o.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),o.closePath(),o.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(o){this.radius()!==o/2&&this.radius(o/2)}setHeight(o){this.radius()!==o/2&&this.radius(o/2)}}return ld.Circle=a,a.prototype._centroid=!0,a.prototype.className="Circle",a.prototype._attrsAffectingSize=["radius"],(0,n._registerNode)(a),e.Factory.addGetterSetter(a,"radius",0,(0,t.getNumberValidator)()),ld}var ud={},f5;function GS(){if(f5)return ud;f5=1,Object.defineProperty(ud,"__esModule",{value:!0}),ud.Ellipse=void 0;const e=Vr(),r=Ma(),t=Yr(),n=jr();class a extends r.Shape{_sceneFunc(o){const s=this.radiusX(),u=this.radiusY();o.beginPath(),o.save(),s!==u&&o.scale(1,u/s),o.arc(0,0,s,0,Math.PI*2,!1),o.restore(),o.closePath(),o.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(o){this.radiusX(o/2)}setHeight(o){this.radiusY(o/2)}}return ud.Ellipse=a,a.prototype.className="Ellipse",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["radiusX","radiusY"],(0,n._registerNode)(a),e.Factory.addComponentsGetterSetter(a,"radius",["x","y"]),e.Factory.addGetterSetter(a,"radiusX",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"radiusY",0,(0,t.getNumberValidator)()),ud}var cd={},h5;function VS(){if(h5)return cd;h5=1,Object.defineProperty(cd,"__esModule",{value:!0}),cd.Image=void 0;const e=Li(),r=Vr(),t=Ma(),n=jr(),a=Yr();class i extends t.Shape{constructor(s){super(s),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",u=>{this._removeImageLoad(u.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const s=this.image();s&&s.complete||s&&s.readyState===4||s&&s.addEventListener&&s.addEventListener("load",this._loadListener)}_removeImageLoad(s){s&&s.removeEventListener&&s.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const s=!!this.cornerRadius(),u=this.hasShadow();return s&&u?!0:super._useBufferCanvas(!0)}_sceneFunc(s){const u=this.getWidth(),c=this.getHeight(),h=this.cornerRadius(),p=this.attrs.image;let v;if(p){const f=this.attrs.cropWidth,_=this.attrs.cropHeight;f&&_?v=[p,this.cropX(),this.cropY(),f,_,0,0,u,c]:v=[p,0,0,u,c]}(this.hasFill()||this.hasStroke()||h)&&(s.beginPath(),h?e.Util.drawRoundedRectPath(s,u,c,h):s.rect(0,0,u,c),s.closePath(),s.fillStrokeShape(this)),p&&(h&&s.clip(),s.drawImage.apply(s,v))}_hitFunc(s){const u=this.width(),c=this.height(),h=this.cornerRadius();s.beginPath(),h?e.Util.drawRoundedRectPath(s,u,c,h):s.rect(0,0,u,c),s.closePath(),s.fillStrokeShape(this)}getWidth(){var s,u;return(s=this.attrs.width)!==null&&s!==void 0?s:(u=this.image())===null||u===void 0?void 0:u.width}getHeight(){var s,u;return(s=this.attrs.height)!==null&&s!==void 0?s:(u=this.image())===null||u===void 0?void 0:u.height}static fromURL(s,u,c=null){const h=e.Util.createImageElement();h.onload=function(){const p=new i({image:h});u(p)},h.onerror=c,h.crossOrigin="Anonymous",h.src=s}}return cd.Image=i,i.prototype.className="Image",(0,n._registerNode)(i),r.Factory.addGetterSetter(i,"cornerRadius",0,(0,a.getNumberOrArrayOfNumbersValidator)(4)),r.Factory.addGetterSetter(i,"image"),r.Factory.addComponentsGetterSetter(i,"crop",["x","y","width","height"]),r.Factory.addGetterSetter(i,"cropX",0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(i,"cropY",0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(i,"cropWidth",0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(i,"cropHeight",0,(0,a.getNumberValidator)()),cd}var bf={},d5;function WS(){if(d5)return bf;d5=1,Object.defineProperty(bf,"__esModule",{value:!0}),bf.Tag=bf.Label=void 0;const e=Vr(),r=Ma(),t=lm(),n=Yr(),a=jr(),i=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],o="Change.konva",s="none",u="up",c="right",h="down",p="left",v=i.length;class f extends t.Group{constructor(w){super(w),this.on("add.konva",function(x){this._addListeners(x.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(w){let x=this,y;const g=function(){x._sync()};for(y=0;y<v;y++)w.on(i[y]+o,g)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let w=this.getText(),x=this.getTag(),y,g,S,b,R,L,T;if(w&&x){switch(y=w.width(),g=w.height(),S=x.pointerDirection(),b=x.pointerWidth(),T=x.pointerHeight(),R=0,L=0,S){case u:R=y/2,L=-1*T;break;case c:R=y+b,L=g/2;break;case h:R=y/2,L=g+T;break;case p:R=-1*b,L=g/2;break}x.setAttrs({x:-1*R,y:-1*L,width:y,height:g}),w.setAttrs({x:-1*R,y:-1*L})}}}bf.Label=f,f.prototype.className="Label",(0,a._registerNode)(f);class _ extends r.Shape{_sceneFunc(w){const x=this.width(),y=this.height(),g=this.pointerDirection(),S=this.pointerWidth(),b=this.pointerHeight(),R=this.cornerRadius();let L=0,T=0,F=0,I=0;typeof R=="number"?L=T=F=I=Math.min(R,x/2,y/2):(L=Math.min(R[0]||0,x/2,y/2),T=Math.min(R[1]||0,x/2,y/2),I=Math.min(R[2]||0,x/2,y/2),F=Math.min(R[3]||0,x/2,y/2)),w.beginPath(),w.moveTo(L,0),g===u&&(w.lineTo((x-S)/2,0),w.lineTo(x/2,-1*b),w.lineTo((x+S)/2,0)),w.lineTo(x-T,0),w.arc(x-T,T,T,Math.PI*3/2,0,!1),g===c&&(w.lineTo(x,(y-b)/2),w.lineTo(x+S,y/2),w.lineTo(x,(y+b)/2)),w.lineTo(x,y-I),w.arc(x-I,y-I,I,0,Math.PI/2,!1),g===h&&(w.lineTo((x+S)/2,y),w.lineTo(x/2,y+b),w.lineTo((x-S)/2,y)),w.lineTo(F,y),w.arc(F,y-F,F,Math.PI/2,Math.PI,!1),g===p&&(w.lineTo(0,(y+b)/2),w.lineTo(-1*S,y/2),w.lineTo(0,(y-b)/2)),w.lineTo(0,L),w.arc(L,L,L,Math.PI,Math.PI*3/2,!1),w.closePath(),w.fillStrokeShape(this)}getSelfRect(){let w=0,x=0,y=this.pointerWidth(),g=this.pointerHeight(),S=this.pointerDirection(),b=this.width(),R=this.height();return S===u?(x-=g,R+=g):S===h?R+=g:S===p?(w-=y*1.5,b+=y):S===c&&(b+=y*1.5),{x:w,y:x,width:b,height:R}}}return bf.Tag=_,_.prototype.className="Tag",(0,a._registerNode)(_),e.Factory.addGetterSetter(_,"pointerDirection",s),e.Factory.addGetterSetter(_,"pointerWidth",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(_,"pointerHeight",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(_,"cornerRadius",0,(0,n.getNumberOrArrayOfNumbersValidator)(4)),bf}var fd={},p5;function A6(){if(p5)return fd;p5=1,Object.defineProperty(fd,"__esModule",{value:!0}),fd.Rect=void 0;const e=Vr(),r=Ma(),t=jr(),n=Li(),a=Yr();class i extends r.Shape{_sceneFunc(s){const u=this.cornerRadius(),c=this.width(),h=this.height();s.beginPath(),u?n.Util.drawRoundedRectPath(s,c,h,u):s.rect(0,0,c,h),s.closePath(),s.fillStrokeShape(this)}}return fd.Rect=i,i.prototype.className="Rect",(0,t._registerNode)(i),e.Factory.addGetterSetter(i,"cornerRadius",0,(0,a.getNumberOrArrayOfNumbersValidator)(4)),fd}var hd={},g5;function $S(){if(g5)return hd;g5=1,Object.defineProperty(hd,"__esModule",{value:!0}),hd.RegularPolygon=void 0;const e=Vr(),r=Ma(),t=Yr(),n=jr();class a extends r.Shape{_sceneFunc(o){const s=this._getPoints();o.beginPath(),o.moveTo(s[0].x,s[0].y);for(let u=1;u<s.length;u++)o.lineTo(s[u].x,s[u].y);o.closePath(),o.fillStrokeShape(this)}_getPoints(){const o=this.attrs.sides,s=this.attrs.radius||0,u=[];for(let c=0;c<o;c++)u.push({x:s*Math.sin(c*2*Math.PI/o),y:-1*s*Math.cos(c*2*Math.PI/o)});return u}getSelfRect(){const o=this._getPoints();let s=o[0].x,u=o[0].y,c=o[0].x,h=o[0].y;return o.forEach(p=>{s=Math.min(s,p.x),u=Math.max(u,p.x),c=Math.min(c,p.y),h=Math.max(h,p.y)}),{x:s,y:c,width:u-s,height:h-c}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(o){this.radius(o/2)}setHeight(o){this.radius(o/2)}}return hd.RegularPolygon=a,a.prototype.className="RegularPolygon",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["radius"],(0,n._registerNode)(a),e.Factory.addGetterSetter(a,"radius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"sides",0,(0,t.getNumberValidator)()),hd}var dd={},v5;function YS(){if(v5)return dd;v5=1,Object.defineProperty(dd,"__esModule",{value:!0}),dd.Ring=void 0;const e=Vr(),r=Ma(),t=Yr(),n=jr(),a=Math.PI*2;class i extends r.Shape{_sceneFunc(s){s.beginPath(),s.arc(0,0,this.innerRadius(),0,a,!1),s.moveTo(this.outerRadius(),0),s.arc(0,0,this.outerRadius(),a,0,!0),s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(s){this.outerRadius(s/2)}setHeight(s){this.outerRadius(s/2)}}return dd.Ring=i,i.prototype.className="Ring",i.prototype._centroid=!0,i.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,n._registerNode)(i),e.Factory.addGetterSetter(i,"innerRadius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(i,"outerRadius",0,(0,t.getNumberValidator)()),dd}var pd={},m5;function XS(){if(m5)return pd;m5=1,Object.defineProperty(pd,"__esModule",{value:!0}),pd.Sprite=void 0;const e=Vr(),r=Ma(),t=um(),n=Yr(),a=jr();class i extends r.Shape{constructor(s){super(s),this._updated=!0,this.anim=new t.Animation(()=>{const u=this._updated;return this._updated=!1,u}),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(s){const u=this.animation(),c=this.frameIndex(),h=c*4,p=this.animations()[u],v=this.frameOffsets(),f=p[h+0],_=p[h+1],E=p[h+2],w=p[h+3],x=this.image();if((this.hasFill()||this.hasStroke())&&(s.beginPath(),s.rect(0,0,E,w),s.closePath(),s.fillStrokeShape(this)),x)if(v){const y=v[u],g=c*2;s.drawImage(x,f,_,E,w,y[g+0],y[g+1],E,w)}else s.drawImage(x,f,_,E,w,0,0,E,w)}_hitFunc(s){const u=this.animation(),c=this.frameIndex(),h=c*4,p=this.animations()[u],v=this.frameOffsets(),f=p[h+2],_=p[h+3];if(s.beginPath(),v){const E=v[u],w=c*2;s.rect(E[w+0],E[w+1],f,_)}else s.rect(0,0,f,_);s.closePath(),s.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const s=this;this.interval=setInterval(function(){s._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const s=this.getLayer();this.anim.setLayers(s),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const s=this.frameIndex(),u=this.animation(),c=this.animations(),h=c[u],p=h.length/4;s<p-1?this.frameIndex(s+1):this.frameIndex(0)}}return pd.Sprite=i,i.prototype.className="Sprite",(0,a._registerNode)(i),e.Factory.addGetterSetter(i,"animation"),e.Factory.addGetterSetter(i,"animations"),e.Factory.addGetterSetter(i,"frameOffsets"),e.Factory.addGetterSetter(i,"image"),e.Factory.addGetterSetter(i,"frameIndex",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(i,"frameRate",17,(0,n.getNumberValidator)()),e.Factory.backCompat(i,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"}),pd}var gd={},y5;function KS(){if(y5)return gd;y5=1,Object.defineProperty(gd,"__esModule",{value:!0}),gd.Star=void 0;const e=Vr(),r=Ma(),t=Yr(),n=jr();class a extends r.Shape{_sceneFunc(o){const s=this.innerRadius(),u=this.outerRadius(),c=this.numPoints();o.beginPath(),o.moveTo(0,0-u);for(let h=1;h<c*2;h++){const p=h%2===0?u:s,v=p*Math.sin(h*Math.PI/c),f=-1*p*Math.cos(h*Math.PI/c);o.lineTo(v,f)}o.closePath(),o.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(o){this.outerRadius(o/2)}setHeight(o){this.outerRadius(o/2)}}return gd.Star=a,a.prototype.className="Star",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,n._registerNode)(a),e.Factory.addGetterSetter(a,"numPoints",5,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"innerRadius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"outerRadius",0,(0,t.getNumberValidator)()),gd}var rh={},b5;function C6(){if(b5)return rh;b5=1,Object.defineProperty(rh,"__esModule",{value:!0}),rh.Text=void 0,rh.stringToArray=o;const e=Li(),r=Vr(),t=Ma(),n=jr(),a=Yr(),i=jr();function o(U){return[...U].reduce((D,$,Q,ee)=>{if(new RegExp("\\p{Emoji}","u").test($)){const te=ee[Q+1];te&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(te)?(D.push($+te),ee[Q+1]=""):D.push($)}else new RegExp("\\p{Regional_Indicator}{2}","u").test($+(ee[Q+1]||""))?D.push($+ee[Q+1]):Q>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test($)?D[D.length-1]+=$:$&&D.push($);return D},[])}const s="auto",u="center",c="inherit",h="justify",p="Change.konva",v="2d",f="-",_="left",E="text",w="Text",x="top",y="bottom",g="middle",S="normal",b="px ",R=" ",L="right",T="rtl",F="word",I="char",O="none",C="…",A=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],j=A.length;function N(U){return U.split(",").map(D=>{D=D.trim();const $=D.indexOf(" ")>=0,Q=D.indexOf('"')>=0||D.indexOf("'")>=0;return $&&!Q&&(D=`"${D}"`),D}).join(", ")}let B;function W(){return B||(B=e.Util.createCanvasElement().getContext(v),B)}function Y(U){U.fillText(this._partialText,this._partialTextX,this._partialTextY)}function Z(U){U.setAttr("miterLimit",2),U.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function V(U){return U=U||{},!U.fillLinearGradientColorStops&&!U.fillRadialGradientColorStops&&!U.fillPatternImage&&(U.fill=U.fill||"black"),U}class H extends t.Shape{constructor(D){super(V(D)),this._partialTextX=0,this._partialTextY=0;for(let $=0;$<j;$++)this.on(A[$]+p,this._setTextData);this._setTextData()}_sceneFunc(D){const $=this.textArr,Q=$.length;if(!this.text())return;let ee=this.padding(),te=this.fontSize(),ae=this.lineHeight()*te,se=this.verticalAlign(),ce=this.direction(),me=0,_e=this.align(),Le=this.getWidth(),Re=this.letterSpacing(),Pe=this.fill(),ve=this.textDecoration(),it=ve.indexOf("underline")!==-1,Se=ve.indexOf("line-through")!==-1,be;ce=ce===c?D.direction:ce;let Ae=ae/2,Te=g;if(n.Konva._fixTextRendering){const Ze=this.measureSize("M");Te="alphabetic",Ae=(Ze.fontBoundingBoxAscent-Ze.fontBoundingBoxDescent)/2+ae/2}var he=0,Oe=0;for(ce===T&&D.setAttr("direction",ce),D.setAttr("font",this._getContextFont()),D.setAttr("textBaseline",Te),D.setAttr("textAlign",_),se===g?me=(this.getHeight()-Q*ae-ee*2)/2:se===y&&(me=this.getHeight()-Q*ae-ee*2),D.translate(ee,me+ee),be=0;be<Q;be++){var he=0,Oe=0,Me=$[be],ze=Me.text,pt=Me.width,yt=Me.lastInParagraph,He,Qe;if(D.save(),_e===L?he+=Le-pt-ee*2:_e===u&&(he+=(Le-pt-ee*2)/2),it){D.save(),D.beginPath();const Ht=n.Konva._fixTextRendering?Math.round(te/4):Math.round(te/2),Pt=he,It=Ae+Oe+Ht;D.moveTo(Pt,It),He=ze.split(" ").length-1,Qe=_e===h&&!yt?Le-ee*2:pt,D.lineTo(Pt+Math.round(Qe),It),D.lineWidth=te/15;const qt=this._getLinearGradient();D.strokeStyle=qt||Pe,D.stroke(),D.restore()}if(Se){D.save(),D.beginPath();const Ht=n.Konva._fixTextRendering?-Math.round(te/4):0;D.moveTo(he,Ae+Oe+Ht),He=ze.split(" ").length-1,Qe=_e===h&&!yt?Le-ee*2:pt,D.lineTo(he+Math.round(Qe),Ae+Oe+Ht),D.lineWidth=te/15;const Pt=this._getLinearGradient();D.strokeStyle=Pt||Pe,D.stroke(),D.restore()}if(ce!==T&&(Re!==0||_e===h)){He=ze.split(" ").length-1;const Ht=o(ze);for(let Pt=0;Pt<Ht.length;Pt++){const It=Ht[Pt];It===" "&&!yt&&_e===h&&(he+=(Le-ee*2-pt)/He),this._partialTextX=he,this._partialTextY=Ae+Oe,this._partialText=It,D.fillStrokeShape(this),he+=this.measureSize(It).width+Re}}else Re!==0&&D.setAttr("letterSpacing",`${Re}px`),this._partialTextX=he,this._partialTextY=Ae+Oe,this._partialText=ze,D.fillStrokeShape(this);D.restore(),Q>1&&(Ae+=ae)}}_hitFunc(D){const $=this.getWidth(),Q=this.getHeight();D.beginPath(),D.rect(0,0,$,Q),D.closePath(),D.fillStrokeShape(this)}setText(D){const $=e.Util._isString(D)?D:D==null?"":D+"";return this._setAttr(E,$),this}getWidth(){return this.attrs.width===s||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===s||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(D){var $,Q,ee,te,ae,se,ce,me,_e,Le,Re;let Pe=W(),ve=this.fontSize(),it;Pe.save(),Pe.font=this._getContextFont(),it=Pe.measureText(D),Pe.restore();const Se=ve/100;return{actualBoundingBoxAscent:($=it.actualBoundingBoxAscent)!==null&&$!==void 0?$:71.58203125*Se,actualBoundingBoxDescent:(Q=it.actualBoundingBoxDescent)!==null&&Q!==void 0?Q:0,actualBoundingBoxLeft:(ee=it.actualBoundingBoxLeft)!==null&&ee!==void 0?ee:-7.421875*Se,actualBoundingBoxRight:(te=it.actualBoundingBoxRight)!==null&&te!==void 0?te:75.732421875*Se,alphabeticBaseline:(ae=it.alphabeticBaseline)!==null&&ae!==void 0?ae:0,emHeightAscent:(se=it.emHeightAscent)!==null&&se!==void 0?se:100*Se,emHeightDescent:(ce=it.emHeightDescent)!==null&&ce!==void 0?ce:-20*Se,fontBoundingBoxAscent:(me=it.fontBoundingBoxAscent)!==null&&me!==void 0?me:91*Se,fontBoundingBoxDescent:(_e=it.fontBoundingBoxDescent)!==null&&_e!==void 0?_e:21*Se,hangingBaseline:(Le=it.hangingBaseline)!==null&&Le!==void 0?Le:72.80000305175781*Se,ideographicBaseline:(Re=it.ideographicBaseline)!==null&&Re!==void 0?Re:-21*Se,width:it.width,height:ve}}_getContextFont(){return this.fontStyle()+R+this.fontVariant()+R+(this.fontSize()+b)+N(this.fontFamily())}_addTextLine(D){this.align()===h&&(D=D.trim());const Q=this._getTextWidth(D);return this.textArr.push({text:D,width:Q,lastInParagraph:!1})}_getTextWidth(D){const $=this.letterSpacing(),Q=D.length;return W().measureText(D).width+$*Q}_setTextData(){let D=this.text().split(`
|
|
43
|
-
`),$=+this.fontSize(),Q=0,ee=this.lineHeight()*$,te=this.attrs.width,ae=this.attrs.height,se=te!==s&&te!==void 0,ce=ae!==s&&ae!==void 0,me=this.padding(),_e=te-me*2,Le=ae-me*2,Re=0,Pe=this.wrap(),ve=Pe!==O,it=Pe!==I&&ve,Se=this.ellipsis();this.textArr=[],W().font=this._getContextFont();const be=Se?this._getTextWidth(C):0;for(let Ae=0,Te=D.length;Ae<Te;++Ae){let he=D[Ae],Oe=this._getTextWidth(he);if(se&&Oe>_e)for(;he.length>0;){let Me=0,ze=o(he).length,pt="",yt=0;for(;Me<ze;){const He=Me+ze>>>1,Qe=o(he),Ze=Qe.slice(0,He+1).join(""),tt=this._getTextWidth(Ze);(Se&&ce&&Re+ee>Le?tt+be:tt)<=_e?(Me=He+1,pt=Ze,yt=tt):ze=He}if(pt){if(it){const Ze=o(he),tt=o(pt),Ht=Ze[tt.length],Pt=Ht===R||Ht===f;let It;if(Pt&&yt<=_e)It=tt.length;else{const qt=tt.lastIndexOf(R),Ie=tt.lastIndexOf(f);It=Math.max(qt,Ie)+1}It>0&&(Me=It,pt=Ze.slice(0,Me).join(""),yt=this._getTextWidth(pt))}if(pt=pt.trimRight(),this._addTextLine(pt),Q=Math.max(Q,yt),Re+=ee,this._shouldHandleEllipsis(Re)){this._tryToAddEllipsisToLastLine();break}if(he=o(he).slice(Me).join("").trimLeft(),he.length>0&&(Oe=this._getTextWidth(he),Oe<=_e)){this._addTextLine(he),Re+=ee,Q=Math.max(Q,Oe);break}}else break}else this._addTextLine(he),Re+=ee,Q=Math.max(Q,Oe),this._shouldHandleEllipsis(Re)&&Ae<Te-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),ce&&Re+ee>Le)break}this.textHeight=$,this.textWidth=Q}_shouldHandleEllipsis(D){const $=+this.fontSize(),Q=this.lineHeight()*$,ee=this.attrs.height,te=ee!==s&&ee!==void 0,ae=this.padding(),se=ee-ae*2;return!(this.wrap()!==O)||te&&D+Q>se}_tryToAddEllipsisToLastLine(){const D=this.attrs.width,$=D!==s&&D!==void 0,Q=this.padding(),ee=D-Q*2,te=this.ellipsis(),ae=this.textArr[this.textArr.length-1];!ae||!te||($&&(this._getTextWidth(ae.text+C)<ee||(ae.text=ae.text.slice(0,ae.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(ae.text+C))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const D=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,$=this.hasShadow();return D&&$?!0:super._useBufferCanvas()}}return rh.Text=H,H.prototype._fillFunc=Y,H.prototype._strokeFunc=Z,H.prototype.className=w,H.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],(0,i._registerNode)(H),r.Factory.overWriteSetter(H,"width",(0,a.getNumberOrAutoValidator)()),r.Factory.overWriteSetter(H,"height",(0,a.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(H,"direction",c),r.Factory.addGetterSetter(H,"fontFamily","Arial"),r.Factory.addGetterSetter(H,"fontSize",12,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(H,"fontStyle",S),r.Factory.addGetterSetter(H,"fontVariant",S),r.Factory.addGetterSetter(H,"padding",0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(H,"align",_),r.Factory.addGetterSetter(H,"verticalAlign",x),r.Factory.addGetterSetter(H,"lineHeight",1,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(H,"wrap",F),r.Factory.addGetterSetter(H,"ellipsis",!1,(0,a.getBooleanValidator)()),r.Factory.addGetterSetter(H,"letterSpacing",0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(H,"text","",(0,a.getStringValidator)()),r.Factory.addGetterSetter(H,"textDecoration",""),rh}var vd={},w5;function ZS(){if(w5)return vd;w5=1,Object.defineProperty(vd,"__esModule",{value:!0}),vd.TextPath=void 0;const e=Li(),r=Vr(),t=Ma(),n=cm(),a=C6(),i=Yr(),o=jr(),s="",u="normal";function c(v){v.fillText(this.partialText,0,0)}function h(v){v.strokeText(this.partialText,0,0)}class p extends t.Shape{constructor(f){super(f),this.dummyCanvas=e.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 n.Path.getPathLength(this.dataArray)}_getPointAtLength(f){if(!this.attrs.data)return null;const _=this.pathLength;return f-1>_?null:n.Path.getPointAtLengthOfDataArray(f,this.dataArray)}_readDataAttribute(){this.dataArray=n.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(f){f.setAttr("font",this._getContextFont()),f.setAttr("textBaseline",this.textBaseline()),f.setAttr("textAlign","left"),f.save();const _=this.textDecoration(),E=this.fill(),w=this.fontSize(),x=this.glyphInfo;_==="underline"&&f.beginPath();for(let y=0;y<x.length;y++){f.save();const g=x[y].p0;f.translate(g.x,g.y),f.rotate(x[y].rotation),this.partialText=x[y].text,f.fillStrokeShape(this),_==="underline"&&(y===0&&f.moveTo(0,w/2+1),f.lineTo(w,w/2+1)),f.restore()}_==="underline"&&(f.strokeStyle=E,f.lineWidth=w/20,f.stroke()),f.restore()}_hitFunc(f){f.beginPath();const _=this.glyphInfo;if(_.length>=1){const E=_[0].p0;f.moveTo(E.x,E.y)}for(let E=0;E<_.length;E++){const w=_[E].p1;f.lineTo(w.x,w.y)}f.setAttr("lineWidth",this.fontSize()),f.setAttr("strokeStyle",this.colorKey),f.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(f){return a.Text.prototype.setText.call(this,f)}_getContextFont(){return a.Text.prototype._getContextFont.call(this)}_getTextSize(f){const E=this.dummyCanvas.getContext("2d");E.save(),E.font=this._getContextFont();const w=E.measureText(f);return E.restore(),{width:w.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:f,height:_}=this._getTextSize(this.attrs.text);if(this.textWidth=f,this.textHeight=_,this.glyphInfo=[],!this.attrs.data)return null;const E=this.letterSpacing(),w=this.align(),x=this.kerningFunc(),y=Math.max(this.textWidth+((this.attrs.text||"").length-1)*E,0);let g=0;w==="center"&&(g=Math.max(0,this.pathLength/2-y/2)),w==="right"&&(g=Math.max(0,this.pathLength-y));const S=(0,a.stringToArray)(this.text());let b=g;for(let R=0;R<S.length;R++){const L=this._getPointAtLength(b);if(!L)return;let T=this._getTextSize(S[R]).width+E;if(S[R]===" "&&w==="justify"){const j=this.text().split(" ").length-1;T+=(this.pathLength-y)/j}const F=this._getPointAtLength(b+T);if(!F)return;const I=n.Path.getLineLength(L.x,L.y,F.x,F.y);let O=0;if(x)try{O=x(S[R-1],S[R])*this.fontSize()}catch{O=0}L.x+=O,F.x+=O,this.textWidth+=O;const C=n.Path.getPointOnLine(O+I/2,L.x,L.y,F.x,F.y),A=Math.atan2(F.y-L.y,F.x-L.x);this.glyphInfo.push({transposeX:C.x,transposeY:C.y,text:S[R],rotation:A,p0:L,p1:F}),b+=T}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const f=[];this.glyphInfo.forEach(function(b){f.push(b.p0.x),f.push(b.p0.y),f.push(b.p1.x),f.push(b.p1.y)});let _=f[0]||0,E=f[0]||0,w=f[1]||0,x=f[1]||0,y,g;for(let b=0;b<f.length/2;b++)y=f[b*2],g=f[b*2+1],_=Math.min(_,y),E=Math.max(E,y),w=Math.min(w,g),x=Math.max(x,g);const S=this.fontSize();return{x:_-S/2,y:w-S/2,width:E-_+S,height:x-w+S}}destroy(){return e.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}return vd.TextPath=p,p.prototype._fillFunc=c,p.prototype._strokeFunc=h,p.prototype._fillFuncHit=c,p.prototype._strokeFuncHit=h,p.prototype.className="TextPath",p.prototype._attrsAffectingSize=["text","fontSize","data"],(0,o._registerNode)(p),r.Factory.addGetterSetter(p,"data"),r.Factory.addGetterSetter(p,"fontFamily","Arial"),r.Factory.addGetterSetter(p,"fontSize",12,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(p,"fontStyle",u),r.Factory.addGetterSetter(p,"align","left"),r.Factory.addGetterSetter(p,"letterSpacing",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(p,"textBaseline","middle"),r.Factory.addGetterSetter(p,"fontVariant",u),r.Factory.addGetterSetter(p,"text",s),r.Factory.addGetterSetter(p,"textDecoration",""),r.Factory.addGetterSetter(p,"kerningFunc",void 0),vd}var md={},_5;function QS(){if(_5)return md;_5=1,Object.defineProperty(md,"__esModule",{value:!0}),md.Transformer=void 0;const e=Li(),r=Vr(),t=Ji(),n=Ma(),a=A6(),i=lm(),o=jr(),s=Yr(),u=jr(),c="tr-konva",h=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(T=>T+`.${c}`).join(" "),p="nodesRect",v=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],f={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},_="ontouchstart"in o.Konva._global;function E(T,F,I){if(T==="rotater")return I;F+=e.Util.degToRad(f[T]||0);const O=(e.Util.radToDeg(F)%360+360)%360;return e.Util._inRange(O,315+22.5,360)||e.Util._inRange(O,0,22.5)?"ns-resize":e.Util._inRange(O,45-22.5,45+22.5)?"nesw-resize":e.Util._inRange(O,90-22.5,90+22.5)?"ew-resize":e.Util._inRange(O,135-22.5,135+22.5)?"nwse-resize":e.Util._inRange(O,180-22.5,180+22.5)?"ns-resize":e.Util._inRange(O,225-22.5,225+22.5)?"nesw-resize":e.Util._inRange(O,270-22.5,270+22.5)?"ew-resize":e.Util._inRange(O,315-22.5,315+22.5)?"nwse-resize":(e.Util.error("Transformer has unknown angle for cursor detection: "+O),"pointer")}const w=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function x(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 y(T,F,I){const O=I.x+(T.x-I.x)*Math.cos(F)-(T.y-I.y)*Math.sin(F),C=I.y+(T.x-I.x)*Math.sin(F)+(T.y-I.y)*Math.cos(F);return{...T,rotation:T.rotation+F,x:O,y:C}}function g(T,F){const I=x(T);return y(T,F,I)}function S(T,F,I){let O=F;for(let C=0;C<T.length;C++){const A=o.Konva.getAngle(T[C]),j=Math.abs(A-F)%(Math.PI*2);Math.min(j,Math.PI*2-j)<I&&(O=A)}return O}let b=0;class R extends i.Group{constructor(F){super(F),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(h,this.update),this.getNode()&&this.update()}attachTo(F){return this.setNode(F),this}setNode(F){return e.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([F])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return c+this._id}setNodes(F=[]){this._nodes&&this._nodes.length&&this.detach();const I=F.filter(C=>C.isAncestorOf(this)?(e.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=F=I,F.length===1&&this.useSingleNodeRotation()?this.rotation(F[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(C=>{const A=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(C._attrsAffectingSize.length){const j=C._attrsAffectingSize.map(N=>N+"Change."+this._getEventNamespace()).join(" ");C.on(j,A)}C.on(v.map(j=>j+`.${this._getEventNamespace()}`).join(" "),A),C.on(`absoluteTransformChange.${this._getEventNamespace()}`,A),this._proxyDrag(C)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(F){let I;F.on(`dragstart.${this._getEventNamespace()}`,O=>{I=F.getAbsolutePosition(),!this.isDragging()&&F!==this.findOne(".back")&&this.startDrag(O,!1)}),F.on(`dragmove.${this._getEventNamespace()}`,O=>{if(!I)return;const C=F.getAbsolutePosition(),A=C.x-I.x,j=C.y-I.y;this.nodes().forEach(N=>{if(N===F||N.isDragging())return;const B=N.getAbsolutePosition();N.setAbsolutePosition({x:B.x+A,y:B.y+j}),N.startDrag(O)}),I=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(F=>{F.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(p),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(p,this.__getNodeRect)}__getNodeShape(F,I=this.rotation(),O){const C=F.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),A=F.getAbsoluteScale(O),j=F.getAbsolutePosition(O),N=C.x*A.x-F.offsetX()*A.x,B=C.y*A.y-F.offsetY()*A.y,W=(o.Konva.getAngle(F.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),Y={x:j.x+N*Math.cos(W)+B*Math.sin(-W),y:j.y+B*Math.cos(W)+N*Math.sin(W),width:C.width*A.x,height:C.height*A.y,rotation:W};return y(Y,-o.Konva.getAngle(I),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const I=[];this.nodes().map(W=>{const Y=W.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),Z=[{x:Y.x,y:Y.y},{x:Y.x+Y.width,y:Y.y},{x:Y.x+Y.width,y:Y.y+Y.height},{x:Y.x,y:Y.y+Y.height}],V=W.getAbsoluteTransform();Z.forEach(function(H){const U=V.point(H);I.push(U)})});const O=new e.Transform;O.rotate(-o.Konva.getAngle(this.rotation()));let C=1/0,A=1/0,j=-1/0,N=-1/0;I.forEach(function(W){const Y=O.point(W);C===void 0&&(C=j=Y.x,A=N=Y.y),C=Math.min(C,Y.x),A=Math.min(A,Y.y),j=Math.max(j,Y.x),N=Math.max(N,Y.y)}),O.invert();const B=O.point({x:C,y:A});return{x:B.x,y:B.y,width:j-C,height:N-A,rotation:o.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(),w.forEach(F=>{this._createAnchor(F)}),this._createAnchor("rotater")}_createAnchor(F){const I=new a.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:F+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:_?10:"auto"}),O=this;I.on("mousedown touchstart",function(C){O._handleMouseDown(C)}),I.on("dragstart",C=>{I.stopDrag(),C.cancelBubble=!0}),I.on("dragend",C=>{C.cancelBubble=!0}),I.on("mouseenter",()=>{const C=o.Konva.getAngle(this.rotation()),A=this.rotateAnchorCursor(),j=E(F,C,A);I.getStage().content&&(I.getStage().content.style.cursor=j),this._cursorChange=!0}),I.on("mouseout",()=>{I.getStage().content&&(I.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(I)}_createBack(){const F=new n.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(I,O){const C=O.getParent(),A=C.padding();I.beginPath(),I.rect(-A,-A,O.width()+A*2,O.height()+A*2),I.moveTo(O.width()/2,-A),C.rotateEnabled()&&C.rotateLineVisible()&&I.lineTo(O.width()/2,-C.rotateAnchorOffset()*e.Util._sign(O.height())-A),I.fillStrokeShape(O)},hitFunc:(I,O)=>{if(!this.shouldOverdrawWholeArea())return;const C=this.padding();I.beginPath(),I.rect(-C,-C,O.width()+C*2,O.height()+C*2),I.fillStrokeShape(O)}});this.add(F),this._proxyDrag(F),F.on("dragstart",I=>{I.cancelBubble=!0}),F.on("dragmove",I=>{I.cancelBubble=!0}),F.on("dragend",I=>{I.cancelBubble=!0}),this.on("dragmove",I=>{this.update()})}_handleMouseDown(F){if(this._transforming)return;this._movingAnchorName=F.target.name().split(" ")[0];const I=this._getNodeRect(),O=I.width,C=I.height,A=Math.sqrt(Math.pow(O,2)+Math.pow(C,2));this.sin=Math.abs(C/A),this.cos=Math.abs(O/A),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const j=F.target.getAbsolutePosition(),N=F.target.getStage().getPointerPosition();this._anchorDragOffset={x:N.x-j.x,y:N.y-j.y},b++,this._fire("transformstart",{evt:F.evt,target:this.getNode()}),this._nodes.forEach(B=>{B._fire("transformstart",{evt:F.evt,target:B})})}_handleMouseMove(F){let I,O,C;const A=this.findOne("."+this._movingAnchorName),j=A.getStage();j.setPointersPositions(F);const N=j.getPointerPosition();let B={x:N.x-this._anchorDragOffset.x,y:N.y-this._anchorDragOffset.y};const W=A.getAbsolutePosition();this.anchorDragBoundFunc()&&(B=this.anchorDragBoundFunc()(W,B,F)),A.setAbsolutePosition(B);const Y=A.getAbsolutePosition();if(W.x===Y.x&&W.y===Y.y)return;if(this._movingAnchorName==="rotater"){const se=this._getNodeRect();I=A.x()-se.width/2,O=-A.y()+se.height/2;let ce=Math.atan2(-O,I)+Math.PI/2;se.height<0&&(ce-=Math.PI);const _e=o.Konva.getAngle(this.rotation())+ce,Le=o.Konva.getAngle(this.rotationSnapTolerance()),Pe=S(this.rotationSnaps(),_e,Le)-se.rotation,ve=g(se,Pe);this._fitNodesInto(ve,F);return}const Z=this.shiftBehavior();let V;Z==="inverted"?V=this.keepRatio()&&!F.shiftKey:Z==="none"?V=this.keepRatio():V=this.keepRatio()||F.shiftKey;var Q=this.centeredScaling()||F.altKey;if(this._movingAnchorName==="top-left"){if(V){var H=Q?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};C=Math.sqrt(Math.pow(H.x-A.x(),2)+Math.pow(H.y-A.y(),2));var U=this.findOne(".top-left").x()>H.x?-1:1,D=this.findOne(".top-left").y()>H.y?-1:1;I=C*this.cos*U,O=C*this.sin*D,this.findOne(".top-left").x(H.x-I),this.findOne(".top-left").y(H.y-O)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(A.y());else if(this._movingAnchorName==="top-right"){if(V){var H=Q?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};C=Math.sqrt(Math.pow(A.x()-H.x,2)+Math.pow(H.y-A.y(),2));var U=this.findOne(".top-right").x()<H.x?-1:1,D=this.findOne(".top-right").y()>H.y?-1:1;I=C*this.cos*U,O=C*this.sin*D,this.findOne(".top-right").x(H.x+I),this.findOne(".top-right").y(H.y-O)}var $=A.position();this.findOne(".top-left").y($.y),this.findOne(".bottom-right").x($.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(A.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(A.x());else if(this._movingAnchorName==="bottom-left"){if(V){var H=Q?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};C=Math.sqrt(Math.pow(H.x-A.x(),2)+Math.pow(A.y()-H.y,2));var U=H.x<A.x()?-1:1,D=A.y()<H.y?-1:1;I=C*this.cos*U,O=C*this.sin*D,A.x(H.x-I),A.y(H.y+O)}$=A.position(),this.findOne(".top-left").x($.x),this.findOne(".bottom-right").y($.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(A.y());else if(this._movingAnchorName==="bottom-right"){if(V){var H=Q?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};C=Math.sqrt(Math.pow(A.x()-H.x,2)+Math.pow(A.y()-H.y,2));var U=this.findOne(".bottom-right").x()<H.x?-1:1,D=this.findOne(".bottom-right").y()<H.y?-1:1;I=C*this.cos*U,O=C*this.sin*D,this.findOne(".bottom-right").x(H.x+I),this.findOne(".bottom-right").y(H.y+O)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var Q=this.centeredScaling()||F.altKey;if(Q){const se=this.findOne(".top-left"),ce=this.findOne(".bottom-right"),me=se.x(),_e=se.y(),Le=this.getWidth()-ce.x(),Re=this.getHeight()-ce.y();ce.move({x:-me,y:-_e}),se.move({x:Le,y:Re})}const ee=this.findOne(".top-left").getAbsolutePosition();I=ee.x,O=ee.y;const te=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),ae=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:I,y:O,width:te,height:ae,rotation:o.Konva.getAngle(this.rotation())},F)}_handleMouseUp(F){this._removeEvents(F)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(F){var I;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 O=this.getNode();b--,this._fire("transformend",{evt:F,target:O}),(I=this.getLayer())===null||I===void 0||I.batchDraw(),O&&this._nodes.forEach(C=>{var A;C._fire("transformend",{evt:F,target:C}),(A=C.getLayer())===null||A===void 0||A.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(F,I){const O=this._getNodeRect(),C=1;if(e.Util._inRange(F.width,-this.padding()*2-C,C)){this.update();return}if(e.Util._inRange(F.height,-this.padding()*2-C,C)){this.update();return}const A=new e.Transform;if(A.rotate(o.Konva.getAngle(this.rotation())),this._movingAnchorName&&F.width<0&&this._movingAnchorName.indexOf("left")>=0){const V=A.point({x:-this.padding()*2,y:0});F.x+=V.x,F.y+=V.y,F.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=V.x,this._anchorDragOffset.y-=V.y}else if(this._movingAnchorName&&F.width<0&&this._movingAnchorName.indexOf("right")>=0){const V=A.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=V.x,this._anchorDragOffset.y-=V.y,F.width+=this.padding()*2}if(this._movingAnchorName&&F.height<0&&this._movingAnchorName.indexOf("top")>=0){const V=A.point({x:0,y:-this.padding()*2});F.x+=V.x,F.y+=V.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=V.x,this._anchorDragOffset.y-=V.y,F.height+=this.padding()*2}else if(this._movingAnchorName&&F.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const V=A.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=V.x,this._anchorDragOffset.y-=V.y,F.height+=this.padding()*2}if(this.boundBoxFunc()){const V=this.boundBoxFunc()(O,F);V?F=V:e.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const j=1e7,N=new e.Transform;N.translate(O.x,O.y),N.rotate(O.rotation),N.scale(O.width/j,O.height/j);const B=new e.Transform,W=F.width/j,Y=F.height/j;this.flipEnabled()===!1?(B.translate(F.x,F.y),B.rotate(F.rotation),B.translate(F.width<0?F.width:0,F.height<0?F.height:0),B.scale(Math.abs(W),Math.abs(Y))):(B.translate(F.x,F.y),B.rotate(F.rotation),B.scale(W,Y));const Z=B.multiply(N.invert());this._nodes.forEach(V=>{var H;const U=V.getParent().getAbsoluteTransform(),D=V.getTransform().copy();D.translate(V.offsetX(),V.offsetY());const $=new e.Transform;$.multiply(U.copy().invert()).multiply(Z).multiply(U).multiply(D);const Q=$.decompose();V.setAttrs(Q),(H=V.getLayer())===null||H===void 0||H.batchDraw()}),this.rotation(e.Util._getRotation(F.rotation)),this._nodes.forEach(V=>{this._fire("transform",{evt:I,target:V}),V._fire("transform",{evt:I,target:V})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(F,I){this.findOne(F).setAttrs(I)}update(){var F;const I=this._getNodeRect();this.rotation(e.Util._getRotation(I.rotation));const O=I.width,C=I.height,A=this.enabledAnchors(),j=this.resizeEnabled(),N=this.padding(),B=this.anchorSize(),W=this.find("._anchor");W.forEach(Z=>{Z.setAttrs({width:B,height:B,offsetX:B/2,offsetY:B/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:B/2+N,offsetY:B/2+N,visible:j&&A.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:O/2,y:0,offsetY:B/2+N,visible:j&&A.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:O,y:0,offsetX:B/2-N,offsetY:B/2+N,visible:j&&A.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:C/2,offsetX:B/2+N,visible:j&&A.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:O,y:C/2,offsetX:B/2-N,visible:j&&A.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:C,offsetX:B/2+N,offsetY:B/2-N,visible:j&&A.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:O/2,y:C,offsetY:B/2-N,visible:j&&A.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:O,y:C,offsetX:B/2-N,offsetY:B/2-N,visible:j&&A.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:O/2,y:-this.rotateAnchorOffset()*e.Util._sign(C)-N,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:O,height:C,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const Y=this.anchorStyleFunc();Y&&W.forEach(Z=>{Y(Z)}),(F=this.getLayer())===null||F===void 0||F.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const F=this.findOne("."+this._movingAnchorName);F&&F.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),i.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return t.Node.prototype.toObject.call(this)}clone(F){return t.Node.prototype.clone.call(this,F)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}md.Transformer=R,R.isTransforming=()=>b>0;function L(T){return T instanceof Array||e.Util.warn("enabledAnchors value should be an array"),T instanceof Array&&T.forEach(function(F){w.indexOf(F)===-1&&e.Util.warn("Unknown anchor name: "+F+". Available names are: "+w.join(", "))}),T||[]}return R.prototype.className="Transformer",(0,u._registerNode)(R),r.Factory.addGetterSetter(R,"enabledAnchors",w,L),r.Factory.addGetterSetter(R,"flipEnabled",!0,(0,s.getBooleanValidator)()),r.Factory.addGetterSetter(R,"resizeEnabled",!0),r.Factory.addGetterSetter(R,"anchorSize",10,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(R,"rotateEnabled",!0),r.Factory.addGetterSetter(R,"rotateLineVisible",!0),r.Factory.addGetterSetter(R,"rotationSnaps",[]),r.Factory.addGetterSetter(R,"rotateAnchorOffset",50,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(R,"rotateAnchorCursor","crosshair"),r.Factory.addGetterSetter(R,"rotationSnapTolerance",5,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(R,"borderEnabled",!0),r.Factory.addGetterSetter(R,"anchorStroke","rgb(0, 161, 255)"),r.Factory.addGetterSetter(R,"anchorStrokeWidth",1,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(R,"anchorFill","white"),r.Factory.addGetterSetter(R,"anchorCornerRadius",0,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(R,"borderStroke","rgb(0, 161, 255)"),r.Factory.addGetterSetter(R,"borderStrokeWidth",1,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(R,"borderDash"),r.Factory.addGetterSetter(R,"keepRatio",!0),r.Factory.addGetterSetter(R,"shiftBehavior","default"),r.Factory.addGetterSetter(R,"centeredScaling",!1),r.Factory.addGetterSetter(R,"ignoreStroke",!1),r.Factory.addGetterSetter(R,"padding",0,(0,s.getNumberValidator)()),r.Factory.addGetterSetter(R,"nodes"),r.Factory.addGetterSetter(R,"node"),r.Factory.addGetterSetter(R,"boundBoxFunc"),r.Factory.addGetterSetter(R,"anchorDragBoundFunc"),r.Factory.addGetterSetter(R,"anchorStyleFunc"),r.Factory.addGetterSetter(R,"shouldOverdrawWholeArea",!1),r.Factory.addGetterSetter(R,"useSingleNodeRotation",!0),r.Factory.backCompat(R,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"}),md}var yd={},S5;function JS(){if(S5)return yd;S5=1,Object.defineProperty(yd,"__esModule",{value:!0}),yd.Wedge=void 0;const e=Vr(),r=Ma(),t=jr(),n=Yr(),a=jr();class i extends r.Shape{_sceneFunc(s){s.beginPath(),s.arc(0,0,this.radius(),0,t.Konva.getAngle(this.angle()),this.clockwise()),s.lineTo(0,0),s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(s){this.radius(s/2)}setHeight(s){this.radius(s/2)}}return yd.Wedge=i,i.prototype.className="Wedge",i.prototype._centroid=!0,i.prototype._attrsAffectingSize=["radius"],(0,a._registerNode)(i),e.Factory.addGetterSetter(i,"radius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(i,"angle",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(i,"clockwise",!1),e.Factory.backCompat(i,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"}),yd}var bd={},x5;function ex(){if(x5)return bd;x5=1,Object.defineProperty(bd,"__esModule",{value:!0}),bd.Blur=void 0;const e=Vr(),r=Ji(),t=Yr();function n(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const a=[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],i=[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 o(u,c){const h=u.data,p=u.width,v=u.height;let f,_,E,w,x,y,g,S,b,R,L,T,F,I,O,C,A,j,N,B,W,Y,Z,V;const H=c+c+1,U=p-1,D=v-1,$=c+1,Q=$*($+1)/2,ee=new n,te=a[c],ae=i[c];let se=null,ce=ee,me=null,_e=null;for(E=1;E<H;E++)ce=ce.next=new n,E===$&&(se=ce);for(ce.next=ee,g=y=0,_=0;_<v;_++){for(C=A=j=N=S=b=R=L=0,T=$*(B=h[y]),F=$*(W=h[y+1]),I=$*(Y=h[y+2]),O=$*(Z=h[y+3]),S+=Q*B,b+=Q*W,R+=Q*Y,L+=Q*Z,ce=ee,E=0;E<$;E++)ce.r=B,ce.g=W,ce.b=Y,ce.a=Z,ce=ce.next;for(E=1;E<$;E++)w=y+((U<E?U:E)<<2),S+=(ce.r=B=h[w])*(V=$-E),b+=(ce.g=W=h[w+1])*V,R+=(ce.b=Y=h[w+2])*V,L+=(ce.a=Z=h[w+3])*V,C+=B,A+=W,j+=Y,N+=Z,ce=ce.next;for(me=ee,_e=se,f=0;f<p;f++)h[y+3]=Z=L*te>>ae,Z!==0?(Z=255/Z,h[y]=(S*te>>ae)*Z,h[y+1]=(b*te>>ae)*Z,h[y+2]=(R*te>>ae)*Z):h[y]=h[y+1]=h[y+2]=0,S-=T,b-=F,R-=I,L-=O,T-=me.r,F-=me.g,I-=me.b,O-=me.a,w=g+((w=f+c+1)<U?w:U)<<2,C+=me.r=h[w],A+=me.g=h[w+1],j+=me.b=h[w+2],N+=me.a=h[w+3],S+=C,b+=A,R+=j,L+=N,me=me.next,T+=B=_e.r,F+=W=_e.g,I+=Y=_e.b,O+=Z=_e.a,C-=B,A-=W,j-=Y,N-=Z,_e=_e.next,y+=4;g+=p}for(f=0;f<p;f++){for(A=j=N=C=b=R=L=S=0,y=f<<2,T=$*(B=h[y]),F=$*(W=h[y+1]),I=$*(Y=h[y+2]),O=$*(Z=h[y+3]),S+=Q*B,b+=Q*W,R+=Q*Y,L+=Q*Z,ce=ee,E=0;E<$;E++)ce.r=B,ce.g=W,ce.b=Y,ce.a=Z,ce=ce.next;for(x=p,E=1;E<=c;E++)y=x+f<<2,S+=(ce.r=B=h[y])*(V=$-E),b+=(ce.g=W=h[y+1])*V,R+=(ce.b=Y=h[y+2])*V,L+=(ce.a=Z=h[y+3])*V,C+=B,A+=W,j+=Y,N+=Z,ce=ce.next,E<D&&(x+=p);for(y=f,me=ee,_e=se,_=0;_<v;_++)w=y<<2,h[w+3]=Z=L*te>>ae,Z>0?(Z=255/Z,h[w]=(S*te>>ae)*Z,h[w+1]=(b*te>>ae)*Z,h[w+2]=(R*te>>ae)*Z):h[w]=h[w+1]=h[w+2]=0,S-=T,b-=F,R-=I,L-=O,T-=me.r,F-=me.g,I-=me.b,O-=me.a,w=f+((w=_+$)<D?w:D)*p<<2,S+=C+=me.r=h[w],b+=A+=me.g=h[w+1],R+=j+=me.b=h[w+2],L+=N+=me.a=h[w+3],me=me.next,T+=B=_e.r,F+=W=_e.g,I+=Y=_e.b,O+=Z=_e.a,C-=B,A-=W,j-=Y,N-=Z,_e=_e.next,y+=p}}const s=function(c){const h=Math.round(this.blurRadius());h>0&&o(c,h)};return bd.Blur=s,e.Factory.addGetterSetter(r.Node,"blurRadius",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),bd}var wd={},E5;function tx(){if(E5)return wd;E5=1,Object.defineProperty(wd,"__esModule",{value:!0}),wd.Brighten=void 0;const e=Vr(),r=Ji(),t=Yr(),n=function(a){const i=this.brightness()*255,o=a.data,s=o.length;for(let u=0;u<s;u+=4)o[u]+=i,o[u+1]+=i,o[u+2]+=i};return wd.Brighten=n,e.Factory.addGetterSetter(r.Node,"brightness",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),wd}var _d={},P5;function rx(){if(P5)return _d;P5=1,Object.defineProperty(_d,"__esModule",{value:!0}),_d.Contrast=void 0;const e=Vr(),r=Ji(),t=Yr(),n=function(a){const i=Math.pow((this.contrast()+100)/100,2),o=a.data,s=o.length;let u=150,c=150,h=150;for(let p=0;p<s;p+=4)u=o[p],c=o[p+1],h=o[p+2],u/=255,u-=.5,u*=i,u+=.5,u*=255,c/=255,c-=.5,c*=i,c+=.5,c*=255,h/=255,h-=.5,h*=i,h+=.5,h*=255,u=u<0?0:u>255?255:u,c=c<0?0:c>255?255:c,h=h<0?0:h>255?255:h,o[p]=u,o[p+1]=c,o[p+2]=h};return _d.Contrast=n,e.Factory.addGetterSetter(r.Node,"contrast",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),_d}var Sd={},O5;function nx(){if(O5)return Sd;O5=1,Object.defineProperty(Sd,"__esModule",{value:!0}),Sd.Emboss=void 0;const e=Vr(),r=Ji(),t=Li(),n=Yr(),a=function(i){const o=this.embossStrength()*10,s=this.embossWhiteLevel()*255,u=this.embossDirection(),c=this.embossBlend(),h=i.data,p=i.width,v=i.height,f=p*4;let _=0,E=0,w=v;switch(u){case"top-left":_=-1,E=-1;break;case"top":_=-1,E=0;break;case"top-right":_=-1,E=1;break;case"right":_=0,E=1;break;case"bottom-right":_=1,E=1;break;case"bottom":_=1,E=0;break;case"bottom-left":_=1,E=-1;break;case"left":_=0,E=-1;break;default:t.Util.error("Unknown emboss direction: "+u)}do{const x=(w-1)*f;let y=_;w+y<1&&(y=0),w+y>v&&(y=0);const g=(w-1+y)*p*4;let S=p;do{const b=x+(S-1)*4;let R=E;S+R<1&&(R=0),S+R>p&&(R=0);const L=g+(S-1+R)*4,T=h[b]-h[L],F=h[b+1]-h[L+1],I=h[b+2]-h[L+2];let O=T;const C=O>0?O:-O,A=F>0?F:-F,j=I>0?I:-I;if(A>C&&(O=F),j>C&&(O=I),O*=o,c){const N=h[b]+O,B=h[b+1]+O,W=h[b+2]+O;h[b]=N>255?255:N<0?0:N,h[b+1]=B>255?255:B<0?0:B,h[b+2]=W>255?255:W<0?0:W}else{let N=s-O;N<0?N=0:N>255&&(N=255),h[b]=h[b+1]=h[b+2]=N}}while(--S)}while(--w)};return Sd.Emboss=a,e.Factory.addGetterSetter(r.Node,"embossStrength",.5,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"embossWhiteLevel",.5,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"embossDirection","top-left",void 0,e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"embossBlend",!1,void 0,e.Factory.afterSetFilter),Sd}var xd={},A5;function ix(){if(A5)return xd;A5=1,Object.defineProperty(xd,"__esModule",{value:!0}),xd.Enhance=void 0;const e=Vr(),r=Ji(),t=Yr();function n(i,o,s,u,c){const h=s-o,p=c-u;if(h===0)return u+p/2;if(p===0)return u;let v=(i-o)/h;return v=p*v+u,v}const a=function(i){const o=i.data,s=o.length;let u=o[0],c=u,h,p=o[1],v=p,f,_=o[2],E=_,w;const x=this.enhance();if(x===0)return;for(let O=0;O<s;O+=4)h=o[O+0],h<u?u=h:h>c&&(c=h),f=o[O+1],f<p?p=f:f>v&&(v=f),w=o[O+2],w<_?_=w:w>E&&(E=w);c===u&&(c=255,u=0),v===p&&(v=255,p=0),E===_&&(E=255,_=0);let y,g,S,b,R,L,T,F,I;x>0?(g=c+x*(255-c),S=u-x*(u-0),R=v+x*(255-v),L=p-x*(p-0),F=E+x*(255-E),I=_-x*(_-0)):(y=(c+u)*.5,g=c+x*(c-y),S=u+x*(u-y),b=(v+p)*.5,R=v+x*(v-b),L=p+x*(p-b),T=(E+_)*.5,F=E+x*(E-T),I=_+x*(_-T));for(let O=0;O<s;O+=4)o[O+0]=n(o[O+0],u,c,S,g),o[O+1]=n(o[O+1],p,v,L,R),o[O+2]=n(o[O+2],_,E,I,F)};return xd.Enhance=a,e.Factory.addGetterSetter(r.Node,"enhance",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),xd}var Ed={},C5;function ax(){if(C5)return Ed;C5=1,Object.defineProperty(Ed,"__esModule",{value:!0}),Ed.Grayscale=void 0;const e=function(r){const t=r.data,n=t.length;for(let a=0;a<n;a+=4){const i=.34*t[a]+.5*t[a+1]+.16*t[a+2];t[a]=i,t[a+1]=i,t[a+2]=i}};return Ed.Grayscale=e,Ed}var Pd={},k5;function ox(){if(k5)return Pd;k5=1,Object.defineProperty(Pd,"__esModule",{value:!0}),Pd.HSL=void 0;const e=Vr(),r=Ji(),t=Yr();e.Factory.addGetterSetter(r.Node,"hue",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"saturation",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"luminance",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter);const n=function(a){const i=a.data,o=i.length,s=1,u=Math.pow(2,this.saturation()),c=Math.abs(this.hue()+360)%360,h=this.luminance()*127,p=s*u*Math.cos(c*Math.PI/180),v=s*u*Math.sin(c*Math.PI/180),f=.299*s+.701*p+.167*v,_=.587*s-.587*p+.33*v,E=.114*s-.114*p-.497*v,w=.299*s-.299*p-.328*v,x=.587*s+.413*p+.035*v,y=.114*s-.114*p+.293*v,g=.299*s-.3*p+1.25*v,S=.587*s-.586*p-1.05*v,b=.114*s+.886*p-.2*v;let R,L,T,F;for(let I=0;I<o;I+=4)R=i[I+0],L=i[I+1],T=i[I+2],F=i[I+3],i[I+0]=f*R+_*L+E*T+h,i[I+1]=w*R+x*L+y*T+h,i[I+2]=g*R+S*L+b*T+h,i[I+3]=F};return Pd.HSL=n,Pd}var Od={},L5;function sx(){if(L5)return Od;L5=1,Object.defineProperty(Od,"__esModule",{value:!0}),Od.HSV=void 0;const e=Vr(),r=Ji(),t=Yr(),n=function(a){const i=a.data,o=i.length,s=Math.pow(2,this.value()),u=Math.pow(2,this.saturation()),c=Math.abs(this.hue()+360)%360,h=s*u*Math.cos(c*Math.PI/180),p=s*u*Math.sin(c*Math.PI/180),v=.299*s+.701*h+.167*p,f=.587*s-.587*h+.33*p,_=.114*s-.114*h-.497*p,E=.299*s-.299*h-.328*p,w=.587*s+.413*h+.035*p,x=.114*s-.114*h+.293*p,y=.299*s-.3*h+1.25*p,g=.587*s-.586*h-1.05*p,S=.114*s+.886*h-.2*p;let b,R,L,T;for(let F=0;F<o;F+=4)b=i[F+0],R=i[F+1],L=i[F+2],T=i[F+3],i[F+0]=v*b+f*R+_*L,i[F+1]=E*b+w*R+x*L,i[F+2]=y*b+g*R+S*L,i[F+3]=T};return Od.HSV=n,e.Factory.addGetterSetter(r.Node,"hue",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"saturation",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"value",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Od}var Ad={},N5;function lx(){if(N5)return Ad;N5=1,Object.defineProperty(Ad,"__esModule",{value:!0}),Ad.Invert=void 0;const e=function(r){const t=r.data,n=t.length;for(let a=0;a<n;a+=4)t[a]=255-t[a],t[a+1]=255-t[a+1],t[a+2]=255-t[a+2]};return Ad.Invert=e,Ad}var Cd={},T5;function ux(){if(T5)return Cd;T5=1,Object.defineProperty(Cd,"__esModule",{value:!0}),Cd.Kaleidoscope=void 0;const e=Vr(),r=Ji(),t=Li(),n=Yr(),a=function(s,u,c){const h=s.data,p=u.data,v=s.width,f=s.height,_=c.polarCenterX||v/2,E=c.polarCenterY||f/2;let w=Math.sqrt(_*_+E*E),x=v-_,y=f-E;const g=Math.sqrt(x*x+y*y);w=g>w?g:w;const S=f,b=v,R=360/b*Math.PI/180;for(let L=0;L<b;L+=1){const T=Math.sin(L*R),F=Math.cos(L*R);for(let I=0;I<S;I+=1){x=Math.floor(_+w*I/S*F),y=Math.floor(E+w*I/S*T);let O=(y*v+x)*4;const C=h[O+0],A=h[O+1],j=h[O+2],N=h[O+3];O=(L+I*v)*4,p[O+0]=C,p[O+1]=A,p[O+2]=j,p[O+3]=N}}},i=function(s,u,c){const h=s.data,p=u.data,v=s.width,f=s.height,_=c.polarCenterX||v/2,E=c.polarCenterY||f/2;let w=Math.sqrt(_*_+E*E),x=v-_,y=f-E;const g=Math.sqrt(x*x+y*y);w=g>w?g:w;const S=f,b=v,R=0;let L,T;for(x=0;x<v;x+=1)for(y=0;y<f;y+=1){const F=x-_,I=y-E,O=Math.sqrt(F*F+I*I)*S/w;let C=(Math.atan2(I,F)*180/Math.PI+360+R)%360;C=C*b/360,L=Math.floor(C),T=Math.floor(O);let A=(T*v+L)*4;const j=h[A+0],N=h[A+1],B=h[A+2],W=h[A+3];A=(y*v+x)*4,p[A+0]=j,p[A+1]=N,p[A+2]=B,p[A+3]=W}},o=function(s){const u=s.width,c=s.height;let h,p,v,f,_,E,w,x,y,g,S=Math.round(this.kaleidoscopePower());const b=Math.round(this.kaleidoscopeAngle()),R=Math.floor(u*(b%360)/360);if(S<1)return;const L=t.Util.createCanvasElement();L.width=u,L.height=c;const T=L.getContext("2d").getImageData(0,0,u,c);t.Util.releaseCanvas(L),a(s,T,{polarCenterX:u/2,polarCenterY:c/2});let F=u/Math.pow(2,S);for(;F<=8;)F=F*2,S-=1;F=Math.ceil(F);let I=F,O=0,C=I,A=1;for(R+F>u&&(O=I,C=0,A=-1),p=0;p<c;p+=1)for(h=O;h!==C;h+=A)v=Math.round(h+R)%u,y=(u*p+v)*4,_=T.data[y+0],E=T.data[y+1],w=T.data[y+2],x=T.data[y+3],g=(u*p+h)*4,T.data[g+0]=_,T.data[g+1]=E,T.data[g+2]=w,T.data[g+3]=x;for(p=0;p<c;p+=1)for(I=Math.floor(F),f=0;f<S;f+=1){for(h=0;h<I+1;h+=1)y=(u*p+h)*4,_=T.data[y+0],E=T.data[y+1],w=T.data[y+2],x=T.data[y+3],g=(u*p+I*2-h-1)*4,T.data[g+0]=_,T.data[g+1]=E,T.data[g+2]=w,T.data[g+3]=x;I*=2}i(T,s,{})};return Cd.Kaleidoscope=o,e.Factory.addGetterSetter(r.Node,"kaleidoscopePower",2,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"kaleidoscopeAngle",0,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),Cd}var kd={},R5;function cx(){if(R5)return kd;R5=1,Object.defineProperty(kd,"__esModule",{value:!0}),kd.Mask=void 0;const e=Vr(),r=Ji(),t=Yr();function n(v,f,_){let E=(_*v.width+f)*4;const w=[];return w.push(v.data[E++],v.data[E++],v.data[E++],v.data[E++]),w}function a(v,f){return Math.sqrt(Math.pow(v[0]-f[0],2)+Math.pow(v[1]-f[1],2)+Math.pow(v[2]-f[2],2))}function i(v){const f=[0,0,0];for(let _=0;_<v.length;_++)f[0]+=v[_][0],f[1]+=v[_][1],f[2]+=v[_][2];return f[0]/=v.length,f[1]/=v.length,f[2]/=v.length,f}function o(v,f){const _=n(v,0,0),E=n(v,v.width-1,0),w=n(v,0,v.height-1),x=n(v,v.width-1,v.height-1),y=f||10;if(a(_,E)<y&&a(E,x)<y&&a(x,w)<y&&a(w,_)<y){const g=i([E,_,x,w]),S=[];for(let b=0;b<v.width*v.height;b++){const R=a(g,[v.data[b*4],v.data[b*4+1],v.data[b*4+2]]);S[b]=R<y?0:255}return S}}function s(v,f){for(let _=0;_<v.width*v.height;_++)v.data[4*_+3]=f[_]}function u(v,f,_){const E=[1,1,1,1,0,1,1,1,1],w=Math.round(Math.sqrt(E.length)),x=Math.floor(w/2),y=[];for(let g=0;g<_;g++)for(let S=0;S<f;S++){const b=g*f+S;let R=0;for(let L=0;L<w;L++)for(let T=0;T<w;T++){const F=g+L-x,I=S+T-x;if(F>=0&&F<_&&I>=0&&I<f){const O=F*f+I,C=E[L*w+T];R+=v[O]*C}}y[b]=R===255*8?255:0}return y}function c(v,f,_){const E=[1,1,1,1,1,1,1,1,1],w=Math.round(Math.sqrt(E.length)),x=Math.floor(w/2),y=[];for(let g=0;g<_;g++)for(let S=0;S<f;S++){const b=g*f+S;let R=0;for(let L=0;L<w;L++)for(let T=0;T<w;T++){const F=g+L-x,I=S+T-x;if(F>=0&&F<_&&I>=0&&I<f){const O=F*f+I,C=E[L*w+T];R+=v[O]*C}}y[b]=R>=255*4?255:0}return y}function h(v,f,_){const E=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],w=Math.round(Math.sqrt(E.length)),x=Math.floor(w/2),y=[];for(let g=0;g<_;g++)for(let S=0;S<f;S++){const b=g*f+S;let R=0;for(let L=0;L<w;L++)for(let T=0;T<w;T++){const F=g+L-x,I=S+T-x;if(F>=0&&F<_&&I>=0&&I<f){const O=F*f+I,C=E[L*w+T];R+=v[O]*C}}y[b]=R}return y}const p=function(v){const f=this.threshold();let _=o(v,f);return _&&(_=u(_,v.width,v.height),_=c(_,v.width,v.height),_=h(_,v.width,v.height),s(v,_)),v};return kd.Mask=p,e.Factory.addGetterSetter(r.Node,"threshold",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),kd}var Ld={},M5;function fx(){if(M5)return Ld;M5=1,Object.defineProperty(Ld,"__esModule",{value:!0}),Ld.Noise=void 0;const e=Vr(),r=Ji(),t=Yr(),n=function(a){const i=this.noise()*255,o=a.data,s=o.length,u=i/2;for(let c=0;c<s;c+=4)o[c+0]+=u-2*u*Math.random(),o[c+1]+=u-2*u*Math.random(),o[c+2]+=u-2*u*Math.random()};return Ld.Noise=n,e.Factory.addGetterSetter(r.Node,"noise",.2,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Ld}var Nd={},I5;function hx(){if(I5)return Nd;I5=1,Object.defineProperty(Nd,"__esModule",{value:!0}),Nd.Pixelate=void 0;const e=Vr(),r=Li(),t=Ji(),n=Yr(),a=function(i){let o=Math.ceil(this.pixelSize()),s=i.width,u=i.height,c,h,p,v,f,_,E,w=Math.ceil(s/o),x=Math.ceil(u/o),y,g,S,b,R,L,T,F=i.data;if(o<=0){r.Util.error("pixelSize value can not be <= 0");return}for(R=0;R<w;R+=1)for(L=0;L<x;L+=1){for(v=0,f=0,_=0,E=0,y=R*o,g=y+o,S=L*o,b=S+o,T=0,c=y;c<g;c+=1)if(!(c>=s))for(h=S;h<b;h+=1)h>=u||(p=(s*h+c)*4,v+=F[p+0],f+=F[p+1],_+=F[p+2],E+=F[p+3],T+=1);for(v=v/T,f=f/T,_=_/T,E=E/T,c=y;c<g;c+=1)if(!(c>=s))for(h=S;h<b;h+=1)h>=u||(p=(s*h+c)*4,F[p+0]=v,F[p+1]=f,F[p+2]=_,F[p+3]=E)}};return Nd.Pixelate=a,e.Factory.addGetterSetter(t.Node,"pixelSize",8,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),Nd}var Td={},j5;function dx(){if(j5)return Td;j5=1,Object.defineProperty(Td,"__esModule",{value:!0}),Td.Posterize=void 0;const e=Vr(),r=Ji(),t=Yr(),n=function(a){const i=Math.round(this.levels()*254)+1,o=a.data,s=o.length,u=255/i;for(let c=0;c<s;c+=1)o[c]=Math.floor(o[c]/u)*u};return Td.Posterize=n,e.Factory.addGetterSetter(r.Node,"levels",.5,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Td}var Rd={},F5;function px(){if(F5)return Rd;F5=1,Object.defineProperty(Rd,"__esModule",{value:!0}),Rd.RGB=void 0;const e=Vr(),r=Ji(),t=Yr(),n=function(a){const i=a.data,o=i.length,s=this.red(),u=this.green(),c=this.blue();for(let h=0;h<o;h+=4){const p=(.34*i[h]+.5*i[h+1]+.16*i[h+2])/255;i[h]=p*s,i[h+1]=p*u,i[h+2]=p*c,i[h+3]=i[h+3]}};return Rd.RGB=n,e.Factory.addGetterSetter(r.Node,"red",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(r.Node,"green",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(r.Node,"blue",0,t.RGBComponent,e.Factory.afterSetFilter),Rd}var Md={},D5;function gx(){if(D5)return Md;D5=1,Object.defineProperty(Md,"__esModule",{value:!0}),Md.RGBA=void 0;const e=Vr(),r=Ji(),t=Yr(),n=function(a){const i=a.data,o=i.length,s=this.red(),u=this.green(),c=this.blue(),h=this.alpha();for(let p=0;p<o;p+=4){const v=1-h;i[p]=s*h+i[p]*v,i[p+1]=u*h+i[p+1]*v,i[p+2]=c*h+i[p+2]*v}};return Md.RGBA=n,e.Factory.addGetterSetter(r.Node,"red",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(r.Node,"green",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(r.Node,"blue",0,t.RGBComponent,e.Factory.afterSetFilter),e.Factory.addGetterSetter(r.Node,"alpha",1,function(a){return this._filterUpToDate=!1,a>1?1:a<0?0:a}),Md}var Id={},B5;function vx(){if(B5)return Id;B5=1,Object.defineProperty(Id,"__esModule",{value:!0}),Id.Sepia=void 0;const e=function(r){const t=r.data,n=t.length;for(let a=0;a<n;a+=4){const i=t[a+0],o=t[a+1],s=t[a+2];t[a+0]=Math.min(255,i*.393+o*.769+s*.189),t[a+1]=Math.min(255,i*.349+o*.686+s*.168),t[a+2]=Math.min(255,i*.272+o*.534+s*.131)}};return Id.Sepia=e,Id}var jd={},q5;function mx(){if(q5)return jd;q5=1,Object.defineProperty(jd,"__esModule",{value:!0}),jd.Solarize=void 0;const e=function(r){const t=r.data,n=r.width,a=r.height,i=n*4;let o=a;do{const s=(o-1)*i;let u=n;do{const c=s+(u-1)*4;let h=t[c],p=t[c+1],v=t[c+2];h>127&&(h=255-h),p>127&&(p=255-p),v>127&&(v=255-v),t[c]=h,t[c+1]=p,t[c+2]=v}while(--u)}while(--o)};return jd.Solarize=e,jd}var Fd={},z5;function yx(){if(z5)return Fd;z5=1,Object.defineProperty(Fd,"__esModule",{value:!0}),Fd.Threshold=void 0;const e=Vr(),r=Ji(),t=Yr(),n=function(a){const i=this.threshold()*255,o=a.data,s=o.length;for(let u=0;u<s;u+=1)o[u]=o[u]<i?0:255};return Fd.Threshold=n,e.Factory.addGetterSetter(r.Node,"threshold",.5,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Fd}var U5;function bx(){if(U5)return Zh;U5=1,Object.defineProperty(Zh,"__esModule",{value:!0}),Zh.Konva=void 0;const e=x2(),r=qS(),t=US(),n=HS(),a=GS(),i=VS(),o=WS(),s=O6(),u=cm(),c=A6(),h=$S(),p=YS(),v=XS(),f=KS(),_=C6(),E=ZS(),w=QS(),x=JS(),y=ex(),g=tx(),S=rx(),b=nx(),R=ix(),L=ax(),T=ox(),F=sx(),I=lx(),O=ux(),C=cx(),A=fx(),j=hx(),N=dx(),B=px(),W=gx(),Y=vx(),Z=mx(),V=yx();return Zh.Konva=e.Konva.Util._assign(e.Konva,{Arc:r.Arc,Arrow:t.Arrow,Circle:n.Circle,Ellipse:a.Ellipse,Image:i.Image,Label:o.Label,Tag:o.Tag,Line:s.Line,Path:u.Path,Rect:c.Rect,RegularPolygon:h.RegularPolygon,Ring:p.Ring,Sprite:v.Sprite,Star:f.Star,Text:_.Text,TextPath:E.TextPath,Transformer:w.Transformer,Wedge:x.Wedge,Filters:{Blur:y.Blur,Brighten:g.Brighten,Contrast:S.Contrast,Emboss:b.Emboss,Enhance:R.Enhance,Grayscale:L.Grayscale,HSL:T.HSL,HSV:F.HSV,Invert:I.Invert,Kaleidoscope:O.Kaleidoscope,Mask:C.Mask,Noise:A.Noise,Pixelate:j.Pixelate,Posterize:N.Posterize,RGB:B.RGB,RGBA:W.RGBA,Sepia:Y.Sepia,Solarize:Z.Solarize,Threshold:V.Threshold}}),Zh}var wx=m1.exports,H5;function Hs(){if(H5)return m1.exports;H5=1,Object.defineProperty(wx,"__esModule",{value:!0});const e=bx();return m1.exports=e.Konva,m1.exports}Hs();var s1={exports:{}},G5;function _x(){return G5||(G5=1,function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Konva=void 0;var t=x2();Object.defineProperty(r,"Konva",{enumerable:!0,get:function(){return t.Konva}});const n=x2();e.exports=n.Konva}(s1,s1.exports)),s1.exports}var Sx=_x();const dp=yp(Sx);var og={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 sg,V5;function xx(){return V5||(V5=1,sg=function(r){var t={},n=ai(),a=B2(),i=Object.assign;function o(m){for(var P="https://reactjs.org/docs/error-decoder.html?invariant="+m,q=1;q<arguments.length;q++)P+="&args[]="+encodeURIComponent(arguments[q]);return"Minified React error #"+m+"; visit "+P+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),c=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),_=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),b=Symbol.iterator;function R(m){return m===null||typeof m!="object"?null:(m=b&&m[b]||m["@@iterator"],typeof m=="function"?m:null)}function L(m){if(m==null)return null;if(typeof m=="function")return m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case h:return"Fragment";case c:return"Portal";case v:return"Profiler";case p:return"StrictMode";case w:return"Suspense";case x:return"SuspenseList"}if(typeof m=="object")switch(m.$$typeof){case _:return(m.displayName||"Context")+".Consumer";case f:return(m._context.displayName||"Context")+".Provider";case E:var P=m.render;return m=m.displayName,m||(m=P.displayName||P.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case y:return P=m.displayName||null,P!==null?P:L(m.type)||"Memo";case g:P=m._payload,m=m._init;try{return L(m(P))}catch{}}return null}function T(m){var P=m.type;switch(m.tag){case 24:return"Cache";case 9:return(P.displayName||"Context")+".Consumer";case 10:return(P._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return m=P.render,m=m.displayName||m.name||"",P.displayName||(m!==""?"ForwardRef("+m+")":"ForwardRef");case 7:return"Fragment";case 5:return P;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return L(P);case 8:return P===p?"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 P=="function")return P.displayName||P.name||null;if(typeof P=="string")return P}return null}function F(m){var P=m,q=m;if(m.alternate)for(;P.return;)P=P.return;else{m=P;do P=m,(P.flags&4098)!==0&&(q=P.return),m=P.return;while(m)}return P.tag===3?q:null}function I(m){if(F(m)!==m)throw Error(o(188))}function O(m){var P=m.alternate;if(!P){if(P=F(m),P===null)throw Error(o(188));return P!==m?null:m}for(var q=m,K=P;;){var ne=q.return;if(ne===null)break;var le=ne.alternate;if(le===null){if(K=ne.return,K!==null){q=K;continue}break}if(ne.child===le.child){for(le=ne.child;le;){if(le===q)return I(ne),m;if(le===K)return I(ne),P;le=le.sibling}throw Error(o(188))}if(q.return!==K.return)q=ne,K=le;else{for(var xe=!1,$e=ne.child;$e;){if($e===q){xe=!0,q=ne,K=le;break}if($e===K){xe=!0,K=ne,q=le;break}$e=$e.sibling}if(!xe){for($e=le.child;$e;){if($e===q){xe=!0,q=le,K=ne;break}if($e===K){xe=!0,K=le,q=ne;break}$e=$e.sibling}if(!xe)throw Error(o(189))}}if(q.alternate!==K)throw Error(o(190))}if(q.tag!==3)throw Error(o(188));return q.stateNode.current===q?m:P}function C(m){return m=O(m),m!==null?A(m):null}function A(m){if(m.tag===5||m.tag===6)return m;for(m=m.child;m!==null;){var P=A(m);if(P!==null)return P;m=m.sibling}return null}function j(m){if(m.tag===5||m.tag===6)return m;for(m=m.child;m!==null;){if(m.tag!==4){var P=j(m);if(P!==null)return P}m=m.sibling}return null}var N=Array.isArray,B=r.getPublicInstance,W=r.getRootHostContext,Y=r.getChildHostContext,Z=r.prepareForCommit,V=r.resetAfterCommit,H=r.createInstance,U=r.appendInitialChild,D=r.finalizeInitialChildren,$=r.prepareUpdate,Q=r.shouldSetTextContent,ee=r.createTextInstance,te=r.scheduleTimeout,ae=r.cancelTimeout,se=r.noTimeout,ce=r.isPrimaryRenderer,me=r.supportsMutation,_e=r.supportsPersistence,Le=r.supportsHydration,Re=r.getInstanceFromNode,Pe=r.preparePortalMount,ve=r.getCurrentEventPriority,it=r.detachDeletedInstance,Se=r.supportsMicrotasks,be=r.scheduleMicrotask,Ae=r.supportsTestSelectors,Te=r.findFiberRoot,he=r.getBoundingRect,Oe=r.getTextContent,Me=r.isHiddenSubtree,ze=r.matchAccessibilityRole,pt=r.setFocusIfFocusable,yt=r.setupIntersectionObserver,He=r.appendChild,Qe=r.appendChildToContainer,Ze=r.commitTextUpdate,tt=r.commitMount,Ht=r.commitUpdate,Pt=r.insertBefore,It=r.insertInContainerBefore,qt=r.removeChild,Ie=r.removeChildFromContainer,ke=r.resetTextContent,ut=r.hideInstance,Nt=r.hideTextInstance,Ct=r.unhideInstance,St=r.unhideTextInstance,Jt=r.clearContainer,nr=r.cloneInstance,Tt=r.createContainerChildSet,Xt=r.appendChildToContainerChildSet,Rr=r.finalizeContainerChildren,Je=r.replaceContainerChildren,mt=r.cloneHiddenInstance,Gt=r.cloneHiddenTextInstance,bt=r.canHydrateInstance,Kt=r.canHydrateTextInstance,Yt=r.canHydrateSuspenseInstance,ct=r.isSuspenseInstancePending,_t=r.isSuspenseInstanceFallback,xt=r.getSuspenseInstanceFallbackErrorDetails,rt=r.registerSuspenseInstanceRetry,zt=r.getNextHydratableSibling,gt=r.getFirstHydratableChild,Ft=r.getFirstHydratableChildWithinContainer,br=r.getFirstHydratableChildWithinSuspenseInstance,hr=r.hydrateInstance,Qr=r.hydrateTextInstance,Sn=r.hydrateSuspenseInstance,Ni=r.getNextHydratableInstanceAfterSuspenseInstance,Si=r.commitHydratedContainer,fa=r.commitHydratedSuspenseInstance,_s=r.clearSuspenseBoundary,Vo=r.clearSuspenseBoundaryFromContainer,tu=r.shouldDeleteUnhydratedTailInstances,mc=r.didNotMatchHydratedContainerTextInstance,Fn=r.didNotMatchHydratedTextInstance,Bu;function oo(m){if(Bu===void 0)try{throw Error()}catch(q){var P=q.stack.trim().match(/\n( *(at )?)/);Bu=P&&P[1]||""}return`
|
|
52
|
-
`+Bu+m}var dl=!1;function Gs(m,P){if(!m||dl)return"";dl=!0;var q=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(P)if(P=function(){throw Error()},Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(Lt){var K=Lt}Reflect.construct(m,[],P)}else{try{P.call()}catch(Lt){K=Lt}m.call(P.prototype)}else{try{throw Error()}catch(Lt){K=Lt}m()}}catch(Lt){if(Lt&&K&&typeof Lt.stack=="string"){for(var ne=Lt.stack.split(`
|
|
53
|
-
`),le=K.stack.split(`
|
|
54
|
-
`),xe=ne.length-1,$e=le.length-1;1<=xe&&0<=$e&&ne[xe]!==le[$e];)$e--;for(;1<=xe&&0<=$e;xe--,$e--)if(ne[xe]!==le[$e]){if(xe!==1||$e!==1)do if(xe--,$e--,0>$e||ne[xe]!==le[$e]){var lt=`
|
|
55
|
-
`+ne[xe].replace(" at new "," at ");return m.displayName&<.includes("<anonymous>")&&(lt=lt.replace("<anonymous>",m.displayName)),lt}while(1<=xe&&0<=$e);break}}}finally{dl=!1,Error.prepareStackTrace=q}return(m=m?m.displayName||m.name:"")?oo(m):""}var qu=Object.prototype.hasOwnProperty,ru=[],so=-1;function gi(m){return{current:m}}function Jr(m){0>so||(m.current=ru[so],ru[so]=null,so--)}function Nr(m,P){so++,ru[so]=m.current,m.current=P}var cn={},vi=gi(cn),Ti=gi(!1),Ia=cn;function ja(m,P){var q=m.type.contextTypes;if(!q)return cn;var K=m.stateNode;if(K&&K.__reactInternalMemoizedUnmaskedChildContext===P)return K.__reactInternalMemoizedMaskedChildContext;var ne={},le;for(le in q)ne[le]=P[le];return K&&(m=m.stateNode,m.__reactInternalMemoizedUnmaskedChildContext=P,m.__reactInternalMemoizedMaskedChildContext=ne),ne}function oi(m){return m=m.childContextTypes,m!=null}function Ri(){Jr(Ti),Jr(vi)}function pl(m,P,q){if(vi.current!==cn)throw Error(o(168));Nr(vi,P),Nr(Ti,q)}function ha(m,P,q){var K=m.stateNode;if(P=P.childContextTypes,typeof K.getChildContext!="function")return q;K=K.getChildContext();for(var ne in K)if(!(ne in P))throw Error(o(108,T(m)||"Unknown",ne));return i({},q,K)}function Wo(m){return m=(m=m.stateNode)&&m.__reactInternalMemoizedMergedChildContext||cn,Ia=vi.current,Nr(vi,m),Nr(Ti,Ti.current),!0}function nu(m,P,q){var K=m.stateNode;if(!K)throw Error(o(169));q?(m=ha(m,P,Ia),K.__reactInternalMemoizedMergedChildContext=m,Jr(Ti),Jr(vi),Nr(vi,m)):Jr(Ti),Nr(Ti,q)}var da=Math.clz32?Math.clz32:iu,Vs=Math.log,af=Math.LN2;function iu(m){return m>>>=0,m===0?32:31-(Vs(m)/af|0)|0}var Fr=64,Ss=4194304;function Ws(m){switch(m&-m){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 m&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return m&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return m}}function $s(m,P){var q=m.pendingLanes;if(q===0)return 0;var K=0,ne=m.suspendedLanes,le=m.pingedLanes,xe=q&268435455;if(xe!==0){var $e=xe&~ne;$e!==0?K=Ws($e):(le&=xe,le!==0&&(K=Ws(le)))}else xe=q&~ne,xe!==0?K=Ws(xe):le!==0&&(K=Ws(le));if(K===0)return 0;if(P!==0&&P!==K&&(P&ne)===0&&(ne=K&-K,le=P&-P,ne>=le||ne===16&&(le&4194240)!==0))return P;if((K&4)!==0&&(K|=q&16),P=m.entangledLanes,P!==0)for(m=m.entanglements,P&=K;0<P;)q=31-da(P),ne=1<<q,K|=m[q],P&=~ne;return K}function yc(m,P){switch(m){case 1:case 2:case 4:return P+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 P+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 $o(m,P){for(var q=m.suspendedLanes,K=m.pingedLanes,ne=m.expirationTimes,le=m.pendingLanes;0<le;){var xe=31-da(le),$e=1<<xe,lt=ne[xe];lt===-1?(($e&q)===0||($e&K)!==0)&&(ne[xe]=yc($e,P)):lt<=P&&(m.expiredLanes|=$e),le&=~$e}}function xs(m){return m=m.pendingLanes&-1073741825,m!==0?m:m&1073741824?1073741824:0}function Es(){var m=Fr;return Fr<<=1,(Fr&4194240)===0&&(Fr=64),m}function Ps(m){for(var P=[],q=0;31>q;q++)P.push(m);return P}function mn(m,P,q){m.pendingLanes|=P,P!==536870912&&(m.suspendedLanes=0,m.pingedLanes=0),m=m.eventTimes,P=31-da(P),m[P]=q}function Yo(m,P){var q=m.pendingLanes&~P;m.pendingLanes=P,m.suspendedLanes=0,m.pingedLanes=0,m.expiredLanes&=P,m.mutableReadLanes&=P,m.entangledLanes&=P,P=m.entanglements;var K=m.eventTimes;for(m=m.expirationTimes;0<q;){var ne=31-da(q),le=1<<ne;P[ne]=0,K[ne]=-1,m[ne]=-1,q&=~le}}function Fa(m,P){var q=m.entangledLanes|=P;for(m=m.entanglements;q;){var K=31-da(q),ne=1<<K;ne&P|m[K]&P&&(m[K]|=P),q&=~ne}}var Dt=0;function Ys(m){return m&=-m,1<m?4<m?(m&268435455)!==0?16:536870912:4:1}var lo=a.unstable_scheduleCallback,Oo=a.unstable_cancelCallback,zu=a.unstable_shouldYield,Xs=a.unstable_requestPaint,Dn=a.unstable_now,Ks=a.unstable_ImmediatePriority,au=a.unstable_UserBlockingPriority,ou=a.unstable_NormalPriority,of=a.unstable_IdlePriority,uo=null,si=null;function Da(m){if(si&&typeof si.onCommitFiberRoot=="function")try{si.onCommitFiberRoot(uo,m,void 0,(m.current.flags&128)===128)}catch{}}function su(m,P){return m===P&&(m!==0||1/m===1/P)||m!==m&&P!==P}var Mi=typeof Object.is=="function"?Object.is:su,Ba=null,Ao=!1,Os=!1;function gl(m){Ba===null?Ba=[m]:Ba.push(m)}function Uu(m){Ao=!0,gl(m)}function li(){if(!Os&&Ba!==null){Os=!0;var m=0,P=Dt;try{var q=Ba;for(Dt=1;m<q.length;m++){var K=q[m];do K=K(!0);while(K!==null)}Ba=null,Ao=!1}catch(ne){throw Ba!==null&&(Ba=Ba.slice(m+1)),lo(Ks,li),ne}finally{Dt=P,Os=!1}}return null}var Ii=[],ji=0,vl=null,xa=0,xn=[],Fi=0,En=null,ea=1,ta="";function qa(m,P){Ii[ji++]=xa,Ii[ji++]=vl,vl=m,xa=P}function lu(m,P,q){xn[Fi++]=ea,xn[Fi++]=ta,xn[Fi++]=En,En=m;var K=ea;m=ta;var ne=32-da(K)-1;K&=~(1<<ne),q+=1;var le=32-da(P)+ne;if(30<le){var xe=ne-ne%5;le=(K&(1<<xe)-1).toString(32),K>>=xe,ne-=xe,ea=1<<32-da(P)+ne|q<<ne|K,ta=le+m}else ea=1<<le|q<<ne|K,ta=m}function As(m){m.return!==null&&(qa(m,1),lu(m,1,0))}function Zs(m){for(;m===vl;)vl=Ii[--ji],Ii[ji]=null,xa=Ii[--ji],Ii[ji]=null;for(;m===En;)En=xn[--Fi],xn[Fi]=null,ta=xn[--Fi],xn[Fi]=null,ea=xn[--Fi],xn[Fi]=null}var Xn=null,mi=null,nn=!1,Qs=!1,za=null;function ml(m,P){var q=Uo(5,null,null,0);q.elementType="DELETED",q.stateNode=P,q.return=m,P=m.deletions,P===null?(m.deletions=[q],m.flags|=16):P.push(q)}function Xo(m,P){switch(m.tag){case 5:return P=bt(P,m.type,m.pendingProps),P!==null?(m.stateNode=P,Xn=m,mi=gt(P),!0):!1;case 6:return P=Kt(P,m.pendingProps),P!==null?(m.stateNode=P,Xn=m,mi=null,!0):!1;case 13:if(P=Yt(P),P!==null){var q=En!==null?{id:ea,overflow:ta}:null;return m.memoizedState={dehydrated:P,treeContext:q,retryLane:1073741824},q=Uo(18,null,null,0),q.stateNode=P,q.return=m,m.child=q,Xn=m,mi=null,!0}return!1;default:return!1}}function yl(m){return(m.mode&1)!==0&&(m.flags&128)===0}function Ko(m){if(nn){var P=mi;if(P){var q=P;if(!Xo(m,P)){if(yl(m))throw Error(o(418));P=zt(q);var K=Xn;P&&Xo(m,P)?ml(K,q):(m.flags=m.flags&-4097|2,nn=!1,Xn=m)}}else{if(yl(m))throw Error(o(418));m.flags=m.flags&-4097|2,nn=!1,Xn=m}}}function uu(m){for(m=m.return;m!==null&&m.tag!==5&&m.tag!==3&&m.tag!==13;)m=m.return;Xn=m}function X(m){if(!Le||m!==Xn)return!1;if(!nn)return uu(m),nn=!0,!1;if(m.tag!==3&&(m.tag!==5||tu(m.type)&&!Q(m.type,m.memoizedProps))){var P=mi;if(P){if(yl(m))throw fe(),Error(o(418));for(;P;)ml(m,P),P=zt(P)}}if(uu(m),m.tag===13){if(!Le)throw Error(o(316));if(m=m.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(o(317));mi=Ni(m)}else mi=Xn?zt(m.stateNode):null;return!0}function fe(){for(var m=mi;m;)m=zt(m)}function Ce(){Le&&(mi=Xn=null,Qs=nn=!1)}function Fe(m){za===null?za=[m]:za.push(m)}var Ke=s.ReactCurrentBatchConfig;function ht(m,P){if(Mi(m,P))return!0;if(typeof m!="object"||m===null||typeof P!="object"||P===null)return!1;var q=Object.keys(m),K=Object.keys(P);if(q.length!==K.length)return!1;for(K=0;K<q.length;K++){var ne=q[K];if(!qu.call(P,ne)||!Mi(m[ne],P[ne]))return!1}return!0}function Et(m){switch(m.tag){case 5:return oo(m.type);case 16:return oo("Lazy");case 13:return oo("Suspense");case 19:return oo("SuspenseList");case 0:case 2:case 15:return m=Gs(m.type,!1),m;case 11:return m=Gs(m.type.render,!1),m;case 1:return m=Gs(m.type,!0),m;default:return""}}function Ut(m,P,q){if(m=q.ref,m!==null&&typeof m!="function"&&typeof m!="object"){if(q._owner){if(q=q._owner,q){if(q.tag!==1)throw Error(o(309));var K=q.stateNode}if(!K)throw Error(o(147,m));var ne=K,le=""+m;return P!==null&&P.ref!==null&&typeof P.ref=="function"&&P.ref._stringRef===le?P.ref:(P=function(xe){var $e=ne.refs;xe===null?delete $e[le]:$e[le]=xe},P._stringRef=le,P)}if(typeof m!="string")throw Error(o(284));if(!q._owner)throw Error(o(290,m))}return m}function sr(m,P){throw m=Object.prototype.toString.call(P),Error(o(31,m==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":m))}function wr(m){var P=m._init;return P(m._payload)}function mr(m){function P(at,Ye){if(m){var dt=at.deletions;dt===null?(at.deletions=[Ye],at.flags|=16):dt.push(Ye)}}function q(at,Ye){if(!m)return null;for(;Ye!==null;)P(at,Ye),Ye=Ye.sibling;return null}function K(at,Ye){for(at=new Map;Ye!==null;)Ye.key!==null?at.set(Ye.key,Ye):at.set(Ye.index,Ye),Ye=Ye.sibling;return at}function ne(at,Ye){return at=Eu(at,Ye),at.index=0,at.sibling=null,at}function le(at,Ye,dt){return at.index=dt,m?(dt=at.alternate,dt!==null?(dt=dt.index,dt<Ye?(at.flags|=2,Ye):dt):(at.flags|=2,Ye)):(at.flags|=1048576,Ye)}function xe(at){return m&&at.alternate===null&&(at.flags|=2),at}function $e(at,Ye,dt,$t){return Ye===null||Ye.tag!==6?(Ye=kc(dt,at.mode,$t),Ye.return=at,Ye):(Ye=ne(Ye,dt),Ye.return=at,Ye)}function lt(at,Ye,dt,$t){var dr=dt.type;return dr===h?er(at,Ye,dt.props.children,$t,dt.key):Ye!==null&&(Ye.elementType===dr||typeof dr=="object"&&dr!==null&&dr.$$typeof===g&&wr(dr)===Ye.type)?($t=ne(Ye,dt.props),$t.ref=Ut(at,Ye,dt),$t.return=at,$t):($t=$f(dt.type,dt.key,dt.props,null,at.mode,$t),$t.ref=Ut(at,Ye,dt),$t.return=at,$t)}function Lt(at,Ye,dt,$t){return Ye===null||Ye.tag!==4||Ye.stateNode.containerInfo!==dt.containerInfo||Ye.stateNode.implementation!==dt.implementation?(Ye=Yf(dt,at.mode,$t),Ye.return=at,Ye):(Ye=ne(Ye,dt.children||[]),Ye.return=at,Ye)}function er(at,Ye,dt,$t,dr){return Ye===null||Ye.tag!==7?(Ye=ma(dt,at.mode,$t,dr),Ye.return=at,Ye):(Ye=ne(Ye,dt),Ye.return=at,Ye)}function Er(at,Ye,dt){if(typeof Ye=="string"&&Ye!==""||typeof Ye=="number")return Ye=kc(""+Ye,at.mode,dt),Ye.return=at,Ye;if(typeof Ye=="object"&&Ye!==null){switch(Ye.$$typeof){case u:return dt=$f(Ye.type,Ye.key,Ye.props,null,at.mode,dt),dt.ref=Ut(at,null,Ye),dt.return=at,dt;case c:return Ye=Yf(Ye,at.mode,dt),Ye.return=at,Ye;case g:var $t=Ye._init;return Er(at,$t(Ye._payload),dt)}if(N(Ye)||R(Ye))return Ye=ma(Ye,at.mode,dt,null),Ye.return=at,Ye;sr(at,Ye)}return null}function Wt(at,Ye,dt,$t){var dr=Ye!==null?Ye.key:null;if(typeof dt=="string"&&dt!==""||typeof dt=="number")return dr!==null?null:$e(at,Ye,""+dt,$t);if(typeof dt=="object"&&dt!==null){switch(dt.$$typeof){case u:return dt.key===dr?lt(at,Ye,dt,$t):null;case c:return dt.key===dr?Lt(at,Ye,dt,$t):null;case g:return dr=dt._init,Wt(at,Ye,dr(dt._payload),$t)}if(N(dt)||R(dt))return dr!==null?null:er(at,Ye,dt,$t,null);sr(at,dt)}return null}function In(at,Ye,dt,$t,dr){if(typeof $t=="string"&&$t!==""||typeof $t=="number")return at=at.get(dt)||null,$e(Ye,at,""+$t,dr);if(typeof $t=="object"&&$t!==null){switch($t.$$typeof){case u:return at=at.get($t.key===null?dt:$t.key)||null,lt(Ye,at,$t,dr);case c:return at=at.get($t.key===null?dt:$t.key)||null,Lt(Ye,at,$t,dr);case g:var Tr=$t._init;return In(at,Ye,dt,Tr($t._payload),dr)}if(N($t)||R($t))return at=at.get(dt)||null,er(Ye,at,$t,dr,null);sr(Ye,$t)}return null}function bn(at,Ye,dt,$t){for(var dr=null,Tr=null,Pr=Ye,Wr=Ye=0,$i=null;Pr!==null&&Wr<dt.length;Wr++){Pr.index>Wr?($i=Pr,Pr=null):$i=Pr.sibling;var Gr=Wt(at,Pr,dt[Wr],$t);if(Gr===null){Pr===null&&(Pr=$i);break}m&&Pr&&Gr.alternate===null&&P(at,Pr),Ye=le(Gr,Ye,Wr),Tr===null?dr=Gr:Tr.sibling=Gr,Tr=Gr,Pr=$i}if(Wr===dt.length)return q(at,Pr),nn&&qa(at,Wr),dr;if(Pr===null){for(;Wr<dt.length;Wr++)Pr=Er(at,dt[Wr],$t),Pr!==null&&(Ye=le(Pr,Ye,Wr),Tr===null?dr=Pr:Tr.sibling=Pr,Tr=Pr);return nn&&qa(at,Wr),dr}for(Pr=K(at,Pr);Wr<dt.length;Wr++)$i=In(Pr,at,Wr,dt[Wr],$t),$i!==null&&(m&&$i.alternate!==null&&Pr.delete($i.key===null?Wr:$i.key),Ye=le($i,Ye,Wr),Tr===null?dr=$i:Tr.sibling=$i,Tr=$i);return m&&Pr.forEach(function(ka){return P(at,ka)}),nn&&qa(at,Wr),dr}function to(at,Ye,dt,$t){var dr=R(dt);if(typeof dr!="function")throw Error(o(150));if(dt=dr.call(dt),dt==null)throw Error(o(151));for(var Tr=dr=null,Pr=Ye,Wr=Ye=0,$i=null,Gr=dt.next();Pr!==null&&!Gr.done;Wr++,Gr=dt.next()){Pr.index>Wr?($i=Pr,Pr=null):$i=Pr.sibling;var ka=Wt(at,Pr,Gr.value,$t);if(ka===null){Pr===null&&(Pr=$i);break}m&&Pr&&ka.alternate===null&&P(at,Pr),Ye=le(ka,Ye,Wr),Tr===null?dr=ka:Tr.sibling=ka,Tr=ka,Pr=$i}if(Gr.done)return q(at,Pr),nn&&qa(at,Wr),dr;if(Pr===null){for(;!Gr.done;Wr++,Gr=dt.next())Gr=Er(at,Gr.value,$t),Gr!==null&&(Ye=le(Gr,Ye,Wr),Tr===null?dr=Gr:Tr.sibling=Gr,Tr=Gr);return nn&&qa(at,Wr),dr}for(Pr=K(at,Pr);!Gr.done;Wr++,Gr=dt.next())Gr=In(Pr,at,Wr,Gr.value,$t),Gr!==null&&(m&&Gr.alternate!==null&&Pr.delete(Gr.key===null?Wr:Gr.key),Ye=le(Gr,Ye,Wr),Tr===null?dr=Gr:Tr.sibling=Gr,Tr=Gr);return m&&Pr.forEach(function(v0){return P(at,v0)}),nn&&qa(at,Wr),dr}function sl(at,Ye,dt,$t){if(typeof dt=="object"&&dt!==null&&dt.type===h&&dt.key===null&&(dt=dt.props.children),typeof dt=="object"&&dt!==null){switch(dt.$$typeof){case u:e:{for(var dr=dt.key,Tr=Ye;Tr!==null;){if(Tr.key===dr){if(dr=dt.type,dr===h){if(Tr.tag===7){q(at,Tr.sibling),Ye=ne(Tr,dt.props.children),Ye.return=at,at=Ye;break e}}else if(Tr.elementType===dr||typeof dr=="object"&&dr!==null&&dr.$$typeof===g&&wr(dr)===Tr.type){q(at,Tr.sibling),Ye=ne(Tr,dt.props),Ye.ref=Ut(at,Tr,dt),Ye.return=at,at=Ye;break e}q(at,Tr);break}else P(at,Tr);Tr=Tr.sibling}dt.type===h?(Ye=ma(dt.props.children,at.mode,$t,dt.key),Ye.return=at,at=Ye):($t=$f(dt.type,dt.key,dt.props,null,at.mode,$t),$t.ref=Ut(at,Ye,dt),$t.return=at,at=$t)}return xe(at);case c:e:{for(Tr=dt.key;Ye!==null;){if(Ye.key===Tr)if(Ye.tag===4&&Ye.stateNode.containerInfo===dt.containerInfo&&Ye.stateNode.implementation===dt.implementation){q(at,Ye.sibling),Ye=ne(Ye,dt.children||[]),Ye.return=at,at=Ye;break e}else{q(at,Ye);break}else P(at,Ye);Ye=Ye.sibling}Ye=Yf(dt,at.mode,$t),Ye.return=at,at=Ye}return xe(at);case g:return Tr=dt._init,sl(at,Ye,Tr(dt._payload),$t)}if(N(dt))return bn(at,Ye,dt,$t);if(R(dt))return to(at,Ye,dt,$t);sr(at,dt)}return typeof dt=="string"&&dt!==""||typeof dt=="number"?(dt=""+dt,Ye!==null&&Ye.tag===6?(q(at,Ye.sibling),Ye=ne(Ye,dt),Ye.return=at,at=Ye):(q(at,Ye),Ye=kc(dt,at.mode,$t),Ye.return=at,at=Ye),xe(at)):q(at,Ye)}return sl}var Or=mr(!0),Nn=mr(!1),Pn=gi(null),Bn=null,ei=null,ui=null;function Ua(){ui=ei=Bn=null}function Ea(m,P,q){ce?(Nr(Pn,P._currentValue),P._currentValue=q):(Nr(Pn,P._currentValue2),P._currentValue2=q)}function Pa(m){var P=Pn.current;Jr(Pn),ce?m._currentValue=P:m._currentValue2=P}function Zo(m,P,q){for(;m!==null;){var K=m.alternate;if((m.childLanes&P)!==P?(m.childLanes|=P,K!==null&&(K.childLanes|=P)):K!==null&&(K.childLanes&P)!==P&&(K.childLanes|=P),m===q)break;m=m.return}}function Qo(m,P){Bn=m,ui=ei=null,m=m.dependencies,m!==null&&m.firstContext!==null&&((m.lanes&P)!==0&&(fi=!0),m.firstContext=null)}function Di(m){var P=ce?m._currentValue:m._currentValue2;if(ui!==m)if(m={context:m,memoizedValue:P,next:null},ei===null){if(Bn===null)throw Error(o(308));ei=m,Bn.dependencies={lanes:0,firstContext:m}}else ei=ei.next=m;return P}var Ha=null;function Js(m){Ha===null?Ha=[m]:Ha.push(m)}function bl(m,P,q,K){var ne=P.interleaved;return ne===null?(q.next=q,Js(P)):(q.next=ne.next,ne.next=q),P.interleaved=q,ra(m,K)}function ra(m,P){m.lanes|=P;var q=m.alternate;for(q!==null&&(q.lanes|=P),q=m,m=m.return;m!==null;)m.childLanes|=P,q=m.alternate,q!==null&&(q.childLanes|=P),q=m,m=m.return;return q.tag===3?q.stateNode:null}var an=!1;function el(m){m.updateQueue={baseState:m.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function wl(m,P){m=m.updateQueue,P.updateQueue===m&&(P.updateQueue={baseState:m.baseState,firstBaseUpdate:m.firstBaseUpdate,lastBaseUpdate:m.lastBaseUpdate,shared:m.shared,effects:m.effects})}function Oa(m,P){return{eventTime:m,lane:P,tag:0,payload:null,callback:null,next:null}}function Ga(m,P,q){var K=m.updateQueue;if(K===null)return null;if(K=K.shared,(_r&2)!==0){var ne=K.pending;return ne===null?P.next=P:(P.next=ne.next,ne.next=P),K.pending=P,ra(m,q)}return ne=K.interleaved,ne===null?(P.next=P,Js(K)):(P.next=ne.next,ne.next=P),K.interleaved=P,ra(m,q)}function xi(m,P,q){if(P=P.updateQueue,P!==null&&(P=P.shared,(q&4194240)!==0)){var K=P.lanes;K&=m.pendingLanes,q|=K,P.lanes=q,Fa(m,q)}}function tl(m,P){var q=m.updateQueue,K=m.alternate;if(K!==null&&(K=K.updateQueue,q===K)){var ne=null,le=null;if(q=q.firstBaseUpdate,q!==null){do{var xe={eventTime:q.eventTime,lane:q.lane,tag:q.tag,payload:q.payload,callback:q.callback,next:null};le===null?ne=le=xe:le=le.next=xe,q=q.next}while(q!==null);le===null?ne=le=P:le=le.next=P}else ne=le=P;q={baseState:K.baseState,firstBaseUpdate:ne,lastBaseUpdate:le,shared:K.shared,effects:K.effects},m.updateQueue=q;return}m=q.lastBaseUpdate,m===null?q.firstBaseUpdate=P:m.next=P,q.lastBaseUpdate=P}function co(m,P,q,K){var ne=m.updateQueue;an=!1;var le=ne.firstBaseUpdate,xe=ne.lastBaseUpdate,$e=ne.shared.pending;if($e!==null){ne.shared.pending=null;var lt=$e,Lt=lt.next;lt.next=null,xe===null?le=Lt:xe.next=Lt,xe=lt;var er=m.alternate;er!==null&&(er=er.updateQueue,$e=er.lastBaseUpdate,$e!==xe&&($e===null?er.firstBaseUpdate=Lt:$e.next=Lt,er.lastBaseUpdate=lt))}if(le!==null){var Er=ne.baseState;xe=0,er=Lt=lt=null,$e=le;do{var Wt=$e.lane,In=$e.eventTime;if((K&Wt)===Wt){er!==null&&(er=er.next={eventTime:In,lane:0,tag:$e.tag,payload:$e.payload,callback:$e.callback,next:null});e:{var bn=m,to=$e;switch(Wt=P,In=q,to.tag){case 1:if(bn=to.payload,typeof bn=="function"){Er=bn.call(In,Er,Wt);break e}Er=bn;break e;case 3:bn.flags=bn.flags&-65537|128;case 0:if(bn=to.payload,Wt=typeof bn=="function"?bn.call(In,Er,Wt):bn,Wt==null)break e;Er=i({},Er,Wt);break e;case 2:an=!0}}$e.callback!==null&&$e.lane!==0&&(m.flags|=64,Wt=ne.effects,Wt===null?ne.effects=[$e]:Wt.push($e))}else In={eventTime:In,lane:Wt,tag:$e.tag,payload:$e.payload,callback:$e.callback,next:null},er===null?(Lt=er=In,lt=Er):er=er.next=In,xe|=Wt;if($e=$e.next,$e===null){if($e=ne.shared.pending,$e===null)break;Wt=$e,$e=Wt.next,Wt.next=null,ne.lastBaseUpdate=Wt,ne.shared.pending=null}}while(!0);if(er===null&&(lt=Er),ne.baseState=lt,ne.firstBaseUpdate=Lt,ne.lastBaseUpdate=er,P=ne.shared.interleaved,P!==null){ne=P;do xe|=ne.lane,ne=ne.next;while(ne!==P)}else le===null&&(ne.shared.lanes=0);Ts|=xe,m.lanes=xe,m.memoizedState=Er}}function Hu(m,P,q){if(m=P.effects,P.effects=null,m!==null)for(P=0;P<m.length;P++){var K=m[P],ne=K.callback;if(ne!==null){if(K.callback=null,K=q,typeof ne!="function")throw Error(o(191,ne));ne.call(K)}}}var yi={},Bi=gi(yi),Cs=gi(yi),Co=gi(yi);function bi(m){if(m===yi)throw Error(o(174));return m}function Jo(m,P){Nr(Co,P),Nr(Cs,m),Nr(Bi,yi),m=W(P),Jr(Bi),Nr(Bi,m)}function ci(){Jr(Bi),Jr(Cs),Jr(Co)}function qi(m){var P=bi(Co.current),q=bi(Bi.current);P=Y(q,m.type,P),q!==P&&(Nr(Cs,m),Nr(Bi,P))}function es(m){Cs.current===m&&(Jr(Bi),Jr(Cs))}var Xr=gi(0);function fo(m){for(var P=m;P!==null;){if(P.tag===13){var q=P.memoizedState;if(q!==null&&(q=q.dehydrated,q===null||ct(q)||_t(q)))return P}else if(P.tag===19&&P.memoizedProps.revealOrder!==void 0){if((P.flags&128)!==0)return P}else if(P.child!==null){P.child.return=P,P=P.child;continue}if(P===m)break;for(;P.sibling===null;){if(P.return===null||P.return===m)return null;P=P.return}P.sibling.return=P.return,P=P.sibling}return null}var rl=[];function ko(){for(var m=0;m<rl.length;m++){var P=rl[m];ce?P._workInProgressVersionPrimary=null:P._workInProgressVersionSecondary=null}rl.length=0}var Dr=s.ReactCurrentDispatcher,Lo=s.ReactCurrentBatchConfig,Kn=0,Mr=null,On=null,Zn=null,ts=!1,No=!1,To=0,Va=0;function Tn(){throw Error(o(321))}function ho(m,P){if(P===null)return!1;for(var q=0;q<P.length&&q<m.length;q++)if(!Mi(m[q],P[q]))return!1;return!0}function Ro(m,P,q,K,ne,le){if(Kn=le,Mr=P,P.memoizedState=null,P.updateQueue=null,P.lanes=0,Dr.current=m===null||m.memoizedState===null?Wu:Ol,m=q(K,ne),No){le=0;do{if(No=!1,To=0,25<=le)throw Error(o(301));le+=1,Zn=On=null,P.updateQueue=null,Dr.current=uf,m=q(K,ne)}while(No)}if(Dr.current=Ls,P=On!==null&&On.next!==null,Kn=0,Zn=On=Mr=null,ts=!1,P)throw Error(o(300));return m}function Mo(){var m=To!==0;return To=0,m}function zi(){var m={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zn===null?Mr.memoizedState=Zn=m:Zn=Zn.next=m,Zn}function fn(){if(On===null){var m=Mr.alternate;m=m!==null?m.memoizedState:null}else m=On.next;var P=Zn===null?Mr.memoizedState:Zn.next;if(P!==null)Zn=P,On=m;else{if(m===null)throw Error(o(310));On=m,m={memoizedState:On.memoizedState,baseState:On.baseState,baseQueue:On.baseQueue,queue:On.queue,next:null},Zn===null?Mr.memoizedState=Zn=m:Zn=Zn.next=m}return Zn}function Ei(m,P){return typeof P=="function"?P(m):P}function on(m){var P=fn(),q=P.queue;if(q===null)throw Error(o(311));q.lastRenderedReducer=m;var K=On,ne=K.baseQueue,le=q.pending;if(le!==null){if(ne!==null){var xe=ne.next;ne.next=le.next,le.next=xe}K.baseQueue=ne=le,q.pending=null}if(ne!==null){le=ne.next,K=K.baseState;var $e=xe=null,lt=null,Lt=le;do{var er=Lt.lane;if((Kn&er)===er)lt!==null&&(lt=lt.next={lane:0,action:Lt.action,hasEagerState:Lt.hasEagerState,eagerState:Lt.eagerState,next:null}),K=Lt.hasEagerState?Lt.eagerState:m(K,Lt.action);else{var Er={lane:er,action:Lt.action,hasEagerState:Lt.hasEagerState,eagerState:Lt.eagerState,next:null};lt===null?($e=lt=Er,xe=K):lt=lt.next=Er,Mr.lanes|=er,Ts|=er}Lt=Lt.next}while(Lt!==null&&Lt!==le);lt===null?xe=K:lt.next=$e,Mi(K,P.memoizedState)||(fi=!0),P.memoizedState=K,P.baseState=xe,P.baseQueue=lt,q.lastRenderedState=K}if(m=q.interleaved,m!==null){ne=m;do le=ne.lane,Mr.lanes|=le,Ts|=le,ne=ne.next;while(ne!==m)}else ne===null&&(q.lanes=0);return[P.memoizedState,q.dispatch]}function Kr(m){var P=fn(),q=P.queue;if(q===null)throw Error(o(311));q.lastRenderedReducer=m;var K=q.dispatch,ne=q.pending,le=P.memoizedState;if(ne!==null){q.pending=null;var xe=ne=ne.next;do le=m(le,xe.action),xe=xe.next;while(xe!==ne);Mi(le,P.memoizedState)||(fi=!0),P.memoizedState=le,P.baseQueue===null&&(P.baseState=le),q.lastRenderedState=le}return[le,K]}function qn(){}function ti(m,P){var q=Mr,K=fn(),ne=P(),le=!Mi(K.memoizedState,ne);if(le&&(K.memoizedState=ne,fi=!0),K=K.queue,El(nl.bind(null,q,K,m),[m]),K.getSnapshot!==P||le||Zn!==null&&Zn.memoizedState.tag&1){if(q.flags|=2048,wi(9,_l.bind(null,q,K,ne,P),void 0,null),rn===null)throw Error(o(349));(Kn&30)!==0||Io(q,P,ne)}return ne}function Io(m,P,q){m.flags|=16384,m={getSnapshot:P,value:q},P=Mr.updateQueue,P===null?(P={lastEffect:null,stores:null},Mr.updateQueue=P,P.stores=[m]):(q=P.stores,q===null?P.stores=[m]:q.push(m))}function _l(m,P,q,K){P.value=q,P.getSnapshot=K,cu(P)&&jo(m)}function nl(m,P,q){return q(function(){cu(P)&&jo(m)})}function cu(m){var P=m.getSnapshot;m=m.value;try{var q=P();return!Mi(m,q)}catch{return!0}}function jo(m){var P=ra(m,1);P!==null&&la(P,m,1,-1)}function Sl(m){var P=zi();return typeof m=="function"&&(m=m()),P.memoizedState=P.baseState=m,m={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ei,lastRenderedState:m},P.queue=m,m=m.dispatch=qh.bind(null,Mr,m),[P.memoizedState,m]}function wi(m,P,q,K){return m={tag:m,create:P,destroy:q,deps:K,next:null},P=Mr.updateQueue,P===null?(P={lastEffect:null,stores:null},Mr.updateQueue=P,P.lastEffect=m.next=m):(q=P.lastEffect,q===null?P.lastEffect=m.next=m:(K=q.next,q.next=m,m.next=K,P.lastEffect=m)),m}function Wa(){return fn().memoizedState}function xl(m,P,q,K){var ne=zi();Mr.flags|=m,ne.memoizedState=wi(1|P,q,void 0,K===void 0?null:K)}function Fo(m,P,q,K){var ne=fn();K=K===void 0?null:K;var le=void 0;if(On!==null){var xe=On.memoizedState;if(le=xe.destroy,K!==null&&ho(K,xe.deps)){ne.memoizedState=wi(P,q,le,K);return}}Mr.flags|=m,ne.memoizedState=wi(1|P,q,le,K)}function sf(m,P){return xl(8390656,8,m,P)}function El(m,P){return Fo(2048,8,m,P)}function fu(m,P){return Fo(4,2,m,P)}function hn(m,P){return Fo(4,4,m,P)}function Gu(m,P){if(typeof P=="function")return m=m(),P(m),function(){P(null)};if(P!=null)return m=m(),P.current=m,function(){P.current=null}}function Pl(m,P,q){return q=q!=null?q.concat([m]):null,Fo(4,4,Gu.bind(null,P,m),q)}function ks(){}function hu(m,P){var q=fn();P=P===void 0?null:P;var K=q.memoizedState;return K!==null&&P!==null&&ho(P,K[1])?K[0]:(q.memoizedState=[m,P],m)}function du(m,P){var q=fn();P=P===void 0?null:P;var K=q.memoizedState;return K!==null&&P!==null&&ho(P,K[1])?K[0]:(m=m(),q.memoizedState=[m,P],m)}function pu(m,P,q){return(Kn&21)===0?(m.baseState&&(m.baseState=!1,fi=!0),m.memoizedState=q):(Mi(q,P)||(q=Es(),Mr.lanes|=q,Ts|=q,m.baseState=!0),P)}function bc(m,P){var q=Dt;Dt=q!==0&&4>q?q:4,m(!0);var K=Lo.transition;Lo.transition={};try{m(!1),P()}finally{Dt=q,Lo.transition=K}}function il(){return fn().memoizedState}function Bf(m,P,q){var K=pi(m);if(q={lane:K,action:q,hasEagerState:!1,eagerState:null,next:null},qf(m))lf(P,q);else if(q=bl(m,P,q,K),q!==null){var ne=_n();la(q,m,K,ne),Vu(q,P,K)}}function qh(m,P,q){var K=pi(m),ne={lane:K,action:q,hasEagerState:!1,eagerState:null,next:null};if(qf(m))lf(P,ne);else{var le=m.alternate;if(m.lanes===0&&(le===null||le.lanes===0)&&(le=P.lastRenderedReducer,le!==null))try{var xe=P.lastRenderedState,$e=le(xe,q);if(ne.hasEagerState=!0,ne.eagerState=$e,Mi($e,xe)){var lt=P.interleaved;lt===null?(ne.next=ne,Js(P)):(ne.next=lt.next,lt.next=ne),P.interleaved=ne;return}}catch{}finally{}q=bl(m,P,ne,K),q!==null&&(ne=_n(),la(q,m,K,ne),Vu(q,P,K))}}function qf(m){var P=m.alternate;return m===Mr||P!==null&&P===Mr}function lf(m,P){No=ts=!0;var q=m.pending;q===null?P.next=P:(P.next=q.next,q.next=P),m.pending=P}function Vu(m,P,q){if((q&4194240)!==0){var K=P.lanes;K&=m.pendingLanes,q|=K,P.lanes=q,Fa(m,q)}}var Ls={readContext:Di,useCallback:Tn,useContext:Tn,useEffect:Tn,useImperativeHandle:Tn,useInsertionEffect:Tn,useLayoutEffect:Tn,useMemo:Tn,useReducer:Tn,useRef:Tn,useState:Tn,useDebugValue:Tn,useDeferredValue:Tn,useTransition:Tn,useMutableSource:Tn,useSyncExternalStore:Tn,useId:Tn,unstable_isNewReconciler:!1},Wu={readContext:Di,useCallback:function(m,P){return zi().memoizedState=[m,P===void 0?null:P],m},useContext:Di,useEffect:sf,useImperativeHandle:function(m,P,q){return q=q!=null?q.concat([m]):null,xl(4194308,4,Gu.bind(null,P,m),q)},useLayoutEffect:function(m,P){return xl(4194308,4,m,P)},useInsertionEffect:function(m,P){return xl(4,2,m,P)},useMemo:function(m,P){var q=zi();return P=P===void 0?null:P,m=m(),q.memoizedState=[m,P],m},useReducer:function(m,P,q){var K=zi();return P=q!==void 0?q(P):P,K.memoizedState=K.baseState=P,m={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:m,lastRenderedState:P},K.queue=m,m=m.dispatch=Bf.bind(null,Mr,m),[K.memoizedState,m]},useRef:function(m){var P=zi();return m={current:m},P.memoizedState=m},useState:Sl,useDebugValue:ks,useDeferredValue:function(m){return zi().memoizedState=m},useTransition:function(){var m=Sl(!1),P=m[0];return m=bc.bind(null,m[1]),zi().memoizedState=m,[P,m]},useMutableSource:function(){},useSyncExternalStore:function(m,P,q){var K=Mr,ne=zi();if(nn){if(q===void 0)throw Error(o(407));q=q()}else{if(q=P(),rn===null)throw Error(o(349));(Kn&30)!==0||Io(K,P,q)}ne.memoizedState=q;var le={value:q,getSnapshot:P};return ne.queue=le,sf(nl.bind(null,K,le,m),[m]),K.flags|=2048,wi(9,_l.bind(null,K,le,q,P),void 0,null),q},useId:function(){var m=zi(),P=rn.identifierPrefix;if(nn){var q=ta,K=ea;q=(K&~(1<<32-da(K)-1)).toString(32)+q,P=":"+P+"R"+q,q=To++,0<q&&(P+="H"+q.toString(32)),P+=":"}else q=Va++,P=":"+P+"r"+q.toString(32)+":";return m.memoizedState=P},unstable_isNewReconciler:!1},Ol={readContext:Di,useCallback:hu,useContext:Di,useEffect:El,useImperativeHandle:Pl,useInsertionEffect:fu,useLayoutEffect:hn,useMemo:du,useReducer:on,useRef:Wa,useState:function(){return on(Ei)},useDebugValue:ks,useDeferredValue:function(m){var P=fn();return pu(P,On.memoizedState,m)},useTransition:function(){var m=on(Ei)[0],P=fn().memoizedState;return[m,P]},useMutableSource:qn,useSyncExternalStore:ti,useId:il,unstable_isNewReconciler:!1},uf={readContext:Di,useCallback:hu,useContext:Di,useEffect:El,useImperativeHandle:Pl,useInsertionEffect:fu,useLayoutEffect:hn,useMemo:du,useReducer:Kr,useRef:Wa,useState:function(){return Kr(Ei)},useDebugValue:ks,useDeferredValue:function(m){var P=fn();return On===null?P.memoizedState=m:pu(P,On.memoizedState,m)},useTransition:function(){var m=Kr(Ei)[0],P=fn().memoizedState;return[m,P]},useMutableSource:qn,useSyncExternalStore:ti,useId:il,unstable_isNewReconciler:!1};function $a(m,P){if(m&&m.defaultProps){P=i({},P),m=m.defaultProps;for(var q in m)P[q]===void 0&&(P[q]=m[q]);return P}return P}function wc(m,P,q,K){P=m.memoizedState,q=q(K,P),q=q==null?P:i({},P,q),m.memoizedState=q,m.lanes===0&&(m.updateQueue.baseState=q)}var $u={isMounted:function(m){return(m=m._reactInternals)?F(m)===m:!1},enqueueSetState:function(m,P,q){m=m._reactInternals;var K=_n(),ne=pi(m),le=Oa(K,ne);le.payload=P,q!=null&&(le.callback=q),P=Ga(m,le,ne),P!==null&&(la(P,m,ne,K),xi(P,m,ne))},enqueueReplaceState:function(m,P,q){m=m._reactInternals;var K=_n(),ne=pi(m),le=Oa(K,ne);le.tag=1,le.payload=P,q!=null&&(le.callback=q),P=Ga(m,le,ne),P!==null&&(la(P,m,ne,K),xi(P,m,ne))},enqueueForceUpdate:function(m,P){m=m._reactInternals;var q=_n(),K=pi(m),ne=Oa(q,K);ne.tag=2,P!=null&&(ne.callback=P),P=Ga(m,ne,K),P!==null&&(la(P,m,K,q),xi(P,m,K))}};function zf(m,P,q,K,ne,le,xe){return m=m.stateNode,typeof m.shouldComponentUpdate=="function"?m.shouldComponentUpdate(K,le,xe):P.prototype&&P.prototype.isPureReactComponent?!ht(q,K)||!ht(ne,le):!0}function Uf(m,P,q){var K=!1,ne=cn,le=P.contextType;return typeof le=="object"&&le!==null?le=Di(le):(ne=oi(P)?Ia:vi.current,K=P.contextTypes,le=(K=K!=null)?ja(m,ne):cn),P=new P(q,le),m.memoizedState=P.state!==null&&P.state!==void 0?P.state:null,P.updater=$u,m.stateNode=P,P._reactInternals=m,K&&(m=m.stateNode,m.__reactInternalMemoizedUnmaskedChildContext=ne,m.__reactInternalMemoizedMaskedChildContext=le),P}function _c(m,P,q,K){m=P.state,typeof P.componentWillReceiveProps=="function"&&P.componentWillReceiveProps(q,K),typeof P.UNSAFE_componentWillReceiveProps=="function"&&P.UNSAFE_componentWillReceiveProps(q,K),P.state!==m&&$u.enqueueReplaceState(P,P.state,null)}function Ui(m,P,q,K){var ne=m.stateNode;ne.props=q,ne.state=m.memoizedState,ne.refs={},el(m);var le=P.contextType;typeof le=="object"&&le!==null?ne.context=Di(le):(le=oi(P)?Ia:vi.current,ne.context=ja(m,le)),ne.state=m.memoizedState,le=P.getDerivedStateFromProps,typeof le=="function"&&(wc(m,P,le,q),ne.state=m.memoizedState),typeof P.getDerivedStateFromProps=="function"||typeof ne.getSnapshotBeforeUpdate=="function"||typeof ne.UNSAFE_componentWillMount!="function"&&typeof ne.componentWillMount!="function"||(P=ne.state,typeof ne.componentWillMount=="function"&&ne.componentWillMount(),typeof ne.UNSAFE_componentWillMount=="function"&&ne.UNSAFE_componentWillMount(),P!==ne.state&&$u.enqueueReplaceState(ne,ne.state,null),co(m,q,ne,K),ne.state=m.memoizedState),typeof ne.componentDidMount=="function"&&(m.flags|=4194308)}function Hi(m,P){try{var q="",K=P;do q+=Et(K),K=K.return;while(K);var ne=q}catch(le){ne=`
|
|
56
|
-
Error generating stack: `+le.message+`
|
|
57
|
-
`+le.stack}return{value:m,source:P,stack:ne,digest:null}}function na(m,P,q){return{value:m,source:null,stack:q??null,digest:P??null}}function po(m,P){try{console.error(P.value)}catch(q){setTimeout(function(){throw q})}}var gu=typeof WeakMap=="function"?WeakMap:Map;function Gi(m,P,q){q=Oa(-1,q),q.tag=3,q.payload={element:null};var K=P.value;return q.callback=function(){Gn||(Gn=!0,Vn=K),po(m,P)},q}function pa(m,P,q){q=Oa(-1,q),q.tag=3;var K=m.type.getDerivedStateFromError;if(typeof K=="function"){var ne=P.value;q.payload=function(){return K(ne)},q.callback=function(){po(m,P)}}var le=m.stateNode;return le!==null&&typeof le.componentDidCatch=="function"&&(q.callback=function(){po(m,P),typeof K!="function"&&(Za===null?Za=new Set([this]):Za.add(this));var xe=P.stack;this.componentDidCatch(P.value,{componentStack:xe!==null?xe:""})}),q}function Hf(m,P,q){var K=m.pingCache;if(K===null){K=m.pingCache=new gu;var ne=new Set;K.set(P,ne)}else ne=K.get(P),ne===void 0&&(ne=new Set,K.set(P,ne));ne.has(q)||(ne.add(q),m=Np.bind(null,m,P,q),P.then(m,m))}function Gf(m){do{var P;if((P=m.tag===13)&&(P=m.memoizedState,P=P!==null?P.dehydrated!==null:!0),P)return m;m=m.return}while(m!==null);return null}function Ns(m,P,q,K,ne){return(m.mode&1)===0?(m===P?m.flags|=65536:(m.flags|=128,q.flags|=131072,q.flags&=-52805,q.tag===1&&(q.alternate===null?q.tag=17:(P=Oa(-1,1),P.tag=2,Ga(q,P,1))),q.lanes|=1),m):(m.flags|=65536,m.lanes=ne,m)}var vu=s.ReactCurrentOwner,fi=!1;function _i(m,P,q,K){P.child=m===null?Nn(P,null,q,K):Or(P,m.child,q,K)}function Sc(m,P,q,K,ne){q=q.render;var le=P.ref;return Qo(P,ne),K=Ro(m,P,q,K,le,ne),q=Mo(),m!==null&&!fi?(P.updateQueue=m.updateQueue,P.flags&=-2053,m.lanes&=~ne,re(m,P,ne)):(nn&&q&&As(P),P.flags|=1,_i(m,P,K,ne),P.child)}function rs(m,P,q,K,ne){if(m===null){var le=q.type;return typeof le=="function"&&!Ac(le)&&le.defaultProps===void 0&&q.compare===null&&q.defaultProps===void 0?(P.tag=15,P.type=le,go(m,P,le,K,ne)):(m=$f(q.type,null,K,P,P.mode,ne),m.ref=P.ref,m.return=P,P.child=m)}if(le=m.child,(m.lanes&ne)===0){var xe=le.memoizedProps;if(q=q.compare,q=q!==null?q:ht,q(xe,K)&&m.ref===P.ref)return re(m,P,ne)}return P.flags|=1,m=Eu(le,K),m.ref=P.ref,m.return=P,P.child=m}function go(m,P,q,K,ne){if(m!==null){var le=m.memoizedProps;if(ht(le,K)&&m.ref===P.ref)if(fi=!1,P.pendingProps=K=le,(m.lanes&ne)!==0)(m.flags&131072)!==0&&(fi=!0);else return P.lanes=m.lanes,re(m,P,ne)}return ns(m,P,q,K,ne)}function en(m,P,q){var K=P.pendingProps,ne=K.children,le=m!==null?m.memoizedState:null;if(K.mode==="hidden")if((P.mode&1)===0)P.memoizedState={baseLanes:0,cachePool:null,transitions:null},Nr(qo,ri),ri|=q;else{if((q&1073741824)===0)return m=le!==null?le.baseLanes|q:q,P.lanes=P.childLanes=1073741824,P.memoizedState={baseLanes:m,cachePool:null,transitions:null},P.updateQueue=null,Nr(qo,ri),ri|=m,null;P.memoizedState={baseLanes:0,cachePool:null,transitions:null},K=le!==null?le.baseLanes:q,Nr(qo,ri),ri|=K}else le!==null?(K=le.baseLanes|q,P.memoizedState=null):K=q,Nr(qo,ri),ri|=K;return _i(m,P,ne,q),P.child}function sn(m,P){var q=P.ref;(m===null&&q!==null||m!==null&&m.ref!==q)&&(P.flags|=512,P.flags|=2097152)}function ns(m,P,q,K,ne){var le=oi(q)?Ia:vi.current;return le=ja(P,le),Qo(P,ne),q=Ro(m,P,q,K,le,ne),K=Mo(),m!==null&&!fi?(P.updateQueue=m.updateQueue,P.flags&=-2053,m.lanes&=~ne,re(m,P,ne)):(nn&&K&&As(P),P.flags|=1,_i(m,P,q,ne),P.child)}function Pi(m,P,q,K,ne){if(oi(q)){var le=!0;Wo(P)}else le=!1;if(Qo(P,ne),P.stateNode===null)G(m,P),Uf(P,q,K),Ui(P,q,K,ne),K=!0;else if(m===null){var xe=P.stateNode,$e=P.memoizedProps;xe.props=$e;var lt=xe.context,Lt=q.contextType;typeof Lt=="object"&&Lt!==null?Lt=Di(Lt):(Lt=oi(q)?Ia:vi.current,Lt=ja(P,Lt));var er=q.getDerivedStateFromProps,Er=typeof er=="function"||typeof xe.getSnapshotBeforeUpdate=="function";Er||typeof xe.UNSAFE_componentWillReceiveProps!="function"&&typeof xe.componentWillReceiveProps!="function"||($e!==K||lt!==Lt)&&_c(P,xe,K,Lt),an=!1;var Wt=P.memoizedState;xe.state=Wt,co(P,K,xe,ne),lt=P.memoizedState,$e!==K||Wt!==lt||Ti.current||an?(typeof er=="function"&&(wc(P,q,er,K),lt=P.memoizedState),($e=an||zf(P,q,$e,K,Wt,lt,Lt))?(Er||typeof xe.UNSAFE_componentWillMount!="function"&&typeof xe.componentWillMount!="function"||(typeof xe.componentWillMount=="function"&&xe.componentWillMount(),typeof xe.UNSAFE_componentWillMount=="function"&&xe.UNSAFE_componentWillMount()),typeof xe.componentDidMount=="function"&&(P.flags|=4194308)):(typeof xe.componentDidMount=="function"&&(P.flags|=4194308),P.memoizedProps=K,P.memoizedState=lt),xe.props=K,xe.state=lt,xe.context=Lt,K=$e):(typeof xe.componentDidMount=="function"&&(P.flags|=4194308),K=!1)}else{xe=P.stateNode,wl(m,P),$e=P.memoizedProps,Lt=P.type===P.elementType?$e:$a(P.type,$e),xe.props=Lt,Er=P.pendingProps,Wt=xe.context,lt=q.contextType,typeof lt=="object"&<!==null?lt=Di(lt):(lt=oi(q)?Ia:vi.current,lt=ja(P,lt));var In=q.getDerivedStateFromProps;(er=typeof In=="function"||typeof xe.getSnapshotBeforeUpdate=="function")||typeof xe.UNSAFE_componentWillReceiveProps!="function"&&typeof xe.componentWillReceiveProps!="function"||($e!==Er||Wt!==lt)&&_c(P,xe,K,lt),an=!1,Wt=P.memoizedState,xe.state=Wt,co(P,K,xe,ne);var bn=P.memoizedState;$e!==Er||Wt!==bn||Ti.current||an?(typeof In=="function"&&(wc(P,q,In,K),bn=P.memoizedState),(Lt=an||zf(P,q,Lt,K,Wt,bn,lt)||!1)?(er||typeof xe.UNSAFE_componentWillUpdate!="function"&&typeof xe.componentWillUpdate!="function"||(typeof xe.componentWillUpdate=="function"&&xe.componentWillUpdate(K,bn,lt),typeof xe.UNSAFE_componentWillUpdate=="function"&&xe.UNSAFE_componentWillUpdate(K,bn,lt)),typeof xe.componentDidUpdate=="function"&&(P.flags|=4),typeof xe.getSnapshotBeforeUpdate=="function"&&(P.flags|=1024)):(typeof xe.componentDidUpdate!="function"||$e===m.memoizedProps&&Wt===m.memoizedState||(P.flags|=4),typeof xe.getSnapshotBeforeUpdate!="function"||$e===m.memoizedProps&&Wt===m.memoizedState||(P.flags|=1024),P.memoizedProps=K,P.memoizedState=bn),xe.props=K,xe.state=bn,xe.context=lt,K=Lt):(typeof xe.componentDidUpdate!="function"||$e===m.memoizedProps&&Wt===m.memoizedState||(P.flags|=4),typeof xe.getSnapshotBeforeUpdate!="function"||$e===m.memoizedProps&&Wt===m.memoizedState||(P.flags|=1024),K=!1)}return ia(m,P,q,K,le,ne)}function ia(m,P,q,K,ne,le){sn(m,P);var xe=(P.flags&128)!==0;if(!K&&!xe)return ne&&nu(P,q,!1),re(m,P,le);K=P.stateNode,vu.current=P;var $e=xe&&typeof q.getDerivedStateFromError!="function"?null:K.render();return P.flags|=1,m!==null&&xe?(P.child=Or(P,m.child,null,le),P.child=Or(P,null,$e,le)):_i(m,P,$e,le),P.memoizedState=K.state,ne&&nu(P,q,!0),P.child}function al(m){var P=m.stateNode;P.pendingContext?pl(m,P.pendingContext,P.pendingContext!==P.context):P.context&&pl(m,P.context,!1),Jo(m,P.containerInfo)}function Al(m,P,q,K,ne){return Ce(),Fe(ne),P.flags|=256,_i(m,P,q,K),P.child}var aa={dehydrated:null,treeContext:null,retryLane:0};function mu(m){return{baseLanes:m,cachePool:null,transitions:null}}function cf(m,P,q){var K=P.pendingProps,ne=Xr.current,le=!1,xe=(P.flags&128)!==0,$e;if(($e=xe)||($e=m!==null&&m.memoizedState===null?!1:(ne&2)!==0),$e?(le=!0,P.flags&=-129):(m===null||m.memoizedState!==null)&&(ne|=1),Nr(Xr,ne&1),m===null)return Ko(P),m=P.memoizedState,m!==null&&(m=m.dehydrated,m!==null)?((P.mode&1)===0?P.lanes=1:_t(m)?P.lanes=8:P.lanes=1073741824,null):(xe=K.children,m=K.fallback,le?(K=P.mode,le=P.child,xe={mode:"hidden",children:xe},(K&1)===0&&le!==null?(le.childLanes=0,le.pendingProps=xe):le=Cc(xe,K,0,null),m=ma(m,K,q,null),le.return=P,m.return=P,le.sibling=m,P.child=le,P.child.memoizedState=mu(q),P.memoizedState=aa,m):Yu(P,xe));if(ne=m.memoizedState,ne!==null&&($e=ne.dehydrated,$e!==null))return Vf(m,P,xe,K,$e,ne,q);if(le){le=K.fallback,xe=P.mode,ne=m.child,$e=ne.sibling;var lt={mode:"hidden",children:K.children};return(xe&1)===0&&P.child!==ne?(K=P.child,K.childLanes=0,K.pendingProps=lt,P.deletions=null):(K=Eu(ne,lt),K.subtreeFlags=ne.subtreeFlags&14680064),$e!==null?le=Eu($e,le):(le=ma(le,xe,q,null),le.flags|=2),le.return=P,K.return=P,K.sibling=le,P.child=K,K=le,le=P.child,xe=m.child.memoizedState,xe=xe===null?mu(q):{baseLanes:xe.baseLanes|q,cachePool:null,transitions:xe.transitions},le.memoizedState=xe,le.childLanes=m.childLanes&~q,P.memoizedState=aa,K}return le=m.child,m=le.sibling,K=Eu(le,{mode:"visible",children:K.children}),(P.mode&1)===0&&(K.lanes=q),K.return=P,K.sibling=null,m!==null&&(q=P.deletions,q===null?(P.deletions=[m],P.flags|=16):q.push(m)),P.child=K,P.memoizedState=null,K}function Yu(m,P){return P=Cc({mode:"visible",children:P},m.mode,0,null),P.return=m,m.child=P}function is(m,P,q,K){return K!==null&&Fe(K),Or(P,m.child,null,q),m=Yu(P,P.pendingProps.children),m.flags|=2,P.memoizedState=null,m}function Vf(m,P,q,K,ne,le,xe){if(q)return P.flags&256?(P.flags&=-257,K=na(Error(o(422))),is(m,P,xe,K)):P.memoizedState!==null?(P.child=m.child,P.flags|=128,null):(le=K.fallback,ne=P.mode,K=Cc({mode:"visible",children:K.children},ne,0,null),le=ma(le,ne,xe,null),le.flags|=2,K.return=P,le.return=P,K.sibling=le,P.child=K,(P.mode&1)!==0&&Or(P,m.child,null,xe),P.child.memoizedState=mu(xe),P.memoizedState=aa,le);if((P.mode&1)===0)return is(m,P,xe,null);if(_t(ne))return K=xt(ne).digest,le=Error(o(419)),K=na(le,K,void 0),is(m,P,xe,K);if(q=(xe&m.childLanes)!==0,fi||q){if(K=rn,K!==null){switch(xe&-xe){case 4:ne=2;break;case 16:ne=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:ne=32;break;case 536870912:ne=268435456;break;default:ne=0}ne=(ne&(K.suspendedLanes|xe))!==0?0:ne,ne!==0&&ne!==le.retryLane&&(le.retryLane=ne,ra(m,ne),la(K,m,ne,-1))}return eo(),K=na(Error(o(421))),is(m,P,xe,K)}return ct(ne)?(P.flags|=128,P.child=m.child,P=Rp.bind(null,m),rt(ne,P),null):(m=le.treeContext,Le&&(mi=br(ne),Xn=P,nn=!0,za=null,Qs=!1,m!==null&&(xn[Fi++]=ea,xn[Fi++]=ta,xn[Fi++]=En,ea=m.id,ta=m.overflow,En=P)),P=Yu(P,K.children),P.flags|=4096,P)}function as(m,P,q){m.lanes|=P;var K=m.alternate;K!==null&&(K.lanes|=P),Zo(m.return,P,q)}function Cl(m,P,q,K,ne){var le=m.memoizedState;le===null?m.memoizedState={isBackwards:P,rendering:null,renderingStartTime:0,last:K,tail:q,tailMode:ne}:(le.isBackwards=P,le.rendering=null,le.renderingStartTime=0,le.last=K,le.tail=q,le.tailMode=ne)}function M(m,P,q){var K=P.pendingProps,ne=K.revealOrder,le=K.tail;if(_i(m,P,K.children,q),K=Xr.current,(K&2)!==0)K=K&1|2,P.flags|=128;else{if(m!==null&&(m.flags&128)!==0)e:for(m=P.child;m!==null;){if(m.tag===13)m.memoizedState!==null&&as(m,q,P);else if(m.tag===19)as(m,q,P);else if(m.child!==null){m.child.return=m,m=m.child;continue}if(m===P)break e;for(;m.sibling===null;){if(m.return===null||m.return===P)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}K&=1}if(Nr(Xr,K),(P.mode&1)===0)P.memoizedState=null;else switch(ne){case"forwards":for(q=P.child,ne=null;q!==null;)m=q.alternate,m!==null&&fo(m)===null&&(ne=q),q=q.sibling;q=ne,q===null?(ne=P.child,P.child=null):(ne=q.sibling,q.sibling=null),Cl(P,!1,ne,q,le);break;case"backwards":for(q=null,ne=P.child,P.child=null;ne!==null;){if(m=ne.alternate,m!==null&&fo(m)===null){P.child=ne;break}m=ne.sibling,ne.sibling=q,q=ne,ne=m}Cl(P,!0,q,null,le);break;case"together":Cl(P,!1,null,null,void 0);break;default:P.memoizedState=null}return P.child}function G(m,P){(P.mode&1)===0&&m!==null&&(m.alternate=null,P.alternate=null,P.flags|=2)}function re(m,P,q){if(m!==null&&(P.dependencies=m.dependencies),Ts|=P.lanes,(q&P.childLanes)===0)return null;if(m!==null&&P.child!==m.child)throw Error(o(153));if(P.child!==null){for(m=P.child,q=Eu(m,m.pendingProps),P.child=q,q.return=P;m.sibling!==null;)m=m.sibling,q=q.sibling=Eu(m,m.pendingProps),q.return=P;q.sibling=null}return P.child}function oe(m,P,q){switch(P.tag){case 3:al(P),Ce();break;case 5:qi(P);break;case 1:oi(P.type)&&Wo(P);break;case 4:Jo(P,P.stateNode.containerInfo);break;case 10:Ea(P,P.type._context,P.memoizedProps.value);break;case 13:var K=P.memoizedState;if(K!==null)return K.dehydrated!==null?(Nr(Xr,Xr.current&1),P.flags|=128,null):(q&P.child.childLanes)!==0?cf(m,P,q):(Nr(Xr,Xr.current&1),m=re(m,P,q),m!==null?m.sibling:null);Nr(Xr,Xr.current&1);break;case 19:if(K=(q&P.childLanes)!==0,(m.flags&128)!==0){if(K)return M(m,P,q);P.flags|=128}var ne=P.memoizedState;if(ne!==null&&(ne.rendering=null,ne.tail=null,ne.lastEffect=null),Nr(Xr,Xr.current),K)break;return null;case 22:case 23:return P.lanes=0,en(m,P,q)}return re(m,P,q)}function ue(m){m.flags|=4}function de(m,P){if(m!==null&&m.child===P.child)return!0;if((P.flags&16)!==0)return!1;for(m=P.child;m!==null;){if((m.flags&12854)!==0||(m.subtreeFlags&12854)!==0)return!1;m=m.sibling}return!0}var ge,ye,we,Ee;if(me)ge=function(m,P){for(var q=P.child;q!==null;){if(q.tag===5||q.tag===6)U(m,q.stateNode);else if(q.tag!==4&&q.child!==null){q.child.return=q,q=q.child;continue}if(q===P)break;for(;q.sibling===null;){if(q.return===null||q.return===P)return;q=q.return}q.sibling.return=q.return,q=q.sibling}},ye=function(){},we=function(m,P,q,K,ne){if(m=m.memoizedProps,m!==K){var le=P.stateNode,xe=bi(Bi.current);q=$(le,q,m,K,ne,xe),(P.updateQueue=q)&&ue(P)}},Ee=function(m,P,q,K){q!==K&&ue(P)};else if(_e){ge=function(m,P,q,K){for(var ne=P.child;ne!==null;){if(ne.tag===5){var le=ne.stateNode;q&&K&&(le=mt(le,ne.type,ne.memoizedProps,ne)),U(m,le)}else if(ne.tag===6)le=ne.stateNode,q&&K&&(le=Gt(le,ne.memoizedProps,ne)),U(m,le);else if(ne.tag!==4){if(ne.tag===22&&ne.memoizedState!==null)le=ne.child,le!==null&&(le.return=ne),ge(m,ne,!0,!0);else if(ne.child!==null){ne.child.return=ne,ne=ne.child;continue}}if(ne===P)break;for(;ne.sibling===null;){if(ne.return===null||ne.return===P)return;ne=ne.return}ne.sibling.return=ne.return,ne=ne.sibling}};var De=function(m,P,q,K){for(var ne=P.child;ne!==null;){if(ne.tag===5){var le=ne.stateNode;q&&K&&(le=mt(le,ne.type,ne.memoizedProps,ne)),Xt(m,le)}else if(ne.tag===6)le=ne.stateNode,q&&K&&(le=Gt(le,ne.memoizedProps,ne)),Xt(m,le);else if(ne.tag!==4){if(ne.tag===22&&ne.memoizedState!==null)le=ne.child,le!==null&&(le.return=ne),De(m,ne,!0,!0);else if(ne.child!==null){ne.child.return=ne,ne=ne.child;continue}}if(ne===P)break;for(;ne.sibling===null;){if(ne.return===null||ne.return===P)return;ne=ne.return}ne.sibling.return=ne.return,ne=ne.sibling}};ye=function(m,P){var q=P.stateNode;if(!de(m,P)){m=q.containerInfo;var K=Tt(m);De(K,P,!1,!1),q.pendingChildren=K,ue(P),Rr(m,K)}},we=function(m,P,q,K,ne){var le=m.stateNode,xe=m.memoizedProps;if((m=de(m,P))&&xe===K)P.stateNode=le;else{var $e=P.stateNode,lt=bi(Bi.current),Lt=null;xe!==K&&(Lt=$($e,q,xe,K,ne,lt)),m&&Lt===null?P.stateNode=le:(le=nr(le,Lt,q,xe,K,P,m,$e),D(le,q,K,ne,lt)&&ue(P),P.stateNode=le,m?ue(P):ge(le,P,!1,!1))}},Ee=function(m,P,q,K){q!==K?(m=bi(Co.current),q=bi(Bi.current),P.stateNode=ee(K,m,q,P),ue(P)):P.stateNode=m.stateNode}}else ye=function(){},we=function(){},Ee=function(){};function Xe(m,P){if(!nn)switch(m.tailMode){case"hidden":P=m.tail;for(var q=null;P!==null;)P.alternate!==null&&(q=P),P=P.sibling;q===null?m.tail=null:q.sibling=null;break;case"collapsed":q=m.tail;for(var K=null;q!==null;)q.alternate!==null&&(K=q),q=q.sibling;K===null?P||m.tail===null?m.tail=null:m.tail.sibling=null:K.sibling=null}}function We(m){var P=m.alternate!==null&&m.alternate.child===m.child,q=0,K=0;if(P)for(var ne=m.child;ne!==null;)q|=ne.lanes|ne.childLanes,K|=ne.subtreeFlags&14680064,K|=ne.flags&14680064,ne.return=m,ne=ne.sibling;else for(ne=m.child;ne!==null;)q|=ne.lanes|ne.childLanes,K|=ne.subtreeFlags,K|=ne.flags,ne.return=m,ne=ne.sibling;return m.subtreeFlags|=K,m.childLanes=q,P}function Ve(m,P,q){var K=P.pendingProps;switch(Zs(P),P.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(P),null;case 1:return oi(P.type)&&Ri(),We(P),null;case 3:return q=P.stateNode,ci(),Jr(Ti),Jr(vi),ko(),q.pendingContext&&(q.context=q.pendingContext,q.pendingContext=null),(m===null||m.child===null)&&(X(P)?ue(P):m===null||m.memoizedState.isDehydrated&&(P.flags&256)===0||(P.flags|=1024,za!==null&&(Ku(za),za=null))),ye(m,P),We(P),null;case 5:es(P),q=bi(Co.current);var ne=P.type;if(m!==null&&P.stateNode!=null)we(m,P,ne,K,q),m.ref!==P.ref&&(P.flags|=512,P.flags|=2097152);else{if(!K){if(P.stateNode===null)throw Error(o(166));return We(P),null}if(m=bi(Bi.current),X(P)){if(!Le)throw Error(o(175));m=hr(P.stateNode,P.type,P.memoizedProps,q,m,P,!Qs),P.updateQueue=m,m!==null&&ue(P)}else{var le=H(ne,K,q,m,P);ge(le,P,!1,!1),P.stateNode=le,D(le,ne,K,q,m)&&ue(P)}P.ref!==null&&(P.flags|=512,P.flags|=2097152)}return We(P),null;case 6:if(m&&P.stateNode!=null)Ee(m,P,m.memoizedProps,K);else{if(typeof K!="string"&&P.stateNode===null)throw Error(o(166));if(m=bi(Co.current),q=bi(Bi.current),X(P)){if(!Le)throw Error(o(176));if(m=P.stateNode,q=P.memoizedProps,(K=Qr(m,q,P,!Qs))&&(ne=Xn,ne!==null))switch(ne.tag){case 3:mc(ne.stateNode.containerInfo,m,q,(ne.mode&1)!==0);break;case 5:Fn(ne.type,ne.memoizedProps,ne.stateNode,m,q,(ne.mode&1)!==0)}K&&ue(P)}else P.stateNode=ee(K,m,q,P)}return We(P),null;case 13:if(Jr(Xr),K=P.memoizedState,m===null||m.memoizedState!==null&&m.memoizedState.dehydrated!==null){if(nn&&mi!==null&&(P.mode&1)!==0&&(P.flags&128)===0)fe(),Ce(),P.flags|=98560,ne=!1;else if(ne=X(P),K!==null&&K.dehydrated!==null){if(m===null){if(!ne)throw Error(o(318));if(!Le)throw Error(o(344));if(ne=P.memoizedState,ne=ne!==null?ne.dehydrated:null,!ne)throw Error(o(317));Sn(ne,P)}else Ce(),(P.flags&128)===0&&(P.memoizedState=null),P.flags|=4;We(P),ne=!1}else za!==null&&(Ku(za),za=null),ne=!0;if(!ne)return P.flags&65536?P:null}return(P.flags&128)!==0?(P.lanes=q,P):(q=K!==null,q!==(m!==null&&m.memoizedState!==null)&&q&&(P.child.flags|=8192,(P.mode&1)!==0&&(m===null||(Xr.current&1)!==0?dn===0&&(dn=3):eo())),P.updateQueue!==null&&(P.flags|=4),We(P),null);case 4:return ci(),ye(m,P),m===null&&Pe(P.stateNode.containerInfo),We(P),null;case 10:return Pa(P.type._context),We(P),null;case 17:return oi(P.type)&&Ri(),We(P),null;case 19:if(Jr(Xr),ne=P.memoizedState,ne===null)return We(P),null;if(K=(P.flags&128)!==0,le=ne.rendering,le===null)if(K)Xe(ne,!1);else{if(dn!==0||m!==null&&(m.flags&128)!==0)for(m=P.child;m!==null;){if(le=fo(m),le!==null){for(P.flags|=128,Xe(ne,!1),m=le.updateQueue,m!==null&&(P.updateQueue=m,P.flags|=4),P.subtreeFlags=0,m=q,q=P.child;q!==null;)K=q,ne=m,K.flags&=14680066,le=K.alternate,le===null?(K.childLanes=0,K.lanes=ne,K.child=null,K.subtreeFlags=0,K.memoizedProps=null,K.memoizedState=null,K.updateQueue=null,K.dependencies=null,K.stateNode=null):(K.childLanes=le.childLanes,K.lanes=le.lanes,K.child=le.child,K.subtreeFlags=0,K.deletions=null,K.memoizedProps=le.memoizedProps,K.memoizedState=le.memoizedState,K.updateQueue=le.updateQueue,K.type=le.type,ne=le.dependencies,K.dependencies=ne===null?null:{lanes:ne.lanes,firstContext:ne.firstContext}),q=q.sibling;return Nr(Xr,Xr.current&1|2),P.child}m=m.sibling}ne.tail!==null&&Dn()>_u&&(P.flags|=128,K=!0,Xe(ne,!1),P.lanes=4194304)}else{if(!K)if(m=fo(le),m!==null){if(P.flags|=128,K=!0,m=m.updateQueue,m!==null&&(P.updateQueue=m,P.flags|=4),Xe(ne,!0),ne.tail===null&&ne.tailMode==="hidden"&&!le.alternate&&!nn)return We(P),null}else 2*Dn()-ne.renderingStartTime>_u&&q!==1073741824&&(P.flags|=128,K=!0,Xe(ne,!1),P.lanes=4194304);ne.isBackwards?(le.sibling=P.child,P.child=le):(m=ne.last,m!==null?m.sibling=le:P.child=le,ne.last=le)}return ne.tail!==null?(P=ne.tail,ne.rendering=P,ne.tail=P.sibling,ne.renderingStartTime=Dn(),P.sibling=null,m=Xr.current,Nr(Xr,K?m&1|2:m&1),P):(We(P),null);case 22:case 23:return xu(),q=P.memoizedState!==null,m!==null&&m.memoizedState!==null!==q&&(P.flags|=8192),q&&(P.mode&1)!==0?(ri&1073741824)!==0&&(We(P),me&&P.subtreeFlags&6&&(P.flags|=8192)):We(P),null;case 24:return null;case 25:return null}throw Error(o(156,P.tag))}function wt(m,P){switch(Zs(P),P.tag){case 1:return oi(P.type)&&Ri(),m=P.flags,m&65536?(P.flags=m&-65537|128,P):null;case 3:return ci(),Jr(Ti),Jr(vi),ko(),m=P.flags,(m&65536)!==0&&(m&128)===0?(P.flags=m&-65537|128,P):null;case 5:return es(P),null;case 13:if(Jr(Xr),m=P.memoizedState,m!==null&&m.dehydrated!==null){if(P.alternate===null)throw Error(o(340));Ce()}return m=P.flags,m&65536?(P.flags=m&-65537|128,P):null;case 19:return Jr(Xr),null;case 4:return ci(),null;case 10:return Pa(P.type._context),null;case 22:case 23:return xu(),null;case 24:return null;default:return null}}var st=!1,je=!1,qe=typeof WeakSet=="function"?WeakSet:Set,Ue=null;function ft(m,P){var q=m.ref;if(q!==null)if(typeof q=="function")try{q(null)}catch(K){$n(m,P,K)}else q.current=null}function vt(m,P,q){try{q()}catch(K){$n(m,P,K)}}var Vt=!1;function Bt(m,P){for(Z(m.containerInfo),Ue=P;Ue!==null;)if(m=Ue,P=m.child,(m.subtreeFlags&1028)!==0&&P!==null)P.return=m,Ue=P;else for(;Ue!==null;){m=Ue;try{var q=m.alternate;if((m.flags&1024)!==0)switch(m.tag){case 0:case 11:case 15:break;case 1:if(q!==null){var K=q.memoizedProps,ne=q.memoizedState,le=m.stateNode,xe=le.getSnapshotBeforeUpdate(m.elementType===m.type?K:$a(m.type,K),ne);le.__reactInternalSnapshotBeforeUpdate=xe}break;case 3:me&&Jt(m.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch($e){$n(m,m.return,$e)}if(P=m.sibling,P!==null){P.return=m.return,Ue=P;break}Ue=m.return}return q=Vt,Vt=!1,q}function lr(m,P,q){var K=P.updateQueue;if(K=K!==null?K.lastEffect:null,K!==null){var ne=K=K.next;do{if((ne.tag&m)===m){var le=ne.destroy;ne.destroy=void 0,le!==void 0&&vt(P,q,le)}ne=ne.next}while(ne!==K)}}function jt(m,P){if(P=P.updateQueue,P=P!==null?P.lastEffect:null,P!==null){var q=P=P.next;do{if((q.tag&m)===m){var K=q.create;q.destroy=K()}q=q.next}while(q!==P)}}function Br(m){var P=m.ref;if(P!==null){var q=m.stateNode;switch(m.tag){case 5:m=B(q);break;default:m=q}typeof P=="function"?P(m):P.current=m}}function Ur(m){var P=m.alternate;P!==null&&(m.alternate=null,Ur(P)),m.child=null,m.deletions=null,m.sibling=null,m.tag===5&&(P=m.stateNode,P!==null&&it(P)),m.stateNode=null,m.return=null,m.dependencies=null,m.memoizedProps=null,m.memoizedState=null,m.pendingProps=null,m.stateNode=null,m.updateQueue=null}function Ir(m){return m.tag===5||m.tag===3||m.tag===4}function xr(m){e:for(;;){for(;m.sibling===null;){if(m.return===null||Ir(m.return))return null;m=m.return}for(m.sibling.return=m.return,m=m.sibling;m.tag!==5&&m.tag!==6&&m.tag!==18;){if(m.flags&2||m.child===null||m.tag===4)continue e;m.child.return=m,m=m.child}if(!(m.flags&2))return m.stateNode}}function Zr(m,P,q){var K=m.tag;if(K===5||K===6)m=m.stateNode,P?It(q,m,P):Qe(q,m);else if(K!==4&&(m=m.child,m!==null))for(Zr(m,P,q),m=m.sibling;m!==null;)Zr(m,P,q),m=m.sibling}function tn(m,P,q){var K=m.tag;if(K===5||K===6)m=m.stateNode,P?Pt(q,m,P):He(q,m);else if(K!==4&&(m=m.child,m!==null))for(tn(m,P,q),m=m.sibling;m!==null;)tn(m,P,q),m=m.sibling}var tr=null,Hr=!1;function Rn(m,P,q){for(q=q.child;q!==null;)zn(m,P,q),q=q.sibling}function zn(m,P,q){if(si&&typeof si.onCommitFiberUnmount=="function")try{si.onCommitFiberUnmount(uo,q)}catch{}switch(q.tag){case 5:je||ft(q,P);case 6:if(me){var K=tr,ne=Hr;tr=null,Rn(m,P,q),tr=K,Hr=ne,tr!==null&&(Hr?Ie(tr,q.stateNode):qt(tr,q.stateNode))}else Rn(m,P,q);break;case 18:me&&tr!==null&&(Hr?Vo(tr,q.stateNode):_s(tr,q.stateNode));break;case 4:me?(K=tr,ne=Hr,tr=q.stateNode.containerInfo,Hr=!0,Rn(m,P,q),tr=K,Hr=ne):(_e&&(K=q.stateNode.containerInfo,ne=Tt(K),Je(K,ne)),Rn(m,P,q));break;case 0:case 11:case 14:case 15:if(!je&&(K=q.updateQueue,K!==null&&(K=K.lastEffect,K!==null))){ne=K=K.next;do{var le=ne,xe=le.destroy;le=le.tag,xe!==void 0&&((le&2)!==0||(le&4)!==0)&&vt(q,P,xe),ne=ne.next}while(ne!==K)}Rn(m,P,q);break;case 1:if(!je&&(ft(q,P),K=q.stateNode,typeof K.componentWillUnmount=="function"))try{K.props=q.memoizedProps,K.state=q.memoizedState,K.componentWillUnmount()}catch($e){$n(q,P,$e)}Rn(m,P,q);break;case 21:Rn(m,P,q);break;case 22:q.mode&1?(je=(K=je)||q.memoizedState!==null,Rn(m,P,q),je=K):Rn(m,P,q);break;default:Rn(m,P,q)}}function hi(m){var P=m.updateQueue;if(P!==null){m.updateQueue=null;var q=m.stateNode;q===null&&(q=m.stateNode=new qe),P.forEach(function(K){var ne=d0.bind(null,m,K);q.has(K)||(q.add(K),K.then(ne,ne))})}}function Ar(m,P){var q=P.deletions;if(q!==null)for(var K=0;K<q.length;K++){var ne=q[K];try{var le=m,xe=P;if(me){var $e=xe;e:for(;$e!==null;){switch($e.tag){case 5:tr=$e.stateNode,Hr=!1;break e;case 3:tr=$e.stateNode.containerInfo,Hr=!0;break e;case 4:tr=$e.stateNode.containerInfo,Hr=!0;break e}$e=$e.return}if(tr===null)throw Error(o(160));zn(le,xe,ne),tr=null,Hr=!1}else zn(le,xe,ne);var lt=ne.alternate;lt!==null&&(lt.return=null),ne.return=null}catch(Lt){$n(ne,P,Lt)}}if(P.subtreeFlags&12854)for(P=P.child;P!==null;)Vi(P,m),P=P.sibling}function Vi(m,P){var q=m.alternate,K=m.flags;switch(m.tag){case 0:case 11:case 14:case 15:if(Ar(P,m),An(m),K&4){try{lr(3,m,m.return),jt(3,m)}catch(Wt){$n(m,m.return,Wt)}try{lr(5,m,m.return)}catch(Wt){$n(m,m.return,Wt)}}break;case 1:Ar(P,m),An(m),K&512&&q!==null&&ft(q,q.return);break;case 5:if(Ar(P,m),An(m),K&512&&q!==null&&ft(q,q.return),me){if(m.flags&32){var ne=m.stateNode;try{ke(ne)}catch(Wt){$n(m,m.return,Wt)}}if(K&4&&(ne=m.stateNode,ne!=null)){var le=m.memoizedProps;if(q=q!==null?q.memoizedProps:le,K=m.type,P=m.updateQueue,m.updateQueue=null,P!==null)try{Ht(ne,P,K,q,le,m)}catch(Wt){$n(m,m.return,Wt)}}}break;case 6:if(Ar(P,m),An(m),K&4&&me){if(m.stateNode===null)throw Error(o(162));ne=m.stateNode,le=m.memoizedProps,q=q!==null?q.memoizedProps:le;try{Ze(ne,q,le)}catch(Wt){$n(m,m.return,Wt)}}break;case 3:if(Ar(P,m),An(m),K&4){if(me&&Le&&q!==null&&q.memoizedState.isDehydrated)try{Si(P.containerInfo)}catch(Wt){$n(m,m.return,Wt)}if(_e){ne=P.containerInfo,le=P.pendingChildren;try{Je(ne,le)}catch(Wt){$n(m,m.return,Wt)}}}break;case 4:if(Ar(P,m),An(m),K&4&&_e){le=m.stateNode,ne=le.containerInfo,le=le.pendingChildren;try{Je(ne,le)}catch(Wt){$n(m,m.return,Wt)}}break;case 13:Ar(P,m),An(m),ne=m.child,ne.flags&8192&&(le=ne.memoizedState!==null,ne.stateNode.isHidden=le,!le||ne.alternate!==null&&ne.alternate.memoizedState!==null||(wu=Dn())),K&4&&hi(m);break;case 22:var xe=q!==null&&q.memoizedState!==null;if(m.mode&1?(je=(q=je)||xe,Ar(P,m),je=q):Ar(P,m),An(m),K&8192){if(q=m.memoizedState!==null,(m.stateNode.isHidden=q)&&!xe&&(m.mode&1)!==0)for(Ue=m,K=m.child;K!==null;){for(P=Ue=K;Ue!==null;){xe=Ue;var $e=xe.child;switch(xe.tag){case 0:case 11:case 14:case 15:lr(4,xe,xe.return);break;case 1:ft(xe,xe.return);var lt=xe.stateNode;if(typeof lt.componentWillUnmount=="function"){var Lt=xe,er=xe.return;try{var Er=Lt;lt.props=Er.memoizedProps,lt.state=Er.memoizedState,lt.componentWillUnmount()}catch(Wt){$n(Lt,er,Wt)}}break;case 5:ft(xe,xe.return);break;case 22:if(xe.memoizedState!==null){ga(P);continue}}$e!==null?($e.return=xe,Ue=$e):ga(P)}K=K.sibling}if(me){e:if(K=null,me)for(P=m;;){if(P.tag===5){if(K===null){K=P;try{ne=P.stateNode,q?ut(ne):Ct(P.stateNode,P.memoizedProps)}catch(Wt){$n(m,m.return,Wt)}}}else if(P.tag===6){if(K===null)try{le=P.stateNode,q?Nt(le):St(le,P.memoizedProps)}catch(Wt){$n(m,m.return,Wt)}}else if((P.tag!==22&&P.tag!==23||P.memoizedState===null||P===m)&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===m)break e;for(;P.sibling===null;){if(P.return===null||P.return===m)break e;K===P&&(K=null),P=P.return}K===P&&(K=null),P.sibling.return=P.return,P=P.sibling}}}break;case 19:Ar(P,m),An(m),K&4&&hi(m);break;case 21:break;default:Ar(P,m),An(m)}}function An(m){var P=m.flags;if(P&2){try{if(me){e:{for(var q=m.return;q!==null;){if(Ir(q)){var K=q;break e}q=q.return}throw Error(o(160))}switch(K.tag){case 5:var ne=K.stateNode;K.flags&32&&(ke(ne),K.flags&=-33);var le=xr(m);tn(m,le,ne);break;case 3:case 4:var xe=K.stateNode.containerInfo,$e=xr(m);Zr(m,$e,xe);break;default:throw Error(o(161))}}}catch(lt){$n(m,m.return,lt)}m.flags&=-3}P&4096&&(m.flags&=-4097)}function Un(m,P,q){Ue=m,di(m)}function di(m,P,q){for(var K=(m.mode&1)!==0;Ue!==null;){var ne=Ue,le=ne.child;if(ne.tag===22&&K){var xe=ne.memoizedState!==null||st;if(!xe){var $e=ne.alternate,lt=$e!==null&&$e.memoizedState!==null||je;$e=st;var Lt=je;if(st=xe,(je=lt)&&!Lt)for(Ue=ne;Ue!==null;)xe=Ue,lt=xe.child,xe.tag===22&&xe.memoizedState!==null?Ya(ne):lt!==null?(lt.return=xe,Ue=lt):Ya(ne);for(;le!==null;)Ue=le,di(le),le=le.sibling;Ue=ne,st=$e,je=Lt}Oi(m)}else(ne.subtreeFlags&8772)!==0&&le!==null?(le.return=ne,Ue=le):Oi(m)}}function Oi(m){for(;Ue!==null;){var P=Ue;if((P.flags&8772)!==0){var q=P.alternate;try{if((P.flags&8772)!==0)switch(P.tag){case 0:case 11:case 15:je||jt(5,P);break;case 1:var K=P.stateNode;if(P.flags&4&&!je)if(q===null)K.componentDidMount();else{var ne=P.elementType===P.type?q.memoizedProps:$a(P.type,q.memoizedProps);K.componentDidUpdate(ne,q.memoizedState,K.__reactInternalSnapshotBeforeUpdate)}var le=P.updateQueue;le!==null&&Hu(P,le,K);break;case 3:var xe=P.updateQueue;if(xe!==null){if(q=null,P.child!==null)switch(P.child.tag){case 5:q=B(P.child.stateNode);break;case 1:q=P.child.stateNode}Hu(P,xe,q)}break;case 5:var $e=P.stateNode;q===null&&P.flags&4&&tt($e,P.type,P.memoizedProps,P);break;case 6:break;case 4:break;case 12:break;case 13:if(Le&&P.memoizedState===null){var lt=P.alternate;if(lt!==null){var Lt=lt.memoizedState;if(Lt!==null){var er=Lt.dehydrated;er!==null&&fa(er)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}je||P.flags&512&&Br(P)}catch(Er){$n(P,P.return,Er)}}if(P===m){Ue=null;break}if(q=P.sibling,q!==null){q.return=P.return,Ue=q;break}Ue=P.return}}function ga(m){for(;Ue!==null;){var P=Ue;if(P===m){Ue=null;break}var q=P.sibling;if(q!==null){q.return=P.return,Ue=q;break}Ue=P.return}}function Ya(m){for(;Ue!==null;){var P=Ue;try{switch(P.tag){case 0:case 11:case 15:var q=P.return;try{jt(4,P)}catch(lt){$n(P,q,lt)}break;case 1:var K=P.stateNode;if(typeof K.componentDidMount=="function"){var ne=P.return;try{K.componentDidMount()}catch(lt){$n(P,ne,lt)}}var le=P.return;try{Br(P)}catch(lt){$n(P,le,lt)}break;case 5:var xe=P.return;try{Br(P)}catch(lt){$n(P,xe,lt)}}}catch(lt){$n(P,P.return,lt)}if(P===m){Ue=null;break}var $e=P.sibling;if($e!==null){$e.return=P.return,Ue=$e;break}Ue=P.return}}var wn=0,Hn=1,oa=2,Do=3,vo=4;if(typeof Symbol=="function"&&Symbol.for){var qr=Symbol.for;wn=qr("selector.component"),Hn=qr("selector.has_pseudo_class"),oa=qr("selector.role"),Do=qr("selector.test_id"),vo=qr("selector.text")}function mo(m){var P=Re(m);if(P!=null){if(typeof P.memoizedProps["data-testname"]!="string")throw Error(o(364));return P}if(m=Te(m),m===null)throw Error(o(362));return m.stateNode.current}function yu(m,P){switch(P.$$typeof){case wn:if(m.type===P.value)return!0;break;case Hn:e:{P=P.value,m=[m,0];for(var q=0;q<m.length;){var K=m[q++],ne=m[q++],le=P[ne];if(K.tag!==5||!Me(K)){for(;le!=null&&yu(K,le);)ne++,le=P[ne];if(ne===P.length){P=!0;break e}else for(K=K.child;K!==null;)m.push(K,ne),K=K.sibling}}P=!1}return P;case oa:if(m.tag===5&&ze(m.stateNode,P.value))return!0;break;case vo:if((m.tag===5||m.tag===6)&&(m=Oe(m),m!==null&&0<=m.indexOf(P.value)))return!0;break;case Do:if(m.tag===5&&(m=m.memoizedProps["data-testname"],typeof m=="string"&&m.toLowerCase()===P.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function Xu(m){switch(m.$$typeof){case wn:return"<"+(L(m.value)||"Unknown")+">";case Hn:return":has("+(Xu(m)||"")+")";case oa:return'[role="'+m.value+'"]';case vo:return'"'+m.value+'"';case Do:return'[data-testname="'+m.value+'"]';default:throw Error(o(365))}}function Xa(m,P){var q=[];m=[m,0];for(var K=0;K<m.length;){var ne=m[K++],le=m[K++],xe=P[le];if(ne.tag!==5||!Me(ne)){for(;xe!=null&&yu(ne,xe);)le++,xe=P[le];if(le===P.length)q.push(ne);else for(ne=ne.child;ne!==null;)m.push(ne,le),ne=ne.sibling}}return q}function Aa(m,P){if(!Ae)throw Error(o(363));m=mo(m),m=Xa(m,P),P=[],m=Array.from(m);for(var q=0;q<m.length;){var K=m[q++];if(K.tag===5)Me(K)||P.push(K.stateNode);else for(K=K.child;K!==null;)m.push(K),K=K.sibling}return P}var kl=Math.ceil,va=s.ReactCurrentDispatcher,Bo=s.ReactCurrentOwner,yn=s.ReactCurrentBatchConfig,_r=0,rn=null,Cn=null,Mn=0,ri=0,qo=gi(0),dn=0,bu=null,Ts=0,pn=0,Ka=0,Ll=null,sa=null,wu=0,_u=1/0,Ai=null;function ln(){_u=Dn()+500}var Gn=!1,Vn=null,Za=null,yo=!1,Qa=null,xc=0,Wn=0,Su=null,ol=-1,Ja=0;function _n(){return(_r&6)!==0?Dn():ol!==-1?ol:ol=Dn()}function pi(m){return(m.mode&1)===0?1:(_r&2)!==0&&Mn!==0?Mn&-Mn:Ke.transition!==null?(Ja===0&&(Ja=Es()),Ja):(m=Dt,m!==0?m:ve())}function la(m,P,q,K){if(50<Wn)throw Wn=0,Su=null,Error(o(185));mn(m,q,K),((_r&2)===0||m!==rn)&&(m===rn&&((_r&2)===0&&(pn|=q),dn===4&&os(m,Mn)),Wi(m,K),q===1&&_r===0&&(P.mode&1)===0&&(ln(),Ao&&li()))}function Wi(m,P){var q=m.callbackNode;$o(m,P);var K=$s(m,m===rn?Mn:0);if(K===0)q!==null&&Oo(q),m.callbackNode=null,m.callbackPriority=0;else if(P=K&-K,m.callbackPriority!==P){if(q!=null&&Oo(q),P===1)m.tag===0?Uu(ff.bind(null,m)):gl(ff.bind(null,m)),Se?be(function(){(_r&6)===0&&li()}):lo(Ks,li),q=null;else{switch(Ys(K)){case 1:q=Ks;break;case 4:q=au;break;case 16:q=ou;break;case 536870912:q=of;break;default:q=ou}q=Uh(q,Rs.bind(null,m))}m.callbackPriority=P,m.callbackNode=q}}function Rs(m,P){if(ol=-1,Ja=0,(_r&6)!==0)throw Error(o(327));var q=m.callbackNode;if(Tl()&&m.callbackNode!==q)return null;var K=$s(m,m===rn?Mn:0);if(K===0)return null;if((K&30)!==0||(K&m.expiredLanes)!==0||P)P=ls(m,K);else{P=K;var ne=_r;_r|=2;var le=ss();(rn!==m||Mn!==P)&&(Ai=null,ln(),zo(m,P));do try{Oc();break}catch($e){Ca(m,$e)}while(!0);Ua(),va.current=le,_r=ne,Cn!==null?P=0:(rn=null,Mn=0,P=dn)}if(P!==0){if(P===2&&(ne=xs(m),ne!==0&&(K=ne,P=Ec(m,ne))),P===1)throw q=bu,zo(m,0),os(m,K),Wi(m,Dn()),q;if(P===6)os(m,K);else{if(ne=m.current.alternate,(K&30)===0&&!Wf(ne)&&(P=ls(m,K),P===2&&(le=xs(m),le!==0&&(K=le,P=Ec(m,le))),P===1))throw q=bu,zo(m,0),os(m,K),Wi(m,Dn()),q;switch(m.finishedWork=ne,m.finishedLanes=K,P){case 0:case 1:throw Error(o(345));case 2:us(m,sa,Ai);break;case 3:if(os(m,K),(K&130023424)===K&&(P=wu+500-Dn(),10<P)){if($s(m,0)!==0)break;if(ne=m.suspendedLanes,(ne&K)!==K){_n(),m.pingedLanes|=m.suspendedLanes≠break}m.timeoutHandle=te(us.bind(null,m,sa,Ai),P);break}us(m,sa,Ai);break;case 4:if(os(m,K),(K&4194240)===K)break;for(P=m.eventTimes,ne=-1;0<K;){var xe=31-da(K);le=1<<xe,xe=P[xe],xe>ne&&(ne=xe),K&=~le}if(K=ne,K=Dn()-K,K=(120>K?120:480>K?480:1080>K?1080:1920>K?1920:3e3>K?3e3:4320>K?4320:1960*kl(K/1960))-K,10<K){m.timeoutHandle=te(us.bind(null,m,sa,Ai),K);break}us(m,sa,Ai);break;case 5:us(m,sa,Ai);break;default:throw Error(o(329))}}}return Wi(m,Dn()),m.callbackNode===q?Rs.bind(null,m):null}function Ec(m,P){var q=Ll;return m.current.memoizedState.isDehydrated&&(zo(m,P).flags|=256),m=ls(m,P),m!==2&&(P=sa,sa=q,P!==null&&Ku(P)),m}function Ku(m){sa===null?sa=m:sa.push.apply(sa,m)}function Wf(m){for(var P=m;;){if(P.flags&16384){var q=P.updateQueue;if(q!==null&&(q=q.stores,q!==null))for(var K=0;K<q.length;K++){var ne=q[K],le=ne.getSnapshot;ne=ne.value;try{if(!Mi(le(),ne))return!1}catch{return!1}}}if(q=P.child,P.subtreeFlags&16384&&q!==null)q.return=P,P=q;else{if(P===m)break;for(;P.sibling===null;){if(P.return===null||P.return===m)return!0;P=P.return}P.sibling.return=P.return,P=P.sibling}}return!0}function os(m,P){for(P&=~Ka,P&=~pn,m.suspendedLanes|=P,m.pingedLanes&=~P,m=m.expirationTimes;0<P;){var q=31-da(P),K=1<<q;m[q]=-1,P&=~K}}function ff(m){if((_r&6)!==0)throw Error(o(327));Tl();var P=$s(m,0);if((P&1)===0)return Wi(m,Dn()),null;var q=ls(m,P);if(m.tag!==0&&q===2){var K=xs(m);K!==0&&(P=K,q=Ec(m,K))}if(q===1)throw q=bu,zo(m,0),os(m,P),Wi(m,Dn()),q;if(q===6)throw Error(o(345));return m.finishedWork=m.current.alternate,m.finishedLanes=P,us(m,sa,Ai),Wi(m,Dn()),null}function Nl(m){Qa!==null&&Qa.tag===0&&(_r&6)===0&&Tl();var P=_r;_r|=1;var q=yn.transition,K=Dt;try{if(yn.transition=null,Dt=1,m)return m()}finally{Dt=K,yn.transition=q,_r=P,(_r&6)===0&&li()}}function xu(){ri=qo.current,Jr(qo)}function zo(m,P){m.finishedWork=null,m.finishedLanes=0;var q=m.timeoutHandle;if(q!==se&&(m.timeoutHandle=se,ae(q)),Cn!==null)for(q=Cn.return;q!==null;){var K=q;switch(Zs(K),K.tag){case 1:K=K.type.childContextTypes,K!=null&&Ri();break;case 3:ci(),Jr(Ti),Jr(vi),ko();break;case 5:es(K);break;case 4:ci();break;case 13:Jr(Xr);break;case 19:Jr(Xr);break;case 10:Pa(K.type._context);break;case 22:case 23:xu()}q=q.return}if(rn=m,Cn=m=Eu(m.current,null),Mn=ri=P,dn=0,bu=null,Ka=pn=Ts=0,sa=Ll=null,Ha!==null){for(P=0;P<Ha.length;P++)if(q=Ha[P],K=q.interleaved,K!==null){q.interleaved=null;var ne=K.next,le=q.pending;if(le!==null){var xe=le.next;le.next=ne,K.next=xe}q.pending=K}Ha=null}return m}function Ca(m,P){do{var q=Cn;try{if(Ua(),Dr.current=Ls,ts){for(var K=Mr.memoizedState;K!==null;){var ne=K.queue;ne!==null&&(ne.pending=null),K=K.next}ts=!1}if(Kn=0,Zn=On=Mr=null,No=!1,To=0,Bo.current=null,q===null||q.return===null){dn=1,bu=P,Cn=null;break}e:{var le=m,xe=q.return,$e=q,lt=P;if(P=Mn,$e.flags|=32768,lt!==null&&typeof lt=="object"&&typeof lt.then=="function"){var Lt=lt,er=$e,Er=er.tag;if((er.mode&1)===0&&(Er===0||Er===11||Er===15)){var Wt=er.alternate;Wt?(er.updateQueue=Wt.updateQueue,er.memoizedState=Wt.memoizedState,er.lanes=Wt.lanes):(er.updateQueue=null,er.memoizedState=null)}var In=Gf(xe);if(In!==null){In.flags&=-257,Ns(In,xe,$e,le,P),In.mode&1&&Hf(le,Lt,P),P=In,lt=Lt;var bn=P.updateQueue;if(bn===null){var to=new Set;to.add(lt),P.updateQueue=to}else bn.add(lt);break e}else{if((P&1)===0){Hf(le,Lt,P),eo();break e}lt=Error(o(426))}}else if(nn&&$e.mode&1){var sl=Gf(xe);if(sl!==null){(sl.flags&65536)===0&&(sl.flags|=256),Ns(sl,xe,$e,le,P),Fe(Hi(lt,$e));break e}}le=lt=Hi(lt,$e),dn!==4&&(dn=2),Ll===null?Ll=[le]:Ll.push(le),le=xe;do{switch(le.tag){case 3:le.flags|=65536,P&=-P,le.lanes|=P;var at=Gi(le,lt,P);tl(le,at);break e;case 1:$e=lt;var Ye=le.type,dt=le.stateNode;if((le.flags&128)===0&&(typeof Ye.getDerivedStateFromError=="function"||dt!==null&&typeof dt.componentDidCatch=="function"&&(Za===null||!Za.has(dt)))){le.flags|=65536,P&=-P,le.lanes|=P;var $t=pa(le,$e,P);tl(le,$t);break e}}le=le.return}while(le!==null)}Zu(q)}catch(dr){P=dr,Cn===q&&q!==null&&(Cn=q=q.return);continue}break}while(!0)}function ss(){var m=va.current;return va.current=Ls,m===null?Ls:m}function eo(){(dn===0||dn===3||dn===2)&&(dn=4),rn===null||(Ts&268435455)===0&&(pn&268435455)===0||os(rn,Mn)}function ls(m,P){var q=_r;_r|=2;var K=ss();(rn!==m||Mn!==P)&&(Ai=null,zo(m,P));do try{Pc();break}catch(ne){Ca(m,ne)}while(!0);if(Ua(),_r=q,va.current=K,Cn!==null)throw Error(o(261));return rn=null,Mn=0,dn}function Pc(){for(;Cn!==null;)hf(Cn)}function Oc(){for(;Cn!==null&&!zu();)hf(Cn)}function hf(m){var P=Mp(m.alternate,m,ri);m.memoizedProps=m.pendingProps,P===null?Zu(m):Cn=P,Bo.current=null}function Zu(m){var P=m;do{var q=P.alternate;if(m=P.return,(P.flags&32768)===0){if(q=Ve(q,P,ri),q!==null){Cn=q;return}}else{if(q=wt(q,P),q!==null){q.flags&=32767,Cn=q;return}if(m!==null)m.flags|=32768,m.subtreeFlags=0,m.deletions=null;else{dn=6,Cn=null;return}}if(P=P.sibling,P!==null){Cn=P;return}Cn=P=m}while(P!==null);dn===0&&(dn=5)}function us(m,P,q){var K=Dt,ne=yn.transition;try{yn.transition=null,Dt=1,Lp(m,P,q,K)}finally{yn.transition=ne,Dt=K}return null}function Lp(m,P,q,K){do Tl();while(Qa!==null);if((_r&6)!==0)throw Error(o(327));q=m.finishedWork;var ne=m.finishedLanes;if(q===null)return null;if(m.finishedWork=null,m.finishedLanes=0,q===m.current)throw Error(o(177));m.callbackNode=null,m.callbackPriority=0;var le=q.lanes|q.childLanes;if(Yo(m,le),m===rn&&(Cn=rn=null,Mn=0),(q.subtreeFlags&2064)===0&&(q.flags&2064)===0||yo||(yo=!0,Uh(ou,function(){return Tl(),null})),le=(q.flags&15990)!==0,(q.subtreeFlags&15990)!==0||le){le=yn.transition,yn.transition=null;var xe=Dt;Dt=1;var $e=_r;_r|=4,Bo.current=null,Bt(m,q),Vi(q,m),V(m.containerInfo),m.current=q,Un(q),Xs(),_r=$e,Dt=xe,yn.transition=le}else m.current=q;if(yo&&(yo=!1,Qa=m,xc=ne),le=m.pendingLanes,le===0&&(Za=null),Da(q.stateNode),Wi(m,Dn()),P!==null)for(K=m.onRecoverableError,q=0;q<P.length;q++)ne=P[q],K(ne.value,{componentStack:ne.stack,digest:ne.digest});if(Gn)throw Gn=!1,m=Vn,Vn=null,m;return(xc&1)!==0&&m.tag!==0&&Tl(),le=m.pendingLanes,(le&1)!==0?m===Su?Wn++:(Wn=0,Su=m):Wn=0,li(),null}function Tl(){if(Qa!==null){var m=Ys(xc),P=yn.transition,q=Dt;try{if(yn.transition=null,Dt=16>m?16:m,Qa===null)var K=!1;else{if(m=Qa,Qa=null,xc=0,(_r&6)!==0)throw Error(o(331));var ne=_r;for(_r|=4,Ue=m.current;Ue!==null;){var le=Ue,xe=le.child;if((Ue.flags&16)!==0){var $e=le.deletions;if($e!==null){for(var lt=0;lt<$e.length;lt++){var Lt=$e[lt];for(Ue=Lt;Ue!==null;){var er=Ue;switch(er.tag){case 0:case 11:case 15:lr(8,er,le)}var Er=er.child;if(Er!==null)Er.return=er,Ue=Er;else for(;Ue!==null;){er=Ue;var Wt=er.sibling,In=er.return;if(Ur(er),er===Lt){Ue=null;break}if(Wt!==null){Wt.return=In,Ue=Wt;break}Ue=In}}}var bn=le.alternate;if(bn!==null){var to=bn.child;if(to!==null){bn.child=null;do{var sl=to.sibling;to.sibling=null,to=sl}while(to!==null)}}Ue=le}}if((le.subtreeFlags&2064)!==0&&xe!==null)xe.return=le,Ue=xe;else e:for(;Ue!==null;){if(le=Ue,(le.flags&2048)!==0)switch(le.tag){case 0:case 11:case 15:lr(9,le,le.return)}var at=le.sibling;if(at!==null){at.return=le.return,Ue=at;break e}Ue=le.return}}var Ye=m.current;for(Ue=Ye;Ue!==null;){xe=Ue;var dt=xe.child;if((xe.subtreeFlags&2064)!==0&&dt!==null)dt.return=xe,Ue=dt;else e:for(xe=Ye;Ue!==null;){if($e=Ue,($e.flags&2048)!==0)try{switch($e.tag){case 0:case 11:case 15:jt(9,$e)}}catch(dr){$n($e,$e.return,dr)}if($e===xe){Ue=null;break e}var $t=$e.sibling;if($t!==null){$t.return=$e.return,Ue=$t;break e}Ue=$e.return}}if(_r=ne,li(),si&&typeof si.onPostCommitFiberRoot=="function")try{si.onPostCommitFiberRoot(uo,m)}catch{}K=!0}return K}finally{Dt=q,yn.transition=P}}return!1}function zh(m,P,q){P=Hi(q,P),P=Gi(m,P,1),m=Ga(m,P,1),P=_n(),m!==null&&(mn(m,1,P),Wi(m,P))}function $n(m,P,q){if(m.tag===3)zh(m,m,q);else for(;P!==null;){if(P.tag===3){zh(P,m,q);break}else if(P.tag===1){var K=P.stateNode;if(typeof P.type.getDerivedStateFromError=="function"||typeof K.componentDidCatch=="function"&&(Za===null||!Za.has(K))){m=Hi(q,m),m=pa(P,m,1),P=Ga(P,m,1),m=_n(),P!==null&&(mn(P,1,m),Wi(P,m));break}}P=P.return}}function Np(m,P,q){var K=m.pingCache;K!==null&&K.delete(P),P=_n(),m.pingedLanes|=m.suspendedLanes&q,rn===m&&(Mn&q)===q&&(dn===4||dn===3&&(Mn&130023424)===Mn&&500>Dn()-wu?zo(m,0):Ka|=q),Wi(m,P)}function Tp(m,P){P===0&&((m.mode&1)===0?P=1:(P=Ss,Ss<<=1,(Ss&130023424)===0&&(Ss=4194304)));var q=_n();m=ra(m,P),m!==null&&(mn(m,P,q),Wi(m,q))}function Rp(m){var P=m.memoizedState,q=0;P!==null&&(q=P.retryLane),Tp(m,q)}function d0(m,P){var q=0;switch(m.tag){case 13:var K=m.stateNode,ne=m.memoizedState;ne!==null&&(q=ne.retryLane);break;case 19:K=m.stateNode;break;default:throw Error(o(314))}K!==null&&K.delete(P),Tp(m,q)}var Mp;Mp=function(m,P,q){if(m!==null)if(m.memoizedProps!==P.pendingProps||Ti.current)fi=!0;else{if((m.lanes&q)===0&&(P.flags&128)===0)return fi=!1,oe(m,P,q);fi=(m.flags&131072)!==0}else fi=!1,nn&&(P.flags&1048576)!==0&&lu(P,xa,P.index);switch(P.lanes=0,P.tag){case 2:var K=P.type;G(m,P),m=P.pendingProps;var ne=ja(P,vi.current);Qo(P,q),ne=Ro(null,P,K,m,ne,q);var le=Mo();return P.flags|=1,typeof ne=="object"&&ne!==null&&typeof ne.render=="function"&&ne.$$typeof===void 0?(P.tag=1,P.memoizedState=null,P.updateQueue=null,oi(K)?(le=!0,Wo(P)):le=!1,P.memoizedState=ne.state!==null&&ne.state!==void 0?ne.state:null,el(P),ne.updater=$u,P.stateNode=ne,ne._reactInternals=P,Ui(P,K,m,q),P=ia(null,P,K,!0,le,q)):(P.tag=0,nn&&le&&As(P),_i(null,P,ne,q),P=P.child),P;case 16:K=P.elementType;e:{switch(G(m,P),m=P.pendingProps,ne=K._init,K=ne(K._payload),P.type=K,ne=P.tag=p0(K),m=$a(K,m),ne){case 0:P=ns(null,P,K,m,q);break e;case 1:P=Pi(null,P,K,m,q);break e;case 11:P=Sc(null,P,K,m,q);break e;case 14:P=rs(null,P,K,$a(K.type,m),q);break e}throw Error(o(306,K,""))}return P;case 0:return K=P.type,ne=P.pendingProps,ne=P.elementType===K?ne:$a(K,ne),ns(m,P,K,ne,q);case 1:return K=P.type,ne=P.pendingProps,ne=P.elementType===K?ne:$a(K,ne),Pi(m,P,K,ne,q);case 3:e:{if(al(P),m===null)throw Error(o(387));K=P.pendingProps,le=P.memoizedState,ne=le.element,wl(m,P),co(P,K,null,q);var xe=P.memoizedState;if(K=xe.element,Le&&le.isDehydrated)if(le={element:K,isDehydrated:!1,cache:xe.cache,pendingSuspenseBoundaries:xe.pendingSuspenseBoundaries,transitions:xe.transitions},P.updateQueue.baseState=le,P.memoizedState=le,P.flags&256){ne=Hi(Error(o(423)),P),P=Al(m,P,K,q,ne);break e}else if(K!==ne){ne=Hi(Error(o(424)),P),P=Al(m,P,K,q,ne);break e}else for(Le&&(mi=Ft(P.stateNode.containerInfo),Xn=P,nn=!0,za=null,Qs=!1),q=Nn(P,null,K,q),P.child=q;q;)q.flags=q.flags&-3|4096,q=q.sibling;else{if(Ce(),K===ne){P=re(m,P,q);break e}_i(m,P,K,q)}P=P.child}return P;case 5:return qi(P),m===null&&Ko(P),K=P.type,ne=P.pendingProps,le=m!==null?m.memoizedProps:null,xe=ne.children,Q(K,ne)?xe=null:le!==null&&Q(K,le)&&(P.flags|=32),sn(m,P),_i(m,P,xe,q),P.child;case 6:return m===null&&Ko(P),null;case 13:return cf(m,P,q);case 4:return Jo(P,P.stateNode.containerInfo),K=P.pendingProps,m===null?P.child=Or(P,null,K,q):_i(m,P,K,q),P.child;case 11:return K=P.type,ne=P.pendingProps,ne=P.elementType===K?ne:$a(K,ne),Sc(m,P,K,ne,q);case 7:return _i(m,P,P.pendingProps,q),P.child;case 8:return _i(m,P,P.pendingProps.children,q),P.child;case 12:return _i(m,P,P.pendingProps.children,q),P.child;case 10:e:{if(K=P.type._context,ne=P.pendingProps,le=P.memoizedProps,xe=ne.value,Ea(P,K,xe),le!==null)if(Mi(le.value,xe)){if(le.children===ne.children&&!Ti.current){P=re(m,P,q);break e}}else for(le=P.child,le!==null&&(le.return=P);le!==null;){var $e=le.dependencies;if($e!==null){xe=le.child;for(var lt=$e.firstContext;lt!==null;){if(lt.context===K){if(le.tag===1){lt=Oa(-1,q&-q),lt.tag=2;var Lt=le.updateQueue;if(Lt!==null){Lt=Lt.shared;var er=Lt.pending;er===null?lt.next=lt:(lt.next=er.next,er.next=lt),Lt.pending=lt}}le.lanes|=q,lt=le.alternate,lt!==null&&(lt.lanes|=q),Zo(le.return,q,P),$e.lanes|=q;break}lt=lt.next}}else if(le.tag===10)xe=le.type===P.type?null:le.child;else if(le.tag===18){if(xe=le.return,xe===null)throw Error(o(341));xe.lanes|=q,$e=xe.alternate,$e!==null&&($e.lanes|=q),Zo(xe,q,P),xe=le.sibling}else xe=le.child;if(xe!==null)xe.return=le;else for(xe=le;xe!==null;){if(xe===P){xe=null;break}if(le=xe.sibling,le!==null){le.return=xe.return,xe=le;break}xe=xe.return}le=xe}_i(m,P,ne.children,q),P=P.child}return P;case 9:return ne=P.type,K=P.pendingProps.children,Qo(P,q),ne=Di(ne),K=K(ne),P.flags|=1,_i(m,P,K,q),P.child;case 14:return K=P.type,ne=$a(K,P.pendingProps),ne=$a(K.type,ne),rs(m,P,K,ne,q);case 15:return go(m,P,P.type,P.pendingProps,q);case 17:return K=P.type,ne=P.pendingProps,ne=P.elementType===K?ne:$a(K,ne),G(m,P),P.tag=1,oi(K)?(m=!0,Wo(P)):m=!1,Qo(P,q),Uf(P,K,ne),Ui(P,K,ne,q),ia(null,P,K,!0,m,q);case 19:return M(m,P,q);case 22:return en(m,P,q)}throw Error(o(156,P.tag))};function Uh(m,P){return lo(m,P)}function Ip(m,P,q,K){this.tag=m,this.key=q,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=P,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=K,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Uo(m,P,q,K){return new Ip(m,P,q,K)}function Ac(m){return m=m.prototype,!(!m||!m.isReactComponent)}function p0(m){if(typeof m=="function")return Ac(m)?1:0;if(m!=null){if(m=m.$$typeof,m===E)return 11;if(m===y)return 14}return 2}function Eu(m,P){var q=m.alternate;return q===null?(q=Uo(m.tag,P,m.key,m.mode),q.elementType=m.elementType,q.type=m.type,q.stateNode=m.stateNode,q.alternate=m,m.alternate=q):(q.pendingProps=P,q.type=m.type,q.flags=0,q.subtreeFlags=0,q.deletions=null),q.flags=m.flags&14680064,q.childLanes=m.childLanes,q.lanes=m.lanes,q.child=m.child,q.memoizedProps=m.memoizedProps,q.memoizedState=m.memoizedState,q.updateQueue=m.updateQueue,P=m.dependencies,q.dependencies=P===null?null:{lanes:P.lanes,firstContext:P.firstContext},q.sibling=m.sibling,q.index=m.index,q.ref=m.ref,q}function $f(m,P,q,K,ne,le){var xe=2;if(K=m,typeof m=="function")Ac(m)&&(xe=1);else if(typeof m=="string")xe=5;else e:switch(m){case h:return ma(q.children,ne,le,P);case p:xe=8,ne|=8;break;case v:return m=Uo(12,q,P,ne|2),m.elementType=v,m.lanes=le,m;case w:return m=Uo(13,q,P,ne),m.elementType=w,m.lanes=le,m;case x:return m=Uo(19,q,P,ne),m.elementType=x,m.lanes=le,m;case S:return Cc(q,ne,le,P);default:if(typeof m=="object"&&m!==null)switch(m.$$typeof){case f:xe=10;break e;case _:xe=9;break e;case E:xe=11;break e;case y:xe=14;break e;case g:xe=16,K=null;break e}throw Error(o(130,m==null?m:typeof m,""))}return P=Uo(xe,q,P,ne),P.elementType=m,P.type=K,P.lanes=le,P}function ma(m,P,q,K){return m=Uo(7,m,K,P),m.lanes=q,m}function Cc(m,P,q,K){return m=Uo(22,m,K,P),m.elementType=S,m.lanes=q,m.stateNode={isHidden:!1},m}function kc(m,P,q){return m=Uo(6,m,null,P),m.lanes=q,m}function Yf(m,P,q){return P=Uo(4,m.children!==null?m.children:[],m.key,P),P.lanes=q,P.stateNode={containerInfo:m.containerInfo,pendingChildren:null,implementation:m.implementation},P}function jp(m,P,q,K,ne){this.tag=P,this.containerInfo=m,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=se,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ps(0),this.expirationTimes=Ps(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ps(0),this.identifierPrefix=K,this.onRecoverableError=ne,Le&&(this.mutableSourceEagerHydrationData=null)}function Hh(m,P,q,K,ne,le,xe,$e,lt){return m=new jp(m,P,q,$e,lt),P===1?(P=1,le===!0&&(P|=8)):P=0,le=Uo(3,null,null,P),m.current=le,le.stateNode=m,le.memoizedState={element:K,isDehydrated:q,cache:null,transitions:null,pendingSuspenseBoundaries:null},el(le),m}function Xf(m){if(!m)return cn;m=m._reactInternals;e:{if(F(m)!==m||m.tag!==1)throw Error(o(170));var P=m;do{switch(P.tag){case 3:P=P.stateNode.context;break e;case 1:if(oi(P.type)){P=P.stateNode.__reactInternalMemoizedMergedChildContext;break e}}P=P.return}while(P!==null);throw Error(o(171))}if(m.tag===1){var q=m.type;if(oi(q))return ha(m,q,P)}return P}function Qu(m){var P=m._reactInternals;if(P===void 0)throw typeof m.render=="function"?Error(o(188)):(m=Object.keys(m).join(","),Error(o(268,m)));return m=C(P),m===null?null:m.stateNode}function Kf(m,P){if(m=m.memoizedState,m!==null&&m.dehydrated!==null){var q=m.retryLane;m.retryLane=q!==0&&q<P?q:P}}function Lc(m,P){Kf(m,P),(m=m.alternate)&&Kf(m,P)}function g0(m){return m=C(m),m===null?null:m.stateNode}function Fp(){return null}return t.attemptContinuousHydration=function(m){if(m.tag===13){var P=ra(m,134217728);if(P!==null){var q=_n();la(P,m,134217728,q)}Lc(m,134217728)}},t.attemptDiscreteHydration=function(m){if(m.tag===13){var P=ra(m,1);if(P!==null){var q=_n();la(P,m,1,q)}Lc(m,1)}},t.attemptHydrationAtCurrentPriority=function(m){if(m.tag===13){var P=pi(m),q=ra(m,P);if(q!==null){var K=_n();la(q,m,P,K)}Lc(m,P)}},t.attemptSynchronousHydration=function(m){switch(m.tag){case 3:var P=m.stateNode;if(P.current.memoizedState.isDehydrated){var q=Ws(P.pendingLanes);q!==0&&(Fa(P,q|1),Wi(P,Dn()),(_r&6)===0&&(ln(),li()))}break;case 13:Nl(function(){var K=ra(m,1);if(K!==null){var ne=_n();la(K,m,1,ne)}}),Lc(m,1)}},t.batchedUpdates=function(m,P){var q=_r;_r|=1;try{return m(P)}finally{_r=q,_r===0&&(ln(),Ao&&li())}},t.createComponentSelector=function(m){return{$$typeof:wn,value:m}},t.createContainer=function(m,P,q,K,ne,le,xe){return Hh(m,P,!1,null,q,K,ne,le,xe)},t.createHasPseudoClassSelector=function(m){return{$$typeof:Hn,value:m}},t.createHydrationContainer=function(m,P,q,K,ne,le,xe,$e,lt){return m=Hh(q,K,!0,m,ne,le,xe,$e,lt),m.context=Xf(null),q=m.current,K=_n(),ne=pi(q),le=Oa(K,ne),le.callback=P??null,Ga(q,le,ne),m.current.lanes=ne,mn(m,ne,K),Wi(m,K),m},t.createPortal=function(m,P,q){var K=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:K==null?null:""+K,children:m,containerInfo:P,implementation:q}},t.createRoleSelector=function(m){return{$$typeof:oa,value:m}},t.createTestNameSelector=function(m){return{$$typeof:Do,value:m}},t.createTextSelector=function(m){return{$$typeof:vo,value:m}},t.deferredUpdates=function(m){var P=Dt,q=yn.transition;try{return yn.transition=null,Dt=16,m()}finally{Dt=P,yn.transition=q}},t.discreteUpdates=function(m,P,q,K,ne){var le=Dt,xe=yn.transition;try{return yn.transition=null,Dt=1,m(P,q,K,ne)}finally{Dt=le,yn.transition=xe,_r===0&&ln()}},t.findAllNodes=Aa,t.findBoundingRects=function(m,P){if(!Ae)throw Error(o(363));P=Aa(m,P),m=[];for(var q=0;q<P.length;q++)m.push(he(P[q]));for(P=m.length-1;0<P;P--){q=m[P];for(var K=q.x,ne=K+q.width,le=q.y,xe=le+q.height,$e=P-1;0<=$e;$e--)if(P!==$e){var lt=m[$e],Lt=lt.x,er=Lt+lt.width,Er=lt.y,Wt=Er+lt.height;if(K>=Lt&&le>=Er&&ne<=er&&xe<=Wt){m.splice(P,1);break}else if(K!==Lt||q.width!==lt.width||Wt<le||Er>xe){if(!(le!==Er||q.height!==lt.height||er<K||Lt>ne)){Lt>K&&(lt.width+=Lt-K,lt.x=K),er<ne&&(lt.width=ne-Lt),m.splice(P,1);break}}else{Er>le&&(lt.height+=Er-le,lt.y=le),Wt<xe&&(lt.height=xe-Er),m.splice(P,1);break}}}return m},t.findHostInstance=Qu,t.findHostInstanceWithNoPortals=function(m){return m=O(m),m=m!==null?j(m):null,m===null?null:m.stateNode},t.findHostInstanceWithWarning=function(m){return Qu(m)},t.flushControlled=function(m){var P=_r;_r|=1;var q=yn.transition,K=Dt;try{yn.transition=null,Dt=1,m()}finally{Dt=K,yn.transition=q,_r=P,_r===0&&(ln(),li())}},t.flushPassiveEffects=Tl,t.flushSync=Nl,t.focusWithin=function(m,P){if(!Ae)throw Error(o(363));for(m=mo(m),P=Xa(m,P),P=Array.from(P),m=0;m<P.length;){var q=P[m++];if(!Me(q)){if(q.tag===5&&pt(q.stateNode))return!0;for(q=q.child;q!==null;)P.push(q),q=q.sibling}}return!1},t.getCurrentUpdatePriority=function(){return Dt},t.getFindAllNodesFailureDescription=function(m,P){if(!Ae)throw Error(o(363));var q=0,K=[];m=[mo(m),0];for(var ne=0;ne<m.length;){var le=m[ne++],xe=m[ne++],$e=P[xe];if((le.tag!==5||!Me(le))&&(yu(le,$e)&&(K.push(Xu($e)),xe++,xe>q&&(q=xe)),xe<P.length))for(le=le.child;le!==null;)m.push(le,xe),le=le.sibling}if(q<P.length){for(m=[];q<P.length;q++)m.push(Xu(P[q]));return`findAllNodes was able to match part of the selector:
|
|
58
|
-
`+(K.join(" > ")+`
|
|
59
|
-
|
|
60
|
-
No matching component was found for:
|
|
61
|
-
`)+m.join(" > ")}return null},t.getPublicRootInstance=function(m){if(m=m.current,!m.child)return null;switch(m.child.tag){case 5:return B(m.child.stateNode);default:return m.child.stateNode}},t.injectIntoDevTools=function(m){if(m={bundleType:m.bundleType,version:m.version,rendererPackageName:m.rendererPackageName,rendererConfig:m.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:g0,findFiberByHostInstance:m.findFiberByHostInstance||Fp,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")m=!1;else{var P=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(P.isDisabled||!P.supportsFiber)m=!0;else{try{uo=P.inject(m),si=P}catch{}m=!!P.checkDCE}}return m},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(m,P,q,K){if(!Ae)throw Error(o(363));m=Aa(m,P);var ne=yt(m,q,K).disconnect;return{disconnect:function(){ne()}}},t.registerMutableSourceForHydration=function(m,P){var q=P._getVersion;q=q(P._source),m.mutableSourceEagerHydrationData==null?m.mutableSourceEagerHydrationData=[P,q]:m.mutableSourceEagerHydrationData.push(P,q)},t.runWithPriority=function(m,P){var q=Dt;try{return Dt=m,P()}finally{Dt=q}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(m,P,q,K){var ne=P.current,le=_n(),xe=pi(ne);return q=Xf(q),P.context===null?P.context=q:P.pendingContext=q,P=Oa(le,xe),P.payload={element:m},K=K===void 0?null:K,K!==null&&(P.callback=K),m=Ga(ne,P,xe),m!==null&&(la(m,ne,xe,le),xi(m,ne,xe)),xe},t}),sg}var W5;function Ex(){return W5||(W5=1,og.exports=xx()),og.exports}var Px=Ex();const Ox=yp(Px);var lg={exports:{}},Bc={};/**
|
|
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
|
-
*/var $5;function Ax(){return $5||($5=1,Bc.ConcurrentRoot=1,Bc.ContinuousEventPriority=4,Bc.DefaultEventPriority=16,Bc.DiscreteEventPriority=1,Bc.IdleEventPriority=536870912,Bc.LegacyRoot=0),Bc}var Y5;function Cx(){return Y5||(Y5=1,lg.exports=Ax()),lg.exports}var k6=Cx(),kx=jr();const X5={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let K5=!1,Z5=!1;const fm=".react-konva-event";let L6=!1;function Lx(e){L6=e}const Nx=`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
|
-
`,Tx=`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
|
-
`,Rx={};function t0(e,r,t=Rx){if(!K5&&"zIndex"in r&&(console.warn(Tx),K5=!0),!Z5&&r.draggable){var n=r.x!==void 0||r.y!==void 0,a=r.onDragEnd||r.onDragMove;n&&!a&&(console.warn(Nx),Z5=!0)}for(var i in t)if(!X5[i]){var o=i.slice(0,2)==="on",s=t[i]!==r[i];if(o&&s){var u=i.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e.off(u,t[i])}var c=!r.hasOwnProperty(i);c&&e.setAttr(i,void 0)}var h=L6||r._useStrictMode,p={},v=!1;const f={};for(var i in r)if(!X5[i]){var o=i.slice(0,2)==="on",_=t[i]!==r[i];if(o&&_){var u=i.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),r[i]&&(f[u]=r[i])}!o&&(r[i]!==t[i]||h&&r[i]!==e.getAttr(i))&&(v=!0,p[i]=r[i])}v&&(e.setAttrs(p),tf(e));for(var u in f)e.on(u+fm,f[u])}function tf(e){if(!kx.Konva.autoDrawEnabled){var r=e.getLayer()||e.getStage();r&&r.batchDraw()}}var ug=B2();const N6={},Mx={};dp.Node.prototype._applyProps=t0;function Ix(e,r){if(typeof r=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${r}`);return}e.add(r),tf(e)}function jx(e,r,t){let n=dp[e];n||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),n=dp.Group);const a={},i={};for(var o in r){var s=o.slice(0,2)==="on";s?i[o]=r[o]:a[o]=r[o]}const u=new n(a);return t0(u,i),u}function Fx(e,r,t){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function Dx(e,r,t){return!1}function Bx(e){return e}function qx(){return null}function zx(){return null}function Ux(e,r,t,n){return Mx}function Hx(){}function Gx(e){}function Vx(e,r){return!1}function Wx(){return N6}function $x(){return N6}const Yx=setTimeout,Xx=clearTimeout,Kx=-1;function Zx(e,r){return!1}const Qx=!1,Jx=!0,eE=!0;function tE(e,r){r.parent===e?r.moveToTop():e.add(r),tf(e)}function rE(e,r){r.parent===e?r.moveToTop():e.add(r),tf(e)}function T6(e,r,t){r._remove(),e.add(r),r.setZIndex(t.getZIndex()),tf(e)}function nE(e,r,t){T6(e,r,t)}function iE(e,r){r.destroy(),r.off(fm),tf(e)}function aE(e,r){r.destroy(),r.off(fm),tf(e)}function oE(e,r,t){console.error(`Text components are not yet supported in ReactKonva. You text is: "${t}"`)}function sE(e,r,t){}function lE(e,r,t,n,a){t0(e,a,n)}function uE(e){e.hide(),tf(e)}function cE(e){}function fE(e,r){(r.visible==null||r.visible)&&e.show()}function hE(e,r){}function dE(e){}function pE(){}const gE=()=>k6.DefaultEventPriority,vE=Object.freeze(Object.defineProperty({__proto__:null,appendChild:tE,appendChildToContainer:rE,appendInitialChild:Ix,cancelTimeout:Xx,clearContainer:dE,commitMount:sE,commitTextUpdate:oE,commitUpdate:lE,createInstance:jx,createTextInstance:Fx,detachDeletedInstance:pE,finalizeInitialChildren:Dx,getChildHostContext:$x,getCurrentEventPriority:gE,getPublicInstance:Bx,getRootHostContext:Wx,hideInstance:uE,hideTextInstance:cE,idlePriority:ug.unstable_IdlePriority,insertBefore:T6,insertInContainerBefore:nE,isPrimaryRenderer:Qx,noTimeout:Kx,now:ug.unstable_now,prepareForCommit:qx,preparePortalMount:zx,prepareUpdate:Ux,removeChild:iE,removeChildFromContainer:aE,resetAfterCommit:Hx,resetTextContent:Gx,run:ug.unstable_runWithPriority,scheduleTimeout:Yx,shouldDeprioritizeSubtree:Vx,shouldSetTextContent:Zx,supportsMutation:eE,unhideInstance:fE,unhideTextInstance:hE,warnsIfNotActing:Jx},Symbol.toStringTag,{value:"Module"}));var mE=Object.defineProperty,yE=Object.defineProperties,bE=Object.getOwnPropertyDescriptors,Q5=Object.getOwnPropertySymbols,wE=Object.prototype.hasOwnProperty,_E=Object.prototype.propertyIsEnumerable,J5=(e,r,t)=>r in e?mE(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,eb=(e,r)=>{for(var t in r||(r={}))wE.call(r,t)&&J5(e,t,r[t]);if(Q5)for(var t of Q5(r))_E.call(r,t)&&J5(e,t,r[t]);return e},SE=(e,r)=>yE(e,bE(r)),tb,rb;typeof window<"u"&&((tb=window.document)!=null&&tb.createElement||((rb=window.navigator)==null?void 0:rb.product)==="ReactNative")?ii.useLayoutEffect:ii.useEffect;function R6(e,r,t){if(!e)return;if(t(e)===!0)return e;let n=e.child;for(;n;){const a=R6(n,r,t);if(a)return a;n=n.sibling}}function M6(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const nb=console.error;console.error=function(){const e=[...arguments].join("");if(e!=null&&e.startsWith("Warning:")&&e.includes("useContext")){console.error=nb;return}return nb.apply(this,arguments)};const hm=M6(ii.createContext(null));class I6 extends ii.Component{render(){return ii.createElement(hm.Provider,{value:this._reactInternals},this.props.children)}}function xE(){const e=ii.useContext(hm);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const r=ii.useId();return ii.useMemo(()=>{for(const n of[e,e==null?void 0:e.alternate]){if(!n)continue;const a=R6(n,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===r)return!0;o=o.next}});if(a)return a}},[e,r])}function EE(){const e=xE(),[r]=ii.useState(()=>new Map);r.clear();let t=e;for(;t;){if(t.type&&typeof t.type=="object"){const a=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;a&&a!==hm&&!r.has(a)&&r.set(a,ii.useContext(M6(a)))}t=t.return}return r}function j6(){const e=EE();return ii.useMemo(()=>Array.from(e.keys()).reduce((r,t)=>n=>ii.createElement(r,null,ii.createElement(t.Provider,SE(eb({},n),{value:e.get(t)}))),r=>ii.createElement(I6,eb({},r))),[e])}function PE(e){const r=$r.useRef({});return $r.useLayoutEffect(()=>{r.current=e}),$r.useLayoutEffect(()=>()=>{r.current={}},[]),r.current}const OE=e=>{const r=$r.useRef(),t=$r.useRef(),n=$r.useRef(),a=PE(e),i=j6(),o=s=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(s):u.current=s)};return $r.useLayoutEffect(()=>(t.current=new dp.Stage({width:e.width,height:e.height,container:r.current}),o(t.current),n.current=hh.createContainer(t.current,k6.LegacyRoot,!1,null),hh.updateContainer($r.createElement(i,{},e.children),n.current),()=>{dp.isBrowser&&(o(null),hh.updateContainer(null,n.current,null),t.current.destroy())}),[]),$r.useLayoutEffect(()=>{o(t.current),t0(t.current,e,a),hh.updateContainer($r.createElement(i,{},e.children),n.current,null)}),$r.createElement("div",{ref:r,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},AE="Layer",CE="FastLayer",M1="Group",kE="Label",LE="Rect",NE="Circle",TE="Ellipse",RE="Wedge",ME="Line",IE="Sprite",jE="Image",FE="Text",DE="TextPath",BE="Star",qE="Ring",zE="Arc",UE="Tag",HE="Path",GE="RegularPolygon",VE="Arrow",WE="Shape",$E="Transformer",hh=Ox(vE);hh.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:$r.version,rendererPackageName:"react-konva"});const YE=$r.forwardRef((e,r)=>$r.createElement(I6,{},$r.createElement(OE,{...e,forwardedRef:r}))),XE=Lx,KE=Object.freeze(Object.defineProperty({__proto__:null,Arc:zE,Arrow:VE,Circle:NE,Ellipse:TE,FastLayer:CE,Group:M1,Image:jE,KonvaRenderer:hh,Label:kE,Layer:AE,Line:ME,Path:HE,Rect:LE,RegularPolygon:GE,Ring:qE,Shape:WE,Sprite:IE,Stage:YE,Star:BE,Tag:UE,Text:FE,TextPath:DE,Transformer:$E,Wedge:RE,useStrictMode:XE},Symbol.toStringTag,{value:"Module"})),Fu=Zc(KE);var cg,ib;function r0(){if(ib)return cg;ib=1;var e=ai();return cg=function(t,n,a){const i=e.useRef("loading"),o=e.useRef(),[s,u]=e.useState(0),c=e.useRef(),h=e.useRef(),p=e.useRef();return(c.current!==t||h.current!==n||p.current!==a)&&(i.current="loading",o.current=void 0,c.current=t,h.current=n,p.current=a),e.useLayoutEffect(function(){if(!t)return;var v=document.createElement("img");function f(){v.decode().catch(()=>{}).finally(()=>{i.current="loaded",o.current=v,u(Math.random())})}function _(){i.current="failed",o.current=void 0,u(Math.random())}return v.addEventListener("load",f),v.addEventListener("error",_),n&&(v.crossOrigin=n),a&&(v.referrerPolicy=a),v.src=t,function(){v.removeEventListener("load",f),v.removeEventListener("error",_)}},[t,n,a]),[o.current,i.current]},cg}var Dd={},Bd={},ZE=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]]);return t};const QE=e=>{const r=window.getComputedStyle(e).position;return!(r==="absolute"||r==="relative")};function F6(e=()=>{}){const r=$r.useRef(e);return r.current=e,$r.useCallback((...t)=>r.current.apply(null,t),[])}const JE=({children:e,groupProps:r,divProps:t,transform:n,transformFunc:a,parentNodeFunc:i})=>{const o=j6(),s=$r.useRef(null),[u]=$r.useState(()=>document.createElement("div")),c=$r.useMemo(()=>gw.createRoot(u),[u]),h=n??!0,p=F6(()=>{if(h&&s.current){let w=s.current.getAbsoluteTransform().decompose();a&&(w=a(w)),u.style.position="absolute",u.style.zIndex="10",u.style.top="0px",u.style.left="0px",u.style.transform=`translate(${w.x}px, ${w.y}px) rotate(${w.rotation}deg) scaleX(${w.scaleX}) scaleY(${w.scaleY})`,u.style.transformOrigin="top left"}else u.style.position="",u.style.zIndex="",u.style.top="",u.style.left="",u.style.transform="",u.style.transformOrigin="";const v=t||{},{style:f}=v,_=ZE(v,["style"]);Object.assign(u.style,f),Object.assign(u,_)});return $r.useLayoutEffect(()=>{var v;const f=s.current;if(!f)return;const _=i?i({stage:f.getStage()}):(v=f.getStage())===null||v===void 0?void 0:v.container();if(_)return _.appendChild(u),h&&QE(_)&&(_.style.position="relative"),f.on("absoluteTransformChange",p),p(),()=>{var E;f.off("absoluteTransformChange",p),(E=u.parentNode)===null||E===void 0||E.removeChild(u)}},[h,i]),$r.useLayoutEffect(()=>{p()},[t,a]),$r.useLayoutEffect(()=>{c.render($r.createElement(o,null,e))}),$r.useLayoutEffect(()=>()=>{setTimeout(()=>{c.unmount()})},[]),$r.createElement(M1,Object.assign({ref:s},r))},eP=({selector:e,enabled:r,children:t})=>{const n=$r.useRef(null),a=$r.useRef(null),i=$r.useRef(null),o=r??!0;return $r.useLayoutEffect(()=>{if(!n.current||!a.current)return;i.current=a.current;const u=n.current.getStage().findOne(e);o&&u?a.current.moveTo(u):a.current.moveTo(n.current);const c=n.current.getLayer();if(c&&(c.batchDraw(),u)){const h=u.getLayer();if(!h)return;h.batchDraw()}},[e,o]),$r.useEffect(()=>()=>{var s;(s=i.current)===null||s===void 0||s.destroy()},[]),$r.createElement(M1,{name:"_outer_portal",ref:n},$r.createElement(M1,{name:"_inner_portal",ref:a},t))};var tP=r0();const rP=yp(tP),nP=Object.freeze(Object.defineProperty({__proto__:null,Html:JE,Portal:eP,useEvent:F6,useImage:rP},Symbol.toStringTag,{value:"Module"})),Mh=Zc(nP);function iP(e,r){return Object.keys(e.values).forEach(t=>e.values[t]=e.values[t]&&parseFloat(e.values[t].toFixed(r))),e}function D6(e,r,t){const n=r-1,a=t[q6(n,t.length)];return a.marker!=="Z"?a:D6(e,n,t)}function B6(e,r,t){const n=r+1,a=t[q6(n,t.length)];return a.marker==="Z"?B6(e,n,t):a}function aP(e,r,t){let n=t[r-1]||{values:{x:0,y:0}};if(e.marker===e.marker.toLowerCase())switch(e.marker=e.marker.toUpperCase(),e.marker){case"M":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"L":case"A":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"H":e.marker="L",e.values.x+=n.values.x,e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x,e.values.y+=n.values.y;break;case"C":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"S":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"Q":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y;break;case"T":e.values.x+=n.values.x,e.values.y+=n.values.y;break}else if(e.marker===e.marker.toUpperCase())switch(e.marker){case"H":e.marker="L",e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x;break}if(e.marker==="Z"){let a=function(o,s){return o[s].marker==="M"?o[s]:a(o,s-1)},i=a(t,r);e.values.x=i.values.x,e.values.y=i.values.y}return e}function oP(e,r){const t=[];switch(e.toUpperCase()){case"M":for(let n=0;n<r.length;n+=2){let a;e===e.toUpperCase()?a=n===0?"M":"L":a=n===0?"m":"l",t.push({marker:a,values:{x:r[n],y:r[n+1]}})}break;case"L":for(let n=0;n<r.length;n+=2)t.push({marker:e,values:{x:r[n],y:r[n+1]}});break;case"H":for(let n=0;n<r.length;n++)t.push({marker:e,values:{x:r[n],y:0}});break;case"V":for(let n=0;n<r.length;n++)t.push({marker:e,values:{x:0,y:r[n]}});break;case"C":for(let n=0;n<r.length;n+=6)t.push({marker:e,values:{x1:r[n],y1:r[n+1],x2:r[n+2],y2:r[n+3],x:r[n+4],y:r[n+5]}});break;case"S":for(let n=0;n<r.length;n+=4)t.push({marker:e,values:{x2:r[n],y2:r[n+1],x:r[n+2],y:r[n+3]}});break;case"Q":for(let n=0;n<r.length;n+=4)t.push({marker:e,values:{x1:r[n],y1:r[n+1],x:r[n+2],y:r[n+3]}});break;case"T":for(let n=0;n<r.length;n+=2)t.push({marker:e,values:{x:r[n],y:r[n+1]}});break;case"A":for(let n=0;n<r.length;n+=7)t.push({marker:e,values:{radiusX:r[n],radiusY:r[n+1],rotation:r[n+2],largeArc:r[n+3],sweep:r[n+4],x:r[n+5],y:r[n+6]}});break;case"Z":t.push({marker:e,values:{x:0,y:0}});break}return t}function q6(e,r){return(e%r+r)%r}function sP(e,r,t){if(r!==0&&e.marker==="L"){let n=t[r-1];["x","y"].every(i=>Math.round(Math.abs(n.values[i]-e.values[i]))===0)&&(e.overlap=!0)}return e}function E2(e,r){const t=["x","y"].every(n=>Math.round(Math.abs(e[r].values[n]-e[0].values[n]))===0);e[r].marker==="L"&&t&&(e[r].overlap=!0,E2(e,r-1)),e[r].marker==="Z"&&E2(e,r-1)}function lP(e,r,t){const n=ob(e.values,t.values),a=ob(r.values,e.values);return Math.min(a,n)}function ab(e,r){return Math.atan2(r.x-e.x,r.y-e.y)}function ob(e,r){const t=e.x-r.x,n=e.y-r.y;return Math.sqrt(Math.pow(t,2)+Math.pow(n,2))}function sb(e,r){return Math.sin(e)*r}function lb(e,r){return Math.cos(e)*r}function ub(e,r){const t=r/Math.tan(e);return t===1/0||t===-1/0||isNaN(t)?r:t}function uP(e,r){return r*Math.tan(e)}function cP(e,r){let t,n=0,a=e*(180/Math.PI);return a<0&&a>=-180||a>180&&a<360?t=ub(e/2,-r):(t=ub(e/2,r),n=1,t===1/0&&(t=r)),{offset:t,sweepFlag:n}}function fP(e){const r=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map(t=>{let n="";if(t.marker!=="Z"){const a=Object.keys(t.values);n=r.filter(i=>a.indexOf(i)!==-1).map(i=>t.values[i]).join()}return`${t.marker}${n}`}).join("").trim()}function z6(e){const r=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,t=/-?[0-9]*\.?\d+/g;return[...e.matchAll(r)].map(n=>({marker:n[0],index:n.index})).reduceRight((n,a)=>{const i=e.substring(a.index,n.length?n[n.length-1].index:e.length);return n.concat([{marker:a.marker,index:a.index,chunk:i.length>0?i.substr(1,i.length-1):i}])},[]).reverse().flatMap(n=>{const a=n.chunk.match(t),i=a?a.map(parseFloat):[];return oP(n.marker,i)}).map(aP)}function U6(e,r,t){let n=[],a=[];return t&&e.forEach(i=>iP(i,t)),e.forEach(i=>{i.marker==="M"&&n.push([]),n[n.length-1].push(i)}),n.forEach(i=>{i.map(sP),E2(i,i.length-1);const o=i[i.length-1].marker=="Z";i.filter(s=>!s.overlap).map((s,u,c)=>{const p=D6(s,u,c),v=B6(s,u,c),f=ab(s.values,p.values),_=ab(s.values,v.values),E=_-f,w=E*(180/Math.PI),x=lP(s,p,v),y=Math.abs(uP(E/2,x/2)),g=Math.min(r,y),S=cP(E,g),b=S.offset,R=S.sweepFlag,L=(u==0||u==c.length-1)&&!o;switch(s.marker){case"M":case"L":const T=[s.values.x+sb(f,b),s.values.y+lb(f,b)],F=[s.values.x+sb(_,b),s.values.y+lb(_,b)];L?a.push({marker:s.marker,values:s.values}):a.push({marker:s.marker,values:{x:parseFloat(T[0].toFixed(3)),y:parseFloat(T[1].toFixed(3))}}),!L&&(v.marker==="L"||v.marker==="M")&&a.push({marker:"A",radius:g,values:{radiusX:parseFloat(g.toFixed(3)),radiusY:parseFloat(g.toFixed(3)),rotation:w,largeArc:0,sweep:R,x:parseFloat(F[0].toFixed(3)),y:parseFloat(F[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":a.push({marker:s.marker,values:s.values});break}})}),{path:fP(a),commands:a}}function hP(e,r,t){return U6([...z6(e)],r,t)}const dP=Object.freeze(Object.defineProperty({__proto__:null,parsePath:z6,roundCommands:U6,roundCorners:hP},Symbol.toStringTag,{value:"Module"})),pP=Zc(dP);var jl={},qd={},l1={},cb;function gP(){if(cb)return l1;cb=1;var e=e||{};e.stringify=function(){var r={"visit_linear-gradient":function(t){return r.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return r.visit_gradient(t)},"visit_radial-gradient":function(t){return r.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return r.visit_gradient(t)},visit_gradient:function(t){var n=r.visit(t.orientation);return n&&(n+=", "),t.type+"("+n+r.visit(t.colorStops)+")"},visit_shape:function(t){var n=t.value,a=r.visit(t.at),i=r.visit(t.style);return i&&(n+=" "+i),a&&(n+=" at "+a),n},"visit_default-radial":function(t){var n="",a=r.visit(t.at);return a&&(n+=a),n},"visit_extent-keyword":function(t){var n=t.value,a=r.visit(t.at);return a&&(n+=" at "+a),n},"visit_position-keyword":function(t){return t.value},visit_position:function(t){return r.visit(t.value.x)+" "+r.visit(t.value.y)},"visit_%":function(t){return t.value+"%"},visit_em:function(t){return t.value+"em"},visit_px:function(t){return t.value+"px"},visit_calc:function(t){return"calc("+t.value+")"},visit_literal:function(t){return r.visit_color(t.value,t)},visit_hex:function(t){return r.visit_color("#"+t.value,t)},visit_rgb:function(t){return r.visit_color("rgb("+t.value.join(", ")+")",t)},visit_rgba:function(t){return r.visit_color("rgba("+t.value.join(", ")+")",t)},visit_hsl:function(t){return r.visit_color("hsl("+t.value[0]+", "+t.value[1]+"%, "+t.value[2]+"%)",t)},visit_hsla:function(t){return r.visit_color("hsla("+t.value[0]+", "+t.value[1]+"%, "+t.value[2]+"%, "+t.value[3]+")",t)},visit_var:function(t){return r.visit_color("var("+t.value+")",t)},visit_color:function(t,n){var a=t,i=r.visit(n.length);return i&&(a+=" "+i),a},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var n="",a=t.length;return t.forEach(function(i,o){n+=r.visit(i),o<a-1&&(n+=", ")}),n},visit_object:function(t){return t.width&&t.height?r.visit(t.width)+" "+r.visit(t.height):""},visit:function(t){if(!t)return"";if(t instanceof Array)return r.visit_array(t);if(typeof t=="object"&&!t.type)return r.visit_object(t);if(t.type){var n=r["visit_"+t.type];if(n)return n(t);throw Error("Missing visitor visit_"+t.type)}else throw Error("Invalid node.")}};return function(t){return r.visit(t)}}();var e=e||{};return e.parse=function(){var r={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)|top (left|right)|bottom (left|right)|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/,radianValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))rad/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,varColor:/^var/i,calcValue:/^calc/i,variableName:/^(--[a-zA-Z0-9-,\s\#]+)/,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,hslColor:/^hsl/i,hslaColor:/^hsla/i},t="";function n(D){var $=new Error(t+": "+D);throw $.source=t,$}function a(){var D=i();return t.length>0&&n("Invalid input not EOF"),D}function i(){return S(o)}function o(){return s("linear-gradient",r.linearGradient,c)||s("repeating-linear-gradient",r.repeatingLinearGradient,c)||s("radial-gradient",r.radialGradient,v)||s("repeating-radial-gradient",r.repeatingRadialGradient,v)}function s(D,$,Q){return u($,function(ee){var te=Q();return te&&(H(r.comma)||n("Missing comma before color stops")),{type:D,orientation:te,colorStops:S(b)}})}function u(D,$){var Q=H(D);if(Q){H(r.startCall)||n("Missing (");var ee=$(Q);return H(r.endCall)||n("Missing )"),ee}}function c(){var D=h();if(D)return D;var $=V("position-keyword",r.positionKeywords,1);return $?{type:"directional",value:$.value}:p()}function h(){return V("directional",r.sideOrCorner,1)}function p(){return V("angular",r.angleValue,1)||V("angular",r.radianValue,1)}function v(){var D,$=f(),Q;return $&&(D=[],D.push($),Q=t,H(r.comma)&&($=f(),$?D.push($):t=Q)),D}function f(){var D=_()||E();if(D)D.at=x();else{var $=w();if($){D=$;var Q=x();Q&&(D.at=Q)}else{var ee=x();if(ee)D={type:"default-radial",at:ee};else{var te=y();te&&(D={type:"default-radial",at:te})}}}return D}function _(){var D=V("shape",/^(circle)/i,0);return D&&(D.style=Z()||w()),D}function E(){var D=V("shape",/^(ellipse)/i,0);return D&&(D.style=y()||B()||w()),D}function w(){return V("extent-keyword",r.extentKeywords,1)}function x(){if(V("position",/^at/,0)){var D=y();return D||n("Missing positioning value"),D}}function y(){var D=g();if(D.x||D.y)return{type:"position",value:D}}function g(){return{x:B(),y:B()}}function S(D){var $=D(),Q=[];if($)for(Q.push($);H(r.comma);)$=D(),$?Q.push($):n("One extra comma");return Q}function b(){var D=R();return D||n("Expected color definition"),D.length=B(),D}function R(){return T()||A()||C()||I()||F()||O()||L()}function L(){return V("literal",r.literalColor,0)}function T(){return V("hex",r.hexColor,1)}function F(){return u(r.rgbColor,function(){return{type:"rgb",value:S(N)}})}function I(){return u(r.rgbaColor,function(){return{type:"rgba",value:S(N)}})}function O(){return u(r.varColor,function(){return{type:"var",value:j()}})}function C(){return u(r.hslColor,function(){var D=H(r.percentageValue);D&&n("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");var $=N();H(r.comma);var Q=H(r.percentageValue),ee=Q?Q[1]:null;H(r.comma),Q=H(r.percentageValue);var te=Q?Q[1]:null;return(!ee||!te)&&n("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[$,ee,te]}})}function A(){return u(r.hslaColor,function(){var D=N();H(r.comma);var $=H(r.percentageValue),Q=$?$[1]:null;H(r.comma),$=H(r.percentageValue);var ee=$?$[1]:null;H(r.comma);var te=N();return(!Q||!ee)&&n("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[D,Q,ee,te]}})}function j(){return H(r.variableName)[1]}function N(){return H(r.number)[1]}function B(){return V("%",r.percentageValue,1)||W()||Y()||Z()}function W(){return V("position-keyword",r.positionKeywords,1)}function Y(){return u(r.calcValue,function(){for(var D=1,$=0;D>0&&$<t.length;){var Q=t.charAt($);Q==="("?D++:Q===")"&&D--,$++}D>0&&n("Missing closing parenthesis in calc() expression");var ee=t.substring(0,$-1);return U($-1),{type:"calc",value:ee}})}function Z(){return V("px",r.pixelValue,1)||V("em",r.emValue,1)}function V(D,$,Q){var ee=H($);if(ee)return{type:D,value:ee[Q]}}function H(D){var $,Q;return Q=/^[\n\r\t\s]+/.exec(t),Q&&U(Q[0].length),$=D.exec(t),$&&U($[0].length),$}function U(D){t=t.substr(D)}return function(D){return t=D.toString().trim(),t.endsWith(";")&&(t=t.slice(0,-1)),a()}}(),l1.parse=e.parse,l1.stringify=e.stringify,l1}var fb;function dm(){return fb||(fb=1,function(e){var r=qd&&qd.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.isGradient=void 0;const t=r(gP());e.isGradient=a=>a.indexOf("linear-gradient")>=0;const n=a=>a.type==="hex"?"#"+a.value:a.type==="literal"?a.value:`${a.type}(${a.value.join(",")})`;e.parseColor=a=>{if(!(0,e.isGradient)(a))return{rotation:0,stops:[{offset:0,color:a},{offset:1,color:a}]};const i=t.default.parse(a)[0];return{rotation:parseFloat(i.orientation.value),stops:i.colorStops.map((o,s)=>({color:n(o),offset:o.length?parseFloat(o.length.value)/100:s/(i.colorStops.length-1)}))}}}(qd)),qd}var hb;function Op(){return hb||(hb=1,function(e){var r,t=jl&&jl.__createBinding||(Object.create?function(c,h,p,v){v===void 0&&(v=p);var f=Object.getOwnPropertyDescriptor(h,p);f&&!("get"in f?!h.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return h[p]}}),Object.defineProperty(c,v,f)}:function(c,h,p,v){v===void 0&&(v=p),c[v]=h[p]}),n=jl&&jl.__setModuleDefault||(Object.create?function(c,h){Object.defineProperty(c,"default",{enumerable:!0,value:h})}:function(c,h){c.default=h}),a=jl&&jl.__importStar||(r=function(c){return r=Object.getOwnPropertyNames||function(h){var p=[];for(var v in h)Object.prototype.hasOwnProperty.call(h,v)&&(p[p.length]=v);return p},r(c)},function(c){if(c&&c.__esModule)return c;var h={};if(c!=null)for(var p=r(c),v=0;v<p.length;v++)p[v]!=="default"&&t(h,c,p[v]);return n(h,c),h}),i=jl&&jl.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.useColor=void 0;const o=i(ai()),s=a(dm()),u=i(Hs());e.useColor=(c,h=c.fill,p="fill")=>o.default.useMemo(()=>{if(!s.isGradient(h))return{[p]:h};const{stops:v,rotation:f}=s.parseColor(h),_=c.a.width/2,E=c.a.height/2,w=(f%180+180)%180,x=w>45&&w<135?c.a.width:c.a.height,y=u.default.Util.degToRad(f)-Math.PI/2,g=[];return v.forEach(({offset:S,color:b})=>{g.push(S,b)}),p==="fill"?{fillLinearGradientStartPointX:_-x/2*Math.cos(y),fillLinearGradientStartPointY:E-x/2*Math.sin(y),fillLinearGradientColorStops:g,fillLinearGradientEndPointX:_+x/2*Math.cos(y),fillLinearGradientEndPointY:E+x/2*Math.sin(y),fill:v[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:_-x/2*Math.cos(y),strokeLinearGradientStartPointY:E-x/2*Math.sin(y),strokeLinearGradientColorStops:g,strokeLinearGradientEndPointX:_+x/2*Math.cos(y),strokeLinearGradientEndPointY:E+x/2*Math.sin(y)}},[h,c.width,c.height])}(jl)),jl}var fg={},zd={},db;function If(){return db||(db=1,function(e){var r=zd&&zd.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAnimationUsed=e.toggleFadeInAnimation=void 0,e.useFadeIn=function(i,o){const s=t.default.useRef();t.default.useLayoutEffect(()=>{s.current&&s.current.destroy()},[o]),t.default.useLayoutEffect(()=>{if(!a)return;const u=i.current.opacity();return u?(i.current.opacity(0),s.current=new n.default.Tween({node:i.current,opacity:u,onFinish:()=>{var c;(c=s.current)===null||c===void 0||c.destroy()}}),s.current.play(),()=>{var c;(c=s.current)===null||c===void 0||c.destroy()}):void 0},[])};const t=r(ai()),n=r(Hs());let a=!1;e.toggleFadeInAnimation=(i=!a)=>{a=i},e.isAnimationUsed=()=>a}(zd)),zd}var pb;function jf(){return pb||(pb=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getFontLoadTimeout=e.setFontLoadTimeout=e.getAssetLoadTimeout=e.setAssetLoadTimeout=void 0,e.incrementLoader=function(c){t+=1;let h=!1,p=!1;const v=setTimeout(()=>{h||(u(`Timeout loading asset ${c}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",c),h=!0,o())},a);return()=>{p?console.error("Finish called twice! That is not expected. id: ",c):(p=!0,h||(clearTimeout(v),o()))}},e.decrementLoader=o,e.whenLoaded=function(){return new Promise(c=>{return h=()=>{(0,r.isAnimationUsed)()?setTimeout(c,300):c(!0)},void(t===0?h():n.push(h));var h})},e.onLoadError=function(c){s.push(c)},e.triggerLoadError=u;const r=If();let t=0,n=[],a=3e4;e.setAssetLoadTimeout=c=>{a=c},e.getAssetLoadTimeout=()=>a;let i=6e3;function o(){t-=1,t===0&&(n.forEach(c=>c()),n=[])}e.setFontLoadTimeout=c=>{i=c},e.getFontLoadTimeout=()=>i;let s=[];function u(c){s.forEach(h=>h(c))}}(fg)),fg}var rc={},gb;function Ih(){return gb||(gb=1,function(e){var r,t=rc&&rc.__createBinding||(Object.create?function(g,S,b,R){R===void 0&&(R=b);var L=Object.getOwnPropertyDescriptor(S,b);L&&!("get"in L?!S.__esModule:L.writable||L.configurable)||(L={enumerable:!0,get:function(){return S[b]}}),Object.defineProperty(g,R,L)}:function(g,S,b,R){R===void 0&&(R=b),g[R]=S[b]}),n=rc&&rc.__setModuleDefault||(Object.create?function(g,S){Object.defineProperty(g,"default",{enumerable:!0,value:S})}:function(g,S){g.default=S}),a=rc&&rc.__importStar||(r=function(g){return r=Object.getOwnPropertyNames||function(S){var b=[];for(var R in S)Object.prototype.hasOwnProperty.call(S,R)&&(b[b.length]=R);return b},r(g)},function(g){if(g&&g.__esModule)return g;var S={};if(g!=null)for(var b=r(g),R=0;R<b.length;R++)b[R]!=="default"&&t(S,g,b[R]);return n(S,g),S});Object.defineProperty(e,"__esModule",{value:!0}),e.isFontLoaded=e.globalFonts=void 0,e.isGoogleFontChanged=function(){return u.value},e.setGoogleFonts=function(g){g!=="default"?(u.value=!0,s.splice(0,s.length),s.push(...g)):u.value=!1},e.getFontsList=function(){return s},e.addGlobalFont=function(g){e.globalFonts.push(g)},e.removeGlobalFont=function(g){const S=e.globalFonts.findIndex(b=>b.fontFamily===g);S!==-1&&e.globalFonts.splice(S,1)},e.replaceGlobalFonts=function(g){e.globalFonts.replace(g)},e.loadFont=async function(g,S,b){var R;if(v[g])return;const L=!!(!((R=document.fonts)===null||R===void 0)&&R.load),T=p("Arial","Arial",S,b);if(L)try{if(await document.fonts.load(`16px '${g}', ${S} ${b}`),T!==p(g,"Arial",S,b))return void(v[g]=!0)}catch{}const F=p("Times","Times",S,b),I=p(g,"Arial",S,b),O=Math.min(6e3,(0,o.getFontLoadTimeout)())/60;for(let C=0;C<O;C++){const A=p(g,"Arial",S,b),j=p(g,"Times",S,b);if(A!==I||A!==T||j!==F)return void(v[g]=!0);await new Promise(N=>setTimeout(N,60))}console.warn(`Timeout for loading font "${g}". Looks like polotno can't load it. Is it a correct font family?`),(0,o.triggerLoadError)(`Timeout for loading font "${g}"`)},e.setGoogleFontsVariants=function(g){_=g},e.getGoogleFontsVariants=function(){return _},e.getGoogleFontsUrl=E,e.injectGoogleFont=function(g){if(f[g])return;const S=E(g),b=document.createElement("link");b.type="text/css",b.href=S,b.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(b),f[g]=!0},e.injectCustomFont=function(g){const S=g.fontFamily;if(w[S]||!g.url&&!g.styles)return;const b=g.styles||(g.url?[{src:`url("${g.url}")`}]:[]);let R="";b.forEach(L=>{R+=`
|
|
77
|
-
@font-face {
|
|
78
|
-
font-family: '${S}';
|
|
79
|
-
src: ${L.src};
|
|
80
|
-
font-style: ${L.fontStyle||"normal"};
|
|
81
|
-
font-weight: ${L.fontWeight||"normal"};
|
|
82
|
-
}
|
|
83
|
-
`}),y().innerHTML+=R,w[g.fontFamily]=!0};const i=a(vs),o=jf();let s=i.observable(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]),u=i.observable({value:!1});e.globalFonts=i.observable([]);var c="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",h=document.createElement("canvas");function p(g,S="Arial",b="normal",R="normal"){var L=h.getContext("2d");return L.font=`${b} ${R} 40px '${g}', ${S}`,L.measureText(c).width}const v={Arial:!0};e.isFontLoaded=g=>!!v[g];const f={};let _="400,400italic,700,700italic";function E(g){return`https://fonts.googleapis.com/css?family=${g.replace(/ /g,"+")}:${_}`}const w={};let x;function y(){return x||(x=document.getElementById("polotno-font-style"),x||(x=document.createElement("style"),x.id="polotno-font-style",document.head.appendChild(x)),x)}}(rc)),rc}var nc={},vb;function gc(){return vb||(vb=1,function(e){var r,t=nc&&nc.__createBinding||(Object.create?function(o,s,u,c){c===void 0&&(c=u);var h=Object.getOwnPropertyDescriptor(s,u);h&&!("get"in h?!s.__esModule:h.writable||h.configurable)||(h={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(o,c,h)}:function(o,s,u,c){c===void 0&&(c=u),o[c]=s[u]}),n=nc&&nc.__setModuleDefault||(Object.create?function(o,s){Object.defineProperty(o,"default",{enumerable:!0,value:s})}:function(o,s){o.default=s}),a=nc&&nc.__importStar||(r=function(o){return r=Object.getOwnPropertyNames||function(s){var u=[];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(u[u.length]=c);return u},r(o)},function(o){if(o&&o.__esModule)return o;var s={};if(o!=null)for(var u=r(o),c=0;c<u.length;c++)u[c]!=="default"&&t(s,o,u[c]);return n(s,o),s});Object.defineProperty(e,"__esModule",{value:!0}),e.setAnimationsEnabled=e.setTextSplitAllowed=e.setTextOverflow=e.setForceTextFit=e.useDownScaling=e.setDownScalingEnabled=e.useHtmlTextRender=e.useRemoveBackground=e.setTextVerticalResizeEnabled=e.flags=void 0;const i=a(vs);e.flags=i.observable({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",textSplitAllowed:!1,animationsEnabled:!1}),e.setTextVerticalResizeEnabled=i.action(o=>{e.flags.textVerticalResizeEnabled=o}),e.useRemoveBackground=i.action(o=>{e.flags.removeBackgroundEnabled=o}),e.useHtmlTextRender=i.action(o=>{e.flags.htmlRenderEnabled=o}),e.setDownScalingEnabled=i.action(o=>{e.flags.imageDownScalingEnabled=o}),e.useDownScaling=i.action(o=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),(0,e.setDownScalingEnabled)(o)}),e.setForceTextFit=i.action(o=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),e.flags.textOverflow="change-font-size"}),e.setTextOverflow=i.action(o=>{e.flags.textOverflow=o}),e.setTextSplitAllowed=i.action(o=>{e.flags.textSplitAllowed=o}),e.setAnimationsEnabled=i.action(o=>{e.flags.animationsEnabled=o})}(nc)),nc}var hg={},mb;function pm(){return mb||(mb=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.removeTags=function(r=""){return(r.match(/<\/p>/gi)||[]).length>1&&(r=r.replace(/<\/p>/gi,(t,n,a)=>(a.slice(n+t.length).match(/<\/p>/gi)||[]).length>0?`
|
|
84
|
-
`:t)),r.replace(/(<([^>]+)>)/gi,"")},e.sanitizeHtml=function(r){return r?/<[a-z][a-z0-9]*(\s[^>]*)?>[^<]*<\/[a-z][a-z0-9]*>/i.test(r)?(r=r.replace(/<(?![a-z/!])/gi,"<")).replace(/([^a-z0-9"'\s/])>/gi,"$1>"):r.replace(/</g,"<").replace(/>/g,">"):""}}(hg)),hg}var Ud={},yb;function Ap(){return yb||(yb=1,function(e){var r=Ud&&Ud.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.applyFilter=function(a,i){var o;const s={filters:[]},u={};i.brightnessEnabled&&(s.filters.push(t.default.Filters.Brighten),s.brightness=i.brightness),i.blurEnabled&&(s.filters.push(t.default.Filters.Blur),s.blurRadius=i.blurRadius,i.type==="text"&&i.lineHeight<1&&(u.offset=i.fontSize)),i.sepiaEnabled&&s.filters.push(t.default.Filters.Sepia),i.grayscaleEnabled&&s.filters.push(t.default.Filters.Grayscale),i.filters.forEach((c,h)=>{const p=n[h];p&&s.filters.push(p(c.intensity))}),a.setAttrs(s),s.filters.length?a.cache(Object.assign(Object.assign({},u),{pixelRatio:i.store._elementsPixelRatio})):a.clearCache(),(o=a.getLayer())===null||o===void 0||o.batchDraw()};const t=r(Hs()),n={warm:a=>i=>{const o=i.data;a=Math.max(0,Math.min(1,a));for(let s=0;s<o.length;s+=4)o[s]=Math.min(o[s]+30*a,255),o[s+1]=Math.min(o[s+1]+15*a,255);return i},cold:a=>i=>{const o=i.data;a=Math.max(0,Math.min(1,a));for(let s=0;s<o.length;s+=4)o[s]=Math.min(o[s]-15*a,255),o[s+1]=Math.min(o[s+1]-10*a,255),o[s+2]=Math.min(o[s+2]+15*a,255);return i},natural:a=>i=>{const o=i.data;a=Math.max(0,Math.min(1,a));for(let s=0;s<o.length;s+=4){o[s]=Math.min(o[s]*(1+.1*a),255),o[s+1]=Math.min(o[s+1]*(1+.1*a),255),o[s+2]=Math.min(o[s+2]*(1+.1*a),255);const u=(o[s]+o[s+1]+o[s+2])/3;o[s]=Math.min((o[s]-u)*(1+.2*a)+u,255),o[s+1]=Math.min((o[s+1]-u)*(1+.2*a)+u,255),o[s+2]=Math.min((o[s+2]-u)*(1+.2*a)+u,255)}return i},temperature:a=>i=>{const o=i.data;a=Math.max(-1,Math.min(1,a));for(let s=0;s<o.length;s+=4){const u=o[s],c=(o[s+1],o[s+2]);o[s]=Math.min(Math.max(u+15*a,0),255),o[s+2]=Math.min(Math.max(c-15*a,0),255)}return i},contrast:a=>i=>{const o=i.data,s=100*(a=Math.max(-1,Math.min(1,a))),u=259*(s+255)/(255*(259-s));for(let c=0;c<o.length;c+=4)o[c]=Math.min(Math.max(u*(o[c]-128)+128,0),255),o[c+1]=Math.min(Math.max(u*(o[c+1]-128)+128,0),255),o[c+2]=Math.min(Math.max(u*(o[c+2]-128)+128,0),255);return i},shadows:a=>i=>{const o=i.data;a=Math.max(-1,Math.min(1,a));for(let s=0;s<o.length;s+=4){const u=(o[s]+o[s+1]+o[s+2])/3;if(u<128){const c=1+a*(1-u/128)*2;o[s]=Math.min(Math.max(o[s]*c,0),255),o[s+1]=Math.min(Math.max(o[s+1]*c,0),255),o[s+2]=Math.min(Math.max(o[s+2]*c,0),255)}}return i},white:a=>i=>{const o=i.data;a=Math.max(-1,Math.min(1,a));for(let s=0;s<o.length;s+=4){const u=o[s],c=o[s+1],h=o[s+2],p=(u+c+h)/3;if(p>128){const v=1+a*((p-128)/127);o[s]=Math.min(Math.max(u*v,0),255),o[s+1]=Math.min(Math.max(c*v,0),255),o[s+2]=Math.min(Math.max(h*v,0),255)}}return i},black:a=>i=>{const o=i.data;a=Math.max(-1,Math.min(1,a));for(let s=0;s<o.length;s+=4){const u=o[s],c=o[s+1],h=o[s+2],p=(u+c+h)/3;if(p<128){const v=1+a*((128-p)/128);o[s]=Math.min(Math.max(u*v,0),255),o[s+1]=Math.min(Math.max(c*v,0),255),o[s+2]=Math.min(Math.max(h*v,0),255)}}return i},vibrance:a=>i=>{const o=i.data;a=Math.max(-1,Math.min(1,a));for(let s=0;s<o.length;s+=4){const u=o[s],c=o[s+1],h=o[s+2],p=Math.max(u,c,h),v=a<0?(1-(p===0?0:(p-(u+c+h)/3)/p))*a*1.5:.5*a;o[s]=Math.min(Math.max(u-(p-u)*v,0),255),o[s+1]=Math.min(Math.max(c-(p-c)*v,0),255),o[s+2]=Math.min(Math.max(h-(p-h)*v,0),255)}return i},saturation:a=>i=>{const o=i.data;a=Math.max(-1,Math.min(1,a));for(let s=0;s<o.length;s+=4){const u=o[s],c=o[s+1],h=o[s+2],p=.2126*u+.7152*c+.0722*h;o[s]=Math.min(Math.max(p+(u-p)*(1+a),0),255),o[s+1]=Math.min(Math.max(p+(c-p)*(1+a),0),255),o[s+2]=Math.min(Math.max(p+(h-p)*(1+a),0),255)}return i}}}(Ud)),Ud}var Hd={},bb;function rf(){return bb||(bb=1,function(e){var r=Hd&&Hd.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e,"__esModule",{value:!0}),e.useMobile=e.isTouchDevice=e.mobileStyle=e.isMobile=e.MOBILE_BREAKPOINT=void 0;const t=r(ai());e.MOBILE_BREAKPOINT=800,e.isMobile=()=>window.innerWidth<=e.MOBILE_BREAKPOINT,e.mobileStyle=n=>`
|
|
85
|
-
@media (max-width: ${e.MOBILE_BREAKPOINT}px) {
|
|
86
|
-
${n}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.polotno-mobile & {
|
|
90
|
-
${n}
|
|
91
|
-
}
|
|
92
|
-
`,e.isTouchDevice=()=>"ontouchstart"in window||navigator.maxTouchPoints>0,e.useMobile=()=>{const[n,a]=t.default.useState((0,e.isMobile)());return t.default.useEffect(()=>{const i=()=>{a((0,e.isMobile)())};return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[]),n}}(Hd)),Hd}var wb={},H6="warn";function G6(e){H6=e}function V6(){return H6}function vP(e){G6(e)}var wa;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(wa||(wa={}));var P2=function(e,r){return P2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])},P2(e,r)};function Jn(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");P2(e,r);function t(){this.constructor=e}e.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var _a=function(){return _a=Object.assign||function(r){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},_a.apply(this,arguments)};function mP(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]]);return t}function W6(e,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(h){return u([c,h])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(n=1,a&&(i=c[0]&2?a.return:c[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,c[1])).done)return i;switch(a=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,a=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1],i=c;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(c);break}i[2]&&t.ops.pop(),t.trys.pop();continue}c=r.call(e,t)}catch(h){c=[6,h],a=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function lp(e){var r=typeof Symbol=="function"&&Symbol.iterator,t=r&&e[r],n=0;if(t)return t.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function Iu(e,r){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var n=t.call(e),a,i=[],o;try{for(;(r===void 0||r-- >0)&&!(a=n.next()).done;)i.push(a.value)}catch(s){o={error:s}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return i}function ju(e,r,t){if(arguments.length===2)for(var n=0,a=r.length,i;n<a;n++)(i||!(n in r))&&(i||(i=Array.prototype.slice.call(r,0,n)),i[n]=r[n]);return e.concat(i||Array.prototype.slice.call(r))}function Cp(e){return or(e).type}function yP(e,r){return or(e).getChildType(r)}function $6(e,r){return or(e).onPatch(r)}function bP(e,r){return or(e).onSnapshot(r)}function Ph(e,r){or(e).applyPatches(Sm(r))}function wP(e,r){var t={patches:[],inversePatches:[]},n={},a,i={get recording(){return!!a},get patches(){return n.patches||(n.patches=t.patches.slice()),n.patches},get reversedInversePatches(){return n.reversedInversePatches||(n.reversedInversePatches=t.inversePatches.slice().reverse()),n.reversedInversePatches},get inversePatches(){return n.inversePatches||(n.inversePatches=t.inversePatches.slice()),n.inversePatches},stop:function(){a&&(a(),a=void 0)},resume:function(){a||(a=$6(e,function(o,s){r&&!r(o,s,ym())||(t.patches.push(o),t.inversePatches.push(s),n.patches=void 0,n.inversePatches=void 0,n.reversedInversePatches=void 0)}))},replay:function(o){Ph(o||e,t.patches)},undo:function(o){Ph(o||e,t.inversePatches.slice().reverse())}};return i.resume(),i}function _P(e){var r=or(e);if(!r.isRoot)throw new Qt("`protect` can only be invoked on root nodes");r.isProtectionEnabled=!0}function SP(e){var r=or(e);if(!r.isRoot)throw new Qt("`unprotect` can only be invoked on root nodes");r.isProtectionEnabled=!1}function xP(e){return or(e).isProtected}function Y6(e,r){return or(e).applySnapshot(r)}function gm(e,r){r===void 0&&(r=!0);var t=or(e);return r?t.snapshot:t.type.getSnapshot(t,!1)}function EP(e,r){r===void 0&&(r=1);for(var t=or(e).parent;t;){if(--r===0)return!0;t=t.parent}return!1}function PP(e,r){r===void 0&&(r=1);for(var t=r,n=or(e).parent;n;){if(--t===0)return n.storedValue;n=n.parent}throw new Qt("Failed to find the parent of ".concat(or(e)," at depth ").concat(r))}function OP(e,r){for(var t=or(e).parent;t;){if(r.is(t.storedValue))return!0;t=t.parent}return!1}function AP(e,r){for(var t=or(e).parent;t;){if(r.is(t.storedValue))return t.storedValue;t=t.parent}throw new Qt("Failed to find the parent of ".concat(or(e)," of a given type"))}function X6(e){return or(e).root.storedValue}function K6(e){return or(e).path}function CP(e){return Lh(or(e).path)}function kP(e){return or(e).isRoot}function LP(e,r){var t=p8(or(e),r);return t?t.value:void 0}function NP(e,r,t){var n=or(r).root.identifierCache.resolve(e,jh(t));return n==null?void 0:n.value}function Z6(e){return or(e).identifier}function TP(e,r){r===void 0&&(r=!0);try{var t=e();if(t==null)return;if(Ln(t))return r?vm(t)?t:void 0:t;throw new Qt("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof xm)return;throw n}}function RP(e,r){r===void 0&&(r=!0);try{var t=e();if(t==null)return!1;if(Ln(t))return r?vm(t):!0;throw new Qt("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof xm)return!1;throw n}}function Q6(e,r){var t=p8(or(e),r,!1);if(t!==void 0)try{return t.value}catch{return}}function MP(e,r){return d8(or(e),or(r))}function IP(e,r){r===void 0&&(r=!0);var t=or(e);return t.type.create(t.snapshot,r===!0?t.root.environment:r===!1?void 0:r)}function jP(e){return or(e).detach(),e}function FP(e){var r=or(e);r.isRoot?r.die():r.parent.removeChild(r.subpath)}function vm(e){return or(e).observableIsAlive}function DP(e,r){var t=or(e);return t.addDisposer(r),r}function BP(e){var r=or(e),t=r.root.environment;if(!t)throw new Qt("Failed to find the environment of ".concat(r," ").concat(r.path));return t}function qP(e){var r=or(e),t=r.root.environment;return!!t}function J6(e,r){var t=or(e);t.getChildren().forEach(function(n){Ln(n.storedValue)&&J6(n.storedValue,r)}),r(t.storedValue)}function e8(e){var r;return Ln(e)?r=Cp(e):r=e,{name:r.name,properties:_a({},r.properties)}}function zP(e){var r=or(e).type,t=_a(_a({},e8(r)),{actions:[],volatile:[],views:[],flowActions:[]}),n=Object.getOwnPropertyNames(e);return n.forEach(function(a){if(!(a in t.properties)){var i=Object.getOwnPropertyDescriptor(e,a);if(i.get){a6(e,a)?t.views.push(a):t.volatile.push(a);return}i.value._isFlowAction===!0&&t.flowActions.push(a),i.value._isMSTAction===!0?t.actions.push(a):s6(e,a)?t.volatile.push(a):t.views.push(a)}}),t}function UP(e){return e}function HP(e){return e}function GP(e){return e}function VP(e){return or(e).nodeId}var t8=function(){function e(r,t,n,a){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:a}),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:io.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=a,this.baseSetParent(t,n)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(r){var t=this.isAlive;this._state=r;var n=this.isAlive;this.aliveAtom&&t!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._hookSubscribers&&this._hookSubscribers.emit(r,this,r)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){return this._hookSubscribers||(this._hookSubscribers=new b8),this._hookSubscribers.register(r,t)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){this._parent=r,this._subpath=t,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r&&(this.pathAtom||(this.pathAtom=fp("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?Wc(this._subpath):""),this.parent.getEscapedPath(r)+"/"+this._escapedSubpath):""}}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAlive",{get:function(){return this.state!==io.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===io.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=fp("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.state===io.CREATED){if(this.parent){if(this.parent.state!==io.FINALIZED)return;this.fireHook(wa.afterAttach)}this.state=io.FINALIZED,r&&r()}}}),Object.defineProperty(e.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=io.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(wa.beforeDestroy)}}),e}(),pp=function(e){Jn(r,e);function r(t,n,a,i,o){var s=e.call(this,t,n,a,i)||this;try{s.storedValue=t.createNewInstance(o)}catch(u){throw s.state=io.DEAD,u}return s.state=io.CREATED,s.finalizeCreation(),s}return Object.defineProperty(r.prototype,"root",{get:function(){if(!this.parent)throw new Qt("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this.parent!==t,i=this.subpath!==n;!a&&!i||(this.environment=void 0,this.baseSetParent(this.parent,n))}}),Object.defineProperty(r.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(r.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(t).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(r.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===io.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(r.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(r.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(r.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(r.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.fireInternalHook(t)}}),r}(t8);pp.prototype.die=ca(pp.prototype.die);var WP=1,Gl;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(Gl||(Gl={}));var js;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(js||(js={}));var $P={onError:function(e){throw e}},ms=function(e){Jn(r,e);function r(t,n,a,i,o){var s=e.call(this,t,n,a,i)||this;if(Object.defineProperty(s,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++WP}),Object.defineProperty(s,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(s,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(s,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:Gl.UNINITIALIZED}),Object.defineProperty(s,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),s._snapshotComputed=Tf(function(){return s.getSnapshot()}),s.unbox=s.unbox.bind(s),s._initialSnapshot=o,s.identifierAttribute=t.identifierAttribute,n||(s.identifierCache=new dO),s._childNodes=t.initializeChildNodes(s,s._initialSnapshot),s.identifier=null,s.unnormalizedIdentifier=null,s.identifierAttribute&&s._initialSnapshot){var u=s._initialSnapshot[s.identifierAttribute];if(u===void 0){var c=s._childNodes[s.identifierAttribute];c&&(u=c.value)}if(typeof u!="string"&&typeof u!="number")throw new Qt("Instance identifier '".concat(s.identifierAttribute,"' for type '").concat(s.type.name,"' must be a string or a number"));s.identifier=jh(u),s.unnormalizedIdentifier=u}return n?n.root.identifierCache.addNodeToCache(s):s.identifierCache.addNodeToCache(s),s}return Object.defineProperty(r.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.createObservableInstanceIfNeeded(),this._applyPatches(t)}}),Object.defineProperty(r.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.createObservableInstanceIfNeeded(),this._applySnapshot(t)}}),Object.defineProperty(r.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(t){t===void 0&&(t=!0),this._observableInstanceState===Gl.UNINITIALIZED&&this.createObservableInstance(t)}}),Object.defineProperty(r.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n,a,i,o;t===void 0&&(t=!0),this._observableInstanceState=Gl.CREATING;for(var s=[],u=this.parent;u&&u._observableInstanceState===Gl.UNINITIALIZED;)s.unshift(u),u=u.parent;try{for(var c=lp(s),h=c.next();!h.done;h=c.next()){var p=h.value;p.createObservableInstanceIfNeeded(!1)}}catch(E){n={error:E}}finally{try{h&&!h.done&&(a=c.return)&&a.call(c)}finally{if(n)throw n.error}}var v=this.type;try{this.storedValue=v.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,v.finalizeNewInstance(this,this.storedValue)}catch(E){throw this.state=io.DEAD,E}finally{this._isRunningAction=!1}if(this._observableInstanceState=Gl.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=Ch,this.state=io.CREATED,t){this.fireHook(wa.afterCreate),this.finalizeCreation();try{for(var f=lp(s.reverse()),_=f.next();!_.done;_=f.next()){var p=_.value;p.fireHook(wa.afterCreate),p.finalizeCreation()}}catch(E){i={error:E}}finally{try{_&&!_.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}}}}),Object.defineProperty(r.prototype,"root",{get:function(){var t=this.parent;return t?t.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(wa.beforeDetach);var t=this.state;this.state=io.DETACHING;var n=this.root,a=n.environment,i=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=a,this.identifierCache=i}finally{this.state=t}}}}),Object.defineProperty(r.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=t!==this.parent,i=n!==this.subpath;!a&&!i||(a?(this.environment=void 0,t.root.identifierCache.mergeCache(this),this.baseSetParent(t,n),this.fireHook(wa.afterAttach)):i&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(r.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;this.fireInternalHook(t);var a=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[t];typeof a=="function"&&(Sh?Sh(function(){a.apply(n.storedValue)}):a.apply(this.storedValue))}}),Object.defineProperty(r.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===Gl.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(r.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(r.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var t=this.type,n=this._childNodes,a=this._initialSnapshot;this._cachedInitialSnapshot=t.processInitialSnapshot(n,a),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(r.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(r.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=V6();if(!this.isAlive&&n!=="ignore"){var a=this._getAssertAliveError(t);switch(n){case"error":throw new Qt(a);case"warn":OO(a)}}}}),Object.defineProperty(r.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.getEscapedPath(!1)||this.pathUponDeath||"",a=t.subpath&&Wc(t.subpath)||"",i=t.actionContext||mm();i&&i.type!=="action"&&i.parentActionEvent&&(i=i.parentActionEvent);var o="";if(i&&i.name!=null){var s=i&&i.context&&K6(i.context)||n;o="".concat(s,".").concat(i.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(n,"', Subpath: '").concat(a,"', Action: '").concat(o,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(r.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.assertAlive({subpath:t}),this._autoUnbox=!1;try{return this._observableInstanceState===Gl.CREATED?this.type.getChildNode(this,t):this._childNodes[t]}finally{this._autoUnbox=!0}}}),Object.defineProperty(r.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(Ch),this._autoUnbox=!1;try{return this._observableInstanceState===Gl.CREATED?this.type.getChildren(this):v8(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(r.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.type.getChildType(t)}}),Object.defineProperty(r.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.assertAlive(t),!this.isRunningAction()&&this.isProtected)throw new Qt("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(r.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.type.removeChild(this,t)}}),Object.defineProperty(r.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.assertAlive({subpath:t.subpath||t.subpathUponDeath}),this._autoUnbox?t.value:t)}}),Object.defineProperty(r.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=(this.isAlive?this.path:this.pathUponDeath)||"<root>",n=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(t).concat(n).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(r.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;this.baseFinalizeCreation(function(){var n,a;try{for(var i=lp(t.getChildren()),o=i.next();!o.done;o=i.next()){var s=o.value;s.finalizeCreation()}}catch(u){n={error:u}}finally{try{o&&!o.done&&(a=i.return)&&a.call(i)}finally{if(n)throw n.error}}t.fireInternalHook(wa.afterCreationFinalization)})}}),Object.defineProperty(r.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new Qt("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(r.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;this._applyPatches=gp(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(a){if(!a.path){t.type.applySnapshot(t,a.value);return}var i=Lh(a.path),o=g8(t,i.slice(0,-1));o.applyPatchLocally(i[i.length-1],a)})}),this._applySnapshot=gp(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==t.snapshot)return t.type.applySnapshot(t,n)}),Ef(this.storedValue,"$treenode",this),Ef(this.storedValue,"toJSON",gO)}}),Object.defineProperty(r.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===io.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(r.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==Gl.UNINITIALIZED&&(this.getChildren().forEach(function(t){t.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(js.Dispose),this._internalEventsClear(js.Dispose))}}),Object.defineProperty(r.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(n){n.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var t=this.snapshot;this._snapshotUponDeath=t,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(r.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._addSnapshotReaction(),this._internalEventsRegister(js.Snapshot,t)}}),Object.defineProperty(r.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._internalEventsEmit(js.Snapshot,t)}}),Object.defineProperty(r.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._internalEventsRegister(js.Patch,t)}}),Object.defineProperty(r.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this._internalEventsHasSubscribers(js.Patch)){var a=n.path.substr(this.path.length)+(t.path?"/"+t.path:""),i=xO({},t,{path:a}),o=Iu(TO(i),2),s=o[0],u=o[1];this._internalEventsEmit(js.Patch,s,u)}this.parent&&this.parent.emitPatch(t,n)}}),Object.defineProperty(r.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._internalEventsHas(js.Dispose,t)}}),Object.defineProperty(r.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this.hasDisposer(t)){this._internalEventsRegister(js.Dispose,t,!0);return}throw new Qt("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(r.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this._internalEventsHas(js.Dispose,t))throw new Qt("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(js.Dispose,t)}}),Object.defineProperty(r.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.middlewares){var n=this.middlewares.indexOf(t);n>=0&&this.middlewares.splice(n,1)}}}),Object.defineProperty(r.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this;n===void 0&&(n=!0);var i={handler:t,includeHooks:n};return this.middlewares?this.middlewares.push(i):this.middlewares=[i],function(){a.removeMiddleware(i)}}}),Object.defineProperty(r.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){this.assertWritable({subpath:t}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,t,n)}}),Object.defineProperty(r.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;if(!this._hasSnapshotReaction){var n=Zw(function(){return t.snapshot},function(a){return t.emitSnapshot(a)},$P);this.addDisposer(n),this._hasSnapshotReaction=!0}}}),Object.defineProperty(r.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return!!this._internalEvents&&this._internalEvents.hasSubscribers(t)}}),Object.defineProperty(r.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){return a===void 0&&(a=!1),this._internalEvents||(this._internalEvents=new b8),this._internalEvents.register(t,n,a)}}),Object.defineProperty(r.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return!!this._internalEvents&&this._internalEvents.has(t,n)}}),Object.defineProperty(r.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){this._internalEvents&&this._internalEvents.unregister(t,n)}}),Object.defineProperty(r.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){for(var n,a=[],i=1;i<arguments.length;i++)a[i-1]=arguments[i];this._internalEvents&&(n=this._internalEvents).emit.apply(n,ju([t],Iu(a),!1))}}),Object.defineProperty(r.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._internalEvents&&this._internalEvents.clear(t)}}),Object.defineProperty(r.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),r}(t8);ms.prototype.createObservableInstance=ca(ms.prototype.createObservableInstance);ms.prototype.detach=ca(ms.prototype.detach);ms.prototype.die=ca(ms.prototype.die);var r8,Lr;(function(e){e[e.String=1]="String",e[e.Number=2]="Number",e[e.Boolean=4]="Boolean",e[e.Date=8]="Date",e[e.Literal=16]="Literal",e[e.Array=32]="Array",e[e.Map=64]="Map",e[e.Object=128]="Object",e[e.Frozen=256]="Frozen",e[e.Optional=512]="Optional",e[e.Reference=1024]="Reference",e[e.Identifier=2048]="Identifier",e[e.Late=4096]="Late",e[e.Refinement=8192]="Refinement",e[e.Union=16384]="Union",e[e.Null=32768]="Null",e[e.Undefined=65536]="Undefined",e[e.Integer=131072]="Integer",e[e.Custom=262144]="Custom",e[e.SnapshotProcessor=524288]="SnapshotProcessor",e[e.Lazy=1048576]="Lazy",e[e.Finite=2097152]="Finite",e[e.Float=4194304]="Float"})(Lr||(Lr={}));var n8="cannotDetermine",YP=Symbol("$type"),pc=function(){function e(r){Object.defineProperty(this,r8,{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=r}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){return hc(this,r),this.instantiate(null,"",t,r).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){throw new Qt("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){var n=h8(r);if(n){var a=Cp(r);return this.isAssignableFrom(a)?ys():bs(t,r)}return this.isValidSnapshot(r,t)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.validate(r,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw new Qt("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TypeWithoutSTN",{get:function(){throw new Qt("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SnapshotType",{get:function(){throw new Qt("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreationType",{get:function(){throw new Qt("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),e}();r8=YP;pc.prototype.create=ca(pc.prototype.create);var Oh=function(e){Jn(r,e);function r(t){var n=e.call(this,t)||this;return Object.defineProperty(n,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(r.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return t===void 0&&(t=this.getDefaultSnapshot()),e.prototype.create.call(this,t,n)}}),Object.defineProperty(r.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.createObservableInstanceIfNeeded(),t.storedValue}}),Object.defineProperty(r.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return!t.identifierAttribute||t.identifier===jh(n[t.identifierAttribute])}}),Object.defineProperty(r.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return t.isDetaching?!1:t.snapshot===n||Ln(n)&&or(n)===t?!0:t.type===this&&m8(n)&&!Ln(n)&&this.isMatchingSnapshotId(t,n)?(t.applySnapshot(n),!0):!1}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=this.tryToReconcileNode(t,n);if(o)return t.setParent(a,i),t;if(t.die(),Ln(n)&&this.isAssignableFrom(Cp(n))){var s=or(n);return s.setParent(a,i),s}return this.instantiate(a,i,void 0,n)}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),r}(pc);Oh.prototype.create=ca(Oh.prototype.create);var Ff=function(e){Jn(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(r.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t}}),Object.defineProperty(r.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){if(!t.isDetaching&&t.type===this&&t.storedValue===n)return t;var o=this.instantiate(a,i,void 0,n);return t.die(),o}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),r}(pc);function Sa(e){return typeof e=="object"&&e&&e.isType===!0}var Ou=new Map;function XP(e){return function(t,n,a){switch(t.type){case"action":if(!e.filter||e.filter(t)===!0){var i=e.onStart(t);e.onResume(t,i),Ou.set(t.id,{call:t,context:i,async:!1});try{var o=n(t);return e.onSuspend(t,i),Ou.get(t.id).async===!1&&(Ou.delete(t.id),e.onSuccess(t,i,o)),o}catch(u){throw Ou.delete(t.id),e.onFail(t,i,u),u}}else return n(t);case"flow_spawn":{var s=Ou.get(t.rootId);return s.async=!0,n(t)}case"flow_resume":case"flow_resume_error":{var s=Ou.get(t.rootId);e.onResume(t,s.context);try{return n(t)}finally{e.onSuspend(t,s.context)}}case"flow_throw":{var s=Ou.get(t.rootId);return Ou.delete(t.rootId),e.onFail(t,s.context,t.args[0]),n(t)}case"flow_return":{var s=Ou.get(t.rootId);return Ou.delete(t.rootId),e.onSuccess(t,s.context,t.args[0]),n(t)}}}}var KP=function(){function e(r,t){Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"call",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"flowsPending",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"running",{enumerable:!0,configurable:!0,writable:!0,value:!0}),r&&r.onStart(t)}return Object.defineProperty(e.prototype,"finish",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.running&&(this.running=!1,this.hooks&&this.hooks.onFinish(this.call,r))}}),Object.defineProperty(e.prototype,"incFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending++}}),Object.defineProperty(e.prototype,"decFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending--}}),Object.defineProperty(e.prototype,"hasFlowsPending",{get:function(){return this.flowsPending>0},enumerable:!1,configurable:!0}),e}();function ZP(e){var r=new Map;return function(n,a){var i=n.parentActionEvent?r.get(n.parentActionEvent.id):void 0;if(n.type==="action"){var o=_a(_a({},n),{env:i&&i.call.env,parentCall:i&&i.call}),s=!e.filter||e.filter(o),u=s?e:void 0,c=new KP(u,o);r.set(n.id,c);var h=void 0;try{h=a(n)}catch(v){throw r.delete(n.id),c.finish(v),v}return c.hasFlowsPending||(r.delete(n.id),c.finish()),h}else{if(!i)return a(n);switch(n.type){case"flow_spawn":return i.incFlowsPending(),a(n);case"flow_resume":case"flow_resume_error":return a(n);case"flow_throw":{var p=n.args[0];try{return a(n)}finally{i.decFlowsPending(),i.hasFlowsPending||(r.delete(n.parentActionEvent.id),i.finish(p))}}case"flow_return":try{return a(n)}finally{i.decFlowsPending(),i.hasFlowsPending||(r.delete(n.parentActionEvent.id),i.finish())}}}}}function QP(e,r,t,n){if(n instanceof Date)return{$MST_DATE:n.getTime()};if(kh(n))return n;if(Ln(n))return u1("[MSTNode: ".concat(Cp(n).name,"]"));if(typeof n=="function")return u1("[function]");if(typeof n=="object"&&!xf(n)&&!_m(n))return u1("[object ".concat(n&&n.constructor&&n.constructor.name||"Complex Object","]"));try{return JSON.stringify(n),n}catch(a){return u1(""+a)}}function JP(e,r){return r&&typeof r=="object"&&"$MST_DATE"in r?new Date(r.$MST_DATE):r}function u1(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function i8(e,r){Sh(function(){Sm(r).forEach(function(t){return eO(e,t)})})}function eO(e,r){var t=Q6(e,r.path||"");if(!t)throw new Qt("Invalid action path: ".concat(r.path||""));var n=or(t);if(r.name==="@APPLY_PATCHES")return Ph.call(null,t,r.args[0]);if(r.name==="@APPLY_SNAPSHOT")return Y6.call(null,t,r.args[0]);if(typeof t[r.name]!="function")throw new Qt("Action '".concat(r.name,"' does not exist in '").concat(n.path,"'"));return t[r.name].apply(t,r.args?r.args.map(function(a){return JP(n,a)}):[])}function tO(e,r){var t=[],n=function(o){var s=r?r(o,ym()):!0;s&&t.push(o)},a,i={actions:t,get recording(){return!!a},stop:function(){a&&(a(),a=void 0)},resume:function(){a||(a=a8(e,n))},replay:function(o){i8(o,t)}};return i.resume(),i}function a8(e,r,t){return t===void 0&&(t=!1),l8(e,function(a,i){if(a.type==="action"&&a.id===a.rootId){var o=or(a.context),s={name:a.name,path:d8(or(e),o),args:a.args.map(function(c,h){return QP(o,a.name,h,c)})};if(t){var u=i(a);return r(s),u}else return r(s),i(a)}else return i(a)})}var rO=1,up;function mm(){return up}function o8(){return rO++}function O2(e,r){var t=or(e.context);e.type==="action"&&t.assertAlive({actionContext:e});var n=t._isRunningAction;t._isRunningAction=!0;var a=up;up=e;try{return aO(t,e,r)}finally{up=a,t._isRunningAction=n}}function s8(e){if(e)return e.type==="action"?e:e.parentActionEvent}function gp(e,r,t){var n=function(){var a=o8(),i=up,o=s8(i);return O2({type:"action",name:r,id:a,args:w8(arguments),context:e,tree:X6(e),rootId:i?i.rootId:a,parentId:i?i.id:0,allParentIds:i?ju(ju([],Iu(i.allParentIds),!1),[i.id],!1):[],parentEvent:i,parentActionEvent:o},t)};return n._isMSTAction=!0,n._isFlowAction=t._isFlowAction,n}function l8(e,r,t){t===void 0&&(t=!0);var n=or(e);return n.addMiddleWare(r,t)}function nO(e,r,t){t===void 0&&(t=!0);var n={handler:e,includeHooks:t};return r.$mst_middleware=r.$mst_middleware||[],r.$mst_middleware.push(n),r}var iO=function(){function e(r,t){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:[]}),t.$mst_middleware&&this.middlewares.push(t.$mst_middleware);for(var n=r;n;)n.middlewares&&this.middlewares.push(n.middlewares),n=n.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.middlewares[this.arrayIndex];if(r){var t=r[this.inArrayIndex++];return t||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e}();function aO(e,r,t){var n=new iO(e,t);if(n.isEmpty)return ca(t).apply(null,r.args);var a=null;function i(o){var s=n.getNextMiddleware(),u=s&&s.handler;if(!u)return ca(t).apply(null,o.args);if(!s.includeHooks&&wa[o.name])return i(o);function c(p,v){a=i(p),v&&(a=v(a))}function h(p){a=p}return u(o,c,h),a}return i(r)}function ym(){for(var e=mm();e&&e.type!=="action";)e=e.parentActionEvent;return e}function u8(e,r,t){for(var n=typeof r=="number"?r:r.id,a=t?e:e.parentActionEvent;a;){if(a.id===n)return!0;a=a.parentActionEvent}return!1}function oO(e,r){return u8(e,r,!1)}function sO(e,r){return u8(e,r,!0)}function lO(e){try{return JSON.stringify(e)}catch(r){return"<Unserializable: ".concat(r,">")}}function c8(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):Ln(e)?"<".concat(e,">"):"`".concat(lO(e),"`")}function uO(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function cO(e){var r=e.value,t=e.context[e.context.length-1].type,n=e.context.map(function(s){var u=s.path;return u}).filter(function(s){return s.length>0}).join("/"),a=n.length>0?'at path "/'.concat(n,'" '):"",i=Ln(r)?"value of type ".concat(or(r).type.name,":"):kh(r)?"value":"snapshot",o=t&&Ln(r)&&t.is(or(r).snapshot);return"".concat(a).concat(i," ").concat(c8(r)," is not assignable ").concat(t?"to type: `".concat(t.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(t?T8(t)||kh(r)?".":", expected an instance of `".concat(t.name,"` or a snapshot like `").concat(t.describe(),"` instead.")+(o?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function bm(e,r,t){return e.concat([{path:r,type:t}])}function ys(){return Ah}function bs(e,r,t){return[{context:e,value:r,message:t}]}function n0(e){return e.reduce(function(r,t){return r.concat(t)},[])}function hc(e,r){AO()&&f8(e,r)}function f8(e,r){var t=e.validate(r,[{path:"",type:e}]);if(t.length>0)throw new Qt(fO(e,r,t))}function fO(e,r,t){if(t.length!==0)return"Error while converting ".concat(uO(c8(r))," to `").concat(e.name,`\`:
|
|
93
|
-
|
|
94
|
-
`)+t.map(cO).join(`
|
|
95
|
-
`)}var hO=0,dO=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:hO++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:jn.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:jn.map()})}return Object.defineProperty(e.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=this.lastCacheModificationPerId.get(r);this.lastCacheModificationPerId.set(r,t===void 0?1:t+1)}}),Object.defineProperty(e.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=this.lastCacheModificationPerId.get(r)||0;return"".concat(this.cacheId,"-").concat(t)}}),Object.defineProperty(e.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){if(t===void 0&&(t=!0),r.identifierAttribute){var n=r.identifier;this.cache.has(n)||this.cache.set(n,jn.array([],i0));var a=this.cache.get(n);if(a.indexOf(r)!==-1)throw new Qt("Already registered");a.push(r),t&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=this;K2(r.identifierCache.cache).forEach(function(n){return n.forEach(function(a){t.addNodeToCache(a)})})}}),Object.defineProperty(e.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.identifierAttribute){var t=r.identifier,n=this.cache.get(t);n&&(n.remove(r),n.length||this.cache.delete(t),this.updateLastCacheModificationPerId(r.identifier))}}}),Object.defineProperty(e.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=this,n=new e,a=r.path+"/";return l6(this.cache).forEach(function(i){for(var o=Iu(i,2),s=o[0],u=o[1],c=!1,h=u.length-1;h>=0;h--){var p=u[h];(p===r||p.path.indexOf(a)===0)&&(n.addNodeToCache(p,!1),u.splice(h,1),u.length||t.cache.delete(s),c=!0)}c&&t.updateLastCacheModificationPerId(s)}),n}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){var n=this.cache.get(t);return n?n.some(function(a){return r.isAssignableFrom(a.type)}):!1}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){var n=this.cache.get(t);if(!n)return null;var a=n.filter(function(i){return r.isAssignableFrom(i.type)});switch(a.length){case 0:return null;case 1:return a[0];default:throw new Qt("Cannot resolve a reference to type '".concat(r.name,"' with id: '").concat(t,"' unambigously, there are multiple candidates: ").concat(a.map(function(i){return i.path}).join(", ")))}}}),e}();function wm(e,r,t,n,a){var i=h8(a);if(i){if(i.parent)throw new Qt("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(r?r.path:"","/").concat(t,"', but it lives already at '").concat(i.path,"'"));return r&&i.setParent(r,t),i}return new ms(e,r,t,n,a)}function nf(e,r,t,n,a){return new pp(e,r,t,n,a)}function pO(e){return e instanceof pp||e instanceof ms}var io;(function(e){e[e.INITIALIZING=0]="INITIALIZING",e[e.CREATED=1]="CREATED",e[e.FINALIZED=2]="FINALIZED",e[e.DETACHING=3]="DETACHING",e[e.DEAD=4]="DEAD"})(io||(io={}));function Ln(e){return!!(e&&e.$treenode)}function or(e){if(!Ln(e))throw new Qt("Value ".concat(e," is no MST Node"));return e.$treenode}function h8(e){return e&&e.$treenode||null}function gO(){return or(this).snapshot}var vO=function(e){return".."};function d8(e,r){if(e.root!==r.root)throw new Qt("Cannot calculate relative path: objects '".concat(e,"' and '").concat(r,"' are not part of the same object tree"));for(var t=Lh(e.path),n=Lh(r.path),a=0;a<t.length&&t[a]===n[a];a++);return t.slice(a).map(vO).join("/")+I1(n.slice(a))}function p8(e,r,t){return t===void 0&&(t=!0),g8(e,Lh(r),t)}function g8(e,r,t){t===void 0&&(t=!0);var n=e;try{for(var a=0;a<r.length;a++){var i=r[a];if(i===".."){if(n=n.parent,n)continue}else{if(i===".")continue;if(n){if(n instanceof pp){var o=n.value;Ln(o)&&(n=or(o))}if(n instanceof ms){var s=n.getChildType(i);if(s&&(n=n.getChildNode(i),n))continue}}}throw new Qt("Could not resolve '".concat(i,"' in path '").concat(I1(r.slice(0,a))||"/","' while resolving '").concat(I1(r),"'"))}}catch(u){if(!t)return;throw u}return n}function v8(e){if(!e)return Ah;var r=Object.keys(e);if(!r.length)return Ah;var t=new Array(r.length);return r.forEach(function(n,a){t[a]=e[n]}),t}function mO(e){return _8(e)}var yO=Object.toString(),Ah=Object.freeze([]),Ch=Object.freeze({}),i0=Bw().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(i0);var Qt=function(e){Jn(r,e);function r(t){return t===void 0&&(t="Illegal state"),e.call(this,"[mobx-state-tree] ".concat(t))||this}return r}(Error);function bO(e){return e}var wO=Number.isInteger;function _O(e){return Number(e)===e&&e%1!==0}function SO(e){return Number.isFinite(e)}function _m(e){return Array.isArray(e)||Go(e)}function Sm(e){return e?_m(e)?e:[e]:Ah}function xO(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var n=0;n<r.length;n++){var a=r[n];for(var i in a)e[i]=a[i]}return e}function xf(e){var r;if(e===null||typeof e!="object")return!1;var t=Object.getPrototypeOf(e);return t==null?!0:((r=t.constructor)===null||r===void 0?void 0:r.toString())===yO}function m8(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function kh(e,r){return r===void 0&&(r=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||r&&e instanceof Date}function y8(e){return typeof e!="function"}function EO(e,r,t){Ra(e)?Q2(e,r,t):Object.defineProperty(e,r,t)}function Ef(e,r,t){EO(e,r,{enumerable:!1,writable:!1,configurable:!0,value:t})}var PO=function(){function e(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){var n=this;return t===void 0&&(t=!1),t?this.handlers.unshift(r):this.handlers.push(r),function(){n.unregister(r)}}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.handlers.indexOf(r)>=0}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=this.handlers.indexOf(r);t>=0&&this.handlers.splice(t,1)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var n=this.handlers.slice();n.forEach(function(a){return a.apply(void 0,ju([],Iu(r),!1))})}}),e}(),b8=function(){function e(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=this.eventHandlers&&this.eventHandlers[r];return!!t&&t.hasSubscribers}}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t,n){n===void 0&&(n=!1),this.eventHandlers||(this.eventHandlers={});var a=this.eventHandlers[r];return a||(a=this.eventHandlers[r]=new PO),a.register(t,n)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){var n=this.eventHandlers&&this.eventHandlers[r];return!!n&&n.has(t)}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,t){var n=this.eventHandlers&&this.eventHandlers[r];n&&n.unregister(t)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.eventHandlers&&delete this.eventHandlers[r]}}),Object.defineProperty(e.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(r){for(var t,n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];var i=this.eventHandlers&&this.eventHandlers[r];i&&(t=i).emit.apply(t,ju([],Iu(n),!1))}}),e}();function w8(e){for(var r=new Array(e.length),t=0;t<e.length;t++)r[t]=e[t];return r}function dg(e,r){return e.indexOf(r)===0}function OO(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function AO(){return typeof process<"u"&&wb&&wb.ENABLE_TYPE_CHECK==="true"}function pg(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function _8(e){return NO(e.name,e)}function CO(e){return e}function kO(e){return function(){var r,t=[];for(r=0;r<arguments.length;r++)t[r]=arguments[r];return W6(this,function(n){switch(n.label){case 0:return[4,e.apply(void 0,ju([],Iu(t),!1))];case 1:return[2,n.sent()]}})}}function LO(e){return W6(this,function(r){switch(r.label){case 0:return[4,e];case 1:return[2,r.sent()]}})}function NO(e,r){var t=function(){var a=o8(),i=mm();if(!i)throw new Qt("a mst flow must always have a parent context");var o=s8(i);if(!o)throw new Qt("a mst flow must always have a parent action context");var s={name:e,id:a,tree:i.tree,context:i.context,parentId:i.id,allParentIds:ju(ju([],Iu(i.allParentIds),!1),[i.id],!1),rootId:i.rootId,parentEvent:i,parentActionEvent:o},u=arguments;function c(h,p,v){return h.$mst_middleware=t.$mst_middleware,O2(_a(_a({},s),{type:p,args:[v]}),h)}return new Promise(function(h,p){var v,f=function(){v=r.apply(null,arguments),_(void 0)};f.$mst_middleware=t.$mst_middleware,O2(_a(_a({},s),{type:"flow_spawn",args:w8(u)}),f);function _(x){var y;try{var g=c(function(S){y=v.next(S)},"flow_resume",x);g instanceof Error&&(y=v.throw(g))}catch(S){pg(function(){c(function(b){p(S)},"flow_throw",S)});return}w(y)}function E(x){var y;try{c(function(g){y=v.throw(g)},"flow_resume_error",x)}catch(g){pg(function(){c(function(S){p(g)},"flow_throw",g)});return}w(y)}function w(x){if(x.done){pg(function(){c(function(y){h(y)},"flow_return",x.value)});return}if(!x.value||typeof x.value.then!="function")throw new Qt("Only promises can be yielded to `async`, got: "+x);return x.value.then(_,E)}})};return t._isFlowAction=!0,t}function TO(e){if(!("oldValue"in e))throw new Qt("Patches without `oldValue` field cannot be inversed");return[RO(e),MO(e)]}function RO(e){switch(e.op){case"add":return{op:"add",path:e.path,value:e.value};case"remove":return{op:"remove",path:e.path};case"replace":return{op:"replace",path:e.path,value:e.value}}}function MO(e){switch(e.op){case"add":return{op:"remove",path:e.path};case"remove":return{op:"add",path:e.path,value:e.oldValue};case"replace":return{op:"replace",path:e.path,value:e.oldValue}}}function IO(e){return typeof e=="number"}function Wc(e){return IO(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function S8(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function I1(e){if(e.length===0)return"";var r=function(t){return t.map(Wc).join("/")};return e[0]==="."||e[0]===".."?r(e):"/"+r(e)}function Lh(e){var r=e.split("/").map(S8),t=e===""||e==="."||e===".."||dg(e,"/")||dg(e,"./")||dg(e,"../");if(!t)throw new Qt("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return r[0]===""&&r.shift(),r}var gg=Symbol("$preProcessorFailed"),jO=function(e){Jn(r,e);function r(t,n,a){var i=e.call(this,a||t.name)||this;return Object.defineProperty(i,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:n}),i}return Object.defineProperty(r.prototype,"flags",{get:function(){return this._subtype.flags|Lr.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(r.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._processors.preProcessor?this._processors.preProcessor.call(null,t):t}}),Object.defineProperty(r.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(t){try{return this.preProcessSnapshot(t)}catch{return gg}}}),Object.defineProperty(r.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this._processors.postProcessor?this._processors.postProcessor.call(null,t,n.storedValue):t}}),Object.defineProperty(r.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;FO(t.type,this,"create"),t instanceof ms&&(t.hasSnapshotPostProcessor=!!this._processors.postProcessor);var a=t.getSnapshot;t.getSnapshot=function(){return n.postProcessSnapshot(a.call(t),t)},M8(this._subtype)||(t.getReconciliationType=function(){return n})}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=Ln(i)?i:this.preProcessSnapshot(i),s=this._subtype.instantiate(t,n,a,o);return this._fixNode(s),s}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=this._subtype.reconcile(t,Ln(n)?n:this.preProcessSnapshot(n),a,i);return o!==t&&this._fixNode(o),o}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n=!0);var a=this._subtype.getSnapshot(t);return n?this.postProcessSnapshot(a,t):a}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this.preProcessSnapshotSafe(t);return a===gg?bs(n,t,"Failed to preprocess value"):this._subtype.validate(a,n)}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(r.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=Sa(t)?this._subtype:Ln(t)?gm(t,!1):this.preProcessSnapshotSafe(t);return n===gg?!1:this._subtype.validate(n,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(r.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(r.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!(this._subtype instanceof Oh))return!1;var a=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(t,a)}}),r}(pc);function FO(e,r){for(var t,n,a=[],i=2;i<arguments.length;i++)a[i-2]=arguments[i];try{for(var o=lp(a),s=o.next();!s.done;s=o.next()){var u=s.value;e[u]=r[u].bind(r)}}catch(c){t={error:c}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}}function DO(e,r,t){return new jO(e,r,t)}var _b="Map.put can only be used to store complex values that have an identifier type attribute";function x8(e,r){var t,n,a=e.getSubTypes();if(a===n8)return!1;if(a){var i=Sm(a);try{for(var o=lp(i),s=o.next();!s.done;s=o.next()){var u=s.value;if(!x8(u,r))return!1}}catch(c){t={error:c}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}}return e instanceof vp&&r.push(e),!0}var Uc;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(Uc||(Uc={}));var BO=function(e){Jn(r,e);function r(t,n){return e.call(this,t,jn.ref.enhancer,n)||this}return Object.defineProperty(r.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.get.call(this,""+t)}}),Object.defineProperty(r.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.has.call(this,""+t)}}),Object.defineProperty(r.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.delete.call(this,""+t)}}),Object.defineProperty(r.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return e.prototype.set.call(this,""+t,n)}}),Object.defineProperty(r.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!t)throw new Qt("Map.put cannot be used to set empty values");if(Ln(t)){var n=or(t);if(n.identifier===null)throw new Qt(_b);return this.set(n.identifier,t),t}else if(m8(t)){var a=or(this),i=a.type;if(i.identifierMode!==Uc.YES)throw new Qt(_b);var o=i.mapIdentifierAttribute,s=t[o];if(!Em(s)){var u=this.put(i.getChildType().create(t,a.environment));return this.put(gm(u))}var c=jh(s);return this.set(c,t),this.get(c)}else throw new Qt("Map.put can only be used to store complex values")}}),r}(Q1),j1=function(e){Jn(r,e);function r(t,n,a){a===void 0&&(a=[]);var i=e.call(this,t)||this;return Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:Uc.UNKNOWN}),Object.defineProperty(i,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Map}),Object.defineProperty(i,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),i._determineIdentifierMode(),i.hookInitializers=a,i}return Object.defineProperty(r.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.hookInitializers.length>0?this.hookInitializers.concat(t):[t];return new r(this.name,this._subType,n)}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this._determineIdentifierMode(),wm(this,t,n,a,i)}}),Object.defineProperty(r.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===Uc.UNKNOWN){var t=[];if(x8(this._subType,t)){var n=t.reduce(function(a,i){if(!i.identifierAttribute)return a;if(a&&a!==i.identifierAttribute)throw new Qt("The objects in a map should all have the same identifier attribute, expected '".concat(a,"', but child of type '").concat(i.name,"' declared attribute '").concat(i.identifierAttribute,"' as identifier"));return i.identifierAttribute},void 0);n?(this.identifierMode=Uc.YES,this.mapIdentifierAttribute=n):this.identifierMode=Uc.NO}}}}),Object.defineProperty(r.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n={});var a=t.type._subType,i={};return Object.keys(n).forEach(function(o){i[o]=a.instantiate(t,o,void 0,n[o])}),i}}),Object.defineProperty(r.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new BO(t,this.name)}}),Object.defineProperty(r.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){X2(n,t.unbox);var a=t.type;a.hookInitializers.forEach(function(i){var o=i(n);Object.keys(o).forEach(function(s){var u=o[s],c=gp(n,s,u);Ef(n,s,c)})}),X1(n,this.willChange),Z1(n,this.didChange)}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(r.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return K2(t.storedValue)}}),Object.defineProperty(r.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=t.storedValue.get(""+n);if(!a)throw new Qt("Not a child "+n);return a}}),Object.defineProperty(r.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=or(t.object),a=t.name;n.assertWritable({subpath:a});var i=n.type,o=i._subType;switch(t.type){case"update":{var s=t.newValue,u=t.object.get(a);if(s===u)return null;hc(o,s),t.newValue=o.reconcile(n.getChildNode(a),t.newValue,n,a),i.processIdentifier(a,t.newValue)}break;case"add":hc(o,t.newValue),t.newValue=o.instantiate(n,a,void 0,t.newValue),i.processIdentifier(a,t.newValue);break}return t}}),Object.defineProperty(r.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this.identifierMode===Uc.YES&&n instanceof ms){var a=n.identifier;if(a!==t)throw new Qt("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(a,"', but expected: '").concat(t,"'"))}}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n={};return t.getChildren().forEach(function(a){n[a.subpath]=a.snapshot}),n}}),Object.defineProperty(r.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n={};return Object.keys(t).forEach(function(a){n[a]=t[a].getSnapshot()}),n}}),Object.defineProperty(r.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=or(t.object);switch(t.type){case"update":return void n.emitPatch({op:"replace",path:Wc(t.name),value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:Wc(t.name),value:t.newValue.snapshot,oldValue:void 0},n);case"delete":var a=t.oldValue.snapshot;return t.oldValue.die(),void n.emitPatch({op:"remove",path:Wc(t.name),oldValue:a},n)}}}),Object.defineProperty(r.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){var i=t.storedValue;switch(a.op){case"add":case"replace":i.set(n,a.value);break;case"remove":i.delete(n);break}}}),Object.defineProperty(r.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){hc(this,n);var a=t.storedValue,i={};if(Array.from(a.keys()).forEach(function(s){i[s]=!1}),n)for(var o in n)a.set(o,n[o]),i[""+o]=!0;Object.keys(i).forEach(function(s){i[s]===!1&&a.delete(s)})}}),Object.defineProperty(r.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this;return xf(t)?n0(Object.keys(t).map(function(i){return a._subType.validate(t[i],bm(n,i,a._subType))})):bs(n,t,"Value is not a plain object")}}),Object.defineProperty(r.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ch}}),Object.defineProperty(r.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){t.storedValue.delete(n)}}),r}(Oh);j1.prototype.applySnapshot=ca(j1.prototype.applySnapshot);function qO(e){return new j1("Map<string, ".concat(e.name,">"),e)}function zO(e){return Sa(e)&&(e.flags&Lr.Map)>0}var F1=function(e){Jn(r,e);function r(t,n,a){a===void 0&&(a=[]);var i=e.call(this,t)||this;return Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Array}),Object.defineProperty(i,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),i.hookInitializers=a,i}return Object.defineProperty(r.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.hookInitializers.length>0?this.hookInitializers.concat(t):[t];return new r(this.name,this._subType,n)}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return wm(this,t,n,a,i)}}),Object.defineProperty(r.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n=[]);var a=t.type._subType,i={};return n.forEach(function(o,s){var u=""+s;i[u]=a.instantiate(t,u,void 0,o)}),i}}),Object.defineProperty(r.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=_a(_a({},i0),{name:this.name});return jn.array(v8(t),n)}}),Object.defineProperty(r.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){Zl(n).dehancer=t.unbox;var a=t.type;a.hookInitializers.forEach(function(i){var o=i(n);Object.keys(o).forEach(function(s){var u=o[s],c=gp(n,s,u);Ef(n,s,c)})}),X1(n,this.willChange),Z1(n,this.didChange)}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(r.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue.slice()}}),Object.defineProperty(r.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=Number(n);if(a<t.storedValue.length)return t.storedValue[a];throw new Qt("Not a child: "+n)}}),Object.defineProperty(r.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=or(t.object);n.assertWritable({subpath:""+t.index});var a=n.type._subType,i=n.getChildren();switch(t.type){case"update":{if(t.newValue===t.object[t.index])return null;var o=Sb(n,a,[i[t.index]],[t.newValue],[t.index]);if(!o)return null;t.newValue=o[0]}break;case"splice":{var s=t.index,u=t.removedCount,c=t.added,h=Sb(n,a,i.slice(s,s+u),c,c.map(function(v,f){return s+f}));if(!h)return null;t.added=h;for(var p=s+u;p<i.length;p++)i[p].setParent(n,""+(p+c.length-u))}break}return t}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.getChildren().map(function(n){return n.snapshot})}}),Object.defineProperty(r.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=[];return Object.keys(t).forEach(function(a){n.push(t[a].getSnapshot())}),n}}),Object.defineProperty(r.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=or(t.object);switch(t.type){case"update":return void n.emitPatch({op:"replace",path:""+t.index,value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},n);case"splice":if(t.removedCount&&t.addedCount===t.object.length)return void n.emitPatch({op:"replace",path:"",value:n.snapshot,oldValue:t.removed.map(function(i){return i.snapshot})},n);for(var a=t.removedCount-1;a>=0;a--)n.emitPatch({op:"remove",path:""+(t.index+a),oldValue:t.removed[a].snapshot},n);for(var a=0;a<t.addedCount;a++)n.emitPatch({op:"add",path:""+(t.index+a),value:t.added[a].snapshot,oldValue:void 0},n);return}}}),Object.defineProperty(r.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){var i=t.storedValue,o=n==="-"?i.length:Number(n);switch(a.op){case"replace":i[o]=a.value;break;case"add":i.splice(o,0,a.value);break;case"remove":i.splice(o,1);break}}}),Object.defineProperty(r.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){hc(this,n);var a=t.storedValue;a.replace(n)}}),Object.defineProperty(r.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this;return _m(t)?n0(t.map(function(i,o){return a._subType.validate(i,bm(n,""+o,a._subType))})):bs(n,t,"Value is not an array")}}),Object.defineProperty(r.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ah}}),Object.defineProperty(r.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){t.storedValue.splice(Number(n),1)}}),r}(Oh);F1.prototype.applySnapshot=ca(F1.prototype.applySnapshot);function UO(e){return new F1("".concat(e.name,"[]"),e)}function Sb(e,r,t,n,a){for(var i=!0,o=0;;o++){var s=o<=n.length-1,u=t[o],c=s?n[o]:void 0,h=""+a[o];if(pO(c)&&(c=c.storedValue),!u&&!s)break;if(!s)i=!1,t.splice(o,1),u instanceof ms&&u.createObservableInstanceIfNeeded(),u.die(),o--;else if(u)if(xb(u,c))t[o]=vg(r,e,h,c,u);else{for(var v=void 0,f=o;f<t.length;f++)if(xb(t[f],c)){v=t.splice(f,1)[0];break}i=!1;var p=vg(r,e,h,c,v);t.splice(o,0,p)}else{if(Ln(c)&&or(c).parent===e)throw new Qt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(e.path,"/").concat(h,"', but it lives already at '").concat(or(c).path,"'"));i=!1;var p=vg(r,e,h,c);t.splice(o,0,p)}}return i?null:t}function vg(e,r,t,n,a){hc(e,n);function i(){if(Ln(n)){var s=or(n);if(s.assertAlive(Ch),s.parent!==null&&s.parent===r)return s.setParent(r,t),s}return a?e.reconcile(a,n,r,t):e.instantiate(r,t,void 0,n)}var o=i();return a&&a!==o&&(a instanceof ms&&a.createObservableInstanceIfNeeded(),a.die()),o}function xb(e,r){if(!e.isAlive)return!1;if(Ln(r)){var t=or(r);return t.isAlive&&t===e}if(e.snapshot===r)return!0;if(!(e instanceof ms))return!1;var n=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&xf(r)&&n.is(r)&&n.isMatchingSnapshotId(e,r)}function HO(e){return Sa(e)&&(e.flags&Lr.Array)>0}var Eb="preProcessSnapshot",Pb="postProcessSnapshot";function GO(){return or(this).toString()}var Ob={name:"AnonymousModel",properties:{},initializers:Ah};function VO(e){var r=Object.keys(e),t=new Set;return r.forEach(function(n){if(t.has(n))throw new Qt("".concat(n," is declared twice in the model. Model should not contain the same keys"));t.add(n)}),r.reduce(function(n,a){if(a in wa)throw new Qt("Hook '".concat(a,"' was defined as property. Hooks should be defined as part of the actions"));var i=Object.getOwnPropertyDescriptor(e,a);if("get"in i)throw new Qt("Getters are not supported as properties. Please use views instead");var o=i.value;if(o==null)throw new Qt("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(kh(o))n[a]=Pf(ZO(o),o);else if(o instanceof j1)n[a]=Pf(o,{});else if(o instanceof F1)n[a]=Pf(o,[]);else if(!Sa(o))throw new Qt("Invalid type definition for property '".concat(a,"', cannot infer a type from a value like '").concat(o,"' (").concat(typeof o,")"));return n},_a({},e))}var vp=function(e){Jn(r,e);function r(t){var n=e.call(this,t.name||Ob.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Object}),Object.defineProperty(n,"initializers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"preProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"postProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"propertyNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"named",{enumerable:!0,configurable:!0,writable:!0,value:function(a){return n.cloneAndEnhance({name:a})}}),Object.defineProperty(n,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(a){return n.cloneAndEnhance({properties:a})}}),Object.defineProperty(n,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(a){var i=n.preProcessor;return i?n.cloneAndEnhance({preProcessor:function(o){return i(a(o))}}):n.cloneAndEnhance({preProcessor:a})}}),Object.defineProperty(n,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(a){var i=n.postProcessor;return i?n.cloneAndEnhance({postProcessor:function(o){return a(i(o))}}):n.cloneAndEnhance({postProcessor:a})}}),Object.assign(n,Ob,t),n.properties=VO(n.properties),n.properties,n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return Object.defineProperty(r.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=void 0;return this.forAllProps(function(n,a){if(a.flags&Lr.Identifier){if(t)throw new Qt("Cannot define property '".concat(n,"' as object identifier, property '").concat(t,"' is already defined as identifier property"));t=n}}),t}}),Object.defineProperty(r.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new r({name:t.name||this.name,properties:Object.assign({},this.properties,t.properties),initializers:this.initializers.concat(t.initializers||[]),preProcessor:t.preProcessor||this.preProcessor,postProcessor:t.postProcessor||this.postProcessor})}}),Object.defineProperty(r.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,a=function(i){return n.instantiateActions(i,t(i)),i};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(r.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!xf(n))throw new Qt("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(a){if(a===Eb)throw new Qt("Cannot define action '".concat(Eb,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(a===Pb)throw new Qt("Cannot define action '".concat(Pb,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var i=n[a],o=t[a];if(a in wa&&o){var s=i;i=function(){o.apply(null,arguments),s.apply(null,arguments)}}var u=i.$mst_middleware,c=i.bind(n);c._isFlowAction=i._isFlowAction||!1,c.$mst_middleware=u;var h=gp(t,a,c);n[a]=h,Ef(t,a,h)})}}),Object.defineProperty(r.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;if(typeof t!="function")throw new Qt("You passed an ".concat(typeof t," to volatile state as an argument, when function is expected"));var a=function(i){return n.instantiateVolatileState(i,t(i)),i};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(r.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!xf(n))throw new Qt("volatile state initializer should return a plain object containing state");Z2(t,n)}}),Object.defineProperty(r.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,a=function(i){var o=t(i),s=o.actions,u=o.views,c=o.state,h=mP(o,["actions","views","state"]);for(var p in h)throw new Qt("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(p,"'"));return c&&n.instantiateVolatileState(i,c),u&&n.instantiateViews(i,u),s&&n.instantiateActions(i,s),i};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(r.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,a=function(i){return n.instantiateViews(i,t(i)),i};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(r.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!xf(n))throw new Qt("views initializer should return a plain object containing views");Object.getOwnPropertyNames(n).forEach(function(a){var i,o=Object.getOwnPropertyDescriptor(n,a);if("get"in o)Q2(t,a,o),J2(t,(i={},i[a]=Tf,i));else if(typeof o.value=="function")Ef(t,a,o.value);else throw new Qt("A view member should either be a function or getter based property")})}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=Ln(i)?i:this.applySnapshotPreProcessor(i);return wm(this,t,n,a,o)}}),Object.defineProperty(r.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n={});var a=t.type,i={};return a.forAllProps(function(o,s){i[o]=s.instantiate(t,o,void 0,n[o])}),i}}),Object.defineProperty(r.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=_a(_a({},i0),{name:this.name});return jn.object(t,Ch,n)}}),Object.defineProperty(r.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){Ef(n,"toString",GO),this.forAllProps(function(a){X2(n,a,t.unbox)}),this.initializers.reduce(function(a,i){return i(a)},n),X1(n,this.willChange),Z1(n,this.didChange)}}),Object.defineProperty(r.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=t,a=or(n.object),i=n.name;a.assertWritable({subpath:i});var o=a.type.properties[i];return o&&(hc(o,n.newValue),n.newValue=o.reconcile(a.getChildNode(i),n.newValue,a,i)),n}}),Object.defineProperty(r.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=t,a=or(n.object),i=a.type.properties[n.name];if(i){var o=n.oldValue?n.oldValue.snapshot:void 0;a.emitPatch({op:"replace",path:Wc(n.name),value:n.newValue.snapshot,oldValue:o},a)}}}),Object.defineProperty(r.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,a=[];return this.forAllProps(function(i){a.push(n.getChildNode(t,i))}),a}}),Object.defineProperty(r.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a;if(!(n in this.properties))throw new Qt("Not a value property: "+n);var i=Zl(t.storedValue,n),o=(a=i.raw)===null||a===void 0?void 0:a.call(i);if(!o)throw new Qt("Node not available for property "+n);return o}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this;n===void 0&&(n=!0);var i={};return this.forAllProps(function(o,s){try{var u=Mu(t.storedValue,o);u.reportObserved()}catch{throw new Qt("".concat(o," property is declared twice"))}i[o]=a.getChildNode(t,o).snapshot}),n?this.applySnapshotPostProcessor(i):i}}),Object.defineProperty(r.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n={};return Object.keys(t).forEach(function(a){n[a]=t[a].getSnapshot()}),this.applySnapshotPostProcessor(n)}}),Object.defineProperty(r.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){if(!(a.op==="replace"||a.op==="add"))throw new Qt("object does not support operation ".concat(a.op));t.storedValue[n]=a.value}}),Object.defineProperty(r.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){hc(this,n);var a=this.applySnapshotPreProcessor(n);this.forAllProps(function(i){t.storedValue[i]=a[i]})}}),Object.defineProperty(r.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.preProcessor;return n?n.call(null,t):t}}),Object.defineProperty(r.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.postProcessor;return n?n.call(null,t):t}}),Object.defineProperty(r.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.properties[t]}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this,i=this.applySnapshotPreProcessor(t);return xf(i)?n0(this.propertyNames.map(function(o){return a.properties[o].validate(i[o],bm(n,o,a.properties[o]))})):bs(n,i,"Value is not a plain object")}}),Object.defineProperty(r.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;this.propertyNames.forEach(function(a){return t(a,n.properties[a])})}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;return"{ "+this.propertyNames.map(function(n){return n+": "+t.properties[n].describe()}).join("; ")+" }"}}),Object.defineProperty(r.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ch}}),Object.defineProperty(r.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){t.storedValue[n]=void 0}}),r}(Oh);vp.prototype.applySnapshot=ca(vp.prototype.applySnapshot);function WO(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var t=typeof e[0]=="string"?e.shift():"AnonymousModel",n=e.shift()||{};return new vp({name:t,properties:n})}function $O(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var t=typeof e[0]=="string",n=t?e[0]:"AnonymousModel";return t&&e.shift(),e.reduce(function(a,i){return a.cloneAndEnhance({name:a.name+"_"+i.name,properties:i.properties,initializers:i.initializers,preProcessor:function(o){return i.applySnapshotPreProcessor(a.applySnapshotPreProcessor(o))},postProcessor:function(o){return i.applySnapshotPostProcessor(a.applySnapshotPostProcessor(o))}})}).named(n)}function E8(e){return Sa(e)&&(e.flags&Lr.Object)>0}var vc=function(e){Jn(r,e);function r(t,n,a,i){i===void 0&&(i=bO);var o=e.call(this,t)||this;return Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"checker",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(o,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:i}),o.flags=n,o}return Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return nf(this,t,n,a,i)}}),Object.defineProperty(r.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.initializer(t)}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(kh(t)&&this.checker(t))return ys();var a=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return bs(n,t,"Value is not a ".concat(a))}}),r}(Ff),P8=new vc("string",Lr.String,function(e){return typeof e=="string"}),O8=new vc("number",Lr.Number,function(e){return typeof e=="number"}),YO=new vc("integer",Lr.Integer,function(e){return wO(e)}),XO=new vc("float",Lr.Float,function(e){return _O(e)}),KO=new vc("finite",Lr.Finite,function(e){return SO(e)}),A8=new vc("boolean",Lr.Boolean,function(e){return typeof e=="boolean"}),C8=new vc("null",Lr.Null,function(e){return e===null}),k8=new vc("undefined",Lr.Undefined,function(e){return e===void 0}),L8=new vc("Date",Lr.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});L8.getSnapshot=function(e){return e.storedValue.getTime()};var N8=L8;function ZO(e){switch(typeof e){case"string":return P8;case"number":return O8;case"boolean":return A8;case"object":if(e instanceof Date)return N8}throw new Qt("Cannot determine primitive type from value "+e)}function T8(e){return Sa(e)&&(e.flags&(Lr.String|Lr.Number|Lr.Integer|Lr.Boolean|Lr.Date))>0}var QO=function(e){Jn(r,e);function r(t){var n=e.call(this,JSON.stringify(t))||this;return Object.defineProperty(n,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Literal}),n.value=t,n}return Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return nf(this,t,n,a,i)}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return kh(t)&&t===this.value?ys():bs(n,t,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),r}(Ff);function R8(e){return new QO(e)}function JO(e){return Sa(e)&&(e.flags&Lr.Literal)>0}var eA=function(e){Jn(r,e);function r(t,n,a,i){var o=e.call(this,t)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(o,"_message",{enumerable:!0,configurable:!0,writable:!0,value:i}),o}return Object.defineProperty(r.prototype,"flags",{get:function(){return this._subtype.flags|Lr.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this._subtype.instantiate(t,n,a,i)}}),Object.defineProperty(r.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this._subtype.validate(t,n);if(a.length>0)return a;var i=Ln(t)?or(t).snapshot:t;return this._predicate(i)?ys():bs(n,t,this._message(t))}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this._subtype.reconcile(t,n,a,i)}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),r}(pc);function tA(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var t=typeof e[0]=="string"?e.shift():Sa(e[0])?e[0].name:null,n=e[0],a=e[1],i=e[2]?e[2]:function(o){return"Value does not respect the refinement predicate"};return new eA(t,n,a,i)}function rA(e){return Sa(e)&&(e.flags&Lr.Refinement)>0}function nA(e,r){var t=typeof e=="string"?r:e,n=a0.apply(void 0,ju([],Iu(t.map(function(a){return R8(""+a)})),!1));return typeof e=="string"&&(n.name=e),n}var iA=function(e){Jn(r,e);function r(t,n,a){var i=e.call(this,t)||this;return Object.defineProperty(i,"_types",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),a=_a({eager:!0,dispatcher:void 0},a),i._dispatcher=a.dispatcher,a.eager||(i._eager=!1),i}return Object.defineProperty(r.prototype,"flags",{get:function(){var t=Lr.Union;return this._types.forEach(function(n){t|=n.flags}),t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._types.some(function(n){return n.isAssignableFrom(t)})}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(t){return t.describe()}).join(" | ")+")"}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=this.determineType(i,void 0);if(!o)throw new Qt("No matching type for union "+this.describe());return o.instantiate(t,n,a,i)}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=this.determineType(n,t.getReconciliationType());if(!o)throw new Qt("No matching type for union "+this.describe());return o.reconcile(t,n,a,i)}}),Object.defineProperty(r.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this._dispatcher?this._dispatcher(t):n?n.is(t)?n:this._types.filter(function(a){return a!==n}).find(function(a){return a.is(t)}):this._types.find(function(a){return a.is(t)})}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this._dispatcher)return this._dispatcher(t).validate(t,n);for(var a=[],i=0,o=0;o<this._types.length;o++){var s=this._types[o],u=s.validate(t,n);if(u.length===0){if(this._eager)return ys();i++}else a.push(u)}return i===1?ys():bs(n,t,"No type is applicable for the union").concat(n0(a))}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),r}(pc);function a0(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];var n=Sa(e)?void 0:e,a=Sa(e)?ju([e],Iu(r),!1):r,i="("+a.map(function(o){return o.name}).join(" | ")+")";return new iA(i,a,n)}function M8(e){return Sa(e)&&(e.flags&Lr.Union)>0}var aA=function(e){Jn(r,e);function r(t,n,a){var i=e.call(this,t.name)||this;return Object.defineProperty(i,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:a}),i}return Object.defineProperty(r.prototype,"flags",{get:function(){return this._subtype.flags|Lr.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){if(this.optionalValues.indexOf(i)>=0){var o=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(t,n,a,o)}return this._subtype.instantiate(t,n,a,i)}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this._subtype.reconcile(t,this.optionalValues.indexOf(n)<0&&this._subtype.is(n)?n:this.getDefaultInstanceOrSnapshot(),a,i)}}),Object.defineProperty(r.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&hc(this,t),t}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this.optionalValues.indexOf(t)>=0?ys():this._subtype.validate(t,n)}}),Object.defineProperty(r.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),r}(pc);function oA(e,r){if(typeof r!="function"&&Ln(r))throw new Qt("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function Pf(e,r,t){return oA(e,r),new aA(e,r,t||sA)}var sA=[void 0];function lA(e){return Sa(e)&&(e.flags&Lr.Optional)>0}var uA=Pf(k8,void 0),cA=Pf(C8,null);function I8(e){return a0(e,uA)}function fA(e){return a0(e,cA)}var hA=function(e){Jn(r,e);function r(t,n){var a=e.call(this,t)||this;return Object.defineProperty(a,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),a}return Object.defineProperty(r.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|Lr.Late},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this._subType){var n=void 0;try{n=this._definition()}catch(a){if(a instanceof ReferenceError)n=void 0;else throw a}if(t&&n===void 0)throw new Qt("Late type seems to be used too early, the definition (still) returns undefined");n&&(this._subType=n)}return this._subType}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this.getSubType(!0).instantiate(t,n,a,i)}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this.getSubType(!0).reconcile(t,n,a,i)}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.getSubType(!1);return t?t.name:"<uknown late type>"}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this.getSubType(!1);return a?a.validate(t,n):ys()}}),Object.defineProperty(r.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.getSubType(!1);return n?n.isAssignableFrom(t):!1}}),Object.defineProperty(r.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.getSubType(!1);return t||n8}}),r}(pc);function dA(e,r){var t=typeof e=="string"?e:"late(".concat(e.toString(),")"),n=typeof e=="string"?r:e;return new hA(t,n)}function pA(e){return Sa(e)&&(e.flags&Lr.Late)>0}function gA(e,r){return new vA(e,r)}var vA=function(e){Jn(r,e);function r(t,n){var a=e.call(this,t)||this;return Object.defineProperty(a,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Lazy}),Object.defineProperty(a,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(a,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:jn.array()}),_2(function(){return a.pendingNodeList.length>0&&a.pendingNodeList.some(function(i){return i.isAlive&&a.options.shouldLoadPredicate(i.parent?i.parent.value:null)})},function(){a.options.loadType().then(ca(function(i){a.loadedType=i,a.pendingNodeList.forEach(function(o){o.parent&&a.loadedType&&o.parent.applyPatches([{op:"replace",path:"/".concat(o.subpath),value:o.snapshot}])})}))}),a}return Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=this;if(this.loadedType)return this.loadedType.instantiate(t,n,a,i);var s=nf(this,t,n,a,i);return this.pendingNodeList.push(s),_2(function(){return!s.isAlive},function(){return o.pendingNodeList.splice(o.pendingNodeList.indexOf(s),1)}),s}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this.loadedType?this.loadedType.validate(t,n):y8(t)?ys():bs(n,t,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return this.loadedType?(t.die(),this.loadedType.instantiate(a,i,a.environment,n)):e.prototype.reconcile.call(this,t,n,a,i)}}),r}(Ff),j8=function(e){Jn(r,e);function r(t){var n=e.call(this,t?"frozen(".concat(t.name,")"):"frozen")||this;return Object.defineProperty(n,"subType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Frozen}),n}return Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){return nf(this,t,n,a,i)}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return y8(t)?this.subType?this.subType.validate(t,n):ys():bs(n,t,"Value is not serializable and cannot be frozen")}}),r}(Ff),Ab=new j8;function mA(e){return arguments.length===0?Ab:Sa(e)?new j8(e):Pf(Ab,e)}function yA(e){return Sa(e)&&(e.flags&Lr.Frozen)>0}function bA(e){switch(e){case wa.beforeDestroy:return"destroy";case wa.beforeDetach:return"detach";default:return}}var wA=function(){function e(r,t){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:t}),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}),Em(r))this.identifier=r;else if(Ln(r)){var n=or(r);if(!n.identifierAttribute)throw new Qt("Can only store references with a defined identifier attribute.");var a=n.unnormalizedIdentifier;if(a==null)throw new Qt("Can only store references to tree nodes with a defined identifier.");this.identifier=a}else throw new Qt("Can only store references to tree nodes or identifiers, got: '".concat(r,"'"))}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=jh(this.identifier),n=r.root,a=n.identifierCache.getLastCacheModificationPerId(t);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==a){var i=this.targetType,o=n.identifierCache.resolve(i,t);if(!o)throw new xm("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(r.path,")"));this.resolvedReference={node:o,lastCacheModification:a}}}}),Object.defineProperty(e.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e}(),xm=function(e){Jn(r,e);function r(t){var n=e.call(this,t)||this;return Object.setPrototypeOf(n,r.prototype),n}return r}(Error),F8=function(e){Jn(r,e);function r(t,n){var a=e.call(this,"reference(".concat(t.name,")"))||this;return Object.defineProperty(a,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(a,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Reference}),a}return Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(r.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.targetType.isAssignableFrom(t)}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return Em(t)?ys():bs(n,t,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(r.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=n.parent;if(!(!o||!o.isAlive)){var s=o.storedValue;s&&this.onInvalidated({cause:t,parent:s,invalidTarget:i?i.storedValue:void 0,invalidId:a,replaceRef:function(u){Ph(n.root.storedValue,{op:"replace",value:u,path:n.path})},removeRef:function(){E8(o.type)?this.replaceRef(void 0):Ph(n.root.storedValue,{op:"remove",path:n.path})}})}}}),Object.defineProperty(r.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this,i=this.getValue(t);if(i){var o=or(i),s=function(h,p){var v=bA(p);v&&a.fireInvalidated(v,t,n,o)},u=o.registerHook(wa.beforeDetach,s),c=o.registerHook(wa.beforeDestroy,s);return function(){u(),c()}}}}),Object.defineProperty(r.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){var i=this;if(this.onInvalidated){var o;t.registerHook(wa.beforeDestroy,function(){o&&o()});var s=function(u){o&&o();var c=t.parent,h=c&&c.storedValue;if(c&&c.isAlive&&h){var p=void 0;a?p=!!a.get(n,h):p=t.root.identifierCache.has(i.targetType,jh(n)),p?o=i.addTargetNodeWatcher(t,n):u||i.fireInvalidated("invalidSnapshotReference",t,n,null)}};t.state===io.FINALIZED?s(!0):(t.isRoot||t.root.registerHook(wa.afterCreationFinalization,function(){t.parent&&t.parent.createObservableInstanceIfNeeded()}),t.registerHook(wa.afterAttach,function(){s(!1)}))}}}),r}(Ff),_A=function(e){Jn(r,e);function r(t,n){return e.call(this,t,n)||this}return Object.defineProperty(r.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.isAlive){var n=t.storedValue;return n.resolvedValue}}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=t.storedValue;return n.identifier}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=Ln(i)?Z6(i):i,s=new wA(i,this.targetType),u=nf(this,t,n,a,s);return s.node=u,this.watchTargetNodeForInvalidations(u,o,void 0),u}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){if(!t.isDetaching&&t.type===this){var o=Ln(n),s=t.storedValue;if(!o&&s.identifier===n||o&&s.resolvedValue===n)return t.setParent(a,i),t}var u=this.instantiate(a,i,void 0,n);return t.die(),u}}),r}(F8),SA=function(e){Jn(r,e);function r(t,n,a){var i=e.call(this,t,a)||this;return Object.defineProperty(i,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),i}return Object.defineProperty(r.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.isAlive){var n=this.options.get(t.storedValue,t.parent?t.parent.storedValue:null);return n}}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=Ln(i)?this.options.set(i,t?t.storedValue:null):i,s=nf(this,t,n,a,o);return this.watchTargetNodeForInvalidations(s,o,this.options),s}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=Ln(n)?this.options.set(n,t?t.storedValue:null):n;if(!t.isDetaching&&t.type===this&&t.storedValue===o)return t.setParent(a,i),t;var s=this.instantiate(a,i,void 0,o);return t.die(),s}}),r}(F8);function D8(e,r){var t=r||void 0,n=r?r.onInvalidated:void 0;return t&&(t.get||t.set)?new SA(e,{get:t.get,set:t.set},n):new _A(e,n)}function xA(e){return Sa(e)&&(e.flags&Lr.Reference)>0}function EA(e,r){var t=D8(e,_a(_a({},r),{onInvalidated:function(n){r&&r.onInvalidated&&r.onInvalidated(n),n.removeRef()}}));return r&&r.acceptsUndefined===!1?t:I8(t)}var B8=function(e){Jn(r,e);function r(t,n){var a=e.call(this,t)||this;return Object.defineProperty(a,"validType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Identifier}),a}return Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){if(!t||!(t.type instanceof vp))throw new Qt("Identifier types can only be instantiated as direct child of a model type");return nf(this,t,n,a,i)}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){if(t.storedValue!==n)throw new Qt("Tried to change identifier from '".concat(t.storedValue,"' to '").concat(n,"'. Changing identifiers is not allowed."));return t.setParent(a,i),t}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return typeof t!==this.validType?bs(n,t,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):ys()}}),r}(Ff),PA=function(e){Jn(r,e);function r(){var t=e.call(this,"identifier","string")||this;return Object.defineProperty(t,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Identifier}),t}return Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),r}(B8),OA=function(e){Jn(r,e);function r(){return e.call(this,"identifierNumber","number")||this}return Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),r}(B8),AA=new PA,CA=new OA;function kA(e){return Sa(e)&&(e.flags&Lr.Identifier)>0}function jh(e){return""+e}function Em(e){return typeof e=="string"||typeof e=="number"}function LA(e){return new NA(e)}var NA=function(e){Jn(r,e);function r(t){var n=e.call(this,t.name)||this;return Object.defineProperty(n,"options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Lr.Custom}),n}return Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this.options.isTargetType(t))return ys();var a=this.options.getValidationMessage(t);return a?bs(n,t,"Invalid value for type '".concat(this.name,"': ").concat(a)):ys()}}),Object.defineProperty(r.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.options.toSnapshot(t.storedValue)}}),Object.defineProperty(r.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=this.options.isTargetType(i)?i:this.options.fromSnapshot(i,t&&t.root.environment);return nf(this,t,n,a,o)}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=!this.options.isTargetType(n);if(!t.isDetaching){var s=t.type===this&&(o?n===t.snapshot:n===t.storedValue);if(s)return t.setParent(a,i),t}var u=o?this.options.fromSnapshot(n,a.root.environment):n,c=this.instantiate(a,i,void 0,u);return t.die(),c}}),r}(Ff),Cb={enumeration:nA,model:WO,compose:$O,custom:LA,reference:D8,safeReference:EA,union:a0,optional:Pf,literal:R8,maybe:I8,maybeNull:fA,refinement:tA,string:P8,boolean:A8,number:O8,integer:YO,float:XO,finite:KO,Date:N8,map:qO,array:UO,frozen:mA,identifier:AA,identifierNumber:CA,late:dA,lazy:gA,undefined:k8,null:C8,snapshotProcessor:DO};const TA=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:DP,addMiddleware:l8,applyAction:i8,applyPatch:Ph,applySnapshot:Y6,cast:UP,castFlowReturn:CO,castToReferenceSnapshot:GP,castToSnapshot:HP,clone:IP,createActionTrackingMiddleware:XP,createActionTrackingMiddleware2:ZP,decorate:nO,destroy:FP,detach:jP,escapeJsonPath:Wc,flow:_8,getChildType:yP,getEnv:BP,getIdentifier:Z6,getLivelinessChecking:V6,getMembers:zP,getNodeId:VP,getParent:PP,getParentOfType:AP,getPath:K6,getPathParts:CP,getPropertyMembers:e8,getRelativePath:MP,getRoot:X6,getRunningActionContext:ym,getSnapshot:gm,getType:Cp,hasEnv:qP,hasParent:EP,hasParentOfType:OP,isActionContextChildOf:oO,isActionContextThisOrChildOf:sO,isAlive:vm,isArrayType:HO,isFrozenType:yA,isIdentifierType:kA,isLateType:pA,isLiteralType:JO,isMapType:zO,isModelType:E8,isOptionalType:lA,isPrimitiveType:T8,isProtected:xP,isReferenceType:xA,isRefinementType:rA,isRoot:kP,isStateTreeNode:Ln,isType:Sa,isUnionType:M8,isValidReference:RP,joinJsonPath:I1,onAction:a8,onPatch:$6,onSnapshot:bP,process:mO,protect:_P,recordActions:tO,recordPatches:wP,resolveIdentifier:NP,resolvePath:LP,setLivelinessChecking:G6,setLivelynessChecking:vP,splitJsonPath:Lh,t:Cb,toGenerator:LO,toGeneratorFunction:kO,tryReference:TP,tryResolve:Q6,typecheck:f8,types:Cb,unescapeJsonPath:S8,unprotect:SP,walk:J6},Symbol.toStringTag,{value:"Module"})),hl=Zc(TA);var mg={},kb;function q8(){return kb||(kb=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getLimitedFontSize=function({oldText:r,newText:t,element:n}){if(!(t.length/Math.max(20,r.length)>=4))return n.fontSize;const a=n.width*n.page.computedHeight/t.length,i=1.5*Math.sqrt(a),o=n.fontSize;return Math.min(o,Math.max(5,Math.round(i)))}}(mg)),mg}var Lb;function z8(){return Lb||(Lb=1,function(e){var r=Bd&&Bd.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=e.getLineHeight=e.useFontLoader=void 0,e.isRTLText=R,e.getDir=L,e.usePrevious=I;const t=r(ai()),n=Us,a=Fu,i=Mh,o=vs,s=r(Hs()),u=pP,c=Op(),h=jf(),p=Ih(),v=gc(),f=pm(),_=Ap(),E=If(),w=rf(),x=hl,y=q8();let g;function S(){return g||(g=document.getElementById("polotno-text-style"),g||(g=document.createElement("style"),g.id="polotno-text-style",document.head.appendChild(g)),g)}s.default._fixTextRendering=!0;const b={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal"};function R(O){O=O.replace(/\s/g,"");let C=0;for(var A=0;A<O.length;A++)j=O[A],N="֑-߿יִ-﷽ﹰ-ﻼ",new RegExp("^[^"+N+"]*?["+N+"]").test(j)&&(C+=1);var j,N;return C>O.length/2}function L(O){return R(O)?"rtl":"ltr"}const T=(0,n.observer)(({textNodeRef:O,element:C,onBlur:A,selectAll:j,cursorPosition:N})=>{const[B,W]=t.default.useState(b),Y=O.current;t.default.useLayoutEffect(()=>{const D={};D.width=Y.width()-2*Y.padding()+"px",D.height=Y.height()-2*Y.padding()+Y.fontSize()*Y.lineHeight()+"px",D.fontSize=Y.fontSize()+"px",D.lineHeight=Y.lineHeight()+.01,D.fontFamily=Y.fontFamily(),D.textAlign=Y.align(),D.color=Y.fill(),D.fontWeight=C.fontWeight,D.fontStyle=C.fontStyle,D.letterSpacing=C.letterSpacing+"em",D.opacity=Math.max(C.a.opacity,.2);const $=`
|
|
96
|
-
.polotno-input::placeholder {
|
|
97
|
-
color: ${B.color};
|
|
98
|
-
opacity: 0.6;
|
|
99
|
-
}
|
|
100
|
-
`,Q=S();Q.innerHTML="",Q.appendChild(document.createTextNode($)),JSON.stringify(D)!==JSON.stringify(B)&&W(D)});const Z=t.default.useRef(null);t.default.useLayoutEffect(()=>{var D;const $=Z.current;if(!$)return;(D=Z.current)===null||D===void 0||D.focus();const Q=N||$.value.length;$.selectionStart=$.selectionEnd=Q,j&&($==null||$.select(),document.execCommand("selectAll",!1,null))},[]),t.default.useEffect(()=>{window.addEventListener("blur",A);const D=$=>{var Q;!((Q=Z.current)===null||Q===void 0)&&Q.contains($.target)||A()};return window.addEventListener("touchstart",D),()=>{window.removeEventListener("blur",A),window.removeEventListener("touchstart",D)}},[]);let V=0;const H=Y.textArr.length*Y.lineHeight()*Y.fontSize();C.verticalAlign==="middle"&&(V=(C.a.height-H)/2),C.verticalAlign==="bottom"&&(V=C.a.height-H);const U=(0,f.removeTags)(C.text);return t.default.createElement("textarea",{className:"polotno-input",ref:Z,dir:L(U),style:Object.assign(Object.assign(Object.assign({},b),B),{paddingTop:V+"px"}),value:U,onChange:D=>{const $=(0,y.getLimitedFontSize)({oldText:C.text,newText:D.target.value,element:C});C.set({text:D.target.value,fontSize:$})},placeholder:C.placeholder,onBlur:A})}),F=O=>t.default.createElement(i.Html,null,t.default.createElement(T,Object.assign({},O)));function I(O){const C=t.default.useRef(O),A=t.default.useRef(O);return t.default.useMemo(()=>{A.current=C.current,C.current=O},[O]),A.current}e.useFontLoader=(O,C)=>{const[A,j]=t.default.useReducer(B=>B+1,0),N=t.default.useRef((0,p.isFontLoaded)(C));return t.default.useLayoutEffect(()=>{if(N.current=(0,p.isFontLoaded)(C),N.current)return;let B=!0;return(async()=>{N.current=!1,j();const W=(0,h.incrementLoader)(`text ${C}`);await O.loadFont(C),setTimeout(W,100),B&&(N.current=!0,j())})(),()=>{B=!1}},[C]),[N.current]},e.getLineHeight=({fontLoaded:O,fontFamily:C,fontSize:A,lineHeight:j})=>t.default.useMemo(()=>{if(typeof j=="number")return j;const N=document.createElement("div");N.style.fontFamily=C,N.style.fontSize=A+"px",N.style.lineHeight=j,N.innerText="Test text",document.body.appendChild(N);const B=N.offsetHeight;return document.body.removeChild(N),B/A},[O,C,A,j]),e.TextElement=(0,n.observer)(({element:O,store:C})=>{const A=t.default.useRef(null),j=t.default.useRef(null),{editorEnabled:N,selectAll:B}=(Se=>{const[be,Ae]=t.default.useState(!1),Te=t.default.useRef(!1);return t.default.useEffect(()=>{var he=!0;return setTimeout(()=>{he&&(Se._editModeEnabled&&(Te.current=!0),Ae(!0),setTimeout(()=>{Te.current=!1},50))},50),()=>{he=!1}},[]),{editorEnabled:be&&Se._editModeEnabled,selectAll:Te.current}})(O),[W,Y]=t.default.useState(!1),Z=t.default.useRef(O.a.height),V=C.selectedShapes.indexOf(O)>=0&&O.selectable,{textVerticalResizeEnabled:H}=v.flags,U=I(O.fontFamily),[D,$]=t.default.useState([]);t.default.useEffect(()=>{var Se,be;const Ae=(be=(Se=A.current)===null||Se===void 0?void 0:Se.textArr)!==null&&be!==void 0?be:[];JSON.stringify(Ae)!==JSON.stringify(D)&&$(Ae)}),t.default.useEffect(()=>{if(O.a.width)return;const Se=A.current;Se.width(600),O.set({width:1.4*Se.getTextWidth()})},[]),t.default.useLayoutEffect(()=>(0,o.autorun)(()=>{const Se=A.current;(0,_.applyFilter)(Se,O)}));const[Q]=(0,e.useFontLoader)(C,O.fontFamily),ee=(0,f.removeTags)(O.text),te=()=>{const Se=A.current.clone({height:void 0}),be=Math.ceil(Se.fontSize()*Se.lineHeight()*Se.textArr.length+1);return Se.destroy(),be};t.default.useLayoutEffect(()=>{if(!Q)return;const{textOverflow:Se,textSplitAllowed:be}=v.flags;if(O.a.height){if(!C.isPlaying)if(Se!=="change-font-size"||W){if(Se==="resize"){const Ae=te();H&&O.a.height<Ae&&C.history.ignore(()=>{var Te;(0,x.isAlive)(O)&&O.set({height:Ae}),(Te=A.current)===null||Te===void 0||Te.height(Ae)},!1,!0),H||O.a.height===Ae||W||C.history.ignore(()=>{var Te;(0,x.isAlive)(O)&&O.set({height:Ae}),(Te=A.current)===null||Te===void 0||Te.height(Ae)},!1,!0)}}else{const Ae=function(he,Oe,Me=!1){const ze=he.fontSize(),pt=he.height(),yt=(0,f.removeTags)(Oe.text);let He=Oe.a.fontSize;he.height(void 0);const Qe=Math.round(2*Oe.a.fontSize)-1;for(let Ze=1;Ze<Qe;Ze++){const tt=Oe.a.height&&he.height()>Oe.a.height;let Ht=yt.split(`
|
|
101
|
-
`).join(" ").split(/[\s-]+/).reduce((qt,Ie)=>/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(Ie)?qt.concat(Ie.split("")):qt.concat(Ie),[]),Pt=he.textArr.map(qt=>qt.text).join(";");const It=Ht.find(qt=>!Pt.includes(qt)||(Pt=Pt.replace(qt,""),!1));if(!(tt||It&&!Me))break;He-=.5,he.fontSize(He)}return he.fontSize(ze),he.height(pt),He}(A.current,O,be);if(Ae!==O.a.fontSize)return void C.history.ignore(()=>{O.set({fontSize:Ae})},!1,!0);const Te=te();O.a.height===Te||H||C.history.ignore(()=>{O.set({height:Te})},!1,!0)}}else{const Ae=te();C.history.ignore(()=>{O.set({height:Ae})},!1,!0)}}),t.default.useLayoutEffect(()=>{const Se=A.current;Se&&(Se.width(Se.width()+1e-8),Se._setTextData(),(0,_.applyFilter)(Se,O))},[Q]);const ae=t.default.useRef(null),se=t.default.useRef(0),ce=Se=>{Se.evt.preventDefault(),C.selectedShapes.find(Ae=>Ae===O)&&O.contentEditable&&(se.current=function(Ae){var Te;const he=Ae.target,Oe=function(Qe){var Ze=Qe.getAbsoluteTransform().copy();Ze.invert();var tt=Qe.getStage().getPointerPosition();return Ze.point(tt)}(he),Me=he.textArr,ze=Math.floor(Oe.y/(he.fontSize()*he.lineHeight())),pt=Me.slice(0,ze).reduce((Qe,Ze)=>Qe+Ze.text.length,ze),yt=(Te=Me[ze])!==null&&Te!==void 0?Te:Me[0];let He=0;return he.align()==="right"?He=he.width()-yt.width:he.align()==="center"&&(He=he.width()/2-yt.width/2),pt+Math.round((Oe.x-He)/yt.width*yt.text.length)}(Se),O.toggleEditMode())},me=!ee&&O.placeholder?.6:O.a.opacity;(0,E.useFadeIn)(A,me);const _e=(0,e.getLineHeight)({fontLoaded:Q,fontFamily:O.fontFamily,fontSize:O.a.fontSize,lineHeight:O.lineHeight}),Le=O.selectable||C.role==="admin",Re=(0,c.useColor)(O),Pe=t.default.useMemo(()=>O.backgroundEnabled?function({lines:Se,lineHeight:be,width:Ae,align:Te="left",padding:he=0,cornerRadius:Oe=0}){var Me;Se.forEach((He,Qe)=>{He.cx=Ae/2,Te==="right"?He.cx=Ae-He.width/2:Te==="left"&&(He.cx=He.width/2),Te!=="justify"||He.lastInParagraph||(He.width=Ae),Te==="justify"&&(He.cx=He.width/2)});let ze=`M ${(Me=Se[0])===null||Me===void 0?void 0:Me.cx} ${-he}`;Se.forEach((He,Qe)=>{const{cx:Ze}=He,tt=Se[Qe-1];tt&&tt.width>He.width?ze+=` L ${Ze+He.width/2+he} ${Qe*be+he}`:ze+=` L ${Ze+He.width/2+he} ${Qe*be-he}`;const Ht=Se[Qe+1];Ht&&Ht.width>He.width?ze+=` L ${Ze+He.width/2+he} ${(Qe+1)*be-he}`:ze+=` L ${Ze+He.width/2+he} ${(Qe+1)*be+he}`});for(var pt=Se.length-1;pt>=0;pt--){const He=Se[pt],{cx:Qe}=He,Ze=Se[pt+1];Ze&&Ze.width>He.width?ze+=` L ${Qe-He.width/2-he} ${(pt+1)*be-he}`:ze+=` L ${Qe-He.width/2-he} ${(pt+1)*be+he}`;const tt=Se[pt-1];tt&&tt.width>He.width?ze+=` L ${Qe-He.width/2-he} ${pt*be+he}`:ze+=` L ${Qe-He.width/2-he} ${pt*be-he}`}ze+=" Z";const yt=(0,u.parsePath)(ze);return(0,u.roundCommands)(yt,Oe).path}({lines:JSON.parse(JSON.stringify(D)),cornerRadius:O.backgroundCornerRadius*(O.a.fontSize*_e*.5),lineHeight:_e*O.a.fontSize,padding:O.backgroundPadding*(O.a.fontSize*_e*.5),width:O.a.width,align:O.align}):"",[O.backgroundEnabled,O.backgroundCornerRadius,O.a.fontSize,_e,O.backgroundPadding,O.a.width,O.align,D]),ve=(0,w.isTouchDevice)();let it=0;return O.verticalAlign==="middle"?it=(O.a.height-D.length*_e*O.a.fontSize)/2:O.verticalAlign==="bottom"&&(it=O.a.height-D.length*_e*O.a.fontSize),t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Path,{ref:j,x:O.a.x,y:O.a.y,rotation:O.a.rotation,hideInExport:!O.showInExport,listening:!1,visible:O.backgroundEnabled,opacity:O.backgroundOpacity*me,data:Pe,fill:O.backgroundColor,offsetY:-it}),t.default.createElement(a.Text,Object.assign({ref:A,id:O.id,name:"element",hideInExport:!O.showInExport,editModeEnabled:O._editModeEnabled,x:O.a.x,y:O.a.y,rotation:O.a.rotation,width:O.a.width,height:O.a.height,text:ee||O.placeholder,direction:L(ee)},Re,{stroke:O.stroke,lineJoin:"round",strokeWidth:O.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:O.a.fontSize,fontFamily:`"${O.fontFamily}", "${U}"`,fontStyle:O.fontStyle+" "+O.fontWeight,textDecoration:O.textDecoration,align:O.align,verticalAlign:O.verticalAlign,draggable:ve?O.draggable&&V:O.draggable,preventDefault:!ve||V,opacity:me,visible:!O._editModeEnabled,ellipsis:v.flags.textOverflow==="ellipsis",shadowEnabled:O.shadowEnabled,shadowBlur:O.shadowBlur,shadowOffsetX:O.shadowOffsetX,shadowOffsetY:O.shadowOffsetY,shadowColor:O.shadowColor,shadowOpacity:O.shadowOpacity,lineHeight:_e,letterSpacing:O.letterSpacing*O.a.fontSize,listening:Le,onDragMove:Se=>{O.set({x:Se.target.x(),y:Se.target.y()})},onDragEnd:Se=>{O.set({x:Se.target.x(),y:Se.target.y()})},onClick:ce,onTap:ce,onTransformStart:()=>{Y(!0),Z.current=A.current.height()},onTransform:Se=>{var be,Ae,Te;const he=Se.target;(be=j.current)===null||be===void 0||be.setAttrs({x:he.x(),y:he.y(),rotation:he.rotation(),scale:he.scale()});const Oe=((Ae=he.getStage())===null||Ae===void 0?void 0:Ae.findOne("Transformer")).getActiveAnchor();if(Oe==="middle-left"||Oe==="middle-right"){const ze=he.scaleX(),pt=he.width()*ze,yt=O.a.fontSize;let He=pt;pt<yt&&(He=yt,ae.current&&he.position(ae.current)),he.width(He),he.scaleX(1),he.scaleY(1);const Qe=te();if(v.flags.textOverflow!=="ellipsis"){const tt=Math.max(Qe,Z.current);he.height(tt),O.set({height:he.height()})}const Ze=v.flags.textVerticalResizeEnabled?Math.max(Qe,Z.current):te();O.set({x:he.x(),width:he.width(),rotation:he.rotation(),height:Ze}),(0,_.applyFilter)(he,O)}if(Oe==="top-center"||Oe==="bottom-center"){let ze=v.flags.textOverflow==="resize"?te():_e*O.a.fontSize;Se.target.height(Math.max(ze,Se.target.height()*Se.target.scaleY())),Se.target.scaleY(1)}ae.current=Se.target.position();const Me=Se.target.scaleX();(Te=j.current)===null||Te===void 0||Te.setAttrs({scaleX:1,scaleY:1}),Se.target.scaleX(1),Se.target.scaleY(1),O.set({fontSize:O.a.fontSize*Me,width:Se.target.width()*Me,x:Se.target.x(),y:Se.target.y(),rotation:Se.target.rotation(),height:Se.target.height()*Me,shadowBlur:O.shadowBlur*Me,shadowOffsetX:O.shadowOffsetX*Me,shadowOffsetY:O.shadowOffsetY*Me,strokeWidth:O.strokeWidth*Me})},onTransformEnd:Se=>{var be;const Ae=Se.target.scaleX();Se.target.scaleX(1),Se.target.scaleY(1),O.set({fontSize:Math.round(O.a.fontSize*Ae),width:Math.ceil(Se.target.width()*Ae),x:Se.target.x(),y:Se.target.y(),rotation:Se.target.rotation(),height:Se.target.height()*Ae,shadowBlur:O.shadowBlur*Ae,shadowOffsetX:O.shadowOffsetX*Ae,shadowOffsetY:O.shadowOffsetY*Ae,strokeWidth:O.strokeWidth*Ae}),(be=j.current)===null||be===void 0||be.setAttrs({scaleX:1,scaleY:1}),Y(!1)}})),N&&t.default.createElement(a.Group,{x:O.a.x,y:O.a.y,rotation:O.a.rotation},t.default.createElement(F,{textNodeRef:A,element:O,selectAll:B,cursorPosition:se.current,onBlur:()=>{O.toggleEditMode(!1),O.text===""&&O.removable&&!O.placeholder&&C.deleteElements([O.id])}})))})}(Bd)),Bd}var Fl={},Gd={},yg={exports:{}},bg={exports:{}},Nb;function Pm(){return Nb||(Nb=1,function(e,r){e.exports=t;function t(a){return n.bind(null,a)}function n(a){var i=[].slice.call(arguments,1);i.unshift("["+a+"]"),process.stderr.write(i.join(" ")+`
|
|
102
|
-
`)}}(bg)),bg.exports}var Tb;function U8(){return Tb||(Tb=1,function(e,r){Pm()("lex"),e.exports=t;function t(n){var a="",i,o=0,s=-1,u=0,c=1,h="before-selector",p=[h],v={},f=[],_=["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 E(){return T(),n[s]}function w(W){return W?p[p.length-1-W]:h}function x(W){var Y=s+1;return W===n.slice(Y,Y+W.length)}function y(W){var Y=n.slice(s).indexOf(W);return Y>0?Y:!1}function g(W){return W===S(1)}function S(W){return n[s+(W||1)]}function b(){var W=p.pop();return h=p[p.length-1],W}function R(W){return h=W,p.push(h),p.length}function L(W){var Y=h;return p[p.length-1]=h=W,Y}function T(W){if((W||1)==1)n[s]==`
|
|
103
|
-
`?(c++,o=1):o++,s++;else{var Y=n.slice(s,s+W).split(`
|
|
104
|
-
`);Y.length>1&&(c+=Y.length-1,o=1),o+=Y[Y.length-1].length,s=s+W}}function F(){v.end={line:c,col:o},f.push(v),a="",v={}}function I(W){v={type:W,start:{line:c,col:o}}}for(;i=E();)switch(i){case" ":switch(w()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":a+=i;break}break;case`
|
|
105
|
-
`:case" ":case"\r":case"\f":switch(w()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":a+=i;break;case"at-value":i===`
|
|
106
|
-
`&&(v.value=a.trim(),F(),b());break}break;case":":switch(w()){case"name":v.name=a.trim(),a="",L("before-value");break;case"before-selector":a+=i,I("selector"),R("selector");break;case"before-value":L("value"),a+=i;break;default:a+=i;break}break;case";":switch(w()){case"name":case"before-value":case"value":a.trim().length>0&&(v.value=a.trim(),F()),L("before-name");break;case"value-paren":a+=i;break;case"at-value":v.value=a.trim(),F(),b();break;case"before-name":break;default:a+=i;break}break;case"{":switch(w()){case"selector":if(S(-1)==="\\"){a+=i;break}v.text=a.trim(),F(),L("before-name"),u=u+1;break;case"at-group":switch(v.name=a.trim(),v.type){case"font-face":case"viewport":case"page":R("before-name");break;default:R("before-selector")}F(),u=u+1;break;case"name":case"at-rule":v.name=a.trim(),F(),R("before-name"),u=u+1;break;case"comment":case"double-string":case"single-string":a+=i;break;case"before-value":L("value"),a+=i;break}break;case"}":switch(w()){case"before-name":case"name":case"before-value":case"value":a&&(v.value=a.trim()),v.name&&v.value&&F(),I("end"),F(),b(),w()==="at-group"&&(I("at-group-end"),F(),b()),u>0&&(u=u-1);break;case"at-group":case"before-selector":case"selector":if(S(-1)==="\\"){a+=i;break}u>0&&w(1)==="at-group"&&(I("at-group-end"),F()),u>1&&b(),u>0&&(u=u-1);break;case"double-string":case"single-string":case"comment":a+=i;break}break;case'"':case"'":switch(w()){case"double-string":i==='"'&&S(-1)!=="\\"&&b();break;case"single-string":i==="'"&&S(-1)!=="\\"&&b();break;case"before-at-value":L("at-value"),R(i==='"'?"double-string":"single-string");break;case"before-value":L("value"),R(i==='"'?"double-string":"single-string");break;case"comment":break;default:S(-1)!=="\\"&&R(i==='"'?"double-string":"single-string")}a+=i;break;case"/":switch(w()){case"comment":case"double-string":case"single-string":a+=i;break;case"before-value":case"selector":case"name":case"value":if(g("*")){var O=y("*/");O&&T(O+1)}else w()=="before-value"&&L("value"),a+=i;break;default:g("*")?(I("comment"),R("comment"),T()):a+=i;break}break;case"*":switch(w()){case"comment":g("/")?(v.text=a,T(),F(),b()):a+=i;break;case"before-selector":a+=i,I("selector"),R("selector");break;case"before-value":L("value"),a+=i;break;default:a+=i}break;case"@":switch(w()){case"comment":case"double-string":case"single-string":a+=i;break;case"before-value":L("value"),a+=i;break;default:for(var C=!1,A,j,N=0,B=_.length;!C&&N<B;++N)j=_[N],A=j.name||j,x(A)&&(C=!0,I(A),R(j.state||"at-group"),T(A.length),j.prefix&&(v.prefix=j.prefix),j.type&&(v.type=j.type));C||(a+=i);break}break;case"(":switch(w()){case"value":R("value-paren");break;case"before-value":L("value");break}a+=i;break;case")":switch(w()){case"value-paren":b();break;case"before-value":L("value");break}a+=i;break;default:switch(w()){case"before-selector":I("selector"),R("selector");break;case"before-name":I("property"),L("name");break;case"before-value":L("value");break;case"before-at-value":L("at-value");break}a+=i;break}return f}}(yg)),yg.exports}var wg={exports:{}},Rb;function RA(){return Rb||(Rb=1,function(e,r){Pm()("parse");var t=U8();e.exports=s;var n,a,i,o;function s(b,R){R||(R={}),n=!!R.comments,i=!!R.position,a=0,o=Array.isArray(b)?b.slice():t(b);for(var L,T=[],F;F=c();)L=x(F),L&&T.push(L);return{type:"stylesheet",stylesheet:{rules:T}}}function u(b,R){R||(R={});for(var L,T=["type","name","value"],F={},I=0;I<T.length;++I)L=T[I],b[L]&&(F[L]=R[L]||b[L]);for(T=Object.keys(R),I=0;I<T.length;++I)L=T[I],F[L]||(F[L]=R[L]);return i&&(F.position={start:b.start,end:b.end}),F}function c(){var b=o.shift();return b}function h(b){a=a+1;var R={};switch(b.type){case"font-face":case"viewport":R.declarations=g();break;case"page":R.prefix=b.prefix,R.declarations=g();break;default:R.prefix=b.prefix,R.rules=S()}return u(b,R)}function p(b){return u(b)}function v(b){return u(b)}function f(b){return u(b,{text:b.text})}function _(b){return u(b)}function E(b){return u(b)}function w(b){function R(L){return L.trim()}return u(b,{type:"rule",selectors:b.text.split(",").map(R),declarations:g()})}function x(b){switch(b.type){case"property":return E(b);case"selector":return w(b);case"at-group-end":a=a-1;return;case"media":case"keyframes":return h(b);case"comment":if(n)return f(b);break;case"charset":return v(b);case"import":return p(b);case"namespace":return _(b);case"font-face":case"supports":case"viewport":case"document":case"page":return h(b)}}function y(b){for(var R,L=[],T;(T=c())&&b&&b(T);)R=x(T),R&&L.push(R);return T&&T.type!=="end"&&o.unshift(T),L}function g(){return y(function(b){return b.type==="property"||b.type==="comment"})}function S(){return y(function(){return a})}}(wg)),wg.exports}var _g={exports:{}},Mb;function MA(){return Mb||(Mb=1,function(e,r){Pm()("stringify");var t,n,a,i,o,s;e.exports=u;function u(S,b){b||(b={}),a=b.indentation||"",n=!!b.compress,t=!!b.comments,i=1,n?o=s="":(o=`
|
|
107
|
-
`,s=" ");var R=_(S.stylesheet.rules,y).join(`
|
|
108
|
-
`).trim();return R}function c(S){if(S){i+=S;return}return n?"":Array(i).join(a||"")}function h(S){return"@"+S.type+" "+S.value+";"+o}function p(S){var b="",R=S.prefix||"";S.name&&(b=" "+S.name);var L=S.type!=="page";return"@"+R+S.type+b+s+E(S,L)+o}function v(S){return t?"/*"+(S.text||"")+"*/"+o:""}function f(S){var b;return S.selectors?b=S.selectors.join(","+o):(b="@"+S.type,b+=S.name?" "+S.name:""),c()+b+s+E(S)+o}function _(S,b){return S.reduce(function(R,L){var T=L.type==="comment"?v(L):b(L);return T&&R.push(T),R},[])}function E(S,b){var R=S.declarations,L=x;return S.rules&&(R=S.rules,L=f),R=w(R,L),R&&(R=o+R+(b?"":o)),"{"+R+c()+"}"}function w(S,b){if(!S)return"";c(1);var R=_(S,b);return c(-1),R.length?R.join(o):""}function x(S){if(S.type==="property")return g(S)}function y(S){switch(S.type){case"rule":return f(S);case"media":case"keyframes":return p(S);case"comment":return v(S);case"import":case"charset":case"namespace":return h(S);case"font-face":case"supports":case"viewport":case"document":case"page":return p(S)}}function g(S){var b=S.name?S.name+":"+s:"";return c()+b+S.value+";"}}(_g)),_g.exports}var Sg,Ib;function IA(){return Ib||(Ib=1,Sg={lex:U8(),parse:RA(),stringify:MA()}),Sg}var jb;function kp(){return jb||(jb=1,function(e){var r=Gd&&Gd.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.useSvgColors=e.sameColors=void 0,e.urlToBase64=async function(_){const E=await fetch(_);return f(await E.text())},e.urlToString=p,e.getColors=v,e.svgToURL=f,e.getSvgSize=async function(_){const E=await p(_),w=new DOMParser().parseFromString(E,"image/svg+xml").documentElement.getAttribute("viewBox"),[x,y,g,S]=(w==null?void 0:w.split(" "))||[];return{width:parseFloat(g),height:parseFloat(S)}},e.fixSize=function(_){var E=new DOMParser().parseFromString(_,"image/svg+xml");const w=E.documentElement.getAttribute("viewBox"),[x,y,g,S]=(w==null?void 0:w.split(" "))||[],b=E.documentElement.getAttribute("width");b||E.documentElement.setAttribute("width",g+"px");const R=E.documentElement.getAttribute("height");if((!R||R.indexOf("%")>=0)&&E.documentElement.setAttribute("height",S+"px"),b&&b.indexOf("%")>=0&&R&&R.indexOf("%")===-1){const L=parseFloat(R)/parseFloat(S);E.documentElement.setAttribute("width",L*parseFloat(g)+"px")}if(R&&R.indexOf("%")>=0&&b&&b.indexOf("%")===-1){const L=parseFloat(b)/parseFloat(g);E.documentElement.setAttribute("height",L*parseFloat(S)+"px")}return b==="100%"&&R==="100%"&&(E.documentElement.setAttribute("width",g+"px"),E.documentElement.setAttribute("height",S+"px")),new XMLSerializer().serializeToString(E)},e.replaceColors=function(_,E){var w=new DOMParser().parseFromString(_,"image/svg+xml");const x=h(w),y=Array.from(E.keys()),g=s(w);return x.forEach(S=>{const{fill:b,stroke:R}=u(S,g);[{prop:"fill",color:b},{prop:"stroke",color:R}].forEach(({prop:L,color:T})=>{const F=y.find(I=>(0,e.sameColors)(I,T));if(F){const I=E.get(F);if((0,a.isGradient)(I)){const{rotation:O,stops:C}=(0,a.parseColor)(I),A=C.map(N=>({offset:100*N.offset+"%","stop-color":N.color})),j="color"+Math.round(1e8*Math.random());(function(N,B,W,Y){var Z=N.namespaceURI,V=document.createElementNS(Z,"linearGradient");const H=t.default.Util.degToRad(W+90),U=(Math.cos(H)+1)/2,D=(Math.sin(H)+1)/2,$=(Math.cos(H+Math.PI)+1)/2,Q=(Math.sin(H+Math.PI)+1)/2;V.setAttribute("x1",100*U+"%"),V.setAttribute("y1",100*D+"%"),V.setAttribute("x2",100*$+"%"),V.setAttribute("y2",100*Q+"%"),V.setAttribute("gradientUnits","userSpaceOnUse"),V.setAttribute("id",B);for(var ee=0;ee<Y.length;ee++){var te=Y[ee],ae=document.createElementNS(Z,"stop");for(var se in te)te.hasOwnProperty(se)&&ae.setAttribute(se,te[se]);V.appendChild(ae)}(N.querySelector("defs")||N.insertBefore(document.createElementNS(Z,"defs"),N.firstChild)).appendChild(V)})(w.children[0],j,O,A),S.style[L]=null,S.setAttribute(L,`url('#${j}')`)}else S.style[L]=E.get(F)}})}),f(new XMLSerializer().serializeToString(w))};const t=r(Hs()),n=r(ai()),a=dm(),i=r(IA());function o(_){for(;_.parentNode;){if(_.nodeName==="defs")return!0;_=_.parentNode}return!1}function s(_){const E={};return _.querySelectorAll("style").forEach(w=>{const x=i.default.parse(w.textContent).stylesheet.rules;for(let y of x)y.selectors&&y.selectors.forEach(g=>{const S=E[g]||{};y.declarations.forEach(b=>{S[b.name]=b.value}),E[g]=S})}),E}function u(_,E){var w;const x={fill:"",stroke:""},y=((w=_.getAttribute("class"))===null||w===void 0?void 0:w.split(" "))||[],g=_.getAttribute("id");let S={};if(g&&E[`#${g}`]?S=E[`#${g}`]:y.forEach(b=>{E[`.${b}`]&&(S=Object.assign(Object.assign({},S),E[`.${b}`]))}),E[_.nodeName]&&(S=Object.assign(Object.assign({},S),E[_.nodeName])),_.getAttribute("fill")&&_.getAttribute("fill")!=="none"?x.fill=_.getAttribute("fill"):S.fill&&S.fill!=="none"&&(x.fill=S.fill),_.getAttribute("stroke")&&_.getAttribute("stroke")!=="none"?x.stroke=_.getAttribute("stroke"):S.stroke&&S.stroke!=="none"&&(x.stroke=S.stroke),!x.fill&&_.style.fill&&_.style.fill!=="none"&&(x.fill=_.style.fill),!x.stroke&&_.style.stroke&&_.style.stroke!=="none"&&(x.stroke=_.style.stroke),!x.stroke&&!x.fill){const b=_.ownerSVGElement,R=b&&b!==_&&u(b,E);(R==null?void 0:R.fill)==="currentColor"||(R==null?void 0:R.stroke)==="currentColor"||(x.fill="black")}return x}const c=["path","rect","circle","line","polygon","polyline","ellipse","text"];function h(_){for(var E=[],w=_.getElementsByTagName("*"),x=0,y=w.length;x<y;x++){const g=w[x];o(g)||(g.getAttribute("fill")!==null&&E.push(g),(g.getAttribute("stroke")!==null||g.style&&g.style.fill||c.indexOf(g.nodeName)>=0)&&E.push(g))}return E}async function p(_){return await(await fetch(_,{mode:"cors"})).text()}function v(_){var E=new DOMParser().parseFromString(_,"image/svg+xml");const w=s(E),x=h(E),y=[];return x.forEach(g=>{const{fill:S,stroke:b}=u(g,w);[S,b].forEach(R=>{R&&(R==="currentColor"&&(R="black"),t.default.Util.colorToRGBA(R)&&y.indexOf(R)===-1&&y.push(R))})}),y}function f(_){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(_)))}e.sameColors=(_,E)=>{if(!_||!E)return!1;if(E==="currentColor"&&_==="black")return!0;const w=t.default.Util.colorToRGBA(_),x=t.default.Util.colorToRGBA(E);return w&&x?w.r===x.r&&w.g===x.g&&w.b===x.b&&w.a===x.a:void 0},e.useSvgColors=_=>{const[E,w]=n.default.useState([]);return n.default.useEffect(()=>{let x=!1;return(async()=>{w([]);const y=v(await p(_));x||w(y)})(),()=>{x=!0}},[_]),E}}(Gd)),Gd}var xg={},Fb;function H8(){return Fb||(Fb=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.trySetCanvasSize=void 0,e.trySetCanvasSize=(r,t,n)=>{let a=t,i=n,o=1;for(;a>0&&i>0;){r.width=a,r.height=i;const s=r.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,r.width,r.height);if(o*=.9,a=Math.floor(t*o),i=Math.floor(n*o),a=Math.max(a,1),i=Math.max(i,1),a<=1&&i<=1)return r.width=1,void(r.height=1)}}}(xg)),xg}var Vd={},Db;function G8(){return Db||(Db=1,function(e){var r=Vd&&Vd.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e,"__esModule",{value:!0}),e.useDelayer=void 0;const t=r(ai());e.useDelayer=(n,a=100,i=!1,o)=>{const s=t.default.useRef(o??n),[,u]=t.default.useReducer(p=>p+1,0),c=t.default.useCallback(p=>{s.current!==p&&(s.current=p,u())},[s]),h=t.default.useRef(null);return n===i&&(h.current&&(clearTimeout(h.current),h.current=null),s.current=i),t.default.useEffect(()=>(h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{c(n),h.current=null},a),()=>{h.current&&clearTimeout(h.current)}),[n,a,i]),[s.current,c]}}(Vd)),Vd}var Bb;function Om(){return Bb||(Bb=1,function(e){var r,t=Fl&&Fl.__createBinding||(Object.create?function(N,B,W,Y){Y===void 0&&(Y=W);var Z=Object.getOwnPropertyDescriptor(B,W);Z&&!("get"in Z?!B.__esModule:Z.writable||Z.configurable)||(Z={enumerable:!0,get:function(){return B[W]}}),Object.defineProperty(N,Y,Z)}:function(N,B,W,Y){Y===void 0&&(Y=W),N[Y]=B[W]}),n=Fl&&Fl.__setModuleDefault||(Object.create?function(N,B){Object.defineProperty(N,"default",{enumerable:!0,value:B})}:function(N,B){N.default=B}),a=Fl&&Fl.__importStar||(r=function(N){return r=Object.getOwnPropertyNames||function(B){var W=[];for(var Y in B)Object.prototype.hasOwnProperty.call(B,Y)&&(W[W.length]=Y);return W},r(N)},function(N){if(N&&N.__esModule)return N;var B={};if(N!=null)for(var W=r(N),Y=0;Y<W.length;Y++)W[Y]!=="default"&&t(B,N,W[Y]);return n(B,N),B}),i=Fl&&Fl.__importDefault||function(N){return N&&N.__esModule?N:{default:N}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=e.useImageLoader=e.setImageLoaderHook=e.useCornerRadiusAndCrop=e.setOuterImageCropTransformerStyle=e.setInnerImageCropTransformerStyle=e.useSizeFixer=void 0;const o=i(ai()),s=Us,u=vs,c=Fu,h=i(r0()),p=i(Hs()),v=Mh,f=jf(),_=a(kp()),E=gc(),w=H8(),x=Ap(),y=If(),g=rf(),S=G8();function b(){return document.createElement("canvas")}const R=N=>N.indexOf("data:image/svg+xml")>=0||N.indexOf(".svg")>=0;function L(N,B){return{x:(N.x+B.x)/2,y:(N.y+B.y)/2}}e.useSizeFixer=N=>{const[B,W]=o.default.useState(N);return o.default.useEffect(()=>{(async()=>{const Y=await async function(Z){if(!R(Z))return Z;const V=await _.urlToString(Z),H=_.fixSize(V);return _.svgToURL(H)}(N);Y!==B&&W(Y)})()},[N]),B};const T={boundBoxFunc:(N,B)=>B.width<5||B.height<5?N:B,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2};e.setInnerImageCropTransformerStyle=N=>{Object.assign(T,N)};const F={boundBoxFunc:(N,B)=>B.width<5||B.height<5?N:B,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2};e.setOuterImageCropTransformerStyle=N=>{Object.assign(F,N)};const I=(N,B,W)=>Math.max(B,Math.min(W,N));e.useCornerRadiusAndCrop=(N,B,W,Y,Z=0,V=!1,H=!0)=>{const U=Math.floor(I(N.a.width*Y,1,1e4)),D=Math.floor(I(N.a.height*Y,1,1e4)),$=Math.min(Z*Y,U/2,D/2),Q=Math.max(N.a.width/W.width,N.a.height/W.height)*Y,ee=N.page._exportingOrRendering&&E.flags.imageDownScalingEnabled&&Q<1&&!V,te=W.x===0&&W.y===0&&W.width===(B==null?void 0:B.width)&&W.height===(B==null?void 0:B.height),ae=o.default.useMemo(()=>{if(B&&B.width&&B.height)return te&&$===0&&!ee?void 0:b()},[B,$,ee,te]);return o.default.useLayoutEffect(()=>{if(!ae||!B)return;(0,w.trySetCanvasSize)(ae,U,D);const se=ae.getContext("2d");if(!se)return;$&&(se.beginPath(),se.moveTo($,0),se.lineTo(U-$,0),se.arc(U-$,$,$,3*Math.PI/2,0,!1),se.lineTo(U,D-$),se.arc(U-$,D-$,$,0,Math.PI/2,!1),se.lineTo($,D),se.arc($,D-$,$,Math.PI/2,Math.PI,!1),se.lineTo(0,$),se.arc($,$,$,Math.PI,3*Math.PI/2,!1),se.clip());const ce=ee?function(_e,Le){var Re,Pe;const ve=b();ve.width=_e.width,ve.height=_e.height;const it=Math.max(1,Math.floor(ve.width*Le)),Se=Math.max(1,Math.floor(ve.height*Le));(Re=ve.getContext("2d"))===null||Re===void 0||Re.drawImage(_e,0,0,ve.width,ve.height);const be=function(Ae,Te,he,Oe,Me,ze,pt){for(var yt=new ImageData(Te,he),He=new Int32Array(Ae.data.buffer),Qe=Ae.width,Ze=new Int32Array(yt.data.buffer),tt=yt.width,Ht=Te/ze,Pt=he/pt,It=Math.round(1/Ht),qt=Math.round(1/Pt),Ie=It*qt,ke=0;ke<yt.height;ke++)for(var ut=0;ut<tt;ut++){for(var Nt=0+Math.round(ut/Ht)+(0+Math.round(ke/Pt))*Qe,Ct=0,St=0,Jt=0,nr=0,Tt=0;Tt<qt;Tt++)for(var Xt=0;Xt<It;Xt++){var Rr=He[Nt+Xt+Tt*Qe];Ct+=Rr<<24>>>24,St+=Rr<<16>>>24,Jt+=Rr<<8>>>24,nr+=Rr>>>24}Ct=Math.round(Ct/Ie),St=Math.round(St/Ie),Jt=Math.round(Jt/Ie),nr=Math.round(nr/Ie),Ze[ut+ke*tt]=nr<<24|Jt<<16|St<<8|Ct}return yt}(ve.getContext("2d").getImageData(0,0,ve.width,ve.height),it,Se,0,0,ve.width,ve.height);return ve.width=it,ve.height=Se,(Pe=ve.getContext("2d"))===null||Pe===void 0||Pe.putImageData(be,0,0),ve}(B,Q):B,me=ee?{x:Math.floor(W.x*Q),y:Math.floor(W.y*Q),width:Math.floor(W.width*Q),height:Math.floor(W.height*Q)}:W;se.drawImage(ce,me.x,me.y,me.width,me.height,0,0,ae.width,ae.height)},[ae,N.a.width,N.a.height,W.x,W.y,W.width,W.height,Z,Y,V,N.page._exportingOrRendering,ee]),o.default.useEffect(()=>()=>{ae&&ae.nodeName==="CANVAS"&&p.default.Util.releaseCanvas(ae)},[ae]),ae||B};const O=b(),C=(0,s.observer)(({element:N})=>{const B=Math.min(30,N.a.width/4,N.a.height/4),W=o.default.useRef(null);return o.default.useEffect(()=>{const Y=W.current;if(!Y)return;const Z=new p.default.Animation(V=>{Y.rotate(((V==null?void 0:V.timeDiff)||0)/2)},Y.getLayer());return Z.start(),()=>{Z.stop()}}),o.default.createElement(c.Group,{x:N.x,y:N.y,rotation:N.rotation,listening:!1,opacity:N.a.opacity,hideInExport:!N.showInExport},o.default.createElement(c.Rect,{width:N.a.width,height:N.a.height,fill:"rgba(124, 173, 212, 0.8)"}),o.default.createElement(c.Arc,{ref:W,x:N.a.width/2,y:N.a.height/2,fill:"white",outerRadius:Math.abs(B),innerRadius:Math.max(1,B-5),angle:270}))}),A=(0,s.observer)(({element:N})=>{const B=Math.max(10,Math.min(30,N.a.width/25));return o.default.createElement(c.Group,{x:N.x,y:N.y,rotation:N.rotation,listening:!1,opacity:N.a.opacity,hideInExport:!N.showInExport},o.default.createElement(c.Rect,{width:N.a.width,height:N.a.height,fill:"rgba(223, 102, 102, 0.8)"}),o.default.createElement(c.Text,{text:"Can not load the image...",fontSize:B,width:N.a.width,height:N.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let j=h.default;e.setImageLoaderHook=N=>{j=N},e.useImageLoader=(N,B="",W="")=>{const Y=o.default.useRef(),Z=()=>{var V;(V=Y.current)===null||V===void 0||V.call(Y),Y.current=void 0};o.default.useEffect(()=>Z,[]),o.default.useLayoutEffect(()=>{const V=B.slice(0,200),H=`image with id ${W} url: ${V}`;N!=="loading"||Y.current||(Y.current=(0,f.incrementLoader)(H)),N!=="loading"&&Z(),N==="failed"&&(0,f.triggerLoadError)(H)},[N])},e.ImageElement=(0,s.observer)(({element:N,store:B})=>{var W;const[Y,Z]=o.default.useState(!1),V=o.default.useRef(null),H=o.default.useRef(null),U=B.selectedShapes.indexOf(N)>=0&&N.selectable,[D,$]=(Je=>{const[mt,Gt]=o.default.useReducer(_t=>_t+1,0),bt=o.default.useRef("loading"),Kt=o.default.useRef(Je.src),Yt=o.default.useRef(Je.src);Yt.current!==Je.src&&(Yt.current=Je.src,bt.current="loading");const ct=o.default.useMemo(()=>R(Je.src)||Je.type==="svg",[Je.src,Je.type]);return o.default.useEffect(()=>{if(!ct||!Je.src)return;let _t=!1;return(async()=>{bt.current="loading",Gt();const xt=await _.urlToString(Je.src),rt=_.fixSize(xt);let zt;zt=Je.colorsReplace?_.replaceColors(rt,Je.colorsReplace||new Map):_.svgToURL(rt),_t||(Kt.current=zt,bt.current="loaded",Gt())})(),()=>{_t=!0}},[Je.src,JSON.stringify(Je.colorsReplace)]),ct?[Kt.current,bt.current]:[Je.src,"loaded"]})(N),[Q,ee]=j(D,"anonymous"),te=N.type!=="svg"||$==="loaded"?ee:"loading";(0,e.useImageLoader)(te,N.src,N.id);const ae=N.page._exportingOrRendering?1:Math.max(1,B.scale),se=B._elementsPixelRatio*ae,ce=(({image:Je,status:mt,type:Gt})=>{const bt=o.default.useRef();return o.default.useEffect(()=>{bt.current=Je||bt.current},[Je]),mt!=="failed"||mt!=="failed"&&Gt==="svg"?bt.current:void 0})({image:Q,status:ee,type:N.type}),me=((Je,mt,Gt)=>{const bt=o.default.useMemo(()=>{var Kt,Yt;const{flipX:ct,flipY:_t}=Je,xt=Je.type==="svg"||Je.src.indexOf("data:image/svg+xml")>=0||Je.src.indexOf(".svg")>=0,rt=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,zt=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||rt)&&xt||Je.maskSrc;if(!ct&&!_t&&!zt)return mt;if(!mt||!mt.width||!mt.height)return null;const gt=b();let Ft=1;Je.type==="svg"&&(Ft=Math.max(Je.a.width/mt.width*Gt,Je.a.height/mt.height*Gt)),(0,w.trySetCanvasSize)(gt,Math.max(mt.width*Ft,1),Math.max(mt.height*Ft,1));let br=ct?-gt.width:0,hr=_t?-gt.height:0;return(Kt=gt.getContext("2d"))===null||Kt===void 0||Kt.scale(ct?-1:1,_t?-1:1),(Yt=gt.getContext("2d"))===null||Yt===void 0||Yt.drawImage(mt,br,hr,gt.width,gt.height),gt},[Je.maskSrc,Je.flipX,Je.flipY,mt,Je.a.width,Je.a.height,Gt]);return o.default.useEffect(()=>()=>{bt&&bt.nodeName==="CANVAS"&&p.default.Util.releaseCanvas(bt)},[bt]),bt})(N,Q||ce,se),_e=((Je,mt)=>{const Gt=(0,e.useSizeFixer)(Je.maskSrc||""),[bt,Kt]=j(Gt,"anonymous"),Yt=Gt?Kt:"loaded";return(0,e.useImageLoader)(Yt,Gt||"",Je.id),o.default.useMemo(()=>{if(!bt||!mt||!mt.width||!mt.height)return mt;const ct=b();ct.width=Math.max(mt.width,1),ct.height=Math.max(mt.height,1);const _t=ct.getContext("2d");if(!_t)return mt;_t.drawImage(mt,0,0),_t.globalCompositeOperation="source-in";const xt=function(rt,zt){const gt=zt.width/zt.height;let Ft,br;return gt>=rt.width/rt.height?(Ft=rt.width,br=rt.width/gt):(Ft=rt.height*gt,br=rt.height),{x:(rt.width-Ft)/2,y:(rt.height-br)/2,width:Ft,height:br}}(bt,Je);return _t.drawImage(bt,xt.x,xt.y,xt.width,xt.height,0,0,mt.width,mt.height),ct},[mt,bt,Je.a.width,Je.a.height])})(N,me)||O;let{cropX:Le,cropY:Re,cropWidth:Pe,cropHeight:ve}=N.a;ee!=="loaded"&&(Le=Re=0,Pe=ve=1);const it=_e.width*Pe,Se=_e.height*ve,be=N.a.width/N.a.height;let Ae,Te;const he=it/Se,Oe=N.stretchEnabled;Oe?(Ae=it,Te=Se):be>=he?(Ae=it,Te=it/be):(Ae=Se*be,Te=Se);const Me={x:_e.width*Le,y:_e.height*Re,width:Ae,height:Te},ze=(W=N.cornerRadius)!==null&&W!==void 0?W:0,pt=N.page._exportingOrRendering?1:Math.min(2,B.scale),yt=B._elementsPixelRatio*pt;let He=((Je,mt,Gt,bt)=>{const Kt=(0,e.useSizeFixer)(Je.clipSrc||""),[Yt,ct]=j(Kt,"anonymous"),_t=Je.clipSrc?ct:"loaded";(0,e.useImageLoader)(_t,Je.clipSrc,Je.id);const xt=o.default.useMemo(()=>{if(mt&&Yt)return b()},[mt,Yt]);return o.default.useLayoutEffect(()=>{var rt;if(!Yt||!mt||!mt.width||!mt.height||!Yt||!Yt.width||!Yt.height||!xt)return;const zt=b(),gt=Math.max(Je.a.width/Yt.width*Gt,Je.a.height/Yt.height*Gt);zt.width=Math.max(Yt.width*gt,1),zt.height=Math.max(Yt.height*gt,1),(rt=zt.getContext("2d"))===null||rt===void 0||rt.drawImage(Yt,0,0,zt.width,zt.height),xt.width=Math.max(mt.width,1),xt.height=Math.max(mt.height,1);const Ft=xt.getContext("2d");Ft&&(Ft.save(),Ft.drawImage(zt,0,0,mt.width,mt.height),p.default.Util.releaseCanvas(zt),Ft.globalCompositeOperation="source-in",Ft.drawImage(mt,0,0,xt.width,xt.height),Ft.restore())},[xt,mt,Yt,Je.a.width,Je.a.height,Gt,...bt]),Je.clipSrc&&Yt?xt:mt})(N,(0,e.useCornerRadiusAndCrop)(N,_e,Me,yt,ze,Y||N._cropModeEnabled||N.type==="svg",!0),yt,[Me,ze,yt]);const Qe=Math.max(N.a.width/Ae,N.a.height/Te);o.default.useEffect(()=>{var Je;if(!N._cropModeEnabled)return;const mt=(Je=V.current)===null||Je===void 0?void 0:Je.getStage();function Gt(Kt){N._cropModeEnabled&&Kt.target!==H.current&&N.toggleCropMode(!1)}function bt(Kt){N._cropModeEnabled&&Kt.target.parentNode!==mt.content&&N.toggleCropMode(!1)}return document.body.addEventListener("click",bt),mt==null||mt.on("click",Gt),mt==null||mt.on("tap",Gt),()=>{document.body.removeEventListener("click",bt),document.body.removeEventListener("touchstart",bt),mt==null||mt.off("click",Gt),mt==null||mt.off("click",Gt)}},[N._cropModeEnabled]),o.default.useLayoutEffect(()=>{if(!Y&&!N._cropModeEnabled)return(0,x.applyFilter)(V.current,N),(0,u.autorun)(()=>{(0,x.applyFilter)(V.current,N)},{delay:100})},[He,N.page._exportingOrRendering,Y,Pe,ve,N._cropModeEnabled]),o.default.useLayoutEffect(()=>{var Je;Y||N._cropModeEnabled?(Je=V.current)===null||Je===void 0||Je.clearCache():(0,x.applyFilter)(V.current,N)},[Y,N.a.width,N.a.height,N._cropModeEnabled]),o.default.useEffect(()=>{(0,x.applyFilter)(V.current,N)},[N.shadowEnabled,N.shadowBlur,N.cornerRadius,N.shadowColor,N.shadowOffsetX,N.shadowOffsetY,N.shadowOpacity]);const Ze=o.default.useRef(null),tt=o.default.useRef(null),Ht=o.default.useRef(null);o.default.useLayoutEffect(()=>{N._cropModeEnabled&&(tt.current.nodes([Ze.current]),Ht.current.nodes([H.current]))},[N._cropModeEnabled]);var Pt=o.default.useRef(null),It=o.default.useRef(0),qt=o.default.useRef(!1);const Ie=Je=>{var mt;((mt=Je.evt.touches)===null||mt===void 0?void 0:mt.length)>2&&Je.target.stopDrag(),Math.round(Je.target.x())>0&&(Je.target.x(0),Je.target.scaleX(1)),Math.round(Je.target.y())>0&&(Je.target.y(0),Je.target.scaleY(1));const Gt=Je.target.width()*Je.target.scaleX(),bt=Je.target.height()*Je.target.scaleY(),Kt=Math.min(1,Ae/Gt),Yt=Math.min(1,Te/bt),ct=1-Kt,_t=Math.min(ct,Math.max(0,Math.round(-Je.target.x())/Gt)),xt=1-Yt,rt=Math.min(xt,Math.max(0,Math.round(-Je.target.y())/bt));Je.target.setAttrs({x:-_t*_e.width,y:-rt*_e.height,scaleX:1,scaleY:1}),N.set({cropX:_t,cropY:rt,cropWidth:Kt,cropHeight:Yt})},ke=()=>{N.type!=="svg"&&N.contentEditable&&(N.stretchEnabled||setTimeout(()=>{N.toggleCropMode(!0)}))},ut=N.type==="svg"&&ce,Nt=ee==="loading"&&!ut,[Ct]=(0,S.useDelayer)(Nt,100,!1,!1),St=ee==="failed",Jt=!Ct&&!St,nr=o.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Tt=Jt?N.a.opacity:0;(0,y.useFadeIn)(V,Tt);const Xt=N.selectable||B.role==="admin",Rr=(0,g.isTouchDevice)();return o.default.createElement(o.default.Fragment,null,Ct&&o.default.createElement(C,{element:N}),St&&o.default.createElement(A,{element:N}),o.default.createElement(c.Image,{ref:V,name:"element",id:N.id,image:He,x:N.a.x,y:N.a.y,width:N.a.width||1,height:N.a.height||1,rotation:N.a.rotation,opacity:Tt,shadowEnabled:N.shadowEnabled,shadowBlur:N.shadowBlur,shadowOffsetX:N.shadowOffsetX,shadowOffsetY:N.shadowOffsetY,shadowColor:N.shadowColor,shadowOpacity:N.shadowOpacity,customCrop:Me,listening:Xt,draggable:Rr?N.draggable&&U:N.draggable,preventDefault:!Rr||U,hideInExport:!N.showInExport,onDragMove:Je=>{N.set({x:Je.target.x(),y:Je.target.y()})},onDragEnd:Je=>{N.set({x:Je.target.x(),y:Je.target.y()})},onDblClick:ke,onDblTap:ke,onTransformStart:()=>{Z(!0),nr.current={cropX:N.cropX,cropY:N.cropY,cropWidth:N.cropWidth,cropHeight:N.cropHeight}},onTransform:Je=>{var mt;const Gt=Je.currentTarget,bt=Math.abs(Gt.scaleX()-1)<1e-7?1:Gt.scaleX(),Kt=Math.abs(Gt.scaleY()-1)<1e-7?1:Gt.scaleY();Gt.scaleX(1),Gt.scaleY(1);const Yt=(mt=Je.target.getStage())===null||mt===void 0?void 0:mt.findOne("Transformer"),ct=1-Ae/_e.width,_t=Math.min(ct,Math.max(0,N.cropX)),xt=1-Te/_e.height,rt=Math.min(xt,Math.max(0,N.cropY)),zt=Yt.getActiveAnchor(),gt=!(zt.indexOf("middle")>=0||zt.indexOf("center")>=0),Ft=!gt&&bt<1&&nr.current.cropHeight>Te/_e.height;let br=gt?N.cropWidth:N.cropWidth*bt;Ft&&(br=N.cropWidth);const hr=!gt&&Kt<1&&nr.current.cropWidth>Ae/_e.width;let Qr=gt?N.cropHeight:N.cropHeight*Kt;hr&&(Qr=N.cropHeight),Oe&&(br=N.cropWidth,Qr=N.cropHeight),N.set({cropX:_t,cropY:rt,x:Gt.x(),y:Gt.y(),width:Gt.width()*bt,height:Gt.height()*Kt,rotation:Je.target.rotation(),cropWidth:Math.min(br,1-_t),cropHeight:Math.min(Qr,1-rt)})},onTransformEnd:Je=>{const mt=Je.currentTarget;N.set({width:mt.width(),height:mt.height(),x:mt.x(),y:mt.y(),rotation:Je.target.rotation(),cropWidth:Ae/_e.width,cropHeight:Te/_e.height}),Z(!1)}}),o.default.createElement(c.Rect,{x:N.x,y:N.y,width:Math.max(N.a.width-N.borderSize,0),height:Math.max(N.a.height-N.borderSize,0),opacity:Tt,offsetX:-N.borderSize/2,offsetY:-N.borderSize/2,stroke:N.borderColor,strokeWidth:N.borderSize,listening:!1,visible:!!N.borderSize,rotation:N.rotation,cornerRadius:Math.max(0,ze-N.borderSize),hideInExport:!N.showInExport}),N._cropModeEnabled&&o.default.createElement(v.Portal,{selector:".page-abs-container",enabled:!0},o.default.createElement(c.Rect,{x:-window.innerWidth/B.scale,y:-window.innerWidth/B.scale,width:window.innerWidth/B.scale*3,height:window.innerWidth/B.scale*3,fill:"rgba(0,0,0,0.3)"}),o.default.createElement(c.Image,{listening:!1,image:He,x:N.x,y:N.y,width:N.a.width,height:N.a.height,rotation:N.rotation,shadowEnabled:N.shadowEnabled,shadowBlur:N.shadowBlur}),o.default.createElement(c.Group,{x:N.x,y:N.y,rotation:N.rotation,scaleX:Qe,scaleY:Qe},o.default.createElement(c.Image,{image:_e,ref:H,opacity:.4,draggable:!0,x:-N.cropX*_e.width,y:-N.cropY*_e.height,onDragMove:Ie,onTransform:Ie,onTouchMove:Je=>{Je.evt.preventDefault();const mt=Je.target.getStage().getPointersPositions();var Gt=mt[0],bt=mt[1];const Kt=Je.target;if(Gt&&!bt&&!Kt.isDragging()&&qt.current&&(Kt.startDrag(),qt.current=!1),Gt&&bt){p.default.hitOnDragEnabled=!0,Kt.isDragging()&&(qt.current=!0,Kt.stopDrag());const hr=Je.target.getAbsoluteTransform().copy();hr.invert();var Yt={x:Gt.x,y:Gt.y},ct={x:bt.x,y:bt.y};if(!Pt.current)return void(Pt.current=L(Yt,ct));var _t=L(Yt,ct),xt=function(Si,fa){return Math.sqrt(Math.pow(fa.x-Si.x,2)+Math.pow(fa.y-Si.y,2))}(Yt,ct);It.current||(It.current=xt);const Qr=Kt.position();var rt={x:_t.x-Qr.x,y:_t.y-Qr.y},zt=xt/It.current;Kt.scaleX(zt),Kt.scaleY(zt);const Sn=hr.point(_t),Ni=hr.point(Pt.current);var gt=Sn.x-Ni.x,Ft=Sn.y-Ni.y,br={x:Math.min(0,_t.x-rt.x*zt+gt),y:Math.min(0,_t.y-rt.y*zt+Ft)};Kt.position(br),It.current=xt,Pt.current=_t,Ie(Je)}},onTouchEnd:Je=>{It.current=0,Pt.current=null,p.default.hitOnDragEnabled=!1}}),o.default.createElement(c.Transformer,Object.assign({ref:Ht},F)),o.default.createElement(c.Rect,{width:Ae,height:Te,ref:Ze,listening:!1,onTransform:Je=>{if(N.cropX<Math.abs(Je.target.x()/_e.width)&&Je.target.x()<0&&N.cropX>0){const xt=(N.cropWidth+N.cropX)*_e.width;Je.target.scaleX(1),Je.target.width(xt)}if(N.cropY<Math.abs(Je.target.y()/_e.height)&&Je.target.y()<0&&N.cropY>0){const xt=(N.cropHeight+N.cropY)*_e.height;Je.target.scaleY(1),Je.target.height(xt)}Je.target.x()<-N.cropX*_e.width-1e-9&&(Je.target.x(-N.cropX*_e.width),Je.target.scaleX(1)),Je.target.y()<-N.cropY*_e.height-1e-9&&(Je.target.y(-N.cropY*_e.height),Je.target.scaleY(1));const mt=Math.min(1,Math.max(0,N.cropX+Je.target.x()/_e.width)),Gt=Math.min(1,Math.max(0,Je.target.y()/_e.height+N.cropY)),bt=Je.target.width()*Je.target.scaleX(),Kt=Je.target.height()*Je.target.scaleY(),Yt=Math.min(1-mt,bt/_e.width),ct=Math.min(1-Gt,Kt/_e.height),_t=Je.target.getAbsolutePosition(Je.target.getParent().getParent());Je.target.scale({x:1,y:1}),Je.target.position({x:0,y:0}),N.set({x:_t.x,y:_t.y,cropX:mt,cropY:Gt,cropWidth:Yt,cropHeight:ct,width:Math.min(bt*Qe,_e.width*(1-mt)*Qe),height:Math.min(Kt*Qe,_e.height*(1-Gt)*Qe)})}}),o.default.createElement(c.Transformer,Object.assign({ref:tt},T,{visible:N.resizable})))))})}(Fl)),Fl}var Dl={},y1={exports:{}};/*!
|
|
109
|
-
* Quill Editor v1.3.7
|
|
110
|
-
* https://quilljs.com/
|
|
111
|
-
* Copyright (c) 2014, Jason Chen
|
|
112
|
-
* Copyright (c) 2013, salesforce.com
|
|
113
|
-
*/var jA=y1.exports,qb;function FA(){return qb||(qb=1,function(e,r){(function(n,a){e.exports=a()})(typeof self<"u"?self:jA,function(){return function(t){var n={};function a(i){if(n[i])return n[i].exports;var o=n[i]={i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return a.m=t,a.c=n,a.d=function(i,o,s){a.o(i,o)||Object.defineProperty(i,o,{configurable:!1,enumerable:!0,get:s})},a.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return a.d(o,"a",o),o},a.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},a.p="",a(a.s=109)}([function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(17),o=a(18),s=a(19),u=a(45),c=a(46),h=a(47),p=a(48),v=a(49),f=a(12),_=a(32),E=a(33),w=a(31),x=a(1),y={Scope:x.Scope,create:x.create,find:x.find,query:x.query,register:x.register,Container:i.default,Format:o.default,Leaf:s.default,Embed:p.default,Scroll:u.default,Block:h.default,Inline:c.default,Text:v.default,Attributor:{Attribute:f.default,Class:_.default,Style:E.default,Store:w.default}};n.default=y},function(t,n,a){var i=this&&this.__extends||function(){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,y){x.__proto__=y}||function(x,y){for(var g in y)y.hasOwnProperty(g)&&(x[g]=y[g])};return function(x,y){w(x,y);function g(){this.constructor=x}x.prototype=y===null?Object.create(y):(g.prototype=y.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=function(w){i(x,w);function x(y){var g=this;return y="[Parchment] "+y,g=w.call(this,y)||this,g.message=y,g.name=g.constructor.name,g}return x}(Error);n.ParchmentError=o;var s={},u={},c={},h={};n.DATA_KEY="__blot";var p;(function(w){w[w.TYPE=3]="TYPE",w[w.LEVEL=12]="LEVEL",w[w.ATTRIBUTE=13]="ATTRIBUTE",w[w.BLOT=14]="BLOT",w[w.INLINE=7]="INLINE",w[w.BLOCK=11]="BLOCK",w[w.BLOCK_BLOT=10]="BLOCK_BLOT",w[w.INLINE_BLOT=6]="INLINE_BLOT",w[w.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",w[w.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",w[w.ANY=15]="ANY"})(p=n.Scope||(n.Scope={}));function v(w,x){var y=_(w);if(y==null)throw new o("Unable to create "+w+" blot");var g=y,S=w instanceof Node||w.nodeType===Node.TEXT_NODE?w:g.create(x);return new g(S,x)}n.create=v;function f(w,x){return x===void 0&&(x=!1),w==null?null:w[n.DATA_KEY]!=null?w[n.DATA_KEY].blot:x?f(w.parentNode,x):null}n.find=f;function _(w,x){x===void 0&&(x=p.ANY);var y;if(typeof w=="string")y=h[w]||s[w];else if(w instanceof Text||w.nodeType===Node.TEXT_NODE)y=h.text;else if(typeof w=="number")w&p.LEVEL&p.BLOCK?y=h.block:w&p.LEVEL&p.INLINE&&(y=h.inline);else if(w instanceof HTMLElement){var g=(w.getAttribute("class")||"").split(/\s+/);for(var S in g)if(y=u[g[S]],y)break;y=y||c[w.tagName]}return y==null?null:x&p.LEVEL&y.scope&&x&p.TYPE&y.scope?y:null}n.query=_;function E(){for(var w=[],x=0;x<arguments.length;x++)w[x]=arguments[x];if(w.length>1)return w.map(function(S){return E(S)});var y=w[0];if(typeof y.blotName!="string"&&typeof y.attrName!="string")throw new o("Invalid definition");if(y.blotName==="abstract")throw new o("Cannot register abstract class");if(h[y.blotName||y.attrName]=y,typeof y.keyName=="string")s[y.keyName]=y;else if(y.className!=null&&(u[y.className]=y),y.tagName!=null){Array.isArray(y.tagName)?y.tagName=y.tagName.map(function(S){return S.toUpperCase()}):y.tagName=y.tagName.toUpperCase();var g=Array.isArray(y.tagName)?y.tagName:[y.tagName];g.forEach(function(S){(c[S]==null||y.className==null)&&(c[S]=y)})}return y}n.register=E},function(t,n,a){var i=a(51),o=a(11),s=a(3),u=a(20),c="\0",h=function(p){Array.isArray(p)?this.ops=p:p!=null&&Array.isArray(p.ops)?this.ops=p.ops:this.ops=[]};h.prototype.insert=function(p,v){var f={};return p.length===0?this:(f.insert=p,v!=null&&typeof v=="object"&&Object.keys(v).length>0&&(f.attributes=v),this.push(f))},h.prototype.delete=function(p){return p<=0?this:this.push({delete:p})},h.prototype.retain=function(p,v){if(p<=0)return this;var f={retain:p};return v!=null&&typeof v=="object"&&Object.keys(v).length>0&&(f.attributes=v),this.push(f)},h.prototype.push=function(p){var v=this.ops.length,f=this.ops[v-1];if(p=s(!0,{},p),typeof f=="object"){if(typeof p.delete=="number"&&typeof f.delete=="number")return this.ops[v-1]={delete:f.delete+p.delete},this;if(typeof f.delete=="number"&&p.insert!=null&&(v-=1,f=this.ops[v-1],typeof f!="object"))return this.ops.unshift(p),this;if(o(p.attributes,f.attributes)){if(typeof p.insert=="string"&&typeof f.insert=="string")return this.ops[v-1]={insert:f.insert+p.insert},typeof p.attributes=="object"&&(this.ops[v-1].attributes=p.attributes),this;if(typeof p.retain=="number"&&typeof f.retain=="number")return this.ops[v-1]={retain:f.retain+p.retain},typeof p.attributes=="object"&&(this.ops[v-1].attributes=p.attributes),this}}return v===this.ops.length?this.ops.push(p):this.ops.splice(v,0,p),this},h.prototype.chop=function(){var p=this.ops[this.ops.length-1];return p&&p.retain&&!p.attributes&&this.ops.pop(),this},h.prototype.filter=function(p){return this.ops.filter(p)},h.prototype.forEach=function(p){this.ops.forEach(p)},h.prototype.map=function(p){return this.ops.map(p)},h.prototype.partition=function(p){var v=[],f=[];return this.forEach(function(_){var E=p(_)?v:f;E.push(_)}),[v,f]},h.prototype.reduce=function(p,v){return this.ops.reduce(p,v)},h.prototype.changeLength=function(){return this.reduce(function(p,v){return v.insert?p+u.length(v):v.delete?p-v.delete:p},0)},h.prototype.length=function(){return this.reduce(function(p,v){return p+u.length(v)},0)},h.prototype.slice=function(p,v){p=p||0,typeof v!="number"&&(v=1/0);for(var f=[],_=u.iterator(this.ops),E=0;E<v&&_.hasNext();){var w;E<p?w=_.next(p-E):(w=_.next(v-E),f.push(w)),E+=u.length(w)}return new h(f)},h.prototype.compose=function(p){var v=u.iterator(this.ops),f=u.iterator(p.ops),_=[],E=f.peek();if(E!=null&&typeof E.retain=="number"&&E.attributes==null){for(var w=E.retain;v.peekType()==="insert"&&v.peekLength()<=w;)w-=v.peekLength(),_.push(v.next());E.retain-w>0&&f.next(E.retain-w)}for(var x=new h(_);v.hasNext()||f.hasNext();)if(f.peekType()==="insert")x.push(f.next());else if(v.peekType()==="delete")x.push(v.next());else{var y=Math.min(v.peekLength(),f.peekLength()),g=v.next(y),S=f.next(y);if(typeof S.retain=="number"){var b={};typeof g.retain=="number"?b.retain=y:b.insert=g.insert;var R=u.attributes.compose(g.attributes,S.attributes,typeof g.retain=="number");if(R&&(b.attributes=R),x.push(b),!f.hasNext()&&o(x.ops[x.ops.length-1],b)){var L=new h(v.rest());return x.concat(L).chop()}}else typeof S.delete=="number"&&typeof g.retain=="number"&&x.push(S)}return x.chop()},h.prototype.concat=function(p){var v=new h(this.ops.slice());return p.ops.length>0&&(v.push(p.ops[0]),v.ops=v.ops.concat(p.ops.slice(1))),v},h.prototype.diff=function(p,v){if(this.ops===p.ops)return new h;var f=[this,p].map(function(y){return y.map(function(g){if(g.insert!=null)return typeof g.insert=="string"?g.insert:c;var S=y===p?"on":"with";throw new Error("diff() called "+S+" non-document")}).join("")}),_=new h,E=i(f[0],f[1],v),w=u.iterator(this.ops),x=u.iterator(p.ops);return E.forEach(function(y){for(var g=y[1].length;g>0;){var S=0;switch(y[0]){case i.INSERT:S=Math.min(x.peekLength(),g),_.push(x.next(S));break;case i.DELETE:S=Math.min(g,w.peekLength()),w.next(S),_.delete(S);break;case i.EQUAL:S=Math.min(w.peekLength(),x.peekLength(),g);var b=w.next(S),R=x.next(S);o(b.insert,R.insert)?_.retain(S,u.attributes.diff(b.attributes,R.attributes)):_.push(R).delete(S);break}g-=S}}),_.chop()},h.prototype.eachLine=function(p,v){v=v||`
|
|
114
|
-
`;for(var f=u.iterator(this.ops),_=new h,E=0;f.hasNext();){if(f.peekType()!=="insert")return;var w=f.peek(),x=u.length(w)-f.peekLength(),y=typeof w.insert=="string"?w.insert.indexOf(v,x)-x:-1;if(y<0)_.push(f.next());else if(y>0)_.push(f.next(y));else{if(p(_,f.next(1).attributes||{},E)===!1)return;E+=1,_=new h}}_.length()>0&&p(_,{},E)},h.prototype.transform=function(p,v){if(v=!!v,typeof p=="number")return this.transformPosition(p,v);for(var f=u.iterator(this.ops),_=u.iterator(p.ops),E=new h;f.hasNext()||_.hasNext();)if(f.peekType()==="insert"&&(v||_.peekType()!=="insert"))E.retain(u.length(f.next()));else if(_.peekType()==="insert")E.push(_.next());else{var w=Math.min(f.peekLength(),_.peekLength()),x=f.next(w),y=_.next(w);if(x.delete)continue;y.delete?E.push(y):E.retain(w,u.attributes.transform(x.attributes,y.attributes,v))}return E.chop()},h.prototype.transformPosition=function(p,v){v=!!v;for(var f=u.iterator(this.ops),_=0;f.hasNext()&&_<=p;){var E=f.peekLength(),w=f.peekType();if(f.next(),w==="delete"){p-=Math.min(E,p-_);continue}else w==="insert"&&(_<p||!v)&&(p+=E);_+=E}return p},t.exports=h},function(t,n){var a=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u=function(f){return typeof Array.isArray=="function"?Array.isArray(f):i.call(f)==="[object Array]"},c=function(f){if(!f||i.call(f)!=="[object Object]")return!1;var _=a.call(f,"constructor"),E=f.constructor&&f.constructor.prototype&&a.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!_&&!E)return!1;var w;for(w in f);return typeof w>"u"||a.call(f,w)},h=function(f,_){o&&_.name==="__proto__"?o(f,_.name,{enumerable:!0,configurable:!0,value:_.newValue,writable:!0}):f[_.name]=_.newValue},p=function(f,_){if(_==="__proto__")if(a.call(f,_)){if(s)return s(f,_).value}else return;return f[_]};t.exports=function v(){var f,_,E,w,x,y,g=arguments[0],S=1,b=arguments.length,R=!1;for(typeof g=="boolean"&&(R=g,g=arguments[1]||{},S=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});S<b;++S)if(f=arguments[S],f!=null)for(_ in f)E=p(g,_),w=p(f,_),g!==w&&(R&&w&&(c(w)||(x=u(w)))?(x?(x=!1,y=E&&u(E)?E:[]):y=E&&c(E)?E:{},h(g,{name:_,newValue:v(R,y,w)})):typeof w<"u"&&h(g,{name:_,newValue:w}));return g}},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var i=function(){function O(C,A){for(var j=0;j<A.length;j++){var N=A[j];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(C,N.key,N)}}return function(C,A,j){return A&&O(C.prototype,A),j&&O(C,j),C}}(),o=function O(C,A,j){C===null&&(C=Function.prototype);var N=Object.getOwnPropertyDescriptor(C,A);if(N===void 0){var B=Object.getPrototypeOf(C);return B===null?void 0:O(B,A,j)}else{if("value"in N)return N.value;var W=N.get;return W===void 0?void 0:W.call(j)}},s=a(3),u=g(s),c=a(2),h=g(c),p=a(0),v=g(p),f=a(16),_=g(f),E=a(6),w=g(E),x=a(7),y=g(x);function g(O){return O&&O.__esModule?O:{default:O}}function S(O,C){if(!(O instanceof C))throw new TypeError("Cannot call a class as a function")}function b(O,C){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:O}function R(O,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);O.prototype=Object.create(C&&C.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(O,C):O.__proto__=C)}var L=1,T=function(O){R(C,O);function C(){return S(this,C),b(this,(C.__proto__||Object.getPrototypeOf(C)).apply(this,arguments))}return i(C,[{key:"attach",value:function(){o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"attach",this).call(this),this.attributes=new v.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new h.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(j,N){var B=v.default.query(j,v.default.Scope.BLOCK_ATTRIBUTE);B!=null&&this.attributes.attribute(B,N)}},{key:"formatAt",value:function(j,N,B,W){this.format(B,W)}},{key:"insertAt",value:function(j,N,B){if(typeof N=="string"&&N.endsWith(`
|
|
115
|
-
`)){var W=v.default.create(F.blotName);this.parent.insertBefore(W,j===0?this:this.next),W.insertAt(0,N.slice(0,-1))}else o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertAt",this).call(this,j,N,B)}}]),C}(v.default.Embed);T.scope=v.default.Scope.BLOCK_BLOT;var F=function(O){R(C,O);function C(A){S(this,C);var j=b(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,A));return j.cache={},j}return i(C,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(v.default.Leaf).reduce(function(j,N){return N.length()===0?j:j.insert(N.value(),I(N))},new h.default).insert(`
|
|
116
|
-
`,I(this))),this.cache.delta}},{key:"deleteAt",value:function(j,N){o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"deleteAt",this).call(this,j,N),this.cache={}}},{key:"formatAt",value:function(j,N,B,W){N<=0||(v.default.query(B,v.default.Scope.BLOCK)?j+N===this.length()&&this.format(B,W):o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"formatAt",this).call(this,j,Math.min(N,this.length()-j-1),B,W),this.cache={})}},{key:"insertAt",value:function(j,N,B){if(B!=null)return o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertAt",this).call(this,j,N,B);if(N.length!==0){var W=N.split(`
|
|
117
|
-
`),Y=W.shift();Y.length>0&&(j<this.length()-1||this.children.tail==null?o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertAt",this).call(this,Math.min(j,this.length()-1),Y):this.children.tail.insertAt(this.children.tail.length(),Y),this.cache={});var Z=this;W.reduce(function(V,H){return Z=Z.split(V,!0),Z.insertAt(0,H),H.length},j+Y.length)}}},{key:"insertBefore",value:function(j,N){var B=this.children.head;o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertBefore",this).call(this,j,N),B instanceof _.default&&B.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"length",this).call(this)+L),this.cache.length}},{key:"moveChildren",value:function(j,N){o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"moveChildren",this).call(this,j,N),this.cache={}}},{key:"optimize",value:function(j){o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"optimize",this).call(this,j),this.cache={}}},{key:"path",value:function(j){return o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"path",this).call(this,j,!0)}},{key:"removeChild",value:function(j){o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"removeChild",this).call(this,j),this.cache={}}},{key:"split",value:function(j){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(N&&(j===0||j>=this.length()-L)){var B=this.clone();return j===0?(this.parent.insertBefore(B,this),this):(this.parent.insertBefore(B,this.next),B)}else{var W=o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"split",this).call(this,j,N);return this.cache={},W}}}]),C}(v.default.Block);F.blotName="block",F.tagName="P",F.defaultChild="break",F.allowedChildren=[w.default,v.default.Embed,y.default];function I(O){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return O==null||(typeof O.formats=="function"&&(C=(0,u.default)(C,O.formats())),O.parent==null||O.parent.blotName=="scroll"||O.parent.statics.scope!==O.statics.scope)?C:I(O.parent,C)}n.bubbleFormats=I,n.BlockEmbed=T,n.default=F},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},o=function(){function Z(V,H){var U=[],D=!0,$=!1,Q=void 0;try{for(var ee=V[Symbol.iterator](),te;!(D=(te=ee.next()).done)&&(U.push(te.value),!(H&&U.length===H));D=!0);}catch(ae){$=!0,Q=ae}finally{try{!D&&ee.return&&ee.return()}finally{if($)throw Q}}return U}return function(V,H){if(Array.isArray(V))return V;if(Symbol.iterator in Object(V))return Z(V,H);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function Z(V,H){for(var U=0;U<H.length;U++){var D=H[U];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(V,D.key,D)}}return function(V,H,U){return H&&Z(V.prototype,H),U&&Z(V,U),V}}();a(50);var u=a(2),c=I(u),h=a(14),p=I(h),v=a(8),f=I(v),_=a(9),E=I(_),w=a(0),x=I(w),y=a(15),g=I(y),S=a(3),b=I(S),R=a(10),L=I(R),T=a(34),F=I(T);function I(Z){return Z&&Z.__esModule?Z:{default:Z}}function O(Z,V,H){return V in Z?Object.defineProperty(Z,V,{value:H,enumerable:!0,configurable:!0,writable:!0}):Z[V]=H,Z}function C(Z,V){if(!(Z instanceof V))throw new TypeError("Cannot call a class as a function")}var A=(0,L.default)("quill"),j=function(){s(Z,null,[{key:"debug",value:function(H){H===!0&&(H="log"),L.default.level(H)}},{key:"find",value:function(H){return H.__quill||x.default.find(H)}},{key:"import",value:function(H){return this.imports[H]==null&&A.error("Cannot import "+H+". Are you sure it was registered?"),this.imports[H]}},{key:"register",value:function(H,U){var D=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof H!="string"){var Q=H.attrName||H.blotName;typeof Q=="string"?this.register("formats/"+Q,H,U):Object.keys(H).forEach(function(ee){D.register(ee,H[ee],U)})}else this.imports[H]!=null&&!$&&A.warn("Overwriting "+H+" with",U),this.imports[H]=U,(H.startsWith("blots/")||H.startsWith("formats/"))&&U.blotName!=="abstract"?x.default.register(U):H.startsWith("modules")&&typeof U.register=="function"&&U.register()}}]);function Z(V){var H=this,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(C(this,Z),this.options=N(V,U),this.container=this.options.container,this.container==null)return A.error("Invalid Quill container",V);this.options.debug&&Z.debug(this.options.debug);var D=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 f.default,this.scroll=x.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new p.default(this.scroll),this.selection=new g.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(f.default.events.EDITOR_CHANGE,function(Q){Q===f.default.events.TEXT_CHANGE&&H.root.classList.toggle("ql-blank",H.editor.isBlank())}),this.emitter.on(f.default.events.SCROLL_UPDATE,function(Q,ee){var te=H.selection.lastRange,ae=te&&te.length===0?te.index:void 0;B.call(H,function(){return H.editor.update(null,ee,ae)},Q)});var $=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+D+"<p><br></p></div>");this.setContents($),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return s(Z,[{key:"addContainer",value:function(H){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof H=="string"){var D=H;H=document.createElement("div"),H.classList.add(D)}return this.container.insertBefore(H,U),H}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(H,U,D){var $=this,Q=W(H,U,D),ee=o(Q,4);return H=ee[0],U=ee[1],D=ee[3],B.call(this,function(){return $.editor.deleteText(H,U)},D,H,-1*U)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(H),this.container.classList.toggle("ql-disabled",!H)}},{key:"focus",value:function(){var H=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=H,this.scrollIntoView()}},{key:"format",value:function(H,U){var D=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:f.default.sources.API;return B.call(this,function(){var Q=D.getSelection(!0),ee=new c.default;if(Q==null)return ee;if(x.default.query(H,x.default.Scope.BLOCK))ee=D.editor.formatLine(Q.index,Q.length,O({},H,U));else{if(Q.length===0)return D.selection.format(H,U),ee;ee=D.editor.formatText(Q.index,Q.length,O({},H,U))}return D.setSelection(Q,f.default.sources.SILENT),ee},$)}},{key:"formatLine",value:function(H,U,D,$,Q){var ee=this,te=void 0,ae=W(H,U,D,$,Q),se=o(ae,4);return H=se[0],U=se[1],te=se[2],Q=se[3],B.call(this,function(){return ee.editor.formatLine(H,U,te)},Q,H,0)}},{key:"formatText",value:function(H,U,D,$,Q){var ee=this,te=void 0,ae=W(H,U,D,$,Q),se=o(ae,4);return H=se[0],U=se[1],te=se[2],Q=se[3],B.call(this,function(){return ee.editor.formatText(H,U,te)},Q,H,0)}},{key:"getBounds",value:function(H){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,D=void 0;typeof H=="number"?D=this.selection.getBounds(H,U):D=this.selection.getBounds(H.index,H.length);var $=this.container.getBoundingClientRect();return{bottom:D.bottom-$.top,height:D.height,left:D.left-$.left,right:D.right-$.left,top:D.top-$.top,width:D.width}}},{key:"getContents",value:function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-H,D=W(H,U),$=o(D,2);return H=$[0],U=$[1],this.editor.getContents(H,U)}},{key:"getFormat",value:function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof H=="number"?this.editor.getFormat(H,U):this.editor.getFormat(H.index,H.length)}},{key:"getIndex",value:function(H){return H.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(H){return this.scroll.leaf(H)}},{key:"getLine",value:function(H){return this.scroll.line(H)}},{key:"getLines",value:function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof H!="number"?this.scroll.lines(H.index,H.length):this.scroll.lines(H,U)}},{key:"getModule",value:function(H){return this.theme.modules[H]}},{key:"getSelection",value:function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return H&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-H,D=W(H,U),$=o(D,2);return H=$[0],U=$[1],this.editor.getText(H,U)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(H,U,D){var $=this,Q=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Z.sources.API;return B.call(this,function(){return $.editor.insertEmbed(H,U,D)},Q,H)}},{key:"insertText",value:function(H,U,D,$,Q){var ee=this,te=void 0,ae=W(H,0,D,$,Q),se=o(ae,4);return H=se[0],te=se[2],Q=se[3],B.call(this,function(){return ee.editor.insertText(H,U,te)},Q,H,U.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(H,U,D){this.clipboard.dangerouslyPasteHTML(H,U,D)}},{key:"removeFormat",value:function(H,U,D){var $=this,Q=W(H,U,D),ee=o(Q,4);return H=ee[0],U=ee[1],D=ee[3],B.call(this,function(){return $.editor.removeFormat(H,U)},D,H)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(H){var U=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f.default.sources.API;return B.call(this,function(){H=new c.default(H);var $=U.getLength(),Q=U.editor.deleteText(0,$),ee=U.editor.applyDelta(H),te=ee.ops[ee.ops.length-1];te!=null&&typeof te.insert=="string"&&te.insert[te.insert.length-1]===`
|
|
118
|
-
`&&(U.editor.deleteText(U.getLength()-1,1),ee.delete(1));var ae=Q.compose(ee);return ae},D)}},{key:"setSelection",value:function(H,U,D){if(H==null)this.selection.setRange(null,U||Z.sources.API);else{var $=W(H,U,D),Q=o($,4);H=Q[0],U=Q[1],D=Q[3],this.selection.setRange(new y.Range(H,U),D),D!==f.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(H){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f.default.sources.API,D=new c.default().insert(H);return this.setContents(D,U)}},{key:"update",value:function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f.default.sources.USER,U=this.scroll.update(H);return this.selection.update(H),U}},{key:"updateContents",value:function(H){var U=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f.default.sources.API;return B.call(this,function(){return H=new c.default(H),U.editor.applyDelta(H,D)},D,!0)}}]),Z}();j.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},j.events=f.default.events,j.sources=f.default.sources,j.version="1.3.7",j.imports={delta:c.default,parchment:x.default,"core/module":E.default,"core/theme":F.default};function N(Z,V){if(V=(0,b.default)(!0,{container:Z,modules:{clipboard:!0,keyboard:!0,history:!0}},V),!V.theme||V.theme===j.DEFAULTS.theme)V.theme=F.default;else if(V.theme=j.import("themes/"+V.theme),V.theme==null)throw new Error("Invalid theme "+V.theme+". Did you register it?");var H=(0,b.default)(!0,{},V.theme.DEFAULTS);[H,V].forEach(function($){$.modules=$.modules||{},Object.keys($.modules).forEach(function(Q){$.modules[Q]===!0&&($.modules[Q]={})})});var U=Object.keys(H.modules).concat(Object.keys(V.modules)),D=U.reduce(function($,Q){var ee=j.import("modules/"+Q);return ee==null?A.error("Cannot load "+Q+" module. Are you sure you registered it?"):$[Q]=ee.DEFAULTS||{},$},{});return V.modules!=null&&V.modules.toolbar&&V.modules.toolbar.constructor!==Object&&(V.modules.toolbar={container:V.modules.toolbar}),V=(0,b.default)(!0,{},j.DEFAULTS,{modules:D},H,V),["bounds","container","scrollingContainer"].forEach(function($){typeof V[$]=="string"&&(V[$]=document.querySelector(V[$]))}),V.modules=Object.keys(V.modules).reduce(function($,Q){return V.modules[Q]&&($[Q]=V.modules[Q]),$},{}),V}function B(Z,V,H,U){if(this.options.strict&&!this.isEnabled()&&V===f.default.sources.USER)return new c.default;var D=H==null?null:this.getSelection(),$=this.editor.delta,Q=Z();if(D!=null&&(H===!0&&(H=D.index),U==null?D=Y(D,Q,V):U!==0&&(D=Y(D,H,U,V)),this.setSelection(D,f.default.sources.SILENT)),Q.length()>0){var ee,te=[f.default.events.TEXT_CHANGE,Q,$,V];if((ee=this.emitter).emit.apply(ee,[f.default.events.EDITOR_CHANGE].concat(te)),V!==f.default.sources.SILENT){var ae;(ae=this.emitter).emit.apply(ae,te)}}return Q}function W(Z,V,H,U,D){var $={};return typeof Z.index=="number"&&typeof Z.length=="number"?typeof V!="number"?(D=U,U=H,H=V,V=Z.length,Z=Z.index):(V=Z.length,Z=Z.index):typeof V!="number"&&(D=U,U=H,H=V,V=0),(typeof H>"u"?"undefined":i(H))==="object"?($=H,D=U):typeof H=="string"&&(U!=null?$[H]=U:D=H),D=D||f.default.sources.API,[Z,V,$,D]}function Y(Z,V,H,U){if(Z==null)return null;var D=void 0,$=void 0;if(V instanceof c.default){var Q=[Z.index,Z.index+Z.length].map(function(se){return V.transformPosition(se,U!==f.default.sources.USER)}),ee=o(Q,2);D=ee[0],$=ee[1]}else{var te=[Z.index,Z.index+Z.length].map(function(se){return se<V||se===V&&U===f.default.sources.USER?se:H>=0?se+H:Math.max(V,se+H)}),ae=o(te,2);D=ae[0],$=ae[1]}return new y.Range(D,$-D)}n.expandConfig=N,n.overload=W,n.default=j},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function w(x,y){for(var g=0;g<y.length;g++){var S=y[g];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(x,S.key,S)}}return function(x,y,g){return y&&w(x.prototype,y),g&&w(x,g),x}}(),o=function w(x,y,g){x===null&&(x=Function.prototype);var S=Object.getOwnPropertyDescriptor(x,y);if(S===void 0){var b=Object.getPrototypeOf(x);return b===null?void 0:w(b,y,g)}else{if("value"in S)return S.value;var R=S.get;return R===void 0?void 0:R.call(g)}},s=a(7),u=p(s),c=a(0),h=p(c);function p(w){return w&&w.__esModule?w:{default:w}}function v(w,x){if(!(w instanceof x))throw new TypeError("Cannot call a class as a function")}function f(w,x){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:w}function _(w,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);w.prototype=Object.create(x&&x.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(w,x):w.__proto__=x)}var E=function(w){_(x,w);function x(){return v(this,x),f(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return i(x,[{key:"formatAt",value:function(g,S,b,R){if(x.compare(this.statics.blotName,b)<0&&h.default.query(b,h.default.Scope.BLOT)){var L=this.isolate(g,S);R&&L.wrap(b,R)}else o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"formatAt",this).call(this,g,S,b,R)}},{key:"optimize",value:function(g){if(o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"optimize",this).call(this,g),this.parent instanceof x&&x.compare(this.statics.blotName,this.parent.statics.blotName)>0){var S=this.parent.isolate(this.offset(),this.length());this.moveChildren(S),S.wrap(this)}}}],[{key:"compare",value:function(g,S){var b=x.order.indexOf(g),R=x.order.indexOf(S);return b>=0||R>=0?b-R:g===S?0:g<S?-1:1}}]),x}(h.default.Inline);E.allowedChildren=[E,h.default.Embed,u.default],E.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=E},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(0),o=s(i);function s(v){return v&&v.__esModule?v:{default:v}}function u(v,f){if(!(v instanceof f))throw new TypeError("Cannot call a class as a function")}function c(v,f){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:v}function h(v,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);v.prototype=Object.create(f&&f.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(v,f):v.__proto__=f)}var p=function(v){h(f,v);function f(){return u(this,f),c(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(o.default.Text);n.default=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function y(g,S){for(var b=0;b<S.length;b++){var R=S[b];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(g,R.key,R)}}return function(g,S,b){return S&&y(g.prototype,S),b&&y(g,b),g}}(),o=function y(g,S,b){g===null&&(g=Function.prototype);var R=Object.getOwnPropertyDescriptor(g,S);if(R===void 0){var L=Object.getPrototypeOf(g);return L===null?void 0:y(L,S,b)}else{if("value"in R)return R.value;var T=R.get;return T===void 0?void 0:T.call(b)}},s=a(54),u=p(s),c=a(10),h=p(c);function p(y){return y&&y.__esModule?y:{default:y}}function v(y,g){if(!(y instanceof g))throw new TypeError("Cannot call a class as a function")}function f(y,g){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:y}function _(y,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);y.prototype=Object.create(g&&g.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(y,g):y.__proto__=g)}var E=(0,h.default)("quill:events"),w=["selectionchange","mousedown","mouseup","click"];w.forEach(function(y){document.addEventListener(y,function(){for(var g=arguments.length,S=Array(g),b=0;b<g;b++)S[b]=arguments[b];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(R){if(R.__quill&&R.__quill.emitter){var L;(L=R.__quill.emitter).handleDOM.apply(L,S)}})})});var x=function(y){_(g,y);function g(){v(this,g);var S=f(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return S.listeners={},S.on("error",E.error),S}return i(g,[{key:"emit",value:function(){E.log.apply(E,arguments),o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(b){for(var R=arguments.length,L=Array(R>1?R-1:0),T=1;T<R;T++)L[T-1]=arguments[T];(this.listeners[b.type]||[]).forEach(function(F){var I=F.node,O=F.handler;(b.target===I||I.contains(b.target))&&O.apply(void 0,[b].concat(L))})}},{key:"listenDOM",value:function(b,R,L){this.listeners[b]||(this.listeners[b]=[]),this.listeners[b].push({node:R,handler:L})}}]),g}(u.default);x.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"},x.sources={API:"api",SILENT:"silent",USER:"user"},n.default=x},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});function i(s,u){if(!(s instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function s(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};i(this,s),this.quill=u,this.options=c};o.DEFAULTS={},n.default=o},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=["error","warn","log","info"],o="warn";function s(c){if(i.indexOf(c)<=i.indexOf(o)){for(var h,p=arguments.length,v=Array(p>1?p-1:0),f=1;f<p;f++)v[f-1]=arguments[f];(h=console)[c].apply(h,v)}}function u(c){return i.reduce(function(h,p){return h[p]=s.bind(console,p,c),h},{})}s.level=u.level=function(c){o=c},n.default=u},function(t,n,a){var i=Array.prototype.slice,o=a(52),s=a(53),u=t.exports=function(v,f,_){return _||(_={}),v===f?!0:v instanceof Date&&f instanceof Date?v.getTime()===f.getTime():!v||!f||typeof v!="object"&&typeof f!="object"?_.strict?v===f:v==f:p(v,f,_)};function c(v){return v==null}function h(v){return!(!v||typeof v!="object"||typeof v.length!="number"||typeof v.copy!="function"||typeof v.slice!="function"||v.length>0&&typeof v[0]!="number")}function p(v,f,_){var E,w;if(c(v)||c(f)||v.prototype!==f.prototype)return!1;if(s(v))return s(f)?(v=i.call(v),f=i.call(f),u(v,f,_)):!1;if(h(v)){if(!h(f)||v.length!==f.length)return!1;for(E=0;E<v.length;E++)if(v[E]!==f[E])return!1;return!0}try{var x=o(v),y=o(f)}catch{return!1}if(x.length!=y.length)return!1;for(x.sort(),y.sort(),E=x.length-1;E>=0;E--)if(x[E]!=y[E])return!1;for(E=x.length-1;E>=0;E--)if(w=x[E],!u(v[w],f[w],_))return!1;return typeof v==typeof f}},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(1),o=function(){function s(u,c,h){h===void 0&&(h={}),this.attrName=u,this.keyName=c;var p=i.Scope.TYPE&i.Scope.ATTRIBUTE;h.scope!=null?this.scope=h.scope&i.Scope.LEVEL|p:this.scope=i.Scope.ATTRIBUTE,h.whitelist!=null&&(this.whitelist=h.whitelist)}return s.keys=function(u){return[].map.call(u.attributes,function(c){return c.name})},s.prototype.add=function(u,c){return this.canAdd(u,c)?(u.setAttribute(this.keyName,c),!0):!1},s.prototype.canAdd=function(u,c){var h=i.query(u,i.Scope.BLOT&(this.scope|i.Scope.TYPE));return h==null?!1:this.whitelist==null?!0:typeof c=="string"?this.whitelist.indexOf(c.replace(/["']/g,""))>-1:this.whitelist.indexOf(c)>-1},s.prototype.remove=function(u){u.removeAttribute(this.keyName)},s.prototype.value=function(u){var c=u.getAttribute(this.keyName);return this.canAdd(u,c)&&c?c:""},s}();n.default=o},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var i=function(){function T(F,I){var O=[],C=!0,A=!1,j=void 0;try{for(var N=F[Symbol.iterator](),B;!(C=(B=N.next()).done)&&(O.push(B.value),!(I&&O.length===I));C=!0);}catch(W){A=!0,j=W}finally{try{!C&&N.return&&N.return()}finally{if(A)throw j}}return O}return function(F,I){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return T(F,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function T(F,I){for(var O=0;O<I.length;O++){var C=I[O];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(F,C.key,C)}}return function(F,I,O){return I&&T(F.prototype,I),O&&T(F,O),F}}(),s=function T(F,I,O){F===null&&(F=Function.prototype);var C=Object.getOwnPropertyDescriptor(F,I);if(C===void 0){var A=Object.getPrototypeOf(F);return A===null?void 0:T(A,I,O)}else{if("value"in C)return C.value;var j=C.get;return j===void 0?void 0:j.call(O)}},u=a(2),c=y(u),h=a(0),p=y(h),v=a(4),f=y(v),_=a(6),E=y(_),w=a(7),x=y(w);function y(T){return T&&T.__esModule?T:{default:T}}function g(T,F){if(!(T instanceof F))throw new TypeError("Cannot call a class as a function")}function S(T,F){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F&&(typeof F=="object"||typeof F=="function")?F:T}function b(T,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof F);T.prototype=Object.create(F&&F.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),F&&(Object.setPrototypeOf?Object.setPrototypeOf(T,F):T.__proto__=F)}var R=function(T){b(F,T);function F(){return g(this,F),S(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}return F}(E.default);R.blotName="code",R.tagName="CODE";var L=function(T){b(F,T);function F(){return g(this,F),S(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}return o(F,[{key:"delta",value:function(){var O=this,C=this.domNode.textContent;return C.endsWith(`
|
|
119
|
-
`)&&(C=C.slice(0,-1)),C.split(`
|
|
120
|
-
`).reduce(function(A,j){return A.insert(j).insert(`
|
|
121
|
-
`,O.formats())},new c.default)}},{key:"format",value:function(O,C){if(!(O===this.statics.blotName&&C)){var A=this.descendant(x.default,this.length()-1),j=i(A,1),N=j[0];N!=null&&N.deleteAt(N.length()-1,1),s(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"format",this).call(this,O,C)}}},{key:"formatAt",value:function(O,C,A,j){if(C!==0&&!(p.default.query(A,p.default.Scope.BLOCK)==null||A===this.statics.blotName&&j===this.statics.formats(this.domNode))){var N=this.newlineIndex(O);if(!(N<0||N>=O+C)){var B=this.newlineIndex(O,!0)+1,W=N-B+1,Y=this.isolate(B,W),Z=Y.next;Y.format(A,j),Z instanceof F&&Z.formatAt(0,O-B+C-W,A,j)}}}},{key:"insertAt",value:function(O,C,A){if(A==null){var j=this.descendant(x.default,O),N=i(j,2),B=N[0],W=N[1];B.insertAt(W,C)}}},{key:"length",value:function(){var O=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
|
|
122
|
-
`)?O:O+1}},{key:"newlineIndex",value:function(O){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(C)return this.domNode.textContent.slice(0,O).lastIndexOf(`
|
|
123
|
-
`);var A=this.domNode.textContent.slice(O).indexOf(`
|
|
124
|
-
`);return A>-1?O+A:-1}},{key:"optimize",value:function(O){this.domNode.textContent.endsWith(`
|
|
125
|
-
`)||this.appendChild(p.default.create("text",`
|
|
126
|
-
`)),s(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"optimize",this).call(this,O);var C=this.next;C!=null&&C.prev===this&&C.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===C.statics.formats(C.domNode)&&(C.optimize(O),C.moveChildren(this),C.remove())}},{key:"replace",value:function(O){s(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"replace",this).call(this,O),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(C){var A=p.default.find(C);A==null?C.parentNode.removeChild(C):A instanceof p.default.Embed?A.remove():A.unwrap()})}}],[{key:"create",value:function(O){var C=s(F.__proto__||Object.getPrototypeOf(F),"create",this).call(this,O);return C.setAttribute("spellcheck",!1),C}},{key:"formats",value:function(){return!0}}]),F}(f.default);L.blotName="code-block",L.tagName="PRE",L.TAB=" ",n.Code=R,n.default=L},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},o=function(){function Z(V,H){var U=[],D=!0,$=!1,Q=void 0;try{for(var ee=V[Symbol.iterator](),te;!(D=(te=ee.next()).done)&&(U.push(te.value),!(H&&U.length===H));D=!0);}catch(ae){$=!0,Q=ae}finally{try{!D&&ee.return&&ee.return()}finally{if($)throw Q}}return U}return function(V,H){if(Array.isArray(V))return V;if(Symbol.iterator in Object(V))return Z(V,H);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function Z(V,H){for(var U=0;U<H.length;U++){var D=H[U];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(V,D.key,D)}}return function(V,H,U){return H&&Z(V.prototype,H),U&&Z(V,U),V}}(),u=a(2),c=C(u),h=a(20),p=C(h),v=a(0),f=C(v),_=a(13),E=C(_),w=a(24),x=C(w),y=a(4),g=C(y),S=a(16),b=C(S),R=a(21),L=C(R),T=a(11),F=C(T),I=a(3),O=C(I);function C(Z){return Z&&Z.__esModule?Z:{default:Z}}function A(Z,V,H){return V in Z?Object.defineProperty(Z,V,{value:H,enumerable:!0,configurable:!0,writable:!0}):Z[V]=H,Z}function j(Z,V){if(!(Z instanceof V))throw new TypeError("Cannot call a class as a function")}var N=/^[ -~]*$/,B=function(){function Z(V){j(this,Z),this.scroll=V,this.delta=this.getDelta()}return s(Z,[{key:"applyDelta",value:function(H){var U=this,D=!1;this.scroll.update();var $=this.scroll.length();return this.scroll.batchStart(),H=Y(H),H.reduce(function(Q,ee){var te=ee.retain||ee.delete||ee.insert.length||1,ae=ee.attributes||{};if(ee.insert!=null){if(typeof ee.insert=="string"){var se=ee.insert;se.endsWith(`
|
|
127
|
-
`)&&D&&(D=!1,se=se.slice(0,-1)),Q>=$&&!se.endsWith(`
|
|
128
|
-
`)&&(D=!0),U.scroll.insertAt(Q,se);var ce=U.scroll.line(Q),me=o(ce,2),_e=me[0],Le=me[1],Re=(0,O.default)({},(0,y.bubbleFormats)(_e));if(_e instanceof g.default){var Pe=_e.descendant(f.default.Leaf,Le),ve=o(Pe,1),it=ve[0];Re=(0,O.default)(Re,(0,y.bubbleFormats)(it))}ae=p.default.attributes.diff(Re,ae)||{}}else if(i(ee.insert)==="object"){var Se=Object.keys(ee.insert)[0];if(Se==null)return Q;U.scroll.insertAt(Q,Se,ee.insert[Se])}$+=te}return Object.keys(ae).forEach(function(be){U.scroll.formatAt(Q,te,be,ae[be])}),Q+te},0),H.reduce(function(Q,ee){return typeof ee.delete=="number"?(U.scroll.deleteAt(Q,ee.delete),Q):Q+(ee.retain||ee.insert.length||1)},0),this.scroll.batchEnd(),this.update(H)}},{key:"deleteText",value:function(H,U){return this.scroll.deleteAt(H,U),this.update(new c.default().retain(H).delete(U))}},{key:"formatLine",value:function(H,U){var D=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys($).forEach(function(Q){if(!(D.scroll.whitelist!=null&&!D.scroll.whitelist[Q])){var ee=D.scroll.lines(H,Math.max(U,1)),te=U;ee.forEach(function(ae){var se=ae.length();if(!(ae instanceof E.default))ae.format(Q,$[Q]);else{var ce=H-ae.offset(D.scroll),me=ae.newlineIndex(ce+te)-ce+1;ae.formatAt(ce,me,Q,$[Q])}te-=se})}}),this.scroll.optimize(),this.update(new c.default().retain(H).retain(U,(0,L.default)($)))}},{key:"formatText",value:function(H,U){var D=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys($).forEach(function(Q){D.scroll.formatAt(H,U,Q,$[Q])}),this.update(new c.default().retain(H).retain(U,(0,L.default)($)))}},{key:"getContents",value:function(H,U){return this.delta.slice(H,H+U)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(H,U){return H.concat(U.delta())},new c.default)}},{key:"getFormat",value:function(H){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,D=[],$=[];U===0?this.scroll.path(H).forEach(function(ee){var te=o(ee,1),ae=te[0];ae instanceof g.default?D.push(ae):ae instanceof f.default.Leaf&&$.push(ae)}):(D=this.scroll.lines(H,U),$=this.scroll.descendants(f.default.Leaf,H,U));var Q=[D,$].map(function(ee){if(ee.length===0)return{};for(var te=(0,y.bubbleFormats)(ee.shift());Object.keys(te).length>0;){var ae=ee.shift();if(ae==null)return te;te=W((0,y.bubbleFormats)(ae),te)}return te});return O.default.apply(O.default,Q)}},{key:"getText",value:function(H,U){return this.getContents(H,U).filter(function(D){return typeof D.insert=="string"}).map(function(D){return D.insert}).join("")}},{key:"insertEmbed",value:function(H,U,D){return this.scroll.insertAt(H,U,D),this.update(new c.default().retain(H).insert(A({},U,D)))}},{key:"insertText",value:function(H,U){var D=this,$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return U=U.replace(/\r\n/g,`
|
|
129
|
-
`).replace(/\r/g,`
|
|
130
|
-
`),this.scroll.insertAt(H,U),Object.keys($).forEach(function(Q){D.scroll.formatAt(H,U.length,Q,$[Q])}),this.update(new c.default().retain(H).insert(U,(0,L.default)($)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var H=this.scroll.children.head;return H.statics.blotName!==g.default.blotName||H.children.length>1?!1:H.children.head instanceof b.default}},{key:"removeFormat",value:function(H,U){var D=this.getText(H,U),$=this.scroll.line(H+U),Q=o($,2),ee=Q[0],te=Q[1],ae=0,se=new c.default;ee!=null&&(ee instanceof E.default?ae=ee.newlineIndex(te)-te+1:ae=ee.length()-te,se=ee.delta().slice(te,te+ae-1).insert(`
|
|
131
|
-
`));var ce=this.getContents(H,U+ae),me=ce.diff(new c.default().insert(D).concat(se)),_e=new c.default().retain(H).concat(me);return this.applyDelta(_e)}},{key:"update",value:function(H){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,$=this.delta;if(U.length===1&&U[0].type==="characterData"&&U[0].target.data.match(N)&&f.default.find(U[0].target)){var Q=f.default.find(U[0].target),ee=(0,y.bubbleFormats)(Q),te=Q.offset(this.scroll),ae=U[0].oldValue.replace(x.default.CONTENTS,""),se=new c.default().insert(ae),ce=new c.default().insert(Q.value()),me=new c.default().retain(te).concat(se.diff(ce,D));H=me.reduce(function(_e,Le){return Le.insert?_e.insert(Le.insert,ee):_e.push(Le)},new c.default),this.delta=$.compose(H)}else this.delta=this.getDelta(),(!H||!(0,F.default)($.compose(H),this.delta))&&(H=$.diff(this.delta,D));return H}}]),Z}();function W(Z,V){return Object.keys(V).reduce(function(H,U){return Z[U]==null||(V[U]===Z[U]?H[U]=V[U]:Array.isArray(V[U])?V[U].indexOf(Z[U])<0&&(H[U]=V[U].concat([Z[U]])):H[U]=[V[U],Z[U]]),H},{})}function Y(Z){return Z.reduce(function(V,H){if(H.insert===1){var U=(0,L.default)(H.attributes);return delete U.image,V.insert({image:H.attributes.image},U)}if(H.attributes!=null&&(H.attributes.list===!0||H.attributes.bullet===!0)&&(H=(0,L.default)(H),H.attributes.list?H.attributes.list="ordered":(H.attributes.list="bullet",delete H.attributes.bullet)),typeof H.insert=="string"){var D=H.insert.replace(/\r\n/g,`
|
|
132
|
-
`).replace(/\r/g,`
|
|
133
|
-
`);return V.insert(D,H.attributes)}return V.push(H)},new c.default)}n.default=B},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var i=function(){function T(F,I){var O=[],C=!0,A=!1,j=void 0;try{for(var N=F[Symbol.iterator](),B;!(C=(B=N.next()).done)&&(O.push(B.value),!(I&&O.length===I));C=!0);}catch(W){A=!0,j=W}finally{try{!C&&N.return&&N.return()}finally{if(A)throw j}}return O}return function(F,I){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return T(F,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function T(F,I){for(var O=0;O<I.length;O++){var C=I[O];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(F,C.key,C)}}return function(F,I,O){return I&&T(F.prototype,I),O&&T(F,O),F}}(),s=a(0),u=x(s),c=a(21),h=x(c),p=a(11),v=x(p),f=a(8),_=x(f),E=a(10),w=x(E);function x(T){return T&&T.__esModule?T:{default:T}}function y(T){if(Array.isArray(T)){for(var F=0,I=Array(T.length);F<T.length;F++)I[F]=T[F];return I}else return Array.from(T)}function g(T,F){if(!(T instanceof F))throw new TypeError("Cannot call a class as a function")}var S=(0,w.default)("quill:selection"),b=function T(F){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;g(this,T),this.index=F,this.length=I},R=function(){function T(F,I){var O=this;g(this,T),this.emitter=I,this.scroll=F,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=u.default.create("cursor",this),this.lastRange=this.savedRange=new b(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){O.mouseDown||setTimeout(O.update.bind(O,_.default.sources.USER),1)}),this.emitter.on(_.default.events.EDITOR_CHANGE,function(C,A){C===_.default.events.TEXT_CHANGE&&A.length()>0&&O.update(_.default.sources.SILENT)}),this.emitter.on(_.default.events.SCROLL_BEFORE_UPDATE,function(){if(O.hasFocus()){var C=O.getNativeRange();C!=null&&C.start.node!==O.cursor.textNode&&O.emitter.once(_.default.events.SCROLL_UPDATE,function(){try{O.setNativeRange(C.start.node,C.start.offset,C.end.node,C.end.offset)}catch{}})}}),this.emitter.on(_.default.events.SCROLL_OPTIMIZE,function(C,A){if(A.range){var j=A.range,N=j.startNode,B=j.startOffset,W=j.endNode,Y=j.endOffset;O.setNativeRange(N,B,W,Y)}}),this.update(_.default.sources.SILENT)}return o(T,[{key:"handleComposition",value:function(){var I=this;this.root.addEventListener("compositionstart",function(){I.composing=!0}),this.root.addEventListener("compositionend",function(){if(I.composing=!1,I.cursor.parent){var O=I.cursor.restore();if(!O)return;setTimeout(function(){I.setNativeRange(O.startNode,O.startOffset,O.endNode,O.endOffset)},1)}})}},{key:"handleDragging",value:function(){var I=this;this.emitter.listenDOM("mousedown",document.body,function(){I.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){I.mouseDown=!1,I.update(_.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(I,O){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[I])){this.scroll.update();var C=this.getNativeRange();if(!(C==null||!C.native.collapsed||u.default.query(I,u.default.Scope.BLOCK))){if(C.start.node!==this.cursor.textNode){var A=u.default.find(C.start.node,!1);if(A==null)return;if(A instanceof u.default.Leaf){var j=A.split(C.start.offset);A.parent.insertBefore(this.cursor,j)}else A.insertBefore(this.cursor,C.start.node);this.cursor.attach()}this.cursor.format(I,O),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(I){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,C=this.scroll.length();I=Math.min(I,C-1),O=Math.min(I+O,C-1)-I;var A=void 0,j=this.scroll.leaf(I),N=i(j,2),B=N[0],W=N[1];if(B==null)return null;var Y=B.position(W,!0),Z=i(Y,2);A=Z[0],W=Z[1];var V=document.createRange();if(O>0){V.setStart(A,W);var H=this.scroll.leaf(I+O),U=i(H,2);if(B=U[0],W=U[1],B==null)return null;var D=B.position(W,!0),$=i(D,2);return A=$[0],W=$[1],V.setEnd(A,W),V.getBoundingClientRect()}else{var Q="left",ee=void 0;return A instanceof Text?(W<A.data.length?(V.setStart(A,W),V.setEnd(A,W+1)):(V.setStart(A,W-1),V.setEnd(A,W),Q="right"),ee=V.getBoundingClientRect()):(ee=B.domNode.getBoundingClientRect(),W>0&&(Q="right")),{bottom:ee.top+ee.height,height:ee.height,left:ee[Q],right:ee[Q],top:ee.top,width:0}}}},{key:"getNativeRange",value:function(){var I=document.getSelection();if(I==null||I.rangeCount<=0)return null;var O=I.getRangeAt(0);if(O==null)return null;var C=this.normalizeNative(O);return S.info("getNativeRange",C),C}},{key:"getRange",value:function(){var I=this.getNativeRange();if(I==null)return[null,null];var O=this.normalizedToRange(I);return[O,I]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(I){var O=this,C=[[I.start.node,I.start.offset]];I.native.collapsed||C.push([I.end.node,I.end.offset]);var A=C.map(function(B){var W=i(B,2),Y=W[0],Z=W[1],V=u.default.find(Y,!0),H=V.offset(O.scroll);return Z===0?H:V instanceof u.default.Container?H+V.length():H+V.index(Y,Z)}),j=Math.min(Math.max.apply(Math,y(A)),this.scroll.length()-1),N=Math.min.apply(Math,[j].concat(y(A)));return new b(N,j-N)}},{key:"normalizeNative",value:function(I){if(!L(this.root,I.startContainer)||!I.collapsed&&!L(this.root,I.endContainer))return null;var O={start:{node:I.startContainer,offset:I.startOffset},end:{node:I.endContainer,offset:I.endOffset},native:I};return[O.start,O.end].forEach(function(C){for(var A=C.node,j=C.offset;!(A instanceof Text)&&A.childNodes.length>0;)if(A.childNodes.length>j)A=A.childNodes[j],j=0;else if(A.childNodes.length===j)A=A.lastChild,j=A instanceof Text?A.data.length:A.childNodes.length+1;else break;C.node=A,C.offset=j}),O}},{key:"rangeToNative",value:function(I){var O=this,C=I.collapsed?[I.index]:[I.index,I.index+I.length],A=[],j=this.scroll.length();return C.forEach(function(N,B){N=Math.min(j-1,N);var W=void 0,Y=O.scroll.leaf(N),Z=i(Y,2),V=Z[0],H=Z[1],U=V.position(H,B!==0),D=i(U,2);W=D[0],H=D[1],A.push(W,H)}),A.length<2&&(A=A.concat(A)),A}},{key:"scrollIntoView",value:function(I){var O=this.lastRange;if(O!=null){var C=this.getBounds(O.index,O.length);if(C!=null){var A=this.scroll.length()-1,j=this.scroll.line(Math.min(O.index,A)),N=i(j,1),B=N[0],W=B;if(O.length>0){var Y=this.scroll.line(Math.min(O.index+O.length,A)),Z=i(Y,1);W=Z[0]}if(!(B==null||W==null)){var V=I.getBoundingClientRect();C.top<V.top?I.scrollTop-=V.top-C.top:C.bottom>V.bottom&&(I.scrollTop+=C.bottom-V.bottom)}}}}},{key:"setNativeRange",value:function(I,O){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:I,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:O,j=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(S.info("setNativeRange",I,O,C,A),!(I!=null&&(this.root.parentNode==null||I.parentNode==null||C.parentNode==null))){var N=document.getSelection();if(N!=null)if(I!=null){this.hasFocus()||this.root.focus();var B=(this.getNativeRange()||{}).native;if(B==null||j||I!==B.startContainer||O!==B.startOffset||C!==B.endContainer||A!==B.endOffset){I.tagName=="BR"&&(O=[].indexOf.call(I.parentNode.childNodes,I),I=I.parentNode),C.tagName=="BR"&&(A=[].indexOf.call(C.parentNode.childNodes,C),C=C.parentNode);var W=document.createRange();W.setStart(I,O),W.setEnd(C,A),N.removeAllRanges(),N.addRange(W)}}else N.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(I){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_.default.sources.API;if(typeof O=="string"&&(C=O,O=!1),S.info("setRange",I),I!=null){var A=this.rangeToNative(I);this.setNativeRange.apply(this,y(A).concat([O]))}else this.setNativeRange(null);this.update(C)}},{key:"update",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_.default.sources.USER,O=this.lastRange,C=this.getRange(),A=i(C,2),j=A[0],N=A[1];if(this.lastRange=j,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,v.default)(O,this.lastRange)){var B;!this.composing&&N!=null&&N.native.collapsed&&N.start.node!==this.cursor.textNode&&this.cursor.restore();var W=[_.default.events.SELECTION_CHANGE,(0,h.default)(this.lastRange),(0,h.default)(O),I];if((B=this.emitter).emit.apply(B,[_.default.events.EDITOR_CHANGE].concat(W)),I!==_.default.sources.SILENT){var Y;(Y=this.emitter).emit.apply(Y,W)}}}}]),T}();function L(T,F){try{F.parentNode}catch{return!1}return F instanceof Text&&(F=F.parentNode),T.contains(F)}n.Range=b,n.default=R},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function _(E,w){for(var x=0;x<w.length;x++){var y=w[x];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(E,y.key,y)}}return function(E,w,x){return w&&_(E.prototype,w),x&&_(E,x),E}}(),o=function _(E,w,x){E===null&&(E=Function.prototype);var y=Object.getOwnPropertyDescriptor(E,w);if(y===void 0){var g=Object.getPrototypeOf(E);return g===null?void 0:_(g,w,x)}else{if("value"in y)return y.value;var S=y.get;return S===void 0?void 0:S.call(x)}},s=a(0),u=c(s);function c(_){return _&&_.__esModule?_:{default:_}}function h(_,E){if(!(_ instanceof E))throw new TypeError("Cannot call a class as a function")}function p(_,E){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:_}function v(_,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);_.prototype=Object.create(E&&E.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(_,E):_.__proto__=E)}var f=function(_){v(E,_);function E(){return h(this,E),p(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return i(E,[{key:"insertInto",value:function(x,y){x.children.length===0?o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"insertInto",this).call(this,x,y):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),E}(u.default.Embed);f.blotName="break",f.tagName="BR",n.default=f},function(t,n,a){var i=this&&this.__extends||function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,f){v.__proto__=f}||function(v,f){for(var _ in f)f.hasOwnProperty(_)&&(v[_]=f[_])};return function(v,f){p(v,f);function _(){this.constructor=v}v.prototype=f===null?Object.create(f):(_.prototype=f.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(44),s=a(30),u=a(1),c=function(p){i(v,p);function v(f){var _=p.call(this,f)||this;return _.build(),_}return v.prototype.appendChild=function(f){this.insertBefore(f)},v.prototype.attach=function(){p.prototype.attach.call(this),this.children.forEach(function(f){f.attach()})},v.prototype.build=function(){var f=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(_){try{var E=h(_);f.insertBefore(E,f.children.head||void 0)}catch(w){if(w instanceof u.ParchmentError)return;throw w}})},v.prototype.deleteAt=function(f,_){if(f===0&&_===this.length())return this.remove();this.children.forEachAt(f,_,function(E,w,x){E.deleteAt(w,x)})},v.prototype.descendant=function(f,_){var E=this.children.find(_),w=E[0],x=E[1];return f.blotName==null&&f(w)||f.blotName!=null&&w instanceof f?[w,x]:w instanceof v?w.descendant(f,x):[null,-1]},v.prototype.descendants=function(f,_,E){_===void 0&&(_=0),E===void 0&&(E=Number.MAX_VALUE);var w=[],x=E;return this.children.forEachAt(_,E,function(y,g,S){(f.blotName==null&&f(y)||f.blotName!=null&&y instanceof f)&&w.push(y),y instanceof v&&(w=w.concat(y.descendants(f,g,x))),x-=S}),w},v.prototype.detach=function(){this.children.forEach(function(f){f.detach()}),p.prototype.detach.call(this)},v.prototype.formatAt=function(f,_,E,w){this.children.forEachAt(f,_,function(x,y,g){x.formatAt(y,g,E,w)})},v.prototype.insertAt=function(f,_,E){var w=this.children.find(f),x=w[0],y=w[1];if(x)x.insertAt(y,_,E);else{var g=E==null?u.create("text",_):u.create(_,E);this.appendChild(g)}},v.prototype.insertBefore=function(f,_){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(E){return f instanceof E}))throw new u.ParchmentError("Cannot insert "+f.statics.blotName+" into "+this.statics.blotName);f.insertInto(this,_)},v.prototype.length=function(){return this.children.reduce(function(f,_){return f+_.length()},0)},v.prototype.moveChildren=function(f,_){this.children.forEach(function(E){f.insertBefore(E,_)})},v.prototype.optimize=function(f){if(p.prototype.optimize.call(this,f),this.children.length===0)if(this.statics.defaultChild!=null){var _=u.create(this.statics.defaultChild);this.appendChild(_),_.optimize(f)}else this.remove()},v.prototype.path=function(f,_){_===void 0&&(_=!1);var E=this.children.find(f,_),w=E[0],x=E[1],y=[[this,f]];return w instanceof v?y.concat(w.path(x,_)):(w!=null&&y.push([w,x]),y)},v.prototype.removeChild=function(f){this.children.remove(f)},v.prototype.replace=function(f){f instanceof v&&f.moveChildren(this),p.prototype.replace.call(this,f)},v.prototype.split=function(f,_){if(_===void 0&&(_=!1),!_){if(f===0)return this;if(f===this.length())return this.next}var E=this.clone();return this.parent.insertBefore(E,this.next),this.children.forEachAt(f,this.length(),function(w,x,y){w=w.split(x,_),E.appendChild(w)}),E},v.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},v.prototype.update=function(f,_){var E=this,w=[],x=[];f.forEach(function(y){y.target===E.domNode&&y.type==="childList"&&(w.push.apply(w,y.addedNodes),x.push.apply(x,y.removedNodes))}),x.forEach(function(y){if(!(y.parentNode!=null&&y.tagName!=="IFRAME"&&document.body.compareDocumentPosition(y)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var g=u.find(y);g!=null&&(g.domNode.parentNode==null||g.domNode.parentNode===E.domNode)&&g.detach()}}),w.filter(function(y){return y.parentNode==E.domNode}).sort(function(y,g){return y===g?0:y.compareDocumentPosition(g)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(y){var g=null;y.nextSibling!=null&&(g=u.find(y.nextSibling));var S=h(y);(S.next!=g||S.next==null)&&(S.parent!=null&&S.parent.removeChild(E),E.insertBefore(S,g||void 0))})},v}(s.default);function h(p){var v=u.find(p);if(v==null)try{v=u.create(p)}catch{v=u.create(u.Scope.INLINE),[].slice.call(p.childNodes).forEach(function(_){v.domNode.appendChild(_)}),p.parentNode&&p.parentNode.replaceChild(v.domNode,p),v.attach()}return v}n.default=c},function(t,n,a){var i=this&&this.__extends||function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,f){v.__proto__=f}||function(v,f){for(var _ in f)f.hasOwnProperty(_)&&(v[_]=f[_])};return function(v,f){p(v,f);function _(){this.constructor=v}v.prototype=f===null?Object.create(f):(_.prototype=f.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(12),s=a(31),u=a(17),c=a(1),h=function(p){i(v,p);function v(f){var _=p.call(this,f)||this;return _.attributes=new s.default(_.domNode),_}return v.formats=function(f){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return f.tagName.toLowerCase()},v.prototype.format=function(f,_){var E=c.query(f);E instanceof o.default?this.attributes.attribute(E,_):_&&E!=null&&(f!==this.statics.blotName||this.formats()[f]!==_)&&this.replaceWith(f,_)},v.prototype.formats=function(){var f=this.attributes.values(),_=this.statics.formats(this.domNode);return _!=null&&(f[this.statics.blotName]=_),f},v.prototype.replaceWith=function(f,_){var E=p.prototype.replaceWith.call(this,f,_);return this.attributes.copy(E),E},v.prototype.update=function(f,_){var E=this;p.prototype.update.call(this,f,_),f.some(function(w){return w.target===E.domNode&&w.type==="attributes"})&&this.attributes.build()},v.prototype.wrap=function(f,_){var E=p.prototype.wrap.call(this,f,_);return E instanceof v&&E.statics.scope===this.statics.scope&&this.attributes.move(E),E},v}(u.default);n.default=h},function(t,n,a){var i=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,p){h.__proto__=p}||function(h,p){for(var v in p)p.hasOwnProperty(v)&&(h[v]=p[v])};return function(h,p){c(h,p);function v(){this.constructor=h}h.prototype=p===null?Object.create(p):(v.prototype=p.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(30),s=a(1),u=function(c){i(h,c);function h(){return c!==null&&c.apply(this,arguments)||this}return h.value=function(p){return!0},h.prototype.index=function(p,v){return this.domNode===p||this.domNode.compareDocumentPosition(p)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(v,1):-1},h.prototype.position=function(p,v){var f=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return p>0&&(f+=1),[this.parent.domNode,f]},h.prototype.value=function(){var p;return p={},p[this.statics.blotName]=this.statics.value(this.domNode)||!0,p},h.scope=s.Scope.INLINE_BLOT,h}(o.default);n.default=u},function(t,n,a){var i=a(11),o=a(3),s={attributes:{compose:function(c,h,p){typeof c!="object"&&(c={}),typeof h!="object"&&(h={});var v=o(!0,{},h);p||(v=Object.keys(v).reduce(function(_,E){return v[E]!=null&&(_[E]=v[E]),_},{}));for(var f in c)c[f]!==void 0&&h[f]===void 0&&(v[f]=c[f]);return Object.keys(v).length>0?v:void 0},diff:function(c,h){typeof c!="object"&&(c={}),typeof h!="object"&&(h={});var p=Object.keys(c).concat(Object.keys(h)).reduce(function(v,f){return i(c[f],h[f])||(v[f]=h[f]===void 0?null:h[f]),v},{});return Object.keys(p).length>0?p:void 0},transform:function(c,h,p){if(typeof c!="object")return h;if(typeof h=="object"){if(!p)return h;var v=Object.keys(h).reduce(function(f,_){return c[_]===void 0&&(f[_]=h[_]),f},{});return Object.keys(v).length>0?v:void 0}}},iterator:function(c){return new u(c)},length:function(c){return typeof c.delete=="number"?c.delete:typeof c.retain=="number"?c.retain:typeof c.insert=="string"?c.insert.length:1}};function u(c){this.ops=c,this.index=0,this.offset=0}u.prototype.hasNext=function(){return this.peekLength()<1/0},u.prototype.next=function(c){c||(c=1/0);var h=this.ops[this.index];if(h){var p=this.offset,v=s.length(h);if(c>=v-p?(c=v-p,this.index+=1,this.offset=0):this.offset+=c,typeof h.delete=="number")return{delete:c};var f={};return h.attributes&&(f.attributes=h.attributes),typeof h.retain=="number"?f.retain=c:typeof h.insert=="string"?f.insert=h.insert.substr(p,c):f.insert=h.insert,f}else return{retain:1/0}},u.prototype.peek=function(){return this.ops[this.index]},u.prototype.peekLength=function(){return this.ops[this.index]?s.length(this.ops[this.index])-this.offset:1/0},u.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},u.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var c=this.offset,h=this.index,p=this.next(),v=this.ops.slice(this.index);return this.offset=c,this.index=h,[p].concat(v)}else return[]},t.exports=s},function(t,n){var a=function(){function i(E,w){return w!=null&&E instanceof w}var o;try{o=Map}catch{o=function(){}}var s;try{s=Set}catch{s=function(){}}var u;try{u=Promise}catch{u=function(){}}function c(E,w,x,y,g){typeof w=="object"&&(x=w.depth,y=w.prototype,g=w.includeNonEnumerable,w=w.circular);var S=[],b=[],R=typeof Buffer<"u";typeof w>"u"&&(w=!0),typeof x>"u"&&(x=1/0);function L(T,F){if(T===null)return null;if(F===0)return T;var I,O;if(typeof T!="object")return T;if(i(T,o))I=new o;else if(i(T,s))I=new s;else if(i(T,u))I=new u(function(V,H){T.then(function(U){V(L(U,F-1))},function(U){H(L(U,F-1))})});else if(c.__isArray(T))I=[];else if(c.__isRegExp(T))I=new RegExp(T.source,_(T)),T.lastIndex&&(I.lastIndex=T.lastIndex);else if(c.__isDate(T))I=new Date(T.getTime());else{if(R&&Buffer.isBuffer(T))return Buffer.allocUnsafe?I=Buffer.allocUnsafe(T.length):I=new Buffer(T.length),T.copy(I),I;i(T,Error)?I=Object.create(T):typeof y>"u"?(O=Object.getPrototypeOf(T),I=Object.create(O)):(I=Object.create(y),O=y)}if(w){var C=S.indexOf(T);if(C!=-1)return b[C];S.push(T),b.push(I)}i(T,o)&&T.forEach(function(V,H){var U=L(H,F-1),D=L(V,F-1);I.set(U,D)}),i(T,s)&&T.forEach(function(V){var H=L(V,F-1);I.add(H)});for(var A in T){var j;O&&(j=Object.getOwnPropertyDescriptor(O,A)),!(j&&j.set==null)&&(I[A]=L(T[A],F-1))}if(Object.getOwnPropertySymbols)for(var N=Object.getOwnPropertySymbols(T),A=0;A<N.length;A++){var B=N[A],W=Object.getOwnPropertyDescriptor(T,B);W&&!W.enumerable&&!g||(I[B]=L(T[B],F-1),W.enumerable||Object.defineProperty(I,B,{enumerable:!1}))}if(g)for(var Y=Object.getOwnPropertyNames(T),A=0;A<Y.length;A++){var Z=Y[A],W=Object.getOwnPropertyDescriptor(T,Z);W&&W.enumerable||(I[Z]=L(T[Z],F-1),Object.defineProperty(I,Z,{enumerable:!1}))}return I}return L(E,x)}c.clonePrototype=function(w){if(w===null)return null;var x=function(){};return x.prototype=w,new x};function h(E){return Object.prototype.toString.call(E)}c.__objToStr=h;function p(E){return typeof E=="object"&&h(E)==="[object Date]"}c.__isDate=p;function v(E){return typeof E=="object"&&h(E)==="[object Array]"}c.__isArray=v;function f(E){return typeof E=="object"&&h(E)==="[object RegExp]"}c.__isRegExp=f;function _(E){var w="";return E.global&&(w+="g"),E.ignoreCase&&(w+="i"),E.multiline&&(w+="m"),w}return c.__getRegExpFlags=_,c}();typeof t=="object"&&t.exports&&(t.exports=a)},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function I(O,C){var A=[],j=!0,N=!1,B=void 0;try{for(var W=O[Symbol.iterator](),Y;!(j=(Y=W.next()).done)&&(A.push(Y.value),!(C&&A.length===C));j=!0);}catch(Z){N=!0,B=Z}finally{try{!j&&W.return&&W.return()}finally{if(N)throw B}}return A}return function(O,C){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return I(O,C);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function I(O,C){for(var A=0;A<C.length;A++){var j=C[A];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(O,j.key,j)}}return function(O,C,A){return C&&I(O.prototype,C),A&&I(O,A),O}}(),s=function I(O,C,A){O===null&&(O=Function.prototype);var j=Object.getOwnPropertyDescriptor(O,C);if(j===void 0){var N=Object.getPrototypeOf(O);return N===null?void 0:I(N,C,A)}else{if("value"in j)return j.value;var B=j.get;return B===void 0?void 0:B.call(A)}},u=a(0),c=S(u),h=a(8),p=S(h),v=a(4),f=S(v),_=a(16),E=S(_),w=a(13),x=S(w),y=a(25),g=S(y);function S(I){return I&&I.__esModule?I:{default:I}}function b(I,O){if(!(I instanceof O))throw new TypeError("Cannot call a class as a function")}function R(I,O){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:I}function L(I,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);I.prototype=Object.create(O&&O.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(I,O):I.__proto__=O)}function T(I){return I instanceof f.default||I instanceof v.BlockEmbed}var F=function(I){L(O,I);function O(C,A){b(this,O);var j=R(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,C));return j.emitter=A.emitter,Array.isArray(A.whitelist)&&(j.whitelist=A.whitelist.reduce(function(N,B){return N[B]=!0,N},{})),j.domNode.addEventListener("DOMNodeInserted",function(){}),j.optimize(),j.enable(),j}return o(O,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(A,j){var N=this.line(A),B=i(N,2),W=B[0],Y=B[1],Z=this.line(A+j),V=i(Z,1),H=V[0];if(s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"deleteAt",this).call(this,A,j),H!=null&&W!==H&&Y>0){if(W instanceof v.BlockEmbed||H instanceof v.BlockEmbed){this.optimize();return}if(W instanceof x.default){var U=W.newlineIndex(W.length(),!0);if(U>-1&&(W=W.split(U+1),W===H)){this.optimize();return}}else if(H instanceof x.default){var D=H.newlineIndex(0);D>-1&&H.split(D+1)}var $=H.children.head instanceof E.default?null:H.children.head;W.moveChildren(H,$),W.remove()}this.optimize()}},{key:"enable",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",A)}},{key:"formatAt",value:function(A,j,N,B){this.whitelist!=null&&!this.whitelist[N]||(s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"formatAt",this).call(this,A,j,N,B),this.optimize())}},{key:"insertAt",value:function(A,j,N){if(!(N!=null&&this.whitelist!=null&&!this.whitelist[j])){if(A>=this.length())if(N==null||c.default.query(j,c.default.Scope.BLOCK)==null){var B=c.default.create(this.statics.defaultChild);this.appendChild(B),N==null&&j.endsWith(`
|
|
134
|
-
`)&&(j=j.slice(0,-1)),B.insertAt(0,j,N)}else{var W=c.default.create(j,N);this.appendChild(W)}else s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,A,j,N);this.optimize()}}},{key:"insertBefore",value:function(A,j){if(A.statics.scope===c.default.Scope.INLINE_BLOT){var N=c.default.create(this.statics.defaultChild);N.appendChild(A),A=N}s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertBefore",this).call(this,A,j)}},{key:"leaf",value:function(A){return this.path(A).pop()||[null,-1]}},{key:"line",value:function(A){return A===this.length()?this.line(A-1):this.descendant(T,A)}},{key:"lines",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,N=function B(W,Y,Z){var V=[],H=Z;return W.children.forEachAt(Y,Z,function(U,D,$){T(U)?V.push(U):U instanceof c.default.Container&&(V=V.concat(B(U,D,H))),H-=$}),V};return N(this,A,j)}},{key:"optimize",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,A,j),A.length>0&&this.emitter.emit(p.default.events.SCROLL_OPTIMIZE,A,j))}},{key:"path",value:function(A){return s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"path",this).call(this,A).slice(1)}},{key:"update",value:function(A){if(this.batch!==!0){var j=p.default.sources.USER;typeof A=="string"&&(j=A),Array.isArray(A)||(A=this.observer.takeRecords()),A.length>0&&this.emitter.emit(p.default.events.SCROLL_BEFORE_UPDATE,j,A),s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"update",this).call(this,A.concat([])),A.length>0&&this.emitter.emit(p.default.events.SCROLL_UPDATE,j,A)}}}]),O}(c.default.Scroll);F.blotName="scroll",F.className="ql-editor",F.tagName="DIV",F.defaultChild="block",F.allowedChildren=[f.default,v.BlockEmbed,g.default],n.default=F},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ee){return typeof ee}:function(ee){return ee&&typeof Symbol=="function"&&ee.constructor===Symbol&&ee!==Symbol.prototype?"symbol":typeof ee},o=function(){function ee(te,ae){var se=[],ce=!0,me=!1,_e=void 0;try{for(var Le=te[Symbol.iterator](),Re;!(ce=(Re=Le.next()).done)&&(se.push(Re.value),!(ae&&se.length===ae));ce=!0);}catch(Pe){me=!0,_e=Pe}finally{try{!ce&&Le.return&&Le.return()}finally{if(me)throw _e}}return se}return function(te,ae){if(Array.isArray(te))return te;if(Symbol.iterator in Object(te))return ee(te,ae);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function ee(te,ae){for(var se=0;se<ae.length;se++){var ce=ae[se];ce.enumerable=ce.enumerable||!1,ce.configurable=!0,"value"in ce&&(ce.writable=!0),Object.defineProperty(te,ce.key,ce)}}return function(te,ae,se){return ae&&ee(te.prototype,ae),se&&ee(te,se),te}}(),u=a(21),c=I(u),h=a(11),p=I(h),v=a(3),f=I(v),_=a(2),E=I(_),w=a(20),x=I(w),y=a(0),g=I(y),S=a(5),b=I(S),R=a(10),L=I(R),T=a(9),F=I(T);function I(ee){return ee&&ee.__esModule?ee:{default:ee}}function O(ee,te,ae){return te in ee?Object.defineProperty(ee,te,{value:ae,enumerable:!0,configurable:!0,writable:!0}):ee[te]=ae,ee}function C(ee,te){if(!(ee instanceof te))throw new TypeError("Cannot call a class as a function")}function A(ee,te){if(!ee)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return te&&(typeof te=="object"||typeof te=="function")?te:ee}function j(ee,te){if(typeof te!="function"&&te!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof te);ee.prototype=Object.create(te&&te.prototype,{constructor:{value:ee,enumerable:!1,writable:!0,configurable:!0}}),te&&(Object.setPrototypeOf?Object.setPrototypeOf(ee,te):ee.__proto__=te)}var N=(0,L.default)("quill:keyboard"),B=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",W=function(ee){j(te,ee),s(te,null,[{key:"match",value:function(se,ce){return ce=Q(ce),["altKey","ctrlKey","metaKey","shiftKey"].some(function(me){return!!ce[me]!==se[me]&&ce[me]!==null})?!1:ce.key===(se.which||se.keyCode)}}]);function te(ae,se){C(this,te);var ce=A(this,(te.__proto__||Object.getPrototypeOf(te)).call(this,ae,se));return ce.bindings={},Object.keys(ce.options.bindings).forEach(function(me){me==="list autofill"&&ae.scroll.whitelist!=null&&!ae.scroll.whitelist.list||ce.options.bindings[me]&&ce.addBinding(ce.options.bindings[me])}),ce.addBinding({key:te.keys.ENTER,shiftKey:null},U),ce.addBinding({key:te.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(ce.addBinding({key:te.keys.BACKSPACE},{collapsed:!0},Z),ce.addBinding({key:te.keys.DELETE},{collapsed:!0},V)):(ce.addBinding({key:te.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},Z),ce.addBinding({key:te.keys.DELETE},{collapsed:!0,suffix:/^.?$/},V)),ce.addBinding({key:te.keys.BACKSPACE},{collapsed:!1},H),ce.addBinding({key:te.keys.DELETE},{collapsed:!1},H),ce.addBinding({key:te.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},Z),ce.listen(),ce}return s(te,[{key:"addBinding",value:function(se){var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},_e=Q(se);if(_e==null||_e.key==null)return N.warn("Attempted to add invalid keyboard binding",_e);typeof ce=="function"&&(ce={handler:ce}),typeof me=="function"&&(me={handler:me}),_e=(0,f.default)(_e,ce,me),this.bindings[_e.key]=this.bindings[_e.key]||[],this.bindings[_e.key].push(_e)}},{key:"listen",value:function(){var se=this;this.quill.root.addEventListener("keydown",function(ce){if(!ce.defaultPrevented){var me=ce.which||ce.keyCode,_e=(se.bindings[me]||[]).filter(function(Ze){return te.match(ce,Ze)});if(_e.length!==0){var Le=se.quill.getSelection();if(!(Le==null||!se.quill.hasFocus())){var Re=se.quill.getLine(Le.index),Pe=o(Re,2),ve=Pe[0],it=Pe[1],Se=se.quill.getLeaf(Le.index),be=o(Se,2),Ae=be[0],Te=be[1],he=Le.length===0?[Ae,Te]:se.quill.getLeaf(Le.index+Le.length),Oe=o(he,2),Me=Oe[0],ze=Oe[1],pt=Ae instanceof g.default.Text?Ae.value().slice(0,Te):"",yt=Me instanceof g.default.Text?Me.value().slice(ze):"",He={collapsed:Le.length===0,empty:Le.length===0&&ve.length()<=1,format:se.quill.getFormat(Le),offset:it,prefix:pt,suffix:yt},Qe=_e.some(function(Ze){if(Ze.collapsed!=null&&Ze.collapsed!==He.collapsed||Ze.empty!=null&&Ze.empty!==He.empty||Ze.offset!=null&&Ze.offset!==He.offset)return!1;if(Array.isArray(Ze.format)){if(Ze.format.every(function(tt){return He.format[tt]==null}))return!1}else if(i(Ze.format)==="object"&&!Object.keys(Ze.format).every(function(tt){return Ze.format[tt]===!0?He.format[tt]!=null:Ze.format[tt]===!1?He.format[tt]==null:(0,p.default)(Ze.format[tt],He.format[tt])}))return!1;return Ze.prefix!=null&&!Ze.prefix.test(He.prefix)||Ze.suffix!=null&&!Ze.suffix.test(He.suffix)?!1:Ze.handler.call(se,Le,He)!==!0});Qe&&ce.preventDefault()}}}})}}]),te}(F.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:$("bold"),italic:$("italic"),underline:$("underline"),indent:{key:W.keys.TAB,format:["blockquote","indent","list"],handler:function(te,ae){if(ae.collapsed&&ae.offset!==0)return!0;this.quill.format("indent","+1",b.default.sources.USER)}},outdent:{key:W.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(te,ae){if(ae.collapsed&&ae.offset!==0)return!0;this.quill.format("indent","-1",b.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(te,ae){ae.format.indent!=null?this.quill.format("indent","-1",b.default.sources.USER):ae.format.list!=null&&this.quill.format("list",!1,b.default.sources.USER)}},"indent code-block":D(!0),"outdent code-block":D(!1),"remove tab":{key:W.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(te){this.quill.deleteText(te.index-1,1,b.default.sources.USER)}},tab:{key:W.keys.TAB,handler:function(te){this.quill.history.cutoff();var ae=new E.default().retain(te.index).delete(te.length).insert(" ");this.quill.updateContents(ae,b.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(te.index+1,b.default.sources.SILENT)}},"list empty enter":{key:W.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(te,ae){this.quill.format("list",!1,b.default.sources.USER),ae.format.indent&&this.quill.format("indent",!1,b.default.sources.USER)}},"checklist enter":{key:W.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(te){var ae=this.quill.getLine(te.index),se=o(ae,2),ce=se[0],me=se[1],_e=(0,f.default)({},ce.formats(),{list:"checked"}),Le=new E.default().retain(te.index).insert(`
|
|
135
|
-
`,_e).retain(ce.length()-me-1).retain(1,{list:"unchecked"});this.quill.updateContents(Le,b.default.sources.USER),this.quill.setSelection(te.index+1,b.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:W.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(te,ae){var se=this.quill.getLine(te.index),ce=o(se,2),me=ce[0],_e=ce[1],Le=new E.default().retain(te.index).insert(`
|
|
136
|
-
`,ae.format).retain(me.length()-_e-1).retain(1,{header:null});this.quill.updateContents(Le,b.default.sources.USER),this.quill.setSelection(te.index+1,b.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(te,ae){var se=ae.prefix.length,ce=this.quill.getLine(te.index),me=o(ce,2),_e=me[0],Le=me[1];if(Le>se)return!0;var Re=void 0;switch(ae.prefix.trim()){case"[]":case"[ ]":Re="unchecked";break;case"[x]":Re="checked";break;case"-":case"*":Re="bullet";break;default:Re="ordered"}this.quill.insertText(te.index," ",b.default.sources.USER),this.quill.history.cutoff();var Pe=new E.default().retain(te.index-Le).delete(se+1).retain(_e.length()-2-Le).retain(1,{list:Re});this.quill.updateContents(Pe,b.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(te.index-se,b.default.sources.SILENT)}},"code exit":{key:W.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(te){var ae=this.quill.getLine(te.index),se=o(ae,2),ce=se[0],me=se[1],_e=new E.default().retain(te.index+ce.length()-me-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(_e,b.default.sources.USER)}},"embed left":Y(W.keys.LEFT,!1),"embed left shift":Y(W.keys.LEFT,!0),"embed right":Y(W.keys.RIGHT,!1),"embed right shift":Y(W.keys.RIGHT,!0)}};function Y(ee,te){var ae,se=ee===W.keys.LEFT?"prefix":"suffix";return ae={key:ee,shiftKey:te,altKey:null},O(ae,se,/^$/),O(ae,"handler",function(me){var _e=me.index;ee===W.keys.RIGHT&&(_e+=me.length+1);var Le=this.quill.getLeaf(_e),Re=o(Le,1),Pe=Re[0];return Pe instanceof g.default.Embed?(ee===W.keys.LEFT?te?this.quill.setSelection(me.index-1,me.length+1,b.default.sources.USER):this.quill.setSelection(me.index-1,b.default.sources.USER):te?this.quill.setSelection(me.index,me.length+1,b.default.sources.USER):this.quill.setSelection(me.index+me.length+1,b.default.sources.USER),!1):!0}),ae}function Z(ee,te){if(!(ee.index===0||this.quill.getLength()<=1)){var ae=this.quill.getLine(ee.index),se=o(ae,1),ce=se[0],me={};if(te.offset===0){var _e=this.quill.getLine(ee.index-1),Le=o(_e,1),Re=Le[0];if(Re!=null&&Re.length()>1){var Pe=ce.formats(),ve=this.quill.getFormat(ee.index-1,1);me=x.default.attributes.diff(Pe,ve)||{}}}var it=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(te.prefix)?2:1;this.quill.deleteText(ee.index-it,it,b.default.sources.USER),Object.keys(me).length>0&&this.quill.formatLine(ee.index-it,it,me,b.default.sources.USER),this.quill.focus()}}function V(ee,te){var ae=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(te.suffix)?2:1;if(!(ee.index>=this.quill.getLength()-ae)){var se={},ce=0,me=this.quill.getLine(ee.index),_e=o(me,1),Le=_e[0];if(te.offset>=Le.length()-1){var Re=this.quill.getLine(ee.index+1),Pe=o(Re,1),ve=Pe[0];if(ve){var it=Le.formats(),Se=this.quill.getFormat(ee.index,1);se=x.default.attributes.diff(it,Se)||{},ce=ve.length()}}this.quill.deleteText(ee.index,ae,b.default.sources.USER),Object.keys(se).length>0&&this.quill.formatLine(ee.index+ce-1,ae,se,b.default.sources.USER)}}function H(ee){var te=this.quill.getLines(ee),ae={};if(te.length>1){var se=te[0].formats(),ce=te[te.length-1].formats();ae=x.default.attributes.diff(ce,se)||{}}this.quill.deleteText(ee,b.default.sources.USER),Object.keys(ae).length>0&&this.quill.formatLine(ee.index,1,ae,b.default.sources.USER),this.quill.setSelection(ee.index,b.default.sources.SILENT),this.quill.focus()}function U(ee,te){var ae=this;ee.length>0&&this.quill.scroll.deleteAt(ee.index,ee.length);var se=Object.keys(te.format).reduce(function(ce,me){return g.default.query(me,g.default.Scope.BLOCK)&&!Array.isArray(te.format[me])&&(ce[me]=te.format[me]),ce},{});this.quill.insertText(ee.index,`
|
|
137
|
-
`,se,b.default.sources.USER),this.quill.setSelection(ee.index+1,b.default.sources.SILENT),this.quill.focus(),Object.keys(te.format).forEach(function(ce){se[ce]==null&&(Array.isArray(te.format[ce])||ce!=="link"&&ae.quill.format(ce,te.format[ce],b.default.sources.USER))})}function D(ee){return{key:W.keys.TAB,shiftKey:!ee,format:{"code-block":!0},handler:function(ae){var se=g.default.query("code-block"),ce=ae.index,me=ae.length,_e=this.quill.scroll.descendant(se,ce),Le=o(_e,2),Re=Le[0],Pe=Le[1];if(Re!=null){var ve=this.quill.getIndex(Re),it=Re.newlineIndex(Pe,!0)+1,Se=Re.newlineIndex(ve+Pe+me),be=Re.domNode.textContent.slice(it,Se).split(`
|
|
138
|
-
`);Pe=0,be.forEach(function(Ae,Te){ee?(Re.insertAt(it+Pe,se.TAB),Pe+=se.TAB.length,Te===0?ce+=se.TAB.length:me+=se.TAB.length):Ae.startsWith(se.TAB)&&(Re.deleteAt(it+Pe,se.TAB.length),Pe-=se.TAB.length,Te===0?ce-=se.TAB.length:me-=se.TAB.length),Pe+=Ae.length+1}),this.quill.update(b.default.sources.USER),this.quill.setSelection(ce,me,b.default.sources.SILENT)}}}}function $(ee){return{key:ee[0].toUpperCase(),shortKey:!0,handler:function(ae,se){this.quill.format(ee,!se.format[ee],b.default.sources.USER)}}}function Q(ee){if(typeof ee=="string"||typeof ee=="number")return Q({key:ee});if((typeof ee>"u"?"undefined":i(ee))==="object"&&(ee=(0,c.default)(ee,!1)),typeof ee.key=="string")if(W.keys[ee.key.toUpperCase()]!=null)ee.key=W.keys[ee.key.toUpperCase()];else if(ee.key.length===1)ee.key=ee.key.toUpperCase().charCodeAt(0);else return null;return ee.shortKey&&(ee[B]=ee.shortKey,delete ee.shortKey),ee}n.default=W,n.SHORTKEY=B},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function x(y,g){var S=[],b=!0,R=!1,L=void 0;try{for(var T=y[Symbol.iterator](),F;!(b=(F=T.next()).done)&&(S.push(F.value),!(g&&S.length===g));b=!0);}catch(I){R=!0,L=I}finally{try{!b&&T.return&&T.return()}finally{if(R)throw L}}return S}return function(y,g){if(Array.isArray(y))return y;if(Symbol.iterator in Object(y))return x(y,g);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function x(y,g,S){y===null&&(y=Function.prototype);var b=Object.getOwnPropertyDescriptor(y,g);if(b===void 0){var R=Object.getPrototypeOf(y);return R===null?void 0:x(R,g,S)}else{if("value"in b)return b.value;var L=b.get;return L===void 0?void 0:L.call(S)}},s=function(){function x(y,g){for(var S=0;S<g.length;S++){var b=g[S];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,g,S){return g&&x(y.prototype,g),S&&x(y,S),y}}(),u=a(0),c=v(u),h=a(7),p=v(h);function v(x){return x&&x.__esModule?x:{default:x}}function f(x,y){if(!(x instanceof y))throw new TypeError("Cannot call a class as a function")}function _(x,y){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:x}function E(x,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);x.prototype=Object.create(y&&y.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(x,y):x.__proto__=y)}var w=function(x){E(y,x),s(y,null,[{key:"value",value:function(){}}]);function y(g,S){f(this,y);var b=_(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,g));return b.selection=S,b.textNode=document.createTextNode(y.CONTENTS),b.domNode.appendChild(b.textNode),b._length=0,b}return s(y,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(S,b){if(this._length!==0)return o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,S,b);for(var R=this,L=0;R!=null&&R.statics.scope!==c.default.Scope.BLOCK_BLOT;)L+=R.offset(R.parent),R=R.parent;R!=null&&(this._length=y.CONTENTS.length,R.optimize(),R.formatAt(L,y.CONTENTS.length,S,b),this._length=0)}},{key:"index",value:function(S,b){return S===this.textNode?0:o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"index",this).call(this,S,b)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var S=this.textNode,b=this.selection.getNativeRange(),R=void 0,L=void 0,T=void 0;if(b!=null&&b.start.node===S&&b.end.node===S){var F=[S,b.start.offset,b.end.offset];R=F[0],L=F[1],T=F[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 I=this.textNode.data.split(y.CONTENTS).join("");this.next instanceof p.default?(R=this.next.domNode,this.next.insertAt(0,I),this.textNode.data=y.CONTENTS):(this.textNode.data=I,this.parent.insertBefore(c.default.create(this.textNode),this),this.textNode=document.createTextNode(y.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),L!=null){var O=[L,T].map(function(A){return Math.max(0,Math.min(R.data.length,A-1))}),C=i(O,2);return L=C[0],T=C[1],{startNode:R,startOffset:L,endNode:R,endOffset:T}}}}},{key:"update",value:function(S,b){var R=this;if(S.some(function(T){return T.type==="characterData"&&T.target===R.textNode})){var L=this.restore();L&&(b.range=L)}}},{key:"value",value:function(){return""}}]),y}(c.default.Embed);w.blotName="cursor",w.className="ql-cursor",w.tagName="span",w.CONTENTS="\uFEFF",n.default=w},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(0),o=c(i),s=a(4),u=c(s);function c(_){return _&&_.__esModule?_:{default:_}}function h(_,E){if(!(_ instanceof E))throw new TypeError("Cannot call a class as a function")}function p(_,E){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:_}function v(_,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);_.prototype=Object.create(E&&E.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(_,E):_.__proto__=E)}var f=function(_){v(E,_);function E(){return h(this,E),p(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return E}(o.default.Container);f.allowedChildren=[u.default,s.BlockEmbed,f],n.default=f},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var i=function(){function w(x,y){for(var g=0;g<y.length;g++){var S=y[g];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(x,S.key,S)}}return function(x,y,g){return y&&w(x.prototype,y),g&&w(x,g),x}}(),o=function w(x,y,g){x===null&&(x=Function.prototype);var S=Object.getOwnPropertyDescriptor(x,y);if(S===void 0){var b=Object.getPrototypeOf(x);return b===null?void 0:w(b,y,g)}else{if("value"in S)return S.value;var R=S.get;return R===void 0?void 0:R.call(g)}},s=a(0),u=c(s);function c(w){return w&&w.__esModule?w:{default:w}}function h(w,x){if(!(w instanceof x))throw new TypeError("Cannot call a class as a function")}function p(w,x){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:w}function v(w,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);w.prototype=Object.create(x&&x.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(w,x):w.__proto__=x)}var f=function(w){v(x,w);function x(){return h(this,x),p(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return i(x,[{key:"value",value:function(g){var S=o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"value",this).call(this,g);return S.startsWith("rgb(")?(S=S.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+S.split(",").map(function(b){return("00"+parseInt(b).toString(16)).slice(-2)}).join("")):S}}]),x}(u.default.Attributor.Style),_=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),E=new f("color","color",{scope:u.default.Scope.INLINE});n.ColorAttributor=f,n.ColorClass=_,n.ColorStyle=E},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var i=function(){function E(w,x){for(var y=0;y<x.length;y++){var g=x[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(w,g.key,g)}}return function(w,x,y){return x&&E(w.prototype,x),y&&E(w,y),w}}(),o=function E(w,x,y){w===null&&(w=Function.prototype);var g=Object.getOwnPropertyDescriptor(w,x);if(g===void 0){var S=Object.getPrototypeOf(w);return S===null?void 0:E(S,x,y)}else{if("value"in g)return g.value;var b=g.get;return b===void 0?void 0:b.call(y)}},s=a(6),u=c(s);function c(E){return E&&E.__esModule?E:{default:E}}function h(E,w){if(!(E instanceof w))throw new TypeError("Cannot call a class as a function")}function p(E,w){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:E}function v(E,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);E.prototype=Object.create(w&&w.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(E,w):E.__proto__=w)}var f=function(E){v(w,E);function w(){return h(this,w),p(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return i(w,[{key:"format",value:function(y,g){if(y!==this.statics.blotName||!g)return o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"format",this).call(this,y,g);g=this.constructor.sanitize(g),this.domNode.setAttribute("href",g)}}],[{key:"create",value:function(y){var g=o(w.__proto__||Object.getPrototypeOf(w),"create",this).call(this,y);return y=this.sanitize(y),g.setAttribute("href",y),g.setAttribute("rel","noopener noreferrer"),g.setAttribute("target","_blank"),g}},{key:"formats",value:function(y){return y.getAttribute("href")}},{key:"sanitize",value:function(y){return _(y,this.PROTOCOL_WHITELIST)?y:this.SANITIZED_URL}}]),w}(u.default);f.blotName="link",f.tagName="A",f.SANITIZED_URL="about:blank",f.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function _(E,w){var x=document.createElement("a");x.href=E;var y=x.href.slice(0,x.href.indexOf(":"));return w.indexOf(y)>-1}n.default=f,n.sanitize=_},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},o=function(){function w(x,y){for(var g=0;g<y.length;g++){var S=y[g];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(x,S.key,S)}}return function(x,y,g){return y&&w(x.prototype,y),g&&w(x,g),x}}(),s=a(23),u=p(s),c=a(107),h=p(c);function p(w){return w&&w.__esModule?w:{default:w}}function v(w,x){if(!(w instanceof x))throw new TypeError("Cannot call a class as a function")}var f=0;function _(w,x){w.setAttribute(x,w.getAttribute(x)!=="true")}var E=function(){function w(x){var y=this;v(this,w),this.select=x,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(g){switch(g.keyCode){case u.default.keys.ENTER:y.togglePicker();break;case u.default.keys.ESCAPE:y.escape(),g.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(w,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),_(this.label,"aria-expanded"),_(this.options,"aria-hidden")}},{key:"buildItem",value:function(y){var g=this,S=document.createElement("span");return S.tabIndex="0",S.setAttribute("role","button"),S.classList.add("ql-picker-item"),y.hasAttribute("value")&&S.setAttribute("data-value",y.getAttribute("value")),y.textContent&&S.setAttribute("data-label",y.textContent),S.addEventListener("click",function(){g.selectItem(S,!0)}),S.addEventListener("keydown",function(b){switch(b.keyCode){case u.default.keys.ENTER:g.selectItem(S,!0),b.preventDefault();break;case u.default.keys.ESCAPE:g.escape(),b.preventDefault();break}}),S}},{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,g=document.createElement("span");g.classList.add("ql-picker-options"),g.setAttribute("aria-hidden","true"),g.tabIndex="-1",g.id="ql-picker-options-"+f,f+=1,this.label.setAttribute("aria-controls",g.id),this.options=g,[].slice.call(this.select.options).forEach(function(S){var b=y.buildItem(S);g.appendChild(b),S.selected===!0&&y.selectItem(b)}),this.container.appendChild(g)}},{key:"buildPicker",value:function(){var y=this;[].slice.call(this.select.attributes).forEach(function(g){y.container.setAttribute(g.name,g.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 g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,S=this.container.querySelector(".ql-selected");if(y!==S&&(S!=null&&S.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"),g))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":i(Event))==="object"){var b=document.createEvent("Event");b.initEvent("change",!0,!0),this.select.dispatchEvent(b)}this.close()}}},{key:"update",value:function(){var y=void 0;if(this.select.selectedIndex>-1){var g=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];y=this.select.options[this.select.selectedIndex],this.selectItem(g)}else this.selectItem(null);var S=y!=null&&y!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",S)}}]),w}();n.default=E},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(0),o=N(i),s=a(5),u=N(s),c=a(4),h=N(c),p=a(16),v=N(p),f=a(25),_=N(f),E=a(24),w=N(E),x=a(35),y=N(x),g=a(6),S=N(g),b=a(22),R=N(b),L=a(7),T=N(L),F=a(55),I=N(F),O=a(42),C=N(O),A=a(23),j=N(A);function N(B){return B&&B.__esModule?B:{default:B}}u.default.register({"blots/block":h.default,"blots/block/embed":c.BlockEmbed,"blots/break":v.default,"blots/container":_.default,"blots/cursor":w.default,"blots/embed":y.default,"blots/inline":S.default,"blots/scroll":R.default,"blots/text":T.default,"modules/clipboard":I.default,"modules/history":C.default,"modules/keyboard":j.default}),o.default.register(h.default,v.default,w.default,S.default,R.default,T.default),n.default=u.default},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(1),o=function(){function s(u){this.domNode=u,this.domNode[i.DATA_KEY]={blot:this}}return Object.defineProperty(s.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),s.create=function(u){if(this.tagName==null)throw new i.ParchmentError("Blot definition missing tagName");var c;return Array.isArray(this.tagName)?(typeof u=="string"&&(u=u.toUpperCase(),parseInt(u).toString()===u&&(u=parseInt(u))),typeof u=="number"?c=document.createElement(this.tagName[u-1]):this.tagName.indexOf(u)>-1?c=document.createElement(u):c=document.createElement(this.tagName[0])):c=document.createElement(this.tagName),this.className&&c.classList.add(this.className),c},s.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},s.prototype.clone=function(){var u=this.domNode.cloneNode(!1);return i.create(u)},s.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[i.DATA_KEY]},s.prototype.deleteAt=function(u,c){var h=this.isolate(u,c);h.remove()},s.prototype.formatAt=function(u,c,h,p){var v=this.isolate(u,c);if(i.query(h,i.Scope.BLOT)!=null&&p)v.wrap(h,p);else if(i.query(h,i.Scope.ATTRIBUTE)!=null){var f=i.create(this.statics.scope);v.wrap(f),f.format(h,p)}},s.prototype.insertAt=function(u,c,h){var p=h==null?i.create("text",c):i.create(c,h),v=this.split(u);this.parent.insertBefore(p,v)},s.prototype.insertInto=function(u,c){c===void 0&&(c=null),this.parent!=null&&this.parent.children.remove(this);var h=null;u.children.insertBefore(this,c),c!=null&&(h=c.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=h)&&u.domNode.insertBefore(this.domNode,h),this.parent=u,this.attach()},s.prototype.isolate=function(u,c){var h=this.split(u);return h.split(c),h},s.prototype.length=function(){return 1},s.prototype.offset=function(u){return u===void 0&&(u=this.parent),this.parent==null||this==u?0:this.parent.children.offset(this)+this.parent.offset(u)},s.prototype.optimize=function(u){this.domNode[i.DATA_KEY]!=null&&delete this.domNode[i.DATA_KEY].mutations},s.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},s.prototype.replace=function(u){u.parent!=null&&(u.parent.insertBefore(this,u.next),u.remove())},s.prototype.replaceWith=function(u,c){var h=typeof u=="string"?i.create(u,c):u;return h.replace(this),h},s.prototype.split=function(u,c){return u===0?this:this.next},s.prototype.update=function(u,c){},s.prototype.wrap=function(u,c){var h=typeof u=="string"?i.create(u,c):u;return this.parent!=null&&this.parent.insertBefore(h,this.next),h.appendChild(this),h},s.blotName="abstract",s}();n.default=o},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(12),o=a(32),s=a(33),u=a(1),c=function(){function h(p){this.attributes={},this.domNode=p,this.build()}return h.prototype.attribute=function(p,v){v?p.add(this.domNode,v)&&(p.value(this.domNode)!=null?this.attributes[p.attrName]=p:delete this.attributes[p.attrName]):(p.remove(this.domNode),delete this.attributes[p.attrName])},h.prototype.build=function(){var p=this;this.attributes={};var v=i.default.keys(this.domNode),f=o.default.keys(this.domNode),_=s.default.keys(this.domNode);v.concat(f).concat(_).forEach(function(E){var w=u.query(E,u.Scope.ATTRIBUTE);w instanceof i.default&&(p.attributes[w.attrName]=w)})},h.prototype.copy=function(p){var v=this;Object.keys(this.attributes).forEach(function(f){var _=v.attributes[f].value(v.domNode);p.format(f,_)})},h.prototype.move=function(p){var v=this;this.copy(p),Object.keys(this.attributes).forEach(function(f){v.attributes[f].remove(v.domNode)}),this.attributes={}},h.prototype.values=function(){var p=this;return Object.keys(this.attributes).reduce(function(v,f){return v[f]=p.attributes[f].value(p.domNode),v},{})},h}();n.default=c},function(t,n,a){var i=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,p){h.__proto__=p}||function(h,p){for(var v in p)p.hasOwnProperty(v)&&(h[v]=p[v])};return function(h,p){c(h,p);function v(){this.constructor=h}h.prototype=p===null?Object.create(p):(v.prototype=p.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(12);function s(c,h){var p=c.getAttribute("class")||"";return p.split(/\s+/).filter(function(v){return v.indexOf(h+"-")===0})}var u=function(c){i(h,c);function h(){return c!==null&&c.apply(this,arguments)||this}return h.keys=function(p){return(p.getAttribute("class")||"").split(/\s+/).map(function(v){return v.split("-").slice(0,-1).join("-")})},h.prototype.add=function(p,v){return this.canAdd(p,v)?(this.remove(p),p.classList.add(this.keyName+"-"+v),!0):!1},h.prototype.remove=function(p){var v=s(p,this.keyName);v.forEach(function(f){p.classList.remove(f)}),p.classList.length===0&&p.removeAttribute("class")},h.prototype.value=function(p){var v=s(p,this.keyName)[0]||"",f=v.slice(this.keyName.length+1);return this.canAdd(p,f)?f:""},h}(o.default);n.default=u},function(t,n,a){var i=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,p){h.__proto__=p}||function(h,p){for(var v in p)p.hasOwnProperty(v)&&(h[v]=p[v])};return function(h,p){c(h,p);function v(){this.constructor=h}h.prototype=p===null?Object.create(p):(v.prototype=p.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(12);function s(c){var h=c.split("-"),p=h.slice(1).map(function(v){return v[0].toUpperCase()+v.slice(1)}).join("");return h[0]+p}var u=function(c){i(h,c);function h(){return c!==null&&c.apply(this,arguments)||this}return h.keys=function(p){return(p.getAttribute("style")||"").split(";").map(function(v){var f=v.split(":");return f[0].trim()})},h.prototype.add=function(p,v){return this.canAdd(p,v)?(p.style[s(this.keyName)]=v,!0):!1},h.prototype.remove=function(p){p.style[s(this.keyName)]="",p.getAttribute("style")||p.removeAttribute("style")},h.prototype.value=function(p){var v=p.style[s(this.keyName)];return this.canAdd(p,v)?v:""},h}(o.default);n.default=u},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function u(c,h){for(var p=0;p<h.length;p++){var v=h[p];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(c,v.key,v)}}return function(c,h,p){return h&&u(c.prototype,h),p&&u(c,p),c}}();function o(u,c){if(!(u instanceof c))throw new TypeError("Cannot call a class as a function")}var s=function(){function u(c,h){o(this,u),this.quill=c,this.options=h,this.modules={}}return i(u,[{key:"init",value:function(){var h=this;Object.keys(this.options.modules).forEach(function(p){h.modules[p]==null&&h.addModule(p)})}},{key:"addModule",value:function(h){var p=this.quill.constructor.import("modules/"+h);return this.modules[h]=new p(this.quill,this.options.modules[h]||{}),this.modules[h]}}]),u}();s.DEFAULTS={modules:{}},s.themes={default:s},n.default=s},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function x(y,g){for(var S=0;S<g.length;S++){var b=g[S];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,g,S){return g&&x(y.prototype,g),S&&x(y,S),y}}(),o=function x(y,g,S){y===null&&(y=Function.prototype);var b=Object.getOwnPropertyDescriptor(y,g);if(b===void 0){var R=Object.getPrototypeOf(y);return R===null?void 0:x(R,g,S)}else{if("value"in b)return b.value;var L=b.get;return L===void 0?void 0:L.call(S)}},s=a(0),u=p(s),c=a(7),h=p(c);function p(x){return x&&x.__esModule?x:{default:x}}function v(x,y){if(!(x instanceof y))throw new TypeError("Cannot call a class as a function")}function f(x,y){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:x}function _(x,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);x.prototype=Object.create(y&&y.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(x,y):x.__proto__=y)}var E="\uFEFF",w=function(x){_(y,x);function y(g){v(this,y);var S=f(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,g));return S.contentNode=document.createElement("span"),S.contentNode.setAttribute("contenteditable",!1),[].slice.call(S.domNode.childNodes).forEach(function(b){S.contentNode.appendChild(b)}),S.leftGuard=document.createTextNode(E),S.rightGuard=document.createTextNode(E),S.domNode.appendChild(S.leftGuard),S.domNode.appendChild(S.contentNode),S.domNode.appendChild(S.rightGuard),S}return i(y,[{key:"index",value:function(S,b){return S===this.leftGuard?0:S===this.rightGuard?1:o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"index",this).call(this,S,b)}},{key:"restore",value:function(S){var b=void 0,R=void 0,L=S.data.split(E).join("");if(S===this.leftGuard)if(this.prev instanceof h.default){var T=this.prev.length();this.prev.insertAt(T,L),b={startNode:this.prev.domNode,startOffset:T+L.length}}else R=document.createTextNode(L),this.parent.insertBefore(u.default.create(R),this),b={startNode:R,startOffset:L.length};else S===this.rightGuard&&(this.next instanceof h.default?(this.next.insertAt(0,L),b={startNode:this.next.domNode,startOffset:L.length}):(R=document.createTextNode(L),this.parent.insertBefore(u.default.create(R),this.next),b={startNode:R,startOffset:L.length}));return S.data=E,b}},{key:"update",value:function(S,b){var R=this;S.forEach(function(L){if(L.type==="characterData"&&(L.target===R.leftGuard||L.target===R.rightGuard)){var T=R.restore(L.target);T&&(b.range=T)}})}}]),y}(u.default.Embed);n.default=w},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var i=a(0),o=s(i);function s(v){return v&&v.__esModule?v:{default:v}}var u={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},c=new o.default.Attributor.Attribute("align","align",u),h=new o.default.Attributor.Class("align","ql-align",u),p=new o.default.Attributor.Style("align","text-align",u);n.AlignAttribute=c,n.AlignClass=h,n.AlignStyle=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var i=a(0),o=u(i),s=a(26);function u(p){return p&&p.__esModule?p:{default:p}}var c=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),h=new s.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});n.BackgroundClass=c,n.BackgroundStyle=h},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var i=a(0),o=s(i);function s(v){return v&&v.__esModule?v:{default:v}}var u={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},c=new o.default.Attributor.Attribute("direction","dir",u),h=new o.default.Attributor.Class("direction","ql-direction",u),p=new o.default.Attributor.Style("direction","direction",u);n.DirectionAttribute=c,n.DirectionClass=h,n.DirectionStyle=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var i=function(){function x(y,g){for(var S=0;S<g.length;S++){var b=g[S];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,g,S){return g&&x(y.prototype,g),S&&x(y,S),y}}(),o=function x(y,g,S){y===null&&(y=Function.prototype);var b=Object.getOwnPropertyDescriptor(y,g);if(b===void 0){var R=Object.getPrototypeOf(y);return R===null?void 0:x(R,g,S)}else{if("value"in b)return b.value;var L=b.get;return L===void 0?void 0:L.call(S)}},s=a(0),u=c(s);function c(x){return x&&x.__esModule?x:{default:x}}function h(x,y){if(!(x instanceof y))throw new TypeError("Cannot call a class as a function")}function p(x,y){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:x}function v(x,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);x.prototype=Object.create(y&&y.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(x,y):x.__proto__=y)}var f={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},_=new u.default.Attributor.Class("font","ql-font",f),E=function(x){v(y,x);function y(){return h(this,y),p(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return i(y,[{key:"value",value:function(S){return o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"value",this).call(this,S).replace(/["']/g,"")}}]),y}(u.default.Attributor.Style),w=new E("font","font-family",f);n.FontStyle=w,n.FontClass=_},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var i=a(0),o=s(i);function s(h){return h&&h.__esModule?h:{default:h}}var u=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),c=new o.default.Attributor.Style("size","font-size",{scope:o.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=u,n.SizeStyle=c},function(t,n,a){t.exports={align:{"":a(76),center:a(77),right:a(78),justify:a(79)},background:a(80),blockquote:a(81),bold:a(82),clean:a(83),code:a(58),"code-block":a(58),color:a(84),direction:{"":a(85),rtl:a(86)},float:{center:a(87),full:a(88),left:a(89),right:a(90)},formula:a(91),header:{1:a(92),2:a(93)},italic:a(94),image:a(95),indent:{"+1":a(96),"-1":a(97)},link:a(98),list:{ordered:a(99),bullet:a(100),check:a(101)},script:{sub:a(102),super:a(103)},strike:a(104),underline:a(105),video:a(106)}},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var i=function(){function g(S,b){for(var R=0;R<b.length;R++){var L=b[R];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(S,L.key,L)}}return function(S,b,R){return b&&g(S.prototype,b),R&&g(S,R),S}}(),o=a(0),s=v(o),u=a(5),c=v(u),h=a(9),p=v(h);function v(g){return g&&g.__esModule?g:{default:g}}function f(g,S){if(!(g instanceof S))throw new TypeError("Cannot call a class as a function")}function _(g,S){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:g}function E(g,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);g.prototype=Object.create(S&&S.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(g,S):g.__proto__=S)}var w=function(g){E(S,g);function S(b,R){f(this,S);var L=_(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,b,R));return L.lastRecorded=0,L.ignoreChange=!1,L.clear(),L.quill.on(c.default.events.EDITOR_CHANGE,function(T,F,I,O){T!==c.default.events.TEXT_CHANGE||L.ignoreChange||(!L.options.userOnly||O===c.default.sources.USER?L.record(F,I):L.transform(F))}),L.quill.keyboard.addBinding({key:"Z",shortKey:!0},L.undo.bind(L)),L.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},L.redo.bind(L)),/Win/i.test(navigator.platform)&&L.quill.keyboard.addBinding({key:"Y",shortKey:!0},L.redo.bind(L)),L}return i(S,[{key:"change",value:function(R,L){if(this.stack[R].length!==0){var T=this.stack[R].pop();this.stack[L].push(T),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(T[R],c.default.sources.USER),this.ignoreChange=!1;var F=y(T[R]);this.quill.setSelection(F)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(R,L){if(R.ops.length!==0){this.stack.redo=[];var T=this.quill.getContents().diff(L),F=Date.now();if(this.lastRecorded+this.options.delay>F&&this.stack.undo.length>0){var I=this.stack.undo.pop();T=T.compose(I.undo),R=I.redo.compose(R)}else this.lastRecorded=F;this.stack.undo.push({redo:R,undo:T}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(R){this.stack.undo.forEach(function(L){L.undo=R.transform(L.undo,!0),L.redo=R.transform(L.redo,!0)}),this.stack.redo.forEach(function(L){L.undo=R.transform(L.undo,!0),L.redo=R.transform(L.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),S}(p.default);w.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function x(g){var S=g.ops[g.ops.length-1];return S==null?!1:S.insert!=null?typeof S.insert=="string"&&S.insert.endsWith(`
|
|
139
|
-
`):S.attributes!=null?Object.keys(S.attributes).some(function(b){return s.default.query(b,s.default.Scope.BLOCK)!=null}):!1}function y(g){var S=g.reduce(function(R,L){return R+=L.delete||0,R},0),b=g.length()-S;return x(g)&&(b-=1),b}n.default=w,n.getLastChangeIndex=y},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var i=function(){function U(D,$){for(var Q=0;Q<$.length;Q++){var ee=$[Q];ee.enumerable=ee.enumerable||!1,ee.configurable=!0,"value"in ee&&(ee.writable=!0),Object.defineProperty(D,ee.key,ee)}}return function(D,$,Q){return $&&U(D.prototype,$),Q&&U(D,Q),D}}(),o=function U(D,$,Q){D===null&&(D=Function.prototype);var ee=Object.getOwnPropertyDescriptor(D,$);if(ee===void 0){var te=Object.getPrototypeOf(D);return te===null?void 0:U(te,$,Q)}else{if("value"in ee)return ee.value;var ae=ee.get;return ae===void 0?void 0:ae.call(Q)}},s=a(3),u=F(s),c=a(2),h=F(c),p=a(8),v=F(p),f=a(23),_=F(f),E=a(34),w=F(E),x=a(59),y=F(x),g=a(60),S=F(g),b=a(28),R=F(b),L=a(61),T=F(L);function F(U){return U&&U.__esModule?U:{default:U}}function I(U,D){if(!(U instanceof D))throw new TypeError("Cannot call a class as a function")}function O(U,D){if(!U)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D&&(typeof D=="object"||typeof D=="function")?D:U}function C(U,D){if(typeof D!="function"&&D!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof D);U.prototype=Object.create(D&&D.prototype,{constructor:{value:U,enumerable:!1,writable:!0,configurable:!0}}),D&&(Object.setPrototypeOf?Object.setPrototypeOf(U,D):U.__proto__=D)}var A=[!1,"center","right","justify"],j=["#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"],N=[!1,"serif","monospace"],B=["1","2","3",!1],W=["small",!1,"large","huge"],Y=function(U){C(D,U);function D($,Q){I(this,D);var ee=O(this,(D.__proto__||Object.getPrototypeOf(D)).call(this,$,Q)),te=function ae(se){if(!document.body.contains($.root))return document.body.removeEventListener("click",ae);ee.tooltip!=null&&!ee.tooltip.root.contains(se.target)&&document.activeElement!==ee.tooltip.textbox&&!ee.quill.hasFocus()&&ee.tooltip.hide(),ee.pickers!=null&&ee.pickers.forEach(function(ce){ce.container.contains(se.target)||ce.close()})};return $.emitter.listenDOM("click",document.body,te),ee}return i(D,[{key:"addModule",value:function(Q){var ee=o(D.prototype.__proto__||Object.getPrototypeOf(D.prototype),"addModule",this).call(this,Q);return Q==="toolbar"&&this.extendToolbar(ee),ee}},{key:"buildButtons",value:function(Q,ee){Q.forEach(function(te){var ae=te.getAttribute("class")||"";ae.split(/\s+/).forEach(function(se){if(se.startsWith("ql-")&&(se=se.slice(3),ee[se]!=null))if(se==="direction")te.innerHTML=ee[se][""]+ee[se].rtl;else if(typeof ee[se]=="string")te.innerHTML=ee[se];else{var ce=te.value||"";ce!=null&&ee[se][ce]&&(te.innerHTML=ee[se][ce])}})})}},{key:"buildPickers",value:function(Q,ee){var te=this;this.pickers=Q.map(function(se){if(se.classList.contains("ql-align"))return se.querySelector("option")==null&&H(se,A),new S.default(se,ee.align);if(se.classList.contains("ql-background")||se.classList.contains("ql-color")){var ce=se.classList.contains("ql-background")?"background":"color";return se.querySelector("option")==null&&H(se,j,ce==="background"?"#ffffff":"#000000"),new y.default(se,ee[ce])}else return se.querySelector("option")==null&&(se.classList.contains("ql-font")?H(se,N):se.classList.contains("ql-header")?H(se,B):se.classList.contains("ql-size")&&H(se,W)),new R.default(se)});var ae=function(){te.pickers.forEach(function(ce){ce.update()})};this.quill.on(v.default.events.EDITOR_CHANGE,ae)}}]),D}(w.default);Y.DEFAULTS=(0,u.default)(!0,{},w.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var D=this,$=this.container.querySelector("input.ql-image[type=file]");$==null&&($=document.createElement("input"),$.setAttribute("type","file"),$.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),$.classList.add("ql-image"),$.addEventListener("change",function(){if($.files!=null&&$.files[0]!=null){var Q=new FileReader;Q.onload=function(ee){var te=D.quill.getSelection(!0);D.quill.updateContents(new h.default().retain(te.index).delete(te.length).insert({image:ee.target.result}),v.default.sources.USER),D.quill.setSelection(te.index+1,v.default.sources.SILENT),$.value=""},Q.readAsDataURL($.files[0])}}),this.container.appendChild($)),$.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var Z=function(U){C(D,U);function D($,Q){I(this,D);var ee=O(this,(D.__proto__||Object.getPrototypeOf(D)).call(this,$,Q));return ee.textbox=ee.root.querySelector('input[type="text"]'),ee.listen(),ee}return i(D,[{key:"listen",value:function(){var Q=this;this.textbox.addEventListener("keydown",function(ee){_.default.match(ee,"enter")?(Q.save(),ee.preventDefault()):_.default.match(ee,"escape")&&(Q.cancel(),ee.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),ee!=null?this.textbox.value=ee:Q!==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-"+Q)||""),this.root.setAttribute("data-mode",Q)}},{key:"restoreFocus",value:function(){var Q=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=Q}},{key:"save",value:function(){var Q=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var ee=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",Q,v.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",Q,v.default.sources.USER)),this.quill.root.scrollTop=ee;break}case"video":Q=V(Q);case"formula":{if(!Q)break;var te=this.quill.getSelection(!0);if(te!=null){var ae=te.index+te.length;this.quill.insertEmbed(ae,this.root.getAttribute("data-mode"),Q,v.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(ae+1," ",v.default.sources.USER),this.quill.setSelection(ae+2,v.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),D}(T.default);function V(U){var D=U.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||U.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return D?(D[1]||"https")+"://www.youtube.com/embed/"+D[2]+"?showinfo=0":(D=U.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(D[1]||"https")+"://player.vimeo.com/video/"+D[2]+"/":U}function H(U,D){var $=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;D.forEach(function(Q){var ee=document.createElement("option");Q===$?ee.setAttribute("selected","selected"):ee.setAttribute("value",Q),U.appendChild(ee)})}n.BaseTooltip=Z,n.default=Y},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function o(){this.head=this.tail=null,this.length=0}return o.prototype.append=function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];this.insertBefore(s[0],null),s.length>1&&this.append.apply(this,s.slice(1))},o.prototype.contains=function(s){for(var u,c=this.iterator();u=c();)if(u===s)return!0;return!1},o.prototype.insertBefore=function(s,u){s&&(s.next=u,u!=null?(s.prev=u.prev,u.prev!=null&&(u.prev.next=s),u.prev=s,u===this.head&&(this.head=s)):this.tail!=null?(this.tail.next=s,s.prev=this.tail,this.tail=s):(s.prev=null,this.head=this.tail=s),this.length+=1)},o.prototype.offset=function(s){for(var u=0,c=this.head;c!=null;){if(c===s)return u;u+=c.length(),c=c.next}return-1},o.prototype.remove=function(s){this.contains(s)&&(s.prev!=null&&(s.prev.next=s.next),s.next!=null&&(s.next.prev=s.prev),s===this.head&&(this.head=s.next),s===this.tail&&(this.tail=s.prev),this.length-=1)},o.prototype.iterator=function(s){return s===void 0&&(s=this.head),function(){var u=s;return s!=null&&(s=s.next),u}},o.prototype.find=function(s,u){u===void 0&&(u=!1);for(var c,h=this.iterator();c=h();){var p=c.length();if(s<p||u&&s===p&&(c.next==null||c.next.length()!==0))return[c,s];s-=p}return[null,0]},o.prototype.forEach=function(s){for(var u,c=this.iterator();u=c();)s(u)},o.prototype.forEachAt=function(s,u,c){if(!(u<=0))for(var h=this.find(s),p=h[0],v=h[1],f,_=s-v,E=this.iterator(p);(f=E())&&_<s+u;){var w=f.length();s>_?c(f,s-_,Math.min(u,_+w-s)):c(f,0,Math.min(w,s+u-_)),_+=w}},o.prototype.map=function(s){return this.reduce(function(u,c){return u.push(s(c)),u},[])},o.prototype.reduce=function(s,u){for(var c,h=this.iterator();c=h();)u=s(u,c);return u},o}();n.default=i},function(t,n,a){var i=this&&this.__extends||function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,f){v.__proto__=f}||function(v,f){for(var _ in f)f.hasOwnProperty(_)&&(v[_]=f[_])};return function(v,f){p(v,f);function _(){this.constructor=v}v.prototype=f===null?Object.create(f):(_.prototype=f.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(17),s=a(1),u={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},c=100,h=function(p){i(v,p);function v(f){var _=p.call(this,f)||this;return _.scroll=_,_.observer=new MutationObserver(function(E){_.update(E)}),_.observer.observe(_.domNode,u),_.attach(),_}return v.prototype.detach=function(){p.prototype.detach.call(this),this.observer.disconnect()},v.prototype.deleteAt=function(f,_){this.update(),f===0&&_===this.length()?this.children.forEach(function(E){E.remove()}):p.prototype.deleteAt.call(this,f,_)},v.prototype.formatAt=function(f,_,E,w){this.update(),p.prototype.formatAt.call(this,f,_,E,w)},v.prototype.insertAt=function(f,_,E){this.update(),p.prototype.insertAt.call(this,f,_,E)},v.prototype.optimize=function(f,_){var E=this;f===void 0&&(f=[]),_===void 0&&(_={}),p.prototype.optimize.call(this,_);for(var w=[].slice.call(this.observer.takeRecords());w.length>0;)f.push(w.pop());for(var x=function(b,R){R===void 0&&(R=!0),!(b==null||b===E)&&b.domNode.parentNode!=null&&(b.domNode[s.DATA_KEY].mutations==null&&(b.domNode[s.DATA_KEY].mutations=[]),R&&x(b.parent))},y=function(b){b.domNode[s.DATA_KEY]==null||b.domNode[s.DATA_KEY].mutations==null||(b instanceof o.default&&b.children.forEach(y),b.optimize(_))},g=f,S=0;g.length>0;S+=1){if(S>=c)throw new Error("[Parchment] Maximum optimize iterations reached");for(g.forEach(function(b){var R=s.find(b.target,!0);R!=null&&(R.domNode===b.target&&(b.type==="childList"?(x(s.find(b.previousSibling,!1)),[].forEach.call(b.addedNodes,function(L){var T=s.find(L,!1);x(T,!1),T instanceof o.default&&T.children.forEach(function(F){x(F,!1)})})):b.type==="attributes"&&x(R.prev)),x(R))}),this.children.forEach(y),g=[].slice.call(this.observer.takeRecords()),w=g.slice();w.length>0;)f.push(w.pop())}},v.prototype.update=function(f,_){var E=this;_===void 0&&(_={}),f=f||this.observer.takeRecords(),f.map(function(w){var x=s.find(w.target,!0);return x==null?null:x.domNode[s.DATA_KEY].mutations==null?(x.domNode[s.DATA_KEY].mutations=[w],x):(x.domNode[s.DATA_KEY].mutations.push(w),null)}).forEach(function(w){w==null||w===E||w.domNode[s.DATA_KEY]==null||w.update(w.domNode[s.DATA_KEY].mutations||[],_)}),this.domNode[s.DATA_KEY].mutations!=null&&p.prototype.update.call(this,this.domNode[s.DATA_KEY].mutations,_),this.optimize(f,_)},v.blotName="scroll",v.defaultChild="block",v.scope=s.Scope.BLOCK_BLOT,v.tagName="DIV",v}(o.default);n.default=h},function(t,n,a){var i=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,v){p.__proto__=v}||function(p,v){for(var f in v)v.hasOwnProperty(f)&&(p[f]=v[f])};return function(p,v){h(p,v);function f(){this.constructor=p}p.prototype=v===null?Object.create(v):(f.prototype=v.prototype,new f)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(18),s=a(1);function u(h,p){if(Object.keys(h).length!==Object.keys(p).length)return!1;for(var v in h)if(h[v]!==p[v])return!1;return!0}var c=function(h){i(p,h);function p(){return h!==null&&h.apply(this,arguments)||this}return p.formats=function(v){if(v.tagName!==p.tagName)return h.formats.call(this,v)},p.prototype.format=function(v,f){var _=this;v===this.statics.blotName&&!f?(this.children.forEach(function(E){E instanceof o.default||(E=E.wrap(p.blotName,!0)),_.attributes.copy(E)}),this.unwrap()):h.prototype.format.call(this,v,f)},p.prototype.formatAt=function(v,f,_,E){if(this.formats()[_]!=null||s.query(_,s.Scope.ATTRIBUTE)){var w=this.isolate(v,f);w.format(_,E)}else h.prototype.formatAt.call(this,v,f,_,E)},p.prototype.optimize=function(v){h.prototype.optimize.call(this,v);var f=this.formats();if(Object.keys(f).length===0)return this.unwrap();var _=this.next;_ instanceof p&&_.prev===this&&u(f,_.formats())&&(_.moveChildren(this),_.remove())},p.blotName="inline",p.scope=s.Scope.INLINE_BLOT,p.tagName="SPAN",p}(o.default);n.default=c},function(t,n,a){var i=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,p){h.__proto__=p}||function(h,p){for(var v in p)p.hasOwnProperty(v)&&(h[v]=p[v])};return function(h,p){c(h,p);function v(){this.constructor=h}h.prototype=p===null?Object.create(p):(v.prototype=p.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(18),s=a(1),u=function(c){i(h,c);function h(){return c!==null&&c.apply(this,arguments)||this}return h.formats=function(p){var v=s.query(h.blotName).tagName;if(p.tagName!==v)return c.formats.call(this,p)},h.prototype.format=function(p,v){s.query(p,s.Scope.BLOCK)!=null&&(p===this.statics.blotName&&!v?this.replaceWith(h.blotName):c.prototype.format.call(this,p,v))},h.prototype.formatAt=function(p,v,f,_){s.query(f,s.Scope.BLOCK)!=null?this.format(f,_):c.prototype.formatAt.call(this,p,v,f,_)},h.prototype.insertAt=function(p,v,f){if(f==null||s.query(v,s.Scope.INLINE)!=null)c.prototype.insertAt.call(this,p,v,f);else{var _=this.split(p),E=s.create(v,f);_.parent.insertBefore(E,_)}},h.prototype.update=function(p,v){navigator.userAgent.match(/Trident/)?this.build():c.prototype.update.call(this,p,v)},h.blotName="block",h.scope=s.Scope.BLOCK_BLOT,h.tagName="P",h}(o.default);n.default=u},function(t,n,a){var i=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,h){c.__proto__=h}||function(c,h){for(var p in h)h.hasOwnProperty(p)&&(c[p]=h[p])};return function(c,h){u(c,h);function p(){this.constructor=c}c.prototype=h===null?Object.create(h):(p.prototype=h.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(19),s=function(u){i(c,u);function c(){return u!==null&&u.apply(this,arguments)||this}return c.formats=function(h){},c.prototype.format=function(h,p){u.prototype.formatAt.call(this,0,this.length(),h,p)},c.prototype.formatAt=function(h,p,v,f){h===0&&p===this.length()?this.format(v,f):u.prototype.formatAt.call(this,h,p,v,f)},c.prototype.formats=function(){return this.statics.formats(this.domNode)},c}(o.default);n.default=s},function(t,n,a){var i=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,p){h.__proto__=p}||function(h,p){for(var v in p)p.hasOwnProperty(v)&&(h[v]=p[v])};return function(h,p){c(h,p);function v(){this.constructor=h}h.prototype=p===null?Object.create(p):(v.prototype=p.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(19),s=a(1),u=function(c){i(h,c);function h(p){var v=c.call(this,p)||this;return v.text=v.statics.value(v.domNode),v}return h.create=function(p){return document.createTextNode(p)},h.value=function(p){var v=p.data;return v.normalize&&(v=v.normalize()),v},h.prototype.deleteAt=function(p,v){this.domNode.data=this.text=this.text.slice(0,p)+this.text.slice(p+v)},h.prototype.index=function(p,v){return this.domNode===p?v:-1},h.prototype.insertAt=function(p,v,f){f==null?(this.text=this.text.slice(0,p)+v+this.text.slice(p),this.domNode.data=this.text):c.prototype.insertAt.call(this,p,v,f)},h.prototype.length=function(){return this.text.length},h.prototype.optimize=function(p){c.prototype.optimize.call(this,p),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(p,v){return[this.domNode,p]},h.prototype.split=function(p,v){if(v===void 0&&(v=!1),!v){if(p===0)return this;if(p===this.length())return this.next}var f=s.create(this.domNode.splitText(p));return this.parent.insertBefore(f,this.next),this.text=this.statics.value(this.domNode),f},h.prototype.update=function(p,v){var f=this;p.some(function(_){return _.type==="characterData"&&_.target===f.domNode})&&(this.text=this.statics.value(this.domNode))},h.prototype.value=function(){return this.text},h.blotName="text",h.scope=s.Scope.INLINE_BLOT,h}(o.default);n.default=u},function(t,n,a){var i=document.createElement("div");if(i.classList.toggle("test-class",!1),i.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(s,u){return arguments.length>1&&!this.contains(s)==!u?u:o.call(this,s)}}String.prototype.startsWith||(String.prototype.startsWith=function(s,u){return u=u||0,this.substr(u,s.length)===s}),String.prototype.endsWith||(String.prototype.endsWith=function(s,u){var c=this.toString();(typeof u!="number"||!isFinite(u)||Math.floor(u)!==u||u>c.length)&&(u=c.length),u-=s.length;var h=c.indexOf(s,u);return h!==-1&&h===u}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(u){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof u!="function")throw new TypeError("predicate must be a function");for(var c=Object(this),h=c.length>>>0,p=arguments[1],v,f=0;f<h;f++)if(v=c[f],u.call(p,v,f,c))return v}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(t,n){var a=-1,i=1,o=0;function s(S,b,R){if(S==b)return S?[[o,S]]:[];(R<0||S.length<R)&&(R=null);var L=p(S,b),T=S.substring(0,L);S=S.substring(L),b=b.substring(L),L=v(S,b);var F=S.substring(S.length-L);S=S.substring(0,S.length-L),b=b.substring(0,b.length-L);var I=u(S,b);return T&&I.unshift([o,T]),F&&I.push([o,F]),_(I),R!=null&&(I=x(I,R)),I=y(I),I}function u(S,b){var R;if(!S)return[[i,b]];if(!b)return[[a,S]];var L=S.length>b.length?S:b,T=S.length>b.length?b:S,F=L.indexOf(T);if(F!=-1)return R=[[i,L.substring(0,F)],[o,T],[i,L.substring(F+T.length)]],S.length>b.length&&(R[0][0]=R[2][0]=a),R;if(T.length==1)return[[a,S],[i,b]];var I=f(S,b);if(I){var O=I[0],C=I[1],A=I[2],j=I[3],N=I[4],B=s(O,A),W=s(C,j);return B.concat([[o,N]],W)}return c(S,b)}function c(S,b){for(var R=S.length,L=b.length,T=Math.ceil((R+L)/2),F=T,I=2*T,O=new Array(I),C=new Array(I),A=0;A<I;A++)O[A]=-1,C[A]=-1;O[F+1]=0,C[F+1]=0;for(var j=R-L,N=j%2!=0,B=0,W=0,Y=0,Z=0,V=0;V<T;V++){for(var H=-V+B;H<=V-W;H+=2){var U=F+H,D;H==-V||H!=V&&O[U-1]<O[U+1]?D=O[U+1]:D=O[U-1]+1;for(var $=D-H;D<R&&$<L&&S.charAt(D)==b.charAt($);)D++,$++;if(O[U]=D,D>R)W+=2;else if($>L)B+=2;else if(N){var Q=F+j-H;if(Q>=0&&Q<I&&C[Q]!=-1){var ee=R-C[Q];if(D>=ee)return h(S,b,D,$)}}}for(var te=-V+Y;te<=V-Z;te+=2){var Q=F+te,ee;te==-V||te!=V&&C[Q-1]<C[Q+1]?ee=C[Q+1]:ee=C[Q-1]+1;for(var ae=ee-te;ee<R&&ae<L&&S.charAt(R-ee-1)==b.charAt(L-ae-1);)ee++,ae++;if(C[Q]=ee,ee>R)Z+=2;else if(ae>L)Y+=2;else if(!N){var U=F+j-te;if(U>=0&&U<I&&O[U]!=-1){var D=O[U],$=F+D-U;if(ee=R-ee,D>=ee)return h(S,b,D,$)}}}}return[[a,S],[i,b]]}function h(S,b,R,L){var T=S.substring(0,R),F=b.substring(0,L),I=S.substring(R),O=b.substring(L),C=s(T,F),A=s(I,O);return C.concat(A)}function p(S,b){if(!S||!b||S.charAt(0)!=b.charAt(0))return 0;for(var R=0,L=Math.min(S.length,b.length),T=L,F=0;R<T;)S.substring(F,T)==b.substring(F,T)?(R=T,F=R):L=T,T=Math.floor((L-R)/2+R);return T}function v(S,b){if(!S||!b||S.charAt(S.length-1)!=b.charAt(b.length-1))return 0;for(var R=0,L=Math.min(S.length,b.length),T=L,F=0;R<T;)S.substring(S.length-T,S.length-F)==b.substring(b.length-T,b.length-F)?(R=T,F=R):L=T,T=Math.floor((L-R)/2+R);return T}function f(S,b){var R=S.length>b.length?S:b,L=S.length>b.length?b:S;if(R.length<4||L.length*2<R.length)return null;function T(W,Y,Z){for(var V=W.substring(Z,Z+Math.floor(W.length/4)),H=-1,U="",D,$,Q,ee;(H=Y.indexOf(V,H+1))!=-1;){var te=p(W.substring(Z),Y.substring(H)),ae=v(W.substring(0,Z),Y.substring(0,H));U.length<ae+te&&(U=Y.substring(H-ae,H)+Y.substring(H,H+te),D=W.substring(0,Z-ae),$=W.substring(Z+te),Q=Y.substring(0,H-ae),ee=Y.substring(H+te))}return U.length*2>=W.length?[D,$,Q,ee,U]:null}var F=T(R,L,Math.ceil(R.length/4)),I=T(R,L,Math.ceil(R.length/2)),O;if(!F&&!I)return null;I?F?O=F[4].length>I[4].length?F:I:O=I:O=F;var C,A,j,N;S.length>b.length?(C=O[0],A=O[1],j=O[2],N=O[3]):(j=O[0],N=O[1],C=O[2],A=O[3]);var B=O[4];return[C,A,j,N,B]}function _(S){S.push([o,""]);for(var b=0,R=0,L=0,T="",F="",I;b<S.length;)switch(S[b][0]){case i:L++,F+=S[b][1],b++;break;case a:R++,T+=S[b][1],b++;break;case o:R+L>1?(R!==0&&L!==0&&(I=p(F,T),I!==0&&(b-R-L>0&&S[b-R-L-1][0]==o?S[b-R-L-1][1]+=F.substring(0,I):(S.splice(0,0,[o,F.substring(0,I)]),b++),F=F.substring(I),T=T.substring(I)),I=v(F,T),I!==0&&(S[b][1]=F.substring(F.length-I)+S[b][1],F=F.substring(0,F.length-I),T=T.substring(0,T.length-I))),R===0?S.splice(b-L,R+L,[i,F]):L===0?S.splice(b-R,R+L,[a,T]):S.splice(b-R-L,R+L,[a,T],[i,F]),b=b-R-L+(R?1:0)+(L?1:0)+1):b!==0&&S[b-1][0]==o?(S[b-1][1]+=S[b][1],S.splice(b,1)):b++,L=0,R=0,T="",F="";break}S[S.length-1][1]===""&&S.pop();var O=!1;for(b=1;b<S.length-1;)S[b-1][0]==o&&S[b+1][0]==o&&(S[b][1].substring(S[b][1].length-S[b-1][1].length)==S[b-1][1]?(S[b][1]=S[b-1][1]+S[b][1].substring(0,S[b][1].length-S[b-1][1].length),S[b+1][1]=S[b-1][1]+S[b+1][1],S.splice(b-1,1),O=!0):S[b][1].substring(0,S[b+1][1].length)==S[b+1][1]&&(S[b-1][1]+=S[b+1][1],S[b][1]=S[b][1].substring(S[b+1][1].length)+S[b+1][1],S.splice(b+1,1),O=!0)),b++;O&&_(S)}var E=s;E.INSERT=i,E.DELETE=a,E.EQUAL=o,t.exports=E;function w(S,b){if(b===0)return[o,S];for(var R=0,L=0;L<S.length;L++){var T=S[L];if(T[0]===a||T[0]===o){var F=R+T[1].length;if(b===F)return[L+1,S];if(b<F){S=S.slice();var I=b-R,O=[T[0],T[1].slice(0,I)],C=[T[0],T[1].slice(I)];return S.splice(L,1,O,C),[L+1,S]}else R=F}}throw new Error("cursor_pos is out of bounds!")}function x(S,b){var R=w(S,b),L=R[1],T=R[0],F=L[T],I=L[T+1];if(F==null)return S;if(F[0]!==o)return S;if(I!=null&&F[1]+I[1]===I[1]+F[1])return L.splice(T,2,I,F),g(L,T,2);if(I!=null&&I[1].indexOf(F[1])===0){L.splice(T,2,[I[0],F[1]],[0,F[1]]);var O=I[1].slice(F[1].length);return O.length>0&&L.splice(T+2,0,[I[0],O]),g(L,T,3)}else return S}function y(S){for(var b=!1,R=function(I){return I.charCodeAt(0)>=56320&&I.charCodeAt(0)<=57343},L=function(I){return I.charCodeAt(I.length-1)>=55296&&I.charCodeAt(I.length-1)<=56319},T=2;T<S.length;T+=1)S[T-2][0]===o&&L(S[T-2][1])&&S[T-1][0]===a&&R(S[T-1][1])&&S[T][0]===i&&R(S[T][1])&&(b=!0,S[T-1][1]=S[T-2][1].slice(-1)+S[T-1][1],S[T][1]=S[T-2][1].slice(-1)+S[T][1],S[T-2][1]=S[T-2][1].slice(0,-1));if(!b)return S;for(var F=[],T=0;T<S.length;T+=1)S[T][1].length>0&&F.push(S[T]);return F}function g(S,b,R){for(var L=b+R-1;L>=0&&L>=b-1;L--)if(L+1<S.length){var T=S[L],F=S[L+1];T[0]===F[1]&&S.splice(L,2,[T[0],T[1]+F[1]])}return S}},function(t,n){n=t.exports=typeof Object.keys=="function"?Object.keys:a,n.shim=a;function a(i){var o=[];for(var s in i)o.push(s);return o}},function(t,n){var a=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=t.exports=a?i:o,n.supported=i;function i(s){return Object.prototype.toString.call(s)=="[object Arguments]"}n.unsupported=o;function o(s){return s&&typeof s=="object"&&typeof s.length=="number"&&Object.prototype.hasOwnProperty.call(s,"callee")&&!Object.prototype.propertyIsEnumerable.call(s,"callee")||!1}},function(t,n){var a=Object.prototype.hasOwnProperty,i="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(i=!1));function s(c,h,p){this.fn=c,this.context=h,this.once=p||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var h=[],p,v;if(this._eventsCount===0)return h;for(v in p=this._events)a.call(p,v)&&h.push(i?v.slice(1):v);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(p)):h},u.prototype.listeners=function(h,p){var v=i?i+h:h,f=this._events[v];if(p)return!!f;if(!f)return[];if(f.fn)return[f.fn];for(var _=0,E=f.length,w=new Array(E);_<E;_++)w[_]=f[_].fn;return w},u.prototype.emit=function(h,p,v,f,_,E){var w=i?i+h:h;if(!this._events[w])return!1;var x=this._events[w],y=arguments.length,g,S;if(x.fn){switch(x.once&&this.removeListener(h,x.fn,void 0,!0),y){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,p),!0;case 3:return x.fn.call(x.context,p,v),!0;case 4:return x.fn.call(x.context,p,v,f),!0;case 5:return x.fn.call(x.context,p,v,f,_),!0;case 6:return x.fn.call(x.context,p,v,f,_,E),!0}for(S=1,g=new Array(y-1);S<y;S++)g[S-1]=arguments[S];x.fn.apply(x.context,g)}else{var b=x.length,R;for(S=0;S<b;S++)switch(x[S].once&&this.removeListener(h,x[S].fn,void 0,!0),y){case 1:x[S].fn.call(x[S].context);break;case 2:x[S].fn.call(x[S].context,p);break;case 3:x[S].fn.call(x[S].context,p,v);break;case 4:x[S].fn.call(x[S].context,p,v,f);break;default:if(!g)for(R=1,g=new Array(y-1);R<y;R++)g[R-1]=arguments[R];x[S].fn.apply(x[S].context,g)}}return!0},u.prototype.on=function(h,p,v){var f=new s(p,v||this),_=i?i+h:h;return this._events[_]?this._events[_].fn?this._events[_]=[this._events[_],f]:this._events[_].push(f):(this._events[_]=f,this._eventsCount++),this},u.prototype.once=function(h,p,v){var f=new s(p,v||this,!0),_=i?i+h:h;return this._events[_]?this._events[_].fn?this._events[_]=[this._events[_],f]:this._events[_].push(f):(this._events[_]=f,this._eventsCount++),this},u.prototype.removeListener=function(h,p,v,f){var _=i?i+h:h;if(!this._events[_])return this;if(!p)return--this._eventsCount===0?this._events=new o:delete this._events[_],this;var E=this._events[_];if(E.fn)E.fn===p&&(!f||E.once)&&(!v||E.context===v)&&(--this._eventsCount===0?this._events=new o:delete this._events[_]);else{for(var w=0,x=[],y=E.length;w<y;w++)(E[w].fn!==p||f&&!E[w].once||v&&E[w].context!==v)&&x.push(E[w]);x.length?this._events[_]=x.length===1?x[0]:x:--this._eventsCount===0?this._events=new o:delete this._events[_]}return this},u.prototype.removeAllListeners=function(h){var p;return h?(p=i?i+h:h,this._events[p]&&(--this._eventsCount===0?this._events=new o:delete this._events[p])):(this._events=new o,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prototype.setMaxListeners=function(){return this},u.prefixed=i,u.EventEmitter=u,typeof t<"u"&&(t.exports=u)},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Se){return typeof Se}:function(Se){return Se&&typeof Symbol=="function"&&Se.constructor===Symbol&&Se!==Symbol.prototype?"symbol":typeof Se},o=function(){function Se(be,Ae){var Te=[],he=!0,Oe=!1,Me=void 0;try{for(var ze=be[Symbol.iterator](),pt;!(he=(pt=ze.next()).done)&&(Te.push(pt.value),!(Ae&&Te.length===Ae));he=!0);}catch(yt){Oe=!0,Me=yt}finally{try{!he&&ze.return&&ze.return()}finally{if(Oe)throw Me}}return Te}return function(be,Ae){if(Array.isArray(be))return be;if(Symbol.iterator in Object(be))return Se(be,Ae);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function Se(be,Ae){for(var Te=0;Te<Ae.length;Te++){var he=Ae[Te];he.enumerable=he.enumerable||!1,he.configurable=!0,"value"in he&&(he.writable=!0),Object.defineProperty(be,he.key,he)}}return function(be,Ae,Te){return Ae&&Se(be.prototype,Ae),Te&&Se(be,Te),be}}(),u=a(3),c=C(u),h=a(2),p=C(h),v=a(0),f=C(v),_=a(5),E=C(_),w=a(10),x=C(w),y=a(9),g=C(y),S=a(36),b=a(37),R=a(13),L=C(R),T=a(26),F=a(38),I=a(39),O=a(40);function C(Se){return Se&&Se.__esModule?Se:{default:Se}}function A(Se,be,Ae){return be in Se?Object.defineProperty(Se,be,{value:Ae,enumerable:!0,configurable:!0,writable:!0}):Se[be]=Ae,Se}function j(Se,be){if(!(Se instanceof be))throw new TypeError("Cannot call a class as a function")}function N(Se,be){if(!Se)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return be&&(typeof be=="object"||typeof be=="function")?be:Se}function B(Se,be){if(typeof be!="function"&&be!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof be);Se.prototype=Object.create(be&&be.prototype,{constructor:{value:Se,enumerable:!1,writable:!0,configurable:!0}}),be&&(Object.setPrototypeOf?Object.setPrototypeOf(Se,be):Se.__proto__=be)}var W=(0,x.default)("quill:clipboard"),Y="__ql-matcher",Z=[[Node.TEXT_NODE,it],[Node.TEXT_NODE,Re],["br",me],[Node.ELEMENT_NODE,Re],[Node.ELEMENT_NODE,ce],[Node.ELEMENT_NODE,Pe],[Node.ELEMENT_NODE,se],[Node.ELEMENT_NODE,ve],["li",Le],["b",ae.bind(ae,"bold")],["i",ae.bind(ae,"italic")],["style",_e]],V=[S.AlignAttribute,F.DirectionAttribute].reduce(function(Se,be){return Se[be.keyName]=be,Se},{}),H=[S.AlignStyle,b.BackgroundStyle,T.ColorStyle,F.DirectionStyle,I.FontStyle,O.SizeStyle].reduce(function(Se,be){return Se[be.keyName]=be,Se},{}),U=function(Se){B(be,Se);function be(Ae,Te){j(this,be);var he=N(this,(be.__proto__||Object.getPrototypeOf(be)).call(this,Ae,Te));return he.quill.root.addEventListener("paste",he.onPaste.bind(he)),he.container=he.quill.addContainer("ql-clipboard"),he.container.setAttribute("contenteditable",!0),he.container.setAttribute("tabindex",-1),he.matchers=[],Z.concat(he.options.matchers).forEach(function(Oe){var Me=o(Oe,2),ze=Me[0],pt=Me[1];!Te.matchVisual&&pt===Pe||he.addMatcher(ze,pt)}),he}return s(be,[{key:"addMatcher",value:function(Te,he){this.matchers.push([Te,he])}},{key:"convert",value:function(Te){if(typeof Te=="string")return this.container.innerHTML=Te.replace(/\>\r?\n +\</g,"><"),this.convert();var he=this.quill.getFormat(this.quill.selection.savedRange.index);if(he[L.default.blotName]){var Oe=this.container.innerText;return this.container.innerHTML="",new p.default().insert(Oe,A({},L.default.blotName,he[L.default.blotName]))}var Me=this.prepareMatching(),ze=o(Me,2),pt=ze[0],yt=ze[1],He=te(this.container,pt,yt);return Q(He,`
|
|
140
|
-
`)&&He.ops[He.ops.length-1].attributes==null&&(He=He.compose(new p.default().retain(He.length()-1).delete(1))),W.log("convert",this.container.innerHTML,He),this.container.innerHTML="",He}},{key:"dangerouslyPasteHTML",value:function(Te,he){var Oe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:E.default.sources.API;if(typeof Te=="string")this.quill.setContents(this.convert(Te),he),this.quill.setSelection(0,E.default.sources.SILENT);else{var Me=this.convert(he);this.quill.updateContents(new p.default().retain(Te).concat(Me),Oe),this.quill.setSelection(Te+Me.length(),E.default.sources.SILENT)}}},{key:"onPaste",value:function(Te){var he=this;if(!(Te.defaultPrevented||!this.quill.isEnabled())){var Oe=this.quill.getSelection(),Me=new p.default().retain(Oe.index),ze=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(E.default.sources.SILENT),setTimeout(function(){Me=Me.concat(he.convert()).delete(Oe.length),he.quill.updateContents(Me,E.default.sources.USER),he.quill.setSelection(Me.length()-Oe.length,E.default.sources.SILENT),he.quill.scrollingContainer.scrollTop=ze,he.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var Te=this,he=[],Oe=[];return this.matchers.forEach(function(Me){var ze=o(Me,2),pt=ze[0],yt=ze[1];switch(pt){case Node.TEXT_NODE:Oe.push(yt);break;case Node.ELEMENT_NODE:he.push(yt);break;default:[].forEach.call(Te.container.querySelectorAll(pt),function(He){He[Y]=He[Y]||[],He[Y].push(yt)});break}}),[he,Oe]}}]),be}(g.default);U.DEFAULTS={matchers:[],matchVisual:!0};function D(Se,be,Ae){return(typeof be>"u"?"undefined":i(be))==="object"?Object.keys(be).reduce(function(Te,he){return D(Te,he,be[he])},Se):Se.reduce(function(Te,he){return he.attributes&&he.attributes[be]?Te.push(he):Te.insert(he.insert,(0,c.default)({},A({},be,Ae),he.attributes))},new p.default)}function $(Se){if(Se.nodeType!==Node.ELEMENT_NODE)return{};var be="__ql-computed-style";return Se[be]||(Se[be]=window.getComputedStyle(Se))}function Q(Se,be){for(var Ae="",Te=Se.ops.length-1;Te>=0&&Ae.length<be.length;--Te){var he=Se.ops[Te];if(typeof he.insert!="string")break;Ae=he.insert+Ae}return Ae.slice(-1*be.length)===be}function ee(Se){if(Se.childNodes.length===0)return!1;var be=$(Se);return["block","list-item"].indexOf(be.display)>-1}function te(Se,be,Ae){return Se.nodeType===Se.TEXT_NODE?Ae.reduce(function(Te,he){return he(Se,Te)},new p.default):Se.nodeType===Se.ELEMENT_NODE?[].reduce.call(Se.childNodes||[],function(Te,he){var Oe=te(he,be,Ae);return he.nodeType===Se.ELEMENT_NODE&&(Oe=be.reduce(function(Me,ze){return ze(he,Me)},Oe),Oe=(he[Y]||[]).reduce(function(Me,ze){return ze(he,Me)},Oe)),Te.concat(Oe)},new p.default):new p.default}function ae(Se,be,Ae){return D(Ae,Se,!0)}function se(Se,be){var Ae=f.default.Attributor.Attribute.keys(Se),Te=f.default.Attributor.Class.keys(Se),he=f.default.Attributor.Style.keys(Se),Oe={};return Ae.concat(Te).concat(he).forEach(function(Me){var ze=f.default.query(Me,f.default.Scope.ATTRIBUTE);ze!=null&&(Oe[ze.attrName]=ze.value(Se),Oe[ze.attrName])||(ze=V[Me],ze!=null&&(ze.attrName===Me||ze.keyName===Me)&&(Oe[ze.attrName]=ze.value(Se)||void 0),ze=H[Me],ze!=null&&(ze.attrName===Me||ze.keyName===Me)&&(ze=H[Me],Oe[ze.attrName]=ze.value(Se)||void 0))}),Object.keys(Oe).length>0&&(be=D(be,Oe)),be}function ce(Se,be){var Ae=f.default.query(Se);if(Ae==null)return be;if(Ae.prototype instanceof f.default.Embed){var Te={},he=Ae.value(Se);he!=null&&(Te[Ae.blotName]=he,be=new p.default().insert(Te,Ae.formats(Se)))}else typeof Ae.formats=="function"&&(be=D(be,Ae.blotName,Ae.formats(Se)));return be}function me(Se,be){return Q(be,`
|
|
141
|
-
`)||be.insert(`
|
|
142
|
-
`),be}function _e(){return new p.default}function Le(Se,be){var Ae=f.default.query(Se);if(Ae==null||Ae.blotName!=="list-item"||!Q(be,`
|
|
143
|
-
`))return be;for(var Te=-1,he=Se.parentNode;!he.classList.contains("ql-clipboard");)(f.default.query(he)||{}).blotName==="list"&&(Te+=1),he=he.parentNode;return Te<=0?be:be.compose(new p.default().retain(be.length()-1).retain(1,{indent:Te}))}function Re(Se,be){return Q(be,`
|
|
144
|
-
`)||(ee(Se)||be.length()>0&&Se.nextSibling&&ee(Se.nextSibling))&&be.insert(`
|
|
145
|
-
`),be}function Pe(Se,be){if(ee(Se)&&Se.nextElementSibling!=null&&!Q(be,`
|
|
146
|
-
|
|
147
|
-
`)){var Ae=Se.offsetHeight+parseFloat($(Se).marginTop)+parseFloat($(Se).marginBottom);Se.nextElementSibling.offsetTop>Se.offsetTop+Ae*1.5&&be.insert(`
|
|
148
|
-
`)}return be}function ve(Se,be){var Ae={},Te=Se.style||{};return Te.fontStyle&&$(Se).fontStyle==="italic"&&(Ae.italic=!0),Te.fontWeight&&($(Se).fontWeight.startsWith("bold")||parseInt($(Se).fontWeight)>=700)&&(Ae.bold=!0),Object.keys(Ae).length>0&&(be=D(be,Ae)),parseFloat(Te.textIndent||0)>0&&(be=new p.default().insert(" ").concat(be)),be}function it(Se,be){var Ae=Se.data;if(Se.parentNode.tagName==="O:P")return be.insert(Ae.trim());if(Ae.trim().length===0&&Se.parentNode.classList.contains("ql-clipboard"))return be;if(!$(Se.parentNode).whiteSpace.startsWith("pre")){var Te=function(Oe,Me){return Me=Me.replace(/[^\u00a0]/g,""),Me.length<1&&Oe?" ":Me};Ae=Ae.replace(/\r\n/g," ").replace(/\n/g," "),Ae=Ae.replace(/\s\s+/g,Te.bind(Te,!0)),(Se.previousSibling==null&&ee(Se.parentNode)||Se.previousSibling!=null&&ee(Se.previousSibling))&&(Ae=Ae.replace(/^\s+/,Te.bind(Te,!1))),(Se.nextSibling==null&&ee(Se.parentNode)||Se.nextSibling!=null&&ee(Se.nextSibling))&&(Ae=Ae.replace(/\s+$/,Te.bind(Te,!1)))}return be.insert(Ae)}n.default=U,n.matchAttributor=se,n.matchBlot=ce,n.matchNewline=Re,n.matchSpacing=Pe,n.matchText=it},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function _(E,w){for(var x=0;x<w.length;x++){var y=w[x];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(E,y.key,y)}}return function(E,w,x){return w&&_(E.prototype,w),x&&_(E,x),E}}(),o=function _(E,w,x){E===null&&(E=Function.prototype);var y=Object.getOwnPropertyDescriptor(E,w);if(y===void 0){var g=Object.getPrototypeOf(E);return g===null?void 0:_(g,w,x)}else{if("value"in y)return y.value;var S=y.get;return S===void 0?void 0:S.call(x)}},s=a(6),u=c(s);function c(_){return _&&_.__esModule?_:{default:_}}function h(_,E){if(!(_ instanceof E))throw new TypeError("Cannot call a class as a function")}function p(_,E){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:_}function v(_,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);_.prototype=Object.create(E&&E.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(_,E):_.__proto__=E)}var f=function(_){v(E,_);function E(){return h(this,E),p(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return i(E,[{key:"optimize",value:function(x){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"optimize",this).call(this,x),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(E.__proto__||Object.getPrototypeOf(E),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),E}(u.default);f.blotName="bold",f.tagName=["STRONG","B"],n.default=f},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var i=function(){function O(C,A){var j=[],N=!0,B=!1,W=void 0;try{for(var Y=C[Symbol.iterator](),Z;!(N=(Z=Y.next()).done)&&(j.push(Z.value),!(A&&j.length===A));N=!0);}catch(V){B=!0,W=V}finally{try{!N&&Y.return&&Y.return()}finally{if(B)throw W}}return j}return function(C,A){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return O(C,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function O(C,A){for(var j=0;j<A.length;j++){var N=A[j];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(C,N.key,N)}}return function(C,A,j){return A&&O(C.prototype,A),j&&O(C,j),C}}(),s=a(2),u=x(s),c=a(0),h=x(c),p=a(5),v=x(p),f=a(10),_=x(f),E=a(9),w=x(E);function x(O){return O&&O.__esModule?O:{default:O}}function y(O,C,A){return C in O?Object.defineProperty(O,C,{value:A,enumerable:!0,configurable:!0,writable:!0}):O[C]=A,O}function g(O,C){if(!(O instanceof C))throw new TypeError("Cannot call a class as a function")}function S(O,C){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:O}function b(O,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);O.prototype=Object.create(C&&C.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(O,C):O.__proto__=C)}var R=(0,_.default)("quill:toolbar"),L=function(O){b(C,O);function C(A,j){g(this,C);var N=S(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,A,j));if(Array.isArray(N.options.container)){var B=document.createElement("div");F(B,N.options.container),A.container.parentNode.insertBefore(B,A.container),N.container=B}else typeof N.options.container=="string"?N.container=document.querySelector(N.options.container):N.container=N.options.container;if(!(N.container instanceof HTMLElement)){var W;return W=R.error("Container required for toolbar",N.options),S(N,W)}return N.container.classList.add("ql-toolbar"),N.controls=[],N.handlers={},Object.keys(N.options.handlers).forEach(function(Y){N.addHandler(Y,N.options.handlers[Y])}),[].forEach.call(N.container.querySelectorAll("button, select"),function(Y){N.attach(Y)}),N.quill.on(v.default.events.EDITOR_CHANGE,function(Y,Z){Y===v.default.events.SELECTION_CHANGE&&N.update(Z)}),N.quill.on(v.default.events.SCROLL_OPTIMIZE,function(){var Y=N.quill.selection.getRange(),Z=i(Y,1),V=Z[0];N.update(V)}),N}return o(C,[{key:"addHandler",value:function(j,N){this.handlers[j]=N}},{key:"attach",value:function(j){var N=this,B=[].find.call(j.classList,function(Y){return Y.indexOf("ql-")===0});if(B){if(B=B.slice(3),j.tagName==="BUTTON"&&j.setAttribute("type","button"),this.handlers[B]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[B]==null){R.warn("ignoring attaching to disabled format",B,j);return}if(h.default.query(B)==null){R.warn("ignoring attaching to nonexistent format",B,j);return}}var W=j.tagName==="SELECT"?"change":"click";j.addEventListener(W,function(Y){var Z=void 0;if(j.tagName==="SELECT"){if(j.selectedIndex<0)return;var V=j.options[j.selectedIndex];V.hasAttribute("selected")?Z=!1:Z=V.value||!1}else j.classList.contains("ql-active")?Z=!1:Z=j.value||!j.hasAttribute("value"),Y.preventDefault();N.quill.focus();var H=N.quill.selection.getRange(),U=i(H,1),D=U[0];if(N.handlers[B]!=null)N.handlers[B].call(N,Z);else if(h.default.query(B).prototype instanceof h.default.Embed){if(Z=prompt("Enter "+B),!Z)return;N.quill.updateContents(new u.default().retain(D.index).delete(D.length).insert(y({},B,Z)),v.default.sources.USER)}else N.quill.format(B,Z,v.default.sources.USER);N.update(D)}),this.controls.push([B,j])}}},{key:"update",value:function(j){var N=j==null?{}:this.quill.getFormat(j);this.controls.forEach(function(B){var W=i(B,2),Y=W[0],Z=W[1];if(Z.tagName==="SELECT"){var V=void 0;if(j==null)V=null;else if(N[Y]==null)V=Z.querySelector("option[selected]");else if(!Array.isArray(N[Y])){var H=N[Y];typeof H=="string"&&(H=H.replace(/\"/g,'\\"')),V=Z.querySelector('option[value="'+H+'"]')}V==null?(Z.value="",Z.selectedIndex=-1):V.selected=!0}else if(j==null)Z.classList.remove("ql-active");else if(Z.hasAttribute("value")){var U=N[Y]===Z.getAttribute("value")||N[Y]!=null&&N[Y].toString()===Z.getAttribute("value")||N[Y]==null&&!Z.getAttribute("value");Z.classList.toggle("ql-active",U)}else Z.classList.toggle("ql-active",N[Y]!=null)})}}]),C}(w.default);L.DEFAULTS={};function T(O,C,A){var j=document.createElement("button");j.setAttribute("type","button"),j.classList.add("ql-"+C),A!=null&&(j.value=A),O.appendChild(j)}function F(O,C){Array.isArray(C[0])||(C=[C]),C.forEach(function(A){var j=document.createElement("span");j.classList.add("ql-formats"),A.forEach(function(N){if(typeof N=="string")T(j,N);else{var B=Object.keys(N)[0],W=N[B];Array.isArray(W)?I(j,B,W):T(j,B,W)}}),O.appendChild(j)})}function I(O,C,A){var j=document.createElement("select");j.classList.add("ql-"+C),A.forEach(function(N){var B=document.createElement("option");N!==!1?B.setAttribute("value",N):B.setAttribute("selected","selected"),j.appendChild(B)}),O.appendChild(j)}L.DEFAULTS={container:null,handlers:{clean:function(){var C=this,A=this.quill.getSelection();if(A!=null)if(A.length==0){var j=this.quill.getFormat();Object.keys(j).forEach(function(N){h.default.query(N,h.default.Scope.INLINE)!=null&&C.quill.format(N,!1)})}else this.quill.removeFormat(A,v.default.sources.USER)},direction:function(C){var A=this.quill.getFormat().align;C==="rtl"&&A==null?this.quill.format("align","right",v.default.sources.USER):!C&&A==="right"&&this.quill.format("align",!1,v.default.sources.USER),this.quill.format("direction",C,v.default.sources.USER)},indent:function(C){var A=this.quill.getSelection(),j=this.quill.getFormat(A),N=parseInt(j.indent||0);if(C==="+1"||C==="-1"){var B=C==="+1"?1:-1;j.direction==="rtl"&&(B*=-1),this.quill.format("indent",N+B,v.default.sources.USER)}},link:function(C){C===!0&&(C=prompt("Enter link URL:")),this.quill.format("link",C,v.default.sources.USER)},list:function(C){var A=this.quill.getSelection(),j=this.quill.getFormat(A);C==="check"?j.list==="checked"||j.list==="unchecked"?this.quill.format("list",!1,v.default.sources.USER):this.quill.format("list","unchecked",v.default.sources.USER):this.quill.format("list",C,v.default.sources.USER)}}},n.default=L,n.addControls=F},function(t,n){t.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(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function _(E,w){for(var x=0;x<w.length;x++){var y=w[x];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(E,y.key,y)}}return function(E,w,x){return w&&_(E.prototype,w),x&&_(E,x),E}}(),o=function _(E,w,x){E===null&&(E=Function.prototype);var y=Object.getOwnPropertyDescriptor(E,w);if(y===void 0){var g=Object.getPrototypeOf(E);return g===null?void 0:_(g,w,x)}else{if("value"in y)return y.value;var S=y.get;return S===void 0?void 0:S.call(x)}},s=a(28),u=c(s);function c(_){return _&&_.__esModule?_:{default:_}}function h(_,E){if(!(_ instanceof E))throw new TypeError("Cannot call a class as a function")}function p(_,E){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:_}function v(_,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);_.prototype=Object.create(E&&E.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(_,E):_.__proto__=E)}var f=function(_){v(E,_);function E(w,x){h(this,E);var y=p(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,w));return y.label.innerHTML=x,y.container.classList.add("ql-color-picker"),[].slice.call(y.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(g){g.classList.add("ql-primary")}),y}return i(E,[{key:"buildItem",value:function(x){var y=o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"buildItem",this).call(this,x);return y.style.backgroundColor=x.getAttribute("value")||"",y}},{key:"selectItem",value:function(x,y){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"selectItem",this).call(this,x,y);var g=this.label.querySelector(".ql-color-label"),S=x&&x.getAttribute("data-value")||"";g&&(g.tagName==="line"?g.style.stroke=S:g.style.fill=S)}}]),E}(u.default);n.default=f},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function _(E,w){for(var x=0;x<w.length;x++){var y=w[x];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(E,y.key,y)}}return function(E,w,x){return w&&_(E.prototype,w),x&&_(E,x),E}}(),o=function _(E,w,x){E===null&&(E=Function.prototype);var y=Object.getOwnPropertyDescriptor(E,w);if(y===void 0){var g=Object.getPrototypeOf(E);return g===null?void 0:_(g,w,x)}else{if("value"in y)return y.value;var S=y.get;return S===void 0?void 0:S.call(x)}},s=a(28),u=c(s);function c(_){return _&&_.__esModule?_:{default:_}}function h(_,E){if(!(_ instanceof E))throw new TypeError("Cannot call a class as a function")}function p(_,E){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:_}function v(_,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);_.prototype=Object.create(E&&E.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(_,E):_.__proto__=E)}var f=function(_){v(E,_);function E(w,x){h(this,E);var y=p(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,w));return y.container.classList.add("ql-icon-picker"),[].forEach.call(y.container.querySelectorAll(".ql-picker-item"),function(g){g.innerHTML=x[g.getAttribute("data-value")||""]}),y.defaultItem=y.container.querySelector(".ql-selected"),y.selectItem(y.defaultItem),y}return i(E,[{key:"selectItem",value:function(x,y){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"selectItem",this).call(this,x,y),x=x||this.defaultItem,this.label.innerHTML=x.innerHTML}}]),E}(u.default);n.default=f},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function u(c,h){for(var p=0;p<h.length;p++){var v=h[p];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(c,v.key,v)}}return function(c,h,p){return h&&u(c.prototype,h),p&&u(c,p),c}}();function o(u,c){if(!(u instanceof c))throw new TypeError("Cannot call a class as a function")}var s=function(){function u(c,h){var p=this;o(this,u),this.quill=c,this.boundsContainer=h||document.body,this.root=c.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){p.root.style.marginTop=-1*p.quill.root.scrollTop+"px"}),this.hide()}return i(u,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(h){var p=h.left+h.width/2-this.root.offsetWidth/2,v=h.bottom+this.quill.root.scrollTop;this.root.style.left=p+"px",this.root.style.top=v+"px",this.root.classList.remove("ql-flip");var f=this.boundsContainer.getBoundingClientRect(),_=this.root.getBoundingClientRect(),E=0;if(_.right>f.right&&(E=f.right-_.right,this.root.style.left=p+E+"px"),_.left<f.left&&(E=f.left-_.left,this.root.style.left=p+E+"px"),_.bottom>f.bottom){var w=_.bottom-_.top,x=h.bottom-h.top+w;this.root.style.top=v-x+"px",this.root.classList.add("ql-flip")}return E}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),u}();n.default=s},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function I(O,C){var A=[],j=!0,N=!1,B=void 0;try{for(var W=O[Symbol.iterator](),Y;!(j=(Y=W.next()).done)&&(A.push(Y.value),!(C&&A.length===C));j=!0);}catch(Z){N=!0,B=Z}finally{try{!j&&W.return&&W.return()}finally{if(N)throw B}}return A}return function(O,C){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return I(O,C);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function I(O,C,A){O===null&&(O=Function.prototype);var j=Object.getOwnPropertyDescriptor(O,C);if(j===void 0){var N=Object.getPrototypeOf(O);return N===null?void 0:I(N,C,A)}else{if("value"in j)return j.value;var B=j.get;return B===void 0?void 0:B.call(A)}},s=function(){function I(O,C){for(var A=0;A<C.length;A++){var j=C[A];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(O,j.key,j)}}return function(O,C,A){return C&&I(O.prototype,C),A&&I(O,A),O}}(),u=a(3),c=g(u),h=a(8),p=g(h),v=a(43),f=g(v),_=a(27),E=g(_),w=a(15),x=a(41),y=g(x);function g(I){return I&&I.__esModule?I:{default:I}}function S(I,O){if(!(I instanceof O))throw new TypeError("Cannot call a class as a function")}function b(I,O){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:I}function R(I,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);I.prototype=Object.create(O&&O.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(I,O):I.__proto__=O)}var L=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],T=function(I){R(O,I);function O(C,A){S(this,O),A.modules.toolbar!=null&&A.modules.toolbar.container==null&&(A.modules.toolbar.container=L);var j=b(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,C,A));return j.quill.container.classList.add("ql-snow"),j}return s(O,[{key:"extendToolbar",value:function(A){A.container.classList.add("ql-snow"),this.buildButtons([].slice.call(A.container.querySelectorAll("button")),y.default),this.buildPickers([].slice.call(A.container.querySelectorAll("select")),y.default),this.tooltip=new F(this.quill,this.options.bounds),A.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(j,N){A.handlers.link.call(A,!N.format.link)})}}]),O}(f.default);T.DEFAULTS=(0,c.default)(!0,{},f.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(O){if(O){var C=this.quill.getSelection();if(C==null||C.length==0)return;var A=this.quill.getText(C);/^\S+@\S+\.\S+$/.test(A)&&A.indexOf("mailto:")!==0&&(A="mailto:"+A);var j=this.quill.theme.tooltip;j.edit("link",A)}else this.quill.format("link",!1)}}}}});var F=function(I){R(O,I);function O(C,A){S(this,O);var j=b(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,C,A));return j.preview=j.root.querySelector("a.ql-preview"),j}return s(O,[{key:"listen",value:function(){var A=this;o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(j){A.root.classList.contains("ql-editing")?A.save():A.edit("link",A.preview.textContent),j.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(j){if(A.linkRange!=null){var N=A.linkRange;A.restoreFocus(),A.quill.formatText(N,"link",!1,p.default.sources.USER),delete A.linkRange}j.preventDefault(),A.hide()}),this.quill.on(p.default.events.SELECTION_CHANGE,function(j,N,B){if(j!=null){if(j.length===0&&B===p.default.sources.USER){var W=A.quill.scroll.descendant(E.default,j.index),Y=i(W,2),Z=Y[0],V=Y[1];if(Z!=null){A.linkRange=new w.Range(j.index-V,Z.length());var H=E.default.formats(Z.domNode);A.preview.textContent=H,A.preview.setAttribute("href",H),A.show(),A.position(A.quill.getBounds(A.linkRange));return}}else delete A.linkRange;A.hide()}})}},{key:"show",value:function(){o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),O}(v.BaseTooltip);F.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),n.default=T},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(29),o=he(i),s=a(36),u=a(38),c=a(64),h=a(65),p=he(h),v=a(66),f=he(v),_=a(67),E=he(_),w=a(37),x=a(26),y=a(39),g=a(40),S=a(56),b=he(S),R=a(68),L=he(R),T=a(27),F=he(T),I=a(69),O=he(I),C=a(70),A=he(C),j=a(71),N=he(j),B=a(72),W=he(B),Y=a(73),Z=he(Y),V=a(13),H=he(V),U=a(74),D=he(U),$=a(75),Q=he($),ee=a(57),te=he(ee),ae=a(41),se=he(ae),ce=a(28),me=he(ce),_e=a(59),Le=he(_e),Re=a(60),Pe=he(Re),ve=a(61),it=he(ve),Se=a(108),be=he(Se),Ae=a(62),Te=he(Ae);function he(Oe){return Oe&&Oe.__esModule?Oe:{default:Oe}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":s.AlignClass,"attributors/class/background":w.BackgroundClass,"attributors/class/color":x.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":y.FontClass,"attributors/class/size":g.SizeClass,"attributors/style/align":s.AlignStyle,"attributors/style/background":w.BackgroundStyle,"attributors/style/color":x.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":y.FontStyle,"attributors/style/size":g.SizeStyle},!0),o.default.register({"formats/align":s.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":c.IndentClass,"formats/background":w.BackgroundStyle,"formats/color":x.ColorStyle,"formats/font":y.FontClass,"formats/size":g.SizeClass,"formats/blockquote":p.default,"formats/code-block":H.default,"formats/header":f.default,"formats/list":E.default,"formats/bold":b.default,"formats/code":V.Code,"formats/italic":L.default,"formats/link":F.default,"formats/script":O.default,"formats/strike":A.default,"formats/underline":N.default,"formats/image":W.default,"formats/video":Z.default,"formats/list/item":_.ListItem,"modules/formula":D.default,"modules/syntax":Q.default,"modules/toolbar":te.default,"themes/bubble":be.default,"themes/snow":Te.default,"ui/icons":se.default,"ui/picker":me.default,"ui/icon-picker":Pe.default,"ui/color-picker":Le.default,"ui/tooltip":it.default},!0),n.default=o.default},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var i=function(){function E(w,x){for(var y=0;y<x.length;y++){var g=x[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(w,g.key,g)}}return function(w,x,y){return x&&E(w.prototype,x),y&&E(w,y),w}}(),o=function E(w,x,y){w===null&&(w=Function.prototype);var g=Object.getOwnPropertyDescriptor(w,x);if(g===void 0){var S=Object.getPrototypeOf(w);return S===null?void 0:E(S,x,y)}else{if("value"in g)return g.value;var b=g.get;return b===void 0?void 0:b.call(y)}},s=a(0),u=c(s);function c(E){return E&&E.__esModule?E:{default:E}}function h(E,w){if(!(E instanceof w))throw new TypeError("Cannot call a class as a function")}function p(E,w){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:E}function v(E,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);E.prototype=Object.create(w&&w.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(E,w):E.__proto__=w)}var f=function(E){v(w,E);function w(){return h(this,w),p(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return i(w,[{key:"add",value:function(y,g){if(g==="+1"||g==="-1"){var S=this.value(y)||0;g=g==="+1"?S+1:S-1}return g===0?(this.remove(y),!0):o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"add",this).call(this,y,g)}},{key:"canAdd",value:function(y,g){return o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"canAdd",this).call(this,y,g)||o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"canAdd",this).call(this,y,parseInt(g))}},{key:"value",value:function(y){return parseInt(o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"value",this).call(this,y))||void 0}}]),w}(u.default.Attributor.Class),_=new f("indent","ql-indent",{scope:u.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=_},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(4),o=s(i);function s(v){return v&&v.__esModule?v:{default:v}}function u(v,f){if(!(v instanceof f))throw new TypeError("Cannot call a class as a function")}function c(v,f){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:v}function h(v,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);v.prototype=Object.create(f&&f.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(v,f):v.__proto__=f)}var p=function(v){h(f,v);function f(){return u(this,f),c(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(o.default);p.blotName="blockquote",p.tagName="blockquote",n.default=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function f(_,E){for(var w=0;w<E.length;w++){var x=E[w];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(_,x.key,x)}}return function(_,E,w){return E&&f(_.prototype,E),w&&f(_,w),_}}(),o=a(4),s=u(o);function u(f){return f&&f.__esModule?f:{default:f}}function c(f,_){if(!(f instanceof _))throw new TypeError("Cannot call a class as a function")}function h(f,_){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:f}function p(f,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);f.prototype=Object.create(_&&_.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(f,_):f.__proto__=_)}var v=function(f){p(_,f);function _(){return c(this,_),h(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return i(_,null,[{key:"formats",value:function(w){return this.tagName.indexOf(w.tagName)+1}}]),_}(s.default);v.blotName="header",v.tagName=["H1","H2","H3","H4","H5","H6"],n.default=v},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var i=function(){function S(b,R){for(var L=0;L<R.length;L++){var T=R[L];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(b,T.key,T)}}return function(b,R,L){return R&&S(b.prototype,R),L&&S(b,L),b}}(),o=function S(b,R,L){b===null&&(b=Function.prototype);var T=Object.getOwnPropertyDescriptor(b,R);if(T===void 0){var F=Object.getPrototypeOf(b);return F===null?void 0:S(F,R,L)}else{if("value"in T)return T.value;var I=T.get;return I===void 0?void 0:I.call(L)}},s=a(0),u=f(s),c=a(4),h=f(c),p=a(25),v=f(p);function f(S){return S&&S.__esModule?S:{default:S}}function _(S,b,R){return b in S?Object.defineProperty(S,b,{value:R,enumerable:!0,configurable:!0,writable:!0}):S[b]=R,S}function E(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function w(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function x(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var y=function(S){x(b,S);function b(){return E(this,b),w(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return i(b,[{key:"format",value:function(L,T){L===g.blotName&&!T?this.replaceWith(u.default.create(this.statics.scope)):o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,L,T)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(L,T){return this.parent.isolate(this.offset(this.parent),this.length()),L===this.parent.statics.blotName?(this.parent.replaceWith(L,T),this):(this.parent.unwrap(),o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"replaceWith",this).call(this,L,T))}}],[{key:"formats",value:function(L){return L.tagName===this.tagName?void 0:o(b.__proto__||Object.getPrototypeOf(b),"formats",this).call(this,L)}}]),b}(h.default);y.blotName="list-item",y.tagName="LI";var g=function(S){x(b,S),i(b,null,[{key:"create",value:function(L){var T=L==="ordered"?"OL":"UL",F=o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,T);return(L==="checked"||L==="unchecked")&&F.setAttribute("data-checked",L==="checked"),F}},{key:"formats",value:function(L){if(L.tagName==="OL")return"ordered";if(L.tagName==="UL")return L.hasAttribute("data-checked")?L.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function b(R){E(this,b);var L=w(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,R)),T=function(I){if(I.target.parentNode===R){var O=L.statics.formats(R),C=u.default.find(I.target);O==="checked"?C.format("list","unchecked"):O==="unchecked"&&C.format("list","checked")}};return R.addEventListener("touchstart",T),R.addEventListener("mousedown",T),L}return i(b,[{key:"format",value:function(L,T){this.children.length>0&&this.children.tail.format(L,T)}},{key:"formats",value:function(){return _({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(L,T){if(L instanceof y)o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"insertBefore",this).call(this,L,T);else{var F=T==null?this.length():T.offset(this),I=this.split(F);I.parent.insertBefore(L,I)}}},{key:"optimize",value:function(L){o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"optimize",this).call(this,L);var T=this.next;T!=null&&T.prev===this&&T.statics.blotName===this.statics.blotName&&T.domNode.tagName===this.domNode.tagName&&T.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(T.moveChildren(this),T.remove())}},{key:"replace",value:function(L){if(L.statics.blotName!==this.statics.blotName){var T=u.default.create(this.statics.defaultChild);L.moveChildren(T),this.appendChild(T)}o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"replace",this).call(this,L)}}]),b}(v.default);g.blotName="list",g.scope=u.default.Scope.BLOCK_BLOT,g.tagName=["OL","UL"],g.defaultChild="list-item",g.allowedChildren=[y],n.ListItem=y,n.default=g},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(56),o=s(i);function s(v){return v&&v.__esModule?v:{default:v}}function u(v,f){if(!(v instanceof f))throw new TypeError("Cannot call a class as a function")}function c(v,f){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:v}function h(v,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);v.prototype=Object.create(f&&f.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(v,f):v.__proto__=f)}var p=function(v){h(f,v);function f(){return u(this,f),c(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(o.default);p.blotName="italic",p.tagName=["EM","I"],n.default=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function _(E,w){for(var x=0;x<w.length;x++){var y=w[x];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(E,y.key,y)}}return function(E,w,x){return w&&_(E.prototype,w),x&&_(E,x),E}}(),o=function _(E,w,x){E===null&&(E=Function.prototype);var y=Object.getOwnPropertyDescriptor(E,w);if(y===void 0){var g=Object.getPrototypeOf(E);return g===null?void 0:_(g,w,x)}else{if("value"in y)return y.value;var S=y.get;return S===void 0?void 0:S.call(x)}},s=a(6),u=c(s);function c(_){return _&&_.__esModule?_:{default:_}}function h(_,E){if(!(_ instanceof E))throw new TypeError("Cannot call a class as a function")}function p(_,E){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:_}function v(_,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);_.prototype=Object.create(E&&E.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(_,E):_.__proto__=E)}var f=function(_){v(E,_);function E(){return h(this,E),p(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return i(E,null,[{key:"create",value:function(x){return x==="super"?document.createElement("sup"):x==="sub"?document.createElement("sub"):o(E.__proto__||Object.getPrototypeOf(E),"create",this).call(this,x)}},{key:"formats",value:function(x){if(x.tagName==="SUB")return"sub";if(x.tagName==="SUP")return"super"}}]),E}(u.default);f.blotName="script",f.tagName=["SUB","SUP"],n.default=f},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(6),o=s(i);function s(v){return v&&v.__esModule?v:{default:v}}function u(v,f){if(!(v instanceof f))throw new TypeError("Cannot call a class as a function")}function c(v,f){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:v}function h(v,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);v.prototype=Object.create(f&&f.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(v,f):v.__proto__=f)}var p=function(v){h(f,v);function f(){return u(this,f),c(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(o.default);p.blotName="strike",p.tagName="S",n.default=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(6),o=s(i);function s(v){return v&&v.__esModule?v:{default:v}}function u(v,f){if(!(v instanceof f))throw new TypeError("Cannot call a class as a function")}function c(v,f){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:v}function h(v,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);v.prototype=Object.create(f&&f.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(v,f):v.__proto__=f)}var p=function(v){h(f,v);function f(){return u(this,f),c(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(o.default);p.blotName="underline",p.tagName="U",n.default=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function w(x,y){for(var g=0;g<y.length;g++){var S=y[g];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(x,S.key,S)}}return function(x,y,g){return y&&w(x.prototype,y),g&&w(x,g),x}}(),o=function w(x,y,g){x===null&&(x=Function.prototype);var S=Object.getOwnPropertyDescriptor(x,y);if(S===void 0){var b=Object.getPrototypeOf(x);return b===null?void 0:w(b,y,g)}else{if("value"in S)return S.value;var R=S.get;return R===void 0?void 0:R.call(g)}},s=a(0),u=h(s),c=a(27);function h(w){return w&&w.__esModule?w:{default:w}}function p(w,x){if(!(w instanceof x))throw new TypeError("Cannot call a class as a function")}function v(w,x){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:w}function f(w,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);w.prototype=Object.create(x&&x.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(w,x):w.__proto__=x)}var _=["alt","height","width"],E=function(w){f(x,w);function x(){return p(this,x),v(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return i(x,[{key:"format",value:function(g,S){_.indexOf(g)>-1?S?this.domNode.setAttribute(g,S):this.domNode.removeAttribute(g):o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,g,S)}}],[{key:"create",value:function(g){var S=o(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,g);return typeof g=="string"&&S.setAttribute("src",this.sanitize(g)),S}},{key:"formats",value:function(g){return _.reduce(function(S,b){return g.hasAttribute(b)&&(S[b]=g.getAttribute(b)),S},{})}},{key:"match",value:function(g){return/\.(jpe?g|gif|png)$/.test(g)||/^data:image\/.+;base64/.test(g)}},{key:"sanitize",value:function(g){return(0,c.sanitize)(g,["http","https","data"])?g:"//:0"}},{key:"value",value:function(g){return g.getAttribute("src")}}]),x}(u.default.Embed);E.blotName="image",E.tagName="IMG",n.default=E},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function w(x,y){for(var g=0;g<y.length;g++){var S=y[g];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(x,S.key,S)}}return function(x,y,g){return y&&w(x.prototype,y),g&&w(x,g),x}}(),o=function w(x,y,g){x===null&&(x=Function.prototype);var S=Object.getOwnPropertyDescriptor(x,y);if(S===void 0){var b=Object.getPrototypeOf(x);return b===null?void 0:w(b,y,g)}else{if("value"in S)return S.value;var R=S.get;return R===void 0?void 0:R.call(g)}},s=a(4),u=a(27),c=h(u);function h(w){return w&&w.__esModule?w:{default:w}}function p(w,x){if(!(w instanceof x))throw new TypeError("Cannot call a class as a function")}function v(w,x){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:w}function f(w,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);w.prototype=Object.create(x&&x.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(w,x):w.__proto__=x)}var _=["height","width"],E=function(w){f(x,w);function x(){return p(this,x),v(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return i(x,[{key:"format",value:function(g,S){_.indexOf(g)>-1?S?this.domNode.setAttribute(g,S):this.domNode.removeAttribute(g):o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,g,S)}}],[{key:"create",value:function(g){var S=o(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,g);return S.setAttribute("frameborder","0"),S.setAttribute("allowfullscreen",!0),S.setAttribute("src",this.sanitize(g)),S}},{key:"formats",value:function(g){return _.reduce(function(S,b){return g.hasAttribute(b)&&(S[b]=g.getAttribute(b)),S},{})}},{key:"sanitize",value:function(g){return c.default.sanitize(g)}},{key:"value",value:function(g){return g.getAttribute("src")}}]),x}(s.BlockEmbed);E.blotName="video",E.className="ql-video",E.tagName="IFRAME",n.default=E},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var i=function(){function g(S,b){for(var R=0;R<b.length;R++){var L=b[R];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(S,L.key,L)}}return function(S,b,R){return b&&g(S.prototype,b),R&&g(S,R),S}}(),o=function g(S,b,R){S===null&&(S=Function.prototype);var L=Object.getOwnPropertyDescriptor(S,b);if(L===void 0){var T=Object.getPrototypeOf(S);return T===null?void 0:g(T,b,R)}else{if("value"in L)return L.value;var F=L.get;return F===void 0?void 0:F.call(R)}},s=a(35),u=f(s),c=a(5),h=f(c),p=a(9),v=f(p);function f(g){return g&&g.__esModule?g:{default:g}}function _(g,S){if(!(g instanceof S))throw new TypeError("Cannot call a class as a function")}function E(g,S){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:g}function w(g,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);g.prototype=Object.create(S&&S.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(g,S):g.__proto__=S)}var x=function(g){w(S,g);function S(){return _(this,S),E(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return i(S,null,[{key:"create",value:function(R){var L=o(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this,R);return typeof R=="string"&&(window.katex.render(R,L,{throwOnError:!1,errorColor:"#f00"}),L.setAttribute("data-value",R)),L}},{key:"value",value:function(R){return R.getAttribute("data-value")}}]),S}(u.default);x.blotName="formula",x.className="ql-formula",x.tagName="SPAN";var y=function(g){w(S,g),i(S,null,[{key:"register",value:function(){h.default.register(x,!0)}}]);function S(){_(this,S);var b=E(this,(S.__proto__||Object.getPrototypeOf(S)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return b}return S}(v.default);n.FormulaBlot=x,n.default=y},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var i=function(){function R(L,T){for(var F=0;F<T.length;F++){var I=T[F];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(L,I.key,I)}}return function(L,T,F){return T&&R(L.prototype,T),F&&R(L,F),L}}(),o=function R(L,T,F){L===null&&(L=Function.prototype);var I=Object.getOwnPropertyDescriptor(L,T);if(I===void 0){var O=Object.getPrototypeOf(L);return O===null?void 0:R(O,T,F)}else{if("value"in I)return I.value;var C=I.get;return C===void 0?void 0:C.call(F)}},s=a(0),u=E(s),c=a(5),h=E(c),p=a(9),v=E(p),f=a(13),_=E(f);function E(R){return R&&R.__esModule?R:{default:R}}function w(R,L){if(!(R instanceof L))throw new TypeError("Cannot call a class as a function")}function x(R,L){if(!R)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:R}function y(R,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);R.prototype=Object.create(L&&L.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(R,L):R.__proto__=L)}var g=function(R){y(L,R);function L(){return w(this,L),x(this,(L.__proto__||Object.getPrototypeOf(L)).apply(this,arguments))}return i(L,[{key:"replaceWith",value:function(F){this.domNode.textContent=this.domNode.textContent,this.attach(),o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"replaceWith",this).call(this,F)}},{key:"highlight",value:function(F){var I=this.domNode.textContent;this.cachedText!==I&&((I.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=F(I),this.domNode.normalize(),this.attach()),this.cachedText=I)}}]),L}(_.default);g.className="ql-syntax";var S=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),b=function(R){y(L,R),i(L,null,[{key:"register",value:function(){h.default.register(S,!0),h.default.register(g,!0)}}]);function L(T,F){w(this,L);var I=x(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,T,F));if(typeof I.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var O=null;return I.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(O),O=setTimeout(function(){I.highlight(),O=null},I.options.interval)}),I.highlight(),I}return i(L,[{key:"highlight",value:function(){var F=this;if(!this.quill.selection.composing){this.quill.update(h.default.sources.USER);var I=this.quill.getSelection();this.quill.scroll.descendants(g).forEach(function(O){O.highlight(F.options.highlight)}),this.quill.update(h.default.sources.SILENT),I!=null&&this.quill.setSelection(I,h.default.sources.SILENT)}}}]),L}(v.default);b.DEFAULTS={highlight:function(){return window.hljs==null?null:function(R){var L=window.hljs.highlightAuto(R);return L.value}}(),interval:1e3},n.CodeBlock=g,n.CodeToken=S,n.default=b},function(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n){t.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(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var i=function L(T,F,I){T===null&&(T=Function.prototype);var O=Object.getOwnPropertyDescriptor(T,F);if(O===void 0){var C=Object.getPrototypeOf(T);return C===null?void 0:L(C,F,I)}else{if("value"in O)return O.value;var A=O.get;return A===void 0?void 0:A.call(I)}},o=function(){function L(T,F){for(var I=0;I<F.length;I++){var O=F[I];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(T,O.key,O)}}return function(T,F,I){return F&&L(T.prototype,F),I&&L(T,I),T}}(),s=a(3),u=w(s),c=a(8),h=w(c),p=a(43),v=w(p),f=a(15),_=a(41),E=w(_);function w(L){return L&&L.__esModule?L:{default:L}}function x(L,T){if(!(L instanceof T))throw new TypeError("Cannot call a class as a function")}function y(L,T){if(!L)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:L}function g(L,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);L.prototype=Object.create(T&&T.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(L,T):L.__proto__=T)}var S=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],b=function(L){g(T,L);function T(F,I){x(this,T),I.modules.toolbar!=null&&I.modules.toolbar.container==null&&(I.modules.toolbar.container=S);var O=y(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,F,I));return O.quill.container.classList.add("ql-bubble"),O}return o(T,[{key:"extendToolbar",value:function(I){this.tooltip=new R(this.quill,this.options.bounds),this.tooltip.root.appendChild(I.container),this.buildButtons([].slice.call(I.container.querySelectorAll("button")),E.default),this.buildPickers([].slice.call(I.container.querySelectorAll("select")),E.default)}}]),T}(v.default);b.DEFAULTS=(0,u.default)(!0,{},v.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(T){T?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var R=function(L){g(T,L);function T(F,I){x(this,T);var O=y(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,F,I));return O.quill.on(h.default.events.EDITOR_CHANGE,function(C,A,j,N){if(C===h.default.events.SELECTION_CHANGE)if(A!=null&&A.length>0&&N===h.default.sources.USER){O.show(),O.root.style.left="0px",O.root.style.width="",O.root.style.width=O.root.offsetWidth+"px";var B=O.quill.getLines(A.index,A.length);if(B.length===1)O.position(O.quill.getBounds(A));else{var W=B[B.length-1],Y=O.quill.getIndex(W),Z=Math.min(W.length()-1,A.index+A.length-Y),V=O.quill.getBounds(new f.Range(Y,Z));O.position(V)}}else document.activeElement!==O.textbox&&O.quill.hasFocus()&&O.hide()}),O}return o(T,[{key:"listen",value:function(){var I=this;i(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){I.root.classList.remove("ql-editing")}),this.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!I.root.classList.contains("ql-hidden")){var O=I.quill.getSelection();O!=null&&I.position(I.quill.getBounds(O))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(I){var O=i(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"position",this).call(this,I),C=this.root.querySelector(".ql-tooltip-arrow");if(C.style.marginLeft="",O===0)return O;C.style.marginLeft=-1*O-C.offsetWidth/2+"px"}}]),T}(p.BaseTooltip);R.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),n.BubbleTooltip=R,n.default=b},function(t,n,a){t.exports=a(63)}]).default})}(y1)),y1.exports}var ic={},b1={exports:{}},wf={},ip={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var DA=ip.exports,zb;function BA(){return zb||(zb=1,function(e,r){(function(t){var n=r&&!r.nodeType&&r,a=e&&!e.nodeType&&e,i=typeof bh=="object"&&bh;(i.global===i||i.window===i||i.self===i)&&(t=i);var o,s=2147483647,u=36,c=1,h=26,p=38,v=700,f=72,_=128,E="-",w=/^xn--/,x=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,g={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=u-c,b=Math.floor,R=String.fromCharCode,L;function T(V){throw new RangeError(g[V])}function F(V,H){for(var U=V.length,D=[];U--;)D[U]=H(V[U]);return D}function I(V,H){var U=V.split("@"),D="";U.length>1&&(D=U[0]+"@",V=U[1]),V=V.replace(y,".");var $=V.split("."),Q=F($,H).join(".");return D+Q}function O(V){for(var H=[],U=0,D=V.length,$,Q;U<D;)$=V.charCodeAt(U++),$>=55296&&$<=56319&&U<D?(Q=V.charCodeAt(U++),(Q&64512)==56320?H.push((($&1023)<<10)+(Q&1023)+65536):(H.push($),U--)):H.push($);return H}function C(V){return F(V,function(H){var U="";return H>65535&&(H-=65536,U+=R(H>>>10&1023|55296),H=56320|H&1023),U+=R(H),U}).join("")}function A(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:u}function j(V,H){return V+22+75*(V<26)-((H!=0)<<5)}function N(V,H,U){var D=0;for(V=U?b(V/v):V>>1,V+=b(V/H);V>S*h>>1;D+=u)V=b(V/S);return b(D+(S+1)*V/(V+p))}function B(V){var H=[],U=V.length,D,$=0,Q=_,ee=f,te,ae,se,ce,me,_e,Le,Re,Pe;for(te=V.lastIndexOf(E),te<0&&(te=0),ae=0;ae<te;++ae)V.charCodeAt(ae)>=128&&T("not-basic"),H.push(V.charCodeAt(ae));for(se=te>0?te+1:0;se<U;){for(ce=$,me=1,_e=u;se>=U&&T("invalid-input"),Le=A(V.charCodeAt(se++)),(Le>=u||Le>b((s-$)/me))&&T("overflow"),$+=Le*me,Re=_e<=ee?c:_e>=ee+h?h:_e-ee,!(Le<Re);_e+=u)Pe=u-Re,me>b(s/Pe)&&T("overflow"),me*=Pe;D=H.length+1,ee=N($-ce,D,ce==0),b($/D)>s-Q&&T("overflow"),Q+=b($/D),$%=D,H.splice($++,0,Q)}return C(H)}function W(V){var H,U,D,$,Q,ee,te,ae,se,ce,me,_e=[],Le,Re,Pe,ve;for(V=O(V),Le=V.length,H=_,U=0,Q=f,ee=0;ee<Le;++ee)me=V[ee],me<128&&_e.push(R(me));for(D=$=_e.length,$&&_e.push(E);D<Le;){for(te=s,ee=0;ee<Le;++ee)me=V[ee],me>=H&&me<te&&(te=me);for(Re=D+1,te-H>b((s-U)/Re)&&T("overflow"),U+=(te-H)*Re,H=te,ee=0;ee<Le;++ee)if(me=V[ee],me<H&&++U>s&&T("overflow"),me==H){for(ae=U,se=u;ce=se<=Q?c:se>=Q+h?h:se-Q,!(ae<ce);se+=u)ve=ae-ce,Pe=u-ce,_e.push(R(j(ce+ve%Pe,0))),ae=b(ve/Pe);_e.push(R(j(ae,0))),Q=N(U,Re,D==$),U=0,++D}++U,++H}return _e.join("")}function Y(V){return I(V,function(H){return w.test(H)?B(H.slice(4).toLowerCase()):H})}function Z(V){return I(V,function(H){return x.test(H)?"xn--"+W(H):H})}if(o={version:"1.4.1",ucs2:{decode:O,encode:C},decode:B,encode:W,toASCII:Z,toUnicode:Y},n&&a)if(e.exports==n)a.exports=o;else for(L in o)o.hasOwnProperty(L)&&(n[L]=o[L]);else t.punycode=o})(DA)}(ip,ip.exports)),ip.exports}var Eg,Ub;function Fh(){return Ub||(Ub=1,Eg=TypeError),Eg}const qA={},zA=Object.freeze(Object.defineProperty({__proto__:null,default:qA},Symbol.toStringTag,{value:"Module"})),UA=Zc(zA);var Pg,Hb;function o0(){if(Hb)return Pg;Hb=1;var e=typeof Map=="function"&&Map.prototype,r=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=e&&r&&typeof r.get=="function"?r.get:null,n=e&&Map.prototype.forEach,a=typeof Set=="function"&&Set.prototype,i=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=a&&i&&typeof i.get=="function"?i.get:null,s=a&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,c=u?WeakMap.prototype.has:null,h=typeof WeakSet=="function"&&WeakSet.prototype,p=h?WeakSet.prototype.has:null,v=typeof WeakRef=="function"&&WeakRef.prototype,f=v?WeakRef.prototype.deref:null,_=Boolean.prototype.valueOf,E=Object.prototype.toString,w=Function.prototype.toString,x=String.prototype.match,y=String.prototype.slice,g=String.prototype.replace,S=String.prototype.toUpperCase,b=String.prototype.toLowerCase,R=RegExp.prototype.test,L=Array.prototype.concat,T=Array.prototype.join,F=Array.prototype.slice,I=Math.floor,O=typeof BigInt=="function"?BigInt.prototype.valueOf:null,C=Object.getOwnPropertySymbols,A=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,j=typeof Symbol=="function"&&typeof Symbol.iterator=="object",N=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===j||!0)?Symbol.toStringTag:null,B=Object.prototype.propertyIsEnumerable,W=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(Ie){return Ie.__proto__}:null);function Y(Ie,ke){if(Ie===1/0||Ie===-1/0||Ie!==Ie||Ie&&Ie>-1e3&&Ie<1e3||R.call(/e/,ke))return ke;var ut=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof Ie=="number"){var Nt=Ie<0?-I(-Ie):I(Ie);if(Nt!==Ie){var Ct=String(Nt),St=y.call(ke,Ct.length+1);return g.call(Ct,ut,"$&_")+"."+g.call(g.call(St,/([0-9]{3})/g,"$&_"),/_$/,"")}}return g.call(ke,ut,"$&_")}var Z=UA,V=Z.custom,H=Re(V)?V:null,U={__proto__:null,double:'"',single:"'"},D={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Pg=function Ie(ke,ut,Nt,Ct){var St=ut||{};if(it(St,"quoteStyle")&&!it(U,St.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(it(St,"maxStringLength")&&(typeof St.maxStringLength=="number"?St.maxStringLength<0&&St.maxStringLength!==1/0:St.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Jt=it(St,"customInspect")?St.customInspect:!0;if(typeof Jt!="boolean"&&Jt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(it(St,"indent")&&St.indent!==null&&St.indent!==" "&&!(parseInt(St.indent,10)===St.indent&&St.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(it(St,"numericSeparator")&&typeof St.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var nr=St.numericSeparator;if(typeof ke>"u")return"undefined";if(ke===null)return"null";if(typeof ke=="boolean")return ke?"true":"false";if(typeof ke=="string")return yt(ke,St);if(typeof ke=="number"){if(ke===0)return 1/0/ke>0?"0":"-0";var Tt=String(ke);return nr?Y(ke,Tt):Tt}if(typeof ke=="bigint"){var Xt=String(ke)+"n";return nr?Y(ke,Xt):Xt}var Rr=typeof St.depth>"u"?5:St.depth;if(typeof Nt>"u"&&(Nt=0),Nt>=Rr&&Rr>0&&typeof ke=="object")return te(ke)?"[Array]":"[Object]";var Je=Pt(St,Nt);if(typeof Ct>"u")Ct=[];else if(Ae(Ct,ke)>=0)return"[Circular]";function mt(Si,fa,_s){if(fa&&(Ct=F.call(Ct),Ct.push(fa)),_s){var Vo={depth:St.depth};return it(St,"quoteStyle")&&(Vo.quoteStyle=St.quoteStyle),Ie(Si,Vo,Nt+1,Ct)}return Ie(Si,St,Nt+1,Ct)}if(typeof ke=="function"&&!se(ke)){var Gt=be(ke),bt=qt(ke,mt);return"[Function"+(Gt?": "+Gt:" (anonymous)")+"]"+(bt.length>0?" { "+T.call(bt,", ")+" }":"")}if(Re(ke)){var Kt=j?g.call(String(ke),/^(Symbol\(.*\))_[^)]*$/,"$1"):A.call(ke);return typeof ke=="object"&&!j?Qe(Kt):Kt}if(pt(ke)){for(var Yt="<"+b.call(String(ke.nodeName)),ct=ke.attributes||[],_t=0;_t<ct.length;_t++)Yt+=" "+ct[_t].name+"="+$(Q(ct[_t].value),"double",St);return Yt+=">",ke.childNodes&&ke.childNodes.length&&(Yt+="..."),Yt+="</"+b.call(String(ke.nodeName))+">",Yt}if(te(ke)){if(ke.length===0)return"[]";var xt=qt(ke,mt);return Je&&!Ht(xt)?"["+It(xt,Je)+"]":"[ "+T.call(xt,", ")+" ]"}if(ce(ke)){var rt=qt(ke,mt);return!("cause"in Error.prototype)&&"cause"in ke&&!B.call(ke,"cause")?"{ ["+String(ke)+"] "+T.call(L.call("[cause]: "+mt(ke.cause),rt),", ")+" }":rt.length===0?"["+String(ke)+"]":"{ ["+String(ke)+"] "+T.call(rt,", ")+" }"}if(typeof ke=="object"&&Jt){if(H&&typeof ke[H]=="function"&&Z)return Z(ke,{depth:Rr-Nt});if(Jt!=="symbol"&&typeof ke.inspect=="function")return ke.inspect()}if(Te(ke)){var zt=[];return n&&n.call(ke,function(Si,fa){zt.push(mt(fa,ke,!0)+" => "+mt(Si,ke))}),tt("Map",t.call(ke),zt,Je)}if(Me(ke)){var gt=[];return s&&s.call(ke,function(Si){gt.push(mt(Si,ke))}),tt("Set",o.call(ke),gt,Je)}if(he(ke))return Ze("WeakMap");if(ze(ke))return Ze("WeakSet");if(Oe(ke))return Ze("WeakRef");if(_e(ke))return Qe(mt(Number(ke)));if(Pe(ke))return Qe(mt(O.call(ke)));if(Le(ke))return Qe(_.call(ke));if(me(ke))return Qe(mt(String(ke)));if(typeof window<"u"&&ke===window)return"{ [object Window] }";if(typeof globalThis<"u"&&ke===globalThis||typeof bh<"u"&&ke===bh)return"{ [object globalThis] }";if(!ae(ke)&&!se(ke)){var Ft=qt(ke,mt),br=W?W(ke)===Object.prototype:ke instanceof Object||ke.constructor===Object,hr=ke instanceof Object?"":"null prototype",Qr=!br&&N&&Object(ke)===ke&&N in ke?y.call(Se(ke),8,-1):hr?"Object":"",Sn=br||typeof ke.constructor!="function"?"":ke.constructor.name?ke.constructor.name+" ":"",Ni=Sn+(Qr||hr?"["+T.call(L.call([],Qr||[],hr||[]),": ")+"] ":"");return Ft.length===0?Ni+"{}":Je?Ni+"{"+It(Ft,Je)+"}":Ni+"{ "+T.call(Ft,", ")+" }"}return String(ke)};function $(Ie,ke,ut){var Nt=ut.quoteStyle||ke,Ct=U[Nt];return Ct+Ie+Ct}function Q(Ie){return g.call(String(Ie),/"/g,""")}function ee(Ie){return!N||!(typeof Ie=="object"&&(N in Ie||typeof Ie[N]<"u"))}function te(Ie){return Se(Ie)==="[object Array]"&&ee(Ie)}function ae(Ie){return Se(Ie)==="[object Date]"&&ee(Ie)}function se(Ie){return Se(Ie)==="[object RegExp]"&&ee(Ie)}function ce(Ie){return Se(Ie)==="[object Error]"&&ee(Ie)}function me(Ie){return Se(Ie)==="[object String]"&&ee(Ie)}function _e(Ie){return Se(Ie)==="[object Number]"&&ee(Ie)}function Le(Ie){return Se(Ie)==="[object Boolean]"&&ee(Ie)}function Re(Ie){if(j)return Ie&&typeof Ie=="object"&&Ie instanceof Symbol;if(typeof Ie=="symbol")return!0;if(!Ie||typeof Ie!="object"||!A)return!1;try{return A.call(Ie),!0}catch{}return!1}function Pe(Ie){if(!Ie||typeof Ie!="object"||!O)return!1;try{return O.call(Ie),!0}catch{}return!1}var ve=Object.prototype.hasOwnProperty||function(Ie){return Ie in this};function it(Ie,ke){return ve.call(Ie,ke)}function Se(Ie){return E.call(Ie)}function be(Ie){if(Ie.name)return Ie.name;var ke=x.call(w.call(Ie),/^function\s*([\w$]+)/);return ke?ke[1]:null}function Ae(Ie,ke){if(Ie.indexOf)return Ie.indexOf(ke);for(var ut=0,Nt=Ie.length;ut<Nt;ut++)if(Ie[ut]===ke)return ut;return-1}function Te(Ie){if(!t||!Ie||typeof Ie!="object")return!1;try{t.call(Ie);try{o.call(Ie)}catch{return!0}return Ie instanceof Map}catch{}return!1}function he(Ie){if(!c||!Ie||typeof Ie!="object")return!1;try{c.call(Ie,c);try{p.call(Ie,p)}catch{return!0}return Ie instanceof WeakMap}catch{}return!1}function Oe(Ie){if(!f||!Ie||typeof Ie!="object")return!1;try{return f.call(Ie),!0}catch{}return!1}function Me(Ie){if(!o||!Ie||typeof Ie!="object")return!1;try{o.call(Ie);try{t.call(Ie)}catch{return!0}return Ie instanceof Set}catch{}return!1}function ze(Ie){if(!p||!Ie||typeof Ie!="object")return!1;try{p.call(Ie,p);try{c.call(Ie,c)}catch{return!0}return Ie instanceof WeakSet}catch{}return!1}function pt(Ie){return!Ie||typeof Ie!="object"?!1:typeof HTMLElement<"u"&&Ie instanceof HTMLElement?!0:typeof Ie.nodeName=="string"&&typeof Ie.getAttribute=="function"}function yt(Ie,ke){if(Ie.length>ke.maxStringLength){var ut=Ie.length-ke.maxStringLength,Nt="... "+ut+" more character"+(ut>1?"s":"");return yt(y.call(Ie,0,ke.maxStringLength),ke)+Nt}var Ct=D[ke.quoteStyle||"single"];Ct.lastIndex=0;var St=g.call(g.call(Ie,Ct,"\\$1"),/[\x00-\x1f]/g,He);return $(St,"single",ke)}function He(Ie){var ke=Ie.charCodeAt(0),ut={8:"b",9:"t",10:"n",12:"f",13:"r"}[ke];return ut?"\\"+ut:"\\x"+(ke<16?"0":"")+S.call(ke.toString(16))}function Qe(Ie){return"Object("+Ie+")"}function Ze(Ie){return Ie+" { ? }"}function tt(Ie,ke,ut,Nt){var Ct=Nt?It(ut,Nt):T.call(ut,", ");return Ie+" ("+ke+") {"+Ct+"}"}function Ht(Ie){for(var ke=0;ke<Ie.length;ke++)if(Ae(Ie[ke],`
|
|
149
|
-
`)>=0)return!1;return!0}function Pt(Ie,ke){var ut;if(Ie.indent===" ")ut=" ";else if(typeof Ie.indent=="number"&&Ie.indent>0)ut=T.call(Array(Ie.indent+1)," ");else return null;return{base:ut,prev:T.call(Array(ke+1),ut)}}function It(Ie,ke){if(Ie.length===0)return"";var ut=`
|
|
150
|
-
`+ke.prev+ke.base;return ut+T.call(Ie,","+ut)+`
|
|
151
|
-
`+ke.prev}function qt(Ie,ke){var ut=te(Ie),Nt=[];if(ut){Nt.length=Ie.length;for(var Ct=0;Ct<Ie.length;Ct++)Nt[Ct]=it(Ie,Ct)?ke(Ie[Ct],Ie):""}var St=typeof C=="function"?C(Ie):[],Jt;if(j){Jt={};for(var nr=0;nr<St.length;nr++)Jt["$"+St[nr]]=St[nr]}for(var Tt in Ie)it(Ie,Tt)&&(ut&&String(Number(Tt))===Tt&&Tt<Ie.length||j&&Jt["$"+Tt]instanceof Symbol||(R.call(/[^\w$]/,Tt)?Nt.push(ke(Tt,Ie)+": "+ke(Ie[Tt],Ie)):Nt.push(Tt+": "+ke(Ie[Tt],Ie))));if(typeof C=="function")for(var Xt=0;Xt<St.length;Xt++)B.call(Ie,St[Xt])&&Nt.push("["+ke(St[Xt])+"]: "+ke(Ie[St[Xt]],Ie));return Nt}return Pg}var Og,Gb;function HA(){if(Gb)return Og;Gb=1;var e=o0(),r=Fh(),t=function(s,u,c){for(var h=s,p;(p=h.next)!=null;h=p)if(p.key===u)return h.next=p.next,c||(p.next=s.next,s.next=p),p},n=function(s,u){if(s){var c=t(s,u);return c&&c.value}},a=function(s,u,c){var h=t(s,u);h?h.value=c:s.next={key:u,next:s.next,value:c}},i=function(s,u){return s?!!t(s,u):!1},o=function(s,u){if(s)return t(s,u,!0)};return Og=function(){var u,c={assert:function(h){if(!c.has(h))throw new r("Side channel does not contain "+e(h))},delete:function(h){var p=u&&u.next,v=o(u,h);return v&&p&&p===v&&(u=void 0),!!v},get:function(h){return n(u,h)},has:function(h){return i(u,h)},set:function(h,p){u||(u={next:void 0}),a(u,h,p)}};return c},Og}var Ag,Vb;function V8(){return Vb||(Vb=1,Ag=Object),Ag}var Cg,Wb;function GA(){return Wb||(Wb=1,Cg=Error),Cg}var kg,$b;function VA(){return $b||($b=1,kg=EvalError),kg}var Lg,Yb;function WA(){return Yb||(Yb=1,Lg=RangeError),Lg}var Ng,Xb;function $A(){return Xb||(Xb=1,Ng=ReferenceError),Ng}var Tg,Kb;function YA(){return Kb||(Kb=1,Tg=SyntaxError),Tg}var Rg,Zb;function XA(){return Zb||(Zb=1,Rg=URIError),Rg}var Mg,Qb;function KA(){return Qb||(Qb=1,Mg=Math.abs),Mg}var Ig,Jb;function ZA(){return Jb||(Jb=1,Ig=Math.floor),Ig}var jg,e3;function QA(){return e3||(e3=1,jg=Math.max),jg}var Fg,t3;function JA(){return t3||(t3=1,Fg=Math.min),Fg}var Dg,r3;function eC(){return r3||(r3=1,Dg=Math.pow),Dg}var Bg,n3;function tC(){return n3||(n3=1,Bg=Math.round),Bg}var qg,i3;function rC(){return i3||(i3=1,qg=Number.isNaN||function(r){return r!==r}),qg}var zg,a3;function nC(){if(a3)return zg;a3=1;var e=rC();return zg=function(t){return e(t)||t===0?t:t<0?-1:1},zg}var Ug,o3;function iC(){return o3||(o3=1,Ug=Object.getOwnPropertyDescriptor),Ug}var Hg,s3;function W8(){if(s3)return Hg;s3=1;var e=iC();if(e)try{e([],"length")}catch{e=null}return Hg=e,Hg}var Gg,l3;function aC(){if(l3)return Gg;l3=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Gg=e,Gg}var Vg,u3;function oC(){return u3||(u3=1,Vg=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;r[t]=a;for(var i in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var o=Object.getOwnPropertySymbols(r);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(r,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(r,t);if(s.value!==a||s.enumerable!==!0)return!1}return!0}),Vg}var Wg,c3;function sC(){if(c3)return Wg;c3=1;var e=typeof Symbol<"u"&&Symbol,r=oC();return Wg=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:r()},Wg}var $g,f3;function $8(){return f3||(f3=1,$g=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),$g}var Yg,h3;function Y8(){if(h3)return Yg;h3=1;var e=V8();return Yg=e.getPrototypeOf||null,Yg}var Xg,d3;function lC(){if(d3)return Xg;d3=1;var e="Function.prototype.bind called on incompatible ",r=Object.prototype.toString,t=Math.max,n="[object Function]",a=function(u,c){for(var h=[],p=0;p<u.length;p+=1)h[p]=u[p];for(var v=0;v<c.length;v+=1)h[v+u.length]=c[v];return h},i=function(u,c){for(var h=[],p=c,v=0;p<u.length;p+=1,v+=1)h[v]=u[p];return h},o=function(s,u){for(var c="",h=0;h<s.length;h+=1)c+=s[h],h+1<s.length&&(c+=u);return c};return Xg=function(u){var c=this;if(typeof c!="function"||r.apply(c)!==n)throw new TypeError(e+c);for(var h=i(arguments,1),p,v=function(){if(this instanceof p){var x=c.apply(this,a(h,arguments));return Object(x)===x?x:this}return c.apply(u,a(h,arguments))},f=t(0,c.length-h.length),_=[],E=0;E<f;E++)_[E]="$"+E;if(p=Function("binder","return function ("+o(_,",")+"){ return binder.apply(this,arguments); }")(v),c.prototype){var w=function(){};w.prototype=c.prototype,p.prototype=new w,w.prototype=null}return p},Xg}var Kg,p3;function s0(){if(p3)return Kg;p3=1;var e=lC();return Kg=Function.prototype.bind||e,Kg}var Zg,g3;function Am(){return g3||(g3=1,Zg=Function.prototype.call),Zg}var Qg,v3;function X8(){return v3||(v3=1,Qg=Function.prototype.apply),Qg}var Jg,m3;function uC(){return m3||(m3=1,Jg=typeof Reflect<"u"&&Reflect&&Reflect.apply),Jg}var ev,y3;function cC(){if(y3)return ev;y3=1;var e=s0(),r=X8(),t=Am(),n=uC();return ev=n||e.call(t,r),ev}var tv,b3;function K8(){if(b3)return tv;b3=1;var e=s0(),r=Fh(),t=Am(),n=cC();return tv=function(i){if(i.length<1||typeof i[0]!="function")throw new r("a function is required");return n(e,t,i)},tv}var rv,w3;function fC(){if(w3)return rv;w3=1;var e=K8(),r=W8(),t;try{t=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var n=!!t&&r&&r(Object.prototype,"__proto__"),a=Object,i=a.getPrototypeOf;return rv=n&&typeof n.get=="function"?e([n.get]):typeof i=="function"?function(s){return i(s==null?s:a(s))}:!1,rv}var nv,_3;function hC(){if(_3)return nv;_3=1;var e=$8(),r=Y8(),t=fC();return nv=e?function(a){return e(a)}:r?function(a){if(!a||typeof a!="object"&&typeof a!="function")throw new TypeError("getProto: not an object");return r(a)}:t?function(a){return t(a)}:null,nv}var iv,S3;function dC(){if(S3)return iv;S3=1;var e=Function.prototype.call,r=Object.prototype.hasOwnProperty,t=s0();return iv=t.call(e,r),iv}var av,x3;function Cm(){if(x3)return av;x3=1;var e,r=V8(),t=GA(),n=VA(),a=WA(),i=$A(),o=YA(),s=Fh(),u=XA(),c=KA(),h=ZA(),p=QA(),v=JA(),f=eC(),_=tC(),E=nC(),w=Function,x=function(se){try{return w('"use strict"; return ('+se+").constructor;")()}catch{}},y=W8(),g=aC(),S=function(){throw new s},b=y?function(){try{return arguments.callee,S}catch{try{return y(arguments,"callee").get}catch{return S}}}():S,R=sC()(),L=hC(),T=Y8(),F=$8(),I=X8(),O=Am(),C={},A=typeof Uint8Array>"u"||!L?e:L(Uint8Array),j={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":R&&L?L([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":C,"%AsyncGenerator%":C,"%AsyncGeneratorFunction%":C,"%AsyncIteratorPrototype%":C,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?e:Float16Array,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":w,"%GeneratorFunction%":C,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":R&&L?L(L([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!R||!L?e:L(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":y,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":a,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!R||!L?e:L(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":R&&L?L(""[Symbol.iterator]()):e,"%Symbol%":R?Symbol:e,"%SyntaxError%":o,"%ThrowTypeError%":b,"%TypedArray%":A,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":O,"%Function.prototype.apply%":I,"%Object.defineProperty%":g,"%Object.getPrototypeOf%":T,"%Math.abs%":c,"%Math.floor%":h,"%Math.max%":p,"%Math.min%":v,"%Math.pow%":f,"%Math.round%":_,"%Math.sign%":E,"%Reflect.getPrototypeOf%":F};if(L)try{null.error}catch(se){var N=L(L(se));j["%Error.prototype%"]=N}var B=function se(ce){var me;if(ce==="%AsyncFunction%")me=x("async function () {}");else if(ce==="%GeneratorFunction%")me=x("function* () {}");else if(ce==="%AsyncGeneratorFunction%")me=x("async function* () {}");else if(ce==="%AsyncGenerator%"){var _e=se("%AsyncGeneratorFunction%");_e&&(me=_e.prototype)}else if(ce==="%AsyncIteratorPrototype%"){var Le=se("%AsyncGenerator%");Le&&L&&(me=L(Le.prototype))}return j[ce]=me,me},W={__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"]},Y=s0(),Z=dC(),V=Y.call(O,Array.prototype.concat),H=Y.call(I,Array.prototype.splice),U=Y.call(O,String.prototype.replace),D=Y.call(O,String.prototype.slice),$=Y.call(O,RegExp.prototype.exec),Q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ee=/\\(\\)?/g,te=function(ce){var me=D(ce,0,1),_e=D(ce,-1);if(me==="%"&&_e!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(_e==="%"&&me!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var Le=[];return U(ce,Q,function(Re,Pe,ve,it){Le[Le.length]=ve?U(it,ee,"$1"):Pe||Re}),Le},ae=function(ce,me){var _e=ce,Le;if(Z(W,_e)&&(Le=W[_e],_e="%"+Le[0]+"%"),Z(j,_e)){var Re=j[_e];if(Re===C&&(Re=B(_e)),typeof Re>"u"&&!me)throw new s("intrinsic "+ce+" exists, but is not available. Please file an issue!");return{alias:Le,name:_e,value:Re}}throw new o("intrinsic "+ce+" does not exist!")};return av=function(ce,me){if(typeof ce!="string"||ce.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof me!="boolean")throw new s('"allowMissing" argument must be a boolean');if($(/^%?[^%]*%?$/,ce)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var _e=te(ce),Le=_e.length>0?_e[0]:"",Re=ae("%"+Le+"%",me),Pe=Re.name,ve=Re.value,it=!1,Se=Re.alias;Se&&(Le=Se[0],H(_e,V([0,1],Se)));for(var be=1,Ae=!0;be<_e.length;be+=1){var Te=_e[be],he=D(Te,0,1),Oe=D(Te,-1);if((he==='"'||he==="'"||he==="`"||Oe==='"'||Oe==="'"||Oe==="`")&&he!==Oe)throw new o("property names with quotes must have matching quotes");if((Te==="constructor"||!Ae)&&(it=!0),Le+="."+Te,Pe="%"+Le+"%",Z(j,Pe))ve=j[Pe];else if(ve!=null){if(!(Te in ve)){if(!me)throw new s("base intrinsic for "+ce+" exists, but the property is not available.");return}if(y&&be+1>=_e.length){var Me=y(ve,Te);Ae=!!Me,Ae&&"get"in Me&&!("originalValue"in Me.get)?ve=Me.get:ve=ve[Te]}else Ae=Z(ve,Te),ve=ve[Te];Ae&&!it&&(j[Pe]=ve)}}return ve},av}var ov,E3;function Z8(){if(E3)return ov;E3=1;var e=Cm(),r=K8(),t=r([e("%String.prototype.indexOf%")]);return ov=function(a,i){var o=e(a,!!i);return typeof o=="function"&&t(a,".prototype.")>-1?r([o]):o},ov}var sv,P3;function Q8(){if(P3)return sv;P3=1;var e=Cm(),r=Z8(),t=o0(),n=Fh(),a=e("%Map%",!0),i=r("Map.prototype.get",!0),o=r("Map.prototype.set",!0),s=r("Map.prototype.has",!0),u=r("Map.prototype.delete",!0),c=r("Map.prototype.size",!0);return sv=!!a&&function(){var p,v={assert:function(f){if(!v.has(f))throw new n("Side channel does not contain "+t(f))},delete:function(f){if(p){var _=u(p,f);return c(p)===0&&(p=void 0),_}return!1},get:function(f){if(p)return i(p,f)},has:function(f){return p?s(p,f):!1},set:function(f,_){p||(p=new a),o(p,f,_)}};return v},sv}var lv,O3;function pC(){if(O3)return lv;O3=1;var e=Cm(),r=Z8(),t=o0(),n=Q8(),a=Fh(),i=e("%WeakMap%",!0),o=r("WeakMap.prototype.get",!0),s=r("WeakMap.prototype.set",!0),u=r("WeakMap.prototype.has",!0),c=r("WeakMap.prototype.delete",!0);return lv=i?function(){var p,v,f={assert:function(_){if(!f.has(_))throw new a("Side channel does not contain "+t(_))},delete:function(_){if(i&&_&&(typeof _=="object"||typeof _=="function")){if(p)return c(p,_)}else if(n&&v)return v.delete(_);return!1},get:function(_){return i&&_&&(typeof _=="object"||typeof _=="function")&&p?o(p,_):v&&v.get(_)},has:function(_){return i&&_&&(typeof _=="object"||typeof _=="function")&&p?u(p,_):!!v&&v.has(_)},set:function(_,E){i&&_&&(typeof _=="object"||typeof _=="function")?(p||(p=new i),s(p,_,E)):n&&(v||(v=n()),v.set(_,E))}};return f}:n,lv}var uv,A3;function gC(){if(A3)return uv;A3=1;var e=Fh(),r=o0(),t=HA(),n=Q8(),a=pC(),i=a||n||t;return uv=function(){var s,u={assert:function(c){if(!u.has(c))throw new e("Side channel does not contain "+r(c))},delete:function(c){return!!s&&s.delete(c)},get:function(c){return s&&s.get(c)},has:function(c){return!!s&&s.has(c)},set:function(c,h){s||(s=i()),s.set(c,h)}};return u},uv}var cv,C3;function km(){if(C3)return cv;C3=1;var e=String.prototype.replace,r=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return cv={default:t.RFC3986,formatters:{RFC1738:function(n){return e.call(n,r,"+")},RFC3986:function(n){return String(n)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},cv}var fv,k3;function J8(){if(k3)return fv;k3=1;var e=km(),r=Object.prototype.hasOwnProperty,t=Array.isArray,n=function(){for(var w=[],x=0;x<256;++x)w.push("%"+((x<16?"0":"")+x.toString(16)).toUpperCase());return w}(),a=function(x){for(;x.length>1;){var y=x.pop(),g=y.obj[y.prop];if(t(g)){for(var S=[],b=0;b<g.length;++b)typeof g[b]<"u"&&S.push(g[b]);y.obj[y.prop]=S}}},i=function(x,y){for(var g=y&&y.plainObjects?{__proto__:null}:{},S=0;S<x.length;++S)typeof x[S]<"u"&&(g[S]=x[S]);return g},o=function w(x,y,g){if(!y)return x;if(typeof y!="object"&&typeof y!="function"){if(t(x))x.push(y);else if(x&&typeof x=="object")(g&&(g.plainObjects||g.allowPrototypes)||!r.call(Object.prototype,y))&&(x[y]=!0);else return[x,y];return x}if(!x||typeof x!="object")return[x].concat(y);var S=x;return t(x)&&!t(y)&&(S=i(x,g)),t(x)&&t(y)?(y.forEach(function(b,R){if(r.call(x,R)){var L=x[R];L&&typeof L=="object"&&b&&typeof b=="object"?x[R]=w(L,b,g):x.push(b)}else x[R]=b}),x):Object.keys(y).reduce(function(b,R){var L=y[R];return r.call(b,R)?b[R]=w(b[R],L,g):b[R]=L,b},S)},s=function(x,y){return Object.keys(y).reduce(function(g,S){return g[S]=y[S],g},x)},u=function(w,x,y){var g=w.replace(/\+/g," ");if(y==="iso-8859-1")return g.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(g)}catch{return g}},c=1024,h=function(x,y,g,S,b){if(x.length===0)return x;var R=x;if(typeof x=="symbol"?R=Symbol.prototype.toString.call(x):typeof x!="string"&&(R=String(x)),g==="iso-8859-1")return escape(R).replace(/%u[0-9a-f]{4}/gi,function(A){return"%26%23"+parseInt(A.slice(2),16)+"%3B"});for(var L="",T=0;T<R.length;T+=c){for(var F=R.length>=c?R.slice(T,T+c):R,I=[],O=0;O<F.length;++O){var C=F.charCodeAt(O);if(C===45||C===46||C===95||C===126||C>=48&&C<=57||C>=65&&C<=90||C>=97&&C<=122||b===e.RFC1738&&(C===40||C===41)){I[I.length]=F.charAt(O);continue}if(C<128){I[I.length]=n[C];continue}if(C<2048){I[I.length]=n[192|C>>6]+n[128|C&63];continue}if(C<55296||C>=57344){I[I.length]=n[224|C>>12]+n[128|C>>6&63]+n[128|C&63];continue}O+=1,C=65536+((C&1023)<<10|F.charCodeAt(O)&1023),I[I.length]=n[240|C>>18]+n[128|C>>12&63]+n[128|C>>6&63]+n[128|C&63]}L+=I.join("")}return L},p=function(x){for(var y=[{obj:{o:x},prop:"o"}],g=[],S=0;S<y.length;++S)for(var b=y[S],R=b.obj[b.prop],L=Object.keys(R),T=0;T<L.length;++T){var F=L[T],I=R[F];typeof I=="object"&&I!==null&&g.indexOf(I)===-1&&(y.push({obj:R,prop:F}),g.push(I))}return a(y),x},v=function(x){return Object.prototype.toString.call(x)==="[object RegExp]"},f=function(x){return!x||typeof x!="object"?!1:!!(x.constructor&&x.constructor.isBuffer&&x.constructor.isBuffer(x))},_=function(x,y){return[].concat(x,y)},E=function(x,y){if(t(x)){for(var g=[],S=0;S<x.length;S+=1)g.push(y(x[S]));return g}return y(x)};return fv={arrayToObject:i,assign:s,combine:_,compact:p,decode:u,encode:h,isBuffer:f,isRegExp:v,maybeMap:E,merge:o},fv}var hv,L3;function vC(){if(L3)return hv;L3=1;var e=gC(),r=J8(),t=km(),n=Object.prototype.hasOwnProperty,a={brackets:function(w){return w+"[]"},comma:"comma",indices:function(w,x){return w+"["+x+"]"},repeat:function(w){return w}},i=Array.isArray,o=Array.prototype.push,s=function(E,w){o.apply(E,i(w)?w:[w])},u=Date.prototype.toISOString,c=t.default,h={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:r.encode,encodeValuesOnly:!1,filter:void 0,format:c,formatter:t.formatters[c],indices:!1,serializeDate:function(w){return u.call(w)},skipNulls:!1,strictNullHandling:!1},p=function(w){return typeof w=="string"||typeof w=="number"||typeof w=="boolean"||typeof w=="symbol"||typeof w=="bigint"},v={},f=function E(w,x,y,g,S,b,R,L,T,F,I,O,C,A,j,N,B,W){for(var Y=w,Z=W,V=0,H=!1;(Z=Z.get(v))!==void 0&&!H;){var U=Z.get(w);if(V+=1,typeof U<"u"){if(U===V)throw new RangeError("Cyclic object value");H=!0}typeof Z.get(v)>"u"&&(V=0)}if(typeof F=="function"?Y=F(x,Y):Y instanceof Date?Y=C(Y):y==="comma"&&i(Y)&&(Y=r.maybeMap(Y,function(Pe){return Pe instanceof Date?C(Pe):Pe})),Y===null){if(b)return T&&!N?T(x,h.encoder,B,"key",A):x;Y=""}if(p(Y)||r.isBuffer(Y)){if(T){var D=N?x:T(x,h.encoder,B,"key",A);return[j(D)+"="+j(T(Y,h.encoder,B,"value",A))]}return[j(x)+"="+j(String(Y))]}var $=[];if(typeof Y>"u")return $;var Q;if(y==="comma"&&i(Y))N&&T&&(Y=r.maybeMap(Y,T)),Q=[{value:Y.length>0?Y.join(",")||null:void 0}];else if(i(F))Q=F;else{var ee=Object.keys(Y);Q=I?ee.sort(I):ee}var te=L?String(x).replace(/\./g,"%2E"):String(x),ae=g&&i(Y)&&Y.length===1?te+"[]":te;if(S&&i(Y)&&Y.length===0)return ae+"[]";for(var se=0;se<Q.length;++se){var ce=Q[se],me=typeof ce=="object"&&ce&&typeof ce.value<"u"?ce.value:Y[ce];if(!(R&&me===null)){var _e=O&&L?String(ce).replace(/\./g,"%2E"):String(ce),Le=i(Y)?typeof y=="function"?y(ae,_e):ae:ae+(O?"."+_e:"["+_e+"]");W.set(w,V);var Re=e();Re.set(v,W),s($,E(me,Le,y,g,S,b,R,L,y==="comma"&&N&&i(Y)?null:T,F,I,O,C,A,j,N,B,Re))}}return $},_=function(w){if(!w)return h;if(typeof w.allowEmptyArrays<"u"&&typeof w.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof w.encodeDotInKeys<"u"&&typeof w.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(w.encoder!==null&&typeof w.encoder<"u"&&typeof w.encoder!="function")throw new TypeError("Encoder has to be a function.");var x=w.charset||h.charset;if(typeof w.charset<"u"&&w.charset!=="utf-8"&&w.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var y=t.default;if(typeof w.format<"u"){if(!n.call(t.formatters,w.format))throw new TypeError("Unknown format option provided.");y=w.format}var g=t.formatters[y],S=h.filter;(typeof w.filter=="function"||i(w.filter))&&(S=w.filter);var b;if(w.arrayFormat in a?b=w.arrayFormat:"indices"in w?b=w.indices?"indices":"repeat":b=h.arrayFormat,"commaRoundTrip"in w&&typeof w.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var R=typeof w.allowDots>"u"?w.encodeDotInKeys===!0?!0:h.allowDots:!!w.allowDots;return{addQueryPrefix:typeof w.addQueryPrefix=="boolean"?w.addQueryPrefix:h.addQueryPrefix,allowDots:R,allowEmptyArrays:typeof w.allowEmptyArrays=="boolean"?!!w.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:b,charset:x,charsetSentinel:typeof w.charsetSentinel=="boolean"?w.charsetSentinel:h.charsetSentinel,commaRoundTrip:!!w.commaRoundTrip,delimiter:typeof w.delimiter>"u"?h.delimiter:w.delimiter,encode:typeof w.encode=="boolean"?w.encode:h.encode,encodeDotInKeys:typeof w.encodeDotInKeys=="boolean"?w.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof w.encoder=="function"?w.encoder:h.encoder,encodeValuesOnly:typeof w.encodeValuesOnly=="boolean"?w.encodeValuesOnly:h.encodeValuesOnly,filter:S,format:y,formatter:g,serializeDate:typeof w.serializeDate=="function"?w.serializeDate:h.serializeDate,skipNulls:typeof w.skipNulls=="boolean"?w.skipNulls:h.skipNulls,sort:typeof w.sort=="function"?w.sort:null,strictNullHandling:typeof w.strictNullHandling=="boolean"?w.strictNullHandling:h.strictNullHandling}};return hv=function(E,w){var x=E,y=_(w),g,S;typeof y.filter=="function"?(S=y.filter,x=S("",x)):i(y.filter)&&(S=y.filter,g=S);var b=[];if(typeof x!="object"||x===null)return"";var R=a[y.arrayFormat],L=R==="comma"&&y.commaRoundTrip;g||(g=Object.keys(x)),y.sort&&g.sort(y.sort);for(var T=e(),F=0;F<g.length;++F){var I=g[F],O=x[I];y.skipNulls&&O===null||s(b,f(O,I,R,L,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,T))}var C=b.join(y.delimiter),A=y.addQueryPrefix===!0?"?":"";return y.charsetSentinel&&(y.charset==="iso-8859-1"?A+="utf8=%26%2310003%3B&":A+="utf8=%E2%9C%93&"),C.length>0?A+C:""},hv}var dv,N3;function mC(){if(N3)return dv;N3=1;var e=J8(),r=Object.prototype.hasOwnProperty,t=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},a=function(v){return v.replace(/&#(\d+);/g,function(f,_){return String.fromCharCode(parseInt(_,10))})},i=function(v,f,_){if(v&&typeof v=="string"&&f.comma&&v.indexOf(",")>-1)return v.split(",");if(f.throwOnLimitExceeded&&_>=f.arrayLimit)throw new RangeError("Array limit exceeded. Only "+f.arrayLimit+" element"+(f.arrayLimit===1?"":"s")+" allowed in an array.");return v},o="utf8=%26%2310003%3B",s="utf8=%E2%9C%93",u=function(f,_){var E={__proto__:null},w=_.ignoreQueryPrefix?f.replace(/^\?/,""):f;w=w.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var x=_.parameterLimit===1/0?void 0:_.parameterLimit,y=w.split(_.delimiter,_.throwOnLimitExceeded?x+1:x);if(_.throwOnLimitExceeded&&y.length>x)throw new RangeError("Parameter limit exceeded. Only "+x+" parameter"+(x===1?"":"s")+" allowed.");var g=-1,S,b=_.charset;if(_.charsetSentinel)for(S=0;S<y.length;++S)y[S].indexOf("utf8=")===0&&(y[S]===s?b="utf-8":y[S]===o&&(b="iso-8859-1"),g=S,S=y.length);for(S=0;S<y.length;++S)if(S!==g){var R=y[S],L=R.indexOf("]="),T=L===-1?R.indexOf("="):L+1,F,I;T===-1?(F=_.decoder(R,n.decoder,b,"key"),I=_.strictNullHandling?null:""):(F=_.decoder(R.slice(0,T),n.decoder,b,"key"),I=e.maybeMap(i(R.slice(T+1),_,t(E[F])?E[F].length:0),function(C){return _.decoder(C,n.decoder,b,"value")})),I&&_.interpretNumericEntities&&b==="iso-8859-1"&&(I=a(String(I))),R.indexOf("[]=")>-1&&(I=t(I)?[I]:I);var O=r.call(E,F);O&&_.duplicates==="combine"?E[F]=e.combine(E[F],I):(!O||_.duplicates==="last")&&(E[F]=I)}return E},c=function(v,f,_,E){var w=0;if(v.length>0&&v[v.length-1]==="[]"){var x=v.slice(0,-1).join("");w=Array.isArray(f)&&f[x]?f[x].length:0}for(var y=E?f:i(f,_,w),g=v.length-1;g>=0;--g){var S,b=v[g];if(b==="[]"&&_.parseArrays)S=_.allowEmptyArrays&&(y===""||_.strictNullHandling&&y===null)?[]:e.combine([],y);else{S=_.plainObjects?{__proto__:null}:{};var R=b.charAt(0)==="["&&b.charAt(b.length-1)==="]"?b.slice(1,-1):b,L=_.decodeDotInKeys?R.replace(/%2E/g,"."):R,T=parseInt(L,10);!_.parseArrays&&L===""?S={0:y}:!isNaN(T)&&b!==L&&String(T)===L&&T>=0&&_.parseArrays&&T<=_.arrayLimit?(S=[],S[T]=y):L!=="__proto__"&&(S[L]=y)}y=S}return y},h=function(f,_,E,w){if(f){var x=E.allowDots?f.replace(/\.([^.[]+)/g,"[$1]"):f,y=/(\[[^[\]]*])/,g=/(\[[^[\]]*])/g,S=E.depth>0&&y.exec(x),b=S?x.slice(0,S.index):x,R=[];if(b){if(!E.plainObjects&&r.call(Object.prototype,b)&&!E.allowPrototypes)return;R.push(b)}for(var L=0;E.depth>0&&(S=g.exec(x))!==null&&L<E.depth;){if(L+=1,!E.plainObjects&&r.call(Object.prototype,S[1].slice(1,-1))&&!E.allowPrototypes)return;R.push(S[1])}if(S){if(E.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+E.depth+" and strictDepth is true");R.push("["+x.slice(S.index)+"]")}return c(R,_,E,w)}},p=function(f){if(!f)return n;if(typeof f.allowEmptyArrays<"u"&&typeof f.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof f.decodeDotInKeys<"u"&&typeof f.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(f.decoder!==null&&typeof f.decoder<"u"&&typeof f.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof f.charset<"u"&&f.charset!=="utf-8"&&f.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof f.throwOnLimitExceeded<"u"&&typeof f.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var _=typeof f.charset>"u"?n.charset:f.charset,E=typeof f.duplicates>"u"?n.duplicates:f.duplicates;if(E!=="combine"&&E!=="first"&&E!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var w=typeof f.allowDots>"u"?f.decodeDotInKeys===!0?!0:n.allowDots:!!f.allowDots;return{allowDots:w,allowEmptyArrays:typeof f.allowEmptyArrays=="boolean"?!!f.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof f.allowPrototypes=="boolean"?f.allowPrototypes:n.allowPrototypes,allowSparse:typeof f.allowSparse=="boolean"?f.allowSparse:n.allowSparse,arrayLimit:typeof f.arrayLimit=="number"?f.arrayLimit:n.arrayLimit,charset:_,charsetSentinel:typeof f.charsetSentinel=="boolean"?f.charsetSentinel:n.charsetSentinel,comma:typeof f.comma=="boolean"?f.comma:n.comma,decodeDotInKeys:typeof f.decodeDotInKeys=="boolean"?f.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof f.decoder=="function"?f.decoder:n.decoder,delimiter:typeof f.delimiter=="string"||e.isRegExp(f.delimiter)?f.delimiter:n.delimiter,depth:typeof f.depth=="number"||f.depth===!1?+f.depth:n.depth,duplicates:E,ignoreQueryPrefix:f.ignoreQueryPrefix===!0,interpretNumericEntities:typeof f.interpretNumericEntities=="boolean"?f.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof f.parameterLimit=="number"?f.parameterLimit:n.parameterLimit,parseArrays:f.parseArrays!==!1,plainObjects:typeof f.plainObjects=="boolean"?f.plainObjects:n.plainObjects,strictDepth:typeof f.strictDepth=="boolean"?!!f.strictDepth:n.strictDepth,strictNullHandling:typeof f.strictNullHandling=="boolean"?f.strictNullHandling:n.strictNullHandling,throwOnLimitExceeded:typeof f.throwOnLimitExceeded=="boolean"?f.throwOnLimitExceeded:!1}};return dv=function(v,f){var _=p(f);if(v===""||v===null||typeof v>"u")return _.plainObjects?{__proto__:null}:{};for(var E=typeof v=="string"?u(v,_):v,w=_.plainObjects?{__proto__:null}:{},x=Object.keys(E),y=0;y<x.length;++y){var g=x[y],S=h(g,E[g],_,typeof v=="string");w=e.merge(w,S,_)}return _.allowSparse===!0?w:e.compact(w)},dv}var pv,T3;function yC(){if(T3)return pv;T3=1;var e=vC(),r=mC(),t=km();return pv={formats:t,parse:r,stringify:e},pv}var R3;function e_(){if(R3)return wf;R3=1;var e=BA();function r(){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 t=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,i=["<",">",'"',"`"," ","\r",`
|
|
152
|
-
`," "],o=["{","}","|","\\","^","`"].concat(i),s=["'"].concat(o),u=["%","/","?",";","#"].concat(s),c=["/","?","#"],h=255,p=/^[+a-z0-9A-Z_-]{0,63}$/,v=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},_={javascript:!0,"javascript:":!0},E={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},w=yC();function x(b,R,L){if(b&&typeof b=="object"&&b instanceof r)return b;var T=new r;return T.parse(b,R,L),T}r.prototype.parse=function(b,R,L){if(typeof b!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof b);var T=b.indexOf("?"),F=T!==-1&&T<b.indexOf("#")?"?":"#",I=b.split(F),O=/\\/g;I[0]=I[0].replace(O,"/"),b=I.join(F);var C=b;if(C=C.trim(),!L&&b.split("#").length===1){var A=a.exec(C);if(A)return this.path=C,this.href=C,this.pathname=A[1],A[2]?(this.search=A[2],R?this.query=w.parse(this.search.substr(1)):this.query=this.search.substr(1)):R&&(this.search="",this.query={}),this}var j=t.exec(C);if(j){j=j[0];var N=j.toLowerCase();this.protocol=N,C=C.substr(j.length)}if(L||j||C.match(/^\/\/[^@/]+@[^@/]+/)){var B=C.substr(0,2)==="//";B&&!(j&&_[j])&&(C=C.substr(2),this.slashes=!0)}if(!_[j]&&(B||j&&!E[j])){for(var W=-1,Y=0;Y<c.length;Y++){var Z=C.indexOf(c[Y]);Z!==-1&&(W===-1||Z<W)&&(W=Z)}var V,H;W===-1?H=C.lastIndexOf("@"):H=C.lastIndexOf("@",W),H!==-1&&(V=C.slice(0,H),C=C.slice(H+1),this.auth=decodeURIComponent(V)),W=-1;for(var Y=0;Y<u.length;Y++){var Z=C.indexOf(u[Y]);Z!==-1&&(W===-1||Z<W)&&(W=Z)}W===-1&&(W=C.length),this.host=C.slice(0,W),C=C.slice(W),this.parseHost(),this.hostname=this.hostname||"";var U=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!U)for(var D=this.hostname.split(/\./),Y=0,$=D.length;Y<$;Y++){var Q=D[Y];if(Q&&!Q.match(p)){for(var ee="",te=0,ae=Q.length;te<ae;te++)Q.charCodeAt(te)>127?ee+="x":ee+=Q[te];if(!ee.match(p)){var se=D.slice(0,Y),ce=D.slice(Y+1),me=Q.match(v);me&&(se.push(me[1]),ce.unshift(me[2])),ce.length&&(C="/"+ce.join(".")+C),this.hostname=se.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),U||(this.hostname=e.toASCII(this.hostname));var _e=this.port?":"+this.port:"",Le=this.hostname||"";this.host=Le+_e,this.href+=this.host,U&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),C[0]!=="/"&&(C="/"+C))}if(!f[N])for(var Y=0,$=s.length;Y<$;Y++){var Re=s[Y];if(C.indexOf(Re)!==-1){var Pe=encodeURIComponent(Re);Pe===Re&&(Pe=escape(Re)),C=C.split(Re).join(Pe)}}var ve=C.indexOf("#");ve!==-1&&(this.hash=C.substr(ve),C=C.slice(0,ve));var it=C.indexOf("?");if(it!==-1?(this.search=C.substr(it),this.query=C.substr(it+1),R&&(this.query=w.parse(this.query)),C=C.slice(0,it)):R&&(this.search="",this.query={}),C&&(this.pathname=C),E[N]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var _e=this.pathname||"",Se=this.search||"";this.path=_e+Se}return this.href=this.format(),this};function y(b){return typeof b=="string"&&(b=x(b)),b instanceof r?b.format():r.prototype.format.call(b)}r.prototype.format=function(){var b=this.auth||"";b&&(b=encodeURIComponent(b),b=b.replace(/%3A/i,":"),b+="@");var R=this.protocol||"",L=this.pathname||"",T=this.hash||"",F=!1,I="";this.host?F=b+this.host:this.hostname&&(F=b+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(F+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(I=w.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var O=this.search||I&&"?"+I||"";return R&&R.substr(-1)!==":"&&(R+=":"),this.slashes||(!R||E[R])&&F!==!1?(F="//"+(F||""),L&&L.charAt(0)!=="/"&&(L="/"+L)):F||(F=""),T&&T.charAt(0)!=="#"&&(T="#"+T),O&&O.charAt(0)!=="?"&&(O="?"+O),L=L.replace(/[?#]/g,function(C){return encodeURIComponent(C)}),O=O.replace("#","%23"),R+F+L+O+T};function g(b,R){return x(b,!1,!0).resolve(R)}r.prototype.resolve=function(b){return this.resolveObject(x(b,!1,!0)).format()};function S(b,R){return b?x(b,!1,!0).resolveObject(R):R}return r.prototype.resolveObject=function(b){if(typeof b=="string"){var R=new r;R.parse(b,!1,!0),b=R}for(var L=new r,T=Object.keys(this),F=0;F<T.length;F++){var I=T[F];L[I]=this[I]}if(L.hash=b.hash,b.href==="")return L.href=L.format(),L;if(b.slashes&&!b.protocol){for(var O=Object.keys(b),C=0;C<O.length;C++){var A=O[C];A!=="protocol"&&(L[A]=b[A])}return E[L.protocol]&&L.hostname&&!L.pathname&&(L.pathname="/",L.path=L.pathname),L.href=L.format(),L}if(b.protocol&&b.protocol!==L.protocol){if(!E[b.protocol]){for(var j=Object.keys(b),N=0;N<j.length;N++){var B=j[N];L[B]=b[B]}return L.href=L.format(),L}if(L.protocol=b.protocol,!b.host&&!_[b.protocol]){for(var $=(b.pathname||"").split("/");$.length&&!(b.host=$.shift()););b.host||(b.host=""),b.hostname||(b.hostname=""),$[0]!==""&&$.unshift(""),$.length<2&&$.unshift(""),L.pathname=$.join("/")}else L.pathname=b.pathname;if(L.search=b.search,L.query=b.query,L.host=b.host||"",L.auth=b.auth,L.hostname=b.hostname||b.host,L.port=b.port,L.pathname||L.search){var W=L.pathname||"",Y=L.search||"";L.path=W+Y}return L.slashes=L.slashes||b.slashes,L.href=L.format(),L}var Z=L.pathname&&L.pathname.charAt(0)==="/",V=b.host||b.pathname&&b.pathname.charAt(0)==="/",H=V||Z||L.host&&b.pathname,U=H,D=L.pathname&&L.pathname.split("/")||[],$=b.pathname&&b.pathname.split("/")||[],Q=L.protocol&&!E[L.protocol];if(Q&&(L.hostname="",L.port=null,L.host&&(D[0]===""?D[0]=L.host:D.unshift(L.host)),L.host="",b.protocol&&(b.hostname=null,b.port=null,b.host&&($[0]===""?$[0]=b.host:$.unshift(b.host)),b.host=null),H=H&&($[0]===""||D[0]==="")),V)L.host=b.host||b.host===""?b.host:L.host,L.hostname=b.hostname||b.hostname===""?b.hostname:L.hostname,L.search=b.search,L.query=b.query,D=$;else if($.length)D||(D=[]),D.pop(),D=D.concat($),L.search=b.search,L.query=b.query;else if(b.search!=null){if(Q){L.host=D.shift(),L.hostname=L.host;var ee=L.host&&L.host.indexOf("@")>0?L.host.split("@"):!1;ee&&(L.auth=ee.shift(),L.hostname=ee.shift(),L.host=L.hostname)}return L.search=b.search,L.query=b.query,(L.pathname!==null||L.search!==null)&&(L.path=(L.pathname?L.pathname:"")+(L.search?L.search:"")),L.href=L.format(),L}if(!D.length)return L.pathname=null,L.search?L.path="/"+L.search:L.path=null,L.href=L.format(),L;for(var te=D.slice(-1)[0],ae=(L.host||b.host||D.length>1)&&(te==="."||te==="..")||te==="",se=0,ce=D.length;ce>=0;ce--)te=D[ce],te==="."?D.splice(ce,1):te===".."?(D.splice(ce,1),se++):se&&(D.splice(ce,1),se--);if(!H&&!U)for(;se--;se)D.unshift("..");H&&D[0]!==""&&(!D[0]||D[0].charAt(0)!=="/")&&D.unshift(""),ae&&D.join("/").substr(-1)!=="/"&&D.push("");var me=D[0]===""||D[0]&&D[0].charAt(0)==="/";if(Q){L.hostname=me?"":D.length?D.shift():"",L.host=L.hostname;var ee=L.host&&L.host.indexOf("@")>0?L.host.split("@"):!1;ee&&(L.auth=ee.shift(),L.hostname=ee.shift(),L.host=L.hostname)}return H=H||L.host&&D.length,H&&!me&&D.unshift(""),D.length>0?L.pathname=D.join("/"):(L.pathname=null,L.path=null),(L.pathname!==null||L.search!==null)&&(L.path=(L.pathname?L.pathname:"")+(L.search?L.search:"")),L.auth=b.auth||L.auth,L.slashes=L.slashes||b.slashes,L.href=L.format(),L},r.prototype.parseHost=function(){var b=this.host,R=n.exec(b);R&&(R=R[0],R!==":"&&(this.port=R.substr(1)),b=b.substr(0,b.length-R.length)),b&&(this.hostname=b)},wf.parse=x,wf.resolve=g,wf.resolveObject=S,wf.format=y,wf.Url=r,wf}var w1={exports:{}},bC=w1.exports,M3;function wC(){return M3||(M3=1,function(e){(function(r,t){e.exports?e.exports=t():r.xmlserializer=t()})(bC,function(){var r=function(f){return f.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},t=function(f){return f.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},n=function(f){return f.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},a=function(f){var _=f.value;return" "+f.name+'="'+t(_)+'"'},i=function(f){var _=f.tagName;return f.namespaceURI==="http://www.w3.org/1999/xhtml"&&(_=_.toLowerCase()),_},o=function(f,_){var E=Array.prototype.map.call(f.attributes||f.attrs,function(w){return w.name}).indexOf("xmlns")>=0;return!E&&(_||f.namespaceURI!==f.parentNode.namespaceURI)?' xmlns="'+f.namespaceURI+'"':""},s=function(f){return Array.prototype.map.call(f.childNodes,function(_){return v(_)}).join("")},u=function(f,_){var E="<"+i(f);return E+=o(f,_),Array.prototype.forEach.call(f.attributes||f.attrs,function(w){E+=a(w)}),f.childNodes.length>0?(E+=">",E+=s(f),E+="</"+i(f)+">"):E+="/>",E},c=function(f){var _=f.nodeValue||f.value||"";return n(_)},h=function(f){return"<!--"+f.data.replace(/-/g,"-")+"-->"},p=function(f){return"<![CDATA["+f.nodeValue+"]]>"},v=function(f,_){var E=_&&_.rootNode;if(f.nodeName==="#document"||f.nodeName==="#document-fragment")return s(f);if(f.tagName)return u(f,E);if(f.nodeName==="#text")return c(f);if(f.nodeName==="#comment")return h(f);if(f.nodeName==="#cdata-section")return p(f)};return{serializeToString:function(f){return r(v(f,{rootNode:!0}))}}})}(w1)),w1.exports}var gv={},I3;function _C(){if(I3)return gv;I3=1;var e=function(i){var o=new XMLSerializer;return Array.prototype.map.call(i.childNodes,function(s){return o.serializeToString(s)}).join("")},r=function(i){if(i.documentElement.tagName==="parsererror"&&i.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml")return i.documentElement;if((i.documentElement.tagName==="xml"||i.documentElement.tagName==="html")&&i.documentElement.childNodes&&i.documentElement.childNodes.length>0&&i.documentElement.childNodes[0].nodeName==="parsererror")return i.documentElement.childNodes[0];if(i.documentElement.tagName==="html"&&i.documentElement.childNodes&&i.documentElement.childNodes.length>0&&i.documentElement.childNodes[0].nodeName==="body"&&i.documentElement.childNodes[0].childNodes&&i.documentElement.childNodes[0].childNodes.length&&i.documentElement.childNodes[0].childNodes[0].nodeName==="parsererror")return i.documentElement.childNodes[0].childNodes[0]},t=[new RegExp(`^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)
|
|
153
|
-
?</div>`),new RegExp(`^(.+)
|
|
154
|
-
`)],n=function(i){var o=e(i),s,u;for(s=0;s<t.length;s++)if(u=t[s].exec(o),u)return u[1]},a=function(i){var o;if(i===null)throw new Error("Parse error");var s=r(i);if(s!==void 0)throw o=n(s)||"Parse error",new Error(o)};return gv.failOnParseError=function(i){return a(i),i},gv}var vv={},mv={},j3;function l0(){return j3||(j3=1,function(e){var r=e_();e.getDocumentBaseUrl=function(s){return s.baseURI!=="about:blank"?s.baseURI:null},e.clone=function(s){var u={},c;for(c in s)s.hasOwnProperty(c)&&(u[c]=s[c]);return u},e.cloneArray=function(s){return Array.prototype.slice.apply(s,[0])},e.joinUrl=function(s,u){return s?r.resolve(s,u):u},e.isDataUri=function(s){return/^data:/.test(s)},e.collectAndReportErrors=function(s){var u=[];return Promise.all(s.map(function(c){return c.catch(function(h){u.push(h)})})).then(function(){return u})};var t=null,n=function(s,u){return u===!1||u==="none"||u==="repeated"?((t===null||u!=="repeated")&&(t=Date.now()),s+"?_="+t):s};e.ajax=function(s,u){return new Promise(function(c,h){var p=new window.XMLHttpRequest,v=e.joinUrl(u.baseUrl,s),f,_=function(){h({msg:"Unable to load url",url:v})};f=n(v,u.cache),p.addEventListener("load",function(){p.status===200||p.status===0?c(p.response):_()},!1),p.addEventListener("error",_,!1);try{p.open("GET",f,!0),p.overrideMimeType(u.mimeType),p.send(null)}catch{_()}})},e.binaryAjax=function(s,u){var c=e.clone(u);return c.mimeType="text/plain; charset=x-user-defined",e.ajax(s,c).then(function(h){for(var p="",v=0;v<h.length;v++)p+=String.fromCharCode(h.charCodeAt(v)&255);return p})};var a=function(s){var u=function(c,h){return c.substring(0,h.length)===h};return u(s,"<?xml")||u(s,"<svg")?"image/svg+xml":"image/png"};e.getDataURIForImageURL=function(s,u){return e.binaryAjax(s,u).then(function(c){var h=btoa(c),p=a(c);return"data:"+p+";base64,"+h})};var i=[],o=function(s){return i.indexOf(s)<0&&i.push(s),i.indexOf(s)};e.memoize=function(s,u,c){if(typeof c!="object")throw new Error("cacheBucket is not an object");return function(){var h=Array.prototype.slice.call(arguments),p=u(h),v=o(s),f;return c[v]&&c[v][p]?c[v][p]:(f=s.apply(null,h),c[v]=c[v]||{},c[v][p]=f,f)}}}(mv)),mv}var yv={},F3;function SC(){if(F3)return yv;F3=1;var e=l0(),r=function(i,o){var s=null;i.hasAttribute("src")?s=i.getAttribute("src"):i.hasAttributeNS("http://www.w3.org/1999/xlink","href")?s=i.getAttributeNS("http://www.w3.org/1999/xlink","href"):i.hasAttribute("href")&&(s=i.getAttribute("href"));var u=e.getDocumentBaseUrl(i.ownerDocument),c=e.clone(o);return!c.baseUrl&&u&&(c.baseUrl=u),e.getDataURIForImageURL(s,c).then(function(h){return h},function(h){throw{resourceType:"image",url:h.url,msg:"Unable to load image "+h.url}})},t=function(i){return i.filter(function(o){var s=null;return o.hasAttribute("src")?s=o.getAttribute("src"):o.hasAttributeNS("http://www.w3.org/1999/xlink","href")?s=o.getAttributeNS("http://www.w3.org/1999/xlink","href"):o.hasAttribute("href")&&(s=o.getAttribute("href")),s!==null&&!e.isDataUri(s)})},n=function(i){return Array.prototype.filter.call(i,function(o){return o.type==="image"})},a=function(i){return Array.prototype.slice.call(i)};return yv.inline=function(i,o){var s=a(i.getElementsByTagName("img")),u=a(i.getElementsByTagName("image")),c=n(i.getElementsByTagName("input"));s=s.concat(u),s=s.concat(c);var h=t(s);return e.collectAndReportErrors(h.map(function(p){return r(p,o).then(function(v){p.attributes.src?p.attributes.src.value=v:p.attributes["xlink:href"]?p.attributes["xlink:href"].value=v:p.attributes.href&&(p.attributes.href.value=v)})}))},yv}var bv={},D3;function xC(){if(D3)return bv;D3=1;var e=l0(),r=function(i,o){var s=i.attributes.src.value,u=e.getDocumentBaseUrl(i.ownerDocument),c=e.clone(o);return!c.baseUrl&&u&&(c.baseUrl=u),e.ajax(s,c).catch(function(h){throw{resourceType:"script",url:h.url,msg:"Unable to load script "+h.url}})},t=function(i){return i.replace(/<\//g,"<\\/")},n=function(i,o){i.attributes.removeNamedItem("src"),i.textContent=t(o)},a=function(i){var o=i.getElementsByTagName("script");return Array.prototype.filter.call(o,function(s){return!!s.attributes.src})};return bv.inline=function(i,o){var s=a(i);return e.collectAndReportErrors(s.map(function(u){return r(u,o).then(function(c){n(u,c)})}))},bv}var wv={},_v={},B3;function Lm(){return B3||(B3=1,function(e){e.unquoteString=function(r){var t=/^"(.*)"$/,n=/^'(.*)'$/;return t.test(r)?r.replace(t,"$1"):n.test(r)?r.replace(n,"$1"):r},e.rulesForCssText=function(r){var t=document.implementation.createHTMLDocument(""),n=document.createElement("style"),a;return n.textContent=r,t.body.appendChild(n),a=n.sheet.cssRules,Array.prototype.slice.call(a)},e.cssRulesToText=function(r){return r.reduce(function(t,n){return t+n.cssText},"")},e.exchangeRule=function(r,t,n){var a=r.indexOf(t);r[a]=e.rulesForCssText(n)[0]},e.changeFontFaceRuleSrc=function(r,t,n){var a="@font-face { font-family: "+t.style.getPropertyValue("font-family")+"; ";t.style.getPropertyValue("font-style")&&(a+="font-style: "+t.style.getPropertyValue("font-style")+"; "),t.style.getPropertyValue("font-weight")&&(a+="font-weight: "+t.style.getPropertyValue("font-weight")+"; "),t.style.getPropertyValue("unicode-range")&&(a+="unicode-range: "+t.style.getPropertyValue("unicode-range")+"; "),a+="src: "+n+"}",e.exchangeRule(r,t,a)}}(_v)),_v}var Sv={},q3;function EC(){return q3||(q3=1,function(e){var r=Lm(),t=function(i){var o=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return i.replace(o,"$1")};e.extractCssUrl=function(i){var o=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,s;if(!o.test(i))throw new Error("Invalid url");return s=o.exec(i)[1],r.unquoteString(t(s))};var n=function(i){var o=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,s="(url\\("+o+"\\)|[^,\\s]+)",u="(?:\\s*"+s+")+",c="^\\s*("+u+")(?:\\s*,\\s*("+u+"))*\\s*$",h=new RegExp(u,"g"),p,v=[],f=function(_){var E=new RegExp(s,"g"),w=[],x;for(x=E.exec(_);x;)w.push(x[1]),x=E.exec(_);return w};if(i.match(new RegExp(c))){for(p=h.exec(i);p;)v.push(f(p[0])),p=h.exec(i);return v}return[]},a=function(i){var o,s;for(o=0;o<i.length;o++)try{return s=e.extractCssUrl(i[o]),{url:s,idx:o}}catch{}};e.parse=function(i){var o=n(i);return o.map(function(s){var u=a(s);return u?{preUrl:s.slice(0,u.idx),url:u.url,postUrl:s.slice(u.idx+1)}:{preUrl:s}})},e.serialize=function(i){var o=i.map(function(s){var u=[].concat(s.preUrl);return s.url&&u.push('url("'+s.url+'")'),s.postUrl&&(u=u.concat(s.postUrl)),u.join(" ")});return o.join(", ")}}(Sv)),Sv}function c1(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var xv={exports:{}},z3;function PC(){return z3||(z3=1,function(e,r){(function(t){e.exports=t()})(function(){return function t(n,a,i){function o(c,h){if(!a[c]){if(!n[c]){var p=typeof c1=="function"&&c1;if(!h&&p)return p(c,!0);if(s)return s(c,!0);var v=new Error("Cannot find module '"+c+"'");throw v.code="MODULE_NOT_FOUND",v}var f=a[c]={exports:{}};n[c][0].call(f.exports,function(_){var E=n[c][1][_];return o(E||_)},f,f.exports,t,n,a,i)}return a[c].exports}for(var s=typeof c1=="function"&&c1,u=0;u<i.length;u++)o(i[u]);return o}({1:[function(t,n,a){function i(u,c){function h(){this.constructor=u}h.prototype=c.prototype,u.prototype=new h}function o(u,c,h,p){this.message=u,this.expected=c,this.found=h,this.location=p,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}i(o,Error),o.buildMessage=function(u,c){var h={literal:function(x){return'"'+v(x.text)+'"'},class:function(x){var y="",g;for(g=0;g<x.parts.length;g++)y+=x.parts[g]instanceof Array?f(x.parts[g][0])+"-"+f(x.parts[g][1]):f(x.parts[g]);return"["+(x.inverted?"^":"")+y+"]"},any:function(x){return"any character"},end:function(x){return"end of input"},other:function(x){return x.description}};function p(x){return x.charCodeAt(0).toString(16).toUpperCase()}function v(x){return x.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"+p(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+p(y)})}function f(x){return x.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"+p(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+p(y)})}function _(x){return h[x.type](x)}function E(x){var y=new Array(x.length),g,S;for(g=0;g<x.length;g++)y[g]=_(x[g]);if(y.sort(),y.length>0){for(g=1,S=1;g<y.length;g++)y[g-1]!==y[g]&&(y[S]=y[g],S++);y.length=S}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 w(x){return x?'"'+v(x)+'"':"end of input"}return"Expected "+E(u)+" but "+w(c)+" found."};function s(u,c){c=c!==void 0?c:{};var h={},p={start:_e},v=_e,f="",_=function(){return[]},E=",",w=Q(",",!1),x=function(he,Oe){return[he].concat(Oe)},y=function(he){return[he]},g=function(he,Oe){return{url:he,format:Oe}},S=function(he){return{url:he}},b="url(",R=Q("url(",!1),L=")",T=Q(")",!1),F=function(he){return he},I="format(",O=Q("format(",!1),C="local(",A=Q("local(",!1),j=function(he){return{local:he}},N=/^[^)]/,B=ee([")"],!0,!1),W=function(he){return Te.extractValue(he.join(""))},Y=/^[ \t\r\n\f]/,Z=ee([" "," ","\r",`
|
|
155
|
-
`,"\f"],!1,!1),V=0,H=[{line:1,column:1}],U=0,D=[],$;if("startRule"in c){if(!(c.startRule in p))throw new Error(`Can't start parsing from rule "`+c.startRule+'".');v=p[c.startRule]}function Q(he,Oe){return{type:"literal",text:he,ignoreCase:Oe}}function ee(he,Oe,Me){return{type:"class",parts:he,inverted:Oe,ignoreCase:Me}}function te(){return{type:"end"}}function ae(he){var Oe=H[he],Me;if(Oe)return Oe;for(Me=he-1;!H[Me];)Me--;for(Oe=H[Me],Oe={line:Oe.line,column:Oe.column};Me<he;)u.charCodeAt(Me)===10?(Oe.line++,Oe.column=1):Oe.column++,Me++;return H[he]=Oe,Oe}function se(he,Oe){var Me=ae(he),ze=ae(Oe);return{start:{offset:he,line:Me.line,column:Me.column},end:{offset:Oe,line:ze.line,column:ze.column}}}function ce(he){V<U||(V>U&&(U=V,D=[]),D.push(he))}function me(he,Oe,Me){return new o(o.buildMessage(he,Oe),he,Oe,Me)}function _e(){var he,Oe;return he=Le(),he===h&&(he=V,Oe=f,Oe!==h&&(Oe=_()),he=Oe),he}function Le(){var he,Oe,Me,ze,pt,yt;if(he=V,Oe=Re(),Oe!==h){for(Me=[],ze=Ae();ze!==h;)Me.push(ze),ze=Ae();if(Me!==h)if(u.charCodeAt(V)===44?(ze=E,V++):(ze=h,ce(w)),ze!==h){for(pt=[],yt=Ae();yt!==h;)pt.push(yt),yt=Ae();pt!==h?(yt=Le(),yt!==h?(Oe=x(Oe,yt),he=Oe):(V=he,he=h)):(V=he,he=h)}else V=he,he=h;else V=he,he=h}else V=he,he=h;return he===h&&(he=V,Oe=Re(),Oe!==h&&(Oe=y(Oe)),he=Oe),he}function Re(){var he;return he=Pe(),he===h&&(he=Se()),he}function Pe(){var he,Oe,Me,ze;if(he=V,Oe=ve(),Oe!==h){if(Me=[],ze=Ae(),ze!==h)for(;ze!==h;)Me.push(ze),ze=Ae();else Me=h;Me!==h?(ze=it(),ze!==h?(Oe=g(Oe,ze),he=Oe):(V=he,he=h)):(V=he,he=h)}else V=he,he=h;return he===h&&(he=V,Oe=ve(),Oe!==h&&(Oe=S(Oe)),he=Oe),he}function ve(){var he,Oe,Me,ze;return he=V,u.substr(V,4)===b?(Oe=b,V+=4):(Oe=h,ce(R)),Oe!==h?(Me=be(),Me!==h?(u.charCodeAt(V)===41?(ze=L,V++):(ze=h,ce(T)),ze!==h?(Oe=F(Me),he=Oe):(V=he,he=h)):(V=he,he=h)):(V=he,he=h),he}function it(){var he,Oe,Me,ze;return he=V,u.substr(V,7)===I?(Oe=I,V+=7):(Oe=h,ce(O)),Oe!==h?(Me=be(),Me!==h?(u.charCodeAt(V)===41?(ze=L,V++):(ze=h,ce(T)),ze!==h?(Oe=F(Me),he=Oe):(V=he,he=h)):(V=he,he=h)):(V=he,he=h),he}function Se(){var he,Oe,Me,ze;return he=V,u.substr(V,6)===C?(Oe=C,V+=6):(Oe=h,ce(A)),Oe!==h?(Me=be(),Me!==h?(u.charCodeAt(V)===41?(ze=L,V++):(ze=h,ce(T)),ze!==h?(Oe=j(Me),he=Oe):(V=he,he=h)):(V=he,he=h)):(V=he,he=h),he}function be(){var he,Oe,Me;if(he=V,Oe=[],N.test(u.charAt(V))?(Me=u.charAt(V),V++):(Me=h,ce(B)),Me!==h)for(;Me!==h;)Oe.push(Me),N.test(u.charAt(V))?(Me=u.charAt(V),V++):(Me=h,ce(B));else Oe=h;return Oe!==h&&(Oe=W(Oe)),he=Oe,he}function Ae(){var he;return Y.test(u.charAt(V))?(he=u.charAt(V),V++):(he=h,ce(Z)),he}var Te=t("../util");if($=v(),$!==h&&V===u.length)return $;throw $!==h&&V<u.length&&ce(te()),me(D,U<u.length?u.charAt(U):null,U<u.length?se(U,U+1):se(U,U))}n.exports={SyntaxError:o,parse:s}},{"../util":3}],2:[function(t,n,a){var i=t("./grammar");a.SyntaxError=function(o,s){this.message=o,this.offset=s},a.parse=function(o){try{return i.parse(o)}catch(s){throw new a.SyntaxError(s.message,s.offset)}},a.serialize=function(o){return o.map(function(s){var u;return s.url?(u='url("'+s.url+'")',s.format&&(u+=' format("'+s.format+'")')):u='local("'+s.local+'")',u}).join(", ")}},{"./grammar":1}],3:[function(t,n,a){var i=function(s){var u=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return s.replace(u,"$1")},o=function(s){var u=/^"(.*)"$/,c=/^'(.*)'$/;return u.test(s)?s.replace(u,"$1"):c.test(s)?s.replace(c,"$1"):s};a.extractValue=function(s){return o(i(s))}},{}]},{},[2])(2)})}(xv)),xv.exports}var U3;function OC(){return U3||(U3=1,function(e){var r=l0(),t=Lm(),n=EC(),a=PC(),i=function(y,g,S){y.style.setProperty(g,S,y.style.getPropertyPriority(g))},o=function(y){return y.filter(function(g){return g.type===window.CSSRule.STYLE_RULE&&(g.style.getPropertyValue("background-image")||g.style.getPropertyValue("background"))})},s=function(y){var g=[];return y.forEach(function(S){S.style.getPropertyValue("background-image")?g.push({property:"background-image",value:S.style.getPropertyValue("background-image"),rule:S}):S.style.getPropertyValue("background")&&g.push({property:"background",value:S.style.getPropertyValue("background"),rule:S})}),g},u=function(y){return y.filter(function(g){return g.type===window.CSSRule.FONT_FACE_RULE&&g.style.getPropertyValue("src")})},c=function(y){return y.filter(function(g){return g.type===window.CSSRule.IMPORT_RULE&&g.href})},h=function(y){var g=[];return y.forEach(function(S,b){S.url&&!r.isDataUri(S.url)&&g.push(b)}),g},p=function(y){var g=[];return y.forEach(function(S,b){S.url&&!r.isDataUri(S.url)&&g.push(b)}),g};e.adjustPathsOfCssResources=function(y,g){var S=o(g),b=s(S),R=!1;return b.forEach(function(L){var T=n.parse(L.value),F=h(T),I;F.length>0&&(F.forEach(function(O){var C=T[O].url,A=r.joinUrl(y,C);T[O].url=A}),I=n.serialize(T),i(L.rule,L.property,I),R=!0)}),u(g).forEach(function(L){var T=L.style.getPropertyValue("src"),F,I;try{F=a.parse(T)}catch{return}I=p(F),I.length>0&&(I.forEach(function(O){var C=F[O].url,A=r.joinUrl(y,C);F[O].url=A}),t.changeFontFaceRuleSrc(g,L,a.serialize(F)),R=!0)}),c(g).forEach(function(L){var T=L.href,F=r.joinUrl(y,T);t.exchangeRule(g,L,"@import url("+F+");"),R=!0}),R};var v=function(y,g,S){var b=y.indexOf(g);y.splice(b,1),S.forEach(function(R,L){y.splice(b+L,0,R)})},f=function(y,g,S,b){var R=g.href,L;return R=t.unquoteString(R),L=r.joinUrl(b.baseUrl,R),S.indexOf(L)>=0?(v(y,g,[]),Promise.resolve([])):(S.push(L),r.ajax(R,b).then(function(T){var F=t.rulesForCssText(T);return e.loadCSSImportsForRules(F,S,b).then(function(I){return e.adjustPathsOfCssResources(R,F),v(y,g,F),I.errors})},function(T){throw{resourceType:"stylesheet",url:T.url,msg:"Unable to load stylesheet "+T.url}}))};e.loadCSSImportsForRules=function(y,g,S){var b=c(y),R=[],L=!1;return Promise.all(b.map(function(T){return f(y,T,g,S).then(function(F){R=R.concat(F),L=!0},function(F){R.push(F)})})).then(function(){return{hasChanges:L,errors:R}})};var _=function(y,g){var S=n.parse(y),b=h(S),R=!1;return r.collectAndReportErrors(b.map(function(L){var T=S[L].url;return r.getDataURIForImageURL(T,g).then(function(F){S[L].url=F,R=!0},function(F){throw{resourceType:"backgroundImage",url:F.url,msg:"Unable to load background-image "+F.url}})})).then(function(L){return{backgroundValue:n.serialize(S),hasChanges:R,errors:L}})},E=function(y,g){var S=o(y),b=s(S),R=[],L=!1;return Promise.all(b.map(function(T){return _(T.value,g).then(function(F){F.hasChanges&&(i(T.rule,T.property,F.backgroundValue),L=!0),R=R.concat(F.errors)})})).then(function(){return{hasChanges:L,errors:R}})},w=function(y,g){var S=!1,b,R;try{b=a.parse(y)}catch{b=[]}return R=p(b),r.collectAndReportErrors(R.map(function(L){var T=b[L],F=T.format||"woff";return r.binaryAjax(T.url,g).then(function(I){var O=btoa(I);T.url="data:font/"+F+";base64,"+O,S=!0},function(I){throw{resourceType:"fontFace",url:I.url,msg:"Unable to load font-face "+I.url}})})).then(function(L){return{srcDeclarationValue:a.serialize(b),hasChanges:S,errors:L}})},x=function(y,g){var S=u(y),b=[],R=!1;return Promise.all(S.map(function(L){var T=L.style.getPropertyValue("src");return w(T,g).then(function(F){F.hasChanges&&(t.changeFontFaceRuleSrc(y,L,F.srcDeclarationValue),R=!0),b=b.concat(F.errors)})})).then(function(){return{hasChanges:R,errors:b}})};e.loadAndInlineCSSResourcesForRules=function(y,g){var S=!1,b=[];return Promise.all([E,x].map(function(R){return R(y,g).then(function(L){S=S||L.hasChanges,b=b.concat(L.errors)})})).then(function(){return{hasChanges:S,errors:b}})}}(wv)),wv}var H3;function AC(){return H3||(H3=1,function(e){var r=l0(),t=SC(),n=xC(),a=OC(),i=Lm(),o=function(w){return r.joinUrl(w,".")},s=function(w){var x=w.map(function(y,g){return g===w.length-1&&(y={baseUrl:o(y.baseUrl)}),JSON.stringify(y)});return x},u=function(w,x){return x.cache!==!1&&x.cache!=="none"&&x.cacheBucket?r.memoize(w,s,x.cacheBucket):w},c=function(w,x,y){var g=i.rulesForCssText(w);return a.loadCSSImportsForRules(g,x,y).then(function(S){return a.loadAndInlineCSSResourcesForRules(g,y).then(function(b){var R=S.errors.concat(b.errors),L=S.hasChanges||b.hasChanges;return L&&(w=i.cssRulesToText(g)),{hasChanges:L,content:w,errors:R}})})},h=function(w,x,y){var g=w.textContent,S=u(c,x);return S(g,y,x).then(function(b){return b.hasChanges&&(w.childNodes[0].nodeValue=b.content),r.cloneArray(b.errors)})},p=function(w){var x=w.getElementsByTagName("style");return Array.prototype.filter.call(x,function(y){return!y.attributes.type||y.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(w,x){var y=p(w),g=[],S=[],b;return b=r.clone(x),b.baseUrl=b.baseUrl||r.getDocumentBaseUrl(w),Promise.all(y.map(function(R){return h(R,b,S).then(function(L){g=g.concat(L)})})).then(function(){return g})};var v=function(w,x){var y=w.parentNode,g;x=x.trim(),x&&(g=w.ownerDocument.createElement("style"),g.type="text/css",g.appendChild(w.ownerDocument.createTextNode(x)),y.insertBefore(g,w)),y.removeChild(w)},f=function(w,x){return r.ajax(w,x).then(function(y){var g=i.rulesForCssText(y);return{content:y,cssRules:g}}).then(function(y){var g=a.adjustPathsOfCssResources(w,y.cssRules);return{content:y.content,cssRules:y.cssRules,hasChanges:g}}).then(function(y){return a.loadCSSImportsForRules(y.cssRules,[],x).then(function(g){return{content:y.content,cssRules:y.cssRules,hasChanges:y.hasChanges||g.hasChanges,errors:g.errors}})}).then(function(y){return a.loadAndInlineCSSResourcesForRules(y.cssRules,x).then(function(g){return{content:y.content,cssRules:y.cssRules,hasChanges:y.hasChanges||g.hasChanges,errors:y.errors.concat(g.errors)}})}).then(function(y){var g=y.content;return y.hasChanges&&(g=i.cssRulesToText(y.cssRules)),{content:g,errors:y.errors}})},_=function(w,x){var y=w.attributes.href.value,g=r.getDocumentBaseUrl(w.ownerDocument),S=r.clone(x);!S.baseUrl&&g&&(S.baseUrl=g);var b=u(f,x);return b(y,S).then(function(R){return{content:R.content,errors:r.cloneArray(R.errors)}})},E=function(w){var x=w.getElementsByTagName("link");return Array.prototype.filter.call(x,function(y){return y.attributes.rel&&y.attributes.rel.value==="stylesheet"&&(!y.attributes.type||y.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(w,x){var y=E(w),g=[];return Promise.all(y.map(function(S){return _(S,x).then(function(b){v(S,b.content+`
|
|
156
|
-
`),g=g.concat(b.errors)},function(b){g.push({resourceType:"stylesheet",url:b.url,msg:"Unable to load stylesheet "+b.url})})})).then(function(){return g})},e.loadAndInlineImages=t.inline,e.loadAndInlineScript=n.inline,e.inlineReferences=function(w,x){var y=[],g=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return x.inlineScripts!==!1&&g.push(e.loadAndInlineScript),Promise.all(g.map(function(S){return S(w,x).then(function(b){y=y.concat(b)})})).then(function(){return y})}}(vv)),vv}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
|
|
157
|
-
* http://www.github.com/cburgmer/rasterizeHTML.js
|
|
158
|
-
* Copyright (c) 2022 Christoph Burgmer; Licensed MIT */var CC=b1.exports,G3;function kC(){return G3||(G3=1,function(e){(function(r,t){r===void 0&&window!==void 0&&(r=window),e.exports?e.exports=t(e_(),wC(),_C(),AC()):r.rasterizeHTML=t(r.url,r.xmlserializer,r.sanedomparsererror,r.inlineresources)})(CC,function(r,t,n,a){var i=function(_){var E={},w=[];E.joinUrl=function(g,S){return g?_.resolve(g,S):S},E.getConstantUniqueIdFor=function(g){return w.indexOf(g)<0&&w.push(g),w.indexOf(g)},E.clone=function(g){var S={},b;for(b in g)g.hasOwnProperty(b)&&(S[b]=g[b]);return S};var x=function(g){return typeof g=="object"&&g!==null},y=function(g){return x(g)&&Object.prototype.toString.apply(g).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return E.parseOptionalParameters=function(g){var S={canvas:null,options:{}};return g[0]==null||y(g[0])?(S.canvas=g[0]||null,S.options=E.clone(g[1])):S.options=E.clone(g[0]),S},E}(r),o=function(_){var E={},w=function(x,y,g){var S=x[y];return x[y]=function(){var b=Array.prototype.slice.call(arguments);return g.apply(this,[b,S])},S};return E.baseUrlRespectingXhr=function(x,y){var g=function(){var S=new x;return w(S,"open",function(b,R){var L=b.shift(),T=b.shift(),F=_.joinUrl(y,T);return R.apply(this,[L,F].concat(b))}),S};return g},E.finishNotifyingXhr=function(x){var y=0,g=0,S=!1,b,R=new Promise(function(T){b=function(){var F=y-g;F<=0&&S&&T({totalCount:y})}}),L=function(){var T=new x;return w(T,"send",function(F,I){return y+=1,I.apply(this,arguments)}),T.addEventListener("load",function(){g+=1,b()}),T};return L.waitForRequestsToFinish=function(){return S=!0,b(),R},L},E}(i),s=function(){var _={},E=function(L){return Array.prototype.slice.call(L)};_.addClassName=function(L,T){L.className+=" "+T},_.addClassNameRecursively=function(L,T){_.addClassName(L,T),L.parentNode!==L.ownerDocument&&_.addClassNameRecursively(L.parentNode,T)};var w=function(L,T){var F=L.parentStyleSheet,I=E(F.cssRules).indexOf(L);F.insertRule(T,I+1),F.deleteRule(I)},x=function(L,T){var F=L.cssText.replace(/^[^\{]+/,""),I=T+" "+F;w(L,I)},y=function(L){return E(L).reduce(function(T,F){return T+F.cssText},"")},g=function(L){L.textContent=y(L.sheet.cssRules)},S=function(L){var T=document.implementation.createHTMLDocument(""),F=document.createElement("style");F.textContent=L.textContent,T.body.appendChild(F),L.sheet=F.sheet},b=function(L){return"((?:^|[^.#:\\w])|(?=\\W))("+L.join("|")+")(?=\\W|$)"},R=function(L,T,F){var I=b(T);E(L.querySelectorAll("style")).forEach(function(O){typeof O.sheet>"u"&&S(O);var C=E(O.sheet.cssRules).filter(function(A){return A.selectorText&&new RegExp(I,"i").test(A.selectorText)});C.length&&(C.forEach(function(A){var j=A.selectorText.replace(new RegExp(I,"gi"),function(N,B,W){return B+F(W)});j!==A.selectorText&&x(A,j)}),g(O))})};return _.rewriteCssSelectorWith=function(L,T,F){R(L,[T],function(){return F})},_.lowercaseCssTypeSelectors=function(L,T){R(L,T,function(F){return F.toLowerCase()})},_.findHtmlOnlyNodeNames=function(L){var T=L.ownerDocument.createTreeWalker(L,NodeFilter.SHOW_ELEMENT),F={},I={},O;do O=T.currentNode.tagName.toLowerCase(),T.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?F[O]=!0:I[O]=!0;while(T.nextNode());return Object.keys(F).filter(function(C){return!I[C]})},_}(),u=function(_){var E={},w=function(y){return Array.prototype.slice.call(y)},x={active:!0,hover:!0,focus:!1,target:!1};return E.fakeUserAction=function(y,g,S){var b=y.querySelector(g),R=":"+S,L="rasterizehtml"+S;b&&(x[S]?_.addClassNameRecursively(b,L):_.addClassName(b,L),_.rewriteCssSelectorWith(y,R,"."+L))},E.persistInputValues=function(y){var g=y.querySelectorAll("input"),S=y.querySelectorAll("textarea"),b=function(R){return R.type==="checkbox"||R.type==="radio"};w(g).filter(b).forEach(function(R){R.checked?R.setAttribute("checked",""):R.removeAttribute("checked")}),w(g).filter(function(R){return!b(R)}).forEach(function(R){R.setAttribute("value",R.value)}),w(S).forEach(function(R){R.textContent=R.value})},E.rewriteTagNameSelectorsToLowerCase=function(y){_.lowercaseCssTypeSelectors(y,_.findHtmlOnlyNodeNames(y))},E}(s),c=function(_,E,w,x){var y={},g=function(W,Y,Z,V){var H=W.createElement(Y);return H.style.visibility="hidden",H.style.width=Z+"px",H.style.height=V+"px",H.style.position="absolute",H.style.top=-1e4-V+"px",H.style.left=-1e4-Z+"px",W.getElementsByTagName("body")[0].appendChild(H),H},S=function(W){return W>0?new Promise(function(Y){setTimeout(Y,W)}):Promise.resolve()};y.executeJavascript=function(W,Y){return new Promise(function(Z){var V=g(x.document,"iframe",Y.width,Y.height),H=W.outerHTML,U=[],D=Y.executeJsTimeout||0,$=function(){x.document.getElementsByTagName("body")[0].removeChild(V)},Q=function(){var se=V.contentDocument;Z({document:se,errors:U,cleanUp:$})},ee=V.contentWindow.XMLHttpRequest,te=E.finishNotifyingXhr(ee),ae=E.baseUrlRespectingXhr(te,Y.baseUrl);V.onload=function(){S(D).then(te.waitForRequestsToFinish).then(Q)},V.contentDocument.open(),V.contentWindow.XMLHttpRequest=ae,V.contentWindow.onerror=function(se){U.push({resourceType:"scriptExecution",msg:se})},V.contentDocument.write("<!DOCTYPE html>"),V.contentDocument.write(H),V.contentDocument.close()})};var b=function(W,Y,Z){var V=W.createElement("iframe");return V.style.width=Y+"px",V.style.height=Z+"px",V.style.visibility="hidden",V.style.position="absolute",V.style.top=-1e4-Z+"px",V.style.left=-1e4-Y+"px",V.style.borderWidth=0,V.sandbox="allow-same-origin",V.scrolling="no",V},R=function(W,Y,Z){var V=Math.floor(W/Z),H=Math.floor(Y/Z);return b(x.document,V,H)},L=function(W,Y,Z,V){return{width:Math.max(W.width*V,Y),height:Math.max(W.height*V,Z)}},T=function(W,Y){var Z=W.querySelector(Y);if(Z)return Z;if(W.ownerDocument.querySelector(Y)===W)return W;throw{message:"Clipping selector not found"}},F=function(W,Y,Z,V,H){var U=Math.max(W.scrollWidth,W.clientWidth),D=Math.max(W.scrollHeight,W.clientHeight),$,Q,ee,te,ae,se,ce,me;return Y?(se=T(W,Y),ce=se.getBoundingClientRect(),$=ce.top,Q=ce.left,ee=ce.width,te=ce.height):($=0,Q=0,ee=U,te=D),me=L({width:ee,height:te},Z,V,H),ae=x.getComputedStyle(W.ownerDocument.documentElement).fontSize,{left:Q,top:$,width:me.width,height:me.height,viewportWidth:U,viewportHeight:D,rootFontSize:ae}},I=function(W,Y){var Z=W.tagName;return Y.querySelector(Z)},O=function(W){var Y=W.tagName.toLowerCase();return Y==="html"||Y==="body"?W.outerHTML:'<body style="margin: 0;">'+W.outerHTML+"</body>"};y.calculateDocumentContentSize=function(W,Y){return new Promise(function(Z,V){var H=Y.zoom||1,U;U=R(Y.width,Y.height,H),x.document.getElementsByTagName("body")[0].appendChild(U),U.onload=function(){var D=U.contentDocument,$;try{$=F(I(W,D),Y.clip,Y.width,Y.height,H),Z($)}catch(Q){V(Q)}finally{x.document.getElementsByTagName("body")[0].removeChild(U)}},U.contentDocument.open(),U.contentDocument.write("<!DOCTYPE html>"),U.contentDocument.write(O(W)),U.contentDocument.close()})},y.parseHtmlFragment=function(W){var Y=x.document.implementation.createHTMLDocument("");Y.documentElement.innerHTML=W;var Z=Y.querySelector("body").firstChild;if(!Z)throw"Invalid source";return Z};var C=function(W,Y){var Z=/<html((?:\s+[^>]*)?)>/im.exec(Y),V=x.document.implementation.createHTMLDocument(""),H,U,D,$;if(Z)for(H="<div"+Z[1]+"></div>",V.documentElement.innerHTML=H,D=V.querySelector("div"),U=0;U<D.attributes.length;U++)$=D.attributes[U],W.documentElement.setAttribute($.name,$.value)};y.parseHTML=function(W){var Y=x.document.implementation.createHTMLDocument("");return Y.documentElement.innerHTML=W,C(Y,W),Y};var A=function(W){try{return w.failOnParseError(W)}catch(Y){throw{message:"Invalid source",originalError:Y}}};y.validateXHTML=function(W){var Y=new DOMParser,Z=Y.parseFromString(W,"application/xml");A(Z)};var j=null,N=function(W,Y){return Y==="none"||Y==="repeated"?((j===null||Y!=="repeated")&&(j=Date.now()),W+"?_="+j):W},B=function(W,Y){return new Promise(function(Z,V){var H=new window.XMLHttpRequest,U=_.joinUrl(Y.baseUrl,W),D=N(U,Y.cache),$=function(Q){V({message:"Unable to load page",originalError:Q})};H.addEventListener("load",function(){H.status===200||H.status===0?Z(H.responseXML):$(H.statusText)},!1),H.addEventListener("error",function(Q){$(Q)},!1);try{H.open("GET",D,!0),H.responseType="document",H.send(null)}catch(Q){$(Q)}})};return y.loadDocument=function(W,Y){return B(W,Y).then(function(Z){return A(Z)})},y}(i,o,n,window),h=function(_){var E={},w=function(I,O){return O?URL.createObjectURL(new Blob([I],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(I)},x=function(I){I instanceof Blob&&URL.revokeObjectURL(I)},y='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',g=function(I){return new Promise(function(O,C){var A=document.createElement("canvas"),j=new Image;j.onload=function(){var N=A.getContext("2d");try{N.drawImage(j,0,0),A.toDataURL("image/png"),O(!0)}catch{O(!1)}},j.onerror=C,j.src=I})},S=function(){var I=w(y,!0);return g(I).then(function(O){return x(I),O?!1:g(w(y,!1)).then(function(C){return C})},function(){return!1})},b=function(){if(_.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},R=function(){return new Promise(function(I,O){b()&&_.URL?S().then(function(C){I(!C)},function(){O()}):I(!1)})},L,T=function(){return L===void 0&&(L=R()),L},F=function(I){return T().then(function(O){return w(I,O)})};return E.renderSvg=function(I){return new Promise(function(O,C){var A,j,N=function(){j.onload=null,j.onerror=null},B=function(){A&&x(A)};j=new Image,j.onload=function(){N(),B(),O(j)},j.onerror=function(){B(),C()},F(I).then(function(W){A=W,j.src=A},C)})},E}(window),p=function(_,E,w,x){var y={},g=function(I,O){var C=O||1,A={width:I.width,height:I.height,"font-size":I.rootFontSize};return C!==1&&(A.style="transform:scale("+C+"); transform-origin: 0 0;"),A},S=function(I){var O,C,A,j;O=Math.round(I.viewportWidth),C=Math.round(I.viewportHeight),A=-I.left,j=-I.top;var N={x:A,y:j,width:O,height:C};return N},b=function(I){var O=I.style||"";I.style=O+"float: left;"},R=function(I){I.externalResourcesRequired=!0},L=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},T=function(I){var O=Object.keys(I);return O.length?" "+O.map(function(C){return C+'="'+I[C]+'"'}).join(" "):""},F=function(I,O,C){var A=x.serializeToString(I);E.validateXHTML(A);var j=S(O);return b(j),R(j),'<svg xmlns="http://www.w3.org/2000/svg"'+T(g(O,C))+">"+L()+"<foreignObject"+T(j)+">"+A+"</foreignObject></svg>"};return y.getSvgForDocument=function(I,O,C){return w.rewriteTagNameSelectorsToLowerCase(I),F(I,O,C)},y.drawDocumentAsSvg=function(I,O){return["hover","active","focus","target"].forEach(function(C){O[C]&&w.fakeUserAction(I,O[C],C)}),E.calculateDocumentContentSize(I,O).then(function(C){return y.getSvgForDocument(I,C,O.zoom)})},y}(i,c,u,t),v=function(_,E,w,x,y,g){var S={},b=function(I){return{message:"Error rendering page",originalError:I}},R=function(I){return y.renderSvg(I).then(function(O){return{image:O,svg:I}},function(O){throw b(O)})},L=function(I,O){try{O.getContext("2d").drawImage(I,0,0)}catch(C){throw b(C)}},T=function(I,O,C){return x.drawDocumentAsSvg(I,C).then(R).then(function(A){return O&&L(A.image,O),A})},F=function(I,O){return E.executeJavascript(I,O).then(function(C){var A=C.document;return w.persistInputValues(A),{document:A,errors:C.errors,cleanUp:C.cleanUp}})};return S.rasterize=function(I,O,C){var A;return A=_.clone(C),A.inlineScripts=C.executeJs===!0,g.inlineReferences(I,A).then(function(j){return C.executeJs?F(I,C).then(function(N){return{element:N.document.documentElement,errors:j.concat(N.errors),cleanUp:N.cleanUp}}):{element:I,errors:j,cleanUp:function(){}}}).then(function(j){return T(j.element,O,C).then(function(N){return j.cleanUp(),{image:N.image,svg:N.svg,errors:j.errors}})})},S}(i,c,u,p,h,a),f=function(_,E,w){var x={},y=function(L,T){var F=300,I=200,O=L?L.width:F,C=L?L.height:I,A=T.width!==void 0?T.width:O,j=T.height!==void 0?T.height:C;return{width:A,height:j}},g=function(L){var T=y(L.canvas,L.options),F;return F=_.clone(L.options),F.width=T.width,F.height=T.height,F};x.drawDocument=function(){var L=arguments[0],T=Array.prototype.slice.call(arguments,1),F=_.parseOptionalParameters(T),I=L.documentElement?L.documentElement:L;return w.rasterize(I,F.canvas,g(F))};var S=function(L,T,F){var I=E.parseHTML(L);return x.drawDocument(I,T,F)};x.drawHTML=function(){var L=arguments[0],T=Array.prototype.slice.call(arguments,1),F=_.parseOptionalParameters(T);return S(L,F.canvas,F.options)};var b=function(L,T,F){var I=document.implementation.createHTMLDocument("");I.replaceChild(L.documentElement,I.documentElement);var O=F?_.clone(F):{};return F.baseUrl||(O.baseUrl=T),{document:I,options:O}},R=function(L,T,F){return E.loadDocument(L,F).then(function(I){var O=b(I,L,F);return x.drawDocument(O.document,T,O.options)})};return x.drawURL=function(){var L=arguments[0],T=Array.prototype.slice.call(arguments,1),F=_.parseOptionalParameters(T);return R(L,F.canvas,F.options)},x}(i,c,v);return f})}(b1)),b1.exports}var Ev={},V3;function LC(){return V3||(V3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.optimizeCss=function(t,n){if(!t.includes("@font-face"))return"";const a=new Set,i=new Set;n&&((n.match(/font-weight:\s*(\d+|bold|normal)/gi)||[]).forEach(p=>{const v=p.split(":")[1].trim();v==="bold"?a.add("700"):v==="normal"?a.add("400"):/^\d+$/.test(v)&&a.add(v)}),(n.match(/font-style:\s*(italic|normal)/gi)||[]).forEach(p=>{p.split(":")[1].trim().toLowerCase()==="italic"&&i.add("italic")}),/<(b|strong)\b/i.test(n)&&a.add("700"),/<(i|em)\b/i.test(n)&&i.add("italic"));const o=(0,r.removeTags)(n);o&&o.trim()&&a.add("400"),a.size===0&&a.add("400");const s=a,u=i.has("italic"),c=Array.from(new Set(o)).map(p=>p.codePointAt(0)).filter(p=>p!==void 0),h=t.split(/}\s*/).map(p=>p&&p+"}").filter(p=>/@font-face/.test(p)&&(v=>{const f=(v.match(/font-weight:\s*(\d+)/)||[])[1];if(f&&!s.has(f)||/font-style:\s*italic/.test(v)&&!u)return!1;const _=v.match(/unicode-range:\s*([^;]+);/);if(!_)return!0;const E=_[1].split(",").map(w=>{const[x,y=x]=w.replace("U+","").split("-").map(g=>parseInt(g,16));return[x,y]});return c.some(w=>E.some(([x,y])=>w>=x&&w<=y))})(p)).join(`
|
|
159
|
-
`);return h?`<style>${h}</style>`:""};const r=pm()}(Ev)),Ev}var W3;function t_(){return W3||(W3=1,function(e){var r,t=ic&&ic.__createBinding||(Object.create?function(y,g,S,b){b===void 0&&(b=S);var R=Object.getOwnPropertyDescriptor(g,S);R&&!("get"in R?!g.__esModule:R.writable||R.configurable)||(R={enumerable:!0,get:function(){return g[S]}}),Object.defineProperty(y,b,R)}:function(y,g,S,b){b===void 0&&(b=S),y[b]=g[S]}),n=ic&&ic.__setModuleDefault||(Object.create?function(y,g){Object.defineProperty(y,"default",{enumerable:!0,value:g})}:function(y,g){y.default=g}),a=ic&&ic.__importStar||(r=function(y){return r=Object.getOwnPropertyNames||function(g){var S=[];for(var b in g)Object.prototype.hasOwnProperty.call(g,b)&&(S[S.length]=b);return S},r(y)},function(y){if(y&&y.__esModule)return y;var g={};if(y!=null)for(var S=r(y),b=0;b<S.length;b++)S[b]!=="default"&&t(g,y,S[b]);return n(g,y),g});Object.defineProperty(e,"__esModule",{value:!0}),e.prerenderFont=e.resetStyleContent=void 0,e.isContentWrapping=function({html:y}){const g=document.createElement("div");g.innerHTML=y,g.style.display="inline-block",g.style.position="fixed",g.style.top="0px",g.style.left="0px",g.style.zIndex="1000",g.style.whiteSpace="nowrap",g.style.visibility="hidden";const S=p();S.appendChild(g);const b=g.textContent,R=g.childNodes[0],L=(b==null?void 0:b.split(/\s+/))||[];let T=!1;for(let F=0;F<L.length;F++){const I=L[F];if(R&&(R.textContent=I,T=R.scrollWidth>g.clientWidth,T))break}return S.removeChild(g),T},e.detectSize=function(y){const g=document.createElement("div");g.innerHTML=y,g.style.display="inline-block",g.style.position="fixed",g.style.top="0px",g.style.left="0px",g.style.zIndex="1000";const S=p();S.appendChild(g);const b=g.getBoundingClientRect();return S.removeChild(g),{width:b.width,height:b.height}},e.htmlToCanvas=async function({html:y,width:g,height:S,fontFamily:b,padding:R,font:L,pixelRatio:T}){let F="";if(b!=="Arial"&&!L){const B=(0,o.getGoogleFontsVariants)();F=await async function(W,Y){const Z=`${W}|${Y}`;if(x.has(Z))return x.get(Z);const V=`https://fonts.googleapis.com/css?family=${W}:${Y}&display=swap`,H=await(await fetch(V)).text();return x.set(Z,H),H}(b,B)}if(L){const B=L.styles||(L.url?[{src:`url("${L.url}")`}]:w(b));F="",B.forEach(W=>{F+=`
|
|
160
|
-
@font-face {
|
|
161
|
-
font-family: '${b}';
|
|
162
|
-
src: ${W.src};
|
|
163
|
-
font-style: ${W.fontStyle||"normal"};
|
|
164
|
-
font-weight: ${W.fontWeight||"normal"};
|
|
165
|
-
}
|
|
166
|
-
`})}let I="";F&&(I=(0,u.optimizeCss)(F,y)),y+=I+c;const O=g+2*R,C=S+2*R,A=document.createElement("canvas"),j=await i.drawHTML(`<div style="padding: ${R}px;" dir="auto">${y}</div>`,A,{width:O,height:C,cacheBucket:_});(0,s.trySetCanvasSize)(A,O*T,C*T);const N=A.getContext("2d");return N==null||N.drawImage(j.image,0,0,O,C,0,0,A.width,A.height),A};const i=a(kC()),o=Ih(),s=H8(),u=LC();e.resetStyleContent=`
|
|
167
|
-
p {
|
|
168
|
-
margin: 0;
|
|
169
|
-
padding: 0;
|
|
170
|
-
word-wrap: break-word; /* Required for Firefox */
|
|
171
|
-
/* a text may have several spaces, we need to preserve them */
|
|
172
|
-
white-space: pre-wrap;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/* Reset default list styles and setup counters */
|
|
176
|
-
ul, ol {
|
|
177
|
-
list-style: none; /* Remove default markers */
|
|
178
|
-
padding-inline-start: 0; /* Reset padding */
|
|
179
|
-
margin: 0;
|
|
180
|
-
display: block; /* Use block instead of inline-block for better text wrapping */
|
|
181
|
-
width: 100%;
|
|
182
|
-
text-decoration: inherit;
|
|
183
|
-
counter-reset: ol-counter; /* Initialize counter for ol */
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
li {
|
|
187
|
-
position: relative; /* Needed for absolute positioning of ::before */
|
|
188
|
-
padding-inline-start: 2.1em; /* Space for the marker (start side) */
|
|
189
|
-
margin: 0; /* Reset default li margins */
|
|
190
|
-
word-wrap: break-word; /* Required for Firefox text wrapping */
|
|
191
|
-
white-space: pre-wrap; /* Preserve spaces and allow wrapping */
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
li::before {
|
|
195
|
-
content: ''; /* Base content */
|
|
196
|
-
position: absolute;
|
|
197
|
-
/* Use logical properties for positioning */
|
|
198
|
-
inset-inline-start: 0; /* Position marker at the start edge (left in LTR, right in RTL) */
|
|
199
|
-
top: 0; /* Adjust vertical alignment */
|
|
200
|
-
/* Prevent letter-spacing from affecting the marker */
|
|
201
|
-
letter-spacing: normal;
|
|
202
|
-
/* Define width to ensure consistent spacing and alignment */
|
|
203
|
-
display: inline-block;
|
|
204
|
-
width: 2em; /* Width for the marker container */
|
|
205
|
-
/* Align multi-digit numbers to the end (right in LTR, left in RTL) */
|
|
206
|
-
text-align: end;
|
|
207
|
-
/* Space between marker and text (using logical property) */
|
|
208
|
-
margin-inline-end: 0.8em; /* Pushes text away from marker (2.5em total = 1.7em width + 0.8em margin)*/
|
|
209
|
-
/* Prevent marker style from inheriting list item styles */
|
|
210
|
-
font-weight: normal;
|
|
211
|
-
font-style: normal;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/* Style for bullet points */
|
|
215
|
-
ul > li::before {
|
|
216
|
-
content: '•'; /* Literal bullet character */
|
|
217
|
-
/* Center the bullet within its allocated width */
|
|
218
|
-
text-align: center; /* Override text-align: end for bullets */
|
|
219
|
-
font-size: 1.2em;
|
|
220
|
-
top: 0em; /* Re-adjust vertical alignment for bullet */
|
|
221
|
-
/* Bullets don't need number alignment, width can be tighter */
|
|
222
|
-
width: 2em;
|
|
223
|
-
/* Adjust margin to maintain overall padding */
|
|
224
|
-
margin-inline-end: 1.5em; /* 2.5em total padding = 1em width + 1.5em margin */
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
/* Style for numbers using counter */
|
|
228
|
-
ol > li {
|
|
229
|
-
counter-increment: ol-counter; /* Increment counter for each li in ol */
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
ol > li::before {
|
|
233
|
-
content: counter(ol-counter) "."; /* Display counter value + dot */
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
.ql-indent-1 {
|
|
237
|
-
margin-inline-start: 0.5em;
|
|
238
|
-
}
|
|
239
|
-
.ql-indent-2 {
|
|
240
|
-
margin-inline-start: 1em;
|
|
241
|
-
}
|
|
242
|
-
.ql-indent-3 {
|
|
243
|
-
margin-inline-start: 1.5em;
|
|
244
|
-
}
|
|
245
|
-
`;const c=`
|
|
246
|
-
<style>
|
|
247
|
-
html, body {
|
|
248
|
-
padding: 0;
|
|
249
|
-
margin: 0;
|
|
250
|
-
}
|
|
251
|
-
${e.resetStyleContent}
|
|
252
|
-
</style>
|
|
253
|
-
`;let h;const p=()=>(h||(h=document.createElement("div"),h.id="polotno-hidden-do-not-touch",h.style.overflow="hidden",h.style.position="relative",document.body.appendChild(h),h.innerHTML=`<style>#polotno-hidden-do-not-touch {${e.resetStyleContent}}</style>`),h),v=new Map,f=navigator.userAgent.includes("Firefox");e.prerenderFont=async y=>{if(v.has(y))return v.get(y);const g=(async()=>{const S=`<div style="font-family: ${y}; font-size: 100px;">${y}<strong>${y}</strong></div>`,b=document.createElement("div");b.innerHTML=S,b.style.visibility="hidden",b.style.position="absolute";const R=p();R.appendChild(b);const L=f?180:50;await new Promise(T=>setTimeout(T,L)),R.removeChild(b)})();return v.set(y,g),g};const _={},E={},w=y=>{if(E[y])return E[y];const g=function(b){const R=[];for(let L=0;L<document.styleSheets.length;L++){const T=document.styleSheets[L];try{const F=T.cssRules;if(F)for(let I=0;I<F.length;I++){const O=F[I];O instanceof CSSFontFaceRule&&O.style.fontFamily.replace(/['"]/g,"")===b&&R.push(O)}}catch(F){console.warn(`Could not access stylesheet: ${T.href}`,F)}}return R}(y),S=g.filter(b=>b.style.fontFamily.replace(/['"]/g,"")===y).map(b=>({src:b.style.getPropertyValue("src"),fontStyle:b.style.getPropertyValue("font-style")||"normal",fontWeight:b.style.getPropertyValue("font-weight")||"normal"}));return E[y]=S,S},x=new Map}(ic)),ic}var nh={},Pv={},$3;function r_(){return $3||($3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.keyframes=e.glob=e.extractCss=void 0,e.css=h,e.setup=function(w,x,y,g){i.p=x,p=w,v=y,f=g},e.styled=function(w,x){let y=this||{};return function(){let g=arguments;function S(b,R){let L=Object.assign({},b),T=L.className||S.className;y.p=Object.assign({theme:v&&v()},L),y.o=/ *go\d+/.test(T),L.className=h.apply(y,g)+(T?" "+T:""),x&&(L.ref=R);let F=w;return w[0]&&(F=L.as||w,delete L.as),f&&F[0]&&f(L),p(F,L)}return x?x(S):S}};let r={data:""},t=w=>typeof window=="object"?((w?w.querySelector("#_goober"):window._goober)||Object.assign((w||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:w||r,n=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,i=(w,x)=>{let y="",g="",S="";for(let b in w){let R=w[b];b[0]=="@"?b[1]=="i"?y=b+" "+R+";":g+=b[1]=="f"?i(R,b):b+"{"+i(R,b[1]=="k"?"":x)+"}":typeof R=="object"?g+=i(R,x?x.replace(/([^,])+/g,L=>b.replace(/(^:.*)|([^,])+/g,T=>/&/.test(T)?T.replace(/&/g,L):L?L+" "+T:T)):b):R!=null&&(b=b.replace(/[A-Z]/g,"-$&").toLowerCase(),S+=i.p?i.p(b,R):b+":"+R+";")}return y+(x&&S?x+"{"+S+"}":S)+g},o={},s=w=>{if(typeof w=="object"){let x="";for(let y in w)x+=y+s(w[y]);return x}return w},u=(w,x,y,g,S)=>{let b=s(w),R=o[b]||(o[b]=(L=>{let T=0,F=11;for(;T<L.length;)F=101*F+L.charCodeAt(T++)>>>0;return"go"+F})(b));if(!o[R]){let L=b!==w?w:(T=>{let F,I=[{}];for(;F=n.exec(T.replace(a,""));)F[4]?I.shift():F[3]?I.unshift(I[0][F[3]]=I[0][F[3]]||{}):I[0][F[1]]=F[2];return I[0]})(w);o[R]=i(S?{["@keyframes "+R]:L}:L,y?"":"."+R)}return((L,T,F)=>{T.data.indexOf(L)==-1&&(T.data=F?L+T.data:T.data+L)})(o[R],x,g),R},c=(w,x,y)=>w.reduce((g,S,b)=>{let R=x[b];if(R&&R.call){let L=R(y),T=L&&L.props&&L.props.className||/^go/.test(L)&&L;R=T?"."+T:L&&typeof L=="object"?L.props?"":i(L,""):L===!1?"":L}return g+S+(R??"")},"");function h(w){let x=this||{},y=w.call?w(x.p):w;return u(y.unshift?y.raw?c(y,[].slice.call(arguments,1),x.p):y.reduce((g,S)=>Object.assign(g,S&&S.call?S(x.p):S),{}):y,t(x.target),x.g,x.o,x.k)}e.extractCss=w=>{let x=t(w),y=x.data;return x.data="",y};let p,v,f,_=h.bind({g:1}),E=h.bind({k:1});e.glob=_,e.keyframes=E}(Pv)),Pv}var Y3;function NC(){if(Y3)return nh;Y3=1;var e=nh&&nh.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(nh,"__esModule",{value:!0});const r=e(ai()),t=r_();return(0,t.setup)(r.default.createElement),nh.default=t.styled,nh}var X3;function TC(){return X3||(X3=1,function(e){var r,t=Dl&&Dl.__createBinding||(Object.create?function(B,W,Y,Z){Z===void 0&&(Z=Y);var V=Object.getOwnPropertyDescriptor(W,Y);V&&!("get"in V?!W.__esModule:V.writable||V.configurable)||(V={enumerable:!0,get:function(){return W[Y]}}),Object.defineProperty(B,Z,V)}:function(B,W,Y,Z){Z===void 0&&(Z=Y),B[Z]=W[Y]}),n=Dl&&Dl.__setModuleDefault||(Object.create?function(B,W){Object.defineProperty(B,"default",{enumerable:!0,value:W})}:function(B,W){B.default=W}),a=Dl&&Dl.__importStar||(r=function(B){return r=Object.getOwnPropertyNames||function(W){var Y=[];for(var Z in W)Object.prototype.hasOwnProperty.call(W,Z)&&(Y[Y.length]=Z);return Y},r(B)},function(B){if(B&&B.__esModule)return B;var W={};if(B!=null)for(var Y=r(B),Z=0;Z<Y.length;Z++)Y[Z]!=="default"&&t(W,B,Y[Z]);return n(W,B),W}),i=Dl&&Dl.__importDefault||function(B){return B&&B.__esModule?B:{default:B}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLElement=e.setQuillContent=e.createQuill=e.setQuillFormats=e.quillRef=void 0,e.setCursorFromCoords=N;const o=i(ai()),s=Us,u=Fu,c=i(FA()),h=a(vs),p=gc(),v=Ap(),f=z8(),_=Op(),E=t_(),w=If(),x=Mh,y=i(NC()),g=jf(),S=pm(),b=a(Ih()),R=rf(),L=q8(),T=vs,F=G8();e.quillRef=h.observable({enabled:!1,currentFormat:{},editor:h.observable.object({instance:null},{},{deep:!1})});const I=(0,y.default)("div",o.default.forwardRef)`
|
|
254
|
-
.ql-editor {
|
|
255
|
-
outline: none;
|
|
256
|
-
}
|
|
257
|
-
.ql-clipboard {
|
|
258
|
-
pointer-events: none;
|
|
259
|
-
}
|
|
260
|
-
${E.resetStyleContent}
|
|
261
|
-
strong {
|
|
262
|
-
font-weight: 700;
|
|
263
|
-
}
|
|
264
|
-
.ql-direction-rtl {
|
|
265
|
-
direction: rtl;
|
|
266
|
-
}
|
|
267
|
-
`;let O=["bold","color","font","italic","size","strike","underline","indent","list","direction"];e.setQuillFormats=B=>{O=B},e.createQuill=B=>new c.default(B,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:O}),e.setQuillContent=(B,W)=>{var Y=B.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+W+"<p><br></p></div>");B.setContents(Y),B.history.clear()};const C=({html:B,onBlur:W,onChange:Y,element:Z,clickCoords:V})=>{const H=o.default.useRef(null);o.default.useEffect(()=>{if(!H.current)return;const D=(0,e.createQuill)(H.current);return h.runInAction(()=>{e.quillRef.editor.instance=D}),window.__polotnoQuill=D,D.on("text-change",()=>{D.getSelection()&&h.runInAction(()=>{e.quillRef.currentFormat=D.getFormat()}),setTimeout(()=>{var $;const Q=($=H.current)===null||$===void 0?void 0:$.childNodes[0];Y(Q.innerHTML)},10)}),V?setTimeout(()=>N(D,V),0):D.setSelection(0,0,"api"),D.on("selection-change",($,Q,ee)=>{$&&h.runInAction(()=>{e.quillRef.currentFormat=D.getFormat()})}),H.current.childNodes[0].addEventListener("blur",$=>{var Q;if(!((Q=$.relatedTarget)===null||Q===void 0)&&Q.classList.contains("ql-clipboard"))return;(function(te){return!!te&&!!te.closest(".sketch-picker")})($.relatedTarget)||W()}),()=>{h.runInAction(()=>{e.quillRef.editor.instance=null,e.quillRef.currentFormat={}}),delete window.__polotnoQuill}},[]),o.default.useEffect(()=>(0,T.reaction)(()=>Z.text,()=>{var D;const $=e.quillRef.editor.instance;if(!$)return;const Q=$.getSelection();((D=H.current)===null||D===void 0?void 0:D.childNodes[0].innerHTML)===Z.text||((0,e.setQuillContent)($,B),Q&&($.setSelection(Q.index,Q.length),h.runInAction(()=>{e.quillRef.currentFormat=$.getFormat()})))},{fireImmediately:!0}),[]);const U={color:Z.fill};return Z.fill.indexOf("gradient")>=0&&(U.backgroundColor=Z.fill,U.backgroundImage=Z.fill,U.backgroundSize="100% 100%",U.backgroundRepeat="repeat",U.webkitBackgroundClip="text",U.MozBackgroundClip="text",U.WebkitTextFillColor="transparent",U.MozTextFillColor="transparent"),o.default.createElement(I,{ref:H,style:Object.assign(Object.assign({},U),{fontSize:Z.fontSize,fontWeight:Z.fontWeight,width:Z.a.width,fontFamily:'"'+Z.fontFamily+'"',lineHeight:Z.lineHeight,letterSpacing:Z.letterSpacing*Z.fontSize+"px",textAlign:Z.align,opacity:Math.max(Z.a.opacity,.2)}),dir:(0,f.getDir)((0,S.removeTags)(Z.text))})};function A(B,{fontFamily:W="",color:Y="black"}={}){let Z=`color: ${Y||B.fill}`;return B.fill.indexOf("gradient")>=0&&(Z=`
|
|
268
|
-
background-color: ${Y};
|
|
269
|
-
background-image: ${B.fill};
|
|
270
|
-
background-size: 100% 100%;
|
|
271
|
-
background-repeat: repeat;
|
|
272
|
-
-webkit-background-clip: text;
|
|
273
|
-
-moz-background-clip: text;
|
|
274
|
-
-webkit-text-fill-color: transparent;
|
|
275
|
-
-moz-text-fill-color: transparent;
|
|
276
|
-
`),`<div style="${["white-space: pre-wrap",`width: ${Math.round(B.width||100)}px`,Z,`font-size: ${B.fontSize}px`,`font-family: '${W}'`,`text-align: ${B.align}`,B.textDecoration?`text-decoration: ${B.textDecoration}; text-decoration-color: ${Y||B.fill}; text-decoration-layer: over`:"",B.lineHeight?`line-height: ${B.lineHeight}`:"",B.letterSpacing?`letter-spacing: ${B.letterSpacing*B.fontSize}px`:"",B.fontStyle?`font-style: ${B.fontStyle}`:"",B.fontWeight?`font-weight: ${B.fontWeight}`:"",B.strokeWidth?`-webkit-text-stroke: ${B.strokeWidth}px ${B.stroke}`:"",B.strokeWidth?"paint-order: stroke fill":""].filter(Boolean).join("; ")}" contentEditable dir="${(0,f.getDir)((0,S.removeTags)(B.text))}">${(0,S.sanitizeHtml)(B.text).replace(/\n/g,"</br>")}</div>`}const j=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function N(B,W){if(!B||!W)return;const{x:Y,y:Z}=W;try{let V=null;if(document.caretRangeFromPoint)V=document.caretRangeFromPoint(Y,Z);else if(document.caretPositionFromPoint){const H=document.caretPositionFromPoint(Y,Z);H&&(V=document.createRange(),V.setStart(H.offsetNode,H.offset))}if(V){const H=c.default.find(V.startContainer,!0);if(H){const U=H.offset(B.scroll)+V.startOffset;return void B.setSelection(U,0,"api")}}}catch{}B.setSelection(0,0,"api")}e.HTMLElement=(0,s.observer)(({element:B,store:W})=>{const Y=o.default.useRef(null),[Z,V]=o.default.useState(),[H,U]=o.default.useState(!1),[D,$]=o.default.useState(!1),Q=o.default.useRef(B.height),ee=W.selectedShapes.indexOf(B)>=0&&B.selectable,te=B.fontSize/3,{textVerticalResizeEnabled:ae}=p.flags,se=(0,f.usePrevious)(B.fontFamily),[ce]=(0,f.useFontLoader)(W,B.fontFamily),me=B._editModeEnabled;(0,w.useFadeIn)(Y);const _e=ce?B.fontFamily:se!==B.fontFamily?se:"Arial",Le=(0,_.useColor)(B).fill,Re=A(B,{fontFamily:_e,color:Le}),{width:Pe,height:ve}=function(He,Qe,Ze){return o.default.useMemo(()=>(0,E.detectSize)(He),[He,Qe.width,Ze])}(Re,B,ce);o.default.useEffect(()=>{if(!ce)return;if(!B.height)return void B.set({height:ve});const{textOverflow:He}=p.flags;if(He!=="change-font-size"||H)He==="resize"&&(ae&&B.height<ve&&W.history.ignore(()=>{B.set({height:ve})}),ae||B.height===ve||W.history.ignore(()=>{B.set({height:ve})}));else{const Qe=(Ze=>{let tt=Ze.fontSize;for(let Ht=1;Ht<50;Ht++){const Pt=A(Object.assign(Object.assign({},Ze.toJSON()),{fontSize:tt}),{fontFamily:Ze.fontFamily}),{height:It}=(0,E.detectSize)(Pt),qt=Ze.height&&It>Ze.height,Ie=(0,E.isContentWrapping)({html:Pt});if(!qt&&!Ie)break;tt-=.5}return tt})(B);Qe!==B.fontSize?W.history.ignore(()=>{B.set({fontSize:Qe})}):B.height!==ve&&(ae&&B.height<ve?W.history.ignore(()=>{B.set({height:ve})}):ae||W.history.ignore(()=>{B.set({height:ve})}))}});const it=o.default.useMemo(()=>{const He={lastArgs:null,lastResult:null};return async function(Qe){return He.lastArgs&&He.lastResult&&(Ze=He.lastArgs,tt=Qe,JSON.stringify(Ze)===JSON.stringify(tt))||(He.lastResult=await(0,E.htmlToCanvas)(Qe),He.lastArgs=Object.assign({},Qe)),He.lastResult;var Ze,tt}},[]),Se=o.default.useRef(0),be=o.default.useRef(null);o.default.useEffect(()=>{H||me||(async()=>{Se.current++;const He=Se.current;let Qe=(0,g.incrementLoader)(`text ${B.id} ${He}`);be.current&&be.current(),be.current=Qe,$(!0);let Ze=null;const tt=j?5:1;for(let Ht=0;Ht<tt;Ht++){const Pt=Ht>0?it:E.htmlToCanvas;try{if(Ze=await Pt({skipCache:Ht>0,html:Re,width:B.width||1,height:B.height||ve||1,fontFamily:_e,padding:te,pixelRatio:W._elementsPixelRatio,font:W.fonts.find(It=>It.fontFamily===_e)||b.globalFonts.find(It=>It.fontFamily===_e)}),He!==Se.current)return;if(!function(It){const qt=It.getContext("2d").getImageData(0,0,It.width,It.height).data;for(let Ie=0;Ie<qt.length;Ie+=4)if(qt[Ie+3]!==0)return!0;return!1}(Ze)&&j){await new Promise(It=>setTimeout(It,50*(Ht+1)));continue}break}catch(It){console.error(It),(0,g.triggerLoadError)(`Error rendering rich text with id ${B.id}`);break}}Ze?V(Ze):Qe?(Qe(),Qe=null):console.error("Finish function is called twice!"),$(!1)})()},[Re,H,ve,me,_e,B.height,W._elementsPixelRatio,ce]);const[Ae,Te]=(0,F.useDelayer)(D,300),[he]=(0,F.useDelayer)(H,300,!0),Oe=he||Ae;o.default.useEffect(()=>{if(!Oe)return h.autorun(()=>{const He=Y.current;(0,v.applyFilter)(He,B)})},[Z,Oe,B.shadowColor,B.shadowOffsetX,B.shadowOffsetY,B.shadowOpacity]),o.default.useEffect(()=>{Z&&!D&&be.current&&(be.current(),be.current=null)},[Z,D]),o.default.useEffect(()=>()=>{be.current&&be.current()},[]);let Me=0;B.verticalAlign==="middle"&&(Me=(B.height-ve)/2),B.verticalAlign==="bottom"&&(Me=B.height-ve);const ze=(0,f.getLineHeight)({fontLoaded:ce,fontFamily:B.fontFamily,fontSize:B.fontSize,lineHeight:B.lineHeight}),pt=(0,R.isTouchDevice)(),yt=o.default.useRef(null);return o.default.createElement(o.default.Fragment,null,o.default.createElement(u.Rect,{x:B.a.x,y:B.a.y,offsetX:B.backgroundPadding*(B.fontSize*ze*.5),offsetY:B.backgroundPadding*(B.fontSize*ze*.5),rotation:B.a.rotation,hideInExport:!B.showInExport,listening:!1,visible:B.backgroundEnabled,opacity:B.backgroundOpacity*B.a.opacity,fill:B.backgroundColor,width:B.a.width+B.backgroundPadding*(B.fontSize*ze),height:B.a.height+B.backgroundPadding*(B.fontSize*ze),cornerRadius:B.backgroundCornerRadius*(B.fontSize*ze*.5)}),o.default.createElement(u.Rect,{ref:Y,name:"element",x:B.a.x,y:B.a.y,listening:B.selectable,rotation:B.a.rotation,width:B.a.width,height:B.a.height,visible:!Oe,draggable:pt?B.draggable&&ee:B.draggable,preventDefault:!pt||ee,opacity:me?0:B.a.opacity,hideInExport:!B.showInExport,onDragMove:He=>{B.set({x:He.target.x(),y:He.target.y()})},onDragEnd:He=>{B.set({x:He.target.x(),y:He.target.y()})},id:B.id,onDblClick:He=>{B.contentEditable&&(yt.current={x:He.evt.clientX,y:He.evt.clientY},B.toggleEditMode(!0))},onDblTap:He=>{var Qe;if(B.contentEditable){const Ze=(Qe=He.evt.changedTouches)===null||Qe===void 0?void 0:Qe[0];yt.current=Ze?{x:Ze.clientX,y:Ze.clientY}:null,B.toggleEditMode(!0)}},onTransformStart:He=>{U(!0),Q.current=B.height},onTransform:He=>{var Qe;const Ze=He.target,tt=((Qe=Ze.getStage())===null||Qe===void 0?void 0:Qe.findOne("Transformer")).getActiveAnchor(),Ht=tt==="middle-left"||tt==="middle-right",Pt=tt==="top-center"||tt==="bottom-center",It=Ze.scaleX();if(Ht){const qt=Ze.scaleX(),Ie=Math.max(Ze.width()*qt,B.fontSize);if(Ze.width(Ie),Ze.scaleX(1),p.flags.textVerticalResizeEnabled){const ke=Math.max(ve,Q.current);B.set({height:ke})}B.set({width:Ie,x:Ze.x(),y:Ze.y()})}else if(Pt){let qt=p.flags.textOverflow==="resize"?ve:B.lineHeight*B.fontSize;const Ie=Math.max(qt,He.target.height()*He.target.scaleY());Ze.scaleY(1),B.set({x:Ze.x(),y:Ze.y(),height:Ie,rotation:Ze.rotation()})}else Ze.scaleX(1),Ze.scaleY(1),B.set({fontSize:B.fontSize*It,letterSpacing:B.letterSpacing,width:Ze.width()*It,x:Ze.x(),y:Ze.y(),rotation:Ze.rotation(),height:Ze.height()*It})},onTransformEnd:He=>{U(!1),$(!0);const Qe=He.target.scaleX();He.target.scaleX(1),He.target.scaleY(1),B.set({fontSize:B.fontSize*Qe,width:He.target.width()*Qe,x:He.target.x(),y:He.target.y(),rotation:He.target.rotation(),shadowBlur:B.shadowBlur*Qe,shadowOffsetX:B.shadowOffsetX*Qe,shadowOffsetY:B.shadowOffsetY*Qe,strokeWidth:B.strokeWidth*Qe})}}),o.default.createElement(u.Image,{ref:Y,image:Z,x:B.a.x,y:B.a.y,offsetX:te,offsetY:te-Me,listening:!1,rotation:B.a.rotation,width:B.a.width+2*te,height:B.a.height+2*te,visible:!Oe,opacity:me?0:B.a.opacity,shadowEnabled:B.shadowEnabled,shadowBlur:B.shadowBlur,shadowOffsetX:B.shadowOffsetX,shadowOffsetY:B.shadowOffsetY,shadowColor:B.shadowColor,shadowOpacity:B.shadowOpacity,hideInExport:!B.showInExport}),Oe&&o.default.createElement(u.Group,{x:B.a.x,y:B.a.y,rotation:B.a.rotation,offsetY:-Me},o.default.createElement(x.Html,{divProps:{style:{pointerEvents:"none"}}},o.default.createElement(I,{dangerouslySetInnerHTML:{__html:Re},style:{pointerEvents:"none",opacity:B.a.opacity}}))),me&&o.default.createElement(u.Group,{x:B.a.x,y:B.a.y,rotation:B.a.rotation,offsetY:-Me},o.default.createElement(x.Html,null,o.default.createElement(C,{html:Re,element:B,onChange:He=>{const Qe=(0,L.getLimitedFontSize)({oldText:(0,S.removeTags)(B.text),newText:(0,S.removeTags)(He),element:B});B.set({text:He,fontSize:Qe})},onBlur:He=>{B.toggleEditMode(!1),Te(!0),(0,S.removeTags)(B.text)===""&&B.removable&&!B.placeholder&&W.deleteElements([B.id])},clickCoords:yt.current}))))})}(Dl)),Dl}var Wd={},$d={},Ov={},K3;function Dh(){return K3||(K3=1,function(e){function r(o){return o/180*Math.PI}function t(o,s,u,c,h){const p=Math.sqrt(u*u+c*c);return h+=Math.atan2(c,u),{x:o+p*Math.cos(h),y:s+p*Math.sin(h)}}function n(o){const{x:s,y:u,width:c,height:h}=o,p=r(o.rotation),v=t(s,u,0,0,p),f=t(s,u,c,0,p),_=t(s,u,c,h,p),E=t(s,u,0,h,p),w=Math.min(v.x,f.x,_.x,E.x),x=Math.min(v.y,f.y,_.y,E.y),y=Math.max(v.x,f.x,_.x,E.x),g=Math.max(v.y,f.y,_.y,E.y);return{x:w,y:x,width:y-w,height:g-x,minX:w,minY:x,maxX:y,maxY:g}}function a(o){const s=r(o.rotation||0);return{x:o.x+o.width/2*Math.cos(s)+o.height/2*Math.sin(-s),y:o.y+o.height/2*Math.cos(s)+o.width/2*Math.sin(s)}}function i(o,s,u){const c=r(s),h=u.x+(o.x-u.x)*Math.cos(c)-(o.y-u.y)*Math.sin(c),p=u.y+(o.x-u.x)*Math.sin(c)+(o.y-u.y)*Math.cos(c);return Object.assign(Object.assign({},o),{rotation:o.rotation+s,x:h,y:p})}Object.defineProperty(e,"__esModule",{value:!0}),e.degToRad=r,e.getClientRect=n,e.getTotalClientRect=function(o){const s=o.map(v=>n(v)),u=Math.min(...s.map(v=>v.minX)),c=Math.min(...s.map(v=>v.minY)),h=Math.max(...s.map(v=>v.maxX)),p=Math.max(...s.map(v=>v.maxY));return{x:u,y:c,width:h-u,height:p-c,minX:u,minY:c,maxX:h,maxY:p}},e.getCenter=a,e.rotateAroundPoint=i,e.rotateAroundCenter=function(o,s){return i(o,s,a(o))}}(Ov)),Ov}var Z3;function n_(){return Z3||(Z3=1,function(e){var r=$d&&$d.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.setSnapFilterFunc=e.setSnapGuideStyle=void 0,e.useSnap=function(h,p,v){const f=t.default.useRef(null);(0,e.setSnapGuideStyle)(v);const _=S=>S.hasName("element")||S.hasName("page-background")||!f.current&&S.hasName("elements-area");function E(S){var b;const R=(b=h.current)===null||b===void 0?void 0:b.getStage(),L=[],T=[];return R.find(_).forEach(F=>{if(!(S.indexOf(F)>=0)){var I=F.getClientRect({skipShadow:!0,skipStroke:!0});L.push({offset:I.x,node:F,snap:"start"},{offset:I.x+I.width,node:F,snap:"end"},{offset:I.x+I.width/2,node:F,snap:"center"}),T.push({offset:I.y,node:F,snap:"start"},{offset:I.y+I.height,node:F,snap:"end"},{offset:I.y+I.height/2,node:F,snap:"center"})}}),{vertical:L,horizontal:T}}function w(S){var b;const R=(b=h.current)===null||b===void 0?void 0:b.getLayer(),L=R==null?void 0:R.children.find(T=>T.name()==="line-guides");S.forEach(T=>{if(T.orientation==="H"){var F=new n.default.Line({x:-R.getStage().x(),y:-R.getStage().y(),points:[-6e3,T.lineGuide,6e3,T.lineGuide],stroke:i.stroke,strokeWidth:i.strokeWidth,name:"guid-line",dash:i.dash});L==null||L.add(F),R.batchDraw()}else T.orientation==="V"&&(F=new n.default.Line({x:-R.getStage().x(),y:-R.getStage().y(),points:[T.lineGuide,-6e3,T.lineGuide,6e3],stroke:i.stroke,strokeWidth:i.strokeWidth,name:"guid-line",dash:i.dash}),L==null||L.add(F))})}const x=S=>{const b=S.target.getLayer().children.find(A=>A.name()==="line-guides");b==null||b.destroyChildren();var R=E(S.target.nodes()),L=function(A){const j=A.__getNodeRect(),N=(0,a.getClientRect)(Object.assign(Object.assign({},j),{rotation:n.default.Util.radToDeg(j.rotation)})),B=A.getAbsolutePosition();return{vertical:[{guide:N.x,offset:B.x-N.x,snap:"start",nodes:A.nodes()},{guide:N.x+N.width/2,offset:B.x-N.x-N.width/2,snap:"center",nodes:A.nodes()},{guide:N.x+N.width,offset:B.x-N.x-N.width,snap:"end",nodes:A.nodes()}],horizontal:[{guide:N.y,offset:B.y-N.y,snap:"start",nodes:A.nodes()},{guide:N.y+N.height/2,offset:B.y-N.y-N.height/2,snap:"center",nodes:A.nodes()},{guide:N.y+N.height,offset:B.y-N.y-N.height,snap:"end",nodes:A.nodes()}]}}(S.target),T=s(R,L);if(!T.length)return;w(T);const F=S.target.getAbsolutePosition(),I=(S.target.nodes().map(A=>A.getAbsolutePosition()),Object.assign({},F));T.forEach(A=>{switch(A.snap){case"start":case"center":case"end":switch(A.orientation){case"V":I.x=A.lineGuide+A.offset;break;case"H":I.y=A.lineGuide+A.offset}}});const O=I.x-F.x,C=I.y-F.y;S.evt.ctrlKey||S.evt.metaKey||S.target.nodes().forEach(A=>{const j=A.getAbsolutePosition();A.setAbsolutePosition({x:j.x+O,y:j.y+C})})},y=(S,b,R)=>{var L;const T=h.current,F=T.getLayer().children.find(Y=>Y.name()==="line-guides");if(F==null||F.destroyChildren(),T.getActiveAnchor()==="rotater")return b;const I=T.getActiveAnchor(),O=c[I],C=(L=T.findOne(`.${O}`))===null||L===void 0?void 0:L.getAbsolutePosition();if(!C)return b;const A={x:S.x-C.x,y:S.y-C.y},j=function(Y,Z){const V=u(Y,Z)/u(Z,Z);return{x:V*Z.x,y:V*Z.y}}({x:b.x-S.x,y:b.y-S.y},A),N={x:S.x+j.x,y:S.y+j.y};var B=s(E(T.nodes()),{vertical:[{guide:N.x,offset:0,snap:"start",nodes:T.nodes()}],horizontal:[{guide:N.y,offset:0,snap:"start",nodes:T.nodes()}]});if(!B.length||(w(B),R.ctrlKey||R.metaKey))return b;const W=[];if(B.forEach(Y=>{const Z=function(V,H,U){if(U.orientation==="V"){const D=U.lineGuide;if(Math.abs(H.x-V.x)<1e-4)return null;const $=(H.y-V.y)/(H.x-V.x);return{x:D,y:$*D+(V.y-$*V.x)}}{const D=U.lineGuide;if(Math.abs(H.y-V.y)<1e-4)return null;const $=(H.y-V.y)/(H.x-V.x);return{x:(D-V.y)/$+V.x,y:D}}}(N,C,{orientation:Y.orientation,lineGuide:Y.lineGuide});Z&&W.push(Z)}),W.length>0){let Y=W[0],Z=Math.sqrt(Math.pow(N.x-Y.x,2)+Math.pow(N.y-Y.y,2));if(W.forEach(V=>{const H=Math.sqrt(Math.pow(N.x-V.x,2)+Math.pow(N.y-V.y,2));H<Z&&(Z=H,Y=V)}),Z<10)return Y}return N},g=S=>{if(!S.target)return;const b=S.target.getLayer(),R=b.children.find(L=>L.name()==="line-guides");R==null||R.destroyChildren(),b.batchDraw()};t.default.useEffect(()=>{h.current&&(h.current.anchorDragBoundFunc(y),h.current.on("dragstart",S=>{setTimeout(()=>{if(n.default.DD._dragElements.size===0)return;const b=[...n.default.DD._dragElements.entries()],R=b.find(([L,T])=>T.node instanceof n.default.Transformer);R&&(b.splice(b.indexOf(R),1),b.unshift(R),n.default.DD._dragElements.clear(),b.forEach(([L,T])=>{n.default.DD._dragElements.set(L,T)}))})}),h.current.on("dragmove",x),h.current.on("dragend",g),h.current.on("transformend",g),h.current.on("transform",S=>{var b,R;S.evt.ctrlKey||S.evt.metaKey?(b=h.current)===null||b===void 0||b.rotationSnapTolerance(0):(R=h.current)===null||R===void 0||R.rotationSnapTolerance(5)}))},[])},e.useAnchorSnap=function(h,p,v){const f=w=>w.hasName("element")||w.hasName("line-anchor")||w.hasName("page-background")||w.hasName("elements-area"),_=w=>{const x=w.target.getLayer().children.find(T=>T.name()==="line-guides");x==null||x.destroyChildren();var y,g=s(function(T){var F;const I=(F=h.current)===null||F===void 0?void 0:F.getStage();var O=[],C=[];return I.find(f).forEach(A=>{if(!(T.indexOf(A)>=0)){var j=A.getClientRect({skipShadow:!0,skipStroke:!0});A.hasName("line-anchor")&&(j={x:A.absolutePosition().x,y:A.absolutePosition().y,width:0,height:0}),O.push({offset:j.x,node:A,snap:"start"},{offset:j.x+j.width,node:A,snap:"end"},{offset:j.x+j.width/2,node:A,snap:"center"}),C.push({offset:j.y,node:A,snap:"start"},{offset:j.y+j.height,node:A,snap:"end"},{offset:j.y+j.height/2,node:A,snap:"center"})}}),{vertical:O,horizontal:C}}([w.target,...p.map(T=>T.current)]),{vertical:[{guide:(y=w.target).absolutePosition().x,offset:0,snap:"center",nodes:[y]}],horizontal:[{guide:y.absolutePosition().y,offset:0,snap:"center",nodes:[y]}]});if(!g.length)return;(function(T){var F;const I=(F=h.current)===null||F===void 0?void 0:F.getLayer(),O=I==null?void 0:I.children.find(C=>C.name()==="line-guides");T.forEach(C=>{if(C.orientation==="H"){var A=new n.default.Line({points:[-6e3,C.lineGuide,6e3,C.lineGuide],stroke:i.stroke,strokeWidth:i.strokeWidth,name:"guid-line",dash:i.dash});O==null||O.add(A),I.batchDraw()}else C.orientation==="V"&&(A=new n.default.Line({points:[C.lineGuide,-6e3,C.lineGuide,6e3],stroke:i.stroke,strokeWidth:i.strokeWidth,name:"guid-line",dash:i.dash}),O==null||O.add(A))})})(g);const S=w.target.getAbsolutePosition(),b=Object.assign({},S);g.forEach(T=>{switch(T.snap){case"start":case"center":case"end":switch(T.orientation){case"V":b.x=T.lineGuide+T.offset;break;case"H":b.y=T.lineGuide+T.offset}}});const R=b.x-S.x,L=b.y-S.y;if(!w.evt.ctrlKey&&!w.evt.metaKey){const T=w.target.getAbsolutePosition();w.target.absolutePosition({x:T.x+R,y:T.y+L})}},E=w=>{if(!w.target)return;const x=w.target.getLayer(),y=x.children.find(g=>g.name()==="line-guides");y==null||y.destroyChildren(),x.batchDraw()};t.default.useEffect(()=>{h.current&&(h.current.on("dragmove",_),h.current.on("dragend",E))},v)};const t=r(ai()),n=r(Hs()),a=Dh(),i={stroke:"rgb(0, 161, 255)",strokeWidth:1,dash:[4,6]};e.setSnapGuideStyle=({stroke:h,strokeWidth:p,dash:v})=>{h!==void 0&&(i.stroke=h),p!==void 0&&(i.strokeWidth=p),v!==void 0&&(i.dash=v)};let o=({targetKonvaNodes:h,guideKonvaNode:p,distance:v,snapDirection:f})=>v<5;function s(h,p){var v=[],f=[];h.vertical.forEach(g=>{p.vertical.forEach(S=>{var b=Math.abs(g.offset-S.guide);o({targetKonvaNodes:S.nodes,guideKonvaNode:g.node,distance:b,snapDirection:g.snap})&&v.push({lineGuide:g.offset,diff:b,snap:S.snap,offset:S.offset})})}),h.horizontal.forEach(g=>{p.horizontal.forEach(S=>{var b=Math.abs(g.offset-S.guide);o({targetKonvaNodes:S.nodes,guideKonvaNode:g.node,distance:b,snapDirection:g.snap})&&f.push({lineGuide:g.offset,diff:b,snap:S.snap,offset:S.offset})})});var _=[];const E=v.sort((g,S)=>g.diff-S.diff),w=f.sort((g,S)=>g.diff-S.diff);var x=E[0],y=w[0];return x&&E.filter(g=>Math.abs(g.diff-x.diff)<.1).forEach(g=>{_.push(Object.assign({orientation:"V"},g))}),y&&w.filter(g=>Math.abs(g.diff-y.diff)<.1).forEach(g=>{_.push(Object.assign({orientation:"H"},g))}),_}function u(h,p){return h.x*p.x+h.y*p.y}e.setSnapFilterFunc=h=>{o=h};const c={"top-left":"bottom-right","top-center":"bottom-center","top-right":"bottom-left","middle-right":"middle-left","bottom-right":"top-left","bottom-center":"top-center","bottom-left":"top-right","middle-left":"middle-right"}}($d)),$d}var Q3;function RC(){return Q3||(Q3=1,function(e){var r=Wd&&Wd.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0,e.getMiddlePoints=c,e.getLinePositionFromMiddlePoints=h;const t=r(ai()),n=Us,a=Fu,i=Op(),o=Mh,s=n_(),u=rf();function c(f){const{x:_,y:E,width:w,height:x,rotation:y}=f.a,g=y*Math.PI/180,S={x:_+x/2*Math.cos(g+Math.PI/2),y:E+x/2*Math.sin(g+Math.PI/2)};return{middleLeft:S,middleRight:{x:S.x+w*Math.cos(g),y:S.y+w*Math.sin(g)}}}function h(f,_,E){const w=Math.sqrt(Math.pow(_.x-f.x,2)+Math.pow(_.y-f.y,2)),x=Math.atan2(_.y-f.y,_.x-f.x),y=180*x/Math.PI;return{x:f.x+Math.cos(x-Math.PI/2)*E/2,y:f.y+Math.sin(x-Math.PI/2)*E/2,width:w,height:E,rotation:y}}const p=(f,_)=>({offsetX:5/f,offsetY:5/f,width:10/f,height:10/f,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:E=>{E.target.getStage().container().style.cursor="crosshair"},onMouseLeave:E=>{E.target.getStage().container().style.cursor=""},onDragStart:E=>{_.history.startTransaction()},onDragEnd:E=>{_.history.endTransaction()}}),v=(0,n.observer)(({element:f,type:_})=>{const E=(0,i.useColor)(f,f.a.color,"fill"),w=(0,i.useColor)(f,f.a.color,"stroke"),x=Object.assign(Object.assign(Object.assign({strokeWidth:f.height,lineCap:"round",lineJoin:"round"},w),E),{opacity:f.a.opacity,hideInExport:!f.showInExport});return t.default.createElement(t.default.Fragment,null,_==="arrow"&&t.default.createElement(a.Line,Object.assign({points:[3*f.height,2*-f.height,0,0,3*f.height,2*f.height]},x)),_==="triangle"&&t.default.createElement(a.Line,Object.assign({points:[3*f.height,2*-f.height,0,0,3*f.height,2*f.height],closed:!0},x)),_==="bar"&&t.default.createElement(a.Line,Object.assign({points:[0,2*-f.height,0,2*f.height],closed:!0},x)),_==="square"&&t.default.createElement(a.Line,Object.assign({points:[0,2*-f.height,4*f.height,2*-f.height,4*f.height,2*f.height,0,2*f.height],closed:!0},x)),_==="circle"&&t.default.createElement(a.Circle,Object.assign({x:2*f.height,y:0,radius:2*f.height},x)))});e.LineElement=(0,n.observer)(({element:f,store:_})=>{const E=t.default.useRef(null),w=t.default.useRef(null),x=t.default.useRef(null),y=f.selectable||_.role==="admin",g=(0,u.isTouchDevice)(),S=_.selectedElements.indexOf(f)>=0&&_.selectedElements.length===1,b=_.selectedShapes.indexOf(f)>=0&&f.selectable,{middleLeft:R,middleRight:L}=c(f);(0,s.useAnchorSnap)(w,[E],[S]),(0,s.useAnchorSnap)(x,[E],[S]);const T=(0,i.useColor)(f,f.a.color,"stroke");return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Line,Object.assign({ref:E,name:"element",id:f.id,x:f.a.x,y:f.a.y,points:[0,0,f.a.width,0],offsetY:-f.a.height/2,strokeWidth:f.a.height,hitStrokeWidth:Math.max(f.a.height,20),dash:f.dash.map(F=>F*f.a.height)},T,{rotation:f.a.rotation,opacity:f.animated("opacity"),shadowEnabled:f.shadowEnabled,shadowBlur:f.shadowBlur,shadowOffsetX:f.shadowOffsetX,shadowOffsetY:f.shadowOffsetY,shadowColor:f.shadowColor,shadowOpacity:f.shadowOpacity,listening:y,draggable:g?f.draggable&&b:f.draggable,preventDefault:!g||b,hideInExport:!f.showInExport,onDragMove:F=>{f.set({x:F.target.x(),y:F.target.y()})},onDragEnd:F=>{f.set({x:F.target.x(),y:F.target.y()})},onTransform:F=>{const I=F.target.scaleX();F.target.scaleX(1),F.target.scaleY(1),f.set({height:f.height*I,width:f.width*I,x:F.target.x(),y:F.target.y(),rotation:F.target.rotation()})}})),t.default.createElement(a.Group,{x:R.x,y:R.y,rotation:f.rotation,hideInExport:!f.showInExport},t.default.createElement(v,{element:f,type:f.startHead})),t.default.createElement(a.Group,{x:L.x,y:L.y,rotation:f.rotation+180},t.default.createElement(v,{element:f,type:f.endHead})),S&&f.resizable&&t.default.createElement(o.Portal,{selector:".page-abs-container",enabled:!0},t.default.createElement(a.Group,{visible:S},t.default.createElement(a.Rect,Object.assign({x:R.x,y:R.y,ref:w,name:"line-anchor"},p(_.scale,_),{onDragMove:F=>{const I=h(F.target.position(),L,f.height);f.set({x:I.x,y:I.y,width:I.width,rotation:I.rotation})}})),t.default.createElement(a.Rect,Object.assign({x:L.x,y:L.y,ref:x,name:"line-anchor"},p(_.scale,_),{onDragMove:F=>{const I=h(R,F.target.position(),f.height);f.set({x:I.x,y:I.y,width:I.width,rotation:I.rotation})}})))))})}(Wd)),Wd}var Bl={},J3;function i_(){return J3||(J3=1,function(e){var r,t=Bl&&Bl.__createBinding||(Object.create?function(O,C,A,j){j===void 0&&(j=A);var N=Object.getOwnPropertyDescriptor(C,A);N&&!("get"in N?!C.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return C[A]}}),Object.defineProperty(O,j,N)}:function(O,C,A,j){j===void 0&&(j=A),O[j]=C[A]}),n=Bl&&Bl.__setModuleDefault||(Object.create?function(O,C){Object.defineProperty(O,"default",{enumerable:!0,value:C})}:function(O,C){O.default=C}),a=Bl&&Bl.__importStar||(r=function(O){return r=Object.getOwnPropertyNames||function(C){var A=[];for(var j in C)Object.prototype.hasOwnProperty.call(C,j)&&(A[A.length]=j);return A},r(O)},function(O){if(O&&O.__esModule)return O;var C={};if(O!=null)for(var A=r(O),j=0;j<A.length;j++)A[j]!=="default"&&t(C,O,A[j]);return n(C,O),C}),i=Bl&&Bl.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=e.useLoader=e.setVideoLoaderHook=e.useCornerRadiusAndCrop=void 0;const o=i(ai()),s=Us,u=vs,c=Fu,h=i(r0()),p=i(Hs()),v=Mh,f=jf(),_=a(kp()),E=gc(),w=Ap(),x=If(),y=rf();function g(){return document.createElement("canvas")}const S=new window.Image;S.src=_.svgToURL(`
|
|
277
|
-
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
278
|
-
<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"/>
|
|
279
|
-
<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"/>
|
|
280
|
-
</svg>
|
|
281
|
-
`);const b=new window.Image;b.src=_.svgToURL(`
|
|
282
|
-
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
283
|
-
<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"/>
|
|
284
|
-
<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"/>
|
|
285
|
-
<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"/>
|
|
286
|
-
<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"/>
|
|
287
|
-
</svg>
|
|
288
|
-
`),e.useCornerRadiusAndCrop=(O,C,A,j,N=0,B=!1)=>{const W=Math.floor(Math.max(O.width*j,1)),Y=Math.floor(Math.max(O.height*j,1)),Z=Math.min(N*j,W/2,Y/2),V=Math.max(O.width/A.width,O.height/A.height)*j,H=O.page._exportingOrRendering&&E.flags.imageDownScalingEnabled&&V<1&&!B,U=A.x===0&&A.y===0&&A.width===(C==null?void 0:C.width)&&A.height===(C==null?void 0:C.height),D=o.default.useMemo(()=>{if(C&&C.width&&C.height)return U&&Z===0&&!H?void 0:g()},[C,Z,H,U]),$=()=>{if(!D||!C)return;D.width=W,D.height=Y;const Q=D.getContext("2d");if(!Q)return;Z&&(Q.beginPath(),Q.moveTo(Z,0),Q.lineTo(W-Z,0),Q.arc(W-Z,Z,Z,3*Math.PI/2,0,!1),Q.lineTo(W,Y-Z),Q.arc(W-Z,Y-Z,Z,0,Math.PI/2,!1),Q.lineTo(Z,Y),Q.arc(Z,Y-Z,Z,Math.PI/2,Math.PI,!1),Q.lineTo(0,Z),Q.arc(Z,Z,Z,Math.PI,3*Math.PI/2,!1),Q.clip());const ee=H?function(ae,se){var ce,me;const _e=g();_e.width=ae.width,_e.height=ae.height,(ce=_e.getContext("2d"))===null||ce===void 0||ce.drawImage(ae,0,0,_e.width,_e.height);const Le=function(Re,Pe,ve,it,Se,be,Ae){for(var Te=new ImageData(Pe,ve),he=new Int32Array(Re.data.buffer),Oe=Re.width,Me=new Int32Array(Te.data.buffer),ze=Te.width,pt=Pe/be,yt=ve/Ae,He=Math.round(1/pt),Qe=Math.round(1/yt),Ze=He*Qe,tt=0;tt<Te.height;tt++)for(var Ht=0;Ht<ze;Ht++){for(var Pt=0+Math.round(Ht/pt)+(0+Math.round(tt/yt))*Oe,It=0,qt=0,Ie=0,ke=0,ut=0;ut<Qe;ut++)for(var Nt=0;Nt<He;Nt++){var Ct=he[Pt+Nt+ut*Oe];It+=Ct<<24>>>24,qt+=Ct<<16>>>24,Ie+=Ct<<8>>>24,ke+=Ct>>>24}It=Math.round(It/Ze),qt=Math.round(qt/Ze),Ie=Math.round(Ie/Ze),ke=Math.round(ke/Ze),Me[Ht+tt*ze]=ke<<24|Ie<<16|qt<<8|It}return Te}(_e.getContext("2d").getImageData(0,0,_e.width,_e.height),Math.floor(_e.width*se),Math.floor(_e.height*se),0,0,_e.width,_e.height);return _e.width=Math.floor(_e.width*se),_e.height=Math.floor(_e.height*se),(me=_e.getContext("2d"))===null||me===void 0||me.putImageData(Le,0,0),_e}(C,V):C,te=H?{x:Math.floor(A.x*V),y:Math.floor(A.y*V),width:Math.floor(A.width*V),height:Math.floor(A.height*V)}:A;Q.drawImage(ee,te.x,te.y,te.width,te.height,0,0,D.width,D.height)};return o.default.useLayoutEffect(()=>{$()},[D,O.width,O.height,A.x,A.y,A.width,A.height,N,j,B,O.page._exportingOrRendering,H]),o.default.useEffect(()=>()=>{D&&D.nodeName==="CANVAS"&&p.default.Util.releaseCanvas(D)},[D]),[D||C,$]};const R=g(),L=(0,s.observer)(({element:O})=>{const C=Math.min(30,O.width/4,O.height/4),A=o.default.useRef(null);return o.default.useEffect(()=>{const j=A.current;if(!j)return;const N=new p.default.Animation(B=>{j.rotate(((B==null?void 0:B.timeDiff)||0)/2)},j.getLayer());return N.start(),()=>{N.stop()}}),o.default.createElement(c.Group,{x:O.a.x,y:O.a.y,rotation:O.a.rotation,listening:!1,opacity:O.a.opacity,hideInExport:!O.showInExport},o.default.createElement(c.Rect,{width:O.width,height:O.height,fill:"rgba(124, 173, 212, 0.8)"}),o.default.createElement(c.Arc,{ref:A,x:O.width/2,y:O.height/2,fill:"white",outerRadius:Math.abs(C),innerRadius:Math.max(1,C-5),angle:270}))}),T=(0,s.observer)(({element:O})=>{const C=Math.max(10,Math.min(30,O.width/25));return o.default.createElement(c.Group,{x:O.a.x,y:O.a.y,rotation:O.a.rotation,listening:!1,opacity:O.a.opacity,hideInExport:!O.showInExport},o.default.createElement(c.Rect,{width:O.width,height:O.height,fill:"rgba(223, 102, 102, 0.8)"}),o.default.createElement(c.Text,{text:"Can not load the video...",fontSize:C,width:O.width,height:O.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let F=function(O,C,A){const j=o.default.useRef("loading"),N=o.default.useRef(null),[B,W]=o.default.useState(0),Y=o.default.useRef(),Z=o.default.useRef(),V=o.default.useRef();return Y.current===O&&Z.current===C&&V.current===A||(j.current="loading",N.current=void 0,Y.current=O,Z.current=C,V.current=A),o.default.useLayoutEffect(function(){if(O){var H=document.createElement("video");return H.addEventListener("canplay",U),H.addEventListener("error",D),C&&(H.crossOrigin=C),A&&(H.referrerpolicy=A),H.src=O,H.load(),function(){H.removeEventListener("canplay",U),H.removeEventListener("error",D)}}function U(){j.current="loaded",N.current=H,N.current.currentTime=0,W(Math.random()),N.current.removeEventListener("canplay",U)}function D($){var Q;const ee=H.readyState===4,te=H.buffered&&H.buffered.length>0&&H.buffered.end(H.buffered.length-1)/H.duration*100>=100;if(ee&&te)return;const ae=$.message||((Q=H.error)===null||Q===void 0?void 0:Q.message)||"Unknown error",se=new Error("Video failed to load: "+ae);console.error(se),j.current="failed",N.current=void 0,W(Math.random())}},[O,C,A]),[N.current,j.current]};function I(O){return O.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA}e.setVideoLoaderHook=O=>{F=O},e.useLoader=(O,C,A)=>{const j=o.default.useRef(),N=()=>{var B;(B=j.current)===null||B===void 0||B.call(j),j.current=void 0};o.default.useEffect(()=>N,[]),o.default.useLayoutEffect(()=>{const B=C.slice(0,200),W=`video with id ${A} url: ${B}`;O!=="loading"||j.current||(j.current=(0,f.incrementLoader)(W)),O!=="loading"&&N(),O==="failed"&&(0,f.triggerLoadError)(W)},[O])},e.VideoElement=(0,s.observer)(({element:O,store:C})=>{var A;const[j,N]=o.default.useState(!1),B=o.default.useRef(null),W=o.default.useRef(null),Y=C.selectedShapes.indexOf(O)>=0&&O.selectable,[Z,V]=o.default.useState(!1),[H,U]=F(O.src,"anonymous"),D=C.activePage===O.page;(0,e.useLoader)(U,O.src,O.id),H&&(H.width=H.videoWidth,H.height=H.videoHeight,H.playsInline=!0);const $=H||R;o.default.useEffect(()=>{H&&C.history.ignore(()=>{O.set({duration:1e3*H.duration})})},[H]),o.default.useEffect(()=>{var ke;if(!H)return;const ut=C.animatedElementsIds,Nt=(!ut.length||ut.includes(O.id))&&C.isPlaying,Ct=D&&(Nt||Z);if(!Ct)return void H.pause();Ct&&(H.currentTime=O.startTime*H.duration,H.play());const St=new p.default.Animation(()=>{Oe()},(ke=B.current)===null||ke===void 0?void 0:ke.getLayer());St.start();const Jt=()=>{V(!1),H.currentTime=O.startTime*H.duration},nr=()=>{H.currentTime>=O.endTime*H.duration&&(H.pause(),H.currentTime=O.startTime*H.duration,V(!1))};return H.addEventListener("ended",Jt),H.addEventListener("timeupdate",nr),()=>{H.pause(),St.stop(),H.removeEventListener("ended",Jt),H.removeEventListener("timeupdate",nr)}},[H,Z,C.isPlaying,D]),o.default.useEffect(()=>{H&&(H.volume=O.volume)},[H,O.volume]);const Q=o.default.useRef();o.default.useEffect(()=>{const ke=(0,u.autorun)(()=>{var ut,Nt;if(H){const Ct=C.animatedElementsIds;if(Ct.length&&!Ct.includes(O.id))return;const St=O.startTime*H.duration*1e3,Jt=H.duration*(O.endTime-O.startTime)*1e3,nr=((C.currentTime||O.page.startTime)-O.page.startTime)%Jt+St;if(Math.abs(1e3*H.currentTime-nr)>500||!C.isPlaying){const Tt=nr/1e3;Tt!==H.currentTime&&(H.currentTime=Tt),!I(H)&&!C.isPlaying&&!Q.current&&(Q.current=(0,f.incrementLoader)(`video ${O.id}`))}Oe(),(Nt=(ut=B.current)===null||ut===void 0?void 0:ut.getLayer())===null||Nt===void 0||Nt.batchDraw()}});return()=>{ke(),Q.current&&(Q.current(),Q.current=null)}},[C,H]),o.default.useEffect(()=>{if(!H)return;const ke=()=>{var Nt,Ct;!I(H)&&O.page._exportingOrRendering||Q.current&&(Oe(),(Ct=(Nt=B.current)===null||Nt===void 0?void 0:Nt.getLayer())===null||Ct===void 0||Ct.batchDraw(),Q.current(),Q.current=null)};let ut;return O.page._exportingOrRendering&&(ut=setInterval(ke,50)),H.addEventListener("timeupdate",ke),H.addEventListener("canplay",ke),()=>{clearInterval(ut),H.removeEventListener("timeupdate",ke),H.removeEventListener("canplay",ke)}},[O.page._exportingOrRendering,H,O.id,f.incrementLoader]);let{cropX:ee,cropY:te,cropWidth:ae,cropHeight:se}=O;U!=="loaded"&&(ee=te=0,ae=se=1);const ce=$.width*ae,me=$.height*se,_e=O.width/O.height;let Le,Re;const Pe=ce/me,ve=O.type==="svg";ve?(Le=ce,Re=me):_e>=Pe?(Le=ce,Re=ce/_e):(Le=me*_e,Re=me);const it={x:$.width*ee,y:$.height*te,width:Le,height:Re},Se=(A=O.cornerRadius)!==null&&A!==void 0?A:0,[be,Ae]=(0,e.useCornerRadiusAndCrop)(O,$,it,C._elementsPixelRatio,Se,j||O._cropModeEnabled||O.type==="svg");let[Te,he]=((ke,ut,Nt,Ct)=>{const St=(Je=>{const[mt,Gt]=o.default.useState(Je);return o.default.useEffect(()=>{(async()=>{const bt=await async function(Kt){if(!(Kt.indexOf("data:image/svg+xml")>=0||Kt.indexOf(".svg")>=0))return Kt;const Yt=await _.urlToString(Kt),ct=_.fixSize(Yt);return _.svgToURL(ct)}(Je);bt!==mt&&Gt(bt)})()},[Je]),mt})(ke.clipSrc||""),[Jt,nr]=(0,h.default)(St,"anonymous"),Tt=ke.clipSrc?nr:"loaded";(0,e.useLoader)(Tt,ke.clipSrc,ke.id);const Xt=o.default.useMemo(()=>{if(ut&&Jt)return g()},[ut,Jt]);function Rr(){var Je;if(!Jt||!ut||!ut.width||!ut.height||!Jt||!Jt.width||!Jt.height||!Xt)return;const mt=g(),Gt=Math.max(ke.width/Jt.width*Nt,ke.height/Jt.height*Nt);mt.width=Jt.width*Gt,mt.height=Jt.height*Gt,(Je=mt.getContext("2d"))===null||Je===void 0||Je.drawImage(Jt,0,0,mt.width,mt.height),Xt.width=Math.max(ut.width,1),Xt.height=Math.max(ut.height,1);const bt=Xt.getContext("2d");bt&&(bt.save(),bt.drawImage(mt,0,0,ut.width,ut.height),p.default.Util.releaseCanvas(mt),bt.globalCompositeOperation="source-in",bt.drawImage(ut,0,0,Xt.width,Xt.height),bt.restore())}return o.default.useLayoutEffect(()=>{Rr()},[Xt,ut,Jt,ke.width,ke.height,Nt,...Ct]),[ke.clipSrc&&Jt?Xt:ut,Rr]})(O,be,C._elementsPixelRatio,[it,Se,C._elementsPixelRatio]);function Oe(){Ae(),he()}const Me=Math.max(O.width/Le,O.height/Re);o.default.useEffect(()=>{var ke;if(!O._cropModeEnabled)return;const ut=(ke=B.current)===null||ke===void 0?void 0:ke.getStage();function Nt(St){O._cropModeEnabled&&St.target!==W.current&&O.toggleCropMode(!1)}function Ct(St){O._cropModeEnabled&&St.target.parentNode!==ut.content&&O.toggleCropMode(!1)}return document.body.addEventListener("click",Ct),ut==null||ut.on("click",Nt),ut==null||ut.on("tap",Nt),()=>{document.body.removeEventListener("click",Ct),document.body.removeEventListener("touchstart",Ct),ut==null||ut.off("click",Nt),ut==null||ut.off("click",Nt)}},[O._cropModeEnabled]),o.default.useLayoutEffect(()=>{if(!j&&!O._cropModeEnabled)return(0,w.applyFilter)(B.current,O),(0,u.autorun)(()=>{(0,w.applyFilter)(B.current,O)},{delay:100})},[$,j,ae,se,O._cropModeEnabled]),o.default.useLayoutEffect(()=>{var ke;j||O._cropModeEnabled?(ke=B.current)===null||ke===void 0||ke.clearCache():(0,w.applyFilter)(B.current,O)},[j,O.width,O.height,O._cropModeEnabled]),o.default.useEffect(()=>{(0,w.applyFilter)(B.current,O)},[O.shadowEnabled,O.shadowBlur,O.cornerRadius,O.shadowColor,O.shadowOffsetX,O.shadowOffsetY,O.shadowOpacity]);const ze=o.default.useRef(null),pt=o.default.useRef(null),yt=o.default.useRef(null);o.default.useLayoutEffect(()=>{O._cropModeEnabled&&(pt.current.nodes([ze.current]),yt.current.nodes([W.current]))},[O._cropModeEnabled]);const He=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 ut=ke.target.width()*ke.target.scaleX(),Nt=ke.target.height()*ke.target.scaleY(),Ct=Math.min(1,Le/ut),St=Math.min(1,Re/Nt),Jt=1-Ct,nr=Math.min(Jt,Math.max(0,Math.round(-ke.target.x())/ut)),Tt=1-St,Xt=Math.min(Tt,Math.max(0,Math.round(-ke.target.y())/Nt));ke.target.setAttrs({x:-nr*$.width,y:-Xt*$.height,scaleX:1,scaleY:1}),O.set({cropX:nr,cropY:Xt,cropWidth:Ct,cropHeight:St})},Qe=()=>{O.type!=="svg"&&O.contentEditable&&setTimeout(()=>{O.toggleCropMode(!0)})},Ze=U==="loading",tt=U==="failed",Ht=!Ze&&!tt,Pt=o.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),It=Ht?O.a.opacity:0;(0,x.useFadeIn)(B,It);const qt=O.selectable||C.role==="admin",Ie=(0,y.isTouchDevice)();return o.default.createElement(o.default.Fragment,null,Ze&&o.default.createElement(L,{element:O}),tt&&o.default.createElement(T,{element:O}),o.default.createElement(c.Image,{ref:B,name:"element",id:O.id,image:Te,x:O.a.x,y:O.a.y,width:O.a.width||1,height:O.a.height||1,rotation:O.a.rotation,opacity:It,shadowEnabled:O.shadowEnabled,shadowBlur:O.shadowBlur,shadowOffsetX:O.shadowOffsetX,shadowOffsetY:O.shadowOffsetY,shadowColor:O.shadowColor,shadowOpacity:O.shadowOpacity,customCrop:it,listening:qt,draggable:Ie?O.draggable&&Y:O.draggable,preventDefault:!Ie||Y,hideInExport:!O.showInExport,onDragMove:ke=>{O.set({x:ke.target.x(),y:ke.target.y()})},onDragEnd:ke=>{O.set({x:ke.target.x(),y:ke.target.y()})},onDblClick:Qe,onDblTap:Qe,onTransformStart:()=>{N(!0),Pt.current={cropX:O.cropX,cropY:O.cropY,cropWidth:O.cropWidth,cropHeight:O.cropHeight}},onTransform:ke=>{var ut;const Nt=ke.currentTarget,Ct=Math.abs(Nt.scaleX()-1)<1e-7?1:Nt.scaleX(),St=Math.abs(Nt.scaleY()-1)<1e-7?1:Nt.scaleY();Nt.scaleX(1),Nt.scaleY(1);const Jt=(ut=ke.target.getStage())===null||ut===void 0?void 0:ut.findOne("Transformer"),nr=1-Le/$.width,Tt=Math.min(nr,Math.max(0,O.cropX)),Xt=1-Re/$.height,Rr=Math.min(Xt,Math.max(0,O.cropY)),Je=Jt.getActiveAnchor(),mt=!(Je.indexOf("middle")>=0||Je.indexOf("center")>=0),Gt=!mt&&Ct<1&&Pt.current.cropHeight>Re/$.height;let bt=mt?O.cropWidth:O.cropWidth*Ct;Gt&&(bt=O.cropWidth);const Kt=!mt&&St<1&&Pt.current.cropWidth>Le/$.width;let Yt=mt?O.cropHeight:O.cropHeight*St;Kt&&(Yt=O.cropHeight),ve&&(bt=O.cropWidth,Yt=O.cropHeight),O.set({cropX:Tt,cropY:Rr,x:Nt.x(),y:Nt.y(),width:Nt.width()*Ct,height:Nt.height()*St,rotation:ke.target.rotation(),cropWidth:Math.min(bt,1-Tt),cropHeight:Math.min(Yt,1-Rr)})},onTransformEnd:ke=>{const ut=ke.currentTarget;O.set({width:ut.width(),height:ut.height(),x:ut.x(),y:ut.y(),rotation:ke.target.rotation(),cropWidth:Le/$.width,cropHeight:Re/$.height}),N(!1)}}),o.default.createElement(c.Rect,{x:O.a.x,y:O.a.y,width:Math.max(O.a.width-O.borderSize,0),height:Math.max(O.a.height-O.borderSize,0),opacity:It,offsetX:-O.borderSize/2,offsetY:-O.borderSize/2,stroke:O.borderColor,strokeWidth:O.borderSize,listening:!1,visible:!!O.borderSize,rotation:O.rotation,cornerRadius:Math.max(0,Se-O.borderSize),hideInExport:!O.showInExport}),!C.isPlaying&&o.default.createElement(c.Image,{image:Z?b:S,x:O.a.x,y:O.a.y,offsetX:-O.a.width/2+15/C.scale,offsetY:-O.a.height/2+15/C.scale,rotation:O.a.rotation,width:30/C.scale,height:30/C.scale,hideInExport:!0,onClick:()=>V(!Z),onTap:()=>V(!Z)}),O._cropModeEnabled&&o.default.createElement(v.Portal,{selector:".page-abs-container",enabled:!0},o.default.createElement(c.Rect,{x:-window.innerWidth/C.scale,y:-window.innerWidth/C.scale,width:window.innerWidth/C.scale*3,height:window.innerWidth/C.scale*3,fill:"rgba(0,0,0,0.3)"}),o.default.createElement(c.Image,{listening:!1,image:Te,x:O.a.x,y:O.a.y,width:O.a.width,height:O.a.height,rotation:O.a.rotation,shadowEnabled:O.shadowEnabled,shadowBlur:O.shadowBlur}),o.default.createElement(c.Group,{x:O.a.x,y:O.a.y,rotation:O.a.rotation,scaleX:Me,scaleY:Me},o.default.createElement(c.Image,{image:$,ref:W,opacity:.4,draggable:!0,x:-O.cropX*$.width,y:-O.cropY*$.height,onDragMove:He,onTransform:He}),o.default.createElement(c.Transformer,{ref:yt,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(ke,ut)=>ut.width<5||ut.height<5?ke:ut,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),o.default.createElement(c.Rect,{width:Le,height:Re,ref:ze,listening:!1,onTransform:ke=>{ke.target.x()<-O.cropX*$.width-1e-9&&(ke.target.x(-O.cropX*$.width),ke.target.scaleX(1)),ke.target.y()<-O.cropY*$.height-1e-9&&(ke.target.y(-O.cropY*$.height),ke.target.scaleY(1));const ut=Math.min(1,Math.max(0,O.cropX+ke.target.x()/$.width)),Nt=Math.min(1,Math.max(0,ke.target.y()/$.height+O.cropY)),Ct=ke.target.width()*ke.target.scaleX(),St=ke.target.height()*ke.target.scaleY(),Jt=Math.min(1-ut,Ct/$.width),nr=Math.min(1-Nt,St/$.height),Tt=ke.target.getAbsolutePosition(ke.target.getParent().getParent());ke.target.scale({x:1,y:1}),ke.target.position({x:0,y:0}),O.set({x:Tt.x,y:Tt.y,cropX:ut,cropY:Nt,cropWidth:Jt,cropHeight:nr,width:Math.min(Ct*Me,$.width*(1-ut)*Me),height:Math.min(St*Me,$.height*(1-Nt)*Me)})}}),o.default.createElement(c.Transformer,{ref:pt,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(ke,ut)=>ut.width<5||ut.height<5?ke:ut,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2,visible:O.resizable}))))})}(Bl)),Bl}var Yd={},Av={},e4;function Nm(){return e4||(e4=1,function(e){function r({width:c,height:h}){const p=c/2,v=h/2,f=c/2,_=h/2,E=f/2,w=_/2;let x="",y=Math.PI/5;for(let g=0;g<10;g++){const S=g%2==0?_:w,b=p+(g%2==0?f:E)*Math.sin(g*y),R=v-S*Math.cos(g*y);g===0?x=`M ${b} ${R}`:x+=` L ${b} ${R}`}return x+" Z"}function t({width:c,height:h}){const p=c/2,v=h/2;return`M ${p} 0 L ${c} ${v} L ${p} ${h} L 0 ${v} Z`}function n({width:c,height:h}){const p=c/2,v=h/2,f=c/2,_=h/2;let E="",w=2*Math.PI/5;for(let x=0;x<5;x++){const y=_,g=p+f*Math.sin(x*w),S=v-y*Math.cos(x*w);x===0?E=`M ${g} ${S}`:E+=` L ${g} ${S}`}return E+" Z"}function a({width:c,height:h}){const p=c/2,v=h/2,f=c/2,_=h/2;let E="",w=2*Math.PI/6;for(let x=0;x<6;x++){const y=_,g=p+f*Math.sin(x*w),S=v-y*Math.cos(x*w);x===0?E=`M ${g} ${S}`:E+=` L ${g} ${S}`}return E+" Z"}function i({path:c,aspectRatio:h,width:p,height:v}){return{path:c,scaleX:p/h.width,scaleY:v/h.height}}function o({width:c,height:h}){const p=.1*Math.min(c,h),v=.2*c,f=.2*h,_=.5*c;let E=`M ${p},0`;return E+=" H "+(c-p),E+=` A ${p},${p} 0 0 1 ${c},${p}`,E+=" V "+(h-p-f),E+=` A ${p},${p} 0 0 1 ${c-p},${h-f}`,E+=` H ${_+v/2}`,E+=` L ${_},${h}`,E+=` L ${_-v/2},${h-f}`,E+=` H ${p}`,E+=` A ${p},${p} 0 0 1 0,${h-p-f}`,E+=` V ${p}`,E+=` A ${p},${p} 0 0 1 ${p},0`,E+=" Z",E}function s({width:c,height:h}){const p=.3*c,v=.3*h,f=c/2,_=h/2,E=f-p/2,w=f+p/2,x=_-v/2,y=_+v/2;let g=`M ${E},0 `;return g+=`H ${w} `,g+=`V ${x} `,g+=`H ${c} `,g+=`V ${y} `,g+=`H ${w} `,g+=`V ${h} `,g+=`H ${E} `,g+=`V ${y} `,g+="H 0 ",g+=`V ${x} `,g+=`H ${E} `,g+="V 0 ",g+="Z",g}function u(c){return e.TYPES[c]||e.rectData}Object.defineProperty(e,"__esModule",{value:!0}),e.TYPES=e.circleData=e.rightTriangleData=e.triangleData=e.rectData=void 0,e.starPath=r,e.diamondPath=t,e.pentagonPath=n,e.hexagonPath=a,e.speechBubblePath=o,e.crossPath=s,e.subTypeToPathDataFunc=u,e.figureToSvg=function(c){const{subType:h}=c,p=u(h);return p?function(v,f){const{width:_,height:E,fill:w,stroke:x,strokeWidth:y,dash:g}=v,S=(g||[]).map(F=>F*y);let b=f(v),R=1,L=1;typeof b!="string"&&(R=b.scaleX,L=b.scaleY,b=b.path);const T=`clip-${v.id||Math.random()}`;return`
|
|
289
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${_}" height="${E}">
|
|
290
|
-
<defs>
|
|
291
|
-
<clipPath id="${T}">
|
|
292
|
-
<path d="${b}" />
|
|
293
|
-
</clipPath>
|
|
294
|
-
</defs>
|
|
295
|
-
|
|
296
|
-
<!-- Path for the fill -->
|
|
297
|
-
<path d="${b}" fill="${w}" transform="scale(${R}, ${L})"/>
|
|
298
|
-
|
|
299
|
-
<!-- Path for the stroke, clipped by the star path -->
|
|
300
|
-
<path d="${b}" fill="none" stroke="${x}" stroke-width="${2*y}" clip-path="url(#${T})" transform="scale(${R}, ${L})" stroke-dasharray="${S.join(" ")}"/>
|
|
301
|
-
</svg>
|
|
302
|
-
`}(c,p):(console.error(`Polotno error: Can not convert ${c.subType} figure to svg.`),(0,e.rectData)(c))},e.rectData=({width:c,height:h,cornerRadius:p})=>{if(p>0){const v=Math.min(p,c/2,h/2);return`M 0 ${v} A ${v} ${v} 0 0 1 ${v} 0 L ${c-v} 0 A ${v} ${v} 0 0 1 ${c} ${v} L ${c} ${h-v} A ${v} ${v} 0 0 1 ${c-v} ${h} L ${v} ${h} A ${v} ${v} 0 0 1 0 ${h-v} Z`}return`M 0 0 L ${c} 0 L ${c} ${h} L 0 ${h} Z`},e.triangleData=({width:c,height:h})=>`M ${c/2} 0 L ${c} ${h} L 0 ${h} Z`,e.rightTriangleData=({width:c,height:h})=>`M 0 0 L ${c} 0 L 0 ${h} Z`,e.circleData=({width:c,height:h})=>`M ${c/2} ${h/2} m -${c/2}, 0 a ${c/2},${h/2} 0 1,0 ${c},0 a ${c/2},${h/2} 0 1,0 -${c},0`,e.TYPES={rect:e.rectData,circle:e.circleData,star:r,triangle:e.triangleData,rightTriangle:e.rightTriangleData,diamond:t,pentagon:n,hexagon:a,speechBubble:o,cross:s,arc:({width:c,height:h})=>i({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:c,height:h}),cloud:({width:c,height:h})=>i({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:c,height:h}),rightArrow:({width:c,height:h})=>{const p=.6*c;return`M 0 ${h/4} L ${p} ${h/4} L ${p} 0 L ${c} ${h/2} L ${p} ${h} L ${p} ${.75*h} L 0 ${.75*h} Z`},leftArrow:({width:c,height:h})=>{const p=.4*c;return`M ${c} ${h/4} L ${p} ${h/4} L ${p} 0 L 0 ${h/2} L ${p} ${h} L ${p} ${.75*h} L ${c} ${.75*h} Z`},downArrow:({width:c,height:h})=>{const p=.6*h;return`M ${c/4} 0 L ${c/4} ${p} L 0 ${p} L ${c/2} ${h} L ${c} ${p} L ${.75*c} ${p} L ${.75*c} 0 Z`},upArrow:({width:c,height:h})=>{const p=.4*h;return`M ${c/4} ${h} L ${c/4} ${p} L 0 ${p} L ${c/2} 0 L ${c} ${p} L ${.75*c} ${p} L ${.75*c} ${h} Z`},asterisk1:({width:c,height:h})=>i({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:c,height:h}),asterisk2:({width:c,height:h})=>i({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:c,height:h}),bookmark:({width:c,height:h})=>i({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:c,height:h}),butterfly:({width:c,height:h})=>i({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:c,height:h}),cylinder:({width:c,height:h})=>i({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:c,height:h}),diamond2:({width:c,height:h})=>i({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:c,height:h}),door:({width:c,height:h})=>i({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:c,height:h}),drop1:({width:c,height:h})=>i({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:c,height:h}),drop2:({width:c,height:h})=>i({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:c,height:h}),explosion:({width:c,height:h})=>i({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:c,height:h}),flag:({width:c,height:h})=>i({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:c,height:h}),flower:({width:c,height:h})=>i({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:c,height:h}),frame:({width:c,height:h})=>i({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:c,height:h}),heart1:({width:c,height:h})=>i({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:c,height:h}),home:({width:c,height:h})=>i({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:c,height:h}),home2:({width:c,height:h})=>i({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:c,height:h}),hourglass:({width:c,height:h})=>i({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:c,height:h}),house:({width:c,height:h})=>i({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:c,height:h}),keyhole:({width:c,height:h})=>i({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:c,height:h}),kiss:({width:c,height:h})=>i({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:c,height:h}),leaf:({width:c,height:h})=>i({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:c,height:h}),lightning1:({width:c,height:h})=>i({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:c,height:h}),lightning2:({width:c,height:h})=>i({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:c,height:h}),magnet:({width:c,height:h})=>i({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:c,height:h}),mithosis:({width:c,height:h})=>i({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:c,height:h}),orangeRicky:({width:c,height:h})=>i({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:c,height:h}),party:({width:c,height:h})=>i({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:c,height:h}),pillow:({width:c,height:h})=>i({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:c,height:h}),polygon:({width:c,height:h})=>i({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:c,height:h}),rainbow:({width:c,height:h})=>i({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:c,height:h}),rhodeIsland:({width:c,height:h})=>i({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:c,height:h}),shell:({width:c,height:h})=>i({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:c,height:h}),shield1:({width:c,height:h})=>i({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:c,height:h}),shield2:({width:c,height:h})=>i({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:c,height:h}),skewedRectangle:({width:c,height:h})=>i({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:c,height:h}),softFlower:({width:c,height:h})=>i({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:c,height:h}),softStar:({width:c,height:h})=>i({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:c,height:h}),stairs1:({width:c,height:h})=>i({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:c,height:h}),stairs2:({width:c,height:h})=>i({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:c,height:h}),teewee:({width:c,height:h})=>i({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:c,height:h}),blob1:({width:c,height:h})=>i({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:c,height:h}),blob10:({width:c,height:h})=>i({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:c,height:h}),blob11:({width:c,height:h})=>i({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:c,height:h}),blob12:({width:c,height:h})=>i({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:c,height:h}),blob13:({width:c,height:h})=>i({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:c,height:h}),blob14:({width:c,height:h})=>i({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:c,height:h}),blob15:({width:c,height:h})=>i({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:c,height:h}),blob16:({width:c,height:h})=>i({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:c,height:h}),blob17:({width:c,height:h})=>i({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:c,height:h}),blob18:({width:c,height:h})=>i({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:c,height:h}),blob19:({width:c,height:h})=>i({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:c,height:h}),blob2:({width:c,height:h})=>i({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:c,height:h}),blob20:({width:c,height:h})=>i({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:c,height:h}),blob21:({width:c,height:h})=>i({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:c,height:h}),blob22:({width:c,height:h})=>i({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:c,height:h}),blob23:({width:c,height:h})=>i({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:c,height:h}),blob24:({width:c,height:h})=>i({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:c,height:h}),blob25:({width:c,height:h})=>i({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:c,height:h}),blob26:({width:c,height:h})=>i({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:c,height:h}),blob27:({width:c,height:h})=>i({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:c,height:h}),blob28:({width:c,height:h})=>i({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:c,height:h}),blob29:({width:c,height:h})=>i({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:c,height:h}),blob3:({width:c,height:h})=>i({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:c,height:h}),blob30:({width:c,height:h})=>i({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:c,height:h}),blob31:({width:c,height:h})=>i({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:c,height:h}),blob32:({width:c,height:h})=>i({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:c,height:h}),blob4:({width:c,height:h})=>i({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:c,height:h}),blob5:({width:c,height:h})=>i({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:c,height:h}),blob6:({width:c,height:h})=>i({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:c,height:h}),blob7:({width:c,height:h})=>i({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:c,height:h}),blob8:({width:c,height:h})=>i({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:c,height:h}),blob9:({width:c,height:h})=>i({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:c,height:h})}}(Av)),Av}var t4;function MC(){return t4||(t4=1,function(e){var r=Yd&&Yd.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const t=r(ai()),n=Us,a=Fu,i=Nm(),o=rf(),s=Op(),u={};e.FigureElement=(0,n.observer)(({element:c,store:h})=>{const p=c.selectable||h.role==="admin",v=(0,o.isTouchDevice)(),f=h.selectedShapes.indexOf(c)>=0&&c.selectable,_=Math.min(c.strokeWidth,c.width/2,c.height/2),E=Math.max(0,Math.min(c.width/2,c.height/2,c.cornerRadius)),w=(0,s.useColor)(c,c.a.fill,"fill"),x=Object.assign(Object.assign({width:c.a.width,height:c.a.height},w),{cornerRadius:E,opacity:c.animated("opacity"),shadowEnabled:c.shadowEnabled,shadowBlur:c.shadowBlur,shadowOffsetX:c.shadowOffsetX,shadowOffsetY:c.shadowOffsetY,shadowColor:c.shadowColor,shadowOpacity:c.shadowOpacity,preventDefault:!v||f,hideInExport:!c.showInExport}),y=(0,s.useColor)(c,c.stroke,"stroke"),g=Object.assign(Object.assign({visible:_>0,x:_/2,y:_/2,width:c.a.width-_,height:c.a.height-_},y),{strokeWidth:_,cornerRadius:Math.max(0,E-_),dash:c.dash.map(L=>L*_),opacity:c.animated("opacity"),hideInExport:!c.showInExport,listening:!1}),S=(b=c.subType,u[b]||(u[b]=(R=(0,i.subTypeToPathDataFunc)(b),(0,n.observer)(({element:L,fillProps:T,strokeProps:F})=>{let I=R({width:L.a.width,height:L.a.height,cornerRadius:L.cornerRadius}),O=1,C=1;typeof I!="string"&&(O=I.scaleX,C=I.scaleY,I=I.path);const A=t.default.useRef(null);return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Rect,{width:L.width,height:L.height,fill:"transparent"}),t.default.createElement(a.Path,Object.assign({},T,{ref:A,data:I,scaleX:O,scaleY:C})),t.default.createElement(a.Group,{clipFunc:j=>{const N=A.current;if(N){var B=N.dataArray;j.beginPath();for(var W=0;W<B.length;W++){var Y=B[W].command,Z=B[W].points;switch(Y){case"L":j.lineTo(Z[0],Z[1]);break;case"M":j.moveTo(Z[0],Z[1]);break;case"C":j.bezierCurveTo(Z[0],Z[1],Z[2],Z[3],Z[4],Z[5]);break;case"Q":j.quadraticCurveTo(Z[0],Z[1],Z[2],Z[3]);break;case"A":var V=Z[0],H=Z[1],U=Z[2],D=Z[3],$=Z[4],Q=Z[5],ee=Z[6],te=Z[7],ae=U>D?U:D,se=U>D?1:U/D,ce=U>D?D/U:1;j.translate(V,H),j.rotate(ee),j.scale(se,ce),j.arc(0,0,ae,$,$+Q,1-te),j.scale(1/se,1/ce),j.rotate(-ee),j.translate(-V,-H);break;case"z":j.closePath()}}}},scaleX:O,scaleY:C},t.default.createElement(a.Path,Object.assign({},F,{x:0,y:0,data:I,strokeWidth:2*F.strokeWidth,dash:F.dash.map(j=>j)}))))}))),u[b]||a.Group);var b,R;return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Group,{id:c.id,x:c.a.x,y:c.a.y,rotation:c.a.rotation,opacity:c.a.opacity,listening:p,draggable:v?c.draggable&&f:c.draggable,name:"element",onDragMove:L=>{c.set({x:L.target.x(),y:L.target.y()})},onDragEnd:L=>{c.set({x:L.target.x(),y:L.target.y()})},onTransform:L=>{const T=L.target.scale();L.target.scaleX(1),L.target.scaleY(1),c.set({width:c.width*T.x,height:c.height*T.y,x:L.target.x(),y:L.target.y(),rotation:L.target.rotation()})}},t.default.createElement(S,{element:c,fillProps:x,strokeProps:g})))})}(Yd)),Yd}var Xd={},ac={},Cv={},oc={},r4;function a_(){if(r4)return oc;r4=1,Object.defineProperty(oc,"__esModule",{value:!0}),oc.loop=oc.conditional=oc.parse=void 0;var e=function n(a,i){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:o;if(Array.isArray(i))i.forEach(function(c){return n(a,c,o,s)});else if(typeof i=="function")i(a,o,s,n);else{var u=Object.keys(i)[0];Array.isArray(i[u])?(s[u]={},n(a,i[u],o,s[u])):s[u]=i[u](a,o,s,n)}return o};oc.parse=e;var r=function(a,i){return function(o,s,u,c){i(o,s,u)&&c(o,a,s,u)}};oc.conditional=r;var t=function(a,i){return function(o,s,u,c){for(var h=[],p=o.pos;i(o,s,u);){var v={};if(c(o,a,s,v),o.pos===p)break;p=o.pos,h.push(v)}return h}};return oc.loop=t,oc}var Xi={},n4;function o_(){if(n4)return Xi;n4=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.readBits=Xi.readArray=Xi.readUnsigned=Xi.readString=Xi.peekBytes=Xi.readBytes=Xi.peekByte=Xi.readByte=Xi.buildStream=void 0;var e=function(p){return{data:p,pos:0}};Xi.buildStream=e;var r=function(){return function(p){return p.data[p.pos++]}};Xi.readByte=r;var t=function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(v){return v.data[v.pos+p]}};Xi.peekByte=t;var n=function(p){return function(v){return v.data.subarray(v.pos,v.pos+=p)}};Xi.readBytes=n;var a=function(p){return function(v){return v.data.subarray(v.pos,v.pos+p)}};Xi.peekBytes=a;var i=function(p){return function(v){return Array.from(n(p)(v)).map(function(f){return String.fromCharCode(f)}).join("")}};Xi.readString=i;var o=function(p){return function(v){var f=n(2)(v);return p?(f[1]<<8)+f[0]:(f[0]<<8)+f[1]}};Xi.readUnsigned=o;var s=function(p,v){return function(f,_,E){for(var w=typeof v=="function"?v(f,_,E):v,x=n(p),y=new Array(w),g=0;g<w;g++)y[g]=x(f);return y}};Xi.readArray=s;var u=function(p,v,f){for(var _=0,E=0;E<f;E++)_+=p[v+E]&&Math.pow(2,f-E-1);return _},c=function(p){return function(v){for(var f=r()(v),_=new Array(8),E=0;E<8;E++)_[7-E]=!!(f&1<<E);return Object.keys(p).reduce(function(w,x){var y=p[x];return y.length?w[x]=u(_,y.index,y.length):w[x]=_[y.index],w},{})}};return Xi.readBits=c,Xi}var i4;function IC(){return i4||(i4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a_(),t=o_(),n={blocks:function(v){for(var f=0,_=[],E=v.data.length,w=0,x=(0,t.readByte)()(v);x!==f&&x;x=(0,t.readByte)()(v)){if(v.pos+x>=E){var y=E-v.pos;_.push((0,t.readBytes)(y)(v)),w+=y;break}_.push((0,t.readBytes)(x)(v)),w+=x}for(var g=new Uint8Array(w),S=0,b=0;b<_.length;b++)g.set(_[b],S),S+=_[b].length;return g}},a=(0,r.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},function(p){var v=(0,t.peekBytes)(2)(p);return v[0]===33&&v[1]===249}),i=(0,r.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,r.conditional)({lct:(0,t.readArray)(3,function(p,v,f){return Math.pow(2,f.descriptor.lct.size+1)})},function(p,v,f){return f.descriptor.lct.exists}),{data:[{minCodeSize:(0,t.readByte)()},n]}]},function(p){return(0,t.peekByte)()(p)===44}),o=(0,r.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(v,f,_){return(0,t.readBytes)(_.text.blockSize)(v)}},n]},function(p){var v=(0,t.peekBytes)(2)(p);return v[0]===33&&v[1]===1}),s=(0,r.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(v,f,_){return(0,t.readString)(_.blockSize)(v)}},n]},function(p){var v=(0,t.peekBytes)(2)(p);return v[0]===33&&v[1]===255}),u=(0,r.conditional)({comment:[{codes:(0,t.readBytes)(2)},n]},function(p){var v=(0,t.peekBytes)(2)(p);return v[0]===33&&v[1]===254}),c=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,r.conditional)({gct:(0,t.readArray)(3,function(p,v){return Math.pow(2,v.lsd.gct.size+1)})},function(p,v){return v.lsd.gct.exists}),{frames:(0,r.loop)([a,s,u,i,o],function(p){var v=(0,t.peekByte)()(p);return v===33||v===44})}],h=c;e.default=h}(Cv)),Cv}var Kd={},a4;function jC(){if(a4)return Kd;a4=1,Object.defineProperty(Kd,"__esModule",{value:!0}),Kd.deinterlace=void 0;var e=function(t,n){for(var a=new Array(t.length),i=t.length/n,o=function(f,_){var E=t.slice(_*n,(_+1)*n);a.splice.apply(a,[f*n,n].concat(E))},s=[0,4,2,1],u=[8,8,4,2],c=0,h=0;h<4;h++)for(var p=s[h];p<i;p+=u[h])o(p,c),c++;return a};return Kd.deinterlace=e,Kd}var Zd={},o4;function FC(){if(o4)return Zd;o4=1,Object.defineProperty(Zd,"__esModule",{value:!0}),Zd.lzw=void 0;var e=function(t,n,a){var i=4096,o=-1,s=a,u,c,h,p,v,f,_,L,E,w,R,x,T,F,O,I,y=new Array(a),g=new Array(i),S=new Array(i),b=new Array(i+1);for(x=t,c=1<<x,v=c+1,u=c+2,_=o,p=x+1,h=(1<<p)-1,E=0;E<c;E++)g[E]=0,S[E]=E;var R,L,T,F,I,O;for(R=L=T=F=I=O=0,w=0;w<s;){if(F===0){if(L<p){R+=n[O]<<L,L+=8,O++;continue}if(E=R&h,R>>=p,L-=p,E>u||E==v)break;if(E==c){p=x+1,h=(1<<p)-1,u=c+2,_=o;continue}if(_==o){b[F++]=S[E],_=E,T=E;continue}for(f=E,E==u&&(b[F++]=T,E=_);E>c;)b[F++]=S[E],E=g[E];T=S[E]&255,b[F++]=T,u<i&&(g[u]=_,S[u]=T,u++,(u&h)===0&&u<i&&(p++,h+=u)),_=f}F--,y[I++]=b[F],w++}for(w=I;w<s;w++)y[w]=0;return y};return Zd.lzw=e,Zd}var s4;function DC(){if(s4)return ac;s4=1,Object.defineProperty(ac,"__esModule",{value:!0}),ac.decompressFrames=ac.decompressFrame=ac.parseGIF=void 0;var e=i(IC()),r=a_(),t=o_(),n=jC(),a=FC();function i(h){return h&&h.__esModule?h:{default:h}}var o=function(p){var v=new Uint8Array(p);return(0,r.parse)((0,t.buildStream)(v),e.default)};ac.parseGIF=o;var s=function(p){for(var v=p.pixels.length,f=new Uint8ClampedArray(v*4),_=0;_<v;_++){var E=_*4,w=p.pixels[_],x=p.colorTable[w]||[0,0,0];f[E]=x[0],f[E+1]=x[1],f[E+2]=x[2],f[E+3]=w!==p.transparentIndex?255:0}return f},u=function(p,v,f){if(!p.image){console.warn("gif frame does not have associated image.");return}var _=p.image,E=_.descriptor.width*_.descriptor.height,w=(0,a.lzw)(_.data.minCodeSize,_.data.blocks,E);_.descriptor.lct.interlaced&&(w=(0,n.deinterlace)(w,_.descriptor.width));var x={pixels:w,dims:{top:p.image.descriptor.top,left:p.image.descriptor.left,width:p.image.descriptor.width,height:p.image.descriptor.height}};return _.descriptor.lct&&_.descriptor.lct.exists?x.colorTable=_.lct:x.colorTable=v,p.gce&&(x.delay=(p.gce.delay||10)*10,x.disposalType=p.gce.extras.disposal,p.gce.extras.transparentColorGiven&&(x.transparentIndex=p.gce.transparentColorIndex)),f&&(x.patch=s(x)),x};ac.decompressFrame=u;var c=function(p,v){return p.frames.filter(function(f){return f.image}).map(function(f){return u(f,p.gct,v)})};return ac.decompressFrames=c,ac}var l4;function BC(){return l4||(l4=1,function(e){var r=Xd&&Xd.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.GifElement=void 0;const t=r(ai()),n=Us,a=vs,i=Fu,o=r(Hs()),s=DC(),u=i_(),c=Om(),h=Ap(),p=If(),v=rf();function f(w,x,y){const g=x.getContext("2d"),S=y.getContext("2d");if(!g||!S)return;w.disposalType===2&&g.clearRect(0,0,x.width,x.height),y.width=w.width,y.height=w.height;const b=S.createImageData(w.width,w.height);b.data.set(w.patch),S.putImageData(b,0,0),g.drawImage(y,w.left,w.top)}const _=(0,n.observer)(({element:w})=>{const x=Math.min(30,w.width/4,w.height/4),y=t.default.useRef(null);return t.default.useEffect(()=>{const g=y.current;if(!g)return;const S=new o.default.Animation(b=>{g.rotate(((b==null?void 0:b.timeDiff)||0)/2)},g.getLayer());return S.start(),()=>{S.stop()}},[]),t.default.createElement(i.Group,{x:w.a.x,y:w.a.y,rotation:w.a.rotation,listening:!1,opacity:w.a.opacity,hideInExport:!w.showInExport},t.default.createElement(i.Rect,{width:w.width,height:w.height,fill:"rgba(124, 173, 212, 0.8)"}),t.default.createElement(i.Arc,{ref:y,x:w.width/2,y:w.height/2,fill:"white",outerRadius:Math.abs(x),innerRadius:Math.max(1,x-5),angle:270}))}),E=(0,n.observer)(({element:w})=>{const x=Math.max(10,Math.min(30,w.width/22));return t.default.createElement(i.Group,{x:w.a.x,y:w.a.y,rotation:w.a.rotation,listening:!1,opacity:w.a.opacity,hideInExport:!w.showInExport},t.default.createElement(i.Rect,{width:w.width,height:w.height,fill:"rgba(223, 102, 102, 0.8)"}),t.default.createElement(i.Text,{text:"Cannot load the GIF...",fontSize:x,width:w.width,height:w.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});e.GifElement=(0,n.observer)(({element:w,store:x})=>{var y;const[g,S]=t.default.useState(!1),b=x.selectedShapes.indexOf(w)>=0&&w.selectable,R=t.default.useRef(null),L=t.default.useRef(),[T,F,I,O]=function(Q){const[ee,te]=t.default.useState([]),[ae,se]=t.default.useState(0),[ce,me]=t.default.useState("loading"),[_e,Le]=t.default.useState({width:0,height:0});return t.default.useEffect(()=>{(async()=>{try{const Re=await fetch(Q),Pe=await Re.arrayBuffer(),ve=(0,s.parseGIF)(Pe),it=(0,s.decompressFrames)(ve,!0),Se=ve.lsd.width,be=ve.lsd.height;Le({width:Se,height:be});const Ae=it.map(he=>({patch:new Uint8ClampedArray(he.patch),delay:he.delay,width:he.dims.width,height:he.dims.height,left:he.dims.left,top:he.dims.top,disposalType:he.disposalType})),Te=Ae.reduce((he,Oe)=>he+Oe.delay,0);te(Ae),se(Te),me("loaded")}catch(Re){console.error("Failed to load GIF:",Re),me("failed")}})()},[Q]),[ee,ae,_e,ce]}(w.src);(0,c.useImageLoader)(O,w.src,w.id),t.default.useEffect(()=>(L.current=document.createElement("canvas"),()=>{L.current&&o.default.Util.releaseCanvas(L.current)}),[]),t.default.useEffect(()=>{if(O==="loaded"&&L.current&&(L.current.width=I.width,L.current.height=I.height,T.length>0)){const Q=L.current.getContext("2d");if(Q){Q.clearRect(0,0,I.width,I.height);const ee=document.createElement("canvas");f(T[0],L.current,ee)}}},[I,O,T]),t.default.useEffect(()=>{if(!T.length||!L.current)return;const Q=L.current;Q.width=I.width,Q.height=I.height;const ee=document.createElement("canvas"),te=Q.getContext("2d");te&&te.clearRect(0,0,Q.width,Q.height);let ae=-1;f(T[0],Q,ee),Z(),ae=0;const se=ce=>{const me=(_e=>{const Le=_e%F;let Re=0;for(let Pe=0;Pe<T.length;Pe++)if(Re+=T[Pe].delay,Re>Le)return Pe;return 0})(ce);me!==ae&&(f(T[me],Q,ee),Z(),R.current.getLayer().draw(),ae=me)};if(x.isPlaying||w.page._exportingOrRendering)return(0,a.autorun)(()=>{se(x.currentTime-w.page.startTime)});{const ce=window.setInterval(()=>{se(x.currentTime||performance.now())},16);return()=>{clearInterval(ce)}}},[x.isPlaying,T,F,w.page._exportingOrRendering]),t.default.useEffect(()=>{F&&x.history.ignore(()=>{w.set({duration:F})})},[F]);let{cropX:C,cropY:A,cropWidth:j,cropHeight:N}=w;O!=="loaded"&&(C=A=0,j=N=1);const B={x:I.width*C,y:I.height*A,width:I.width*j,height:I.height*N},W=(y=w.cornerRadius)!==null&&y!==void 0?y:0,[Y,Z]=(0,u.useCornerRadiusAndCrop)(w,L.current,B,x._elementsPixelRatio,W,g||w._cropModeEnabled);t.default.useLayoutEffect(()=>{if(!g&&!w._cropModeEnabled&&R.current)return(0,h.applyFilter)(R.current,w),(0,a.autorun)(()=>{(0,h.applyFilter)(R.current,w)},{delay:100})},[L.current,g,j,N,w._cropModeEnabled,I.width,I.height]);const V=O==="loading",H=O==="failed",U=V||H?0:w.a.opacity;(0,p.useFadeIn)(R,U);const D=w.selectable||x.role==="admin",$=(0,v.isTouchDevice)();return t.default.createElement(t.default.Fragment,null,V&&t.default.createElement(_,{element:w}),H&&t.default.createElement(E,{element:w}),t.default.createElement(i.Image,{ref:R,name:"element",id:w.id,image:Y,x:w.a.x,y:w.a.y,width:w.a.width||1,height:w.a.height||1,rotation:w.a.rotation,opacity:U,shadowEnabled:w.shadowEnabled,shadowBlur:w.shadowBlur,shadowOffsetX:w.shadowOffsetX,shadowOffsetY:w.shadowOffsetY,shadowColor:w.shadowColor,shadowOpacity:w.shadowOpacity,customCrop:B,listening:D,draggable:$?w.draggable&&b:w.draggable,preventDefault:!$||b,hideInExport:!w.showInExport,onDragMove:Q=>{w.set({x:Q.target.x(),y:Q.target.y()})},onDragEnd:Q=>{w.set({x:Q.target.x(),y:Q.target.y()})},onTransformStart:()=>S(!0),onTransform:Q=>{const ee=Q.currentTarget,te=Math.abs(ee.scaleX()-1)<1e-7?1:ee.scaleX(),ae=Math.abs(ee.scaleY()-1)<1e-7?1:ee.scaleY();ee.scaleX(1),ee.scaleY(1),w.set({x:ee.x(),y:ee.y(),width:ee.width()*te,height:ee.height()*ae,rotation:ee.rotation()})},onTransformEnd:()=>S(!1)}),t.default.createElement(i.Rect,{x:w.a.x,y:w.a.y,width:Math.max(w.a.width-w.borderSize,0),height:Math.max(w.a.height-w.borderSize,0),opacity:U,offsetX:-w.borderSize/2,offsetY:-w.borderSize/2,stroke:w.borderColor,strokeWidth:w.borderSize,listening:!1,visible:!!w.borderSize,rotation:w.rotation,cornerRadius:Math.max(0,W-w.borderSize),hideInExport:!w.showInExport}))})}(Xd)),Xd}var Qd={},u4;function qC(){return u4||(u4=1,function(e){var r=Qd&&Qd.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.Highlighter=e.setHighlighterStyle=void 0;const t=r(ai()),n=Us,a=Fu,i={stroke:"rgb(0, 161, 255)",strokeWidth:2};e.setHighlighterStyle=o=>{Object.assign(i,o)},e.Highlighter=(0,n.observer)(({element:o})=>t.default.createElement(a.Rect,Object.assign({name:"highlighter",x:o.a.x,y:o.a.y,rotation:o.a.rotation,width:o.a.width,height:o.a.height,listening:!1,strokeScaleEnabled:!1},i)))}(Qd)),Qd}var Jd={};let zC="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",s_=e=>crypto.getRandomValues(new Uint8Array(e)),l_=(e,r,t)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,a=-~(1.6*n*r/e.length);return(i=r)=>{let o="";for(;;){let s=t(a),u=a;for(;u--;)if(o+=e[s[u]&n]||"",o.length===i)return o}}},UC=(e,r=21)=>l_(e,r,s_),HC=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((r,t)=>(t&=63,t<36?r+=t.toString(36):t<62?r+=(t-26).toString(36).toUpperCase():t>62?r+="-":r+="_",r),"");const GC=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:UC,customRandom:l_,nanoid:HC,random:s_,urlAlphabet:zC},Symbol.toStringTag,{value:"Module"})),u0=Zc(GC);var kv={},Is={},Lv={},Nv={},c4;function u_(){return c4||(c4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.deepEqual=void 0,e.deepEqual=function(r,t){if(r===t)return!0;if(typeof r=="object"&&r!=null&&typeof t=="object"&&t!=null){if(Object.keys(r).length!=Object.keys(t).length)return!1;for(var n in r)if(!t.hasOwnProperty(n)||!(0,e.deepEqual)(r[n],t[n]))return!1;return!0}return!1}}(Nv)),Nv}var f4;function VC(){return f4||(f4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UndoManager=void 0;const r=hl,t=u_();Object.assign(r.types),e.UndoManager=r.types.model("UndoManager",{history:r.types.array(r.types.frozen()),undoIdx:-1,targetPath:""}).views(n=>({get canUndo(){return n.undoIdx>0},get canRedo(){return n.undoIdx<n.history.length-1}})).actions(n=>{let a,i,o=!1,s=null,u=0,c=0;const h=()=>c>0;function p(){const f=(0,r.getSnapshot)(a);return{pages:f.pages,width:f.width,height:f.height,custom:f.custom,audios:f.audios}}function v(f){const _=a.pages.map(y=>y.id),E=f.pages.map(y=>y.id),w=!(0,t.deepEqual)(_,E),x=!(0,t.deepEqual)(a.custom,f.custom);w?(0,r.applySnapshot)(a.pages,f.pages):a.pages.forEach((y,g)=>{(0,r.applySnapshot)(y,f.pages[g])}),x&&a.set({custom:f.custom}),a.setSize(f.width,f.height)}return{startTransaction(){c++},endTransaction(f){c--,f||this.requestAddState(p())},async ignore(f,_=!1,E=!1){E&&await new Promise(S=>setTimeout(S,10)),u&&n.addUndoState();let w=h();n.startTransaction();let x=c;try{await f()}catch(S){setTimeout(()=>{throw S})}const y=x!==c,g=!y;n.endTransaction(g),_||w||n.replaceState(),y||(clearTimeout(u),u=0)},async transaction(f){await n.ignore(f,!0),this.addUndoState()},requestAddState(f){s=f,u||h()||(o?o=!1:u=setTimeout(()=>{u=0,clearTimeout(u),h()||this.addUndoState()},100))},addUndoState(){if(o)return void(o=!1);const f=n.history[n.undoIdx];!(0,t.deepEqual)(s,f)&&(clearTimeout(u),u=0,n.history.splice(n.undoIdx+1),n.history.push(s),n.undoIdx=n.history.length-1)},afterCreate(){if(a=(0,r.resolvePath)(n,".."),!a)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");i=(0,r.onSnapshot)(a,()=>{this.requestAddState(p())}),n.history.length===0&&this.requestAddState(p())},clear(){clearTimeout(u),u=0,n.history.splice(0,n.history.length),n.undoIdx=-1,n.addUndoState(p())},beforeDestroy(){i()},undo(){u&&this.addUndoState(),n.canUndo?(n.undoIdx--,o=!0,v(n.history[n.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){u&&this.addUndoState(),n.canRedo?(n.undoIdx++,o=!0,v(n.history[n.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){n.history[n.undoIdx]=p()}}}),e.default=e.UndoManager}(Lv)),Lv}var Tv={},h4;function WC(){return h4||(h4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.downloadFile=async function(r,t){const n=await(await fetch(r)).blob(),a=document.createElement("a"),i=URL.createObjectURL(n);a.href=i,a.download=t,document.body.appendChild(a),a.click(),setTimeout(function(){document.body.removeChild(a),window.URL.revokeObjectURL(i)},0)}}(Tv)),Tv}var Rv={},d4;function $C(){return d4||(d4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsPDF=function(){var n;return!((n=window.jspdf)===null||n===void 0)&&n.jsPDF?Promise.resolve(window.jspdf.jsPDF):t||(t=new Promise(a=>{var i=document.createElement("script");i.onload=function(){a(window.jspdf.jsPDF)},i.src=r,document.head.appendChild(i)}),t)};const r="https://cdnjs.cloudflare.com/ajax/libs/jspdf/3.0.1/jspdf.umd.min.js";let t=null}(Rv)),Rv}var Mv={},p4;function YC(){return p4||(p4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getGIF=t,e.createGIF=async function({width:n,height:a}){return new(await t())({workers:4,width:n,height:a,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
|
|
303
|
-
(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]);
|
|
304
|
-
`],{type:"application/javascript"}))})};const r="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js";function t(){return window.GIF?Promise.resolve(window.GIF):new Promise(n=>{var a=document.createElement("script");a.onload=function(){n(window.GIF)},a.src=r,document.head.appendChild(a)})}}(Mv)),Mv}var sc={},Iv={},g4;function XC(){return g4||(g4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.setAPI=e.iconscoutDownload=e.iconscoutList=e.svgapiDownload=e.svgapiList=e.unsplashDownload=e.unsplashList=e.textTemplateList=e.templateList=e.removeBackground=e.polotnoShapesList=e.getGoogleFontImage=e.getGoogleFontsListAPI=e.URLS=e.getAPI=e.API=e.URL=void 0;const r=Tm();e.URL="https://api.polotno.com",e.API=`${e.URL}/api`,e.getAPI=()=>e.URL+"/api";const t={},n=(i,o)=>{t[i]||(t[i]=!0,console.error(o))},a=`API for iconscout is provided as a demonstration.
|
|
305
|
-
For production usage you have to use your own API endpoint.
|
|
306
|
-
https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
|
|
307
|
-
https://polotno.com/docs/server-api`;e.URLS={unsplashList:({query:i,page:o=1})=>`${(0,e.getAPI)()}/get-unsplash?query=${i}&per_page=20&page=${o}&KEY=${(0,r.getKey)()}`,unsplashDownload:i=>`${(0,e.getAPI)()}/download-unsplash?id=${i}&KEY=${(0,r.getKey)()}`,svgapiList:({query:i,page:o=0})=>`${(0,e.getAPI)()}/get-svgapi?query=${i}&page=${o}&per_page=20&KEY=${(0,r.getKey)()}`,svgapiDownload:i=>`${(0,e.getAPI)()}/download-svgapi?path=${i}&KEY=${(0,r.getKey)()}`,iconscoutList:({query:i,page:o=1})=>(n("iconscout",a),`${(0,e.getAPI)()}/get-iconscout?query=${i}&page=${o}&KEY=${(0,r.getKey)()}`),iconscoutDownload:i=>(n("iconscout",a),`${(0,e.getAPI)()}/download-iconscout?uuid=${i}&KEY=${(0,r.getKey)()}`),nounProjectList:({query:i,page:o=1})=>`${(0,e.getAPI)()}/get-nounproject?query=${i}&page=${o}&KEY=${(0,r.getKey)()}`,nounProjectDownload:i=>`${(0,e.getAPI)()}/download-nounproject?id=${i}&KEY=${(0,r.getKey)()}`,templateList:({query:i,page:o=1,sizeQuery:s})=>`${(0,e.getAPI)()}/get-templates?${s}&query=${i}&per_page=30&page=${o}&KEY=${(0,r.getKey)()}`,googleFontsList:()=>`${(0,e.getAPI)()}/get-google-fonts?KEY=${(0,r.getKey)()}`,googleFontImage:i=>{return`${e.URL}/google-fonts-previews/black/${o=i,o.replace(new RegExp(" ","g"),"-")}.png`;var o},textTemplateList:()=>`${(0,e.getAPI)()}/get-text-templates?KEY=${(0,r.getKey)()}`,removeBackground:()=>`${(0,e.getAPI)()}/remove-image-background?KEY=${(0,r.getKey)()}`,aiText:()=>`${(0,e.getAPI)()}/ai/text?KEY=${(0,r.getKey)()}`},e.getGoogleFontsListAPI=()=>e.URLS.googleFontsList(),e.getGoogleFontImage=i=>e.URLS.googleFontImage(i),e.polotnoShapesList=()=>`${(0,e.getAPI)()}/get-basic-shapes?KEY=${(0,r.getKey)()}`,e.removeBackground=()=>e.URLS.removeBackground(),e.templateList=i=>e.URLS.templateList(i),e.textTemplateList=()=>e.URLS.textTemplateList(),e.unsplashList=i=>e.URLS.unsplashList(i),e.unsplashDownload=i=>e.URLS.unsplashDownload(i),e.svgapiList=i=>e.URLS.svgapiList(i),e.svgapiDownload=i=>e.URLS.svgapiDownload(i),e.iconscoutList=i=>e.URLS.iconscoutList(i),e.iconscoutDownload=i=>e.URLS.iconscoutDownload(i),e.setAPI=(i,o)=>{e.URLS[i]=o}}(Iv)),Iv}var v4;function Tm(){return v4||(v4=1,function(e){var r,t=sc&&sc.__createBinding||(Object.create?function(T,F,I,O){O===void 0&&(O=I);var C=Object.getOwnPropertyDescriptor(F,I);C&&!("get"in C?!F.__esModule:C.writable||C.configurable)||(C={enumerable:!0,get:function(){return F[I]}}),Object.defineProperty(T,O,C)}:function(T,F,I,O){O===void 0&&(O=I),T[O]=F[I]}),n=sc&&sc.__setModuleDefault||(Object.create?function(T,F){Object.defineProperty(T,"default",{enumerable:!0,value:F})}:function(T,F){T.default=F}),a=sc&&sc.__importStar||(r=function(T){return r=Object.getOwnPropertyNames||function(F){var I=[];for(var O in F)Object.prototype.hasOwnProperty.call(F,O)&&(I[I.length]=O);return I},r(T)},function(T){if(T&&T.__esModule)return T;var F={};if(T!=null)for(var I=r(T),O=0;O<I.length;O++)I[O]!=="default"&&t(F,T,I[O]);return n(F,T),F});Object.defineProperty(e,"__esModule",{value:!0}),e.__=e.getKey=e.isCreditVisible=e.___=void 0,e.isKeyPaid=L,e.validateKey=async function(T,F){p=T,await L(T)&&!F||h()};const i=a(vs),o=XC(),s=gc(),u=i.observable({value:!1}),c=i.observable({value:"v1"});e.___=()=>c.value,e.isCreditVisible=()=>u.value;const h=i.action(()=>{u.value=!0});let p="";e.getKey=()=>p||"";const v=5,f=3e3,_="Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet",E="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",w="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",x="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let y=window.location.origin;const g=navigator.userAgent.indexOf("Headless")>-1,S=navigator.userAgent.indexOf("Electron")>-1;y==="file://"&&g&&(y="headless"),y==="file://"&&S&&(y="electron");const b=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${y}" here: https://polotno.com/cabinet`;let R=fetch;async function L(T){for(let F=0;F<v;F++)try{const I=await R((0,o.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:T,site:location.host,skdVersion:"2.24.0"})});if(i.runInAction(()=>{c.value=I.headers.get("x-api-version")}),!T)return console.warn(_),!1;if(I.status!==200){await new Promise(C=>setTimeout(C,f));continue}const O=await I.json();return O.is_valid||console.warn(E),O.is_paid||console.log(x,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),O.is_domain_valid||console.log(b,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,s.useRemoveBackground)(O.remove_background_enabled),O.is_paid||!1}catch{await new Promise(O=>setTimeout(O,f))}return console.error(w),!0}e.__=T=>{R=T}}(sc)),sc}var jv={},m4;function Rm(){return m4||(m4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pxToUnitString=e.unitToPx=e.pxToUnitRounded=e.pxToUnit=void 0,e.pxToUnit=({px:r,unit:t="px",dpi:n})=>{switch(t){case"pt":default:return r;case"mm":return r/(n/25.4);case"cm":return r/(n/2.54);case"in":return r/n}},e.pxToUnitRounded=({px:r,precious:t=2,dpi:n=72,unit:a="px"})=>parseFloat((0,e.pxToUnit)({px:r,dpi:n,unit:a}).toFixed(t)),e.unitToPx=({unitVal:r,dpi:t,unit:n})=>r/(0,e.pxToUnit)({px:1,unit:n,dpi:t}),e.pxToUnitString=r=>{const t=parseFloat((0,e.pxToUnit)(r).toFixed(1));switch(r.unit){case"pt":return`${Math.round(t)}pt`;case"mm":return`${t}mm`;case"cm":return`${t}cm`;case"in":return`${t}in`;default:return`${Math.round(t)}px`}}}(jv)),jv}var Fv={},y4;function KC(){return y4||(y4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.waitTillAvailable=async function(r){for(let t=0;t<30;t++){const n=await r();if(n)return n;await new Promise(a=>setTimeout(a,50))}}}(Fv)),Fv}var ql={},Dv={},b4;function D1(){return b4||(b4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getImageSize=function(n){return new Promise(a=>{const i=document.createElement("img");i.onload=async()=>{i.width===0||i.height===0?a(await(0,r.getSvgSize)(n)):a({width:i.width,height:i.height})},i.crossOrigin="anonymous",i.src=n})},e.loadImage=t,e.cropImage=async function(n,a){const i=await t(n),o=document.createElement("canvas");o.width=2*i.width,o.height=2*i.height,o.getContext("2d").drawImage(i,0,0,o.width,o.height);const s=document.createElement("canvas");s.width=a.width,s.height=a.height;const u=s.getContext("2d");let{cropX:c,cropY:h}=a;const p=o.width*a.cropWidth,v=o.height*a.cropHeight,f=a.width/a.height;let _,E;const w=p/v;return a.type==="svg"?(_=p,E=v):f>=w?(_=p,E=p/f):(_=v*f,E=v),u.drawImage(o,c*o.width,h*o.height,_,E,0,0,s.width,s.height),s.toDataURL("image/png")},e.getCrop=function(n,a){const{width:i,height:o}=n,s=i/o;let u,c;s>=a.width/a.height?(u=a.width,c=a.width/s):(u=a.height*s,c=a.height);const h=(a.width-u)/2,p=(a.height-c)/2;return{cropX:h/a.width,cropY:p/a.height,cropWidth:u/a.width,cropHeight:c/a.height}};const r=kp();function t(n){return new Promise((a,i)=>{const o=document.createElement("img");o.onload=()=>{a(o)},o.onerror=s=>{i(s)},o.crossOrigin="anonymous",o.src=n})}}(Dv)),Dv}var Bv={},w4;function c_(){return w4||(w4=1,function(e){var r;Object.defineProperty(e,"__esModule",{value:!0}),e.Effects=void 0,e.shapeFilterToCSS=function(t,n){let a={filter:"",html:void 0};switch(t){case r.warm:{const i=Math.max(0,Math.min(1,n??.5)),o=1+.3*i,s=1+.15*i,u=1;return a.filter="url(#warm-filter)",a.html=`
|
|
308
|
-
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
309
|
-
<filter id="warm-filter" color-interpolation-filters="sRGB">
|
|
310
|
-
<feColorMatrix type="matrix" values="
|
|
311
|
-
${o} 0 0 0 0
|
|
312
|
-
0 ${s} 0 0 0
|
|
313
|
-
0 0 ${u} 0 0
|
|
314
|
-
0 0 0 1 0" />
|
|
315
|
-
</filter>
|
|
316
|
-
</svg>`,a}case r.cold:{const i=Math.max(0,Math.min(1,n??.5)),o=1-.15*i,s=1-.1*i,u=1+.15*i;return a.filter="url(#cold-filter)",a.html=`
|
|
317
|
-
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
318
|
-
<filter id="cold-filter" color-interpolation-filters="sRGB">
|
|
319
|
-
<feColorMatrix type="matrix" values="
|
|
320
|
-
${o} 0 0 0 0
|
|
321
|
-
0 ${s} 0 0 0
|
|
322
|
-
0 0 ${u} 0 0
|
|
323
|
-
0 0 0 1 0" />
|
|
324
|
-
</filter>
|
|
325
|
-
</svg>`,a}case"natural":{const i=Math.max(0,Math.min(1,n??.5)),o=1+.1*i,s=1+.3*i,u=1+.2*i;return a.filter=`saturate(${s}) brightness(${o}) contrast(${u})`,a}case r.temperature:{const i=Math.max(-1,Math.min(1,n??0)),o=1+.15*i,s=1,u=1-.15*i;return a.filter="url(#temperature-filter)",a.html=`
|
|
326
|
-
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
327
|
-
<filter id="temperature-filter" color-interpolation-filters="sRGB">
|
|
328
|
-
<feColorMatrix type="matrix" values="
|
|
329
|
-
${o} 0 0 0 0
|
|
330
|
-
0 ${s} 0 0 0
|
|
331
|
-
0 0 ${u} 0 0
|
|
332
|
-
0 0 0 1 0" />
|
|
333
|
-
</filter>
|
|
334
|
-
</svg>
|
|
335
|
-
`,a}case r.contrast:{const i=100*Math.max(-1,Math.min(1,n??0)),o=259*(i+255)/(255*(259-i)),s=.5*(1-o);return a.filter="url(#contrast-filter)",a.html=`
|
|
336
|
-
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
337
|
-
<filter id="contrast-filter" color-interpolation-filters="sRGB">
|
|
338
|
-
<feComponentTransfer>
|
|
339
|
-
<feFuncR type="linear" slope="${o}" intercept="${s}" />
|
|
340
|
-
<feFuncG type="linear" slope="${o}" intercept="${s}" />
|
|
341
|
-
<feFuncB type="linear" slope="${o}" intercept="${s}" />
|
|
342
|
-
</feComponentTransfer>
|
|
343
|
-
</filter>
|
|
344
|
-
</svg>
|
|
345
|
-
`,a}case r.shadows:{const i=Math.max(-1,Math.min(1,n??0)),o=Math.min(Math.max(1-.6*i,.4),2.5);return a.filter="url(#shadows-filter)",a.html=`
|
|
346
|
-
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
347
|
-
<filter id="shadows-filter" color-interpolation-filters="sRGB">
|
|
348
|
-
<feComponentTransfer>
|
|
349
|
-
<feFuncR type="gamma" amplitude="1" exponent="${o}" offset="0" />
|
|
350
|
-
<feFuncG type="gamma" amplitude="1" exponent="${o}" offset="0" />
|
|
351
|
-
<feFuncB type="gamma" amplitude="1" exponent="${o}" offset="0" />
|
|
352
|
-
</feComponentTransfer>
|
|
353
|
-
</filter>
|
|
354
|
-
</svg>
|
|
355
|
-
`,a}case r.white:case r.black:return null;case r.vibrance:{const i=Math.max(-1,Math.min(1,n??0)),o=.299,s=.587,u=.114;let c;c=i>=0?1+1.5*i:1+i;const h=1-c,p=h*o+c,v=h*s,f=h*u,_=h*o,E=h*s+c,w=h*u,x=h*o,y=h*s,g=h*u+c;return a.filter="url(#vibrance-filter)",a.html=`
|
|
356
|
-
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
357
|
-
<filter id="vibrance-filter" color-interpolation-filters="sRGB">
|
|
358
|
-
<feColorMatrix type="matrix" values="
|
|
359
|
-
${p} ${v} ${f} 0 0
|
|
360
|
-
${_} ${E} ${w} 0 0
|
|
361
|
-
${x} ${y} ${g} 0 0
|
|
362
|
-
0 0 0 1 0" />
|
|
363
|
-
</filter>
|
|
364
|
-
</svg>
|
|
365
|
-
`,a}case r.saturation:{const u=1+Math.max(-1,Math.min(1,n??0)),c=1-u,h=c*.2126+u,p=c*.7152,v=c*.0722,f=c*.2126,_=c*.7152+u,E=c*.0722,w=c*.2126,x=c*.7152,y=c*.0722+u;return a.filter="url(#saturation-filter)",a.html=`
|
|
366
|
-
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
367
|
-
<filter id="saturation-filter" color-interpolation-filters="sRGB">
|
|
368
|
-
<feColorMatrix type="matrix" values="
|
|
369
|
-
${h} ${p} ${v} 0 0
|
|
370
|
-
${f} ${_} ${E} 0 0
|
|
371
|
-
${w} ${x} ${y} 0 0
|
|
372
|
-
0 0 0 1 0" />
|
|
373
|
-
</filter>
|
|
374
|
-
</svg>
|
|
375
|
-
`,a}default:return null}},function(t){t.sepia="sepia",t.grayscale="grayscale",t.natural="natural",t.warm="warm",t.cold="cold",t.temperature="temperature",t.contrast="contrast",t.shadows="shadows",t.white="white",t.black="black",t.vibrance="vibrance",t.saturation="saturation"}(r||(e.Effects=r={}))}(Bv)),Bv}var qv={},_4;function ZC(){return _4||(_4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getVideoSize=async function(r){return new Promise((t,n)=>{const a=document.createElement("video");a.crossOrigin="anonymous",a.src=r,a.addEventListener("loadedmetadata",()=>{const{videoWidth:i,videoHeight:o}=a;t({width:i,height:o})}),a.addEventListener("error",i=>{const o=r.slice(0,100);n(new Error(`Failed to load video: ${o}`))})})},e.getVideoDuration=async function(r){return new Promise(t=>{const n=document.createElement("video");n.crossOrigin="anonymous",n.src=r,n.addEventListener("loadedmetadata",()=>{const{duration:a}=n;t(a)})})},e.getVideoPreview=async function(r,t=5){return new Promise((n,a)=>{var i=document.createElement("video"),o=document.createElement("canvas");o.width=480,o.height=360;var s=o.getContext("2d");i.crossOrigin="anonymous",i.src=r,i.addEventListener("error",u=>{a(u)}),i.addEventListener("loadeddata",function(){const u=i.videoWidth/i.videoHeight;o.width=480,o.height=480/u,i.currentTime=t}),i.addEventListener("seeked",function(){s.drawImage(i,0,0,o.width,o.height);try{var u=o.toDataURL();n(u)}catch(c){a(c)}})})},e.getVideoObjectPreview=async function(r,t,n){return new Promise((a,i)=>{const o=t.getContext("2d"),s=()=>{try{o.drawImage(r,0,0,t.width,t.height);const u=t.toDataURL();a(u),r.removeEventListener("seeked",s)}catch(u){i(u),r.removeEventListener("seeked",s)}};r.addEventListener("seeked",s),r.currentTime=n})}}(qv)),qv}var S4;function QC(){return S4||(S4=1,function(e){var r,t=ql&&ql.__createBinding||(Object.create?function(b,R,L,T){T===void 0&&(T=L);var F=Object.getOwnPropertyDescriptor(R,L);F&&!("get"in F?!R.__esModule:F.writable||F.configurable)||(F={enumerable:!0,get:function(){return R[L]}}),Object.defineProperty(b,T,F)}:function(b,R,L,T){T===void 0&&(T=L),b[T]=R[L]}),n=ql&&ql.__setModuleDefault||(Object.create?function(b,R){Object.defineProperty(b,"default",{enumerable:!0,value:R})}:function(b,R){b.default=R}),a=ql&&ql.__importStar||(r=function(b){return r=Object.getOwnPropertyNames||function(R){var L=[];for(var T in R)Object.prototype.hasOwnProperty.call(R,T)&&(L[L.length]=T);return L},r(b)},function(b){if(b&&b.__esModule)return b;var R={};if(b!=null)for(var L=r(b),T=0;T<L.length;T++)L[T]!=="default"&&t(R,b,L[T]);return n(R,b),R}),i=ql&&ql.__rest||function(b,R){var L={};for(var T in b)Object.prototype.hasOwnProperty.call(b,T)&&R.indexOf(T)<0&&(L[T]=b[T]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function"){var F=0;for(T=Object.getOwnPropertySymbols(b);F<T.length;F++)R.indexOf(T[F])<0&&Object.prototype.propertyIsEnumerable.call(b,T[F])&&(L[T[F]]=b[T[F]])}return L};Object.defineProperty(e,"__esModule",{value:!0}),e.fixRatio=function(b){var R=new DOMParser().parseFromString(b,"image/svg+xml");return R.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(R)},e.jsonToDOM=g,e.jsonToHTML=async function({json:b,elementHook:R}){const L=await g({json:b,elementHook:R});return S({dom:L})};const o=D1(),s=a(kp()),u=D1(),c=Nm(),h=t_(),p=c_(),v=ZC(),f=Ih(),_=(b,R,...L)=>({type:b,props:R,children:L||[]}),E=async({element:b,page:R,store:L})=>{let{src:T}=b;if(b.type==="svg"&&Object.keys(b.colorsReplace).length){const Q=await s.urlToString(T);T=s.replaceColors(Q,new Map(Object.entries(b.colorsReplace)))}let F="";b.flipX&&(F+="scaleX(-1)"),b.flipY&&(F+="scaleY(-1)"),F||(F="none");const I={};if(b.clipSrc){const Q=await s.urlToBase64(b.clipSrc);I["clip-path"]=`url(${Q})`}const O=await(0,u.loadImage)(T),C=O.width*b.cropWidth,A=O.height*b.cropHeight,j=b.width/b.height;let N,B;const W=C/A;b.type==="svg"?(N=C,B=A):j>=W?(N=C,B=C/j):(N=A*j,B=A);const Y=N/O.width,Z=B/O.height,V=N/B>b.width/b.height?b.height/B:b.width/N,H=N*V/Y,U=B*V/Z,D=b.cropX*V*O.width,$=b.cropY*V*O.height;return _("div",{style:Object.assign(Object.assign({},I),{width:"100%",height:"100%","border-radius":b.cornerRadius+"px",border:b.borderSize?`${b.borderSize}px solid ${b.borderColor}`:"none",backgroundRepeat:"no-repeat",background:`url(${T})`,transform:F,"background-size":`${Math.round(H)}px ${Math.round(U)}px`,"background-position-x":-Math.round(D)+"px","background-position-y":-Math.round($)+"px"})})},w=({element:b,type:R})=>{const L={"stroke-width":b.height,stroke:b.color,"line-cap":"round","stroke-linejoin":"round",opacity:b.opacity};return R==="arrow"||R==="triangle"?_("polyline",Object.assign({points:`${3*b.height},${2*-b.height} 0,0 ${3*b.height},${2*b.height}`},L)):R==="bar"?_("polyline",Object.assign({points:`0,${2*-b.height} 0,${2*b.height}`},L)):R==="circle"?_("circle",Object.assign({r:b.height},L)):R==="square"?_("polyline",Object.assign({points:`${-b.height},${-b.height} ${-b.height},${b.height} ${b.height},${b.height} ${b.height},${-b.height}`},L)):null},x={image:E,svg:E,text:async({element:b,page:R,store:L})=>{let T={top:0,left:0};b.fill.indexOf("gradient")>=0&&(T=Object.assign(Object.assign({},T),{"background-color":b.fill,"background-image":b.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}));const F=b.backgroundPadding*(b.fontSize*b.lineHeight),I=_("div",{style:{position:"absolute",top:-F/2+"px",left:-F/2+"px",display:b.backgroundEnabled?"block":"none",width:b.width+F+"px",height:b.height+F+"px","background-color":b.backgroundColor,"border-radius":b.backgroundCornerRadius*(b.fontSize*b.lineHeight*.5)+"px"}});b.verticalAlign==="middle"?(T.top="50%",T.transform="translateY(-50%)"):b.verticalAlign==="bottom"&&(T.bottom=0);const O=/<[a-z][\s\S]*>/i.test(b.text),C=Object.assign(Object.assign({},T),{position:"absolute",width:b.width+"px",color:b.fill,"white-space":"pre-wrap","font-size":b.fontSize+"px","text-align":b.align,"font-family":b.fontFamily,"text-decoration":b.textDecoration||"none","line-height":b.lineHeight,"letter-spacing":b.letterSpacing+"em","font-style":b.fontStyle,"font-weight":b.fontWeight,"-webkit-text-stroke":`${b.strokeWidth}px ${b.stroke}`,"text-stroke":`${b.strokeWidth}px ${b.stroke}`}),A="el-"+b.id,j=O?{id:A}:{},N=`<style>#${A} {${h.resetStyleContent}}</style>`,B=_("div",Object.assign(Object.assign({style:C},j),{innerHTML:O?`${N}${b.text}`:b.text.split(`
|
|
376
|
-
`).join("<br />")}));return _("div",{style:{position:"relative",width:"100%",height:"100%"}},I,B)},line:async({element:b,page:R,store:L})=>_("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},_("rect",{x:0,y:0,width:b.width,height:b.height,fill:b.color}),_("g",{transform:`translate(0 ${b.height/2})`},w({element:b,type:b.startHead})),_("g",{transform:`translate(${b.width} ${b.height/2}) rotate(180)`},w({element:b,type:b.endHead}))),figure:async({element:b,page:R,store:L,elementHook:T})=>{const F=(0,c.figureToSvg)(b),I=_("div",{innerHTML:F});return T&&T({dom:I,element:b})||I},group:async({element:b,page:R,store:L,elementHook:T})=>{const F=await Promise.all(b.children.map(O=>y({element:O,page:R,store:L,elementHook:T}))),I=_("div",{style:{"transform-origin":"top left",opacity:b.opacity}},...F);return T&&T({dom:I,element:b})||I},video:async({element:b,page:R,store:L,elementHook:T})=>{const{cropX:F,cropY:I,cropWidth:O,cropHeight:C}=b,A=await(0,v.getVideoSize)(b.src),j=A.width*O,N=A.height*C,B=b.width/b.height;let W,Y;B>=j/N?(W=j,Y=j/B):(W=N*B,Y=N);const Z=W/O,V=Y/C,H=F*A.width,U=I*A.height,D=Math.max(b.width/A.width,b.height/A.height),$={position:"absolute",width:`${Math.round(Z*D)}px`,height:`${Math.round(V*D)}px`,left:-Math.round(H*D)+"px",top:-Math.round(U*D)+"px","object-fit":"fill"},Q=`video-${b.id}`,ee=_("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden","border-radius":b.cornerRadius+"px",border:b.borderSize?`${b.borderSize}px solid ${b.borderColor}`:"none"}},_("video",{id:Q,src:b.src,style:$,controls:!0,playsInline:!0,muted:!0,volume:b.volume}));return T&&T({dom:ee,element:b})||ee},gif:E};async function y({element:b,page:R,store:L,elementHook:T}){let F=await x[b.type];if(F||(F=()=>_("div",{}),console.error(`HTML export does not support ${b.type} type...`)),!b.visible)return null;const I=await F({element:b,page:R,store:L}),O=[],C=[];if(b.blurEnabled&&O.push(`blur(${b.blurRadius/2}px)`),b.brightnessEnabled&&O.push(`brightness(${100*b.brightness+100}%)`),b.sepiaEnabled&&O.push("sepia()"),b.grayscaleEnabled&&O.push("grayscale()"),b.filters)for(const[j,N]of Object.entries(b.filters)){const B=(0,p.shapeFilterToCSS)(p.Effects[j],N.intensity);B&&(O.push(B.filter),B.html&&C.push(B.html))}b.shadowEnabled&&O.push(`drop-shadow(${b.shadowOffsetX}px ${b.shadowOffsetY}px ${b.shadowBlur}px ${b.shadowColor})`);const A=_("div",{id:b.id,style:{position:"absolute",left:b.x+"px",top:b.y+"px",width:b.width+"px",height:b.height+"px",transform:`rotate(${b.rotation}deg)`,"transform-origin":"top left",opacity:b.opacity,display:b.visible&&b.showInExport?"block":"none",filter:O.join(" ")||"none"}},I,...C);return T&&T({dom:A,element:b})||A}async function g({json:b,elementHook:R}){const L=await Promise.all(b.pages.map(I=>async function({page:O,store:C,elementHook:A}){const j=await Promise.all(O.children.map(Y=>y({element:Y,page:O,store:C,elementHook:A}))),N=O.width==="auto"?C.width:O.width,B=O.height==="auto"?C.height:O.height;let W={};if(O.background.indexOf("url")>=0||O.background.indexOf("http")>=0||O.background.indexOf(".jpg")>=0||O.background.indexOf(".png")>=0||O.background.indexOf(".jpeg")>=0){const{width:Y,height:Z}=await(0,u.loadImage)(O.background),V=await E({element:Object.assign({x:0,y:0,width:Y,height:Z,src:O.background,cornerRadius:0},(0,o.getCrop)({width:Y,height:Z},{width:Y,height:Z})),page:O,store:C});j.unshift(V)}else W=Object.assign(Object.assign({},W),{"background-color":O.background});return _("div",{className:"page",id:O.id,style:Object.assign(Object.assign({},W),{width:N+"px",height:B+"px",overflow:"hidden",position:"relative"})},...j)}({page:I,store:b,elementHook:R}))),T=[];b.pages.forEach(I=>{I.children.forEach(O=>{O.type==="text"&&T.indexOf(O.fontFamily)===-1&&T.push(O.fontFamily)})});const F=T.map(I=>b.fonts.find(O=>O.fontFamily===I)?_("style",{},""):_("link",{href:(0,f.getGoogleFontsUrl)(I),rel:"stylesheet"}));return _("div",{className:"design"},...F,...L)}const S=({dom:b})=>{if(typeof b=="string")return b;if(!b)return"";const R=b.props,{innerHTML:L}=R,T=i(R,["innerHTML"]);return`<${b.type} ${Object.keys(T).map(F=>((I,O)=>typeof O=="object"?`${I}="${Object.keys(O).map(C=>`${C}:${O[C]};`).join(" ")}"`:`${I}="${O}"`)(F,b.props[F])).join(" ")}>${L||b.children.map(F=>S({dom:F})).join("")}</${b.type}>`}}(ql)),ql}var zl={},x4;function JC(){return x4||(x4=1,function(e){var r,t=zl&&zl.__createBinding||(Object.create?function(g,S,b,R){R===void 0&&(R=b);var L=Object.getOwnPropertyDescriptor(S,b);L&&!("get"in L?!S.__esModule:L.writable||L.configurable)||(L={enumerable:!0,get:function(){return S[b]}}),Object.defineProperty(g,R,L)}:function(g,S,b,R){R===void 0&&(R=b),g[R]=S[b]}),n=zl&&zl.__setModuleDefault||(Object.create?function(g,S){Object.defineProperty(g,"default",{enumerable:!0,value:S})}:function(g,S){g.default=S}),a=zl&&zl.__importStar||(r=function(g){return r=Object.getOwnPropertyNames||function(S){var b=[];for(var R in S)Object.prototype.hasOwnProperty.call(S,R)&&(b[b.length]=R);return b},r(g)},function(g){if(g&&g.__esModule)return g;var S={};if(g!=null)for(var b=r(g),R=0;R<b.length;R++)b[R]!=="default"&&t(S,g,b[R]);return n(S,g),S}),i=zl&&zl.__rest||function(g,S){var b={};for(var R in g)Object.prototype.hasOwnProperty.call(g,R)&&S.indexOf(R)<0&&(b[R]=g[R]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function"){var L=0;for(R=Object.getOwnPropertySymbols(g);L<R.length;L++)S.indexOf(R[L])<0&&Object.prototype.propertyIsEnumerable.call(g,R[L])&&(b[R[L]]=g[R[L]])}return b};Object.defineProperty(e,"__esModule",{value:!0}),e.forEveryChild=void 0,e.fixRatio=function(g){var S=new DOMParser().parseFromString(g,"image/svg+xml");return S.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(S)},e.jsonToDOM=x,e.jsonToSVG=async function({json:g,elementHook:S}){const b=await x({json:g,elementHook:S});return y({dom:b})};const o=D1(),s=a(kp()),u=D1(),c=Nm(),h=c_();e.forEveryChild=(g,S)=>{if(g.children)for(const b of g.children){if(S(b)===!0)break;(0,e.forEveryChild)(b,S)}};const p=(g,S,...b)=>({type:g,props:S,children:b||[]}),v=async({element:g,page:S,store:b})=>{let{src:R}=g;if(g.type==="svg"){const $=await s.urlToString(R);R=s.replaceColors($,new Map(Object.entries(g.colorsReplace)))}else R=await(async $=>{try{const Q=await fetch($);if(typeof Buffer<"u"){const ee=await Q.arrayBuffer(),te=Buffer.from(ee).toString("base64");return`data:${Q.headers.get("content-type")||"image/png"};base64,${te}`}{const ee=await Q.blob();return new Promise((te,ae)=>{const se=new FileReader;se.onloadend=()=>te(se.result),se.onerror=ae,se.readAsDataURL(ee)})}}catch(Q){return console.error("Error converting URL to data URL:",Q),$}})(R);let L="";g.flipX&&(L+="scaleX(-1)"),g.flipY&&(L+="scaleY(-1)"),g.clipSrc&&await s.urlToBase64(g.clipSrc);const T=await(0,u.loadImage)(R),F=T.width*g.cropWidth,I=T.height*g.cropHeight,O=g.width/g.height;let C,A;const j=F/I;g.type==="svg"?(C=F,A=I):O>=j?(C=F,A=F/O):(C=I*O,A=I);const N=C/T.width,B=A/T.height,W=C/A>g.width/g.height?g.height/A:g.width/C,Y=C*W/N,Z=A*W/B,V=g.cropX*T.width*W,H=g.cropY*T.height*W,U=`clip-${g.id}`,D=R.replace(/&/g,"&");return p("g",{style:{transform:L}},p("defs",{},p("clipPath",{id:U},p("rect",{x:0,y:0,width:g.width,height:g.height}))),p("image",{href:D,x:-V,y:-H,width:Y,height:Z,preserveAspectRatio:"none","clip-path":`url(#${U})`}))},f=({element:g,type:S})=>{const b={"stroke-width":g.height,stroke:g.color,"line-cap":"round","stroke-linejoin":"round",opacity:g.opacity};return S==="arrow"||S==="triangle"?p("polyline",Object.assign({points:`${3*g.height},${2*-g.height} 0,0 ${3*g.height},${2*g.height}`},b)):S==="bar"?p("polyline",Object.assign({points:`0,${2*-g.height} 0,${2*g.height}`},b)):S==="circle"?p("circle",Object.assign({r:g.height},b)):S==="square"?p("polyline",Object.assign({points:`${-g.height},${-g.height} ${-g.height},${g.height} ${g.height},${g.height} ${g.height},${-g.height}`},b)):null},_={image:v,svg:v,text:async({element:g,page:S,store:b})=>{const R=(O,C,A,j,N)=>{const B=document.createElement("canvas").getContext("2d");return B.font=`${N} ${j} ${C}px ${A}`,B.measureText(O).width},L=((O,C,A,j,N,B)=>{const W=[];return O.split(`
|
|
377
|
-
`).forEach(Y=>{const Z=Y.split(" ");let V="";for(let H=0;H<Z.length;H++){const U=V+Z[H]+" ";R(U,A,j,N,B)>C+.5&&H>0?(W.push(V.trim()),V=Z[H]+" "):V=U}W.push(V.trim())}),W})(g.text,g.width,g.fontSize,g.fontFamily,g.fontWeight,g.fontStyle),T=g.fontSize*g.lineHeight,F=g.align==="center"?"middle":g.align==="right"?"end":"start",I=L.map((O,C)=>p("tspan",{x:g.align==="center"?g.width/2:g.align==="right"?g.width:0,dy:C===0?0:T,innerHTML:O}));return p("g",{},p("text",{fill:g.fill,y:g.fontSize,"font-size":g.fontSize+"px","text-anchor":F,"font-family":g.fontFamily,"font-style":g.fontStyle,"font-weight":g.fontWeight,"text-decoration":g.textDecoration,"line-height":g.lineHeight,"letter-spacing":g.letterSpacing+"em","stroke-width":g.strokeWidth,stroke:g.stroke},...I))},line:async({element:g,page:S,store:b})=>p("g",{},p("line",{x1:0,y1:g.height/2,x2:g.width,y2:g.height/2,stroke:g.color,"stroke-width":g.height}),p("g",{transform:`translate(0 ${g.height/2})`},f({element:g,type:g.startHead})),p("g",{transform:`translate(${g.width} ${g.height/2}) rotate(180)`},f({element:g,type:g.endHead}))),figure:async({element:g,page:S,store:b,elementHook:R})=>{const L=function(F){let I=F.replace(/<svg[^>]*>/,"");return I=I.replace(/<\/svg>/,""),I}((0,c.figureToSvg)(g)),T=p("g",{innerHTML:L});return R&&R({dom:T,element:g})||T},group:async({element:g,page:S,store:b,elementHook:R})=>{const L=await Promise.all(g.children.map(F=>E({element:F,page:S,store:b,elementHook:R}))),T=p("g",{opacity:g.opacity,style:{"transform-origin":"top left"}},...L);return R&&R({dom:T,element:g})||T},gif:v};async function E({element:g,page:S,store:b,elementHook:R}){let L=await _[g.type];L||(L=()=>p("g",{}),console.error(`SVG export does not support ${g.type} type...`));const T=await L({element:g,page:S,store:b}),F=[],I=[];if(g.blurEnabled&&F.push(`blur(${g.blurRadius/2}px)`),g.brightnessEnabled&&F.push(`brightness(${100*g.brightness+100}%)`),g.sepiaEnabled&&F.push("sepia()"),g.grayscaleEnabled&&F.push("grayscale()"),g.shadowEnabled&&F.push(`drop-shadow(${g.shadowOffsetX}px ${g.shadowOffsetY}px ${g.shadowBlur}px ${g.shadowColor})`),g.filters)for(const[C,A]of Object.entries(g.filters)){const j=(0,h.shapeFilterToCSS)(h.Effects[C],A.intensity);if(j&&(F.push(j.filter),j.html)){const N=j.html.replace(/<svg([^>]*)>/,"<g$1>").replace(/<\/svg>/,"</g>");I.push(N)}}const O=p("g",{className:"element",id:g.id,transform:g.type!=="group"?`translate(${g.x}, ${g.y}) rotate(${g.rotation})`:void 0,display:g.visible?void 0:"none",style:{"transform-origin":"top left",filter:F.join(" ")}},T,...I);return R&&R({dom:O,element:g})||O}async function w(g){try{const S=await fetch(g),b=await S.blob();return new Promise((R,L)=>{const T=new FileReader;T.onloadend=()=>R(T.result),T.onerror=L,T.readAsDataURL(b)})}catch(S){return console.error("Error embedding font:",S),g}}async function x({json:g,elementHook:S}){const b=await Promise.all(g.pages.map(T=>async function({page:F,store:I,elementHook:O}){const C=await Promise.all(F.children.map(N=>E({element:N,page:F,store:I,elementHook:O}))),A=F.background.indexOf("url")>=0||F.background.indexOf("http")>=0||F.background.indexOf(".jpg")>=0||F.background.indexOf(".png")>=0||F.background.indexOf(".jpeg")>=0;let j;if(A){const N=await(0,u.loadImage)(F.background);j=await(0,u.cropImage)(F.background,Object.assign({width:I.width,height:I.height,x:0,y:0},(0,o.getCrop)({width:I.width,height:I.height},{width:N.width,height:N.height})))}return p("g",{className:"page",style:{}},A?p("image",{"xlink:href":j,x:0,y:0,width:I.width,height:I.height,preserveAspectRatio:"none"}):p("rect",{x:0,y:0,width:I.width,height:I.height,fill:A?void 0:F.background}),...C)}({page:T,store:g,elementHook:S}))),R=[];(0,e.forEveryChild)({children:g.pages},T=>{T.type==="text"&&R.indexOf(T.fontFamily)===-1&&R.push(T.fontFamily)});const L=await async function(T,F){return await Promise.all(T.map(async I=>{var O,C;const A=F.find(j=>j.fontFamily===I);if(A){const j=await w(A.url);return p("style",{},`@font-face { font-family: ${I}; src: url(${j}); }`)}{const j=`https://fonts.googleapis.com/css?family=${I}:bi,normal,i,b`;try{const N=await fetch(j),B=await N.text(),W=(C=(O=B.match(/url\((.*?)\)/g))===null||O===void 0?void 0:O.map(Z=>Z.replace(/url\((.*?)\)/,"$1")))===null||C===void 0?void 0:C.filter(Z=>Z.startsWith("https"));if(!(W!=null&&W.length))throw new Error("No font URLs found");const Y=await Promise.all(W.map(async Z=>{const V=await w(Z),H=B.match(/font-style:\s*(.*?);/),U=B.match(/font-weight:\s*(.*?);/),D=H?H[1]:"normal",$=U?U[1]:"normal";return`@font-face {
|
|
378
|
-
font-family: ${I};
|
|
379
|
-
font-style: ${D};
|
|
380
|
-
font-weight: ${$};
|
|
381
|
-
src: url(${V});
|
|
382
|
-
}`}));return p("style",{},Y.join(`
|
|
383
|
-
`))}catch(N){return console.error("Error embedding Google Font:",N),p("defs",{},p("style",{type:"text/css",innerHTML:`@import url('${j}');`.replace(/&/g,"&")}))}}}))}(R,g.fonts);return p("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${g.width} ${g.height}`,width:g.width,height:g.height},...L,...b)}const y=({dom:g,nestLevel:S=0})=>{if(typeof g=="string")return g;if(!g)return"";const b=g.props,{innerHTML:R}=b,L=i(b,["innerHTML"]),T=" ".repeat(S);return`${T}<${g.type} ${Object.keys(L).map(F=>((I,O)=>typeof O=="object"?`${I}="${Object.keys(O).map(C=>`${C}:${O[C]};`).join(" ")}"`:O==null||O===""?"":`${I}="${O}"`)(F,L[F])).join(" ")}>${R||`
|
|
384
|
-
`+g.children.map(F=>y({dom:F,nestLevel:S+1})).join("")}${T}</${g.type}>
|
|
385
|
-
`}}(zl)),zl}var zv={},E4;function f_(){return E4||(E4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;const r=hl,t=u0,n=Nh(),a=Mm(),i=Nh(),o=Dh();e.Page=r.types.model("Page",{id:r.types.identifier,children:r.types.array(r.types.late(()=>n.ElementTypes)),width:r.types.optional(r.types.union(r.types.number,r.types.literal("auto")),"auto"),height:r.types.optional(r.types.union(r.types.number,r.types.literal("auto")),"auto"),background:"white",bleed:0,custom:r.types.frozen(),duration:5e3,_exporting:!1,_rendering:!1,_forceMount:!1}).postProcessSnapshot(s=>{const u=Object.assign({},s),c={};for(var h in u)h[0]!=="_"&&(c[h]=s[h]);return c}).views(s=>({get store(){return(0,r.getParentOfType)(s,a.Store)}})).views(s=>({get startTime(){let u=0;for(const c of s.store.pages){if(c.id===s.id)return u;u+=c.duration}return u},get _exportingOrRendering(){return s._exporting||s._rendering}})).views(s=>({get computedWidth(){return s.width==="auto"?s.store.width:s.width},get computedHeight(){return s.height==="auto"?s.store.height:s.height}})).actions(s=>({toJSON:()=>JSON.parse(JSON.stringify((0,r.getSnapshot)(s))),_forEachElementUp(u,c){const h=u.map(p=>({id:p,index:s.children.findIndex(v=>v.id===p)}));h.sort((p,v)=>v.index-p.index);for(const{index:p}of h){if(p==-1)continue;const v=p<s.children.length-1&&s.children[p+1],f=u.indexOf(v==null?void 0:v.id)>=0;p===s.children.length-1||f||c(p)}},_forEachElementDown(u,c){const h=u.map(p=>({id:p,index:s.children.findIndex(v=>v.id===p)}));h.sort((p,v)=>p.index-v.index);for(const{index:p}of h){if(p==-1)continue;const v=p>0&&s.children[p-1],f=u.indexOf(v==null?void 0:v.id)>=0;p===0||f||c(p)}return!1}})).actions(s=>({clone(u={}){const c=s.toJSON();c.children.forEach(f=>{f.id=(0,t.nanoid)(10),(0,i.forEveryChild)(f,_=>{_.id=(0,t.nanoid)(10)})});const h=Object.assign(Object.assign(Object.assign({},c),{id:(0,t.nanoid)(10)}),u),p=s.store.addPage(h),v=s.store.pages.indexOf(s);return p.setZIndex(v+1),p.select(),p},setZIndex(u){s.store.setPageZIndex(s.id,u)},set(u){Object.assign(s,u)},select(){s.store.selectPage(s.id)},addElement(u,{skipSelect:c=!1}={}){const h=i.TYPES_MAP[u.type];if(!h)return void console.error("Can not find model with type "+u.type);"children"in u&&Array.isArray(u.children)&&(0,i.forEveryChild)(u,v=>{v.id=v.id||(0,t.nanoid)(10)});const p=h.create(Object.assign({id:(0,t.nanoid)(10)},u));return s.children.push(p),p.selectable&&!c&&s.store.selectElements([p.id]),p},canMoveElementsUp(u){let c=!1;return s._forEachElementUp(u,()=>{c=c||!0}),c},moveElementsUp(u){s._forEachElementUp(u,c=>{const h=s.children[c];(0,r.detach)(h),s.children.splice(c+1,0,h)})},canMoveElementsTop(u){return this.canMoveElementsUp(u)},moveElementsTop(u){const c=[],h=[];s.children.forEach(p=>{u.indexOf(p.id)>=0?c.push(p):h.push(p)}),s.children.replace(h.concat(c))},canMoveElementsDown(u){let c=!1;return s._forEachElementDown(u,()=>{c=c||!0}),c},moveElementsDown(u){s._forEachElementDown(u,c=>{const h=s.children[c];(0,r.detach)(h),s.children.splice(c-1,0,h)})},canMoveElementsBottom(u){return this.canMoveElementsDown(u)},moveElementsBottom(u){const c=[],h=[];s.children.forEach(p=>{u.indexOf(p.id)>=0?c.push(p):h.push(p)}),s.children.replace(c.concat(h))},setElementZIndex(u,c){const h=s.children.find(p=>p.id===u);h&&((0,r.detach)(h),s.children.remove(h),s.children.splice(c,0,h))},setSize({width:u,height:c,useMagic:h,softChange:p}){if(h){const v=[],f=A=>A.type==="image"&&A.x<1&&A.y<1&&A.width>=s.computedWidth-2&&A.height>=s.computedHeight-2;(0,i.forEveryChild)(s,A=>{A.type!=="group"&&(f(A)||v.push(A))});const _=v.length?(0,o.getTotalClientRect)(v):{x:0,y:0,width:s.computedWidth,height:s.computedHeight},E=1/4,w=Math.max(0,Math.min(_.x,s.computedWidth-_.x-_.width)),x=s.computedWidth*E,y=Math.max(0,w-x),g=Math.max(0,Math.min(_.y,s.computedHeight-_.y-_.height)),S=s.computedHeight*E,b=Math.max(0,g-S),R=s.computedWidth-2*y,L=s.computedHeight-2*b,T=u/R,F=c/L,I=Math.min(T,F),O=(u-R*I)/2-y*I,C=(c-L*I)/2-b*I;(0,i.forEveryChild)(s,A=>{A.type!=="group"&&(f(A)?A.set({x:A.x*I,y:A.y*I,width:A.width*T,height:A.height*F,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(A.set({x:O+A.x*I,y:C+A.y*I,width:A.width*I,height:A.height*I}),A.type==="text"?A.set({fontSize:A.fontSize*I}):A.type==="figure"&&A.set({strokeWidth:A.strokeWidth*I})))})}p||(s.width=u),p||(s.height=c)}})).actions(s=>({moveElementUp(u){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),s.moveElementsUp([u])},moveElementDown(u){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),s.moveElementsDown([u])},moveElementTop(u){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),s.moveElementsTop([u])},moveElementBottom(u){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),s.moveElementsBottom([u])},play(){s.store.play({startTime:s.startTime,endTime:s.startTime+s.duration})}}))}(zv)),zv}var Uv={},P4;function ek(){return P4||(P4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Audio=void 0;const r=hl;e.Audio=r.types.model("Audio",{id:r.types.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0}).actions(t=>({toJSON:()=>Object.assign({},(0,r.getSnapshot)(t))})).actions(t=>({set(n){Object.assign(t,n)}}))}(Uv)),Uv}var O4;function Mm(){return O4||(O4=1,function(e){var r,t=Is&&Is.__createBinding||(Object.create?function(C,A,j,N){N===void 0&&(N=j);var B=Object.getOwnPropertyDescriptor(A,j);B&&!("get"in B?!A.__esModule:B.writable||B.configurable)||(B={enumerable:!0,get:function(){return A[j]}}),Object.defineProperty(C,N,B)}:function(C,A,j,N){N===void 0&&(N=j),C[N]=A[j]}),n=Is&&Is.__setModuleDefault||(Object.create?function(C,A){Object.defineProperty(C,"default",{enumerable:!0,value:A})}:function(C,A){C.default=A}),a=Is&&Is.__importStar||(r=function(C){return r=Object.getOwnPropertyNames||function(A){var j=[];for(var N in A)Object.prototype.hasOwnProperty.call(A,N)&&(j[j.length]=N);return j},r(C)},function(C){if(C&&C.__esModule)return C;var A={};if(C!=null)for(var j=r(C),N=0;N<j.length;N++)j[N]!=="default"&&t(A,C,j[N]);return n(A,C),A}),i=Is&&Is.__rest||function(C,A){var j={};for(var N in C)Object.prototype.hasOwnProperty.call(C,N)&&A.indexOf(N)<0&&(j[N]=C[N]);if(C!=null&&typeof Object.getOwnPropertySymbols=="function"){var B=0;for(N=Object.getOwnPropertySymbols(C);B<N.length;B++)A.indexOf(N[B])<0&&Object.prototype.propertyIsEnumerable.call(C,N[B])&&(j[N[B]]=C[N[B]])}return j},o=Is&&Is.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(e,"__esModule",{value:!0}),e.Store=e.Font=void 0,e.createStore=O;const s=hl,u=VC(),c=u0,h=o(Hs()),p=vs,v=WC(),f=$C(),_=YC(),E=Tm(),w=a(Ih()),x=gc(),y=jf(),g=Rm(),S=u_(),b=KC(),R=QC(),L=JC(),T=f_(),F=Nh(),I=ek();function O({key:C,showCredit:A}={key:"",showCredit:!1}){return e.Store.create({_forceShowCredit:A,_key:C})}(0,s.setLivelinessChecking)("ignore"),e.Font=s.types.model("Font",{fontFamily:s.types.string,url:s.types.optional(s.types.string,""),styles:s.types.frozen()}).preProcessSnapshot(C=>Object.assign(Object.assign({},C),{fontFamily:C.fontFamily||C.name})),e.Store=s.types.model("Store",{role:"",pages:s.types.array(T.Page),fonts:s.types.array(e.Font),audios:s.types.array(I.Audio),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,schemaVersion:2,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:s.types.frozen(),selectedElementsIds:s.types.array(s.types.string),animatedElementsIds:s.types.array(s.types.string),history:s.types.optional(u.UndoManager,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,window.devicePixelRatio||1),_activePageId:"",_forceShowCredit:!1,_key:"",_validated:!1}).views(C=>{const A=(0,p.computed)(()=>{const j={};return(0,F.forEveryChild)({children:C.pages},N=>(j[N.id]=N,!1)),j},{keepAlive:!0});return{get _idsMap(){return A.get()}}}).views(C=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),C.bleedVisible},get selectedElements(){return C.selectedElementsIds.map(A=>{for(const j of C.pages)for(const N of j.children)if(N.id===A)return N}).filter(A=>!!A)},get children(){return C.pages},get selectedShapes(){const A=[];return(0,F.forEveryChild)({children:C.selectedElements},j=>{j.type!=="group"&&A.push(j)}),A},get activePage(){return C.pages.slice().find(A=>A.id===C._activePageId)||(C.pages.length?C.pages[0]:null)},get duration(){let A=0;return C.pages.forEach(j=>{A+=j.duration}),A},get _hasCroppedImages(){return C.find(A=>A.type==="image"&&A._cropModeEnabled)},find(A){let j;return(0,F.forEveryChild)({children:C.pages},N=>{if(!j&&A(N))return j=N,!0}),j},getElementById:A=>C._idsMap[A]})).actions(C=>{let A=0,j=null,N=!1;return{afterCreate(){C.history.canUndo},setCurrentTime(B){C.currentTime=B},_togglePlaying(B=!C.isPlaying){C.isPlaying=B},play({animatedElementsIds:B=[],startTime:W=0,currentTime:Y=0,endTime:Z=C.duration,repeat:V=!1}={}){Y&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),W=Y),C.animatedElementsIds=(0,s.cast)(B),C.currentTime=W,C.isPlaying=!0,A=Date.now(),j=Z,N=V,requestAnimationFrame(C.seek)},checkActivePage(){let B=0;for(const W of C.pages){if(C.currentTime>=W.startTime&&C.currentTime<W.startTime+W.duration){C.selectPage(W.id);break}B+=W.duration}},seek(){if(!C.isPlaying)return;const B=Date.now(),W=B-A;A=B,C.currentTime+=W,C.checkActivePage();const Y=j||C.duration;C.isPlaying&&C.currentTime<Y?requestAnimationFrame(C.seek):C.isPlaying&&N?(C.currentTime=0,requestAnimationFrame(C.seek)):C.stop()},stop(){C.isPlaying=!1,C.currentTime=0,C.animatedElementsIds=(0,s.cast)([]),C.checkActivePage()}}}).actions(C=>({__(){C._validated||((0,E.validateKey)(C._key,C._forceShowCredit),C._validated=!0)},set(A){Object.assign(C,A)},setUnit({unit:A,dpi:j}){C.unit=A||C.unit,C.dpi=j||C.dpi},setRole(A){C.role=A},addPage(A){const j=T.Page.create(Object.assign({id:(0,c.nanoid)(10)},A));return C.pages.push(j),C._activePageId=j.id,j},selectPage(A){C._activePageId=A},selectElements(A){const j=A.map(N=>C.getElementById(N)).sort((N,B)=>N.page.children.indexOf(N)-N.page.children.indexOf(B)).filter(N=>!!N).map(N=>N.id);C.selectedElementsIds=(0,s.cast)(j)},toggleBleed(A){C.bleedVisible=A??!C.bleedVisible},toggleRulers(A){C.rulesVisible=A??!C.rulesVisible},openSidePanel(A){C.openedSidePanel!==A&&(C.previousOpenedSidePanel=C.openedSidePanel,C.openedSidePanel=A)},setScale(A){C.scale=A},_setScaleToFit(A){C.scaleToFit=A},setElementsPixelRatio(A){C._elementsPixelRatio=A},setSize(A,j,N){C.pages.forEach(B=>{B.setSize({width:A,height:j,useMagic:N,softChange:!0})}),C.width=A,C.height=j},setPageZIndex(A,j){const N=C.pages.find(B=>B.id===A);N&&((0,s.detach)(N),C.pages.remove(N),C.pages.splice(j,0,N))},deletePages(A){const j=C.pages.indexOf(C.activePage);A.forEach(W=>{const Y=C.pages.find(Z=>Z.id===W);(0,s.destroy)(Y)});const N=Math.min(C.pages.length-1,j),B=C.pages[N];B&&(C._activePageId=B.id),C.selectedElementsIds=(0,s.cast)(C.selectedElementsIds.filter(W=>C.getElementById(W)))},groupElements(A,j={}){const N=A.map(Y=>C.getElementById(Y)),B=N[0].page;if(N.forEach(Y=>{Y&&(0,s.detach)(Y)}),!N.length)return;const W=Object.assign({id:(0,c.nanoid)(10),children:N,type:"group"},j);return B.children.push(W),C.selectedElementsIds=(0,s.cast)([W.id]),B.children.find(Y=>Y.id===W.id)},ungroupElements(A){const j=A.map(B=>C.getElementById(B)),N=[];j.forEach(B=>{if(B&&B.type==="group"){const W=B.page,Y=W.children.indexOf(B);B.children.forEach(Z=>{N.push(Z.id)}),B.children.forEach(Z=>{(0,s.detach)(Z),W.children.push(Z)}),W.children.splice(Y,1)}}),C.selectedElementsIds=(0,s.cast)(N)},deleteElements(A){const j=[];C.find(N=>(A.includes(N.id)&&j.push(N),!1)),j.forEach(N=>{(0,s.destroy)(N)}),C.selectedElementsIds=(0,s.cast)(C.selectedElementsIds.filter(N=>C.getElementById(N)))},on(A,j){if(A==="change"){let N=C.toJSON();return(0,s.onSnapshot)(C,B=>{const W=C.toJSON();!(0,S.deepEqual)(N,W)&&(N=W,j(W))})}},async _toCanvas({pixelRatio:A,ignoreBackground:j,pageId:N,mimeType:B,includeBleed:W,_skipTimeout:Y,quickMode:Z=!1}={}){var V;const H=A||1;N=N||((V=C.pages[0])===null||V===void 0?void 0:V.id);const U=C.pages.find(be=>be.id===N);if(!U)throw new Error(`No page for export with id ${N}`);const D=C._elementsPixelRatio;H>C._elementsPixelRatio&&C.setElementsPixelRatio(H),Z?U==null||U.set({_forceMount:!0}):U==null||U.set({_exporting:!0});const $=await(0,b.waitTillAvailable)(()=>h.default.stages.find(be=>be.getAttr("pageId")===N));if(!$)throw U==null||U.set({_forceMount:!1,_exporting:!1}),C.setElementsPixelRatio(D),new Error(`Export is failed. Can not find stage for page ${N}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);await C.waitLoading({_skipTimeout:Y});const Q=$.findOne(".page-container");if(!Q)throw C.setElementsPixelRatio(D),U==null||U.set({_forceMount:!1,_exporting:!1}),new Error("Export is failed. Canvas was unmounted.");const ee=$.position();$.position({x:0,y:0}),$.find("Transformer").forEach(be=>{be.setAttr("oldVisible",be.visible()),be.visible(!1)}),Q.find(".page-background").forEach(be=>be.shadowEnabled(!1)),Q.find(".page-background").forEach(be=>be.strokeEnabled(!1)),Q.find(".highlighter").forEach(be=>be.visible(!1));const te=Q.findOne(".page-background-group"),ae=te.clip();te.clip({x:null,y:null,width:null,height:null});const se=Q.findOne(".elements-container"),ce=se.clip();se.clip({x:null,y:null,width:null,height:null});const me=Q.find(be=>be.getAttr("hideInExport"));me.forEach(be=>{be.setAttr("oldVisible",be.visible()),be.hide()});const _e=Q.find(be=>!be.visible()&&be.getAttr("editModeEnabled"));_e.forEach(be=>{be.setAttr("oldVisible",be.visible()),be.show()}),j&&Q.find(".page-background").forEach(be=>be.hide());const Le=W?U.bleed:0;let Re=Le;!C.bleedVisible&&W||(C.bleedVisible||W?C.bleedVisible&&W?Re=0:C.bleedVisible&&!W&&(Re=-U.bleed):Re=0);const Pe=document.createElement("canvas");Pe.width=Math.round((U.computedWidth+2*Le)*H),Pe.height=Math.round((U.computedHeight+2*Le)*H);const ve=Pe.getContext("2d");B==="image/jpeg"&&(ve.fillStyle="white",ve.fillRect(0,0,Pe.width,Pe.height));const it=Q.scale();Q.scale({x:1,y:1});const Se=Q.toCanvas({x:Q.x()-Re,y:Q.y()-Re,width:U.computedWidth+2*Le,height:U.computedHeight+2*Le,pixelRatio:H});return Q.scale(it),ve.drawImage(Se,0,0,Pe.width,Pe.height),h.default.Util.releaseCanvas(Se),j&&Q.find(".page-background").forEach(be=>be.show()),me.forEach(be=>{be.visible(be.getAttr("oldVisible"))}),_e.forEach(be=>{be.visible(be.getAttr("oldVisible"))}),Q.find(".page-background").forEach(be=>be.shadowEnabled(!0)),Q.find(".page-background").forEach(be=>be.strokeEnabled(!0)),$.find("Transformer").forEach(be=>{be.visible(be.getAttr("oldVisible"))}),Q.find(".highlighter").forEach(be=>be.visible(!0)),te.clip(ae),se.clip(ce),$.position(ee),U==null||U.set({_exporting:!1,_forceMount:!1}),await new Promise(be=>setTimeout(be)),C.setElementsPixelRatio(D),Pe},async toDataURL(A={}){var{mimeType:j,quality:N}=A,B=i(A,["mimeType","quality"]);const W=await C._toCanvas(Object.assign({mimeType:j},B)),Y=W.toDataURL(j,N);return h.default.Util.releaseCanvas(W),Y},async toBlob(A={}){var{mimeType:j,quality:N}=A,B=i(A,["mimeType","quality"]);const W=await C._toCanvas(Object.assign({mimeType:j},B)),Y=await new Promise(Z=>{W.toBlob(Z,j,N)});return h.default.Util.releaseCanvas(W),Y},async saveAsImage(A={}){var{fileName:j}=A,N=i(A,["fileName"]);const B=N.mimeType||"image/png",W=B.split("/")[1];(0,v.downloadFile)(await C.toDataURL(N),j||"polotno."+W,B)},async _toPDF(A){const j=A.dpi||C.dpi,N=A.parallel||1,B=A.unit||(C.unit==="px"?"mm":C.unit),W=A.pixelRatio||1,Y=A.pageIds||C.pages.map(me=>me.id),Z=C.pages.filter(me=>Y.includes(me.id)),V=await(0,f.getJsPDF)(),H=me=>(0,g.pxToUnit)({px:me,unit:B,dpi:j}),U=A.cropMarkSize||0,D=H(U),$=Z[0]||{},Q=A.includeBleed?$.bleed:0,ee=H($.computedWidth+2*Q+2*D),te=H($.computedHeight+2*Q+2*D);var ae=new V({unit:B,orientation:ee>te?"landscape":"portrait",format:[ee,te],compress:!0,putOnlyUsedFonts:!0});ae.deletePage(1);const se=((me,_e)=>{for(var Le=[],Re=0;Re<me.length;Re+=_e)Le.push(me.slice(Re,Re+_e));return Le})(Z,N);let ce=0;for(const me of se){const _e=me.map(async Le=>{const Re=A.includeBleed?Le.bleed:0,Pe=Le.computedWidth+2*Re+2*U,ve=Le.computedHeight+2*Re+2*U,it=H(Pe),Se=H(ve);let be=0,Ae=W;for(;be<10;){be+=1,be===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const Te=await C.toDataURL(Object.assign(Object.assign({},A),{pageId:Le.id,pixelRatio:Ae}));if(Te.length>20)return A.onProgress&&A.onProgress(++ce/Y.length*.9),{url:Te,width:it,height:Se,widthPx:Pe,heightPx:ve};Ae*=.8}});(await Promise.all(_e)).forEach(({url:Le,width:Re,height:Pe,widthPx:ve,heightPx:it})=>{ae.addPage([Re,Pe],Re>Pe?"landscape":"portrait");const Se=ae.getCurrentPageInfo();var be;switch(B){case"pt":be=1;break;case"mm":be=72/25.4;break;case"cm":be=72/2.54;break;case"in":be=72;break;case"px":be=.75;break;case"pc":case"em":be=12;break;case"ex":be=6;break;default:throw"Invalid unit: "+B}if(Se.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:Re*be,topRightY:Pe*be},Se.pageContext.artBox={bottomLeftX:H(U+Q)*be,bottomLeftY:H(U+Q)*be,topRightX:H(ve-U-Q)*be,topRightY:H(it-U-Q)*be},Se.pageContext.bleedBox={bottomLeftX:H(U+Q)*be,bottomLeftY:H(U+Q)*be,topRightX:H(ve-U-Q)*be,topRightY:H(it-U-Q)*be},D){ae.setLineWidth(H(1));const Ae=D+H(Q);ae.line(Ae,0,Ae,D),ae.line(0,Ae,D,Ae),ae.line(Re-Ae,0,Re-Ae,D),ae.line(Re,Ae,Re-D,Ae),ae.line(0,Pe-Ae,D,Pe-Ae),ae.line(Ae,Pe,Ae,Pe-D),ae.line(Re,Pe-Ae,Re-D,Pe-Ae),ae.line(Re-Ae,Pe,Re-Ae,Pe-D)}ae.addImage(Le,D,D,Re-2*D,Pe-2*D,void 0,"FAST")})}return ae},toPDFDataURL:async A=>(await C._toPDF(Object.assign({mimeType:"image/jpeg"},A))).output("datauristring"),async toGIFDataURL(A={}){const j=A.pixelRatio||1,N=await(0,_.createGIF)({width:C.width*j,height:C.height*j}),B=1e3/(A.fps||10),W=C.duration/B;for(let Y=0;Y<W-1;Y++){const Z=Y*B||1;C.setCurrentTime(Z);let V=0,H="";for(const D of C.pages)if(V+=D.duration,D.set({_rendering:V>Z}),V>Z){H=D.id;break}const U=await C._toCanvas({pixelRatio:j,pageId:H,_skipTimeout:!0});N.addFrame(U.getContext("2d"),{delay:B,copy:!0})}for(const Y of C.pages)Y.set({_rendering:!1});return C.stop(),N.render(),new Promise(Y=>{N.on("finished",function(Z){(function(V,H){var U=new FileReader;U.onload=function(D){H(D.target.result)},U.readAsDataURL(V)})(Z,Y)})})},async saveAsGIF(A={}){var{fileName:j}=A,N=i(A,["fileName"]);const B=await C.toGIFDataURL(N);(0,v.downloadFile)(B,j||"polotno.gif")},async toHTML({elementHook:A}={elementHook:void 0}){const j=C.toJSON();return(0,R.jsonToHTML)({json:j,elementHook:A})},async saveAsHTML({fileName:A}={}){const j=await C.toHTML(),N="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(j)));(0,v.downloadFile)(N,A||"polotno.html")},async toSVG({elementHook:A,pageId:j}={elementHook:void 0,pageId:void 0}){var N;const B=C.toJSON();j=j||((N=B.pages[0])===null||N===void 0?void 0:N.id);const W=B.pages.find(Y=>Y.id===j);return(0,L.jsonToSVG)({json:Object.assign(Object.assign({},B),{pages:W?[W]:[]}),elementHook:A})},async saveAsSVG({fileName:A,elementHook:j,pageId:N}={}){const B=await C.toSVG({elementHook:j,pageId:N}),W="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(B)));(0,v.downloadFile)(W,A||"polotno.svg")},async saveAsPDF(A={}){var{fileName:j}=A,N=i(A,["fileName"]);(await C._toPDF(Object.assign({mimeType:"image/jpeg"},N))).save(j||"polotno.pdf")},async waitLoading({_skipTimeout:A=!1}={}){A||await new Promise(j=>setTimeout(j,50)),await(0,y.whenLoaded)()},toJSON:()=>({width:C.width,height:C.height,fonts:(0,s.getSnapshot)(C.fonts),pages:(0,s.getSnapshot)(C.pages),audios:(0,s.getSnapshot)(C.audios),unit:C.unit,dpi:C.dpi,custom:C.custom,schemaVersion:C.schemaVersion}),loadJSON(A,j=!1){var N;const B=JSON.parse(JSON.stringify(A)),W=B.schemaVersion||0;W<1&&x.flags.htmlRenderEnabled&&(0,F.forEveryChild)({children:B.pages},H=>{if(H.type==="text"){const D=H.letterSpacing*16;H.letterSpacing=D/H.fontSize}}),W<2&&(0,F.forEveryChild)({children:B.pages},H=>{H.filters&&Object.keys(H.filters).forEach(U=>{if(["warm","cold","natural"].includes(U))return;const D=H.filters[U];D&&typeof D.intensity=="number"&&(D.intensity=D.intensity/100)})}),delete B.schemaVersion;const Y=C.pages.indexOf(C.activePage);let Z=(N=B.pages[Y]||B.pages[0])===null||N===void 0?void 0:N.id;B._activePageId=Z;const V=Object.assign({},(0,s.getSnapshot)(C));Object.assign(V,B),V.history=j?C.history.toJSON():{history:[],undoIdx:-1},(0,s.applySnapshot)(C,V)},clear({keepHistory:A=!1}={}){const j=C.pages.map(N=>N.id);C.deletePages(j),C.custom=null,A||C.history.clear()},addFont(A){C.removeFont(A.fontFamily),C.fonts.push(A),C.loadFont(A.fontFamily)},removeFont(A){C.fonts.filter(j=>j.fontFamily===A).forEach(j=>(0,s.destroy)(j))},addAudio(A){const j=I.Audio.create(Object.assign({id:(0,c.nanoid)(10)},A));C.audios.push(j)},removeAudio(A){const j=C.audios.find(N=>N.id===A);j&&C.audios.remove(j)},async loadFont(A){const j=C.fonts.find(B=>B.fontFamily===A)||w.globalFonts.find(B=>B.fontFamily===A);let N=[{fontStyle:"normal",fontWeight:"normal"}];return j?(j.styles&&(N=j.styles.map(B=>({fontStyle:B.fontStyle||"normal",fontWeight:B.fontWeight||"normal"}))),w.injectCustomFont(j)):w.injectGoogleFont(A),Promise.all(N.map(B=>w.loadFont(A,B.fontStyle,B.fontWeight)))},validate:A=>e.Store.validate(A,[{path:"",type:e.Store}]).map(j=>({path:"store"+j.context.map(N=>N.path).join("."),message:j.message}))})),e.default=O}(Is)),Is}var A4;function h_(){return A4||(A4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;const r=hl,t=u0,n=Mm(),a=f_(),i=Nh();e.Node=r.types.model("Node",{id:r.types.identifier,type:"none",name:"",opacity:1,custom:r.types.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(o=>{for(var s in o)o[s]===null&&(o[s]=void 0);return o}).postProcessSnapshot(o=>{const s=Object.assign({},o),u={};for(var c in s)c[0]!=="_"&&(u[c]=o[c]);return u}).views(o=>({get locked(){return!(o.draggable||o.contentEditable||o.styleEditable||o.resizable)},get page(){return(0,r.getParentOfType)(o,a.Page)},get store(){return(0,r.getParentOfType)(o,n.Store)},get top(){let s=o;for(;;){if(!(0,r.hasParentOfType)(s,i.GroupElement))return s;s=(0,r.getParentOfType)(s,i.GroupElement)}},get parent(){return(0,r.hasParentOfType)(o,i.GroupElement)?(0,r.getParentOfType)(o,i.GroupElement):(0,r.hasParentOfType)(o,a.Page)?(0,r.getParentOfType)(o,a.Page):(0,r.hasParentOfType)(o,n.Store)?(0,r.getParentOfType)(o,n.Store):null},get zIndex(){return o.parent.children.indexOf(o)}})).actions(o=>({toJSON:()=>Object.assign({},(0,r.getSnapshot)(o))})).actions(o=>({clone(s={},{skipSelect:u=!1}={}){const c=JSON.parse(JSON.stringify(o.toJSON()));return s.id=s.id||(0,t.nanoid)(10),(0,i.forEveryChild)(c,h=>{h.id=(0,t.nanoid)(10)}),Object.assign(c,s),o.page.addElement(c,{skipSelect:u})},set(s){Object.assign(o,s)},moveUp(){o.page.moveElementsUp([o.id])},moveTop(){o.page.moveElementsTop([o.id])},moveDown(){o.page.moveElementsDown([o.id])},moveBottom(){o.page.moveElementsBottom([o.id])},setZIndex(s){o.parent.setElementZIndex(o.id,s)},beforeDestroy(){}}))}(kv)),kv}var Hv={},Gv={},C4;function tk(){return C4||(C4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registerAnimation=e.animate=e.animations=void 0;const r=Dh(),t={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}}},n={right:{cropX:-1},left:{cropX:1},up:{cropY:1},down:{cropY:-1}};e.animations={fade:({dTime:a,element:i,animation:o})=>{const s=a/o.duration;return o.type==="enter"?{opacity:s*i.opacity}:{opacity:(1-s)*i.opacity}},rotate:({dTime:a,element:i,animation:o})=>{const s=a/o.duration*360;return(0,r.rotateAroundCenter)({x:i.x,y:i.y,width:i.width,height:i.height,rotation:i.rotation},s)},blink:({dTime:a,element:i,animation:o})=>{const s=o.duration,u=a%s/(s/2),c=u<=1?u:2-u;return{opacity:i.opacity*c}},bounce:({dTime:a,element:i,animation:o})=>{var s;const u=o.duration,c=u/2,h=(s=o.data.strength)!==null&&s!==void 0?s:1,p={},v={x:i.x+i.width/3*h,y:i.y+i.height/3*h,width:i.width/3*h,height:i.height/3*h,fontSize:i.fontSize/3*h},f={x:i.x,y:i.y,width:i.width,height:i.height,fontSize:i.fontSize},_=a%u/c,E=_<=1?_:2-_;for(let w in v){const x=v[w],y=f[w]-x;p[w]=x+E*y}return p},move:({dTime:a,element:i,animation:o})=>{var s;const u=t[o.data.direction]||t.right,c=(s=o.data.strength)!==null&&s!==void 0?s:1,h={};for(var p in u.from){let v=u.from[p],f=u.to[p];o.type==="exit"&&(v=u.to[p],f=-u.from[p]),v*=c,f*=c;const _=i[p]+v,E=i[p]+f-_;h[p]=_+a/o.duration*E}return h},zoom:({dTime:a,element:i,animation:o})=>{var s;const u={},c=1+(((o.data.direction||"in")==="in"?.75:1.25)-1)*((s=o.data.strength)!==null&&s!==void 0?s:1),h=i.rotation*Math.PI/180,p=Math.cos(h),v=Math.sin(h),f=i.width*(1-c),_=i.height*(1-c),E=(f*p-_*v)/2,w=(f*v+_*p)/2,x={x:i.x+E,y:i.y+w,width:i.width*c,height:i.height*c,fontSize:i.fontSize*c},y={x:i.x,y:i.y,width:i.width,height:i.height,fontSize:i.fontSize};for(var g in x){let S=x[g],b=y[g];if(o.type==="exit"){const L=S;S=b,b=L}const R=b-S;u[g]=S+a/o.duration*R}return u},cameraZoom:({dTime:a,element:i,animation:o})=>{var s,u,c;const h={},p=o.data.direction||"right",v=n[p]||n.right,f=(s=o.data.movementStrength)!==null&&s!==void 0?s:.1,_=(u=o.data.shakeStrength)!==null&&u!==void 0?u:.015;c=o.data.zoomStrength;const E=a/o.duration,w=_*(1-E),x=Math.sin(12*E)*w*.7+Math.sin(8*E)*w*.3;o.type==="exit"&&Math.max(i.cropWidth||1,i.cropHeight||1),o.type;const y=1-Math.pow(1-E,2),g=i.cropX||0,S=i.cropY||0,b=i.cropWidth||1,R=i.cropHeight||1,L=b,T=R;let F,I,O=0,C=0;if(v.cropX){const A=v.cropX>0?1-(g+b):g;O=Math.min(A,Math.abs(f))*v.cropX}if(v.cropY){const A=v.cropY>0?1-(S+R):S;C=Math.min(A,Math.abs(f))*v.cropY}return o.type==="enter"?(F=v.cropX?g+O*(1-y):g,I=v.cropY?S+C*(1-y):S):(F=v.cropX?g+O*y:g,I=v.cropY?S+C*y:S),h.cropX=Math.max(0,Math.min(1-L,F+x*L)),h.cropY=Math.max(0,Math.min(1-T,I+x*T)),h.cropWidth=L,h.cropHeight=T,h}},e.animate=({element:a,dTime:i,animation:o})=>{const s=e.animations[o.name];return s?s({element:a,dTime:i,animation:o}):(console.error("Can not find animation type: "+o.name),{})},e.registerAnimation=(a,i)=>{e.animations[a]&&console.warn(`Animation "${a}" already exists and will be overridden`),e.animations[a]=i}}(Gv)),Gv}var k4;function Bh(){return k4||(k4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.INDEPENDENT_FILTERS=e.ShapeFilter=e.getDiff=e.Animation=void 0;const r=hl,t=tk(),n=vs,a=h_();e.Animation=r.types.model("Animation",{delay:0,duration:500,enabled:!0,type:r.types.enumeration("Type",["enter","exit","loop"]),name:"none",data:r.types.frozen({})}),e.getDiff=(i,o)=>{const s={};for(const u in o)if(typeof i[u]=="number"&&typeof o[u]=="number"){const c=o[u]-i[u];c!==0&&(s[u]=c)}return s},e.ShapeFilter=r.types.model("ShapeFilter",{intensity:1}),e.INDEPENDENT_FILTERS=["temperature","contrast","highlights","shadows","white","black","saturation","vibrance"],e.Shape=a.Node.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:r.types.array(e.Animation),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,filters:r.types.map(e.ShapeFilter),shadowEnabled:!1,shadowBlur:5,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black",shadowOpacity:1,visible:!0,draggable:!0,resizable:!0,selectable:!0,contentEditable:!0,styleEditable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(i=>{const o=Object.assign(Object.assign({},i),{x:i.x||0,y:i.y||0,filters:Array.isArray(i.filters)?{}:i.filters});return"width"in i&&(o.width=o.width||1),"height"in i&&(o.height=o.height||1),i.locked&&(o.draggable=!1,o.contentEditable=!1,o.styleEditable=!1,o.resizable=!1,o.removable=!1),o}).views(i=>{const o=(0,n.observable)({x:i.x,y:i.y,width:i.width,height:i.height,rotation:i.rotation,opacity:i.opacity,color:i.color,fontSize:i.fontSize}),s=(0,n.action)(c=>{Object.assign(o,c)}),u=(0,n.action)(c=>{for(const h in c)typeof o[h]=="number"&&(o[h]=o[h]+c[h])});return{get a(){const{currentTime:c}=i.store;if(s({x:i.x,y:i.y,width:i.width,height:i.height,rotation:i.rotation,opacity:i.opacity,color:i.color,fontSize:i.fontSize,cropX:i.cropX,cropY:i.cropY,cropWidth:i.cropWidth,cropHeight:i.cropHeight}),c===0)return o;const h=c-i.page.startTime;if(h>i.page.duration||h<0)return o;const p=i.store.animatedElementsIds;if(p.length&&!p.includes(i.id))return o;const v=i.animations.find(x=>x.type==="enter"),f=(v==null?void 0:v.enabled)&&h<v.delay;f&&s({opacity:0});const _=(v==null?void 0:v.enabled)&&h>=v.delay&&h<=v.delay+v.duration;if(_){const x=h-v.delay,y=(0,t.animate)({element:i,animation:v,dTime:x}),g=(0,e.getDiff)(i,y);u(g)}const E=i.animations.find(x=>x.type==="exit");if(!f&&!_&&(E!=null&&E.enabled)&&h>=i.page.duration-E.duration-E.delay&&h<=i.page.duration-E.delay){const x=h-(i.page.duration-E.duration-E.delay),y=(0,t.animate)({element:i,animation:E,dTime:x}),g=(0,e.getDiff)(i,y);u(g)}E!=null&&E.enabled&&h>=i.page.duration-E.delay&&s({opacity:0});const w=i.animations.find(x=>x.type==="loop");if(w!=null&&w.enabled){const x=h,y=(0,t.animate)({element:i,animation:w,dTime:x}),g=(0,e.getDiff)(i,y);u(g)}return o},animated:c=>i.a[c]}}).actions(i=>({setAnimation(o,s){const u=i.animations.find(c=>c.type===o);u?Object.assign(u,s):i.animations.push(Object.assign({type:o},s))},setFilter(o,s){e.INDEPENDENT_FILTERS.includes(o)||i.filters.forEach((u,c)=>{e.INDEPENDENT_FILTERS.includes(c.toString())||i.filters.delete(c.toString())}),s==null?i.filters.delete(o):i.filters.set(o,{intensity:s})}}))}(Hv)),Hv}var Vv={},L4;function rk(){return L4||(L4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=void 0;const r=hl,t=Bh();e.TextElement=t.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:r.types.optional(r.types.union(r.types.number,r.types.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5}).preProcessSnapshot(n=>Object.assign({},n)).actions(n=>({toggleEditMode(a){n._editModeEnabled=a??!n._editModeEnabled,n._editModeEnabled?n.store.history.startTransaction():n.store.history.endTransaction()}}))}(Vv)),Vv}var Wv={},N4;function Im(){return N4||(N4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=void 0;const r=Bh();e.ImageElement=r.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,stretchEnabled:!1,_cropModeEnabled:!1}).actions(t=>({toggleCropMode(n){t._cropModeEnabled=n??!t._cropModeEnabled,t._cropModeEnabled?t.store.history.startTransaction():t.store.history.endTransaction()},beforeDestroy(){t._cropModeEnabled&&t.store.history.endTransaction()}}))}(Wv)),Wv}var $v={},T4;function nk(){return T4||(T4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=void 0;const r=Im();e.VideoElement=r.ImageElement.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1})}($v)),$v}var Yv={},R4;function ik(){return R4||(R4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;const r=hl,t=Bh();e.LineElement=t.Shape.named("Line").props({type:"line",width:400,height:10,color:"black",dash:r.types.array(r.types.number),startHead:"",endHead:""}).actions(n=>({}))}(Yv)),Yv}var Xv={},M4;function ak(){return M4||(M4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGElement=void 0;const r=hl,t=Bh();e.SVGElement=t.Shape.named("SVG").props({type:"svg",src:"",maskSrc:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,keepRatio:!0,stretchEnabled:!0,flipX:!1,flipY:!1,width:100,height:100,borderColor:"black",borderSize:0,cornerRadius:0,colorsReplace:r.types.map(r.types.string)}).preProcessSnapshot(n=>Object.assign(Object.assign({},n),{src:n.src||n.svgSource,colorsReplace:Array.isArray(n.colorsReplace)?{}:n.colorsReplace})).actions(n=>({replaceColor(a,i){n.colorsReplace.set(a,i)}}))}(Xv)),Xv}var Kv={},I4;function ok(){return I4||(I4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const r=hl,t=Bh();e.FigureElement=t.Shape.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:r.types.array(r.types.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0})}(Kv)),Kv}var Zv={},j4;function sk(){return j4||(j4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GifElement=void 0;const r=Im();e.GifElement=r.ImageElement.named("Gif").props({type:"gif",duration:0,keepRatio:!0})}(Zv)),Zv}var F4;function Nh(){return F4||(F4=1,function(e){var r=Jd&&Jd.__rest||function(E,w){var x={};for(var y in E)Object.prototype.hasOwnProperty.call(E,y)&&w.indexOf(y)<0&&(x[y]=E[y]);if(E!=null&&typeof Object.getOwnPropertySymbols=="function"){var g=0;for(y=Object.getOwnPropertySymbols(E);g<y.length;g++)w.indexOf(y[g])<0&&Object.prototype.propertyIsEnumerable.call(E,y[g])&&(x[y[g]]=E[y[g]])}return x};Object.defineProperty(e,"__esModule",{value:!0}),e.TYPES_MAP=e.GroupElement=e.ElementTypes=e.forEveryChild=void 0,e.registerShapeModel=function(E,w){const x=E.type;if(!x)throw new Error('You must pass "type" attribute to custom model.');let y=i.Shape.named(x).props(E);w&&(y=w(y)),e.TYPES_MAP[x]=y,_.push(y)};const t=hl,n=u0,a=h_(),i=Bh(),o=rk(),s=Im(),u=nk(),c=ik(),h=ak(),p=ok(),v=sk();e.forEveryChild=(E,w)=>{if(E.children)for(const x of E.children){if(w(x)===!0)break;(0,e.forEveryChild)(x,w)}};const f=[...new Array(20)].map((E,w)=>t.types.late(()=>_[w]));e.ElementTypes=t.types.union({dispatcher:E=>{const w=e.TYPES_MAP[E.type];if(!w)throw new Error(`Unknown element type: "${E.type}"`);return w}},h.SVGElement,o.TextElement,s.ImageElement,c.LineElement,u.VideoElement,p.FigureElement,v.GifElement,t.types.late(()=>e.GroupElement),...f),e.GroupElement=a.Node.named("Group").props({type:"group",children:t.types.array(e.ElementTypes)}).views(E=>({get draggable(){let w=!0;return(0,e.forEveryChild)(E,x=>{x.draggable||(w=!1)}),w},get resizable(){let w=!0;return(0,e.forEveryChild)(E,x=>{x.resizable||(w=!1)}),w},get contentEditable(){let w=!0;return(0,e.forEveryChild)(E,x=>{x.contentEditable||(w=!1)}),w},get styleEditable(){let w=!0;return(0,e.forEveryChild)(E,x=>{x.styleEditable||(w=!1)}),w},get locked(){let w=!0;return(0,e.forEveryChild)(E,x=>{x.locked||(w=!1)}),w}})).actions(E=>({set(w){var{draggable:x,contentEditable:y,styleEditable:g,resizable:S}=w,b=r(w,["draggable","contentEditable","styleEditable","resizable"]);x!==void 0&&(0,e.forEveryChild)(E,R=>{R.set({draggable:x})}),y!==void 0&&(0,e.forEveryChild)(E,R=>{R.set({contentEditable:y})}),g!==void 0&&(0,e.forEveryChild)(E,R=>{R.set({styleEditable:g})}),S!==void 0&&(0,e.forEveryChild)(E,R=>{R.set({resizable:S})}),Object.assign(E,b)},addElement(w,{skipSelect:x=!1}={}){const y=e.TYPES_MAP[w.type];if(!y)return void console.error("Can not find model with type "+w.type);w.children&&w.children.forEach(S=>{S.id=S.id||(0,n.nanoid)(10)});const g=y.create(Object.assign({id:(0,n.nanoid)(10)},w));return E.children.push(g),g.selectable&&!x&&E.store.selectElements([g.id]),g},setElementZIndex(w,x){const y=E.children.find(g=>g.id===w);y&&((0,t.detach)(y),E.children.remove(y),E.children.splice(x,0,y))}}));const _=[];e.TYPES_MAP={svg:h.SVGElement,text:o.TextElement,image:s.ImageElement,group:e.GroupElement,line:c.LineElement,video:u.VideoElement,figure:p.FigureElement,gif:v.GifElement}}(Jd)),Jd}var D4;function lk(){return D4||(D4=1,function(e){var r=Dd&&Dd.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeComponent=function(S,b){x[S]=b};const t=r(ai()),n=Us,a=r(Hs()),i=z8(),o=Om(),s=TC(),u=RC(),c=i_(),h=MC(),p=BC(),v=Fu,f=qC(),_=Nh(),E=gc(),w=(0,n.observer)(S=>{const{element:b,store:R}=S,{children:L}=b,T=b.selectable||R.role==="admin";return t.default.createElement(v.Group,{opacity:b.opacity,listening:T,hideInExport:!b.showInExport},L.map(F=>t.default.createElement(g,Object.assign({},S,{key:F.id,store:R,element:F}))))}),x={text:i.TextElement,image:o.ImageElement,svg:o.ImageElement,line:u.LineElement,video:c.VideoElement,figure:h.FigureElement,group:w,gif:p.GifElement},y=(S,b)=>{const R=[];(0,_.forEveryChild)(S,j=>{j.type!=="group"&&R.push(j.a)});const L=[];R.forEach(j=>{const N=[{x:0,y:0},{x:0+j.width,y:0},{x:0+j.width,y:0+j.height},{x:0,y:0+j.height}],B=new a.default.Transform;B.translate(j.x,j.y),B.rotate(a.default.Util.degToRad(j.rotation)),N.forEach(W=>{const Y=B.point(W);L.push(Y)})});const T=new a.default.Transform;T.rotate(-a.default.Util.degToRad(b));let F=1/0,I=1/0,O=-1/0,C=-1/0;L.forEach(j=>{const N=T.point(j);F=Math.min(F,N.x),I=Math.min(I,N.y),O=Math.max(O,N.x),C=Math.max(C,N.y)}),T.invert();const A=T.point({x:F,y:I});return{x:A.x,y:A.y,width:O-F,height:C-I,rotation:b}},g=(0,n.observer)(S=>{const{element:b,store:R}=S,[L,T]=t.default.useState(!1),F=R.selectedElements.indexOf(b)>=0&&b.selectable,I=b.parent.type==="group",O=(j=>{const[N,B]=t.default.useState(null);return t.default.useEffect(()=>{const W=setTimeout(()=>{const Y=j.page.id,Z=a.default.stages.find(V=>V.getAttr("pageId")===Y);Z||console.error("No stage is found for element",j.id),B(Z)});return()=>clearTimeout(W)},[j.id]),N})(b),C=O==null?void 0:O.findOne("Transformer");t.default.useEffect(()=>{if(O){const j=B=>{const W=B.target.findAncestor(".element",!0),Y=R.getElementById(W==null?void 0:W.id()),Z=Y==null?void 0:Y.top,V=Z==null?void 0:Z.id;T(V===b.id)};O.on("mouseover",j);const N=()=>{T(!1)};return O.on("mouseleave",N),()=>{O.off("mouseover",j),O.off("mouseleave",N)}}},[O]);let A=x[S.element.type];return S.element.type==="text"&&E.flags.htmlRenderEnabled&&(A=s.HTMLElement),S.element.visible?A?t.default.createElement(t.default.Fragment,null,t.default.createElement(A,Object.assign({},S)),(L||F)&&!I&&t.default.createElement(f.Highlighter,{element:b.type==="group"?{a:y(b,(C==null?void 0:C.rotation())||0)}:b})):(console.error("Can not find component for "+S.element.type),null):null});e.default=g}(Dd)),Dd}var Qv={},B4;function uk(){return B4||(B4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=function(r,t,n="scale"){const a=t.width/t.height;let i,o;a>=r.width/r.height?(i=r.width,o=r.width/a):(i=r.height*a,o=r.height);let s=0,u=0;return n==="left-top"?(s=0,u=0):n==="left-middle"?(s=0,u=(r.height-o)/2):n==="left-bottom"?(s=0,u=r.height-o):n==="center-top"?(s=(r.width-i)/2,u=0):n==="center-middle"?(s=(r.width-i)/2,u=(r.height-o)/2):n==="center-bottom"?(s=(r.width-i)/2,u=r.height-o):n==="right-top"?(s=r.width-i,u=0):n==="right-middle"?(s=r.width-i,u=(r.height-o)/2):n==="right-bottom"?(s=r.width-i,u=r.height-o):n==="scale"?(s=0,u=0,i=r.width,o=r.height):console.error(new Error("Unknown clip position property - "+n)),{cropX:s,cropY:u,cropWidth:i,cropHeight:o}}}(Qv)),Qv}var q4;function ck(){return q4||(q4=1,function(e){var r=yf&&yf.__rest||function(D,$){var Q={};for(var ee in D)Object.prototype.hasOwnProperty.call(D,ee)&&$.indexOf(ee)<0&&(Q[ee]=D[ee]);if(D!=null&&typeof Object.getOwnPropertySymbols=="function"){var te=0;for(ee=Object.getOwnPropertySymbols(D);te<ee.length;te++)$.indexOf(ee[te])<0&&Object.prototype.propertyIsEnumerable.call(D,ee[te])&&(Q[ee[te]]=D[ee[te]])}return Q},t=yf&&yf.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerNextDomDrop=e.useContextMenu=e.setTransformerStyle=void 0,e.registerTransformerAttrs=function(D,$){I[D]=I[D]||$,Object.assign(I[D],$)};const n=t(ai()),a=Us,i=vs,o=Fu,s=t(r0()),u=t(Hs()),c=t(lk()),h=n_(),p=Om(),v=uk(),f=Tm(),_=Dh(),E=Rm(),w=gc(),x=rf(),y=Op(),g=dm(),S=Mh,b=u.default.DD._drag;window.removeEventListener("mousemove",b),u.default.DD._drag=function(D){(0,i.runInAction)(()=>{b.call(this,D)})},window.addEventListener("mousemove",u.default.DD._drag);const R=new u.default.Group,L=20;R.add(new u.default.Rect({width:L,height:L,fill:"white"})),R.add(new u.default.Path({scaleX:L/24,scaleY:L/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 T=R.toCanvas({pixelRatio:2,width:L,height:L}),F={enabledAnchors:["top-left","top-center","top-right","middle-left","bottom-left","bottom-right","bottom-center","middle-right"],borderEnabled:!0,rotateEnabled:!0,rotationSnaps:[0,45,90,135,180,225,270,315],ignoreStroke:!0,flipEnabled:!1,anchorStrokeWidth:2,borderStrokeWidth:2,rotateAnchorOffset:30,anchorStyleFunc:D=>{D.hasName("rotater")&&D.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:T,fillPatternScaleX:20/L/2,fillPatternScaleY:20/L/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}};e.setTransformerStyle=D=>{Object.assign(F,D)};const I={text:{enabledAnchors:["top-left","top-right","middle-left","bottom-left","bottom-right","middle-right"]},svg:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},gif:{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"]}},O=D=>n.default.createElement(o.Rect,Object.assign({},D,{preventDefault:!1})),C=D=>{var{url:$}=D,Q=r(D,["url"]);const[ee,te]=(0,s.default)($,"anonymous"),ae=ee?(0,v.getCrop)(ee,{width:Q.width,height:Q.height},"center-middle"):{};return(0,p.useImageLoader)(te,$,"page background"),n.default.createElement(o.Image,Object.assign({image:ee},Q,ae))},A=D=>{const $=(0,y.useColor)({fill:D.fill,a:{width:D.width,height:D.height}});return n.default.createElement(o.Rect,Object.assign({},D,$))},j=D=>{const{background:$,scale:Q,borderColor:ee}=D,te=r(D,["background","scale","borderColor"]),ae=n.default.useMemo(()=>!!u.default.Util.colorToRGBA($)||(0,g.isGradient)($),[$]),se=n.default.useMemo(()=>{const ce=document.createElement("canvas"),me=30;ce.width=60,ce.height=60;const _e=ce.getContext("2d");return _e&&(_e.fillStyle="black",_e.fillRect(me,0,me,me),_e.fillRect(0,me,me,me)),ce},[]);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Rect,Object.assign({fillPatternImage:se},te,{opacity:.1,hideInExport:!0})),ae?n.default.createElement(A,Object.assign({fill:$},te)):n.default.createElement(C,Object.assign({url:$},te)))},N=(0,a.observer)(({selection:D,fill:$="rgba(0, 161, 255, 0.3)",stroke:Q="rgb(0, 161, 255)",strokeWidth:ee=1})=>D.visible?n.default.createElement(o.Rect,{name:"selection",x:Math.min(D.x1,D.x2),y:Math.min(D.y1,D.y2),width:Math.abs(D.x1-D.x2),height:Math.abs(D.y1-D.y2),fill:$,stroke:Q,strokeWidth:ee}):null),B=(0,a.observer)(({x:D,y:$,width:Q,height:ee,rotation:te,anchor:ae,store:se,tagFill:ce,textFill:me})=>{const _e=(0,_.getClientRect)({x:D,y:$,width:Q,height:ee,rotation:u.default.Util.radToDeg(te)});if(ae===void 0)return null;const Le=(ee/2+70)*Math.cos(te-Math.PI/2),Re=(ee/2+70)*Math.sin(te-Math.PI/2),Pe=(0,E.pxToUnitRounded)({unit:se.unit,dpi:se.dpi,px:Q/se.scale,precious:se.unit==="px"?0:1})+" x "+(0,E.pxToUnitRounded)({unit:se.unit,dpi:se.dpi,px:ee/se.scale,precious:se.unit==="px"?0:1})+(se.unit==="px"?"":" "+se.unit);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Label,{x:(_e.minX+_e.maxX)/2+Le,y:(_e.minY+_e.maxY)/2+Re,offsetX:14,offsetY:14,visible:ae==="rotater"},n.default.createElement(o.Tag,{cornerRadius:5,fill:ce||"rgb(0, 161, 255)"}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:me||"white",padding:8,text:Math.round(u.default.Util.radToDeg(te)).toString()+"°"})),n.default.createElement(o.Label,{x:(_e.minX+_e.maxX)/2,y:_e.maxY+20,visible:ae!=="rotater"},n.default.createElement(o.Tag,{cornerRadius:5,fill:ce||"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:me||"white",padding:8,text:Pe})))}),W=(0,a.observer)(({elements:D,store:$})=>{const Q=D.filter(te=>te.alwaysOnTop),ee=D.filter(te=>!te.alwaysOnTop).concat(Q);return n.default.createElement(n.default.Fragment,null,ee.map(te=>n.default.createElement(c.default,{key:te.id,store:$,element:te,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});e.useContextMenu=({store:D})=>{const[$,Q]=n.default.useState(!1),[ee,te]=n.default.useState({x:0,y:0});return{open:n.default.useCallback(se=>{Q(!0),te(se)},[]),close:n.default.useCallback(()=>{Q(!1)},[]),props:{isOpen:$,offset:ee,setIsOpen:Q}}};let Y=null;e.registerNextDomDrop=D=>{Y=D};const Z=atob("UG9sb3RubyBmcmVlIGxpY2Vuc2UgbGltaXRhdGlvbiBleGNlZWRlZCAtIFBsZWFzZSB1cGdyYWRlIHlvdXIgYWNjb3VudC4="),V=atob("cmVk"),H=atob("djAuOS4y"),U=D=>n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Label,{fill:V,height:200},n.default.createElement(o.Tag,{fill:V}),n.default.createElement(o.Text,Object.assign({},D,{fill:"white",text:Z,height:void 0,padding:10,fontSize:20}))));e.default=(0,a.observer)(({store:D,page:$,width:Q,height:ee,pageControlsEnabled:te,backColor:ae,pageBorderColor:se,activePageBorderColor:ce,components:me,bleedColor:_e,altCloneEnabled:Le,viewportSize:Re,selectionRectFill:Pe,selectionRectStroke:ve,selectionRectStrokeWidth:it,snapGuideStroke:Se,snapGuideStrokeWidth:be,snapGuideDash:Ae,transformLabelFill:Te,transformLabelTextFill:he})=>{const Oe=D.bleedVisible?$.bleed:0,Me=$.computedWidth+2*Oe,ze=$.computedHeight+2*Oe,pt=(Q-Me*D.scale)/2,yt=(ee-ze*D.scale)/2,He=n.default.useRef(null),Qe=n.default.useRef(null),Ze=n.default.useRef(null),tt=te==null||te,[Ht,Pt]=n.default.useState(null),[It,qt]=n.default.useState({}),Ie=(0,e.useContextMenu)({store:D}),ke=D.selectedElements.find(ct=>ct._cropModeEnabled),ut=D.selectedShapes.filter(ct=>!ct.resizable).length>0,Nt=D.selectedShapes.filter(ct=>!ct.draggable).length>0,Ct=D.selectedElements.filter(ct=>!ct.visible).length>0;n.default.useLayoutEffect(()=>{var ct,_t,xt;if(!He.current)return;const rt=He.current.getStage(),zt=D.selectedShapes.map(Ft=>Ft._cropModeEnabled?null:rt.findOne("#"+Ft.id)).filter(Ft=>Ft),gt=D.selectedElements.length===1&&((ct=D.selectedElements[0])===null||ct===void 0?void 0:ct.type)||"many";I[gt]?(He.current.setAttrs(Object.assign(Object.assign({},F),I[gt])),gt!=="svg"&>!=="image"&>!=="gif"||D.selectedElements[0].keepRatio||He.current.setAttrs({enabledAnchors:F.enabledAnchors}),gt==="text"&&w.flags.textVerticalResizeEnabled&&He.current.setAttrs({enabledAnchors:(_t=I.text.enabledAnchors)===null||_t===void 0?void 0:_t.concat(["bottom-center"])})):He.current.setAttrs(F),ut&&He.current.enabledAnchors([]),Nt&&He.current.rotateEnabled(!1),zt.find(Ft=>Ft==null?void 0:Ft.isDragging())&&zt.forEach(Ft=>{Ft.isDragging()||Ft==null||Ft.startDrag()}),He.current.nodes(zt),(xt=He.current.getLayer())===null||xt===void 0||xt.batchDraw()},[D.selectedShapes,ke,ut,Ct,Nt]);const St=(0,a.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),Jt=n.default.useRef(!1),nr=(0,x.isTouchDevice)(),Tt=(0,i.action)(ct=>{var _t,xt,rt,zt;if(nr)return;Jt.current=!1;const gt=ct.target.findAncestor(".elements-container"),Ft=ct.target.findAncestor("Transformer"),br=ct.target.findAncestor(".page-abs-container");if(gt||Ft||br)return;const hr=(_t=ct.target.getStage())===null||_t===void 0?void 0:_t.getPointerPosition();hr.x-=(xt=ct.target.getStage())===null||xt===void 0?void 0:xt.x(),hr.y-=(rt=ct.target.getStage())===null||rt===void 0?void 0:rt.y(),hr&&(St.visible=!0,St.x1=hr.x,St.y1=hr.y,St.x2=hr.x,St.y2=hr.y,((zt=ct.target.getStage())===null||zt===void 0?void 0:zt.getPointersPositions().length)>=2&&(St.visible=!1))});(({stageRef:ct,containerRef:_t,viewportSize:xt})=>{n.default.useEffect(()=>{var rt;const zt=(rt=_t.current)===null||rt===void 0?void 0:rt.closest(".polotno-workspace-inner");function gt(){var Ft;if(!ct.current)return;const br=(Ft=_t.current)===null||Ft===void 0?void 0:Ft.getBoundingClientRect(),hr=zt==null?void 0:zt.getBoundingClientRect(),Qr=Math.max(0,hr.left-br.left-100),Sn=Math.max(0,hr.top-br.top-100);ct.current.position({x:-Qr,y:-Sn}),ct.current.container().style.transform=`translate(${Qr}px, ${Sn}px)`}return gt(),zt.addEventListener("scroll",gt),()=>{zt.removeEventListener("scroll",gt)}},[xt.width,xt.height])})({stageRef:Qe,containerRef:Ze,viewportSize:Re}),n.default.useEffect(()=>{const ct=(0,i.action)(xt=>{var rt,zt,gt,Ft;if(!St.visible)return;(rt=Qe.current)===null||rt===void 0||rt.setPointersPositions(xt);let br=(zt=Qe.current)===null||zt===void 0?void 0:zt.getPointerPosition();br?(br.x-=(gt=Qe.current)===null||gt===void 0?void 0:gt.x(),br.y-=(Ft=Qe.current)===null||Ft===void 0?void 0:Ft.y()):br={x:St.x2,y:St.y2},St.x2=br.x,St.y2=br.y}),_t=(0,i.action)(()=>{if(!St.visible||!Qe.current)return;const xt=Qe.current.findOne(".selection"),rt=xt?xt.getClientRect():{width:0,height:0,x:0,y:0};if(rt.width&&rt.height){const zt=[];Qe.current.find(".element").forEach(Ft=>{const br=Ft.getClientRect(),hr=D.getElementById(Ft.id()),Qr=hr==null?void 0:hr.draggable,Sn=hr==null?void 0:hr.selectable;u.default.Util.haveIntersection(rt,br)&&Qr&&Sn&&zt.push(hr.top.id)});const gt=[...new Set(zt)];D.selectElements(gt)}St.visible=!1,Jt.current=!0});return window.addEventListener("mousemove",ct),window.addEventListener("touchmove",ct),window.addEventListener("mouseup",_t),window.addEventListener("touchend",_t),()=>{window.removeEventListener("mousemove",ct),window.removeEventListener("touchmove",ct),window.removeEventListener("mouseup",_t),window.removeEventListener("touchend",_t)}},[]);const Xt=n.default.useRef(!1);n.default.useEffect(()=>{var ct;let _t;const xt=(ct=Ze.current)===null||ct===void 0?void 0:ct.closest(".polotno-workspace-inner"),rt=()=>{Xt.current=!0,clearTimeout(_t),_t=setTimeout(()=>{Xt.current=!1},300)};return xt.addEventListener("scroll",rt),()=>{clearTimeout(_t),xt.removeEventListener("scroll",rt)}},[]);const Rr=ct=>{if(D.activePage!==$&&$.select(),Xt.current||Jt.current)return;const _t=ct.evt.ctrlKey||ct.evt.metaKey||ct.evt.shiftKey,xt=ct.target.findAncestor(".elements-container"),rt=ct.target.findAncestor(".page-abs-container"),zt=ct.target.findAncestor("Transformer");if(!(_t||xt||zt||rt))return void D.selectElements([]);const gt=ct.target.findAncestor(".element",!0),Ft=D.getElementById(gt==null?void 0:gt.id()),br=Ft==null?void 0:Ft.top,hr=br==null?void 0:br.id,Qr=D.selectedElementsIds.indexOf(hr)>=0;hr&&_t&&!Qr?D.selectElements(D.selectedElementsIds.concat([hr])):hr&&_t&&Qr?D.selectElements(D.selectedElementsIds.filter(Sn=>Sn!==hr)):!hr||_t||Qr||D.selectElements([hr])};(0,h.useSnap)(He,D,{stroke:Se,strokeWidth:be,dash:Ae});const Je=D.activePage===$,mt=me==null?void 0:me.PageControls,Gt=me==null?void 0:me.Tooltip,bt=me==null?void 0:me.ContextMenu,Kt=1/D.scale,Yt=0/D.scale;return n.default.createElement("div",{ref:Ze,onDragOver:ct=>ct.preventDefault(),onDrop:ct=>{if(ct.preventDefault(),!Qe.current)return;Qe.current.setPointersPositions(ct);const _t=Qe.current.findOne(".elements-container").getRelativePointerPosition(),xt=Qe.current.getPointerPosition(),rt=Qe.current.getAllIntersections(xt).map(Ft=>Ft.findAncestor(".element",!0)).filter(Boolean),zt=[...new Set(rt.reverse())].map(Ft=>D.getElementById(Ft.id())),gt=zt[0];Y&&(Y(_t,gt,{elements:zt,page:$}),Y=null)},style:{position:"relative",width:Q+"px",height:ee+"px",overflow:"hidden"},className:"polotno-page-container"+(Je?" active-page":"")},n.default.createElement(o.Stage,{ref:Qe,width:Math.min(Q,Re.width+200),height:Math.min(Re.height+200,ee),onClick:Rr,onTap:Rr,onContextMenu:ct=>{ct.evt.preventDefault();const _t=ct.target.findAncestor(".element",!0),xt=D.getElementById(_t==null?void 0:_t.id()),rt=xt==null?void 0:xt.top,zt=rt==null?void 0:rt.id;zt?D.selectedElementsIds.indexOf(zt)>=0||D.selectElements([zt]):D.selectElements([]),Ie.open({x:ct.evt.clientX,y:ct.evt.clientY})},onMouseDown:Tt,onMouseMove:ct=>{if(!ct.evt.altKey&&Ht)return void Pt(null);if(!ct.evt.altKey)return;const _t=ct.target.findAncestor(".element",!0),xt=_t==null?void 0:_t.id();if(!D.selectedElements[0]||D.selectedElementsIds.includes(xt))return;const rt=(0,_.getTotalClientRect)(D.selectedShapes),zt=xt?D.getElementById(xt):{x:0,y:0,width:$.computedWidth,height:$.computedHeight,rotation:0},gt=(0,_.getClientRect)(zt),Ft=[];rt.minX>gt.maxX&&Ft.push({distance:rt.minX-gt.maxX,box1:rt,box2:gt,points:[{x:rt.minX,y:rt.minY+rt.height/2},{x:gt.maxX,y:rt.minY+rt.height/2},{x:gt.maxX,y:gt.minY+gt.height/2}]}),rt.maxX<gt.minX&&Ft.push({distance:gt.minX-rt.maxX,box1:rt,box2:gt,points:[{x:rt.maxX,y:rt.minY+rt.height/2},{x:gt.minX,y:rt.minY+rt.height/2},{x:gt.minX,y:gt.minY+gt.height/2}]}),rt.minY>gt.maxY&&Ft.push({box1:rt,box2:gt,distance:rt.minY-gt.maxY,points:[{x:rt.minX+rt.width/2,y:rt.minY},{x:rt.minX+rt.width/2,y:gt.maxY},{x:gt.minX+gt.width/2,y:gt.maxY}]}),rt.maxY<gt.minY&&Ft.push({box1:rt,box2:gt,distance:gt.minY-rt.maxY,points:[{x:rt.minX+rt.width/2,y:rt.maxY},{x:rt.minX+rt.width/2,y:gt.minY},{x:gt.minX+gt.width/2,y:gt.minY}]}),rt.minX>=gt.minX&&rt.maxX<=gt.maxX&&rt.minY>=gt.minY&&rt.maxY<=gt.maxY&&(Ft.push({distance:rt.minX-gt.minX,box1:rt,box2:gt,points:[{x:rt.minX,y:rt.minY+rt.height/2},{x:gt.minX,y:rt.minY+rt.height/2},{x:gt.minX,y:gt.minY+gt.height/2}]}),Ft.push({distance:gt.maxX-rt.maxX,box1:rt,box2:gt,points:[{x:rt.maxX,y:rt.minY+rt.height/2},{x:gt.maxX,y:rt.minY+rt.height/2},{x:gt.maxX,y:gt.minY+gt.height/2}]}),Ft.push({box1:rt,box2:gt,distance:rt.minY-gt.minY,points:[{x:rt.minX+rt.width/2,y:rt.minY},{x:rt.minX+rt.width/2,y:gt.minY},{x:gt.minX+gt.width/2,y:gt.minY}]}),Ft.push({box1:rt,box2:gt,distance:gt.maxY-rt.maxY,points:[{x:rt.minX+rt.width/2,y:rt.maxY},{x:rt.minX+rt.width/2,y:gt.maxY},{x:gt.minX+gt.width/2,y:gt.maxY}]})),JSON.stringify(Ht)!==JSON.stringify(Ft)&&Pt(Ft)},onDragStart:ct=>{var _t;const xt=ct.target.findAncestor(".element",!0);if(xt){const rt=D.getElementById(xt==null?void 0:xt.id()),zt=rt==null?void 0:rt.top,gt=zt==null?void 0:zt.id;!(D.selectedElementsIds.indexOf(gt)>=0)&>&&(D.selectElements([gt]),ct.target.stopDrag(),ct.target.startDrag(ct),(_t=He.current)===null||_t===void 0||_t.startDrag(ct))}Ht&&Pt(null)},pageId:$.id,style:{position:"absolute",overflow:"hidden",top:0,left:0}},n.default.createElement(o.Layer,null,n.default.createElement(O,{width:Q,height:ee,fill:ae}),n.default.createElement(o.Group,{x:pt,y:yt,scaleX:D.scale,scaleY:D.scale,name:"page-container"},n.default.createElement(o.Group,{name:"page-container-2"},n.default.createElement(o.Group,{name:"page-background-group",x:Oe,y:Oe},n.default.createElement(j,{x:-$.bleed,y:-$.bleed,width:$.computedWidth+2*$.bleed,height:$.computedHeight+2*$.bleed,background:$.background,name:"page-background",preventDefault:!1,scale:D.scale})),n.default.createElement(o.Group,{x:Oe,y:Oe,name:"elements-container",listening:!D.isPlaying},n.default.createElement(o.Rect,{name:"elements-area",width:$.computedWidth,height:$.computedHeight,listening:!1}),n.default.createElement(W,{elements:$.children,store:D})),n.default.createElement(o.Rect,{stroke:_e,name:"bleed",strokeWidth:$.bleed,x:$.bleed/2,y:$.bleed/2,width:$.computedWidth+$.bleed,height:$.computedHeight+$.bleed,listening:!1,visible:$.bleed>0&&D.bleedVisible,hideInExport:!0}),(0,f.___)()===H&&n.default.createElement(U,{name:"hit-detection",x:-Kt/2-Yt,y:-Kt/2-Yt,width:Me+Kt+2*Yt,height:ze+Kt+2*Yt}))),n.default.createElement(o.Line,{name:"workspace-background",points:[0,0,Q,0,Q,ee,0,ee,0,0,pt,yt,pt,ee-yt,Q-pt,ee-yt,Q-pt,yt,pt,yt],listening:!1,closed:!0,fill:ae}),n.default.createElement(o.Group,{x:pt,y:yt,scaleX:D.scale,scaleY:D.scale},n.default.createElement(o.Rect,{name:"page-highlight",hideInExport:!0,x:-Kt/2-Yt,y:-Kt/2-Yt,width:Me+Kt+2*Yt,height:ze+Kt+2*Yt,stroke:Je&&D.pages.length>1?ce:se,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),n.default.createElement(o.Group,{x:pt+Oe*D.scale,y:yt+Oe*D.scale,scaleX:D.scale,scaleY:D.scale,name:"page-abs-container"},n.default.createElement(o.Transformer,{ref:He,onDragStart:ct=>{var _t;!((_t=ct.evt)===null||_t===void 0)&&_t.altKey&&Le&&D.selectedElements.forEach(xt=>{const rt=xt.clone({},{skipSelect:!0}),zt=$.children.indexOf(xt);$.setElementZIndex(rt.id,zt)}),D.history.startTransaction()},onDragEnd:()=>{D.history.endTransaction()},onTransformStart:()=>{D.history.startTransaction(),Pt(null)},boundBoxFunc:(ct,_t)=>{const xt=Math.abs(_t.width)<1||Math.abs(_t.height)<1,rt=Math.abs(ct.width)<1||Math.abs(ct.height)<1;return xt&&!rt?ct:_t},onTransform:ct=>{var _t,xt;const rt=He.current.nodes(),zt=rt[rt.length-1];if(ct.target!==zt)return;const gt=(_t=He.current)===null||_t===void 0?void 0:_t.__getNodeRect(),Ft=(xt=He.current)===null||xt===void 0?void 0:xt.getActiveAnchor();qt({anchor:Ft,x:gt.x,y:gt.y,rotation:gt.rotation,width:gt.width,height:gt.height})},onTransformEnd:ct=>{qt({}),D.history.endTransaction()},visible:!D.isPlaying}),Ht&&Ht.map(({points:ct,distance:_t,box1:xt,box2:rt},zt)=>n.default.createElement(o.Group,{name:"distances-container",hideInExport:!0,key:zt,listening:!1},n.default.createElement(o.Rect,Object.assign({},xt,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Rect,Object.assign({},rt,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Line,{points:[ct[0].x,ct[0].y,ct[1].x,ct[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Line,{points:[ct[1].x,ct[1].y,ct[2].x,ct[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Label,{x:(ct[0].x+ct[1].x)/2,y:(ct[0].y+ct[1].y)/2,offsetY:-10,scaleX:1/D.scale,scaleY:1/D.scale},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"down"}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:5,text:(0,E.pxToUnitString)({unit:D.unit,dpi:D.dpi,px:_t})})))),$._rendering&&n.default.createElement(o.Group,null,n.default.createElement(o.Rect,{width:Me,height:ze,fill:"rgba(255,255,255,0.9)"}),n.default.createElement(o.Text,{text:"Rendering...",fontSize:60,width:Me,height:ze,align:"center",verticalAlign:"middle"})),Gt&&n.default.createElement(Gt,{components:me,store:D,page:$,stageRef:Qe}),bt&&n.default.createElement(S.Html,null,n.default.createElement(bt,Object.assign({components:me,store:D},Ie.props)))),n.default.createElement(B,Object.assign({},It,{store:D,tagFill:Te,textFill:he})),n.default.createElement(N,{selection:St,fill:Pe,stroke:ve,strokeWidth:it}),(0,f.isCreditVisible)()&&n.default.createElement(o.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:Q-170,y:ee-18,onMouseEnter:ct=>{ct.target.getStage().container().style.cursor="pointer"},onMouseLeave:ct=>{ct.target.getStage().container().style.cursor=""},onTouchStart:ct=>{ct.cancelBubble=!0},onMouseDown:ct=>{ct.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),n.default.createElement(o.Group,{name:"line-guides"}))),tt&&mt&&n.default.createElement(mt,{store:D,page:$,xPadding:pt,yPadding:yt}))})}(yf)),yf}var ep={},z4;function fk(){return z4||(z4=1,function(e){var r=ep&&ep.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.TopRules=void 0,e.LeftRules=function(){return t.default.createElement("div",null,t.default.createElement("h1",null,"Top rules"))};const t=r(ai()),n=Dh(),a=Rm(),i=Us,o=r_(),s=(0,o.styled)("div",t.default.forwardRef)`
|
|
386
|
-
position: absolute;
|
|
387
|
-
top: 0;
|
|
388
|
-
left: 0;
|
|
389
|
-
pointer-events: none;
|
|
390
|
-
`,u=(0,o.styled)("div",t.default.forwardRef)`
|
|
391
|
-
height: 14px;
|
|
392
|
-
position: sticky;
|
|
393
|
-
font-size: 8px;
|
|
394
|
-
line-height: 14px;
|
|
395
|
-
top: 0;
|
|
396
|
-
left: 0;
|
|
397
|
-
color: grey;
|
|
398
|
-
border-bottom: 1px solid grey;
|
|
399
|
-
background-color: #e8e8e8;
|
|
400
|
-
overflow: hidden;
|
|
401
|
-
`,c=(0,o.styled)("div",t.default.forwardRef)`
|
|
402
|
-
left: 0;
|
|
403
|
-
width: 14px;
|
|
404
|
-
position: sticky;
|
|
405
|
-
font-size: 8px;
|
|
406
|
-
line-height: 14px;
|
|
407
|
-
color: grey;
|
|
408
|
-
border-right: 1px solid grey;
|
|
409
|
-
background-color: #e8e8e8;
|
|
410
|
-
overflow: hidden;
|
|
411
|
-
`,h=(0,o.styled)("div",t.default.forwardRef)`
|
|
412
|
-
position: absolute;
|
|
413
|
-
border-left: 1px solid grey;
|
|
414
|
-
padding-left: 2px;
|
|
415
|
-
`,p=(0,o.styled)("div",t.default.forwardRef)`
|
|
416
|
-
position: absolute;
|
|
417
|
-
left: 14px;
|
|
418
|
-
border-left: 1px solid grey;
|
|
419
|
-
padding-left: 2px;
|
|
420
|
-
transform: rotate(90deg);
|
|
421
|
-
transform-origin: left top;
|
|
422
|
-
overflow: hidden;
|
|
423
|
-
`,v=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4];e.TopRules=(0,i.observer)(({store:f,width:_,height:E})=>{const w=t.default.useRef(null);if(!f.activePage)return null;const x=f.activePage,y=(f.bleedVisible&&x.bleed,x.computedWidth*f.scale),g=x.computedHeight*f.scale,S=(_-y)/2,b=(R=O=>(0,a.unitToPx)({unitVal:O,dpi:f.dpi,unit:f.unit})*f.scale,v.find(O=>R(O)>30)||1e4);var R;const L=(0,a.unitToPx)({unitVal:b,dpi:f.dpi,unit:f.unit})*f.scale,T=Math.round(y/L)+1,F=Math.round(g/L)+1,I=(0,n.getTotalClientRect)(f.selectedShapes);return t.default.createElement(s,{ref:w,className:"polotno-rulers"},t.default.createElement(u,{style:{width:_+"px"},className:"polotno-x-ruler"},[...Array(T)].map((O,C)=>t.default.createElement(h,{key:C,style:{left:S+C*L+"px",width:L+"px"}},f.unit==="px"||b>=1?Math.round(b*C):(b*C).toFixed(1))),!!f.selectedShapes.length&&t.default.createElement("div",{style:{position:"absolute",left:S+I.x*f.scale+"px",height:"14px",width:I.width*f.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),f.pages.map((O,C)=>{var A;const j=O.computedHeight*f.scale,N=(E-j)/2;return t.default.createElement(c,{key:O.id,style:{height:E+"px"},className:"polotno-y-ruler"},[...Array(F)].map((B,W)=>t.default.createElement(p,{key:W,style:{top:N+W*L-14+"px",width:L+"px"}},f.unit==="px"||b>=1?Math.round(b*W):(b*W).toFixed(1))),((A=f.selectedShapes[0])===null||A===void 0?void 0:A.page)===O&&t.default.createElement("div",{style:{position:"absolute",top:N+I.y*f.scale-14+"px",width:"14px",height:I.height*f.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))})}(ep)),ep}var tp={},U4;function hk(){return U4||(U4=1,function(e){var r=tp&&tp.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.AudioElement=void 0;const t=r(ai()),n=Us,a=vs;e.AudioElement=(0,n.observer)(({audio:i,store:o})=>{const[s,u]=function(c){const[h,p]=t.default.useState(null),[v,f]=t.default.useState("loading");return t.default.useEffect(()=>{const _=new Audio(c),E=()=>{f("loaded"),p(_)},w=()=>{f("failed"),p(null)};return _.addEventListener("canplay",E),_.addEventListener("error",w),()=>{_.removeEventListener("canplay",E),_.removeEventListener("error",w)}},[c]),[h,v]}(i.src);return t.default.useEffect(()=>{s&&o.history.ignore(()=>{i.set({duration:1e3*s.duration})})},[s,i,o.history]),t.default.useEffect(()=>{if(!s)return;const c=()=>{s.currentTime=i.startTime*i.duration/1e3},h=()=>{const v=i.endTime*i.duration/1e3;s.currentTime>=v&&(s.pause(),s.currentTime=i.startTime*i.duration/1e3)};s.addEventListener("ended",c),s.addEventListener("timeupdate",h);const p=(0,a.autorun)(()=>{const v=o.animatedElementsIds;if(v.length&&!v.includes(i.id))return;const f=o.currentTime-i.delay,_=i.duration*(i.endTime-i.startTime),E=f>=0&&f<_;if(!o.isPlaying||o.animatedElementsIds.length!==0||!E)return void s.pause();s.volume=i.volume,s.paused&&s.play();const w=f%_/1e3+i.startTime*i.duration/1e3,x=s.currentTime;Math.abs(x-w)>.5&&w!==x&&(s.currentTime=w)});return()=>{s.pause(),s.removeEventListener("ended",c),s.removeEventListener("timeupdate",h),p()}},[o.isPlaying,i.startTime,i.endTime,i.volume,s]),null})}(tp)),tp}var Jv={},e2={},H4;function dk(){return H4||(H4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isClipboardEmpty=e.paste=e.cut=e.copy=void 0;const r=Nh(),t=Dh();let n={data:[],pageId:""};const a="polotno_clipboard",i=(s,u)=>{n={data:JSON.parse(JSON.stringify(s)),pageId:u};try{localStorage.setItem(a,JSON.stringify(s)),localStorage.setItem(a+"_page",u)}catch{}},o=()=>{try{const s=localStorage.getItem(a),u=localStorage.getItem(a+"_page");if(s)return{data:JSON.parse(s),pageId:u}}catch{}return n};e.copy=s=>{var u;s.selectedElements.length!==0&&i(s.selectedElements.map(c=>c.toJSON()),(u=s.activePage)===null||u===void 0?void 0:u.id)},e.cut=s=>{var u;i(s.selectedElements.map(h=>h.toJSON()),(u=s.activePage)===null||u===void 0?void 0:u.id);let c=s.selectedElements.filter(h=>h.removable).map(h=>h.id);s.deleteElements(c)},e.paste=s=>{s.history.transaction(()=>{var u,c;let h=0,p=0;const{data:v,pageId:f}=o();if(f===((u=s.activePage)===null||u===void 0?void 0:u.id))h=s.width/20,p=s.height/20;else{const E=[];(0,r.forEveryChild)({children:v},x=>{x.type!=="group"&&E.push(x)});const w=(0,t.getTotalClientRect)(E);w.maxX>s.width&&(h=-w.minX),w.maxY>s.height&&(p=-w.minY)}const _=[];(0,r.forEveryChild)({children:v},E=>{delete E.id,E.type!=="group"&&(E.x+=h,E.y+=p)}),v.forEach(E=>{var w;const x=(w=s.activePage)===null||w===void 0?void 0:w.addElement(E);x&&_.push(x.id)}),i(v,(c=s.activePage)===null||c===void 0?void 0:c.id),s.selectElements(_)})},e.isClipboardEmpty=()=>o().data.length===0}(e2)),e2}var G4;function pk(){return G4||(G4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.handleHotkey=function(t,n){var a,i,o,s;if(((a=document.activeElement)===null||a===void 0?void 0:a.tagName)==="INPUT"||((i=document.activeElement)===null||i===void 0?void 0:i.tagName)==="TEXTAREA"||((o=document.activeElement)===null||o===void 0?void 0:o.contentEditable)==="true")return;const u=n.selectedElements.filter(p=>p.removable).map(p=>p.id);t.keyCode!==46&&t.keyCode!==8||n.deleteElements(u);const c=t.ctrlKey||t.metaKey,h=t.shiftKey;if(!c||h||t.key.toLowerCase()!=="z"&&t.key.toLowerCase()!=="y"||(t.preventDefault(),n.history.undo()),c&&h&&(t.key.toLowerCase()==="z"||t.key.toLowerCase()==="y")&&(t.preventDefault(),n.history.redo()),c&&t.code==="KeyA"){t.preventDefault();const p=(s=n.activePage)===null||s===void 0?void 0:s.children.filter(f=>f.selectable),v=(p==null?void 0:p.map(f=>f.id))||[];n.selectElements(v)}c&&t.code==="KeyC"&&(t.preventDefault(),(0,r.copy)(n)),c&&t.code==="KeyX"&&(t.preventDefault(),(0,r.cut)(n)),c&&t.code==="KeyV"&&(t.preventDefault(),(0,r.paste)(n)),t.code==="ArrowDown"&&(t.preventDefault(),n.selectedShapes.forEach(p=>{p.draggable&&p.set({y:p.y+1})})),t.code==="ArrowUp"&&(t.preventDefault(),n.selectedShapes.forEach(p=>{p.draggable&&p.set({y:p.y-1})})),t.code==="ArrowLeft"&&(t.preventDefault(),n.selectedShapes.forEach(p=>{p.draggable&&p.set({x:p.x-1})})),t.code==="ArrowRight"&&(t.preventDefault(),n.selectedShapes.forEach(p=>{p.draggable&&p.set({x:p.x+1})}))};const r=dk()}(Jv)),Jv}var t2={},V4;function gk(){return V4||(V4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t=e.getTranslations=e.setTranslations=void 0;const r=vs,t=(0,r.observable)({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",filters:"Filters",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",copyStyle:"Copy style",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",strength:"Strength",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width",colorPicker:{solid:"Solid",linear:"Linear",angle:"Angle"},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",generatedResult:"Generated result",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:"Add file",uploadTip:"Upload your assets",background:"Background",resize:"Resize",layers:"Layers",animate:"Animate",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"},contextMenu:{duplicate:"Duplicate",remove:"Remove",lock:"Lock",unlock:"Unlock",copy:"Copy",paste:"Paste",copyStyle:"Copy style",moveUp:"Move up",moveDown:"Move down",moveBack:"Move back",moveForward:"Move forward"}}),n=s=>s&&typeof s=="object";function a(s,u){Object.keys(u).forEach(c=>{const h=s[c],p=u[c];n(p)&&n(h)?a(h,p):s[c]=p})}function i(s,u,c=""){Object.keys(u).forEach(h=>{const p=u[h],v=c?`${c}.${h}`:h;n(p)?n(s[h])?i(s[h],p,v):console.warn(`Missing nested translation object at '${v}'`):s[h]===void 0&&console.warn(`Missing translation '${v}'`)})}e.setTranslations=(0,r.action)((s,{validate:u=!1}={})=>{u&&i(s,t),a(t,s)}),e.getTranslations=()=>(0,r.toJS)(t);const o={};e.t=s=>{const u=function(p,v){var f,_=v.split("."),E=p;for(f=0;f<_.length;++f){if(E[_[f]]==null)return;E=E[_[f]]}return E}(t,s);if(u!==void 0)return u;o[s]||(o[s]=!0,console.warn(`Missing translation '${s}'`));const c=s.split("."),h=c[c.length-1]||" ";return h.charAt(0).toUpperCase()+h.slice(1)}}(t2)),t2}var W4;function vk(){return W4||(W4=1,function(e){var r=Kh&&Kh.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceCanvas=void 0;const t=r(ai()),n=Us,a=r(ck()),i=fk(),o=hk(),s=pk(),u=gk(),c=({store:v})=>t.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},t.default.createElement("p",null,(0,u.t)("workspace.noPages")),t.default.createElement("button",{onClick:()=>{v.addPage()}},(0,u.t)("workspace.addPage"))),h=({width:v,height:f,xPadding:_,yPadding:E,backgroundColor:w})=>t.default.createElement("div",{style:{width:v+"px",height:f+"px",backgroundColor:w,paddingLeft:_+"px",paddingRight:_+"px",paddingTop:E+"px",paddingBottom:E+"px"}},t.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}})),p=[4,6];e.WorkspaceCanvas=(0,n.observer)(({store:v,pageControlsEnabled:f,backgroundColor:_,pageBorderColor:E,activePageBorderColor:w,bleedColor:x,snapGuideStroke:y,snapGuideStrokeWidth:g,snapGuideDash:S,selectionRectFill:b,selectionRectStroke:R,selectionRectStrokeWidth:L,transformLabelFill:T,transformLabelTextFill:F,components:I,onKeyDown:O,paddingX:C,paddingY:A,altCloneEnabled:j=!0,visiblePagesOffset:N,renderOnlyActivePage:B})=>{var W;const Y=C??20,Z=A??55,[V,H]=t.default.useState({width:100,height:100}),U=t.default.useRef(V),D=t.default.useRef(null),$=t.default.useRef(null),Q=v.bleedVisible?Math.max(0,...v.pages.map(Oe=>Oe.bleed)):0,ee=Math.max(...v.pages.map(Oe=>Oe.computedWidth)),te=Math.max(...v.pages.map(Oe=>Oe.computedHeight)),ae=((W=v.activePage)===null||W===void 0?void 0:W.computedHeight)||0,se=ee+2*Q,ce=(B?ae:te)+2*Q,me=async({skipTimeout:Oe}={skipTimeout:!1})=>{if(Oe||await new Promise(tt=>setTimeout(tt,50)),D.current===null)return;const Me=D.current.getBoundingClientRect();Me.width!==0&&Me.height!==0||(console.warn(`Polotno warning: <Workspace /> component can not automatically detect its size.
|
|
424
|
-
Width or height of parent elements is equal 0.
|
|
425
|
-
Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
|
|
426
|
-
For simpler debugging here is the log of the parent element:`),console.log(D.current));const ze=$.current.clientWidth||Me.width,pt={width:ze,height:Me.height};(U.current.width!==pt.width||U.current.height!==pt.height)&&(H(pt),U.current=pt);const yt=(ze-2*Y)/se,He=v.pages.length>1?3.1:2,Qe=(Me.height-Z*He)/ce,Ze=v.pages.length?Math.max(Math.min(yt,Qe),.01):1;v.scaleToFit!==Ze&&(v.setScale(Ze),v._setScaleToFit(Ze))};t.default.useLayoutEffect(()=>{me({skipTimeout:!0})},[]),t.default.useEffect(()=>{me()},[se,ce]),t.default.useEffect(()=>{v.__()},[]),t.default.useEffect(()=>{const Oe=D.current;if(window.ResizeObserver){const Me=new ResizeObserver(()=>{me({skipTimeout:!0})});return Me.observe(Oe),()=>Me.unobserve(Oe)}{const Me=setInterval(()=>{me({skipTimeout:!0})},100);return()=>clearInterval(Me)}},[se,ce]);const _e=Math.max(Y,(V.width-se*v.scale)/2),Le=B?1:v.pages.length,Re=ce*v.scale*Le,Pe=Math.max(Z,(V.height-Re)/Le/2);t.default.useEffect(()=>{const Oe=Me=>{(O||s.handleHotkey)(Me,v)};return window.addEventListener("keydown",Oe),()=>window.removeEventListener("keydown",Oe)},[]),t.default.useEffect(()=>{var Oe;const Me=ze=>{if(ze.ctrlKey||ze.metaKey){ze.preventDefault();const Qe=Math.max(5,v.scaleToFit),Ze=Math.min(.1,v.scaleToFit),tt=.03,Ht=(pt=ze.deltaY<0?v.scale*(1+tt):v.scale/(1+tt),yt=Ze,He=Qe,Math.max(yt,Math.min(He,pt)));v.setScale(Ht)}else var pt,yt,He};return(Oe=$.current)===null||Oe===void 0||Oe.addEventListener("wheel",Me),()=>{var ze;return(ze=$.current)===null||ze===void 0?void 0:ze.removeEventListener("wheel",Me)}},[]);const ve=t.default.useRef(!1);((Oe,Me,ze,pt,yt,He)=>{const Qe=t.default.useRef({width:Me,height:ze}),Ze=t.default.useRef({top:0,left:0}),tt=t.default.useRef(!1),Ht=t.default.useRef(yt.pages.length);tt.current=Ht.current!==yt.pages.length,Ht.current=yt.pages.length,t.default.useEffect(()=>{const Pt=Oe.current,It=qt=>{Ze.current={top:Pt.scrollTop,left:Pt.scrollLeft}};return Pt.addEventListener("scroll",It),()=>{Pt.removeEventListener("scroll",It)}},[]),t.default.useLayoutEffect(()=>{if(!Oe.current||tt.current)return;const Pt=Oe.current,It=(Ze.current.left+Pt.offsetWidth/2)/Qe.current.width,qt=(Ze.current.top+Pt.offsetHeight/2)/Qe.current.height;He.current=!0,Pt.scrollLeft=It*Me-Pt.offsetWidth/2,Pt.scrollTop=qt*ze-Pt.offsetHeight/2,Qe.current={width:Me,height:ze}},[pt,Me,ze])})($,se*v.scale+2*_e,ce*v.scale+2*Pe,v.scale,v,ve);const{handleScroll:it}=((Oe,Me,ze,pt,yt,He)=>{const Qe=t.default.useRef(!1),Ze=t.default.useRef(null),tt=t.default.useRef(!1);t.default.useEffect(()=>{const Pt=Oe.current,It=()=>{yt.current};return Pt.addEventListener("scroll",It),()=>{Pt.removeEventListener("scroll",It)}},[]);const Ht=ze.pages.indexOf(ze.activePage);return t.default.useLayoutEffect(()=>{if(He||!ze.activePage||!Oe.current||Qe.current)return;const Pt=Oe.current,It=ze.pages.indexOf(ze.activePage)*Me;let qt=()=>{};return(Math.abs(It-Pt.scrollTop)>.5*Me||tt.current)&&(tt.current=!0,qt=(({element:Ie,scrollTop:ke=0,duration:ut=300,onFinish:Nt=()=>{}})=>{const Ct=Ie.scrollTop,St=ke-Ct;let Jt=0,nr=!1;if(ut===0)return Ie.scrollTop=ke,()=>{};const Tt=()=>{if(nr)return;Jt+=20;const Rr=Xt(Jt,Ct,St,ut);Ie.scrollTop=Rr,Jt<ut?setTimeout(Tt,20):Nt()},Xt=(Rr,Je,mt,Gt)=>(Rr/=Gt/2)<1?mt/2*Rr*Rr+Je:-mt/2*(--Rr*(Rr-2)-1)+Je;return Tt(),()=>{nr=!0}})({element:Pt,scrollTop:It,onFinish:()=>{tt.current=!1},duration:ze.isPlaying?0:300})),qt},[ze.activePage,Ht,ze.isPlaying,He]),{handleScroll:Pt=>{if(He||tt.current)return;Qe.current=!0,clearTimeout(Ze.current),Ze.current=setTimeout(()=>{Qe.current=!1},300);const It=Pt.currentTarget.childNodes[0].offsetHeight,qt=Pt.currentTarget.scrollTop,Ie=Math.floor((qt+pt.height/3)/It),ke=ze.pages[Ie];ke&&ze.activePage!==ke&&ke.select()}}})($,ce*v.scale+2*Pe,v,V,ve,B),Se=V.width>=se*v.scale+2*_e,be=_||"rgba(232, 232, 232, 0.9)",Ae=v.pages.indexOf(v.activePage),Te=(I==null?void 0:I.NoPages)||c,he=N??Math.min(3,Math.max(1,Math.ceil(V.height/2/(ce*v.scale))));return t.default.createElement("div",{ref:D,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:be,overflow:"hidden"},tabIndex:0,className:"polotno-workspace-container"},t.default.createElement("div",{ref:$,onScroll:it,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:Se?"hidden":"auto"},className:"polotno-workspace-inner"},v.pages.map((Oe,Me)=>{const ze=Oe===v.activePage;if(B&&!ze&&!Oe._exportingOrRendering&&!Oe._forceMount)return null;if(!(Math.abs(Me-Ae)<=he||Oe._exportingOrRendering||Oe._forceMount))return t.default.createElement(h,{key:Oe.id,width:se*v.scale+2*_e,height:ce*v.scale+2*Pe,backgroundColor:be,xPadding:_e,yPadding:Pe});const pt=t.default.createElement(a.default,{key:Oe.id,page:Oe,xPadding:_e,yPadding:Pe,width:se*v.scale+2*_e,height:ce*v.scale+2*Pe,store:v,pageControlsEnabled:f,backColor:be,pageBorderColor:E||"lightgrey",activePageBorderColor:w||"rgb(0, 161, 255)",altCloneEnabled:j,bleedColor:x||"rgba(255, 0, 0, 0.1)",selectionRectFill:b,selectionRectStroke:R,selectionRectStrokeWidth:L,snapGuideStroke:y||"rgb(0, 161, 255)",snapGuideStrokeWidth:g||1,snapGuideDash:S||p,transformLabelFill:T,transformLabelTextFill:F,components:I,viewportSize:V});return(Oe._exportingOrRendering||Oe._forceMount)&&!ze&&B?t.default.createElement("div",{style:{display:"none"},key:Oe.id},pt):pt}),v.rulesVisible&&t.default.createElement(i.TopRules,{store:v,xPadding:_e,yPadding:Pe,width:se*v.scale+2*_e,height:ce*v.scale+2*Pe}),v.pages.length===0&&t.default.createElement(Te,{store:v}),v.audios.map(Oe=>t.default.createElement(o.AudioElement,{key:Oe.id,audio:Oe,store:v}))))}),e.default=e.WorkspaceCanvas}(Kh)),Kh}var mk=vk(),yk=Mm(),bk=If(),ap=gc(),r2=jf(),wk=Ih();const _k="modulepreload",Sk=function(e,r){return new URL(e,r).href},$4={},A2=function(r,t,n){let a=Promise.resolve();if(t&&t.length>0){let o=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const s=document.getElementsByTagName("link"),u=document.querySelector("meta[property=csp-nonce]"),c=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));a=o(t.map(h=>{if(h=Sk(h,n),h in $4)return;$4[h]=!0;const p=h.endsWith(".css"),v=p?'[rel="stylesheet"]':"";if(!!n)for(let E=s.length-1;E>=0;E--){const w=s[E];if(w.href===h&&(!p||w.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${v}`))return;const _=document.createElement("link");if(_.rel=p?"stylesheet":_k,p||(_.as="script"),_.crossOrigin="",_.href=h,c&&_.setAttribute("nonce",c),document.head.appendChild(_),p)return new Promise((E,w)=>{_.addEventListener("load",E),_.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${h}`)))})}))}function i(o){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o}return a.then(o=>{for(const s of o||[])s.status==="rejected"&&i(s.reason);return r().catch(i)})};function kn(e){"@babel/helpers - typeof";return kn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},kn(e)}var Po=Uint8Array,Bs=Uint16Array,jm=Int32Array,c0=new Po([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),f0=new Po([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),C2=new Po([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d_=function(e,r){for(var t=new Bs(31),n=0;n<31;++n)t[n]=r+=1<<e[n-1];for(var a=new jm(t[30]),n=1;n<30;++n)for(var i=t[n];i<t[n+1];++i)a[i]=i-t[n]<<5|n;return{b:t,r:a}},p_=d_(c0,2),g_=p_.b,k2=p_.r;g_[28]=258,k2[258]=28;var v_=d_(f0,0),xk=v_.b,Y4=v_.r,L2=new Bs(32768);for(var ni=0;ni<32768;++ni){var qc=(ni&43690)>>1|(ni&21845)<<1;qc=(qc&52428)>>2|(qc&13107)<<2,qc=(qc&61680)>>4|(qc&3855)<<4,L2[ni]=((qc&65280)>>8|(qc&255)<<8)>>1}var Ru=function(e,r,t){for(var n=e.length,a=0,i=new Bs(r);a<n;++a)e[a]&&++i[e[a]-1];var o=new Bs(r);for(a=1;a<r;++a)o[a]=o[a-1]+i[a-1]<<1;var s;if(t){s=new Bs(1<<r);var u=15-r;for(a=0;a<n;++a)if(e[a])for(var c=a<<4|e[a],h=r-e[a],p=o[e[a]-1]++<<h,v=p|(1<<h)-1;p<=v;++p)s[L2[p]>>u]=c}else for(s=new Bs(n),a=0;a<n;++a)e[a]&&(s[a]=L2[o[e[a]-1]++]>>15-e[a]);return s},Xc=new Po(288);for(var ni=0;ni<144;++ni)Xc[ni]=8;for(var ni=144;ni<256;++ni)Xc[ni]=9;for(var ni=256;ni<280;++ni)Xc[ni]=7;for(var ni=280;ni<288;++ni)Xc[ni]=8;var mp=new Po(32);for(var ni=0;ni<32;++ni)mp[ni]=5;var Ek=Ru(Xc,9,0),Pk=Ru(Xc,9,1),Ok=Ru(mp,5,0),Ak=Ru(mp,5,1),n2=function(e){for(var r=e[0],t=1;t<e.length;++t)e[t]>r&&(r=e[t]);return r},Ul=function(e,r,t){var n=r/8|0;return(e[n]|e[n+1]<<8)>>(r&7)&t},i2=function(e,r){var t=r/8|0;return(e[t]|e[t+1]<<8|e[t+2]<<16)>>(r&7)},Fm=function(e){return(e+7)/8|0},m_=function(e,r,t){return(t==null||t>e.length)&&(t=e.length),new Po(e.subarray(r,t))},Ck=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Vl=function(e,r,t){var n=new Error(r||Ck[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,Vl),!t)throw n;return n},kk=function(e,r,t,n){var a=e.length,i=0;if(!a||r.f&&!r.l)return t||new Po(0);var o=!t,s=o||r.i!=2,u=r.i;o&&(t=new Po(a*3));var c=function(me){var _e=t.length;if(me>_e){var Le=new Po(Math.max(_e*2,me));Le.set(t),t=Le}},h=r.f||0,p=r.p||0,v=r.b||0,f=r.l,_=r.d,E=r.m,w=r.n,x=a*8;do{if(!f){h=Ul(e,p,1);var y=Ul(e,p+1,3);if(p+=3,y)if(y==1)f=Pk,_=Ak,E=9,w=5;else if(y==2){var R=Ul(e,p,31)+257,L=Ul(e,p+10,15)+4,T=R+Ul(e,p+5,31)+1;p+=14;for(var F=new Po(T),I=new Po(19),O=0;O<L;++O)I[C2[O]]=Ul(e,p+O*3,7);p+=L*3;for(var C=n2(I),A=(1<<C)-1,j=Ru(I,C,1),O=0;O<T;){var N=j[Ul(e,p,A)];p+=N&15;var g=N>>4;if(g<16)F[O++]=g;else{var B=0,W=0;for(g==16?(W=3+Ul(e,p,3),p+=2,B=F[O-1]):g==17?(W=3+Ul(e,p,7),p+=3):g==18&&(W=11+Ul(e,p,127),p+=7);W--;)F[O++]=B}}var Y=F.subarray(0,R),Z=F.subarray(R);E=n2(Y),w=n2(Z),f=Ru(Y,E,1),_=Ru(Z,w,1)}else Vl(1);else{var g=Fm(p)+4,S=e[g-4]|e[g-3]<<8,b=g+S;if(b>a){u&&Vl(0);break}s&&c(v+S),t.set(e.subarray(g,b),v),r.b=v+=S,r.p=p=b*8,r.f=h;continue}if(p>x){u&&Vl(0);break}}s&&c(v+131072);for(var V=(1<<E)-1,H=(1<<w)-1,U=p;;U=p){var B=f[i2(e,p)&V],D=B>>4;if(p+=B&15,p>x){u&&Vl(0);break}if(B||Vl(2),D<256)t[v++]=D;else if(D==256){U=p,f=null;break}else{var $=D-254;if(D>264){var O=D-257,Q=c0[O];$=Ul(e,p,(1<<Q)-1)+g_[O],p+=Q}var ee=_[i2(e,p)&H],te=ee>>4;ee||Vl(3),p+=ee&15;var Z=xk[te];if(te>3){var Q=f0[te];Z+=i2(e,p)&(1<<Q)-1,p+=Q}if(p>x){u&&Vl(0);break}s&&c(v+131072);var ae=v+$;if(v<Z){var se=i-Z,ce=Math.min(Z,ae);for(se+v<0&&Vl(3);v<ce;++v)t[v]=n[se+v]}for(;v<ae;++v)t[v]=t[v-Z]}}r.l=f,r.p=U,r.b=v,r.f=h,f&&(h=1,r.m=E,r.d=_,r.n=w)}while(!h);return v!=t.length&&o?m_(t,0,v):t.subarray(0,v)},lc=function(e,r,t){t<<=r&7;var n=r/8|0;e[n]|=t,e[n+1]|=t>>8},rp=function(e,r,t){t<<=r&7;var n=r/8|0;e[n]|=t,e[n+1]|=t>>8,e[n+2]|=t>>16},a2=function(e,r){for(var t=[],n=0;n<e.length;++n)e[n]&&t.push({s:n,f:e[n]});var a=t.length,i=t.slice();if(!a)return{t:b_,l:0};if(a==1){var o=new Po(t[0].s+1);return o[t[0].s]=1,{t:o,l:1}}t.sort(function(b,R){return b.f-R.f}),t.push({s:-1,f:25001});var s=t[0],u=t[1],c=0,h=1,p=2;for(t[0]={s:-1,f:s.f+u.f,l:s,r:u};h!=a-1;)s=t[t[c].f<t[p].f?c++:p++],u=t[c!=h&&t[c].f<t[p].f?c++:p++],t[h++]={s:-1,f:s.f+u.f,l:s,r:u};for(var v=i[0].s,n=1;n<a;++n)i[n].s>v&&(v=i[n].s);var f=new Bs(v+1),_=N2(t[h-1],f,0);if(_>r){var n=0,E=0,w=_-r,x=1<<w;for(i.sort(function(R,L){return f[L.s]-f[R.s]||R.f-L.f});n<a;++n){var y=i[n].s;if(f[y]>r)E+=x-(1<<_-f[y]),f[y]=r;else break}for(E>>=w;E>0;){var g=i[n].s;f[g]<r?E-=1<<r-f[g]++-1:++n}for(;n>=0&&E;--n){var S=i[n].s;f[S]==r&&(--f[S],++E)}_=r}return{t:new Po(f),l:_}},N2=function(e,r,t){return e.s==-1?Math.max(N2(e.l,r,t+1),N2(e.r,r,t+1)):r[e.s]=t},X4=function(e){for(var r=e.length;r&&!e[--r];);for(var t=new Bs(++r),n=0,a=e[0],i=1,o=function(u){t[n++]=u},s=1;s<=r;++s)if(e[s]==a&&s!=r)++i;else{if(!a&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(a),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(a);i=1,a=e[s]}return{c:t.subarray(0,n),n:r}},np=function(e,r){for(var t=0,n=0;n<r.length;++n)t+=e[n]*r[n];return t},y_=function(e,r,t){var n=t.length,a=Fm(r+2);e[a]=n&255,e[a+1]=n>>8,e[a+2]=e[a]^255,e[a+3]=e[a+1]^255;for(var i=0;i<n;++i)e[a+i+4]=t[i];return(a+4+n)*8},K4=function(e,r,t,n,a,i,o,s,u,c,h){lc(r,h++,t),++a[256];for(var p=a2(a,15),v=p.t,f=p.l,_=a2(i,15),E=_.t,w=_.l,x=X4(v),y=x.c,g=x.n,S=X4(E),b=S.c,R=S.n,L=new Bs(19),T=0;T<y.length;++T)++L[y[T]&31];for(var T=0;T<b.length;++T)++L[b[T]&31];for(var F=a2(L,7),I=F.t,O=F.l,C=19;C>4&&!I[C2[C-1]];--C);var A=c+5<<3,j=np(a,Xc)+np(i,mp)+o,N=np(a,v)+np(i,E)+o+14+3*C+np(L,I)+2*L[16]+3*L[17]+7*L[18];if(u>=0&&A<=j&&A<=N)return y_(r,h,e.subarray(u,u+c));var B,W,Y,Z;if(lc(r,h,1+(N<j)),h+=2,N<j){B=Ru(v,f,0),W=v,Y=Ru(E,w,0),Z=E;var V=Ru(I,O,0);lc(r,h,g-257),lc(r,h+5,R-1),lc(r,h+10,C-4),h+=14;for(var T=0;T<C;++T)lc(r,h+3*T,I[C2[T]]);h+=3*C;for(var H=[y,b],U=0;U<2;++U)for(var D=H[U],T=0;T<D.length;++T){var $=D[T]&31;lc(r,h,V[$]),h+=I[$],$>15&&(lc(r,h,D[T]>>5&127),h+=D[T]>>12)}}else B=Ek,W=Xc,Y=Ok,Z=mp;for(var T=0;T<s;++T){var Q=n[T];if(Q>255){var $=Q>>18&31;rp(r,h,B[$+257]),h+=W[$+257],$>7&&(lc(r,h,Q>>23&31),h+=c0[$]);var ee=Q&31;rp(r,h,Y[ee]),h+=Z[ee],ee>3&&(rp(r,h,Q>>5&8191),h+=f0[ee])}else rp(r,h,B[Q]),h+=W[Q]}return rp(r,h,B[256]),h+W[256]},Lk=new jm([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),b_=new Po(0),Nk=function(e,r,t,n,a,i){var o=i.z||e.length,s=new Po(n+o+5*(1+Math.ceil(o/7e3))+a),u=s.subarray(n,s.length-a),c=i.l,h=(i.r||0)&7;if(r){h&&(u[0]=i.r>>3);for(var p=Lk[r-1],v=p>>13,f=p&8191,_=(1<<t)-1,E=i.p||new Bs(32768),w=i.h||new Bs(_+1),x=Math.ceil(t/3),y=2*x,g=function(Re){return(e[Re]^e[Re+1]<<x^e[Re+2]<<y)&_},S=new jm(25e3),b=new Bs(288),R=new Bs(32),L=0,T=0,F=i.i||0,I=0,O=i.w||0,C=0;F+2<o;++F){var A=g(F),j=F&32767,N=w[A];if(E[j]=N,w[A]=j,O<=F){var B=o-F;if((L>7e3||I>24576)&&(B>423||!c)){h=K4(e,u,0,S,b,R,T,I,C,F-C,h),I=L=T=0,C=F;for(var W=0;W<286;++W)b[W]=0;for(var W=0;W<30;++W)R[W]=0}var Y=2,Z=0,V=f,H=j-N&32767;if(B>2&&A==g(F-H))for(var U=Math.min(v,B)-1,D=Math.min(32767,F),$=Math.min(258,B);H<=D&&--V&&j!=N;){if(e[F+Y]==e[F+Y-H]){for(var Q=0;Q<$&&e[F+Q]==e[F+Q-H];++Q);if(Q>Y){if(Y=Q,Z=H,Q>U)break;for(var ee=Math.min(H,Q-2),te=0,W=0;W<ee;++W){var ae=F-H+W&32767,se=E[ae],ce=ae-se&32767;ce>te&&(te=ce,N=ae)}}}j=N,N=E[j],H+=j-N&32767}if(Z){S[I++]=268435456|k2[Y]<<18|Y4[Z];var me=k2[Y]&31,_e=Y4[Z]&31;T+=c0[me]+f0[_e],++b[257+me],++R[_e],O=F+Y,++L}else S[I++]=e[F],++b[e[F]]}}for(F=Math.max(F,O);F<o;++F)S[I++]=e[F],++b[e[F]];h=K4(e,u,c,S,b,R,T,I,C,F-C,h),c||(i.r=h&7|u[h/8|0]<<3,h-=7,i.h=w,i.p=E,i.i=F,i.w=O)}else{for(var F=i.w||0;F<o+c;F+=65535){var Le=F+65535;Le>=o&&(u[h/8|0]=c,Le=o),h=y_(u,h+1,e.subarray(F,Le))}i.i=o}return m_(s,0,n+Fm(h)+a)},w_=function(){var e=1,r=0;return{p:function(t){for(var n=e,a=r,i=t.length|0,o=0;o!=i;){for(var s=Math.min(o+2655,i);o<s;++o)a+=n+=t[o];n=(n&65535)+15*(n>>16),a=(a&65535)+15*(a>>16)}e=n,r=a},d:function(){return e%=65521,r%=65521,(e&255)<<24|(e&65280)<<8|(r&255)<<8|r>>8}}},Tk=function(e,r,t,n,a){if(!a&&(a={l:1},r.dictionary)){var i=r.dictionary.subarray(-32768),o=new Po(i.length+e.length);o.set(i),o.set(e,i.length),e=o,a.w=i.length}return Nk(e,r.level==null?6:r.level,r.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+r.mem,t,n,a)},__=function(e,r,t){for(;t;++r)e[r]=t,t>>>=8},Rk=function(e,r){var t=r.level,n=t==0?0:t<6?1:t==9?3:2;if(e[0]=120,e[1]=n<<6|(r.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,r.dictionary){var a=w_();a.p(r.dictionary),__(e,2,a.d())}},Mk=function(e,r){return((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&Vl(6,"invalid zlib data"),(e[1]>>5&1)==1&&Vl(6,"invalid zlib data: "+(e[1]&32?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};function T2(e,r){r||(r={});var t=w_();t.p(e);var n=Tk(e,r,r.dictionary?6:2,4);return Rk(n,r),__(n,n.length-4,t.d()),n}function Ik(e,r){return kk(e.subarray(Mk(e),-4),{i:2},r,r)}var jk=typeof TextDecoder<"u"&&new TextDecoder,Fk=0;try{jk.decode(b_,{stream:!0}),Fk=1}catch{}var yr=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function o2(){yr.console&&typeof yr.console.log=="function"&&yr.console.log.apply(yr.console,arguments)}var Yn={log:o2,warn:function(e){yr.console&&(typeof yr.console.warn=="function"?yr.console.warn.apply(yr.console,arguments):o2.call(null,arguments))},error:function(e){yr.console&&(typeof yr.console.error=="function"?yr.console.error.apply(yr.console,arguments):o2(e))}};function s2(e,r,t){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){_f(n.response,r,t)},n.onerror=function(){Yn.error("could not download file")},n.send()}function Z4(e){var r=new XMLHttpRequest;r.open("HEAD",e,!1);try{r.send()}catch{}return r.status>=200&&r.status<=299}function f1(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(r)}}var cp,R2,_f=yr.saveAs||((typeof window>"u"?"undefined":kn(window))!=="object"||window!==yr?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(e,r,t){var n=yr.URL||yr.webkitURL,a=document.createElement("a");r=r||e.name||"download",a.download=r,a.rel="noopener",typeof e=="string"?(a.href=e,a.origin!==location.origin?Z4(a.href)?s2(e,r,t):f1(a,a.target="_blank"):f1(a)):(a.href=n.createObjectURL(e),setTimeout(function(){n.revokeObjectURL(a.href)},4e4),setTimeout(function(){f1(a)},0))}:"msSaveOrOpenBlob"in navigator?function(e,r,t){if(r=r||e.name||"download",typeof e=="string")if(Z4(e))s2(e,r,t);else{var n=document.createElement("a");n.href=e,n.target="_blank",setTimeout(function(){f1(n)})}else navigator.msSaveOrOpenBlob(function(a,i){return i===void 0?i={autoBom:!1}:kn(i)!=="object"&&(Yn.warn("Deprecated: Expected third argument to be a object"),i={autoBom:!i}),i.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}(e,t),r)}:function(e,r,t,n){if((n=n||open("","_blank"))&&(n.document.title=n.document.body.innerText="downloading..."),typeof e=="string")return s2(e,r,t);var a=e.type==="application/octet-stream",i=/constructor/i.test(yr.HTMLElement)||yr.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||a&&i)&&(typeof FileReader>"u"?"undefined":kn(FileReader))==="object"){var s=new FileReader;s.onloadend=function(){var h=s.result;h=o?h:h.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=h:location=h,n=null},s.readAsDataURL(e)}else{var u=yr.URL||yr.webkitURL,c=u.createObjectURL(e);n?n.location=c:location.href=c,n=null,setTimeout(function(){u.revokeObjectURL(c)},4e4)}});/**
|
|
427
|
-
* A class to parse color values
|
|
428
|
-
* @author Stoyan Stefanov <sstoo@gmail.com>
|
|
429
|
-
* {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
|
|
430
|
-
* @license Use it if you like it
|
|
431
|
-
*/function S_(e){var r;e=e||"",this.ok=!1,e.charAt(0)=="#"&&(e=e.substr(1,6)),e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[e=(e=e.replace(/ /g,"")).toLowerCase()]||e;for(var t=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(s){return[parseInt(s[1]),parseInt(s[2]),parseInt(s[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(s){return[parseInt(s[1],16),parseInt(s[2],16),parseInt(s[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(s){return[parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16),parseInt(s[3]+s[3],16)]}}],n=0;n<t.length;n++){var a=t[n].re,i=t[n].process,o=a.exec(e);o&&(r=i(o),this.r=r[0],this.g=r[1],this.b=r[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var s=this.r.toString(16),u=this.g.toString(16),c=this.b.toString(16);return s.length==1&&(s="0"+s),u.length==1&&(u="0"+u),c.length==1&&(c="0"+c),"#"+s+u+c}}/**
|
|
432
|
-
* @license
|
|
433
|
-
* Joseph Myers does not specify a particular license for his work.
|
|
434
|
-
*
|
|
435
|
-
* Author: Joseph Myers
|
|
436
|
-
* Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
|
|
437
|
-
*
|
|
438
|
-
* Modified by: Owen Leong
|
|
439
|
-
*/function l2(e,r){var t=e[0],n=e[1],a=e[2],i=e[3];t=_o(t,n,a,i,r[0],7,-680876936),i=_o(i,t,n,a,r[1],12,-389564586),a=_o(a,i,t,n,r[2],17,606105819),n=_o(n,a,i,t,r[3],22,-1044525330),t=_o(t,n,a,i,r[4],7,-176418897),i=_o(i,t,n,a,r[5],12,1200080426),a=_o(a,i,t,n,r[6],17,-1473231341),n=_o(n,a,i,t,r[7],22,-45705983),t=_o(t,n,a,i,r[8],7,1770035416),i=_o(i,t,n,a,r[9],12,-1958414417),a=_o(a,i,t,n,r[10],17,-42063),n=_o(n,a,i,t,r[11],22,-1990404162),t=_o(t,n,a,i,r[12],7,1804603682),i=_o(i,t,n,a,r[13],12,-40341101),a=_o(a,i,t,n,r[14],17,-1502002290),t=So(t,n=_o(n,a,i,t,r[15],22,1236535329),a,i,r[1],5,-165796510),i=So(i,t,n,a,r[6],9,-1069501632),a=So(a,i,t,n,r[11],14,643717713),n=So(n,a,i,t,r[0],20,-373897302),t=So(t,n,a,i,r[5],5,-701558691),i=So(i,t,n,a,r[10],9,38016083),a=So(a,i,t,n,r[15],14,-660478335),n=So(n,a,i,t,r[4],20,-405537848),t=So(t,n,a,i,r[9],5,568446438),i=So(i,t,n,a,r[14],9,-1019803690),a=So(a,i,t,n,r[3],14,-187363961),n=So(n,a,i,t,r[8],20,1163531501),t=So(t,n,a,i,r[13],5,-1444681467),i=So(i,t,n,a,r[2],9,-51403784),a=So(a,i,t,n,r[7],14,1735328473),t=xo(t,n=So(n,a,i,t,r[12],20,-1926607734),a,i,r[5],4,-378558),i=xo(i,t,n,a,r[8],11,-2022574463),a=xo(a,i,t,n,r[11],16,1839030562),n=xo(n,a,i,t,r[14],23,-35309556),t=xo(t,n,a,i,r[1],4,-1530992060),i=xo(i,t,n,a,r[4],11,1272893353),a=xo(a,i,t,n,r[7],16,-155497632),n=xo(n,a,i,t,r[10],23,-1094730640),t=xo(t,n,a,i,r[13],4,681279174),i=xo(i,t,n,a,r[0],11,-358537222),a=xo(a,i,t,n,r[3],16,-722521979),n=xo(n,a,i,t,r[6],23,76029189),t=xo(t,n,a,i,r[9],4,-640364487),i=xo(i,t,n,a,r[12],11,-421815835),a=xo(a,i,t,n,r[15],16,530742520),t=Eo(t,n=xo(n,a,i,t,r[2],23,-995338651),a,i,r[0],6,-198630844),i=Eo(i,t,n,a,r[7],10,1126891415),a=Eo(a,i,t,n,r[14],15,-1416354905),n=Eo(n,a,i,t,r[5],21,-57434055),t=Eo(t,n,a,i,r[12],6,1700485571),i=Eo(i,t,n,a,r[3],10,-1894986606),a=Eo(a,i,t,n,r[10],15,-1051523),n=Eo(n,a,i,t,r[1],21,-2054922799),t=Eo(t,n,a,i,r[8],6,1873313359),i=Eo(i,t,n,a,r[15],10,-30611744),a=Eo(a,i,t,n,r[6],15,-1560198380),n=Eo(n,a,i,t,r[13],21,1309151649),t=Eo(t,n,a,i,r[4],6,-145523070),i=Eo(i,t,n,a,r[11],10,-1120210379),a=Eo(a,i,t,n,r[2],15,718787259),n=Eo(n,a,i,t,r[9],21,-343485551),e[0]=Gc(t,e[0]),e[1]=Gc(n,e[1]),e[2]=Gc(a,e[2]),e[3]=Gc(i,e[3])}function h0(e,r,t,n,a,i){return r=Gc(Gc(r,e),Gc(n,i)),Gc(r<<a|r>>>32-a,t)}function _o(e,r,t,n,a,i,o){return h0(r&t|~r&n,e,r,a,i,o)}function So(e,r,t,n,a,i,o){return h0(r&n|t&~n,e,r,a,i,o)}function xo(e,r,t,n,a,i,o){return h0(r^t^n,e,r,a,i,o)}function Eo(e,r,t,n,a,i,o){return h0(t^(r|~n),e,r,a,i,o)}function x_(e){var r,t=e.length,n=[1732584193,-271733879,-1732584194,271733878];for(r=64;r<=e.length;r+=64)l2(n,Dk(e.substring(r-64,r)));e=e.substring(r-64);var a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(r=0;r<e.length;r++)a[r>>2]|=e.charCodeAt(r)<<(r%4<<3);if(a[r>>2]|=128<<(r%4<<3),r>55)for(l2(n,a),r=0;r<16;r++)a[r]=0;return a[14]=8*t,l2(n,a),n}function Dk(e){var r,t=[];for(r=0;r<64;r+=4)t[r>>2]=e.charCodeAt(r)+(e.charCodeAt(r+1)<<8)+(e.charCodeAt(r+2)<<16)+(e.charCodeAt(r+3)<<24);return t}cp=yr.atob.bind(yr),R2=yr.btoa.bind(yr);var Q4="0123456789abcdef".split("");function Bk(e){for(var r="",t=0;t<4;t++)r+=Q4[e>>8*t+4&15]+Q4[e>>8*t&15];return r}function qk(e){return String.fromCharCode((255&e)>>0,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function M2(e){return x_(e).map(qk).join("")}var zk=function(e){for(var r=0;r<e.length;r++)e[r]=Bk(e[r]);return e.join("")}(x_("hello"))!="5d41402abc4b2a76b9719d911017c592";function Gc(e,r){if(zk){var t=(65535&e)+(65535&r);return(e>>16)+(r>>16)+(t>>16)<<16|65535&t}return e+r&4294967295}/**
|
|
440
|
-
* @license
|
|
441
|
-
* FPDF is released under a permissive license: there is no usage restriction.
|
|
442
|
-
* You may embed it freely in your application (commercial or not), with or
|
|
443
|
-
* without modifications.
|
|
444
|
-
*
|
|
445
|
-
* Reference: http://www.fpdf.org/en/script/script37.php
|
|
446
|
-
*/function I2(e,r){var t,n,a,i;if(e!==t){for(var o=(a=e,i=1+(256/e.length>>0),new Array(i+1).join(a)),s=[],u=0;u<256;u++)s[u]=u;var c=0;for(u=0;u<256;u++){var h=s[u];c=(c+h+o.charCodeAt(u))%256,s[u]=s[c],s[c]=h}t=e,n=s}else s=n;var p=r.length,v=0,f=0,_="";for(u=0;u<p;u++)f=(f+(h=s[v=(v+1)%256]))%256,s[v]=s[f],s[f]=h,o=s[(s[v]+s[f])%256],_+=String.fromCharCode(r.charCodeAt(u)^o);return _}/**
|
|
447
|
-
* @license
|
|
448
|
-
* Licensed under the MIT License.
|
|
449
|
-
* http://opensource.org/licenses/mit-license
|
|
450
|
-
* Author: Owen Leong (@owenl131)
|
|
451
|
-
* Date: 15 Oct 2020
|
|
452
|
-
* References:
|
|
453
|
-
* https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
|
|
454
|
-
* https://github.com/foliojs/pdfkit/blob/master/lib/security.js
|
|
455
|
-
* http://www.fpdf.org/en/script/script37.php
|
|
456
|
-
*/var J4={print:4,modify:8,copy:16,"annot-forms":32};function lh(e,r,t,n){this.v=1,this.r=2;var a=192;e.forEach(function(s){if(J4.perm!==void 0)throw new Error("Invalid permission: "+s);a+=J4[s]}),this.padding="(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";var i=(r+this.padding).substr(0,32),o=(t+this.padding).substr(0,32);this.O=this.processOwnerPassword(i,o),this.P=-(1+(255^a)),this.encryptionKey=M2(i+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(n)).substr(0,5),this.U=I2(this.encryptionKey,this.padding)}function uh(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var r="",t=e.length,n=0;n<t;n++){var a=e.charCodeAt(n);a<33||a===35||a===37||a===40||a===41||a===47||a===60||a===62||a===91||a===93||a===123||a===125||a>126?r+="#"+("0"+a.toString(16)).slice(-2):r+=e[n]}return r}function ew(e){if(kn(e)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var r={};this.subscribe=function(t,n,a){if(a=a||!1,typeof t!="string"||typeof n!="function"||typeof a!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");r.hasOwnProperty(t)||(r[t]={});var i=Math.random().toString(35);return r[t][i]=[n,!!a],i},this.unsubscribe=function(t){for(var n in r)if(r[n][t])return delete r[n][t],Object.keys(r[n]).length===0&&delete r[n],!0;return!1},this.publish=function(t){if(r.hasOwnProperty(t)){var n=Array.prototype.slice.call(arguments,1),a=[];for(var i in r[t]){var o=r[t][i];try{o[0].apply(e,n)}catch(s){yr.console&&Yn.error("jsPDF PubSub Error",s.message,s)}o[1]&&a.push(i)}a.length&&a.forEach(this.unsubscribe)}},this.getTopics=function(){return r}}function B1(e){if(!(this instanceof B1))return new B1(e);var r="opacity,stroke-opacity".split(",");for(var t in e)e.hasOwnProperty(t)&&r.indexOf(t)>=0&&(this[t]=e[t]);this.id="",this.objectNumber=-1}function E_(e,r){this.gState=e,this.matrix=r,this.id="",this.objectNumber=-1}function Sf(e,r,t,n,a){if(!(this instanceof Sf))return new Sf(e,r,t,n,a);this.type=e==="axial"?2:3,this.coords=r,this.colors=t,E_.call(this,n,a)}function dh(e,r,t,n,a){if(!(this instanceof dh))return new dh(e,r,t,n,a);this.boundingBox=e,this.xStep=r,this.yStep=t,this.stream="",this.cloneIndex=0,E_.call(this,n,a)}function vr(e){var r,t=typeof arguments[0]=="string"?arguments[0]:"p",n=arguments[1],a=arguments[2],i=arguments[3],o=[],s=1,u=16,c="S",h=null;kn(e=e||{})==="object"&&(t=e.orientation,n=e.unit||n,a=e.format||a,i=e.compress||e.compressPdf||i,(h=e.encryption||null)!==null&&(h.userPassword=h.userPassword||"",h.ownerPassword=h.ownerPassword||"",h.userPermissions=h.userPermissions||[]),s=typeof e.userUnit=="number"?Math.abs(e.userUnit):1,e.precision!==void 0&&(r=e.precision),e.floatPrecision!==void 0&&(u=e.floatPrecision),c=e.defaultPathOperation||"S"),o=e.filters||(i===!0?["FlateEncode"]:o),n=n||"mm",t=(""+(t||"P")).toLowerCase();var p=e.putOnlyUsedFonts||!1,v={},f={internal:{},__private__:{}};f.__private__.PubSub=ew;var _="1.3",E=f.__private__.getPdfVersion=function(){return _};f.__private__.setPdfVersion=function(X){_=X};var w={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};f.__private__.getPageFormats=function(){return w};var x=f.__private__.getPageFormat=function(X){return w[X]};a=a||"a4";var y={COMPAT:"compat",ADVANCED:"advanced"},g=y.COMPAT;function S(){this.saveGraphicsState(),ve(new bt(tt,0,0,-tt,0,Ko()*tt).toString()+" cm"),this.setFontSize(this.getFontSize()/tt),c="n",g=y.ADVANCED}function b(){this.restoreGraphicsState(),c="S",g=y.COMPAT}var R=f.__private__.combineFontStyleAndFontWeight=function(X,fe){if(X=="bold"&&fe=="normal"||X=="bold"&&fe==400||X=="normal"&&fe=="italic"||X=="bold"&&fe=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return fe&&(X=fe==400||fe==="normal"?X==="italic"?"italic":"normal":fe!=700&&fe!=="bold"||X!=="normal"?(fe==700?"bold":fe)+""+X:"bold"),X};f.advancedAPI=function(X){var fe=g===y.COMPAT;return fe&&S.call(this),typeof X!="function"||(X(this),fe&&b.call(this)),this},f.compatAPI=function(X){var fe=g===y.ADVANCED;return fe&&b.call(this),typeof X!="function"||(X(this),fe&&S.call(this)),this},f.isAdvancedAPI=function(){return g===y.ADVANCED};var L,T=function(X){if(g!==y.ADVANCED)throw new Error(X+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},F=f.roundToPrecision=f.__private__.roundToPrecision=function(X,fe){var Ce=r||fe;if(isNaN(X)||isNaN(Ce))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return X.toFixed(Ce).replace(/0+$/,"")};L=f.hpf=f.__private__.hpf=typeof u=="number"?function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.hpf");return F(X,u)}:u==="smart"?function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.hpf");return F(X,X>-1&&X<1?16:5)}:function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.hpf");return F(X,16)};var I=f.f2=f.__private__.f2=function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.f2");return F(X,2)},O=f.__private__.f3=function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.f3");return F(X,3)},C=f.scale=f.__private__.scale=function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.scale");return g===y.COMPAT?X*tt:g===y.ADVANCED?X:void 0},A=function(X){return g===y.COMPAT?Ko()-X:g===y.ADVANCED?X:void 0},j=function(X){return C(A(X))};f.__private__.setPrecision=f.setPrecision=function(X){typeof parseInt(X,10)=="number"&&(r=parseInt(X,10))};var N,B="00000000000000000000000000000000",W=f.__private__.getFileId=function(){return B},Y=f.__private__.setFileId=function(X){return B=X!==void 0&&/^[a-fA-F0-9]{32}$/.test(X)?X.toUpperCase():B.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),h!==null&&(mn=new lh(h.userPermissions,h.userPassword,h.ownerPassword,B)),B};f.setFileId=function(X){return Y(X),this},f.getFileId=function(){return W()};var Z=f.__private__.convertDateToPDFDate=function(X){var fe=X.getTimezoneOffset(),Ce=fe<0?"+":"-",Fe=Math.floor(Math.abs(fe/60)),Ke=Math.abs(fe%60),ht=[Ce,$(Fe),"'",$(Ke),"'"].join("");return["D:",X.getFullYear(),$(X.getMonth()+1),$(X.getDate()),$(X.getHours()),$(X.getMinutes()),$(X.getSeconds()),ht].join("")},V=f.__private__.convertPDFDateToDate=function(X){var fe=parseInt(X.substr(2,4),10),Ce=parseInt(X.substr(6,2),10)-1,Fe=parseInt(X.substr(8,2),10),Ke=parseInt(X.substr(10,2),10),ht=parseInt(X.substr(12,2),10),Et=parseInt(X.substr(14,2),10);return new Date(fe,Ce,Fe,Ke,ht,Et,0)},H=f.__private__.setCreationDate=function(X){var fe;if(X===void 0&&(X=new Date),X instanceof Date)fe=Z(X);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(X))throw new Error("Invalid argument passed to jsPDF.setCreationDate");fe=X}return N=fe},U=f.__private__.getCreationDate=function(X){var fe=N;return X==="jsDate"&&(fe=V(N)),fe};f.setCreationDate=function(X){return H(X),this},f.getCreationDate=function(X){return U(X)};var D,$=f.__private__.padd2=function(X){return("0"+parseInt(X)).slice(-2)},Q=f.__private__.padd2Hex=function(X){return("00"+(X=X.toString())).substr(X.length)},ee=0,te=[],ae=[],se=0,ce=[],me=[],_e=!1,Le=ae,Re=function(){ee=0,se=0,ae=[],te=[],ce=[],gt=xt(),Ft=xt()};f.__private__.setCustomOutputDestination=function(X){_e=!0,Le=X};var Pe=function(X){_e||(Le=X)};f.__private__.resetCustomOutputDestination=function(){_e=!1,Le=ae};var ve=f.__private__.out=function(X){return X=X.toString(),se+=X.length+1,Le.push(X),Le},it=f.__private__.write=function(X){return ve(arguments.length===1?X.toString():Array.prototype.join.call(arguments," "))},Se=f.__private__.getArrayBuffer=function(X){for(var fe=X.length,Ce=new ArrayBuffer(fe),Fe=new Uint8Array(Ce);fe--;)Fe[fe]=X.charCodeAt(fe);return Ce},be=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];f.__private__.getStandardFonts=function(){return be};var Ae=e.fontSize||16;f.__private__.setFontSize=f.setFontSize=function(X){return Ae=g===y.ADVANCED?X/tt:X,this};var Te,he=f.__private__.getFontSize=f.getFontSize=function(){return g===y.COMPAT?Ae:Ae*tt},Oe=e.R2L||!1;f.__private__.setR2L=f.setR2L=function(X){return Oe=X,this},f.__private__.getR2L=f.getR2L=function(){return Oe};var Me,ze=f.__private__.setZoomMode=function(X){var fe=[void 0,null,"fullwidth","fullheight","fullpage","original"];if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(X))Te=X;else if(isNaN(X)){if(fe.indexOf(X)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+X+'" is not recognized.');Te=X}else Te=parseInt(X,10)};f.__private__.getZoomMode=function(){return Te};var pt,yt=f.__private__.setPageMode=function(X){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(X)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+X+'" is not recognized.');Me=X};f.__private__.getPageMode=function(){return Me};var He=f.__private__.setLayoutMode=function(X){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(X)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+X+'" is not recognized.');pt=X};f.__private__.getLayoutMode=function(){return pt},f.__private__.setDisplayMode=f.setDisplayMode=function(X,fe,Ce){return ze(X),He(fe),yt(Ce),this};var Qe={title:"",subject:"",author:"",keywords:"",creator:""};f.__private__.getDocumentProperty=function(X){if(Object.keys(Qe).indexOf(X)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return Qe[X]},f.__private__.getDocumentProperties=function(){return Qe},f.__private__.setDocumentProperties=f.setProperties=f.setDocumentProperties=function(X){for(var fe in Qe)Qe.hasOwnProperty(fe)&&X[fe]&&(Qe[fe]=X[fe]);return this},f.__private__.setDocumentProperty=function(X,fe){if(Object.keys(Qe).indexOf(X)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return Qe[X]=fe};var Ze,tt,Ht,Pt,It,qt={},Ie={},ke=[],ut={},Nt={},Ct={},St={},Jt=null,nr=0,Tt=[],Xt=new ew(f),Rr=e.hotfixes||[],Je={},mt={},Gt=[],bt=function X(fe,Ce,Fe,Ke,ht,Et){if(!(this instanceof X))return new X(fe,Ce,Fe,Ke,ht,Et);isNaN(fe)&&(fe=1),isNaN(Ce)&&(Ce=0),isNaN(Fe)&&(Fe=0),isNaN(Ke)&&(Ke=1),isNaN(ht)&&(ht=0),isNaN(Et)&&(Et=0),this._matrix=[fe,Ce,Fe,Ke,ht,Et]};Object.defineProperty(bt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(X){this._matrix[0]=X}}),Object.defineProperty(bt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(X){this._matrix[1]=X}}),Object.defineProperty(bt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(X){this._matrix[2]=X}}),Object.defineProperty(bt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(X){this._matrix[3]=X}}),Object.defineProperty(bt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(X){this._matrix[4]=X}}),Object.defineProperty(bt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(X){this._matrix[5]=X}}),Object.defineProperty(bt.prototype,"a",{get:function(){return this._matrix[0]},set:function(X){this._matrix[0]=X}}),Object.defineProperty(bt.prototype,"b",{get:function(){return this._matrix[1]},set:function(X){this._matrix[1]=X}}),Object.defineProperty(bt.prototype,"c",{get:function(){return this._matrix[2]},set:function(X){this._matrix[2]=X}}),Object.defineProperty(bt.prototype,"d",{get:function(){return this._matrix[3]},set:function(X){this._matrix[3]=X}}),Object.defineProperty(bt.prototype,"e",{get:function(){return this._matrix[4]},set:function(X){this._matrix[4]=X}}),Object.defineProperty(bt.prototype,"f",{get:function(){return this._matrix[5]},set:function(X){this._matrix[5]=X}}),Object.defineProperty(bt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(bt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(bt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(bt.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),bt.prototype.join=function(X){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(L).join(X)},bt.prototype.multiply=function(X){var fe=X.sx*this.sx+X.shy*this.shx,Ce=X.sx*this.shy+X.shy*this.sy,Fe=X.shx*this.sx+X.sy*this.shx,Ke=X.shx*this.shy+X.sy*this.sy,ht=X.tx*this.sx+X.ty*this.shx+this.tx,Et=X.tx*this.shy+X.ty*this.sy+this.ty;return new bt(fe,Ce,Fe,Ke,ht,Et)},bt.prototype.decompose=function(){var X=this.sx,fe=this.shy,Ce=this.shx,Fe=this.sy,Ke=this.tx,ht=this.ty,Et=Math.sqrt(X*X+fe*fe),Ut=(X/=Et)*Ce+(fe/=Et)*Fe;Ce-=X*Ut,Fe-=fe*Ut;var sr=Math.sqrt(Ce*Ce+Fe*Fe);return Ut/=sr,X*(Fe/=sr)<fe*(Ce/=sr)&&(X=-X,fe=-fe,Ut=-Ut,Et=-Et),{scale:new bt(Et,0,0,sr,0,0),translate:new bt(1,0,0,1,Ke,ht),rotate:new bt(X,fe,-fe,X,0,0),skew:new bt(1,0,Ut,1,0,0)}},bt.prototype.toString=function(X){return this.join(" ")},bt.prototype.inversed=function(){var X=this.sx,fe=this.shy,Ce=this.shx,Fe=this.sy,Ke=this.tx,ht=this.ty,Et=1/(X*Fe-fe*Ce),Ut=Fe*Et,sr=-fe*Et,wr=-Ce*Et,mr=X*Et;return new bt(Ut,sr,wr,mr,-Ut*Ke-wr*ht,-sr*Ke-mr*ht)},bt.prototype.applyToPoint=function(X){var fe=X.x*this.sx+X.y*this.shx+this.tx,Ce=X.x*this.shy+X.y*this.sy+this.ty;return new Xn(fe,Ce)},bt.prototype.applyToRectangle=function(X){var fe=this.applyToPoint(X),Ce=this.applyToPoint(new Xn(X.x+X.w,X.y+X.h));return new mi(fe.x,fe.y,Ce.x-fe.x,Ce.y-fe.y)},bt.prototype.clone=function(){var X=this.sx,fe=this.shy,Ce=this.shx,Fe=this.sy,Ke=this.tx,ht=this.ty;return new bt(X,fe,Ce,Fe,Ke,ht)},f.Matrix=bt;var Kt=f.matrixMult=function(X,fe){return fe.multiply(X)},Yt=new bt(1,0,0,1,0,0);f.unitMatrix=f.identityMatrix=Yt;var ct=function(X,fe){if(!Nt[X]){var Ce=(fe instanceof Sf?"Sh":"P")+(Object.keys(ut).length+1).toString(10);fe.id=Ce,Nt[X]=Ce,ut[Ce]=fe,Xt.publish("addPattern",fe)}};f.ShadingPattern=Sf,f.TilingPattern=dh,f.addShadingPattern=function(X,fe){return T("addShadingPattern()"),ct(X,fe),this},f.beginTilingPattern=function(X){T("beginTilingPattern()"),Qs(X.boundingBox[0],X.boundingBox[1],X.boundingBox[2]-X.boundingBox[0],X.boundingBox[3]-X.boundingBox[1],X.matrix)},f.endTilingPattern=function(X,fe){T("endTilingPattern()"),fe.stream=me[D].join(`
|
|
457
|
-
`),ct(X,fe),Xt.publish("endTilingPattern",fe),Gt.pop().restore()};var _t=f.__private__.newObject=function(){var X=xt();return rt(X,!0),X},xt=f.__private__.newObjectDeferred=function(){return ee++,te[ee]=function(){return se},ee},rt=function(X,fe){return fe=typeof fe=="boolean"&&fe,te[X]=se,fe&&ve(X+" 0 obj"),X},zt=f.__private__.newAdditionalObject=function(){var X={objId:xt(),content:""};return ce.push(X),X},gt=xt(),Ft=xt(),br=f.__private__.decodeColorString=function(X){var fe=X.split(" ");if(fe.length!==2||fe[1]!=="g"&&fe[1]!=="G")fe.length===5&&(fe[4]==="k"||fe[4]==="K")&&(fe=[(1-fe[0])*(1-fe[3]),(1-fe[1])*(1-fe[3]),(1-fe[2])*(1-fe[3]),"r"]);else{var Ce=parseFloat(fe[0]);fe=[Ce,Ce,Ce,"r"]}for(var Fe="#",Ke=0;Ke<3;Ke++)Fe+=("0"+Math.floor(255*parseFloat(fe[Ke])).toString(16)).slice(-2);return Fe},hr=f.__private__.encodeColorString=function(X){var fe;typeof X=="string"&&(X={ch1:X});var Ce=X.ch1,Fe=X.ch2,Ke=X.ch3,ht=X.ch4,Et=X.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof Ce=="string"&&Ce.charAt(0)!=="#"){var Ut=new S_(Ce);if(Ut.ok)Ce=Ut.toHex();else if(!/^\d*\.?\d*$/.test(Ce))throw new Error('Invalid color "'+Ce+'" passed to jsPDF.encodeColorString.')}if(typeof Ce=="string"&&/^#[0-9A-Fa-f]{3}$/.test(Ce)&&(Ce="#"+Ce[1]+Ce[1]+Ce[2]+Ce[2]+Ce[3]+Ce[3]),typeof Ce=="string"&&/^#[0-9A-Fa-f]{6}$/.test(Ce)){var sr=parseInt(Ce.substr(1),16);Ce=sr>>16&255,Fe=sr>>8&255,Ke=255&sr}if(Fe===void 0||ht===void 0&&Ce===Fe&&Fe===Ke)if(typeof Ce=="string")fe=Ce+" "+Et[0];else switch(X.precision){case 2:fe=I(Ce/255)+" "+Et[0];break;case 3:default:fe=O(Ce/255)+" "+Et[0]}else if(ht===void 0||kn(ht)==="object"){if(ht&&!isNaN(ht.a)&&ht.a===0)return fe=["1.","1.","1.",Et[1]].join(" ");if(typeof Ce=="string")fe=[Ce,Fe,Ke,Et[1]].join(" ");else switch(X.precision){case 2:fe=[I(Ce/255),I(Fe/255),I(Ke/255),Et[1]].join(" ");break;default:case 3:fe=[O(Ce/255),O(Fe/255),O(Ke/255),Et[1]].join(" ")}}else if(typeof Ce=="string")fe=[Ce,Fe,Ke,ht,Et[2]].join(" ");else switch(X.precision){case 2:fe=[I(Ce),I(Fe),I(Ke),I(ht),Et[2]].join(" ");break;case 3:default:fe=[O(Ce),O(Fe),O(Ke),O(ht),Et[2]].join(" ")}return fe},Qr=f.__private__.getFilters=function(){return o},Sn=f.__private__.putStream=function(X){var fe=(X=X||{}).data||"",Ce=X.filters||Qr(),Fe=X.alreadyAppliedFilters||[],Ke=X.addLength1||!1,ht=fe.length,Et=X.objectId,Ut=function(ei){return ei};if(h!==null&&Et===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");h!==null&&(Ut=mn.encryptor(Et,0));var sr={};Ce===!0&&(Ce=["FlateEncode"]);var wr=X.additionalKeyValues||[],mr=(sr=vr.API.processDataByFilters!==void 0?vr.API.processDataByFilters(fe,Ce):{data:fe,reverseChain:[]}).reverseChain+(Array.isArray(Fe)?Fe.join(" "):Fe.toString());if(sr.data.length!==0&&(wr.push({key:"Length",value:sr.data.length}),Ke===!0&&wr.push({key:"Length1",value:ht})),mr.length!=0)if(mr.split("/").length-1==1)wr.push({key:"Filter",value:mr});else{wr.push({key:"Filter",value:"["+mr+"]"});for(var Or=0;Or<wr.length;Or+=1)if(wr[Or].key==="DecodeParms"){for(var Nn=[],Pn=0;Pn<sr.reverseChain.split("/").length-1;Pn+=1)Nn.push("null");Nn.push(wr[Or].value),wr[Or].value="["+Nn.join(" ")+"]"}}ve("<<");for(var Bn=0;Bn<wr.length;Bn++)ve("/"+wr[Bn].key+" "+wr[Bn].value);ve(">>"),sr.data.length!==0&&(ve("stream"),ve(Ut(sr.data)),ve("endstream"))},Ni=f.__private__.putPage=function(X){var fe=X.number,Ce=X.data,Fe=X.objId,Ke=X.contentsObjId;rt(Fe,!0),ve("<</Type /Page"),ve("/Parent "+X.rootDictionaryObjId+" 0 R"),ve("/Resources "+X.resourceDictionaryObjId+" 0 R"),ve("/MediaBox ["+parseFloat(L(X.mediaBox.bottomLeftX))+" "+parseFloat(L(X.mediaBox.bottomLeftY))+" "+L(X.mediaBox.topRightX)+" "+L(X.mediaBox.topRightY)+"]"),X.cropBox!==null&&ve("/CropBox ["+L(X.cropBox.bottomLeftX)+" "+L(X.cropBox.bottomLeftY)+" "+L(X.cropBox.topRightX)+" "+L(X.cropBox.topRightY)+"]"),X.bleedBox!==null&&ve("/BleedBox ["+L(X.bleedBox.bottomLeftX)+" "+L(X.bleedBox.bottomLeftY)+" "+L(X.bleedBox.topRightX)+" "+L(X.bleedBox.topRightY)+"]"),X.trimBox!==null&&ve("/TrimBox ["+L(X.trimBox.bottomLeftX)+" "+L(X.trimBox.bottomLeftY)+" "+L(X.trimBox.topRightX)+" "+L(X.trimBox.topRightY)+"]"),X.artBox!==null&&ve("/ArtBox ["+L(X.artBox.bottomLeftX)+" "+L(X.artBox.bottomLeftY)+" "+L(X.artBox.topRightX)+" "+L(X.artBox.topRightY)+"]"),typeof X.userUnit=="number"&&X.userUnit!==1&&ve("/UserUnit "+X.userUnit),Xt.publish("putPage",{objId:Fe,pageContext:Tt[fe],pageNumber:fe,page:Ce}),ve("/Contents "+Ke+" 0 R"),ve(">>"),ve("endobj");var ht=Ce.join(`
|
|
458
|
-
`);return g===y.ADVANCED&&(ht+=`
|
|
459
|
-
Q`),rt(Ke,!0),Sn({data:ht,filters:Qr(),objectId:Ke}),ve("endobj"),Fe},Si=f.__private__.putPages=function(){var X,fe,Ce=[];for(X=1;X<=nr;X++)Tt[X].objId=xt(),Tt[X].contentsObjId=xt();for(X=1;X<=nr;X++)Ce.push(Ni({number:X,data:me[X],objId:Tt[X].objId,contentsObjId:Tt[X].contentsObjId,mediaBox:Tt[X].mediaBox,cropBox:Tt[X].cropBox,bleedBox:Tt[X].bleedBox,trimBox:Tt[X].trimBox,artBox:Tt[X].artBox,userUnit:Tt[X].userUnit,rootDictionaryObjId:gt,resourceDictionaryObjId:Ft}));rt(gt,!0),ve("<</Type /Pages");var Fe="/Kids [";for(fe=0;fe<nr;fe++)Fe+=Ce[fe]+" 0 R ";ve(Fe+"]"),ve("/Count "+nr),ve(">>"),ve("endobj"),Xt.publish("postPutPages")},fa=function(X){Xt.publish("putFont",{font:X,out:ve,newObject:_t,putStream:Sn}),X.isAlreadyPutted!==!0&&(X.objectNumber=_t(),ve("<<"),ve("/Type /Font"),ve("/BaseFont /"+uh(X.postScriptName)),ve("/Subtype /Type1"),typeof X.encoding=="string"&&ve("/Encoding /"+X.encoding),ve("/FirstChar 32"),ve("/LastChar 255"),ve(">>"),ve("endobj"))},_s=function(){for(var X in qt)qt.hasOwnProperty(X)&&(p===!1||p===!0&&v.hasOwnProperty(X))&&fa(qt[X])},Vo=function(X){X.objectNumber=_t();var fe=[];fe.push({key:"Type",value:"/XObject"}),fe.push({key:"Subtype",value:"/Form"}),fe.push({key:"BBox",value:"["+[L(X.x),L(X.y),L(X.x+X.width),L(X.y+X.height)].join(" ")+"]"}),fe.push({key:"Matrix",value:"["+X.matrix.toString()+"]"});var Ce=X.pages[1].join(`
|
|
460
|
-
`);Sn({data:Ce,additionalKeyValues:fe,objectId:X.objectNumber}),ve("endobj")},tu=function(){for(var X in Je)Je.hasOwnProperty(X)&&Vo(Je[X])},mc=function(X,fe){var Ce,Fe=[],Ke=1/(fe-1);for(Ce=0;Ce<1;Ce+=Ke)Fe.push(Ce);if(Fe.push(1),X[0].offset!=0){var ht={offset:0,color:X[0].color};X.unshift(ht)}if(X[X.length-1].offset!=1){var Et={offset:1,color:X[X.length-1].color};X.push(Et)}for(var Ut="",sr=0,wr=0;wr<Fe.length;wr++){for(Ce=Fe[wr];Ce>X[sr+1].offset;)sr++;var mr=X[sr].offset,Or=(Ce-mr)/(X[sr+1].offset-mr),Nn=X[sr].color,Pn=X[sr+1].color;Ut+=Q(Math.round((1-Or)*Nn[0]+Or*Pn[0]).toString(16))+Q(Math.round((1-Or)*Nn[1]+Or*Pn[1]).toString(16))+Q(Math.round((1-Or)*Nn[2]+Or*Pn[2]).toString(16))}return Ut.trim()},Fn=function(X,fe){fe||(fe=21);var Ce=_t(),Fe=mc(X.colors,fe),Ke=[];Ke.push({key:"FunctionType",value:"0"}),Ke.push({key:"Domain",value:"[0.0 1.0]"}),Ke.push({key:"Size",value:"["+fe+"]"}),Ke.push({key:"BitsPerSample",value:"8"}),Ke.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Ke.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Sn({data:Fe,additionalKeyValues:Ke,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:Ce}),ve("endobj"),X.objectNumber=_t(),ve("<< /ShadingType "+X.type),ve("/ColorSpace /DeviceRGB");var ht="/Coords ["+L(parseFloat(X.coords[0]))+" "+L(parseFloat(X.coords[1]))+" ";X.type===2?ht+=L(parseFloat(X.coords[2]))+" "+L(parseFloat(X.coords[3])):ht+=L(parseFloat(X.coords[2]))+" "+L(parseFloat(X.coords[3]))+" "+L(parseFloat(X.coords[4]))+" "+L(parseFloat(X.coords[5])),ve(ht+="]"),X.matrix&&ve("/Matrix ["+X.matrix.toString()+"]"),ve("/Function "+Ce+" 0 R"),ve("/Extend [true true]"),ve(">>"),ve("endobj")},Bu=function(X,fe){var Ce=xt(),Fe=_t();fe.push({resourcesOid:Ce,objectOid:Fe}),X.objectNumber=Fe;var Ke=[];Ke.push({key:"Type",value:"/Pattern"}),Ke.push({key:"PatternType",value:"1"}),Ke.push({key:"PaintType",value:"1"}),Ke.push({key:"TilingType",value:"1"}),Ke.push({key:"BBox",value:"["+X.boundingBox.map(L).join(" ")+"]"}),Ke.push({key:"XStep",value:L(X.xStep)}),Ke.push({key:"YStep",value:L(X.yStep)}),Ke.push({key:"Resources",value:Ce+" 0 R"}),X.matrix&&Ke.push({key:"Matrix",value:"["+X.matrix.toString()+"]"}),Sn({data:X.stream,additionalKeyValues:Ke,objectId:X.objectNumber}),ve("endobj")},oo=function(X){var fe;for(fe in ut)ut.hasOwnProperty(fe)&&(ut[fe]instanceof Sf?Fn(ut[fe]):ut[fe]instanceof dh&&Bu(ut[fe],X))},dl=function(X){for(var fe in X.objectNumber=_t(),ve("<<"),X)switch(fe){case"opacity":ve("/ca "+I(X[fe]));break;case"stroke-opacity":ve("/CA "+I(X[fe]))}ve(">>"),ve("endobj")},Gs=function(){var X;for(X in Ct)Ct.hasOwnProperty(X)&&dl(Ct[X])},qu=function(){for(var X in ve("/XObject <<"),Je)Je.hasOwnProperty(X)&&Je[X].objectNumber>=0&&ve("/"+X+" "+Je[X].objectNumber+" 0 R");Xt.publish("putXobjectDict"),ve(">>")},ru=function(){mn.oid=_t(),ve("<<"),ve("/Filter /Standard"),ve("/V "+mn.v),ve("/R "+mn.r),ve("/U <"+mn.toHexString(mn.U)+">"),ve("/O <"+mn.toHexString(mn.O)+">"),ve("/P "+mn.P),ve(">>"),ve("endobj")},so=function(){for(var X in ve("/Font <<"),qt)qt.hasOwnProperty(X)&&(p===!1||p===!0&&v.hasOwnProperty(X))&&ve("/"+X+" "+qt[X].objectNumber+" 0 R");ve(">>")},gi=function(){if(Object.keys(ut).length>0){for(var X in ve("/Shading <<"),ut)ut.hasOwnProperty(X)&&ut[X]instanceof Sf&&ut[X].objectNumber>=0&&ve("/"+X+" "+ut[X].objectNumber+" 0 R");Xt.publish("putShadingPatternDict"),ve(">>")}},Jr=function(X){if(Object.keys(ut).length>0){for(var fe in ve("/Pattern <<"),ut)ut.hasOwnProperty(fe)&&ut[fe]instanceof f.TilingPattern&&ut[fe].objectNumber>=0&&ut[fe].objectNumber<X&&ve("/"+fe+" "+ut[fe].objectNumber+" 0 R");Xt.publish("putTilingPatternDict"),ve(">>")}},Nr=function(){if(Object.keys(Ct).length>0){var X;for(X in ve("/ExtGState <<"),Ct)Ct.hasOwnProperty(X)&&Ct[X].objectNumber>=0&&ve("/"+X+" "+Ct[X].objectNumber+" 0 R");Xt.publish("putGStateDict"),ve(">>")}},cn=function(X){rt(X.resourcesOid,!0),ve("<<"),ve("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),so(),gi(),Jr(X.objectOid),Nr(),qu(),ve(">>"),ve("endobj")},vi=function(){var X=[];_s(),Gs(),tu(),oo(X),Xt.publish("putResources"),X.forEach(cn),cn({resourcesOid:Ft,objectOid:Number.MAX_SAFE_INTEGER}),Xt.publish("postPutResources")},Ti=function(){Xt.publish("putAdditionalObjects");for(var X=0;X<ce.length;X++){var fe=ce[X];rt(fe.objId,!0),ve(fe.content),ve("endobj")}Xt.publish("postPutAdditionalObjects")},Ia=function(X){Ie[X.fontName]=Ie[X.fontName]||{},Ie[X.fontName][X.fontStyle]=X.id},ja=function(X,fe,Ce,Fe,Ke){var ht={id:"F"+(Object.keys(qt).length+1).toString(10),postScriptName:X,fontName:fe,fontStyle:Ce,encoding:Fe,isStandardFont:Ke||!1,metadata:{}};return Xt.publish("addFont",{font:ht,instance:this}),qt[ht.id]=ht,Ia(ht),ht.id},oi=function(X){for(var fe=0,Ce=be.length;fe<Ce;fe++){var Fe=ja.call(this,X[fe][0],X[fe][1],X[fe][2],be[fe][3],!0);p===!1&&(v[Fe]=!0);var Ke=X[fe][0].split("-");Ia({id:Fe,fontName:Ke[0],fontStyle:Ke[1]||""})}Xt.publish("addFonts",{fonts:qt,dictionary:Ie})},Ri=function(X){return X.foo=function(){try{return X.apply(this,arguments)}catch(Fe){var fe=Fe.stack||"";~fe.indexOf(" at ")&&(fe=fe.split(" at ")[1]);var Ce="Error in function "+fe.split(`
|
|
461
|
-
`)[0].split("<")[0]+": "+Fe.message;if(!yr.console)throw new Error(Ce);yr.console.error(Ce,Fe),yr.alert&&alert(Ce)}},X.foo.bar=X,X.foo},pl=function(X,fe){var Ce,Fe,Ke,ht,Et,Ut,sr,wr,mr;if(Ke=(fe=fe||{}).sourceEncoding||"Unicode",Et=fe.outputEncoding,(fe.autoencode||Et)&&qt[Ze].metadata&&qt[Ze].metadata[Ke]&&qt[Ze].metadata[Ke].encoding&&(ht=qt[Ze].metadata[Ke].encoding,!Et&&qt[Ze].encoding&&(Et=qt[Ze].encoding),!Et&&ht.codePages&&(Et=ht.codePages[0]),typeof Et=="string"&&(Et=ht[Et]),Et)){for(sr=!1,Ut=[],Ce=0,Fe=X.length;Ce<Fe;Ce++)(wr=Et[X.charCodeAt(Ce)])?Ut.push(String.fromCharCode(wr)):Ut.push(X[Ce]),Ut[Ce].charCodeAt(0)>>8&&(sr=!0);X=Ut.join("")}for(Ce=X.length;sr===void 0&&Ce!==0;)X.charCodeAt(Ce-1)>>8&&(sr=!0),Ce--;if(!sr)return X;for(Ut=fe.noBOM?[]:[254,255],Ce=0,Fe=X.length;Ce<Fe;Ce++){if((mr=(wr=X.charCodeAt(Ce))>>8)>>8)throw new Error("Character at position "+Ce+" of string '"+X+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");Ut.push(mr),Ut.push(wr-(mr<<8))}return String.fromCharCode.apply(void 0,Ut)},ha=f.__private__.pdfEscape=f.pdfEscape=function(X,fe){return pl(X,fe).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Wo=f.__private__.beginPage=function(X){me[++nr]=[],Tt[nr]={objId:0,contentsObjId:0,userUnit:Number(s),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(X[0]),topRightY:Number(X[1])}},Vs(nr),Pe(me[D])},nu=function(X,fe){var Ce,Fe,Ke;switch(t=fe||t,typeof X=="string"&&(Ce=x(X.toLowerCase()),Array.isArray(Ce)&&(Fe=Ce[0],Ke=Ce[1])),Array.isArray(X)&&(Fe=X[0]*tt,Ke=X[1]*tt),isNaN(Fe)&&(Fe=a[0],Ke=a[1]),(Fe>14400||Ke>14400)&&(Yn.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),Fe=Math.min(14400,Fe),Ke=Math.min(14400,Ke)),a=[Fe,Ke],t.substr(0,1)){case"l":Ke>Fe&&(a=[Ke,Fe]);break;case"p":Fe>Ke&&(a=[Ke,Fe])}Wo(a),Os(Ba),ve(xn),lu!==0&&ve(lu+" J"),As!==0&&ve(As+" j"),Xt.publish("addPage",{pageNumber:nr})},da=function(X){X>0&&X<=nr&&(me.splice(X,1),Tt.splice(X,1),nr--,D>nr&&(D=nr),this.setPage(D))},Vs=function(X){X>0&&X<=nr&&(D=X)},af=f.__private__.getNumberOfPages=f.getNumberOfPages=function(){return me.length-1},iu=function(X,fe,Ce){var Fe,Ke=void 0;return Ce=Ce||{},X=X!==void 0?X:qt[Ze].fontName,fe=fe!==void 0?fe:qt[Ze].fontStyle,Fe=X.toLowerCase(),Ie[Fe]!==void 0&&Ie[Fe][fe]!==void 0?Ke=Ie[Fe][fe]:Ie[X]!==void 0&&Ie[X][fe]!==void 0?Ke=Ie[X][fe]:Ce.disableWarning===!1&&Yn.warn("Unable to look up font label for font '"+X+"', '"+fe+"'. Refer to getFontList() for available fonts."),Ke||Ce.noFallback||(Ke=Ie.times[fe])==null&&(Ke=Ie.times.normal),Ke},Fr=f.__private__.putInfo=function(){var X=_t(),fe=function(Fe){return Fe};for(var Ce in h!==null&&(fe=mn.encryptor(X,0)),ve("<<"),ve("/Producer ("+ha(fe("jsPDF "+vr.version))+")"),Qe)Qe.hasOwnProperty(Ce)&&Qe[Ce]&&ve("/"+Ce.substr(0,1).toUpperCase()+Ce.substr(1)+" ("+ha(fe(Qe[Ce]))+")");ve("/CreationDate ("+ha(fe(N))+")"),ve(">>"),ve("endobj")},Ss=f.__private__.putCatalog=function(X){var fe=(X=X||{}).rootDictionaryObjId||gt;switch(_t(),ve("<<"),ve("/Type /Catalog"),ve("/Pages "+fe+" 0 R"),Te||(Te="fullwidth"),Te){case"fullwidth":ve("/OpenAction [3 0 R /FitH null]");break;case"fullheight":ve("/OpenAction [3 0 R /FitV null]");break;case"fullpage":ve("/OpenAction [3 0 R /Fit]");break;case"original":ve("/OpenAction [3 0 R /XYZ null null 1]");break;default:var Ce=""+Te;Ce.substr(Ce.length-1)==="%"&&(Te=parseInt(Te)/100),typeof Te=="number"&&ve("/OpenAction [3 0 R /XYZ null null "+I(Te)+"]")}switch(pt||(pt="continuous"),pt){case"continuous":ve("/PageLayout /OneColumn");break;case"single":ve("/PageLayout /SinglePage");break;case"two":case"twoleft":ve("/PageLayout /TwoColumnLeft");break;case"tworight":ve("/PageLayout /TwoColumnRight")}Me&&ve("/PageMode /"+Me),Xt.publish("putCatalog"),ve(">>"),ve("endobj")},Ws=f.__private__.putTrailer=function(){ve("trailer"),ve("<<"),ve("/Size "+(ee+1)),ve("/Root "+ee+" 0 R"),ve("/Info "+(ee-1)+" 0 R"),h!==null&&ve("/Encrypt "+mn.oid+" 0 R"),ve("/ID [ <"+B+"> <"+B+"> ]"),ve(">>")},$s=f.__private__.putHeader=function(){ve("%PDF-"+_),ve("%ºß¬à")},yc=f.__private__.putXRef=function(){var X="0000000000";ve("xref"),ve("0 "+(ee+1)),ve("0000000000 65535 f ");for(var fe=1;fe<=ee;fe++)typeof te[fe]=="function"?ve((X+te[fe]()).slice(-10)+" 00000 n "):te[fe]!==void 0?ve((X+te[fe]).slice(-10)+" 00000 n "):ve("0000000000 00000 n ")},$o=f.__private__.buildDocument=function(){Re(),Pe(ae),Xt.publish("buildDocument"),$s(),Si(),Ti(),vi(),h!==null&&ru(),Fr(),Ss();var X=se;return yc(),Ws(),ve("startxref"),ve(""+X),ve("%%EOF"),Pe(me[D]),ae.join(`
|
|
462
|
-
`)},xs=f.__private__.getBlob=function(X){return new Blob([Se(X)],{type:"application/pdf"})},Es=f.output=f.__private__.output=Ri(function(X,fe){switch(typeof(fe=fe||{})=="string"?fe={filename:fe}:fe.filename=fe.filename||"generated.pdf",X){case void 0:return $o();case"save":f.save(fe.filename);break;case"arraybuffer":return Se($o());case"blob":return xs($o());case"bloburi":case"bloburl":if(yr.URL!==void 0&&typeof yr.URL.createObjectURL=="function")return yr.URL&&yr.URL.createObjectURL(xs($o()))||void 0;Yn.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var Ce="",Fe=$o();try{Ce=R2(Fe)}catch{Ce=R2(unescape(encodeURIComponent(Fe)))}return"data:application/pdf;filename="+fe.filename+";base64,"+Ce;case"pdfobjectnewwindow":if(Object.prototype.toString.call(yr)==="[object Window]"){var Ke="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",ht=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';fe.pdfObjectUrl&&(Ke=fe.pdfObjectUrl,ht="");var Et='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+Ke+'"'+ht+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(fe)+");<\/script></body></html>",Ut=yr.open();return Ut!==null&&Ut.document.write(Et),Ut}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(yr)==="[object Window]"){var sr='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(fe.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+fe.filename+'" width="500px" height="400px" /></body></html>',wr=yr.open();if(wr!==null){wr.document.write(sr);var mr=this;wr.document.documentElement.querySelector("#pdfViewer").onload=function(){wr.document.title=fe.filename,wr.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(mr.output("bloburl"))}}return wr}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(yr)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var Or='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",fe)+'"></iframe></body></html>',Nn=yr.open();if(Nn!==null&&(Nn.document.write(Or),Nn.document.title=fe.filename),Nn||typeof safari>"u")return Nn;break;case"datauri":case"dataurl":return yr.document.location.href=this.output("datauristring",fe);default:return null}}),Ps=function(X){return Array.isArray(Rr)===!0&&Rr.indexOf(X)>-1};switch(n){case"pt":tt=1;break;case"mm":tt=72/25.4;break;case"cm":tt=72/2.54;break;case"in":tt=72;break;case"px":tt=Ps("px_scaling")==1?.75:96/72;break;case"pc":case"em":tt=12;break;case"ex":tt=6;break;default:if(typeof n!="number")throw new Error("Invalid unit: "+n);tt=n}var mn=null;H(),Y();var Yo=function(X){return h!==null?mn.encryptor(X,0):function(fe){return fe}},Fa=f.__private__.getPageInfo=f.getPageInfo=function(X){if(isNaN(X)||X%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Tt[X].objId,pageNumber:X,pageContext:Tt[X]}},Dt=f.__private__.getPageInfoByObjId=function(X){if(isNaN(X)||X%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var fe in Tt)if(Tt[fe].objId===X)break;return Fa(fe)},Ys=f.__private__.getCurrentPageInfo=f.getCurrentPageInfo=function(){return{objId:Tt[D].objId,pageNumber:D,pageContext:Tt[D]}};f.addPage=function(){return nu.apply(this,arguments),this},f.setPage=function(){return Vs.apply(this,arguments),Pe.call(this,me[D]),this},f.insertPage=function(X){return this.addPage(),this.movePage(D,X),this},f.movePage=function(X,fe){var Ce,Fe;if(X>fe){Ce=me[X],Fe=Tt[X];for(var Ke=X;Ke>fe;Ke--)me[Ke]=me[Ke-1],Tt[Ke]=Tt[Ke-1];me[fe]=Ce,Tt[fe]=Fe,this.setPage(fe)}else if(X<fe){Ce=me[X],Fe=Tt[X];for(var ht=X;ht<fe;ht++)me[ht]=me[ht+1],Tt[ht]=Tt[ht+1];me[fe]=Ce,Tt[fe]=Fe,this.setPage(fe)}return this},f.deletePage=function(){return da.apply(this,arguments),this},f.__private__.text=f.text=function(X,fe,Ce,Fe,Ke){var ht,Et,Ut,sr,wr,mr,Or,Nn,Pn,Bn=(Fe=Fe||{}).scope||this;if(typeof X=="number"&&typeof fe=="number"&&(typeof Ce=="string"||Array.isArray(Ce))){var ei=Ce;Ce=fe,fe=X,X=ei}if(arguments[3]instanceof bt?(T("The transform parameter of text() with a Matrix value"),Pn=Ke):(Ut=arguments[4],sr=arguments[5],kn(Or=arguments[3])==="object"&&Or!==null||(typeof Ut=="string"&&(sr=Ut,Ut=null),typeof Or=="string"&&(sr=Or,Or=null),typeof Or=="number"&&(Ut=Or,Or=null),Fe={flags:Or,angle:Ut,align:sr})),isNaN(fe)||isNaN(Ce)||X==null)throw new Error("Invalid arguments passed to jsPDF.text");if(X.length===0)return Bn;var ui="",Ua=!1,Ea=typeof Fe.lineHeightFactor=="number"?Fe.lineHeightFactor:Mi,Pa=Bn.internal.scaleFactor;function Zo(on){return on=on.split(" ").join(Array(Fe.TabLen||9).join(" ")),ha(on,Or)}function Qo(on){for(var Kr,qn=on.concat(),ti=[],Io=qn.length;Io--;)typeof(Kr=qn.shift())=="string"?ti.push(Kr):Array.isArray(on)&&(Kr.length===1||Kr[1]===void 0&&Kr[2]===void 0)?ti.push(Kr[0]):ti.push([Kr[0],Kr[1],Kr[2]]);return ti}function Di(on,Kr){var qn;if(typeof on=="string")qn=Kr(on)[0];else if(Array.isArray(on)){for(var ti,Io,_l=on.concat(),nl=[],cu=_l.length;cu--;)typeof(ti=_l.shift())=="string"?nl.push(Kr(ti)[0]):Array.isArray(ti)&&typeof ti[0]=="string"&&(Io=Kr(ti[0],ti[1],ti[2]),nl.push([Io[0],Io[1],Io[2]]));qn=nl}return qn}var Ha=!1,Js=!0;if(typeof X=="string")Ha=!0;else if(Array.isArray(X)){var bl=X.concat();Et=[];for(var ra,an=bl.length;an--;)(typeof(ra=bl.shift())!="string"||Array.isArray(ra)&&typeof ra[0]!="string")&&(Js=!1);Ha=Js}if(Ha===!1)throw new Error('Type of text must be string or Array. "'+X+'" is not recognized.');typeof X=="string"&&(X=X.match(/[\r?\n]/)?X.split(/\r\n|\r|\n/g):[X]);var el=Ae/Bn.internal.scaleFactor,wl=el*(Ea-1);switch(Fe.baseline){case"bottom":Ce-=wl;break;case"top":Ce+=el-wl;break;case"hanging":Ce+=el-2*wl;break;case"middle":Ce+=el/2-wl}if((mr=Fe.maxWidth||0)>0&&(typeof X=="string"?X=Bn.splitTextToSize(X,mr):Object.prototype.toString.call(X)==="[object Array]"&&(X=X.reduce(function(on,Kr){return on.concat(Bn.splitTextToSize(Kr,mr))},[]))),ht={text:X,x:fe,y:Ce,options:Fe,mutex:{pdfEscape:ha,activeFontKey:Ze,fonts:qt,activeFontSize:Ae}},Xt.publish("preProcessText",ht),X=ht.text,Ut=(Fe=ht.options).angle,!(Pn instanceof bt)&&Ut&&typeof Ut=="number"){Ut*=Math.PI/180,Fe.rotationDirection===0&&(Ut=-Ut),g===y.ADVANCED&&(Ut=-Ut);var Oa=Math.cos(Ut),Ga=Math.sin(Ut);Pn=new bt(Oa,Ga,-Ga,Oa,0,0)}else Ut&&Ut instanceof bt&&(Pn=Ut);g!==y.ADVANCED||Pn||(Pn=Yt),(wr=Fe.charSpace||ta)!==void 0&&(ui+=L(C(wr))+` Tc
|
|
463
|
-
`,this.setCharSpace(this.getCharSpace()||0)),(Nn=Fe.horizontalScale)!==void 0&&(ui+=L(100*Nn)+` Tz
|
|
464
|
-
`),Fe.lang;var xi=-1,tl=Fe.renderingMode!==void 0?Fe.renderingMode:Fe.stroke,co=Bn.internal.getCurrentPageInfo().pageContext;switch(tl){case 0:case!1:case"fill":xi=0;break;case 1:case!0:case"stroke":xi=1;break;case 2:case"fillThenStroke":xi=2;break;case 3:case"invisible":xi=3;break;case 4:case"fillAndAddForClipping":xi=4;break;case 5:case"strokeAndAddPathForClipping":xi=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":xi=6;break;case 7:case"addToPathForClipping":xi=7}var Hu=co.usedRenderingMode!==void 0?co.usedRenderingMode:-1;xi!==-1?ui+=xi+` Tr
|
|
465
|
-
`:Hu!==-1&&(ui+=`0 Tr
|
|
466
|
-
`),xi!==-1&&(co.usedRenderingMode=xi),sr=Fe.align||"left";var yi,Bi=Ae*Ea,Cs=Bn.internal.pageSize.getWidth(),Co=qt[Ze];wr=Fe.charSpace||ta,mr=Fe.maxWidth||0,Or=Object.assign({autoencode:!0,noBOM:!0},Fe.flags);var bi=[],Jo=function(on){return Bn.getStringUnitWidth(on,{font:Co,charSpace:wr,fontSize:Ae,doKerning:!1})*Ae/Pa};if(Object.prototype.toString.call(X)==="[object Array]"){var ci;Et=Qo(X),sr!=="left"&&(yi=Et.map(Jo));var qi,es=0;if(sr==="right"){fe-=yi[0],X=[],an=Et.length;for(var Xr=0;Xr<an;Xr++)Xr===0?(qi=Ii(fe),ci=ji(Ce)):(qi=C(es-yi[Xr]),ci=-Bi),X.push([Et[Xr],qi,ci]),es=yi[Xr]}else if(sr==="center"){fe-=yi[0]/2,X=[],an=Et.length;for(var fo=0;fo<an;fo++)fo===0?(qi=Ii(fe),ci=ji(Ce)):(qi=C((es-yi[fo])/2),ci=-Bi),X.push([Et[fo],qi,ci]),es=yi[fo]}else if(sr==="left"){X=[],an=Et.length;for(var rl=0;rl<an;rl++)X.push(Et[rl])}else if(sr==="justify"&&Co.encoding==="Identity-H"){X=[],an=Et.length,mr=mr!==0?mr:Cs;for(var ko=0,Dr=0;Dr<an;Dr++)if(ci=Dr===0?ji(Ce):-Bi,qi=Dr===0?Ii(fe):ko,Dr<an-1){var Lo=C((mr-yi[Dr])/(Et[Dr].split(" ").length-1)),Kn=Et[Dr].split(" ");X.push([Kn[0]+" ",qi,ci]),ko=0;for(var Mr=1;Mr<Kn.length;Mr++){var On=(Jo(Kn[Mr-1]+" "+Kn[Mr])-Jo(Kn[Mr]))*Pa+Lo;Mr==Kn.length-1?X.push([Kn[Mr],On,0]):X.push([Kn[Mr]+" ",On,0]),ko-=On}}else X.push([Et[Dr],qi,ci]);X.push(["",ko,0])}else{if(sr!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(X=[],an=Et.length,mr=mr!==0?mr:Cs,Dr=0;Dr<an;Dr++)ci=Dr===0?ji(Ce):-Bi,qi=Dr===0?Ii(fe):0,Dr<an-1?bi.push(L(C((mr-yi[Dr])/(Et[Dr].split(" ").length-1)))):bi.push(0),X.push([Et[Dr],qi,ci])}}var Zn=typeof Fe.R2L=="boolean"?Fe.R2L:Oe;Zn===!0&&(X=Di(X,function(on,Kr,qn){return[on.split("").reverse().join(""),Kr,qn]})),ht={text:X,x:fe,y:Ce,options:Fe,mutex:{pdfEscape:ha,activeFontKey:Ze,fonts:qt,activeFontSize:Ae}},Xt.publish("postProcessText",ht),X=ht.text,Ua=ht.mutex.isHex||!1;var ts=qt[Ze].encoding;ts!=="WinAnsiEncoding"&&ts!=="StandardEncoding"||(X=Di(X,function(on,Kr,qn){return[Zo(on),Kr,qn]})),Et=Qo(X),X=[];for(var No,To,Va,Tn=0,ho=1,Ro=Array.isArray(Et[0])?ho:Tn,Mo="",zi=function(on,Kr,qn){var ti="";return qn instanceof bt?(qn=typeof Fe.angle=="number"?Kt(qn,new bt(1,0,0,1,on,Kr)):Kt(new bt(1,0,0,1,on,Kr),qn),g===y.ADVANCED&&(qn=Kt(new bt(1,0,0,-1,0,0),qn)),ti=qn.join(" ")+` Tm
|
|
467
|
-
`):ti=L(on)+" "+L(Kr)+` Td
|
|
468
|
-
`,ti},fn=0;fn<Et.length;fn++){switch(Mo="",Ro){case ho:Va=(Ua?"<":"(")+Et[fn][0]+(Ua?">":")"),No=parseFloat(Et[fn][1]),To=parseFloat(Et[fn][2]);break;case Tn:Va=(Ua?"<":"(")+Et[fn]+(Ua?">":")"),No=Ii(fe),To=ji(Ce)}bi!==void 0&&bi[fn]!==void 0&&(Mo=bi[fn]+` Tw
|
|
469
|
-
`),fn===0?X.push(Mo+zi(No,To,Pn)+Va):Ro===Tn?X.push(Mo+Va):Ro===ho&&X.push(Mo+zi(No,To,Pn)+Va)}X=Ro===Tn?X.join(` Tj
|
|
470
|
-
T* `):X.join(` Tj
|
|
471
|
-
`),X+=` Tj
|
|
472
|
-
`;var Ei=`BT
|
|
473
|
-
/`;return Ei+=Ze+" "+Ae+` Tf
|
|
474
|
-
`,Ei+=L(Ae*Ea)+` TL
|
|
475
|
-
`,Ei+=En+`
|
|
476
|
-
`,Ei+=ui,Ei+=X,ve(Ei+="ET"),v[Ze]=!0,Bn};var lo=f.__private__.clip=f.clip=function(X){return ve(X==="evenodd"?"W*":"W"),this};f.clipEvenOdd=function(){return lo("evenodd")},f.__private__.discardPath=f.discardPath=function(){return ve("n"),this};var Oo=f.__private__.isValidStyle=function(X){var fe=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(X)!==-1&&(fe=!0),fe};f.__private__.setDefaultPathOperation=f.setDefaultPathOperation=function(X){return Oo(X)&&(c=X),this};var zu=f.__private__.getStyle=f.getStyle=function(X){var fe=c;switch(X){case"D":case"S":fe="S";break;case"F":fe="f";break;case"FD":case"DF":fe="B";break;case"f":case"f*":case"B":case"B*":fe=X}return fe},Xs=f.close=function(){return ve("h"),this};f.stroke=function(){return ve("S"),this},f.fill=function(X){return Dn("f",X),this},f.fillEvenOdd=function(X){return Dn("f*",X),this},f.fillStroke=function(X){return Dn("B",X),this},f.fillStrokeEvenOdd=function(X){return Dn("B*",X),this};var Dn=function(X,fe){kn(fe)==="object"?ou(fe,X):ve(X)},Ks=function(X){X===null||g===y.ADVANCED&&X===void 0||(X=zu(X),ve(X))};function au(X,fe,Ce,Fe,Ke){var ht=new dh(fe||this.boundingBox,Ce||this.xStep,Fe||this.yStep,this.gState,Ke||this.matrix);ht.stream=this.stream;var Et=X+"$$"+this.cloneIndex+++"$$";return ct(Et,ht),ht}var ou=function(X,fe){var Ce=Nt[X.key],Fe=ut[Ce];if(Fe instanceof Sf)ve("q"),ve(of(fe)),Fe.gState&&f.setGState(Fe.gState),ve(X.matrix.toString()+" cm"),ve("/"+Ce+" sh"),ve("Q");else if(Fe instanceof dh){var Ke=new bt(1,0,0,-1,0,Ko());X.matrix&&(Ke=Ke.multiply(X.matrix||Yt),Ce=au.call(Fe,X.key,X.boundingBox,X.xStep,X.yStep,Ke).id),ve("q"),ve("/Pattern cs"),ve("/"+Ce+" scn"),Fe.gState&&f.setGState(Fe.gState),ve(fe),ve("Q")}},of=function(X){switch(X){case"f":case"F":return"W n";case"f*":return"W* n";case"B":return"W S";case"B*":return"W* S";case"S":return"W S";case"n":return"W n"}},uo=f.moveTo=function(X,fe){return ve(L(C(X))+" "+L(j(fe))+" m"),this},si=f.lineTo=function(X,fe){return ve(L(C(X))+" "+L(j(fe))+" l"),this},Da=f.curveTo=function(X,fe,Ce,Fe,Ke,ht){return ve([L(C(X)),L(j(fe)),L(C(Ce)),L(j(Fe)),L(C(Ke)),L(j(ht)),"c"].join(" ")),this};f.__private__.line=f.line=function(X,fe,Ce,Fe,Ke){if(isNaN(X)||isNaN(fe)||isNaN(Ce)||isNaN(Fe)||!Oo(Ke))throw new Error("Invalid arguments passed to jsPDF.line");return g===y.COMPAT?this.lines([[Ce-X,Fe-fe]],X,fe,[1,1],Ke||"S"):this.lines([[Ce-X,Fe-fe]],X,fe,[1,1]).stroke()},f.__private__.lines=f.lines=function(X,fe,Ce,Fe,Ke,ht){var Et,Ut,sr,wr,mr,Or,Nn,Pn,Bn,ei,ui,Ua;if(typeof X=="number"&&(Ua=Ce,Ce=fe,fe=X,X=Ua),Fe=Fe||[1,1],ht=ht||!1,isNaN(fe)||isNaN(Ce)||!Array.isArray(X)||!Array.isArray(Fe)||!Oo(Ke)||typeof ht!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(uo(fe,Ce),Et=Fe[0],Ut=Fe[1],wr=X.length,ei=fe,ui=Ce,sr=0;sr<wr;sr++)(mr=X[sr]).length===2?(ei=mr[0]*Et+ei,ui=mr[1]*Ut+ui,si(ei,ui)):(Or=mr[0]*Et+ei,Nn=mr[1]*Ut+ui,Pn=mr[2]*Et+ei,Bn=mr[3]*Ut+ui,ei=mr[4]*Et+ei,ui=mr[5]*Ut+ui,Da(Or,Nn,Pn,Bn,ei,ui));return ht&&Xs(),Ks(Ke),this},f.path=function(X){for(var fe=0;fe<X.length;fe++){var Ce=X[fe],Fe=Ce.c;switch(Ce.op){case"m":uo(Fe[0],Fe[1]);break;case"l":si(Fe[0],Fe[1]);break;case"c":Da.apply(this,Fe);break;case"h":Xs()}}return this},f.__private__.rect=f.rect=function(X,fe,Ce,Fe,Ke){if(isNaN(X)||isNaN(fe)||isNaN(Ce)||isNaN(Fe)||!Oo(Ke))throw new Error("Invalid arguments passed to jsPDF.rect");return g===y.COMPAT&&(Fe=-Fe),ve([L(C(X)),L(j(fe)),L(C(Ce)),L(C(Fe)),"re"].join(" ")),Ks(Ke),this},f.__private__.triangle=f.triangle=function(X,fe,Ce,Fe,Ke,ht,Et){if(isNaN(X)||isNaN(fe)||isNaN(Ce)||isNaN(Fe)||isNaN(Ke)||isNaN(ht)||!Oo(Et))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[Ce-X,Fe-fe],[Ke-Ce,ht-Fe],[X-Ke,fe-ht]],X,fe,[1,1],Et,!0),this},f.__private__.roundedRect=f.roundedRect=function(X,fe,Ce,Fe,Ke,ht,Et){if(isNaN(X)||isNaN(fe)||isNaN(Ce)||isNaN(Fe)||isNaN(Ke)||isNaN(ht)||!Oo(Et))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var Ut=4/3*(Math.SQRT2-1);return Ke=Math.min(Ke,.5*Ce),ht=Math.min(ht,.5*Fe),this.lines([[Ce-2*Ke,0],[Ke*Ut,0,Ke,ht-ht*Ut,Ke,ht],[0,Fe-2*ht],[0,ht*Ut,-Ke*Ut,ht,-Ke,ht],[2*Ke-Ce,0],[-Ke*Ut,0,-Ke,-ht*Ut,-Ke,-ht],[0,2*ht-Fe],[0,-ht*Ut,Ke*Ut,-ht,Ke,-ht]],X+Ke,fe,[1,1],Et,!0),this},f.__private__.ellipse=f.ellipse=function(X,fe,Ce,Fe,Ke){if(isNaN(X)||isNaN(fe)||isNaN(Ce)||isNaN(Fe)||!Oo(Ke))throw new Error("Invalid arguments passed to jsPDF.ellipse");var ht=4/3*(Math.SQRT2-1)*Ce,Et=4/3*(Math.SQRT2-1)*Fe;return uo(X+Ce,fe),Da(X+Ce,fe-Et,X+ht,fe-Fe,X,fe-Fe),Da(X-ht,fe-Fe,X-Ce,fe-Et,X-Ce,fe),Da(X-Ce,fe+Et,X-ht,fe+Fe,X,fe+Fe),Da(X+ht,fe+Fe,X+Ce,fe+Et,X+Ce,fe),Ks(Ke),this},f.__private__.circle=f.circle=function(X,fe,Ce,Fe){if(isNaN(X)||isNaN(fe)||isNaN(Ce)||!Oo(Fe))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(X,fe,Ce,Ce,Fe)},f.setFont=function(X,fe,Ce){return Ce&&(fe=R(fe,Ce)),Ze=iu(X,fe,{disableWarning:!1}),this};var su=f.__private__.getFont=f.getFont=function(){return qt[iu.apply(f,arguments)]};f.__private__.getFontList=f.getFontList=function(){var X,fe,Ce={};for(X in Ie)if(Ie.hasOwnProperty(X))for(fe in Ce[X]=[],Ie[X])Ie[X].hasOwnProperty(fe)&&Ce[X].push(fe);return Ce},f.addFont=function(X,fe,Ce,Fe,Ke){var ht=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&ht.indexOf(arguments[3])!==-1?Ke=arguments[3]:arguments[3]&&ht.indexOf(arguments[3])==-1&&(Ce=R(Ce,Fe)),Ke=Ke||"Identity-H",ja.call(this,X,fe,Ce,Ke)};var Mi,Ba=e.lineWidth||.200025,Ao=f.__private__.getLineWidth=f.getLineWidth=function(){return Ba},Os=f.__private__.setLineWidth=f.setLineWidth=function(X){return Ba=X,ve(L(C(X))+" w"),this};f.__private__.setLineDash=vr.API.setLineDash=vr.API.setLineDashPattern=function(X,fe){if(X=X||[],fe=fe||0,isNaN(fe)||!Array.isArray(X))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return X=X.map(function(Ce){return L(C(Ce))}).join(" "),fe=L(C(fe)),ve("["+X+"] "+fe+" d"),this};var gl=f.__private__.getLineHeight=f.getLineHeight=function(){return Ae*Mi};f.__private__.getLineHeight=f.getLineHeight=function(){return Ae*Mi};var Uu=f.__private__.setLineHeightFactor=f.setLineHeightFactor=function(X){return typeof(X=X||1.15)=="number"&&(Mi=X),this},li=f.__private__.getLineHeightFactor=f.getLineHeightFactor=function(){return Mi};Uu(e.lineHeight);var Ii=f.__private__.getHorizontalCoordinate=function(X){return C(X)},ji=f.__private__.getVerticalCoordinate=function(X){return g===y.ADVANCED?X:Tt[D].mediaBox.topRightY-Tt[D].mediaBox.bottomLeftY-C(X)},vl=f.__private__.getHorizontalCoordinateString=f.getHorizontalCoordinateString=function(X){return L(Ii(X))},xa=f.__private__.getVerticalCoordinateString=f.getVerticalCoordinateString=function(X){return L(ji(X))},xn=e.strokeColor||"0 G";f.__private__.getStrokeColor=f.getDrawColor=function(){return br(xn)},f.__private__.setStrokeColor=f.setDrawColor=function(X,fe,Ce,Fe){return xn=hr({ch1:X,ch2:fe,ch3:Ce,ch4:Fe,pdfColorType:"draw",precision:2}),ve(xn),this};var Fi=e.fillColor||"0 g";f.__private__.getFillColor=f.getFillColor=function(){return br(Fi)},f.__private__.setFillColor=f.setFillColor=function(X,fe,Ce,Fe){return Fi=hr({ch1:X,ch2:fe,ch3:Ce,ch4:Fe,pdfColorType:"fill",precision:2}),ve(Fi),this};var En=e.textColor||"0 g",ea=f.__private__.getTextColor=f.getTextColor=function(){return br(En)};f.__private__.setTextColor=f.setTextColor=function(X,fe,Ce,Fe){return En=hr({ch1:X,ch2:fe,ch3:Ce,ch4:Fe,pdfColorType:"text",precision:3}),this};var ta=e.charSpace,qa=f.__private__.getCharSpace=f.getCharSpace=function(){return parseFloat(ta||0)};f.__private__.setCharSpace=f.setCharSpace=function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return ta=X,this};var lu=0;f.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},f.__private__.setLineCap=f.setLineCap=function(X){var fe=f.CapJoinStyles[X];if(fe===void 0)throw new Error("Line cap style of '"+X+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return lu=fe,ve(fe+" J"),this};var As=0;f.__private__.setLineJoin=f.setLineJoin=function(X){var fe=f.CapJoinStyles[X];if(fe===void 0)throw new Error("Line join style of '"+X+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return As=fe,ve(fe+" j"),this},f.__private__.setLineMiterLimit=f.__private__.setMiterLimit=f.setLineMiterLimit=f.setMiterLimit=function(X){if(X=X||0,isNaN(X))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return ve(L(C(X))+" M"),this},f.GState=B1,f.setGState=function(X){(X=typeof X=="string"?Ct[St[X]]:Zs(null,X)).equals(Jt)||(ve("/"+X.id+" gs"),Jt=X)};var Zs=function(X,fe){if(!X||!St[X]){var Ce=!1;for(var Fe in Ct)if(Ct.hasOwnProperty(Fe)&&Ct[Fe].equals(fe)){Ce=!0;break}if(Ce)fe=Ct[Fe];else{var Ke="GS"+(Object.keys(Ct).length+1).toString(10);Ct[Ke]=fe,fe.id=Ke}return X&&(St[X]=fe.id),Xt.publish("addGState",fe),fe}};f.addGState=function(X,fe){return Zs(X,fe),this},f.saveGraphicsState=function(){return ve("q"),ke.push({key:Ze,size:Ae,color:En}),this},f.restoreGraphicsState=function(){ve("Q");var X=ke.pop();return Ze=X.key,Ae=X.size,En=X.color,Jt=null,this},f.setCurrentTransformationMatrix=function(X){return ve(X.toString()+" cm"),this},f.comment=function(X){return ve("#"+X),this};var Xn=function(X,fe){var Ce=X||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return Ce},set:function(ht){isNaN(ht)||(Ce=parseFloat(ht))}});var Fe=fe||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return Fe},set:function(ht){isNaN(ht)||(Fe=parseFloat(ht))}});var Ke="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return Ke},set:function(ht){Ke=ht.toString()}}),this},mi=function(X,fe,Ce,Fe){Xn.call(this,X,fe),this.type="rect";var Ke=Ce||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return Ke},set:function(Et){isNaN(Et)||(Ke=parseFloat(Et))}});var ht=Fe||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return ht},set:function(Et){isNaN(Et)||(ht=parseFloat(Et))}}),this},nn=function(){this.page=nr,this.currentPage=D,this.pages=me.slice(0),this.pagesContext=Tt.slice(0),this.x=Ht,this.y=Pt,this.matrix=It,this.width=Xo(D),this.height=Ko(D),this.outputDestination=Le,this.id="",this.objectNumber=-1};nn.prototype.restore=function(){nr=this.page,D=this.currentPage,Tt=this.pagesContext,me=this.pages,Ht=this.x,Pt=this.y,It=this.matrix,yl(D,this.width),uu(D,this.height),Le=this.outputDestination};var Qs=function(X,fe,Ce,Fe,Ke){Gt.push(new nn),nr=D=0,me=[],Ht=X,Pt=fe,It=Ke,Wo([Ce,Fe])},za=function(X){if(mt[X])Gt.pop().restore();else{var fe=new nn,Ce="Xo"+(Object.keys(Je).length+1).toString(10);fe.id=Ce,mt[X]=Ce,Je[Ce]=fe,Xt.publish("addFormObject",fe),Gt.pop().restore()}};for(var ml in f.beginFormObject=function(X,fe,Ce,Fe,Ke){return Qs(X,fe,Ce,Fe,Ke),this},f.endFormObject=function(X){return za(X),this},f.doFormObject=function(X,fe){var Ce=Je[mt[X]];return ve("q"),ve(fe.toString()+" cm"),ve("/"+Ce.id+" Do"),ve("Q"),this},f.getFormObject=function(X){var fe=Je[mt[X]];return{x:fe.x,y:fe.y,width:fe.width,height:fe.height,matrix:fe.matrix}},f.save=function(X,fe){return X=X||"generated.pdf",(fe=fe||{}).returnPromise=fe.returnPromise||!1,fe.returnPromise===!1?(_f(xs($o()),X),typeof _f.unload=="function"&&yr.setTimeout&&setTimeout(_f.unload,911),this):new Promise(function(Ce,Fe){try{var Ke=_f(xs($o()),X);typeof _f.unload=="function"&&yr.setTimeout&&setTimeout(_f.unload,911),Ce(Ke)}catch(ht){Fe(ht.message)}})},vr.API)vr.API.hasOwnProperty(ml)&&(ml==="events"&&vr.API.events.length?function(X,fe){var Ce,Fe,Ke;for(Ke=fe.length-1;Ke!==-1;Ke--)Ce=fe[Ke][0],Fe=fe[Ke][1],X.subscribe.apply(X,[Ce].concat(typeof Fe=="function"?[Fe]:Fe))}(Xt,vr.API.events):f[ml]=vr.API[ml]);var Xo=f.getPageWidth=function(X){return(Tt[X=X||D].mediaBox.topRightX-Tt[X].mediaBox.bottomLeftX)/tt},yl=f.setPageWidth=function(X,fe){Tt[X].mediaBox.topRightX=fe*tt+Tt[X].mediaBox.bottomLeftX},Ko=f.getPageHeight=function(X){return(Tt[X=X||D].mediaBox.topRightY-Tt[X].mediaBox.bottomLeftY)/tt},uu=f.setPageHeight=function(X,fe){Tt[X].mediaBox.topRightY=fe*tt+Tt[X].mediaBox.bottomLeftY};return f.internal={pdfEscape:ha,getStyle:zu,getFont:su,getFontSize:he,getCharSpace:qa,getTextColor:ea,getLineHeight:gl,getLineHeightFactor:li,getLineWidth:Ao,write:it,getHorizontalCoordinate:Ii,getVerticalCoordinate:ji,getCoordinateString:vl,getVerticalCoordinateString:xa,collections:{},newObject:_t,newAdditionalObject:zt,newObjectDeferred:xt,newObjectDeferredBegin:rt,getFilters:Qr,putStream:Sn,events:Xt,scaleFactor:tt,pageSize:{getWidth:function(){return Xo(D)},setWidth:function(X){yl(D,X)},getHeight:function(){return Ko(D)},setHeight:function(X){uu(D,X)}},encryptionOptions:h,encryption:mn,getEncryptor:Yo,output:Es,getNumberOfPages:af,pages:me,out:ve,f2:I,f3:O,getPageInfo:Fa,getPageInfoByObjId:Dt,getCurrentPageInfo:Ys,getPDFVersion:E,Point:Xn,Rectangle:mi,Matrix:bt,hasHotfix:Ps},Object.defineProperty(f.internal.pageSize,"width",{get:function(){return Xo(D)},set:function(X){yl(D,X)},enumerable:!0,configurable:!0}),Object.defineProperty(f.internal.pageSize,"height",{get:function(){return Ko(D)},set:function(X){uu(D,X)},enumerable:!0,configurable:!0}),oi.call(f,be),Ze="F1",nu(a,t),Xt.publish("initialized"),f}lh.prototype.lsbFirstWord=function(e){return String.fromCharCode(e>>0&255,e>>8&255,e>>16&255,e>>24&255)},lh.prototype.toHexString=function(e){return e.split("").map(function(r){return("0"+(255&r.charCodeAt(0)).toString(16)).slice(-2)}).join("")},lh.prototype.hexToBytes=function(e){for(var r=[],t=0;t<e.length;t+=2)r.push(String.fromCharCode(parseInt(e.substr(t,2),16)));return r.join("")},lh.prototype.processOwnerPassword=function(e,r){return I2(M2(r).substr(0,5),e)},lh.prototype.encryptor=function(e,r){var t=M2(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&r,r>>8&255)).substr(0,10);return function(n){return I2(t,n)}},B1.prototype.equals=function(e){var r,t="id,objectNumber,equals";if(!e||kn(e)!==kn(this))return!1;var n=0;for(r in this)if(!(t.indexOf(r)>=0)){if(this.hasOwnProperty(r)&&!e.hasOwnProperty(r)||this[r]!==e[r])return!1;n++}for(r in e)e.hasOwnProperty(r)&&t.indexOf(r)<0&&n--;return n===0},vr.API={events:[]},vr.version="3.0.1";var ki=vr.API,Dm=1,Df=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},ih=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Cr=function(e){return e.toFixed(2)},zc=function(e){return e.toFixed(5)};ki.__acroform__={};var ws=function(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e},tw=function(e){return e*Dm},Au=function(e){var r=new O_,t=ar.internal.getHeight(e)||0,n=ar.internal.getWidth(e)||0;return r.BBox=[0,0,Number(Cr(n)),Number(Cr(t))],r},Uk=ki.__acroform__.setBit=function(e,r){if(e=e||0,r=r||0,isNaN(e)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return e|=1<<r},Hk=ki.__acroform__.clearBit=function(e,r){if(e=e||0,r=r||0,isNaN(e)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return e&=~(1<<r)},Gk=ki.__acroform__.getBit=function(e,r){if(isNaN(e)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return(e&1<<r)==0?0:1},Ki=ki.__acroform__.getBitForPdf=function(e,r){if(isNaN(e)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return Gk(e,r-1)},Zi=ki.__acroform__.setBitForPdf=function(e,r){if(isNaN(e)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return Uk(e,r-1)},Qi=ki.__acroform__.clearBitForPdf=function(e,r){if(isNaN(e)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return Hk(e,r-1)},Vk=ki.__acroform__.calculateCoordinates=function(e,r){var t=r.internal.getHorizontalCoordinate,n=r.internal.getVerticalCoordinate,a=e[0],i=e[1],o=e[2],s=e[3],u={};return u.lowerLeft_X=t(a)||0,u.lowerLeft_Y=n(i+s)||0,u.upperRight_X=t(a+o)||0,u.upperRight_Y=n(i)||0,[Number(Cr(u.lowerLeft_X)),Number(Cr(u.lowerLeft_Y)),Number(Cr(u.upperRight_X)),Number(Cr(u.upperRight_Y))]},Wk=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var r=[],t=e._V||e.DV,n=j2(e,t),a=e.scope.internal.getFont(e.fontName,e.fontStyle).id;r.push("/Tx BMC"),r.push("q"),r.push("BT"),r.push(e.scope.__private__.encodeColorString(e.color)),r.push("/"+a+" "+Cr(n.fontSize)+" Tf"),r.push("1 0 0 1 0 0 Tm"),r.push(n.text),r.push("ET"),r.push("Q"),r.push("EMC");var i=Au(e);return i.scope=e.scope,i.stream=r.join(`
|
|
477
|
-
`),i}},j2=function(e,r){var t=e.fontSize===0?e.maxFontSize:e.fontSize,n={text:"",fontSize:""},a=(r=(r=r.substr(0,1)=="("?r.substr(1):r).substr(r.length-1)==")"?r.substr(0,r.length-1):r).split(" ");a=e.multiline?a.map(function(O){return O.split(`
|
|
478
|
-
`)}):a.map(function(O){return[O]});var i=t,o=ar.internal.getHeight(e)||0;o=o<0?-o:o;var s=ar.internal.getWidth(e)||0;s=s<0?-s:s;var u=function(O,C,A){if(O+1<a.length){var j=C+" "+a[O+1][0];return h1(j,e,A).width<=s-4}return!1};i++;e:for(;i>0;){r="",i--;var c,h,p=h1("3",e,i).height,v=e.multiline?o-i:(o-p)/2,f=v+=2,_=0,E=0,w=0;if(i<=0){r=`(...) Tj
|
|
479
|
-
`,r+="% Width of Text: "+h1(r,e,i=12).width+", FieldWidth:"+s+`
|
|
480
|
-
`;break}for(var x="",y=0,g=0;g<a.length;g++)if(a.hasOwnProperty(g)){var S=!1;if(a[g].length!==1&&w!==a[g].length-1){if((p+2)*(y+2)+2>o)continue e;x+=a[g][w],S=!0,E=g,g--}else{x=(x+=a[g][w]+" ").substr(x.length-1)==" "?x.substr(0,x.length-1):x;var b=parseInt(g),R=u(b,x,i),L=g>=a.length-1;if(R&&!L){x+=" ",w=0;continue}if(R||L){if(L)E=b;else if(e.multiline&&(p+2)*(y+2)+2>o)continue e}else{if(!e.multiline||(p+2)*(y+2)+2>o)continue e;E=b}}for(var T="",F=_;F<=E;F++){var I=a[F];if(e.multiline){if(F===E){T+=I[w]+" ",w=(w+1)%I.length;continue}if(F===_){T+=I[I.length-1]+" ";continue}}T+=I[0]+" "}switch(T=T.substr(T.length-1)==" "?T.substr(0,T.length-1):T,h=h1(T,e,i).width,e.textAlign){case"right":c=s-h-2;break;case"center":c=(s-h)/2;break;case"left":default:c=2}r+=Cr(c)+" "+Cr(f)+` Td
|
|
481
|
-
`,r+="("+Df(T)+`) Tj
|
|
482
|
-
`,r+=-Cr(c)+` 0 Td
|
|
483
|
-
`,f=-(i+2),h=0,_=S?E:E+1,y++,x=""}break}return n.text=r,n.fontSize=i,n},h1=function(e,r,t){var n=r.scope.internal.getFont(r.fontName,r.fontStyle),a=r.scope.getStringUnitWidth(e,{font:n,fontSize:parseFloat(t),charSpace:0})*parseFloat(t);return{height:r.scope.getStringUnitWidth("3",{font:n,fontSize:parseFloat(t),charSpace:0})*parseFloat(t)*1.5,width:a}},$k={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},Yk=function(e,r){var t={type:"reference",object:e};r.internal.getPageInfo(e.page).pageContext.annotations.find(function(n){return n.type===t.type&&n.object===t.object})===void 0&&r.internal.getPageInfo(e.page).pageContext.annotations.push(t)},Xk=function(e,r){for(var t in e)if(e.hasOwnProperty(t)){var n=t,a=e[t];r.internal.newObjectDeferredBegin(a.objId,!0),kn(a)==="object"&&typeof a.putStream=="function"&&a.putStream(),delete e[n]}},Kk=function(e,r){if(r.scope=e,e.internal!==void 0&&(e.internal.acroformPlugin===void 0||e.internal.acroformPlugin.isInitialized===!1)){if(Jl.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify($k)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");Dm=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new A_,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe("postPutResources",function(){(function(t){t.internal.events.unsubscribe(t.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete t.internal.acroformPlugin.acroFormDictionaryRoot._eventID,t.internal.acroformPlugin.printedOut=!0})(e)}),e.internal.events.subscribe("buildDocument",function(){(function(t){t.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var n=t.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var a in n)if(n.hasOwnProperty(a)){var i=n[a];i.objId=void 0,i.hasAnnotation&&Yk(i,t)}})(e)}),e.internal.events.subscribe("putCatalog",function(){(function(t){if(t.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");t.internal.write("/AcroForm "+t.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(e)}),e.internal.events.subscribe("postPutPages",function(t){(function(n,a){var i=!n;for(var o in n||(a.internal.newObjectDeferredBegin(a.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),a.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),n=n||a.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(n.hasOwnProperty(o)){var s=n[o],u=[],c=s.Rect;if(s.Rect&&(s.Rect=Vk(s.Rect,a)),a.internal.newObjectDeferredBegin(s.objId,!0),s.DA=ar.createDefaultAppearanceStream(s),kn(s)==="object"&&typeof s.getKeyValueListForStream=="function"&&(u=s.getKeyValueListForStream()),s.Rect=c,s.hasAppearanceStream&&!s.appearanceStreamContent){var h=Wk(s);u.push({key:"AP",value:"<</N "+h+">>"}),a.internal.acroformPlugin.xForms.push(h)}if(s.appearanceStreamContent){var p="";for(var v in s.appearanceStreamContent)if(s.appearanceStreamContent.hasOwnProperty(v)){var f=s.appearanceStreamContent[v];if(p+="/"+v+" ",p+="<<",Object.keys(f).length>=1||Array.isArray(f)){for(var o in f)if(f.hasOwnProperty(o)){var _=f[o];typeof _=="function"&&(_=_.call(a,s)),p+="/"+o+" "+_+" ",a.internal.acroformPlugin.xForms.indexOf(_)>=0||a.internal.acroformPlugin.xForms.push(_)}}else typeof(_=f)=="function"&&(_=_.call(a,s)),p+="/"+o+" "+_,a.internal.acroformPlugin.xForms.indexOf(_)>=0||a.internal.acroformPlugin.xForms.push(_);p+=">>"}u.push({key:"AP",value:`<<
|
|
484
|
-
`+p+">>"})}a.internal.putStream({additionalKeyValues:u,objectId:s.objId}),a.internal.out("endobj")}i&&Xk(a.internal.acroformPlugin.xForms,a)})(t,e)}),e.internal.acroformPlugin.isInitialized=!0}},P_=ki.__acroform__.arrayToPdfArray=function(e,r,t){var n=function(o){return o};if(Array.isArray(e)){for(var a="[",i=0;i<e.length;i++)switch(i!==0&&(a+=" "),kn(e[i])){case"boolean":case"number":case"object":a+=e[i].toString();break;case"string":e[i].substr(0,1)!=="/"?(r!==void 0&&t&&(n=t.internal.getEncryptor(r)),a+="("+Df(n(e[i].toString()))+")"):a+=e[i].toString()}return a+="]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},u2=function(e,r,t){var n=function(a){return a};return r!==void 0&&t&&(n=t.internal.getEncryptor(r)),(e=e||"").toString(),e="("+Df(n(e))+")"},Lu=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(e){this._objId=e}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};Lu.prototype.toString=function(){return this.objId+" 0 R"},Lu.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},Lu.prototype.getKeyValueListForStream=function(){var e=[],r=Object.getOwnPropertyNames(this).filter(function(i){return i!="content"&&i!="appearanceStreamContent"&&i!="scope"&&i!="objId"&&i.substring(0,1)!="_"});for(var t in r)if(Object.getOwnPropertyDescriptor(this,r[t]).configurable===!1){var n=r[t],a=this[n];a&&(Array.isArray(a)?e.push({key:n,value:P_(a,this.objId,this.scope)}):a instanceof Lu?(a.scope=this.scope,e.push({key:n,value:a.objId+" 0 R"})):typeof a!="function"&&e.push({key:n,value:a}))}return e};var O_=function(){Lu.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var e,r=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return r},set:function(t){r=t}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(t){e=t.trim()},get:function(){return e||null}})};ws(O_,Lu);var A_=function(){Lu.call(this);var e,r=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return r.length>0?r:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return r}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var t=function(n){return n};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),"("+Df(t(e))+")"}},set:function(t){e=t}})};ws(A_,Lu);var Jl=function e(){Lu.call(this);var r=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return r},set:function(x){if(isNaN(x))throw new Error('Invalid value "'+x+'" for attribute F supplied.');r=x}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!Ki(r,3)},set:function(x){x?this.F=Zi(r,3):this.F=Qi(r,3)}});var t=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return t},set:function(x){if(isNaN(x))throw new Error('Invalid value "'+x+'" for attribute Ff supplied.');t=x}});var n=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(n.length!==0)return n},set:function(x){n=x!==void 0?x:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[0])?0:n[0]},set:function(x){n[0]=x}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[1])?0:n[1]},set:function(x){n[1]=x}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[2])?0:n[2]},set:function(x){n[2]=x}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[3])?0:n[3]},set:function(x){n[3]=x}});var a="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return a},set:function(x){switch(x){case"/Btn":case"/Tx":case"/Ch":case"/Sig":a=x;break;default:throw new Error('Invalid value "'+x+'" for attribute FT supplied.')}}});var i=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!i||i.length<1){if(this instanceof q1)return;i="FieldObject"+e.FieldNum++}var x=function(y){return y};return this.scope&&(x=this.scope.internal.getEncryptor(this.objId)),"("+Df(x(i))+")"},set:function(x){i=x.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return i},set:function(x){i=x}});var o="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return o},set:function(x){o=x}});var s="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return s},set:function(x){s=x}});var u=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return u},set:function(x){u=x}});var c=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return c===void 0?50/Dm:c},set:function(x){c=x}});var h="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return h},set:function(x){h=x}});var p="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!p||this instanceof q1||this instanceof Of))return u2(p,this.objId,this.scope)},set:function(x){x=x.toString(),p=x}});var v=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(v)return this instanceof Ta?v:u2(v,this.objId,this.scope)},set:function(x){x=x.toString(),v=this instanceof Ta?x:x.substr(0,1)==="("?ih(x.substr(1,x.length-2)):ih(x)}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ta?ih(v.substr(1,v.length-1)):v},set:function(x){x=x.toString(),v=this instanceof Ta?"/"+x:x}});var f=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(f)return f},set:function(x){this.V=x}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(f)return this instanceof Ta?f:u2(f,this.objId,this.scope)},set:function(x){x=x.toString(),f=this instanceof Ta?x:x.substr(0,1)==="("?ih(x.substr(1,x.length-2)):ih(x)}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ta?ih(f.substr(1,f.length-1)):f},set:function(x){x=x.toString(),f=this instanceof Ta?"/"+x:x}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var _,E=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return E},set:function(x){x=!!x,E=x}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(_)return _},set:function(x){_=x}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,1)},set:function(x){x?this.Ff=Zi(this.Ff,1):this.Ff=Qi(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,2)},set:function(x){x?this.Ff=Zi(this.Ff,2):this.Ff=Qi(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,3)},set:function(x){x?this.Ff=Zi(this.Ff,3):this.Ff=Qi(this.Ff,3)}});var w=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(w!==null)return w},set:function(x){if([0,1,2].indexOf(x)===-1)throw new Error('Invalid value "'+x+'" for attribute Q supplied.');w=x}}),Object.defineProperty(this,"textAlign",{get:function(){var x;switch(w){case 0:default:x="left";break;case 1:x="center";break;case 2:x="right"}return x},configurable:!0,enumerable:!0,set:function(x){switch(x){case"right":case 2:w=2;break;case"center":case 1:w=1;break;case"left":case 0:default:w=0}}})};ws(Jl,Lu);var gh=function(){Jl.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){e=t}});var r=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return P_(r,this.objId,this.scope)},set:function(t){var n,a;a=[],typeof(n=t)=="string"&&(a=function(i,o,s){s||(s=1);for(var u,c=[];u=o.exec(i);)c.push(u[s]);return c}(n,/\((.*?)\)/g)),r=a}}),this.getOptions=function(){return r},this.setOptions=function(t){r=t,this.sort&&r.sort()},this.addOption=function(t){t=(t=t||"").toString(),r.push(t),this.sort&&r.sort()},this.removeOption=function(t,n){for(n=n||!1,t=(t=t||"").toString();r.indexOf(t)!==-1&&(r.splice(r.indexOf(t),1),n!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,18)},set:function(t){t?this.Ff=Zi(this.Ff,18):this.Ff=Qi(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,19)},set:function(t){this.combo===!0&&(t?this.Ff=Zi(this.Ff,19):this.Ff=Qi(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,20)},set:function(t){t?(this.Ff=Zi(this.Ff,20),r.sort()):this.Ff=Qi(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,22)},set:function(t){t?this.Ff=Zi(this.Ff,22):this.Ff=Qi(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,23)},set:function(t){t?this.Ff=Zi(this.Ff,23):this.Ff=Qi(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,27)},set:function(t){t?this.Ff=Zi(this.Ff,27):this.Ff=Qi(this.Ff,27)}}),this.hasAppearanceStream=!1};ws(gh,Jl);var vh=function(){gh.call(this),this.fontName="helvetica",this.combo=!1};ws(vh,gh);var mh=function(){vh.call(this),this.combo=!0};ws(mh,vh);var _1=function(){mh.call(this),this.edit=!0};ws(_1,mh);var Ta=function(){Jl.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,15)},set:function(t){t?this.Ff=Zi(this.Ff,15):this.Ff=Qi(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,16)},set:function(t){t?this.Ff=Zi(this.Ff,16):this.Ff=Qi(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,17)},set:function(t){t?this.Ff=Zi(this.Ff,17):this.Ff=Qi(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,26)},set:function(t){t?this.Ff=Zi(this.Ff,26):this.Ff=Qi(this.Ff,26)}});var e,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t=function(i){return i};if(this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),Object.keys(r).length!==0){var n,a=[];for(n in a.push("<<"),r)a.push("/"+n+" ("+Df(t(r[n]))+")");return a.push(">>"),a.join(`
|
|
485
|
-
`)}},set:function(t){kn(t)==="object"&&(r=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(t){typeof t=="string"&&(r.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e="/"+t}})};ws(Ta,Jl);var S1=function(){Ta.call(this),this.pushButton=!0};ws(S1,Ta);var yh=function(){Ta.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(r){e=r!==void 0?r:[]}})};ws(yh,Ta);var q1=function(){var e,r;Jl.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(a){e=a}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return r},set:function(a){r=a}});var t,n={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var a=function(s){return s};this.scope&&(a=this.scope.internal.getEncryptor(this.objId));var i,o=[];for(i in o.push("<<"),n)o.push("/"+i+" ("+Df(a(n[i]))+")");return o.push(">>"),o.join(`
|
|
486
|
-
`)},set:function(a){kn(a)==="object"&&(n=a)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(a){typeof a=="string"&&(n.CA=a)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(a){t=a}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(a){t="/"+a}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=ar.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};ws(q1,Jl),yh.prototype.setAppearance=function(e){if(!("createAppearanceStream"in e)||!("getCA"in e))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var r in this.Kids)if(this.Kids.hasOwnProperty(r)){var t=this.Kids[r];t.appearanceStreamContent=e.createAppearanceStream(t.optionName),t.caption=e.getCA()}},yh.prototype.createOption=function(e){var r=new q1;return r.Parent=this,r.optionName=e,this.Kids.push(r),Zk.call(this.scope,r),r};var x1=function(){Ta.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=ar.CheckBox.createAppearanceStream()};ws(x1,Ta);var Of=function(){Jl.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,13)},set:function(r){r?this.Ff=Zi(this.Ff,13):this.Ff=Qi(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,21)},set:function(r){r?this.Ff=Zi(this.Ff,21):this.Ff=Qi(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,23)},set:function(r){r?this.Ff=Zi(this.Ff,23):this.Ff=Qi(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,24)},set:function(r){r?this.Ff=Zi(this.Ff,24):this.Ff=Qi(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,25)},set:function(r){r?this.Ff=Zi(this.Ff,25):this.Ff=Qi(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,26)},set:function(r){r?this.Ff=Zi(this.Ff,26):this.Ff=Qi(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(r){e=r}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(r){Number.isInteger(r)&&(e=r)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};ws(Of,Jl);var E1=function(){Of.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,14)},set:function(e){e?this.Ff=Zi(this.Ff,14):this.Ff=Qi(this.Ff,14)}}),this.password=!0};ws(E1,Of);var ar={CheckBox:{createAppearanceStream:function(){return{N:{On:ar.CheckBox.YesNormal},D:{On:ar.CheckBox.YesPushDown,Off:ar.CheckBox.OffPushDown}}},YesPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=[],n=e.scope.internal.getFont(e.fontName,e.fontStyle).id,a=e.scope.__private__.encodeColorString(e.color),i=j2(e,e.caption);return t.push("0.749023 g"),t.push("0 0 "+Cr(ar.internal.getWidth(e))+" "+Cr(ar.internal.getHeight(e))+" re"),t.push("f"),t.push("BMC"),t.push("q"),t.push("0 0 1 rg"),t.push("/"+n+" "+Cr(i.fontSize)+" Tf "+a),t.push("BT"),t.push(i.text),t.push("ET"),t.push("Q"),t.push("EMC"),r.stream=t.join(`
|
|
487
|
-
`),r},YesNormal:function(e){var r=Au(e);r.scope=e.scope;var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color),a=[],i=ar.internal.getHeight(e),o=ar.internal.getWidth(e),s=j2(e,e.caption);return a.push("1 g"),a.push("0 0 "+Cr(o)+" "+Cr(i)+" re"),a.push("f"),a.push("q"),a.push("0 0 1 rg"),a.push("0 0 "+Cr(o-1)+" "+Cr(i-1)+" re"),a.push("W"),a.push("n"),a.push("0 g"),a.push("BT"),a.push("/"+t+" "+Cr(s.fontSize)+" Tf "+n),a.push(s.text),a.push("ET"),a.push("Q"),r.stream=a.join(`
|
|
488
|
-
`),r},OffPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=[];return t.push("0.749023 g"),t.push("0 0 "+Cr(ar.internal.getWidth(e))+" "+Cr(ar.internal.getHeight(e))+" re"),t.push("f"),r.stream=t.join(`
|
|
489
|
-
`),r}},RadioButton:{Circle:{createAppearanceStream:function(e){var r={D:{Off:ar.RadioButton.Circle.OffPushDown},N:{}};return r.N[e]=ar.RadioButton.Circle.YesNormal,r.D[e]=ar.RadioButton.Circle.YesPushDown,r},getCA:function(){return"l"},YesNormal:function(e){var r=Au(e);r.scope=e.scope;var t=[],n=ar.internal.getWidth(e)<=ar.internal.getHeight(e)?ar.internal.getWidth(e)/4:ar.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var a=ar.internal.Bezier_C,i=Number((n*a).toFixed(5));return t.push("q"),t.push("1 0 0 1 "+zc(ar.internal.getWidth(e)/2)+" "+zc(ar.internal.getHeight(e)/2)+" cm"),t.push(n+" 0 m"),t.push(n+" "+i+" "+i+" "+n+" 0 "+n+" c"),t.push("-"+i+" "+n+" -"+n+" "+i+" -"+n+" 0 c"),t.push("-"+n+" -"+i+" -"+i+" -"+n+" 0 -"+n+" c"),t.push(i+" -"+n+" "+n+" -"+i+" "+n+" 0 c"),t.push("f"),t.push("Q"),r.stream=t.join(`
|
|
490
|
-
`),r},YesPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=[],n=ar.internal.getWidth(e)<=ar.internal.getHeight(e)?ar.internal.getWidth(e)/4:ar.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var a=Number((2*n).toFixed(5)),i=Number((a*ar.internal.Bezier_C).toFixed(5)),o=Number((n*ar.internal.Bezier_C).toFixed(5));return t.push("0.749023 g"),t.push("q"),t.push("1 0 0 1 "+zc(ar.internal.getWidth(e)/2)+" "+zc(ar.internal.getHeight(e)/2)+" cm"),t.push(a+" 0 m"),t.push(a+" "+i+" "+i+" "+a+" 0 "+a+" c"),t.push("-"+i+" "+a+" -"+a+" "+i+" -"+a+" 0 c"),t.push("-"+a+" -"+i+" -"+i+" -"+a+" 0 -"+a+" c"),t.push(i+" -"+a+" "+a+" -"+i+" "+a+" 0 c"),t.push("f"),t.push("Q"),t.push("0 g"),t.push("q"),t.push("1 0 0 1 "+zc(ar.internal.getWidth(e)/2)+" "+zc(ar.internal.getHeight(e)/2)+" cm"),t.push(n+" 0 m"),t.push(n+" "+o+" "+o+" "+n+" 0 "+n+" c"),t.push("-"+o+" "+n+" -"+n+" "+o+" -"+n+" 0 c"),t.push("-"+n+" -"+o+" -"+o+" -"+n+" 0 -"+n+" c"),t.push(o+" -"+n+" "+n+" -"+o+" "+n+" 0 c"),t.push("f"),t.push("Q"),r.stream=t.join(`
|
|
491
|
-
`),r},OffPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=[],n=ar.internal.getWidth(e)<=ar.internal.getHeight(e)?ar.internal.getWidth(e)/4:ar.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var a=Number((2*n).toFixed(5)),i=Number((a*ar.internal.Bezier_C).toFixed(5));return t.push("0.749023 g"),t.push("q"),t.push("1 0 0 1 "+zc(ar.internal.getWidth(e)/2)+" "+zc(ar.internal.getHeight(e)/2)+" cm"),t.push(a+" 0 m"),t.push(a+" "+i+" "+i+" "+a+" 0 "+a+" c"),t.push("-"+i+" "+a+" -"+a+" "+i+" -"+a+" 0 c"),t.push("-"+a+" -"+i+" -"+i+" -"+a+" 0 -"+a+" c"),t.push(i+" -"+a+" "+a+" -"+i+" "+a+" 0 c"),t.push("f"),t.push("Q"),r.stream=t.join(`
|
|
492
|
-
`),r}},Cross:{createAppearanceStream:function(e){var r={D:{Off:ar.RadioButton.Cross.OffPushDown},N:{}};return r.N[e]=ar.RadioButton.Cross.YesNormal,r.D[e]=ar.RadioButton.Cross.YesPushDown,r},getCA:function(){return"8"},YesNormal:function(e){var r=Au(e);r.scope=e.scope;var t=[],n=ar.internal.calculateCross(e);return t.push("q"),t.push("1 1 "+Cr(ar.internal.getWidth(e)-2)+" "+Cr(ar.internal.getHeight(e)-2)+" re"),t.push("W"),t.push("n"),t.push(Cr(n.x1.x)+" "+Cr(n.x1.y)+" m"),t.push(Cr(n.x2.x)+" "+Cr(n.x2.y)+" l"),t.push(Cr(n.x4.x)+" "+Cr(n.x4.y)+" m"),t.push(Cr(n.x3.x)+" "+Cr(n.x3.y)+" l"),t.push("s"),t.push("Q"),r.stream=t.join(`
|
|
493
|
-
`),r},YesPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=ar.internal.calculateCross(e),n=[];return n.push("0.749023 g"),n.push("0 0 "+Cr(ar.internal.getWidth(e))+" "+Cr(ar.internal.getHeight(e))+" re"),n.push("f"),n.push("q"),n.push("1 1 "+Cr(ar.internal.getWidth(e)-2)+" "+Cr(ar.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(Cr(t.x1.x)+" "+Cr(t.x1.y)+" m"),n.push(Cr(t.x2.x)+" "+Cr(t.x2.y)+" l"),n.push(Cr(t.x4.x)+" "+Cr(t.x4.y)+" m"),n.push(Cr(t.x3.x)+" "+Cr(t.x3.y)+" l"),n.push("s"),n.push("Q"),r.stream=n.join(`
|
|
494
|
-
`),r},OffPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=[];return t.push("0.749023 g"),t.push("0 0 "+Cr(ar.internal.getWidth(e))+" "+Cr(ar.internal.getHeight(e))+" re"),t.push("f"),r.stream=t.join(`
|
|
495
|
-
`),r}}},createDefaultAppearanceStream:function(e){var r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,t=e.scope.__private__.encodeColorString(e.color);return"/"+r+" "+e.fontSize+" Tf "+t}};ar.internal={Bezier_C:.551915024494,calculateCross:function(e){var r=ar.internal.getWidth(e),t=ar.internal.getHeight(e),n=Math.min(r,t);return{x1:{x:(r-n)/2,y:(t-n)/2+n},x2:{x:(r-n)/2+n,y:(t-n)/2},x3:{x:(r-n)/2,y:(t-n)/2},x4:{x:(r-n)/2+n,y:(t-n)/2+n}}}},ar.internal.getWidth=function(e){var r=0;return kn(e)==="object"&&(r=tw(e.Rect[2])),r},ar.internal.getHeight=function(e){var r=0;return kn(e)==="object"&&(r=tw(e.Rect[3])),r};var Zk=ki.addField=function(e){if(Kk(this,e),!(e instanceof Jl))throw new Error("Invalid argument passed to jsPDF.addField.");var r;return(r=e).scope.internal.acroformPlugin.printedOut&&(r.scope.internal.acroformPlugin.printedOut=!1,r.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),r.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(r),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};ki.AcroFormChoiceField=gh,ki.AcroFormListBox=vh,ki.AcroFormComboBox=mh,ki.AcroFormEditBox=_1,ki.AcroFormButton=Ta,ki.AcroFormPushButton=S1,ki.AcroFormRadioButton=yh,ki.AcroFormCheckBox=x1,ki.AcroFormTextField=Of,ki.AcroFormPasswordField=E1,ki.AcroFormAppearance=ar,ki.AcroForm={ChoiceField:gh,ListBox:vh,ComboBox:mh,EditBox:_1,Button:Ta,PushButton:S1,RadioButton:yh,CheckBox:x1,TextField:Of,PasswordField:E1,Appearance:ar},vr.AcroForm={ChoiceField:gh,ListBox:vh,ComboBox:mh,EditBox:_1,Button:Ta,PushButton:S1,RadioButton:yh,CheckBox:x1,TextField:Of,PasswordField:E1,Appearance:ar};vr.AcroForm;function C_(e){return e.reduce(function(r,t,n){return r[t]=n,r},{})}(function(e){e.__addimage__={};var r="UNKNOWN",t={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},n=e.__addimage__.getImageFileTypeByImageData=function(O,C){var A,j,N,B,W,Y=r;if((C=C||r)==="RGBA"||O.data!==void 0&&O.data instanceof Uint8ClampedArray&&"height"in O&&"width"in O)return"RGBA";if(R(O))for(W in t)for(N=t[W],A=0;A<N.length;A+=1){for(B=!0,j=0;j<N[A].length;j+=1)if(N[A][j]!==void 0&&N[A][j]!==O[j]){B=!1;break}if(B===!0){Y=W;break}}else for(W in t)for(N=t[W],A=0;A<N.length;A+=1){for(B=!0,j=0;j<N[A].length;j+=1)if(N[A][j]!==void 0&&N[A][j]!==O.charCodeAt(j)){B=!1;break}if(B===!0){Y=W;break}}return Y===r&&C!==r&&(Y=C),Y},a=function O(C){for(var A=this.internal.write,j=this.internal.putStream,N=(0,this.internal.getFilters)();N.indexOf("FlateEncode")!==-1;)N.splice(N.indexOf("FlateEncode"),1);C.objectId=this.internal.newObject();var B=[];if(B.push({key:"Type",value:"/XObject"}),B.push({key:"Subtype",value:"/Image"}),B.push({key:"Width",value:C.width}),B.push({key:"Height",value:C.height}),C.colorSpace===w.INDEXED?B.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(C.palette.length/3-1)+" "+("sMask"in C&&C.sMask!==void 0?C.objectId+2:C.objectId+1)+" 0 R]"}):(B.push({key:"ColorSpace",value:"/"+C.colorSpace}),C.colorSpace===w.DEVICE_CMYK&&B.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),B.push({key:"BitsPerComponent",value:C.bitsPerComponent}),"decodeParameters"in C&&C.decodeParameters!==void 0&&B.push({key:"DecodeParms",value:"<<"+C.decodeParameters+">>"}),"transparency"in C&&Array.isArray(C.transparency)){for(var W="",Y=0,Z=C.transparency.length;Y<Z;Y++)W+=C.transparency[Y]+" "+C.transparency[Y]+" ";B.push({key:"Mask",value:"["+W+"]"})}C.sMask!==void 0&&B.push({key:"SMask",value:C.objectId+1+" 0 R"});var V=C.filter!==void 0?["/"+C.filter]:void 0;if(j({data:C.data,additionalKeyValues:B,alreadyAppliedFilters:V,objectId:C.objectId}),A("endobj"),"sMask"in C&&C.sMask!==void 0){var H="/Predictor "+C.predictor+" /Colors 1 /BitsPerComponent "+C.bitsPerComponent+" /Columns "+C.width,U={width:C.width,height:C.height,colorSpace:"DeviceGray",bitsPerComponent:C.bitsPerComponent,decodeParameters:H,data:C.sMask};"filter"in C&&(U.filter=C.filter),O.call(this,U)}if(C.colorSpace===w.INDEXED){var D=this.internal.newObject();j({data:T(new Uint8Array(C.palette)),objectId:D}),A("endobj")}},i=function(){var O=this.internal.collections.addImage_images;for(var C in O)a.call(this,O[C])},o=function(){var O,C=this.internal.collections.addImage_images,A=this.internal.write;for(var j in C)A("/I"+(O=C[j]).index,O.objectId,"0","R")},s=function(){this.internal.collections.addImage_images||(this.internal.collections.addImage_images={},this.internal.events.subscribe("putResources",i),this.internal.events.subscribe("putXobjectDict",o))},u=function(){var O=this.internal.collections.addImage_images;return s.call(this),O},c=function(){return Object.keys(this.internal.collections.addImage_images).length},h=function(O){return typeof e["process"+O.toUpperCase()]=="function"},p=function(O){return kn(O)==="object"&&O.nodeType===1},v=function(O,C){if(O.nodeName==="IMG"&&O.hasAttribute("src")){var A=""+O.getAttribute("src");if(A.indexOf("data:image/")===0)return cp(unescape(A).split("base64,").pop());var j=e.loadFile(A,!0);if(j!==void 0)return j}if(O.nodeName==="CANVAS"){if(O.width===0||O.height===0)throw new Error("Given canvas must have data. Canvas width: "+O.width+", height: "+O.height);var N;switch(C){case"PNG":N="image/png";break;case"WEBP":N="image/webp";break;case"JPEG":case"JPG":default:N="image/jpeg"}return cp(O.toDataURL(N,1).split("base64,").pop())}},f=function(O){var C=this.internal.collections.addImage_images;if(C){for(var A in C)if(O===C[A].alias)return C[A]}},_=function(O,C,A){return O||C||(O=-96,C=-96),O<0&&(O=-1*A.width*72/O/this.internal.scaleFactor),C<0&&(C=-1*A.height*72/C/this.internal.scaleFactor),O===0&&(O=C*A.width/A.height),C===0&&(C=O*A.height/A.width),[O,C]},E=function(O,C,A,j,N,B){var W=_.call(this,A,j,N),Y=this.internal.getCoordinateString,Z=this.internal.getVerticalCoordinateString,V=u.call(this);if(A=W[0],j=W[1],V[N.index]=N,B){B*=Math.PI/180;var H=Math.cos(B),U=Math.sin(B),D=function(Q){return Q.toFixed(4)},$=[D(H),D(U),D(-1*U),D(H),0,0,"cm"]}this.internal.write("q"),B?(this.internal.write([1,"0","0",1,Y(O),Z(C+j),"cm"].join(" ")),this.internal.write($.join(" ")),this.internal.write([Y(A),"0","0",Y(j),"0","0","cm"].join(" "))):this.internal.write([Y(A),"0","0",Y(j),Y(O),Z(C+j),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+N.index+" Do"),this.internal.write("Q")},w=e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var x=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},y=e.__addimage__.sHashCode=function(O){var C,A,j=0;if(typeof O=="string")for(A=O.length,C=0;C<A;C++)j=(j<<5)-j+O.charCodeAt(C),j|=0;else if(R(O))for(A=O.byteLength/2,C=0;C<A;C++)j=(j<<5)-j+O[C],j|=0;return j},g=e.__addimage__.validateStringAsBase64=function(O){(O=O||"").toString().trim();var C=!0;return O.length===0&&(C=!1),O.length%4!=0&&(C=!1),/^[A-Za-z0-9+/]+$/.test(O.substr(0,O.length-2))===!1&&(C=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(O.substr(-2))===!1&&(C=!1),C},S=e.__addimage__.extractImageFromDataUrl=function(O){if(O==null||!(O=O.trim()).startsWith("data:"))return null;var C=O.indexOf(",");return C<0?null:O.substring(0,C).trim().endsWith("base64")?O.substring(C+1):null},b=e.__addimage__.supportsArrayBuffer=function(){return typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"};e.__addimage__.isArrayBuffer=function(O){return b()&&O instanceof ArrayBuffer};var R=e.__addimage__.isArrayBufferView=function(O){return b()&&typeof Uint32Array<"u"&&(O instanceof Int8Array||O instanceof Uint8Array||typeof Uint8ClampedArray<"u"&&O instanceof Uint8ClampedArray||O instanceof Int16Array||O instanceof Uint16Array||O instanceof Int32Array||O instanceof Uint32Array||O instanceof Float32Array||O instanceof Float64Array)},L=e.__addimage__.binaryStringToUint8Array=function(O){for(var C=O.length,A=new Uint8Array(C),j=0;j<C;j++)A[j]=O.charCodeAt(j);return A},T=e.__addimage__.arrayBufferToBinaryString=function(O){for(var C="",A=R(O)?O:new Uint8Array(O),j=0;j<A.length;j+=8192)C+=String.fromCharCode.apply(null,A.subarray(j,j+8192));return C};e.addImage=function(){var O,C,A,j,N,B,W,Y,Z;if(typeof arguments[1]=="number"?(C=r,A=arguments[1],j=arguments[2],N=arguments[3],B=arguments[4],W=arguments[5],Y=arguments[6],Z=arguments[7]):(C=arguments[1],A=arguments[2],j=arguments[3],N=arguments[4],B=arguments[5],W=arguments[6],Y=arguments[7],Z=arguments[8]),kn(O=arguments[0])==="object"&&!p(O)&&"imageData"in O){var V=O;O=V.imageData,C=V.format||C||r,A=V.x||A||0,j=V.y||j||0,N=V.w||V.width||N,B=V.h||V.height||B,W=V.alias||W,Y=V.compression||Y,Z=V.rotation||V.angle||Z}var H=this.internal.getFilters();if(Y===void 0&&H.indexOf("FlateEncode")!==-1&&(Y="SLOW"),isNaN(A)||isNaN(j))throw new Error("Invalid coordinates passed to jsPDF.addImage");s.call(this);var U=F.call(this,O,C,W,Y);return E.call(this,A,j,N,B,U,Z),this};var F=function(O,C,A,j){var N,B,W;if(typeof O=="string"&&n(O)===r){O=unescape(O);var Y=I(O,!1);(Y!==""||(Y=e.loadFile(O,!0))!==void 0)&&(O=Y)}if(p(O)&&(O=v(O,C)),C=n(O,C),!h(C))throw new Error("addImage does not support files of type '"+C+"', please ensure that a plugin for '"+C+"' support is added.");if(((W=A)==null||W.length===0)&&(A=function(Z){return typeof Z=="string"||R(Z)?y(Z):R(Z.data)?y(Z.data):null}(O)),(N=f.call(this,A))||(b()&&(O instanceof Uint8Array||C==="RGBA"||(B=O,O=L(O))),N=this["process"+C.toUpperCase()](O,c.call(this),A,function(Z){return Z&&typeof Z=="string"&&(Z=Z.toUpperCase()),Z in e.image_compression?Z:x.NONE}(j),B)),!N)throw new Error("An unknown error occurred whilst processing the image.");return N},I=e.__addimage__.convertBase64ToBinaryString=function(O,C){C=typeof C!="boolean"||C;var A,j="";if(typeof O=="string"){var N;A=(N=S(O))!==null&&N!==void 0?N:O;try{j=cp(A)}catch(B){if(C)throw g(A)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+B.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return j};e.getImageProperties=function(O){var C,A,j="";if(p(O)&&(O=v(O)),typeof O=="string"&&n(O)===r&&((j=I(O,!1))===""&&(j=e.loadFile(O)||""),O=j),A=n(O),!h(A))throw new Error("addImage does not support files of type '"+A+"', please ensure that a plugin for '"+A+"' support is added.");if(!b()||O instanceof Uint8Array||(O=L(O)),!(C=this["process"+A.toUpperCase()](O)))throw new Error("An unknown error occurred whilst processing the image");return C.fileType=A,C}})(vr.API),function(e){var r=function(t){if(t!==void 0&&t!="")return!0};vr.API.events.push(["addPage",function(t){this.internal.getPageInfo(t.pageNumber).pageContext.annotations=[]}]),e.events.push(["putPage",function(t){for(var n,a,i,o=this.internal.getCoordinateString,s=this.internal.getVerticalCoordinateString,u=this.internal.getPageInfoByObjId(t.objId),c=t.pageContext.annotations,h=!1,p=0;p<c.length&&!h;p++)switch((n=c[p]).type){case"link":(r(n.options.url)||r(n.options.pageNumber))&&(h=!0);break;case"reference":case"text":case"freetext":h=!0}if(h!=0){this.internal.write("/Annots [");for(var v=0;v<c.length;v++){n=c[v];var f=this.internal.pdfEscape,_=this.internal.getEncryptor(t.objId);switch(n.type){case"reference":this.internal.write(" "+n.object.objId+" 0 R ");break;case"text":var E=this.internal.newAdditionalObject(),w=this.internal.newAdditionalObject(),x=this.internal.getEncryptor(E.objId),y=n.title||"Note";i="<</Type /Annot /Subtype /Text "+(a="/Rect ["+o(n.bounds.x)+" "+s(n.bounds.y+n.bounds.h)+" "+o(n.bounds.x+n.bounds.w)+" "+s(n.bounds.y)+"] ")+"/Contents ("+f(x(n.contents))+")",i+=" /Popup "+w.objId+" 0 R",i+=" /P "+u.objId+" 0 R",i+=" /T ("+f(x(y))+") >>",E.content=i;var g=E.objId+" 0 R";i="<</Type /Annot /Subtype /Popup "+(a="/Rect ["+o(n.bounds.x+30)+" "+s(n.bounds.y+n.bounds.h)+" "+o(n.bounds.x+n.bounds.w+30)+" "+s(n.bounds.y)+"] ")+" /Parent "+g,n.open&&(i+=" /Open true"),i+=" >>",w.content=i,this.internal.write(E.objId,"0 R",w.objId,"0 R");break;case"freetext":a="/Rect ["+o(n.bounds.x)+" "+s(n.bounds.y)+" "+o(n.bounds.x+n.bounds.w)+" "+s(n.bounds.y+n.bounds.h)+"] ";var S=n.color||"#000000";i="<</Type /Annot /Subtype /FreeText "+a+"/Contents ("+f(_(n.contents))+")",i+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+S+")",i+=" /Border [0 0 0]",i+=" >>",this.internal.write(i);break;case"link":if(n.options.name){var b=this.annotations._nameMap[n.options.name];n.options.pageNumber=b.page,n.options.top=b.y}else n.options.top||(n.options.top=0);if(a="/Rect ["+n.finalBounds.x+" "+n.finalBounds.y+" "+n.finalBounds.w+" "+n.finalBounds.h+"] ",i="",n.options.url)i="<</Type /Annot /Subtype /Link "+a+"/Border [0 0 0] /A <</S /URI /URI ("+f(_(n.options.url))+") >>";else if(n.options.pageNumber)switch(i="<</Type /Annot /Subtype /Link "+a+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(n.options.pageNumber).objId+" 0 R",n.options.magFactor=n.options.magFactor||"XYZ",n.options.magFactor){case"Fit":i+=" /Fit]";break;case"FitH":i+=" /FitH "+n.options.top+"]";break;case"FitV":n.options.left=n.options.left||0,i+=" /FitV "+n.options.left+"]";break;case"XYZ":default:var R=s(n.options.top);n.options.left=n.options.left||0,n.options.zoom===void 0&&(n.options.zoom=0),i+=" /XYZ "+n.options.left+" "+R+" "+n.options.zoom+"]"}i!=""&&(i+=" >>",this.internal.write(i))}}this.internal.write("]")}}]),e.createAnnotation=function(t){var n=this.internal.getCurrentPageInfo();switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":n.pageContext.annotations.push(t)}},e.link=function(t,n,a,i,o){var s=this.internal.getCurrentPageInfo(),u=this.internal.getCoordinateString,c=this.internal.getVerticalCoordinateString;s.pageContext.annotations.push({finalBounds:{x:u(t),y:c(n),w:u(t+a),h:c(n+i)},options:o,type:"link"})},e.textWithLink=function(t,n,a,i){var o,s,u=this.getTextWidth(t),c=this.internal.getLineHeight()/this.internal.scaleFactor;if(i.maxWidth!==void 0){s=i.maxWidth;var h=this.splitTextToSize(t,s).length;o=Math.ceil(c*h)}else s=u,o=c;return this.text(t,n,a,i),a+=.2*c,i.align==="center"&&(n-=u/2),i.align==="right"&&(n-=u),this.link(n,a-c,s,o,i),u},e.getTextWidth=function(t){var n=this.internal.getFontSize();return this.getStringUnitWidth(t)*n/this.internal.scaleFactor}}(vr.API),function(e){var r={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},t={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},n={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},a=[1570,1571,1573,1575];e.__arabicParser__={};var i=e.__arabicParser__.isInArabicSubstitutionA=function(E){return r[E.charCodeAt(0)]!==void 0},o=e.__arabicParser__.isArabicLetter=function(E){return typeof E=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(E)},s=e.__arabicParser__.isArabicEndLetter=function(E){return o(E)&&i(E)&&r[E.charCodeAt(0)].length<=2},u=e.__arabicParser__.isArabicAlfLetter=function(E){return o(E)&&a.indexOf(E.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(E){return o(E)&&i(E)&&r[E.charCodeAt(0)].length>=1};var c=e.__arabicParser__.arabicLetterHasFinalForm=function(E){return o(E)&&i(E)&&r[E.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(E){return o(E)&&i(E)&&r[E.charCodeAt(0)].length>=3};var h=e.__arabicParser__.arabicLetterHasMedialForm=function(E){return o(E)&&i(E)&&r[E.charCodeAt(0)].length==4},p=e.__arabicParser__.resolveLigatures=function(E){var w=0,x=t,y="",g=0;for(w=0;w<E.length;w+=1)x[E.charCodeAt(w)]!==void 0?(g++,typeof(x=x[E.charCodeAt(w)])=="number"&&(y+=String.fromCharCode(x),x=t,g=0),w===E.length-1&&(x=t,y+=E.charAt(w-(g-1)),w-=g-1,g=0)):(x=t,y+=E.charAt(w-g),w-=g,g=0);return y};e.__arabicParser__.isArabicDiacritic=function(E){return E!==void 0&&n[E.charCodeAt(0)]!==void 0};var v=e.__arabicParser__.getCorrectForm=function(E,w,x){return o(E)?i(E)===!1?-1:!c(E)||!o(w)&&!o(x)||!o(x)&&s(w)||s(E)&&!o(w)||s(E)&&u(w)||s(E)&&s(w)?0:h(E)&&o(w)&&!s(w)&&o(x)&&c(x)?3:s(E)||!o(x)?1:2:-1},f=function(E){var w=0,x=0,y=0,g="",S="",b="",R=(E=E||"").split("\\s+"),L=[];for(w=0;w<R.length;w+=1){for(L.push(""),x=0;x<R[w].length;x+=1)g=R[w][x],S=R[w][x-1],b=R[w][x+1],o(g)?(y=v(g,S,b),L[w]+=y!==-1?String.fromCharCode(r[g.charCodeAt(0)][y]):g):L[w]+=g;L[w]=p(L[w])}return L.join(" ")},_=e.__arabicParser__.processArabic=e.processArabic=function(){var E,w=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,x=[];if(Array.isArray(w)){var y=0;for(x=[],y=0;y<w.length;y+=1)Array.isArray(w[y])?x.push([f(w[y][0]),w[y][1],w[y][2]]):x.push([f(w[y])]);E=x}else E=f(w);return typeof arguments[0]=="string"?E:(arguments[0].text=E,arguments[0])};e.events.push(["preProcessText",_])}(vr.API),vr.API.autoPrint=function(e){var r;switch((e=e||{}).variant=e.variant||"non-conform",e.variant){case"javascript":this.addJS("print({});");break;case"non-conform":default:this.internal.events.subscribe("postPutResources",function(){r=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+r+" 0 R")})}return this},function(e){var r=function(){var t=void 0;Object.defineProperty(this,"pdf",{get:function(){return t},set:function(s){t=s}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(s){n=isNaN(s)||Number.isInteger(s)===!1||s<0?150:s,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var a=300;Object.defineProperty(this,"height",{get:function(){return a},set:function(s){a=isNaN(s)||Number.isInteger(s)===!1||s<0?300:s,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=a+1)}});var i=[];Object.defineProperty(this,"childNodes",{get:function(){return i},set:function(s){i=s}});var o={};Object.defineProperty(this,"style",{get:function(){return o},set:function(s){o=s}}),Object.defineProperty(this,"parentNode",{})};r.prototype.getContext=function(t,n){var a;if((t=t||"2d")!=="2d")return null;for(a in n)this.pdf.context2d.hasOwnProperty(a)&&(this.pdf.context2d[a]=n[a]);return this.pdf.context2d._canvas=this,this.pdf.context2d},r.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new r,this.canvas.pdf=this}])}(vr.API),function(e){var r={left:0,top:0,bottom:0,right:0},t=!1,n=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},r),this.internal.__cell__.margins.width=this.getPageWidth(),a.call(this))},a=function(){this.internal.__cell__.lastCell=new i,this.internal.__cell__.pages=1},i=function(){var u=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return u},set:function(E){u=E}});var c=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return c},set:function(E){c=E}});var h=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return h},set:function(E){h=E}});var p=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return p},set:function(E){p=E}});var v=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return v},set:function(E){v=E}});var f=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return f},set:function(E){f=E}});var _=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return _},set:function(E){_=E}}),this};i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},i.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(u){return n.call(this),this.internal.__cell__.headerFunction=typeof u=="function"?u:void 0,this},e.getTextDimensions=function(u,c){n.call(this);var h=(c=c||{}).fontSize||this.getFontSize(),p=c.font||this.getFont(),v=c.scaleFactor||this.internal.scaleFactor,f=0,_=0,E=0,w=this;if(!Array.isArray(u)&&typeof u!="string"){if(typeof u!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");u=String(u)}var x=c.maxWidth;x>0?typeof u=="string"?u=this.splitTextToSize(u,x):Object.prototype.toString.call(u)==="[object Array]"&&(u=u.reduce(function(g,S){return g.concat(w.splitTextToSize(S,x))},[])):u=Array.isArray(u)?u:[u];for(var y=0;y<u.length;y++)f<(E=this.getStringUnitWidth(u[y],{font:p})*h)&&(f=E);return f!==0&&(_=u.length),{w:f/=v,h:Math.max((_*h*this.getLineHeightFactor()-h*(this.getLineHeightFactor()-1))/v,0)}},e.cellAddPage=function(){n.call(this),this.addPage();var u=this.internal.__cell__.margins||r;return this.internal.__cell__.lastCell=new i(u.left,u.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var o=e.cell=function(){var u;u=arguments[0]instanceof i?arguments[0]:new i(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),n.call(this);var c=this.internal.__cell__.lastCell,h=this.internal.__cell__.padding,p=this.internal.__cell__.margins||r,v=this.internal.__cell__.tableHeaderRow,f=this.internal.__cell__.printHeaders;return c.lineNumber!==void 0&&(c.lineNumber===u.lineNumber?(u.x=(c.x||0)+(c.width||0),u.y=c.y||0):c.y+c.height+u.height+p.bottom>this.getPageHeight()?(this.cellAddPage(),u.y=p.top,f&&v&&(this.printHeaderRow(u.lineNumber,!0),u.y+=v[0].height)):u.y=c.y+c.height||u.y),u.text[0]!==void 0&&(this.rect(u.x,u.y,u.width,u.height,t===!0?"FD":void 0),u.align==="right"?this.text(u.text,u.x+u.width-h,u.y+h,{align:"right",baseline:"top"}):u.align==="center"?this.text(u.text,u.x+u.width/2,u.y+h,{align:"center",baseline:"top",maxWidth:u.width-h-h}):this.text(u.text,u.x+h,u.y+h,{align:"left",baseline:"top",maxWidth:u.width-h-h})),this.internal.__cell__.lastCell=u,this};e.table=function(u,c,h,p,v){if(n.call(this),!h)throw new Error("No data for PDF table.");var f,_,E,w,x=[],y=[],g=[],S={},b={},R=[],L=[],T=(v=v||{}).autoSize||!1,F=v.printHeaders!==!1,I=v.css&&v.css["font-size"]!==void 0?16*v.css["font-size"]:v.fontSize||12,O=v.margins||Object.assign({width:this.getPageWidth()},r),C=typeof v.padding=="number"?v.padding:3,A=v.headerBackgroundColor||"#c8c8c8",j=v.headerTextColor||"#000";if(a.call(this),this.internal.__cell__.printHeaders=F,this.internal.__cell__.margins=O,this.internal.__cell__.table_font_size=I,this.internal.__cell__.padding=C,this.internal.__cell__.headerBackgroundColor=A,this.internal.__cell__.headerTextColor=j,this.setFontSize(I),p==null)y=x=Object.keys(h[0]),g=x.map(function(){return"left"});else if(Array.isArray(p)&&kn(p[0])==="object")for(x=p.map(function(V){return V.name}),y=p.map(function(V){return V.prompt||V.name||""}),g=p.map(function(V){return V.align||"left"}),f=0;f<p.length;f+=1)b[p[f].name]=p[f].width*(19.049976/25.4);else Array.isArray(p)&&typeof p[0]=="string"&&(y=x=p,g=x.map(function(){return"left"}));if(T||Array.isArray(p)&&typeof p[0]=="string")for(f=0;f<x.length;f+=1){for(S[w=x[f]]=h.map(function(V){return V[w]}),this.setFont(void 0,"bold"),R.push(this.getTextDimensions(y[f],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),_=S[w],this.setFont(void 0,"normal"),E=0;E<_.length;E+=1)R.push(this.getTextDimensions(_[E],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);b[w]=Math.max.apply(null,R)+C+C,R=[]}if(F){var N={};for(f=0;f<x.length;f+=1)N[x[f]]={},N[x[f]].text=y[f],N[x[f]].align=g[f];var B=s.call(this,N,b);L=x.map(function(V){return new i(u,c,b[V],B,N[V].text,void 0,N[V].align)}),this.setTableHeaderRow(L),this.printHeaderRow(1,!1)}var W=p.reduce(function(V,H){return V[H.name]=H.align,V},{});for(f=0;f<h.length;f+=1){"rowStart"in v&&v.rowStart instanceof Function&&v.rowStart({row:f,data:h[f]},this);var Y=s.call(this,h[f],b);for(E=0;E<x.length;E+=1){var Z=h[f][x[E]];"cellStart"in v&&v.cellStart instanceof Function&&v.cellStart({row:f,col:E,data:Z},this),o.call(this,new i(u,c,b[x[E]],Y,Z,f+2,W[x[E]]))}}return this.internal.__cell__.table_x=u,this.internal.__cell__.table_y=c,this};var s=function(u,c){var h=this.internal.__cell__.padding,p=this.internal.__cell__.table_font_size,v=this.internal.scaleFactor;return Object.keys(u).map(function(f){var _=u[f];return this.splitTextToSize(_.hasOwnProperty("text")?_.text:_,c[f]-h-h)},this).map(function(f){return this.getLineHeightFactor()*f.length*p/v+h+h},this).reduce(function(f,_){return Math.max(f,_)},0)};e.setTableHeaderRow=function(u){n.call(this),this.internal.__cell__.tableHeaderRow=u},e.printHeaderRow=function(u,c){if(n.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var h;if(t=!0,typeof this.internal.__cell__.headerFunction=="function"){var p=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new i(p[0],p[1],p[2],p[3],void 0,-1)}this.setFont(void 0,"bold");for(var v=[],f=0;f<this.internal.__cell__.tableHeaderRow.length;f+=1){h=this.internal.__cell__.tableHeaderRow[f].clone(),c&&(h.y=this.internal.__cell__.margins.top||0,v.push(h)),h.lineNumber=u;var _=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),o.call(this,h),this.setTextColor(_)}v.length>0&&this.setTableHeaderRow(v),this.setFont(void 0,"normal"),t=!1}}(vr.API);var k_={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},L_=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],F2=C_(L_),N_=[100,200,300,400,500,600,700,800,900],Qk=C_(N_);function D2(e){var r=e.family.replace(/"|'/g,"").toLowerCase(),t=function(i){return k_[i=i||"normal"]?i:"normal"}(e.style),n=function(i){if(!i)return 400;if(typeof i=="number")return i>=100&&i<=900&&i%100==0?i:400;if(/^\d00$/.test(i))return parseInt(i);switch(i){case"bold":return 700;case"normal":default:return 400}}(e.weight),a=function(i){return typeof F2[i=i||"normal"]=="number"?i:"normal"}(e.stretch);return{family:r,style:t,weight:n,stretch:a,src:e.src||[],ref:e.ref||{name:r,style:[a,t,n].join(" ")}}}function rw(e,r,t,n){var a;for(a=t;a>=0&&a<r.length;a+=n)if(e[r[a]])return e[r[a]];for(a=t;a>=0&&a<r.length;a-=n)if(e[r[a]])return e[r[a]]}var Jk={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},nw={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function iw(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function eL(e,r,t){for(var n=(t=t||{}).defaultFontFamily||"times",a=Object.assign({},Jk,t.genericFontFamilies||{}),i=null,o=null,s=0;s<r.length;++s)if(a[(i=D2(r[s])).family]&&(i.family=a[i.family]),e.hasOwnProperty(i.family)){o=e[i.family];break}if(!(o=o||e[n]))throw new Error("Could not find a font-family for the rule '"+iw(i)+"' and default family '"+n+"'.");if(o=function(u,c){if(c[u])return c[u];var h=F2[u],p=h<=F2.normal?-1:1,v=rw(c,L_,h,p);if(!v)throw new Error("Could not find a matching font-stretch value for "+u);return v}(i.stretch,o),o=function(u,c){if(c[u])return c[u];for(var h=k_[u],p=0;p<h.length;++p)if(c[h[p]])return c[h[p]];throw new Error("Could not find a matching font-style for "+u)}(i.style,o),!(o=function(u,c){if(c[u])return c[u];if(u===400&&c[500])return c[500];if(u===500&&c[400])return c[400];var h=Qk[u],p=rw(c,N_,h,u<400?-1:1);if(!p)throw new Error("Could not find a matching font-weight for value "+u);return p}(i.weight,o)))throw new Error("Failed to resolve a font for the rule '"+iw(i)+"'.");return o}function aw(e){return e.trimLeft()}function tL(e,r){for(var t=0;t<e.length;){if(e.charAt(t)===r)return[e.substring(0,t),e.substring(t+1)];t+=1}return null}function rL(e){var r=e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return r===null?null:[r[0],e.substring(r[0].length)]}var d1,ow,sw,c2=["times"];(function(e){var r,t,n,a,i,o,s,u,c,h=function(U){return U=U||{},this.isStrokeTransparent=U.isStrokeTransparent||!1,this.strokeOpacity=U.strokeOpacity||1,this.strokeStyle=U.strokeStyle||"#000000",this.fillStyle=U.fillStyle||"#000000",this.isFillTransparent=U.isFillTransparent||!1,this.fillOpacity=U.fillOpacity||1,this.font=U.font||"10px sans-serif",this.textBaseline=U.textBaseline||"alphabetic",this.textAlign=U.textAlign||"left",this.lineWidth=U.lineWidth||1,this.lineJoin=U.lineJoin||"miter",this.lineCap=U.lineCap||"butt",this.path=U.path||[],this.transform=U.transform!==void 0?U.transform.clone():new u,this.globalCompositeOperation=U.globalCompositeOperation||"normal",this.globalAlpha=U.globalAlpha||1,this.clip_path=U.clip_path||[],this.currentPoint=U.currentPoint||new o,this.miterLimit=U.miterLimit||10,this.lastPoint=U.lastPoint||new o,this.lineDashOffset=U.lineDashOffset||0,this.lineDash=U.lineDash||[],this.margin=U.margin||[0,0,0,0],this.prevPageLastElemOffset=U.prevPageLastElemOffset||0,this.ignoreClearRect=typeof U.ignoreClearRect!="boolean"||U.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new p(this),r=this.internal.f2,t=this.internal.getCoordinateString,n=this.internal.getVerticalCoordinateString,a=this.internal.getHorizontalCoordinate,i=this.internal.getVerticalCoordinate,o=this.internal.Point,s=this.internal.Rectangle,u=this.internal.Matrix,c=new h}]);var p=function(U){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var D=U;Object.defineProperty(this,"pdf",{get:function(){return D}});var $=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return $},set:function(Pe){$=!!Pe}});var Q=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return Q},set:function(Pe){Q=!!Pe}});var ee=0;Object.defineProperty(this,"posX",{get:function(){return ee},set:function(Pe){isNaN(Pe)||(ee=Pe)}});var te=0;Object.defineProperty(this,"posY",{get:function(){return te},set:function(Pe){isNaN(Pe)||(te=Pe)}}),Object.defineProperty(this,"margin",{get:function(){return c.margin},set:function(Pe){var ve;typeof Pe=="number"?ve=[Pe,Pe,Pe,Pe]:((ve=new Array(4))[0]=Pe[0],ve[1]=Pe.length>=2?Pe[1]:ve[0],ve[2]=Pe.length>=3?Pe[2]:ve[0],ve[3]=Pe.length>=4?Pe[3]:ve[1]),c.margin=ve}});var ae=!1;Object.defineProperty(this,"autoPaging",{get:function(){return ae},set:function(Pe){ae=Pe}});var se=0;Object.defineProperty(this,"lastBreak",{get:function(){return se},set:function(Pe){se=Pe}});var ce=[];Object.defineProperty(this,"pageBreaks",{get:function(){return ce},set:function(Pe){ce=Pe}}),Object.defineProperty(this,"ctx",{get:function(){return c},set:function(Pe){Pe instanceof h&&(c=Pe)}}),Object.defineProperty(this,"path",{get:function(){return c.path},set:function(Pe){c.path=Pe}});var me=[];Object.defineProperty(this,"ctxStack",{get:function(){return me},set:function(Pe){me=Pe}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(Pe){var ve;ve=v(Pe),this.ctx.fillStyle=ve.style,this.ctx.isFillTransparent=ve.a===0,this.ctx.fillOpacity=ve.a,this.pdf.setFillColor(ve.r,ve.g,ve.b,{a:ve.a}),this.pdf.setTextColor(ve.r,ve.g,ve.b,{a:ve.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(Pe){var ve=v(Pe);this.ctx.strokeStyle=ve.style,this.ctx.isStrokeTransparent=ve.a===0,this.ctx.strokeOpacity=ve.a,ve.a===0?this.pdf.setDrawColor(255,255,255):(ve.a,this.pdf.setDrawColor(ve.r,ve.g,ve.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(Pe){["butt","round","square"].indexOf(Pe)!==-1&&(this.ctx.lineCap=Pe,this.pdf.setLineCap(Pe))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(Pe){isNaN(Pe)||(this.ctx.lineWidth=Pe,this.pdf.setLineWidth(Pe))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(Pe){["bevel","round","miter"].indexOf(Pe)!==-1&&(this.ctx.lineJoin=Pe,this.pdf.setLineJoin(Pe))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(Pe){isNaN(Pe)||(this.ctx.miterLimit=Pe,this.pdf.setMiterLimit(Pe))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(Pe){this.ctx.textBaseline=Pe}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(Pe){["right","end","center","left","start"].indexOf(Pe)!==-1&&(this.ctx.textAlign=Pe)}});var _e=null;function Le(Pe,ve){if(_e===null){var it=function(Se){var be=[];return Object.keys(Se).forEach(function(Ae){Se[Ae].forEach(function(Te){var he=null;switch(Te){case"bold":he={family:Ae,weight:"bold"};break;case"italic":he={family:Ae,style:"italic"};break;case"bolditalic":he={family:Ae,weight:"bold",style:"italic"};break;case"":case"normal":he={family:Ae}}he!==null&&(he.ref={name:Ae,style:Te},be.push(he))})}),be}(Pe.getFontList());_e=function(Se){for(var be={},Ae=0;Ae<Se.length;++Ae){var Te=D2(Se[Ae]),he=Te.family,Oe=Te.stretch,Me=Te.style,ze=Te.weight;be[he]=be[he]||{},be[he][Oe]=be[he][Oe]||{},be[he][Oe][Me]=be[he][Oe][Me]||{},be[he][Oe][Me][ze]=Te}return be}(it.concat(ve))}return _e}var Re=null;Object.defineProperty(this,"fontFaces",{get:function(){return Re},set:function(Pe){_e=null,Re=Pe}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(Pe){var ve;if(this.ctx.font=Pe,(ve=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(Pe))!==null){var it=ve[1];ve[2];var Se=ve[3],be=ve[4];ve[5];var Ae=ve[6],Te=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(be)[2];be=Math.floor(Te==="px"?parseFloat(be)*this.pdf.internal.scaleFactor:Te==="em"?parseFloat(be)*this.pdf.getFontSize():parseFloat(be)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(be);var he=function(Qe){var Ze,tt,Ht=[],Pt=Qe.trim();if(Pt==="")return c2;if(Pt in nw)return[nw[Pt]];for(;Pt!=="";){switch(tt=null,Ze=(Pt=aw(Pt)).charAt(0)){case'"':case"'":tt=tL(Pt.substring(1),Ze);break;default:tt=rL(Pt)}if(tt===null||(Ht.push(tt[0]),(Pt=aw(tt[1]))!==""&&Pt.charAt(0)!==","))return c2;Pt=Pt.replace(/^,/,"")}return Ht}(Ae);if(this.fontFaces){var Oe=eL(Le(this.pdf,this.fontFaces),he.map(function(Qe){return{family:Qe,stretch:"normal",weight:Se,style:it}}));this.pdf.setFont(Oe.ref.name,Oe.ref.style)}else{var Me="";(Se==="bold"||parseInt(Se,10)>=700||it==="bold")&&(Me="bold"),it==="italic"&&(Me+="italic"),Me.length===0&&(Me="normal");for(var ze="",pt={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},yt=0;yt<he.length;yt++){if(this.pdf.internal.getFont(he[yt],Me,{noFallback:!0,disableWarning:!0})!==void 0){ze=he[yt];break}if(Me==="bolditalic"&&this.pdf.internal.getFont(he[yt],"bold",{noFallback:!0,disableWarning:!0})!==void 0)ze=he[yt],Me="bold";else if(this.pdf.internal.getFont(he[yt],"normal",{noFallback:!0,disableWarning:!0})!==void 0){ze=he[yt],Me="normal";break}}if(ze===""){for(var He=0;He<he.length;He++)if(pt[he[He]]){ze=pt[he[He]];break}}ze=ze===""?"Times":ze,this.pdf.setFont(ze,Me)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(Pe){this.ctx.globalCompositeOperation=Pe}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(Pe){this.ctx.globalAlpha=Pe}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(Pe){this.ctx.lineDashOffset=Pe,H.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(Pe){this.ctx.lineDash=Pe,H.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(Pe){this.ctx.ignoreClearRect=!!Pe}})};p.prototype.setLineDash=function(U){this.lineDash=U},p.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},p.prototype.fill=function(){S.call(this,"fill",!1)},p.prototype.stroke=function(){S.call(this,"stroke",!1)},p.prototype.beginPath=function(){this.path=[{type:"begin"}]},p.prototype.moveTo=function(U,D){if(isNaN(U)||isNaN(D))throw Yn.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var $=this.ctx.transform.applyToPoint(new o(U,D));this.path.push({type:"mt",x:$.x,y:$.y}),this.ctx.lastPoint=new o(U,D)},p.prototype.closePath=function(){var U=new o(0,0),D=0;for(D=this.path.length-1;D!==-1;D--)if(this.path[D].type==="begin"&&kn(this.path[D+1])==="object"&&typeof this.path[D+1].x=="number"){U=new o(this.path[D+1].x,this.path[D+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new o(U.x,U.y)},p.prototype.lineTo=function(U,D){if(isNaN(U)||isNaN(D))throw Yn.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var $=this.ctx.transform.applyToPoint(new o(U,D));this.path.push({type:"lt",x:$.x,y:$.y}),this.ctx.lastPoint=new o($.x,$.y)},p.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),S.call(this,null,!0)},p.prototype.quadraticCurveTo=function(U,D,$,Q){if(isNaN($)||isNaN(Q)||isNaN(U)||isNaN(D))throw Yn.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var ee=this.ctx.transform.applyToPoint(new o($,Q)),te=this.ctx.transform.applyToPoint(new o(U,D));this.path.push({type:"qct",x1:te.x,y1:te.y,x:ee.x,y:ee.y}),this.ctx.lastPoint=new o(ee.x,ee.y)},p.prototype.bezierCurveTo=function(U,D,$,Q,ee,te){if(isNaN(ee)||isNaN(te)||isNaN(U)||isNaN(D)||isNaN($)||isNaN(Q))throw Yn.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var ae=this.ctx.transform.applyToPoint(new o(ee,te)),se=this.ctx.transform.applyToPoint(new o(U,D)),ce=this.ctx.transform.applyToPoint(new o($,Q));this.path.push({type:"bct",x1:se.x,y1:se.y,x2:ce.x,y2:ce.y,x:ae.x,y:ae.y}),this.ctx.lastPoint=new o(ae.x,ae.y)},p.prototype.arc=function(U,D,$,Q,ee,te){if(isNaN(U)||isNaN(D)||isNaN($)||isNaN(Q)||isNaN(ee))throw Yn.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(te=!!te,!this.ctx.transform.isIdentity){var ae=this.ctx.transform.applyToPoint(new o(U,D));U=ae.x,D=ae.y;var se=this.ctx.transform.applyToPoint(new o(0,$)),ce=this.ctx.transform.applyToPoint(new o(0,0));$=Math.sqrt(Math.pow(se.x-ce.x,2)+Math.pow(se.y-ce.y,2))}Math.abs(ee-Q)>=2*Math.PI&&(Q=0,ee=2*Math.PI),this.path.push({type:"arc",x:U,y:D,radius:$,startAngle:Q,endAngle:ee,counterclockwise:te})},p.prototype.arcTo=function(U,D,$,Q,ee){throw new Error("arcTo not implemented.")},p.prototype.rect=function(U,D,$,Q){if(isNaN(U)||isNaN(D)||isNaN($)||isNaN(Q))throw Yn.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(U,D),this.lineTo(U+$,D),this.lineTo(U+$,D+Q),this.lineTo(U,D+Q),this.lineTo(U,D),this.lineTo(U+$,D),this.lineTo(U,D)},p.prototype.fillRect=function(U,D,$,Q){if(isNaN(U)||isNaN(D)||isNaN($)||isNaN(Q))throw Yn.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!f.call(this)){var ee={};this.lineCap!=="butt"&&(ee.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(ee.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(U,D,$,Q),this.fill(),ee.hasOwnProperty("lineCap")&&(this.lineCap=ee.lineCap),ee.hasOwnProperty("lineJoin")&&(this.lineJoin=ee.lineJoin)}},p.prototype.strokeRect=function(U,D,$,Q){if(isNaN(U)||isNaN(D)||isNaN($)||isNaN(Q))throw Yn.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");_.call(this)||(this.beginPath(),this.rect(U,D,$,Q),this.stroke())},p.prototype.clearRect=function(U,D,$,Q){if(isNaN(U)||isNaN(D)||isNaN($)||isNaN(Q))throw Yn.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(U,D,$,Q))},p.prototype.save=function(U){U=typeof U!="boolean"||U;for(var D=this.pdf.internal.getCurrentPageInfo().pageNumber,$=0;$<this.pdf.internal.getNumberOfPages();$++)this.pdf.setPage($+1),this.pdf.internal.out("q");if(this.pdf.setPage(D),U){this.ctx.fontSize=this.pdf.internal.getFontSize();var Q=new h(this.ctx);this.ctxStack.push(this.ctx),this.ctx=Q}},p.prototype.restore=function(U){U=typeof U!="boolean"||U;for(var D=this.pdf.internal.getCurrentPageInfo().pageNumber,$=0;$<this.pdf.internal.getNumberOfPages();$++)this.pdf.setPage($+1),this.pdf.internal.out("Q");this.pdf.setPage(D),U&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},p.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var v=function(U){var D,$,Q,ee;if(U.isCanvasGradient===!0&&(U=U.getColor()),!U)return{r:0,g:0,b:0,a:0,style:U};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(U))D=0,$=0,Q=0,ee=0;else{var te=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(U);if(te!==null)D=parseInt(te[1]),$=parseInt(te[2]),Q=parseInt(te[3]),ee=1;else if((te=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(U))!==null)D=parseInt(te[1]),$=parseInt(te[2]),Q=parseInt(te[3]),ee=parseFloat(te[4]);else{if(ee=1,typeof U=="string"&&U.charAt(0)!=="#"){var ae=new S_(U);U=ae.ok?ae.toHex():"#000000"}U.length===4?(D=U.substring(1,2),D+=D,$=U.substring(2,3),$+=$,Q=U.substring(3,4),Q+=Q):(D=U.substring(1,3),$=U.substring(3,5),Q=U.substring(5,7)),D=parseInt(D,16),$=parseInt($,16),Q=parseInt(Q,16)}}return{r:D,g:$,b:Q,a:ee,style:U}},f=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},_=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};p.prototype.fillText=function(U,D,$,Q){if(isNaN(D)||isNaN($)||typeof U!="string")throw Yn.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(Q=isNaN(Q)?void 0:Q,!f.call(this)){var ee=Y(this.ctx.transform.rotation),te=this.ctx.transform.scaleX;C.call(this,{text:U,x:D,y:$,scale:te,angle:ee,align:this.textAlign,maxWidth:Q})}},p.prototype.strokeText=function(U,D,$,Q){if(isNaN(D)||isNaN($)||typeof U!="string")throw Yn.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!_.call(this)){Q=isNaN(Q)?void 0:Q;var ee=Y(this.ctx.transform.rotation),te=this.ctx.transform.scaleX;C.call(this,{text:U,x:D,y:$,scale:te,renderingMode:"stroke",angle:ee,align:this.textAlign,maxWidth:Q})}},p.prototype.measureText=function(U){if(typeof U!="string")throw Yn.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var D=this.pdf,$=this.pdf.internal.scaleFactor,Q=D.internal.getFontSize(),ee=D.getStringUnitWidth(U)*Q/D.internal.scaleFactor,te=function(ae){var se=(ae=ae||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return se}}),this};return new te({width:ee*=Math.round(96*$/72*1e4)/1e4})},p.prototype.scale=function(U,D){if(isNaN(U)||isNaN(D))throw Yn.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var $=new u(U,0,0,D,0,0);this.ctx.transform=this.ctx.transform.multiply($)},p.prototype.rotate=function(U){if(isNaN(U))throw Yn.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var D=new u(Math.cos(U),Math.sin(U),-Math.sin(U),Math.cos(U),0,0);this.ctx.transform=this.ctx.transform.multiply(D)},p.prototype.translate=function(U,D){if(isNaN(U)||isNaN(D))throw Yn.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var $=new u(1,0,0,1,U,D);this.ctx.transform=this.ctx.transform.multiply($)},p.prototype.transform=function(U,D,$,Q,ee,te){if(isNaN(U)||isNaN(D)||isNaN($)||isNaN(Q)||isNaN(ee)||isNaN(te))throw Yn.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var ae=new u(U,D,$,Q,ee,te);this.ctx.transform=this.ctx.transform.multiply(ae)},p.prototype.setTransform=function(U,D,$,Q,ee,te){U=isNaN(U)?1:U,D=isNaN(D)?0:D,$=isNaN($)?0:$,Q=isNaN(Q)?1:Q,ee=isNaN(ee)?0:ee,te=isNaN(te)?0:te,this.ctx.transform=new u(U,D,$,Q,ee,te)};var E=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};p.prototype.drawImage=function(U,D,$,Q,ee,te,ae,se,ce){var me=this.pdf.getImageProperties(U),_e=1,Le=1,Re=1,Pe=1;Q!==void 0&&se!==void 0&&(Re=se/Q,Pe=ce/ee,_e=me.width/Q*se/Q,Le=me.height/ee*ce/ee),te===void 0&&(te=D,ae=$,D=0,$=0),Q!==void 0&&se===void 0&&(se=Q,ce=ee),Q===void 0&&se===void 0&&(se=me.width,ce=me.height);for(var ve,it=this.ctx.transform.decompose(),Se=Y(it.rotate.shx),be=new u,Ae=(be=(be=(be=be.multiply(it.translate)).multiply(it.skew)).multiply(it.scale)).applyToRectangle(new s(te-D*Re,ae-$*Pe,Q*_e,ee*Le)),Te=w.call(this,Ae),he=[],Oe=0;Oe<Te.length;Oe+=1)he.indexOf(Te[Oe])===-1&&he.push(Te[Oe]);if(g(he),this.autoPaging)for(var Me=he[0],ze=he[he.length-1],pt=Me;pt<ze+1;pt++){this.pdf.setPage(pt);var yt=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],He=pt===1?this.posY+this.margin[0]:this.margin[0],Qe=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ze=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],tt=pt===1?0:Qe+(pt-2)*Ze;if(this.ctx.clip_path.length!==0){var Ht=this.path;ve=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=y(ve,this.posX+this.margin[3],-tt+He+this.ctx.prevPageLastElemOffset),b.call(this,"fill",!0),this.path=Ht}var Pt=JSON.parse(JSON.stringify(Ae));Pt=y([Pt],this.posX+this.margin[3],-tt+He+this.ctx.prevPageLastElemOffset)[0];var It=(pt>Me||pt<ze)&&E.call(this);It&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],yt,Ze,null).clip().discardPath()),this.pdf.addImage(U,"JPEG",Pt.x,Pt.y,Pt.w,Pt.h,null,null,Se),It&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(U,"JPEG",Ae.x,Ae.y,Ae.w,Ae.h,null,null,Se)};var w=function(U,D,$){var Q=[];D=D||this.pdf.internal.pageSize.width,$=$||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var ee=this.posY+this.ctx.prevPageLastElemOffset;switch(U.type){default:case"mt":case"lt":Q.push(Math.floor((U.y+ee)/$)+1);break;case"arc":Q.push(Math.floor((U.y+ee-U.radius)/$)+1),Q.push(Math.floor((U.y+ee+U.radius)/$)+1);break;case"qct":var te=Z(this.ctx.lastPoint.x,this.ctx.lastPoint.y,U.x1,U.y1,U.x,U.y);Q.push(Math.floor((te.y+ee)/$)+1),Q.push(Math.floor((te.y+te.h+ee)/$)+1);break;case"bct":var ae=V(this.ctx.lastPoint.x,this.ctx.lastPoint.y,U.x1,U.y1,U.x2,U.y2,U.x,U.y);Q.push(Math.floor((ae.y+ee)/$)+1),Q.push(Math.floor((ae.y+ae.h+ee)/$)+1);break;case"rect":Q.push(Math.floor((U.y+ee)/$)+1),Q.push(Math.floor((U.y+U.h+ee)/$)+1)}for(var se=0;se<Q.length;se+=1)for(;this.pdf.internal.getNumberOfPages()<Q[se];)x.call(this);return Q},x=function(){var U=this.fillStyle,D=this.strokeStyle,$=this.font,Q=this.lineCap,ee=this.lineWidth,te=this.lineJoin;this.pdf.addPage(),this.fillStyle=U,this.strokeStyle=D,this.font=$,this.lineCap=Q,this.lineWidth=ee,this.lineJoin=te},y=function(U,D,$){for(var Q=0;Q<U.length;Q++)switch(U[Q].type){case"bct":U[Q].x2+=D,U[Q].y2+=$;case"qct":U[Q].x1+=D,U[Q].y1+=$;case"mt":case"lt":case"arc":default:U[Q].x+=D,U[Q].y+=$}return U},g=function(U){return U.sort(function(D,$){return D-$})},S=function(U,D){for(var $,Q,ee=this.fillStyle,te=this.strokeStyle,ae=this.lineCap,se=this.lineWidth,ce=Math.abs(se*this.ctx.transform.scaleX),me=this.lineJoin,_e=JSON.parse(JSON.stringify(this.path)),Le=JSON.parse(JSON.stringify(this.path)),Re=[],Pe=0;Pe<Le.length;Pe++)if(Le[Pe].x!==void 0)for(var ve=w.call(this,Le[Pe]),it=0;it<ve.length;it+=1)Re.indexOf(ve[it])===-1&&Re.push(ve[it]);for(var Se=0;Se<Re.length;Se++)for(;this.pdf.internal.getNumberOfPages()<Re[Se];)x.call(this);if(g(Re),this.autoPaging)for(var be=Re[0],Ae=Re[Re.length-1],Te=be;Te<Ae+1;Te++){this.pdf.setPage(Te),this.fillStyle=ee,this.strokeStyle=te,this.lineCap=ae,this.lineWidth=ce,this.lineJoin=me;var he=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Oe=Te===1?this.posY+this.margin[0]:this.margin[0],Me=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],ze=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],pt=Te===1?0:Me+(Te-2)*ze;if(this.ctx.clip_path.length!==0){var yt=this.path;$=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=y($,this.posX+this.margin[3],-pt+Oe+this.ctx.prevPageLastElemOffset),b.call(this,U,!0),this.path=yt}if(Q=JSON.parse(JSON.stringify(_e)),this.path=y(Q,this.posX+this.margin[3],-pt+Oe+this.ctx.prevPageLastElemOffset),D===!1||Te===0){var He=(Te>be||Te<Ae)&&E.call(this);He&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],he,ze,null).clip().discardPath()),b.call(this,U,D),He&&this.pdf.restoreGraphicsState()}this.lineWidth=se}else this.lineWidth=ce,b.call(this,U,D),this.lineWidth=se;this.path=_e},b=function(U,D){if((U!=="stroke"||D||!_.call(this))&&(U==="stroke"||D||!f.call(this))){for(var $,Q,ee=[],te=this.path,ae=0;ae<te.length;ae++){var se=te[ae];switch(se.type){case"begin":ee.push({begin:!0});break;case"close":ee.push({close:!0});break;case"mt":ee.push({start:se,deltas:[],abs:[]});break;case"lt":var ce=ee.length;if(te[ae-1]&&!isNaN(te[ae-1].x)&&($=[se.x-te[ae-1].x,se.y-te[ae-1].y],ce>0)){for(;ce>=0;ce--)if(ee[ce-1].close!==!0&&ee[ce-1].begin!==!0){ee[ce-1].deltas.push($),ee[ce-1].abs.push(se);break}}break;case"bct":$=[se.x1-te[ae-1].x,se.y1-te[ae-1].y,se.x2-te[ae-1].x,se.y2-te[ae-1].y,se.x-te[ae-1].x,se.y-te[ae-1].y],ee[ee.length-1].deltas.push($);break;case"qct":var me=te[ae-1].x+2/3*(se.x1-te[ae-1].x),_e=te[ae-1].y+2/3*(se.y1-te[ae-1].y),Le=se.x+2/3*(se.x1-se.x),Re=se.y+2/3*(se.y1-se.y),Pe=se.x,ve=se.y;$=[me-te[ae-1].x,_e-te[ae-1].y,Le-te[ae-1].x,Re-te[ae-1].y,Pe-te[ae-1].x,ve-te[ae-1].y],ee[ee.length-1].deltas.push($);break;case"arc":ee.push({deltas:[],abs:[],arc:!0}),Array.isArray(ee[ee.length-1].abs)&&ee[ee.length-1].abs.push(se)}}Q=D?null:U==="stroke"?"stroke":"fill";for(var it=!1,Se=0;Se<ee.length;Se++)if(ee[Se].arc)for(var be=ee[Se].abs,Ae=0;Ae<be.length;Ae++){var Te=be[Ae];Te.type==="arc"?T.call(this,Te.x,Te.y,Te.radius,Te.startAngle,Te.endAngle,Te.counterclockwise,void 0,D,!it):A.call(this,Te.x,Te.y),it=!0}else if(ee[Se].close===!0)this.pdf.internal.out("h"),it=!1;else if(ee[Se].begin!==!0){var he=ee[Se].start.x,Oe=ee[Se].start.y;j.call(this,ee[Se].deltas,he,Oe),it=!0}Q&&F.call(this,Q),D&&I.call(this)}},R=function(U){var D=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,$=D*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return U-$;case"top":return U+D-$;case"hanging":return U+D-2*$;case"middle":return U+D/2-$;case"ideographic":return U;case"alphabetic":default:return U}},L=function(U){return U+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};p.prototype.createLinearGradient=function(){var U=function(){};return U.colorStops=[],U.addColorStop=function(D,$){this.colorStops.push([D,$])},U.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},U.isCanvasGradient=!0,U},p.prototype.createPattern=function(){return this.createLinearGradient()},p.prototype.createRadialGradient=function(){return this.createLinearGradient()};var T=function(U,D,$,Q,ee,te,ae,se,ce){for(var me=B.call(this,$,Q,ee,te),_e=0;_e<me.length;_e++){var Le=me[_e];_e===0&&(ce?O.call(this,Le.x1+U,Le.y1+D):A.call(this,Le.x1+U,Le.y1+D)),N.call(this,U,D,Le.x2,Le.y2,Le.x3,Le.y3,Le.x4,Le.y4)}se?I.call(this):F.call(this,ae)},F=function(U){switch(U){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},I=function(){this.pdf.clip(),this.pdf.discardPath()},O=function(U,D){this.pdf.internal.out(t(U)+" "+n(D)+" m")},C=function(U){var D;switch(U.align){case"right":case"end":D="right";break;case"center":D="center";break;case"left":case"start":default:D="left"}var $=this.pdf.getTextDimensions(U.text),Q=R.call(this,U.y),ee=L.call(this,Q)-$.h,te=this.ctx.transform.applyToPoint(new o(U.x,Q)),ae=this.ctx.transform.decompose(),se=new u;se=(se=(se=se.multiply(ae.translate)).multiply(ae.skew)).multiply(ae.scale);for(var ce,me,_e,Le=this.ctx.transform.applyToRectangle(new s(U.x,Q,$.w,$.h)),Re=se.applyToRectangle(new s(U.x,ee,$.w,$.h)),Pe=w.call(this,Re),ve=[],it=0;it<Pe.length;it+=1)ve.indexOf(Pe[it])===-1&&ve.push(Pe[it]);if(g(ve),this.autoPaging)for(var Se=ve[0],be=ve[ve.length-1],Ae=Se;Ae<be+1;Ae++){this.pdf.setPage(Ae);var Te=Ae===1?this.posY+this.margin[0]:this.margin[0],he=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Oe=this.pdf.internal.pageSize.height-this.margin[2],Me=Oe-this.margin[0],ze=this.pdf.internal.pageSize.width-this.margin[1],pt=ze-this.margin[3],yt=Ae===1?0:he+(Ae-2)*Me;if(this.ctx.clip_path.length!==0){var He=this.path;ce=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=y(ce,this.posX+this.margin[3],-1*yt+Te),b.call(this,"fill",!0),this.path=He}var Qe=y([JSON.parse(JSON.stringify(Re))],this.posX+this.margin[3],-yt+Te+this.ctx.prevPageLastElemOffset)[0];U.scale>=.01&&(me=this.pdf.internal.getFontSize(),this.pdf.setFontSize(me*U.scale),_e=this.lineWidth,this.lineWidth=_e*U.scale);var Ze=this.autoPaging!=="text";if(Ze||Qe.y+Qe.h<=Oe){if(Ze||Qe.y>=Te&&Qe.x<=ze){var tt=Ze?U.text:this.pdf.splitTextToSize(U.text,U.maxWidth||ze-Qe.x)[0],Ht=y([JSON.parse(JSON.stringify(Le))],this.posX+this.margin[3],-yt+Te+this.ctx.prevPageLastElemOffset)[0],Pt=Ze&&(Ae>Se||Ae<be)&&E.call(this);Pt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],pt,Me,null).clip().discardPath()),this.pdf.text(tt,Ht.x,Ht.y,{angle:U.angle,align:D,renderingMode:U.renderingMode}),Pt&&this.pdf.restoreGraphicsState()}}else Qe.y<Oe&&(this.ctx.prevPageLastElemOffset+=Oe-Qe.y);U.scale>=.01&&(this.pdf.setFontSize(me),this.lineWidth=_e)}else U.scale>=.01&&(me=this.pdf.internal.getFontSize(),this.pdf.setFontSize(me*U.scale),_e=this.lineWidth,this.lineWidth=_e*U.scale),this.pdf.text(U.text,te.x+this.posX,te.y+this.posY,{angle:U.angle,align:D,renderingMode:U.renderingMode,maxWidth:U.maxWidth}),U.scale>=.01&&(this.pdf.setFontSize(me),this.lineWidth=_e)},A=function(U,D,$,Q){$=$||0,Q=Q||0,this.pdf.internal.out(t(U+$)+" "+n(D+Q)+" l")},j=function(U,D,$){return this.pdf.lines(U,D,$,null,null)},N=function(U,D,$,Q,ee,te,ae,se){this.pdf.internal.out([r(a($+U)),r(i(Q+D)),r(a(ee+U)),r(i(te+D)),r(a(ae+U)),r(i(se+D)),"c"].join(" "))},B=function(U,D,$,Q){for(var ee=2*Math.PI,te=Math.PI/2;D>$;)D-=ee;var ae=Math.abs($-D);ae<ee&&Q&&(ae=ee-ae);for(var se=[],ce=Q?-1:1,me=D;ae>1e-5;){var _e=me+ce*Math.min(ae,te);se.push(W.call(this,U,me,_e)),ae-=Math.abs(_e-me),me=_e}return se},W=function(U,D,$){var Q=($-D)/2,ee=U*Math.cos(Q),te=U*Math.sin(Q),ae=ee,se=-te,ce=ae*ae+se*se,me=ce+ae*ee+se*te,_e=4/3*(Math.sqrt(2*ce*me)-me)/(ae*te-se*ee),Le=ae-_e*se,Re=se+_e*ae,Pe=Le,ve=-Re,it=Q+D,Se=Math.cos(it),be=Math.sin(it);return{x1:U*Math.cos(D),y1:U*Math.sin(D),x2:Le*Se-Re*be,y2:Le*be+Re*Se,x3:Pe*Se-ve*be,y3:Pe*be+ve*Se,x4:U*Math.cos($),y4:U*Math.sin($)}},Y=function(U){return 180*U/Math.PI},Z=function(U,D,$,Q,ee,te){var ae=U+.5*($-U),se=D+.5*(Q-D),ce=ee+.5*($-ee),me=te+.5*(Q-te),_e=Math.min(U,ee,ae,ce),Le=Math.max(U,ee,ae,ce),Re=Math.min(D,te,se,me),Pe=Math.max(D,te,se,me);return new s(_e,Re,Le-_e,Pe-Re)},V=function(U,D,$,Q,ee,te,ae,se){var ce,me,_e,Le,Re,Pe,ve,it,Se,be,Ae,Te,he,Oe,Me=$-U,ze=Q-D,pt=ee-$,yt=te-Q,He=ae-ee,Qe=se-te;for(me=0;me<41;me++)Se=(ve=(_e=U+(ce=me/40)*Me)+ce*((Re=$+ce*pt)-_e))+ce*(Re+ce*(ee+ce*He-Re)-ve),be=(it=(Le=D+ce*ze)+ce*((Pe=Q+ce*yt)-Le))+ce*(Pe+ce*(te+ce*Qe-Pe)-it),me==0?(Ae=Se,Te=be,he=Se,Oe=be):(Ae=Math.min(Ae,Se),Te=Math.min(Te,be),he=Math.max(he,Se),Oe=Math.max(Oe,be));return new s(Math.round(Ae),Math.round(Te),Math.round(he-Ae),Math.round(Oe-Te))},H=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var U,D,$=(U=this.ctx.lineDash,D=this.ctx.lineDashOffset,JSON.stringify({lineDash:U,lineDashOffset:D}));this.prevLineDash!==$&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=$)}}})(vr.API),function(e){var r=function(i){var o,s,u,c,h,p,v,f,_,E;for(s=[],u=0,c=(i+=o="\0\0\0\0".slice(i.length%4||4)).length;c>u;u+=4)(h=(i.charCodeAt(u)<<24)+(i.charCodeAt(u+1)<<16)+(i.charCodeAt(u+2)<<8)+i.charCodeAt(u+3))!==0?(p=(h=((h=((h=((h=(h-(E=h%85))/85)-(_=h%85))/85)-(f=h%85))/85)-(v=h%85))/85)%85,s.push(p+33,v+33,f+33,_+33,E+33)):s.push(122);return function(w,x){for(var y=x;y>0;y--)w.pop()}(s,o.length),String.fromCharCode.apply(String,s)+"~>"},t=function(i){var o,s,u,c,h,p=String,v="length",f=255,_="charCodeAt",E="slice",w="replace";for(i[E](-2),i=i[E](0,-2)[w](/\s/g,"")[w]("z","!!!!!"),u=[],c=0,h=(i+=o="uuuuu"[E](i[v]%5||5))[v];h>c;c+=5)s=52200625*(i[_](c)-33)+614125*(i[_](c+1)-33)+7225*(i[_](c+2)-33)+85*(i[_](c+3)-33)+(i[_](c+4)-33),u.push(f&s>>24,f&s>>16,f&s>>8,f&s);return function(x,y){for(var g=y;g>0;g--)x.pop()}(u,o[v]),p.fromCharCode.apply(p,u)},n=function(i){var o=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((i=i.replace(/\s/g,"")).indexOf(">")!==-1&&(i=i.substr(0,i.indexOf(">"))),i.length%2&&(i+="0"),o.test(i)===!1)return"";for(var s="",u=0;u<i.length;u+=2)s+=String.fromCharCode("0x"+(i[u]+i[u+1]));return s},a=function(i){for(var o=new Uint8Array(i.length),s=i.length;s--;)o[s]=i.charCodeAt(s);return i=(o=T2(o)).reduce(function(u,c){return u+String.fromCharCode(c)},"")};e.processDataByFilters=function(i,o){var s=0,u=i||"",c=[];for(typeof(o=o||[])=="string"&&(o=[o]),s=0;s<o.length;s+=1)switch(o[s]){case"ASCII85Decode":case"/ASCII85Decode":u=t(u),c.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":u=r(u),c.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":u=n(u),c.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":u=u.split("").map(function(h){return("0"+h.charCodeAt().toString(16)).slice(-2)}).join("")+">",c.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":u=a(u),c.push("/FlateDecode");break;default:throw new Error('The filter: "'+o[s]+'" is not implemented')}return{data:u,reverseChain:c.reverse().join(" ")}}}(vr.API),function(e){e.loadFile=function(r,t,n){return function(a,i,o){i=i!==!1,o=typeof o=="function"?o:function(){};var s=void 0;try{s=function(u,c,h){var p=new XMLHttpRequest,v=0,f=function(_){var E=_.length,w=[],x=String.fromCharCode;for(v=0;v<E;v+=1)w.push(x(255&_.charCodeAt(v)));return w.join("")};if(p.open("GET",u,!c),p.overrideMimeType("text/plain; charset=x-user-defined"),c===!1&&(p.onload=function(){p.status===200?h(f(this.responseText)):h(void 0)}),p.send(null),c&&p.status===200)return f(p.responseText)}(a,i,o)}catch{}return s}(r,t,n)},e.loadImageFile=e.loadFile}(vr.API),function(e){function r(){return(yr.html2canvas?Promise.resolve(yr.html2canvas):A2(()=>import("./html2canvas.esm-CBrSDip1.js"),[],import.meta.url)).catch(function(o){return Promise.reject(new Error("Could not load html2canvas: "+o))}).then(function(o){return o.default?o.default:o})}function t(){return(yr.DOMPurify?Promise.resolve(yr.DOMPurify):A2(()=>import("./purify.es-CQJ0hv7W.js"),[],import.meta.url)).catch(function(o){return Promise.reject(new Error("Could not load dompurify: "+o))}).then(function(o){return o.default?o.default:o})}var n=function(o){var s=kn(o);return s==="undefined"?"undefined":s==="string"||o instanceof String?"string":s==="number"||o instanceof Number?"number":s==="function"||o instanceof Function?"function":o&&o.constructor===Array?"array":o&&o.nodeType===1?"element":s==="object"?"object":"unknown"},a=function(o,s){var u=document.createElement(o);for(var c in s.className&&(u.className=s.className),s.innerHTML&&s.dompurify&&(u.innerHTML=s.dompurify.sanitize(s.innerHTML)),s.style)u.style[c]=s.style[c];return u},i=function o(s){var u=Object.assign(o.convert(Promise.resolve()),JSON.parse(JSON.stringify(o.template))),c=o.convert(Promise.resolve(),u);return c=(c=c.setProgress(1,o,1,[o])).set(s)};(i.prototype=Object.create(Promise.prototype)).constructor=i,i.convert=function(o,s){return o.__proto__=s||i.prototype,o},i.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},i.prototype.from=function(o,s){return this.then(function(){switch(s=s||function(u){switch(n(u)){case"string":return"string";case"element":return u.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(o)){case"string":return this.then(t).then(function(u){return this.set({src:a("div",{innerHTML:o,dompurify:u})})});case"element":return this.set({src:o});case"canvas":return this.set({canvas:o});case"img":return this.set({img:o});default:return this.error("Unknown source type.")}})},i.prototype.to=function(o){switch(o){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},i.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var o={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},s=function u(c,h){for(var p=c.nodeType===3?document.createTextNode(c.nodeValue):c.cloneNode(!1),v=c.firstChild;v;v=v.nextSibling)h!==!0&&v.nodeType===1&&v.nodeName==="SCRIPT"||p.appendChild(u(v,h));return c.nodeType===1&&(c.nodeName==="CANVAS"?(p.width=c.width,p.height=c.height,p.getContext("2d").drawImage(c,0,0)):c.nodeName!=="TEXTAREA"&&c.nodeName!=="SELECT"||(p.value=c.value),p.addEventListener("load",function(){p.scrollTop=c.scrollTop,p.scrollLeft=c.scrollLeft},!0)),p}(this.prop.src,this.opt.html2canvas.javascriptEnabled);s.tagName==="BODY"&&(o.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=a("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=a("div",{className:"html2pdf__container",style:o}),this.prop.container.appendChild(s),this.prop.container.firstChild.appendChild(a("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},i.prototype.toCanvas=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(r).then(function(s){var u=Object.assign({},this.opt.html2canvas);return delete u.onrendered,s(this.prop.container,u)}).then(function(s){(this.opt.html2canvas.onrendered||function(){})(s),this.prop.canvas=s,document.body.removeChild(this.prop.overlay)})},i.prototype.toContext2d=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(r).then(function(s){var u=this.opt.jsPDF,c=this.opt.fontFaces,h=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,p=Object.assign({async:!0,allowTaint:!0,scale:h,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete p.onrendered,u.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,u.context2d.posX=this.opt.x,u.context2d.posY=this.opt.y,u.context2d.margin=this.opt.margin,u.context2d.fontFaces=c,c)for(var v=0;v<c.length;++v){var f=c[v],_=f.src.find(function(E){return E.format==="truetype"});_&&u.addFont(_.url,f.ref.name,f.ref.style)}return p.windowHeight=p.windowHeight||0,p.windowHeight=p.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):p.windowHeight,u.context2d.save(!0),s(this.prop.container,p)}).then(function(s){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(s),this.prop.canvas=s,document.body.removeChild(this.prop.overlay)})},i.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var o=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=o})},i.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},i.prototype.output=function(o,s,u){return(u=u||"pdf").toLowerCase()==="img"||u.toLowerCase()==="image"?this.outputImg(o,s):this.outputPdf(o,s)},i.prototype.outputPdf=function(o,s){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(o,s)})},i.prototype.outputImg=function(o){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(o){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+o+'" is not supported.'}})},i.prototype.save=function(o){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(o?{filename:o}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},i.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},i.prototype.set=function(o){if(n(o)!=="object")return this;var s=Object.keys(o||{}).map(function(u){if(u in i.template.prop)return function(){this.prop[u]=o[u]};switch(u){case"margin":return this.setMargin.bind(this,o.margin);case"jsPDF":return function(){return this.opt.jsPDF=o.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,o.pageSize);default:return function(){this.opt[u]=o[u]}}},this);return this.then(function(){return this.thenList(s)})},i.prototype.get=function(o,s){return this.then(function(){var u=o in i.template.prop?this.prop[o]:this.opt[o];return s?s(u):u})},i.prototype.setMargin=function(o){return this.then(function(){switch(n(o)){case"number":o=[o,o,o,o];case"array":if(o.length===2&&(o=[o[0],o[1],o[0],o[1]]),o.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=o}).then(this.setPageSize)},i.prototype.setPageSize=function(o){function s(u,c){return Math.floor(u*c/72*96)}return this.then(function(){(o=o||vr.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(o.inner={width:o.width-this.opt.margin[1]-this.opt.margin[3],height:o.height-this.opt.margin[0]-this.opt.margin[2]},o.inner.px={width:s(o.inner.width,o.k),height:s(o.inner.height,o.k)},o.inner.ratio=o.inner.height/o.inner.width),this.prop.pageSize=o})},i.prototype.setProgress=function(o,s,u,c){return o!=null&&(this.progress.val=o),s!=null&&(this.progress.state=s),u!=null&&(this.progress.n=u),c!=null&&(this.progress.stack=c),this.progress.ratio=this.progress.val/this.progress.state,this},i.prototype.updateProgress=function(o,s,u,c){return this.setProgress(o?this.progress.val+o:null,s||null,u?this.progress.n+u:null,c?this.progress.stack.concat(c):null)},i.prototype.then=function(o,s){var u=this;return this.thenCore(o,s,function(c,h){return u.updateProgress(null,null,1,[c]),Promise.prototype.then.call(this,function(p){return u.updateProgress(null,c),p}).then(c,h).then(function(p){return u.updateProgress(1),p})})},i.prototype.thenCore=function(o,s,u){u=u||Promise.prototype.then,o&&(o=o.bind(this)),s&&(s=s.bind(this));var c=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?this:i.convert(Object.assign({},this),Promise.prototype),h=u.call(c,o,s);return i.convert(h,this.__proto__)},i.prototype.thenExternal=function(o,s){return Promise.prototype.then.call(this,o,s)},i.prototype.thenList=function(o){var s=this;return o.forEach(function(u){s=s.thenCore(u)}),s},i.prototype.catch=function(o){o&&(o=o.bind(this));var s=Promise.prototype.catch.call(this,o);return i.convert(s,this)},i.prototype.catchExternal=function(o){return Promise.prototype.catch.call(this,o)},i.prototype.error=function(o){return this.then(function(){throw new Error(o)})},i.prototype.using=i.prototype.set,i.prototype.saveAs=i.prototype.save,i.prototype.export=i.prototype.output,i.prototype.run=i.prototype.then,vr.getPageSize=function(o,s,u){if(kn(o)==="object"){var c=o;o=c.orientation,s=c.unit||s,u=c.format||u}s=s||"mm",u=u||"a4",o=(""+(o||"P")).toLowerCase();var h,p=(""+u).toLowerCase(),v={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(s){case"pt":h=1;break;case"mm":h=72/25.4;break;case"cm":h=72/2.54;break;case"in":h=72;break;case"px":h=.75;break;case"pc":case"em":h=12;break;case"ex":h=6;break;default:throw"Invalid unit: "+s}var f,_=0,E=0;if(v.hasOwnProperty(p))_=v[p][1]/h,E=v[p][0]/h;else try{_=u[1],E=u[0]}catch{throw new Error("Invalid format: "+u)}if(o==="p"||o==="portrait")o="p",E>_&&(f=E,E=_,_=f);else{if(o!=="l"&&o!=="landscape")throw"Invalid orientation: "+o;o="l",_>E&&(f=E,E=_,_=f)}return{width:E,height:_,unit:s,k:h,orientation:o}},e.html=function(o,s){(s=s||{}).callback=s.callback||function(){},s.html2canvas=s.html2canvas||{},s.html2canvas.canvas=s.html2canvas.canvas||this.canvas,s.jsPDF=s.jsPDF||this,s.fontFaces=s.fontFaces?s.fontFaces.map(D2):null;var u=new i(s);return s.worker?u:u.from(o).doCallback()}}(vr.API),vr.API.addJS=function(e){return sw=e,this.internal.events.subscribe("postPutResources",function(){d1=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(d1+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),ow=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+sw+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){d1!==void 0&&ow!==void 0&&this.internal.out("/Names <</JavaScript "+d1+" 0 R>>")}),this},function(e){var r;e.events.push(["postPutResources",function(){var t=this,n=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var a=t.outline.render().split(/\r\n/),i=0;i<a.length;i++){var o=a[i],s=n.exec(o);if(s!=null){var u=s[1];t.internal.newObjectDeferredBegin(u,!1)}t.internal.write(o)}if(this.outline.createNamedDestinations){var c=this.internal.pages.length,h=[];for(i=0;i<c;i++){var p=t.internal.newObject();h.push(p);var v=t.internal.getPageInfo(i+1);t.internal.write("<< /D["+v.objId+" 0 R /XYZ null null null]>> endobj")}var f=t.internal.newObject();for(t.internal.write("<< /Names [ "),i=0;i<h.length;i++)t.internal.write("(page_"+(i+1)+")"+h[i]+" 0 R");t.internal.write(" ] >>","endobj"),r=t.internal.newObject(),t.internal.write("<< /Dests "+f+" 0 R"),t.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){this.outline.root.children.length>0&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+r+" 0 R"))}]),e.events.push(["initialized",function(){var t=this;t.outline={createNamedDestinations:!1,root:{children:[]}},t.outline.add=function(n,a,i){var o={title:a,options:i,children:[]};return n==null&&(n=this.root),n.children.push(o),o},t.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=t,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},t.outline.genIds_r=function(n){n.id=t.internal.newObjectDeferred();for(var a=0;a<n.children.length;a++)this.genIds_r(n.children[a])},t.outline.renderRoot=function(n){this.objStart(n),this.line("/Type /Outlines"),n.children.length>0&&(this.line("/First "+this.makeRef(n.children[0])),this.line("/Last "+this.makeRef(n.children[n.children.length-1]))),this.line("/Count "+this.count_r({count:0},n)),this.objEnd()},t.outline.renderItems=function(n){for(var a=this.ctx.pdf.internal.getVerticalCoordinateString,i=0;i<n.children.length;i++){var o=n.children[i];this.objStart(o),this.line("/Title "+this.makeString(o.title)),this.line("/Parent "+this.makeRef(n)),i>0&&this.line("/Prev "+this.makeRef(n.children[i-1])),i<n.children.length-1&&this.line("/Next "+this.makeRef(n.children[i+1])),o.children.length>0&&(this.line("/First "+this.makeRef(o.children[0])),this.line("/Last "+this.makeRef(o.children[o.children.length-1])));var s=this.count=this.count_r({count:0},o);if(s>0&&this.line("/Count "+s),o.options&&o.options.pageNumber){var u=t.internal.getPageInfo(o.options.pageNumber);this.line("/Dest ["+u.objId+" 0 R /XYZ 0 "+a(0)+" 0]")}this.objEnd()}for(var c=0;c<n.children.length;c++)this.renderItems(n.children[c])},t.outline.line=function(n){this.ctx.val+=n+`\r
|
|
496
|
-
`},t.outline.makeRef=function(n){return n.id+" 0 R"},t.outline.makeString=function(n){return"("+t.internal.pdfEscape(n)+")"},t.outline.objStart=function(n){this.ctx.val+=`\r
|
|
497
|
-
`+n.id+` 0 obj\r
|
|
498
|
-
<<\r
|
|
499
|
-
`},t.outline.objEnd=function(){this.ctx.val+=`>> \r
|
|
500
|
-
endobj\r
|
|
501
|
-
`},t.outline.count_r=function(n,a){for(var i=0;i<a.children.length;i++)n.count++,this.count_r(n,a.children[i]);return n.count}}])}(vr.API),function(e){var r=[192,193,194,195,196,197,198,199];e.processJPEG=function(t,n,a,i,o,s){var u,c=this.decode.DCT_DECODE,h=null;if(typeof t=="string"||this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t)){switch(t=o||t,t=this.__addimage__.isArrayBuffer(t)?new Uint8Array(t):t,(u=function(p){for(var v,f=256*p.charCodeAt(4)+p.charCodeAt(5),_=p.length,E={width:0,height:0,numcomponents:1},w=4;w<_;w+=2){if(w+=f,r.indexOf(p.charCodeAt(w+1))!==-1){v=256*p.charCodeAt(w+5)+p.charCodeAt(w+6),E={width:256*p.charCodeAt(w+7)+p.charCodeAt(w+8),height:v,numcomponents:p.charCodeAt(w+9)};break}f=256*p.charCodeAt(w+2)+p.charCodeAt(w+3)}return E}(t=this.__addimage__.isArrayBufferView(t)?this.__addimage__.arrayBufferToBinaryString(t):t)).numcomponents){case 1:s=this.color_spaces.DEVICE_GRAY;break;case 4:s=this.color_spaces.DEVICE_CMYK;break;case 3:s=this.color_spaces.DEVICE_RGB}h={data:t,width:u.width,height:u.height,colorSpace:s,bitsPerComponent:8,filter:c,index:n,alias:a}}return h}}(vr.API);var ah,p1,lw,uw,cw,nL=function(){var e,r,t;function n(i){var o,s,u,c,h,p,v,f,_,E,w,x,y,g;for(this.data=i,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},p=null;;){switch(o=this.readUInt32(),_=(function(){var S,b;for(b=[],S=0;S<4;++S)b.push(String.fromCharCode(this.data[this.pos++]));return b}).call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(o);break;case"fcTL":p&&this.animation.frames.push(p),this.pos+=4,p={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},h=this.readUInt16(),c=this.readUInt16()||100,p.delay=1e3*h/c,p.disposeOp=this.data[this.pos++],p.blendOp=this.data[this.pos++],p.data=[];break;case"IDAT":case"fdAT":for(_==="fdAT"&&(this.pos+=4,o-=4),i=(p!=null?p.data:void 0)||this.imgData,x=0;0<=o?x<o:x>o;0<=o?++x:--x)i.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(u=this.palette.length/3,this.transparency.indexed=this.read(o),this.transparency.indexed.length>u)throw new Error("More transparent colors than palette size");if((E=u-this.transparency.indexed.length)>0)for(y=0;0<=E?y<E:y>E;0<=E?++y:--y)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(o)[0];break;case 2:this.transparency.rgb=this.read(o)}break;case"tEXt":v=(w=this.read(o)).indexOf(0),f=String.fromCharCode.apply(String,w.slice(0,v)),this.text[f]=String.fromCharCode.apply(String,w.slice(v+1));break;case"IEND":return p&&this.animation.frames.push(p),this.colors=(function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}).call(this),this.hasAlphaChannel=(g=this.colorType)===4||g===6,s=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*s,this.colorSpace=(function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}).call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=o}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}n.prototype.read=function(i){var o,s;for(s=[],o=0;0<=i?o<i:o>i;0<=i?++o:--o)s.push(this.data[this.pos++]);return s},n.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.decodePixels=function(i){var o=this.pixelBitlength/8,s=new Uint8Array(this.width*this.height*o),u=0,c=this;if(i==null&&(i=this.imgData),i.length===0)return new Uint8Array(0);function h(p,v,f,_){var E,w,x,y,g,S,b,R,L,T,F,I,O,C,A,j,N,B,W,Y,Z,V=Math.ceil((c.width-p)/f),H=Math.ceil((c.height-v)/_),U=c.width==V&&c.height==H;for(C=o*V,I=U?s:new Uint8Array(C*H),S=i.length,O=0,w=0;O<H&&u<S;){switch(i[u++]){case 0:for(y=N=0;N<C;y=N+=1)I[w++]=i[u++];break;case 1:for(y=B=0;B<C;y=B+=1)E=i[u++],g=y<o?0:I[w-o],I[w++]=(E+g)%256;break;case 2:for(y=W=0;W<C;y=W+=1)E=i[u++],x=(y-y%o)/o,A=O&&I[(O-1)*C+x*o+y%o],I[w++]=(A+E)%256;break;case 3:for(y=Y=0;Y<C;y=Y+=1)E=i[u++],x=(y-y%o)/o,g=y<o?0:I[w-o],A=O&&I[(O-1)*C+x*o+y%o],I[w++]=(E+Math.floor((g+A)/2))%256;break;case 4:for(y=Z=0;Z<C;y=Z+=1)E=i[u++],x=(y-y%o)/o,g=y<o?0:I[w-o],O===0?A=j=0:(A=I[(O-1)*C+x*o+y%o],j=x&&I[(O-1)*C+(x-1)*o+y%o]),b=g+A-j,R=Math.abs(b-g),T=Math.abs(b-A),F=Math.abs(b-j),L=R<=T&&R<=F?g:T<=F?A:j,I[w++]=(E+L)%256;break;default:throw new Error("Invalid filter algorithm: "+i[u-1])}if(!U){var D=((v+O*_)*c.width+p)*o,$=O*C;for(y=0;y<V;y+=1){for(var Q=0;Q<o;Q+=1)s[D++]=I[$++];D+=(f-1)*o}}O++}}return i=Ik(i),c.interlaceMethod==1?(h(0,0,8,8),h(4,0,8,8),h(0,4,4,8),h(2,0,4,4),h(0,2,2,4),h(1,0,2,2),h(0,1,1,2)):h(0,0,1,1),s},n.prototype.decodePalette=function(){var i,o,s,u,c,h,p,v,f;for(s=this.palette,h=this.transparency.indexed||[],c=new Uint8Array((h.length||0)+s.length),u=0,i=0,o=p=0,v=s.length;p<v;o=p+=3)c[u++]=s[o],c[u++]=s[o+1],c[u++]=s[o+2],c[u++]=(f=h[i++])!=null?f:255;return c},n.prototype.copyToImageData=function(i,o){var s,u,c,h,p,v,f,_,E,w,x;if(u=this.colors,E=null,s=this.hasAlphaChannel,this.palette.length&&(E=(x=this._decodedPalette)!=null?x:this._decodedPalette=this.decodePalette(),u=4,s=!0),_=(c=i.data||i).length,p=E||o,h=v=0,u===1)for(;h<_;)f=E?4*o[h/4]:v,w=p[f++],c[h++]=w,c[h++]=w,c[h++]=w,c[h++]=s?p[f++]:255,v=f;else for(;h<_;)f=E?4*o[h/4]:v,c[h++]=p[f++],c[h++]=p[f++],c[h++]=p[f++],c[h++]=s?p[f++]:255,v=f},n.prototype.decode=function(){var i;return i=new Uint8Array(this.width*this.height*4),this.copyToImageData(i,this.decodePixels()),i};var a=function(){if(Object.prototype.toString.call(yr)==="[object Window]"){try{r=yr.document.createElement("canvas"),t=r.getContext("2d")}catch{return!1}return!0}return!1};return a(),e=function(i){var o;if(a()===!0)return t.width=i.width,t.height=i.height,t.clearRect(0,0,i.width,i.height),t.putImageData(i,0,0),(o=new Image).src=r.toDataURL(),o;throw new Error("This method requires a Browser with Canvas-capability.")},n.prototype.decodeFrames=function(i){var o,s,u,c,h,p,v,f;if(this.animation){for(f=[],s=h=0,p=(v=this.animation.frames).length;h<p;s=++h)o=v[s],u=i.createImageData(o.width,o.height),c=this.decodePixels(new Uint8Array(o.data)),this.copyToImageData(u,c),o.imageData=u,f.push(o.image=e(u));return f}},n.prototype.renderFrame=function(i,o){var s,u,c;return s=(u=this.animation.frames)[o],c=u[o-1],o===0&&i.clearRect(0,0,this.width,this.height),(c!=null?c.disposeOp:void 0)===1?i.clearRect(c.xOffset,c.yOffset,c.width,c.height):(c!=null?c.disposeOp:void 0)===2&&i.putImageData(c.imageData,c.xOffset,c.yOffset),s.blendOp===0&&i.clearRect(s.xOffset,s.yOffset,s.width,s.height),i.drawImage(s.image,s.xOffset,s.yOffset)},n.prototype.animate=function(i){var o,s,u,c,h,p,v=this;return s=0,p=this.animation,c=p.numFrames,u=p.frames,h=p.numPlays,(o=function(){var f,_;if(f=s++%c,_=u[f],v.renderFrame(i,f),c>1&&s/c<h)return v.animation._timeout=setTimeout(o,_.delay)})()},n.prototype.stopAnimation=function(){var i;return clearTimeout((i=this.animation)!=null?i._timeout:void 0)},n.prototype.render=function(i){var o,s;return i._png&&i._png.stopAnimation(),i._png=this,i.width=this.width,i.height=this.height,o=i.getContext("2d"),this.animation?(this.decodeFrames(o),this.animate(o)):(s=o.createImageData(this.width,this.height),this.copyToImageData(s,this.decodePixels()),o.putImageData(s,0,0))},n}();/**
|
|
502
|
-
* @license
|
|
503
|
-
*
|
|
504
|
-
* Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
|
|
505
|
-
*
|
|
506
|
-
* Permission is hereby granted, free of charge, to any person obtaining
|
|
507
|
-
* a copy of this software and associated documentation files (the
|
|
508
|
-
* "Software"), to deal in the Software without restriction, including
|
|
509
|
-
* without limitation the rights to use, copy, modify, merge, publish,
|
|
510
|
-
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
511
|
-
* permit persons to whom the Software is furnished to do so, subject to
|
|
512
|
-
* the following conditions:
|
|
513
|
-
*
|
|
514
|
-
* The above copyright notice and this permission notice shall be
|
|
515
|
-
* included in all copies or substantial portions of the Software.
|
|
516
|
-
*
|
|
517
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
518
|
-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
519
|
-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
520
|
-
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
521
|
-
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
522
|
-
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
523
|
-
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
524
|
-
* ====================================================================
|
|
525
|
-
*//**
|
|
526
|
-
* @license
|
|
527
|
-
* (c) Dean McNamee <dean@gmail.com>, 2013.
|
|
528
|
-
*
|
|
529
|
-
* https://github.com/deanm/omggif
|
|
530
|
-
*
|
|
531
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
532
|
-
* of this software and associated documentation files (the "Software"), to
|
|
533
|
-
* deal in the Software without restriction, including without limitation the
|
|
534
|
-
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
535
|
-
* sell copies of the Software, and to permit persons to whom the Software is
|
|
536
|
-
* furnished to do so, subject to the following conditions:
|
|
537
|
-
*
|
|
538
|
-
* The above copyright notice and this permission notice shall be included in
|
|
539
|
-
* all copies or substantial portions of the Software.
|
|
540
|
-
*
|
|
541
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
542
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
543
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
544
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
545
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
546
|
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
547
|
-
* IN THE SOFTWARE.
|
|
548
|
-
*
|
|
549
|
-
* omggif is a JavaScript implementation of a GIF 89a encoder and decoder,
|
|
550
|
-
* including animation and compression. It does not rely on any specific
|
|
551
|
-
* underlying system, so should run in the browser, Node, or Plask.
|
|
552
|
-
*/function iL(e){var r=0;if(e[r++]!==71||e[r++]!==73||e[r++]!==70||e[r++]!==56||(e[r++]+1&253)!=56||e[r++]!==97)throw new Error("Invalid GIF 87a/89a header.");var t=e[r++]|e[r++]<<8,n=e[r++]|e[r++]<<8,a=e[r++],i=a>>7,o=1<<(7&a)+1;e[r++],e[r++];var s=null,u=null;i&&(s=r,u=o,r+=3*o);var c=!0,h=[],p=0,v=null,f=0,_=null;for(this.width=t,this.height=n;c&&r<e.length;)switch(e[r++]){case 33:switch(e[r++]){case 255:if(e[r]!==11||e[r+1]==78&&e[r+2]==69&&e[r+3]==84&&e[r+4]==83&&e[r+5]==67&&e[r+6]==65&&e[r+7]==80&&e[r+8]==69&&e[r+9]==50&&e[r+10]==46&&e[r+11]==48&&e[r+12]==3&&e[r+13]==1&&e[r+16]==0)r+=14,_=e[r++]|e[r++]<<8,r++;else for(r+=12;;){if(!((O=e[r++])>=0))throw Error("Invalid block size");if(O===0)break;r+=O}break;case 249:if(e[r++]!==4||e[r+4]!==0)throw new Error("Invalid graphics extension block.");var E=e[r++];p=e[r++]|e[r++]<<8,v=e[r++],(1&E)==0&&(v=null),f=E>>2&7,r++;break;case 254:for(;;){if(!((O=e[r++])>=0))throw Error("Invalid block size");if(O===0)break;r+=O}break;default:throw new Error("Unknown graphic control label: 0x"+e[r-1].toString(16))}break;case 44:var w=e[r++]|e[r++]<<8,x=e[r++]|e[r++]<<8,y=e[r++]|e[r++]<<8,g=e[r++]|e[r++]<<8,S=e[r++],b=S>>6&1,R=1<<(7&S)+1,L=s,T=u,F=!1;S>>7&&(F=!0,L=r,T=R,r+=3*R);var I=r;for(r++;;){var O;if(!((O=e[r++])>=0))throw Error("Invalid block size");if(O===0)break;r+=O}h.push({x:w,y:x,width:y,height:g,has_local_palette:F,palette_offset:L,palette_size:T,data_offset:I,data_length:r-I,transparent_index:v,interlaced:!!b,delay:p,disposal:f});break;case 59:c=!1;break;default:throw new Error("Unknown gif block: 0x"+e[r-1].toString(16))}this.numFrames=function(){return h.length},this.loopCount=function(){return _},this.frameInfo=function(C){if(C<0||C>=h.length)throw new Error("Frame index out of range.");return h[C]},this.decodeAndBlitFrameBGRA=function(C,A){var j=this.frameInfo(C),N=j.width*j.height,B=new Uint8Array(N);fw(e,j.data_offset,B,N);var W=j.palette_offset,Y=j.transparent_index;Y===null&&(Y=256);var Z=j.width,V=t-Z,H=Z,U=4*(j.y*t+j.x),D=4*((j.y+j.height)*t+j.x),$=U,Q=4*V;j.interlaced===!0&&(Q+=4*t*7);for(var ee=8,te=0,ae=B.length;te<ae;++te){var se=B[te];if(H===0&&(H=Z,($+=Q)>=D&&(Q=4*V+4*t*(ee-1),$=U+(Z+V)*(ee<<1),ee>>=1)),se===Y)$+=4;else{var ce=e[W+3*se],me=e[W+3*se+1],_e=e[W+3*se+2];A[$++]=_e,A[$++]=me,A[$++]=ce,A[$++]=255}--H}},this.decodeAndBlitFrameRGBA=function(C,A){var j=this.frameInfo(C),N=j.width*j.height,B=new Uint8Array(N);fw(e,j.data_offset,B,N);var W=j.palette_offset,Y=j.transparent_index;Y===null&&(Y=256);var Z=j.width,V=t-Z,H=Z,U=4*(j.y*t+j.x),D=4*((j.y+j.height)*t+j.x),$=U,Q=4*V;j.interlaced===!0&&(Q+=4*t*7);for(var ee=8,te=0,ae=B.length;te<ae;++te){var se=B[te];if(H===0&&(H=Z,($+=Q)>=D&&(Q=4*V+4*t*(ee-1),$=U+(Z+V)*(ee<<1),ee>>=1)),se===Y)$+=4;else{var ce=e[W+3*se],me=e[W+3*se+1],_e=e[W+3*se+2];A[$++]=ce,A[$++]=me,A[$++]=_e,A[$++]=255}--H}}}function fw(e,r,t,n){for(var a=e[r++],i=1<<a,o=i+1,s=o+1,u=a+1,c=(1<<u)-1,h=0,p=0,v=0,f=e[r++],_=new Int32Array(4096),E=null;;){for(;h<16&&f!==0;)p|=e[r++]<<h,h+=8,f===1?f=e[r++]:--f;if(h<u)break;var w=p&c;if(p>>=u,h-=u,w!==i){if(w===o)break;for(var x=w<s?w:E,y=0,g=x;g>i;)g=_[g]>>8,++y;var S=g;if(v+y+(x!==w?1:0)>n)return void Yn.log("Warning, gif stream longer than expected.");t[v++]=S;var b=v+=y;for(x!==w&&(t[v++]=S),g=x;y--;)g=_[g],t[--b]=255&g,g>>=8;E!==null&&s<4096&&(_[s++]=E<<8|S,s>=c+1&&u<12&&(++u,c=c<<1|1)),E=w}else s=o+1,c=(1<<(u=a+1))-1,E=null}return v!==n&&Yn.log("Warning, gif stream shorter than expected."),t}/**
|
|
553
|
-
* @license
|
|
554
|
-
Copyright (c) 2008, Adobe Systems Incorporated
|
|
555
|
-
All rights reserved.
|
|
556
|
-
|
|
557
|
-
Redistribution and use in source and binary forms, with or without
|
|
558
|
-
modification, are permitted provided that the following conditions are
|
|
559
|
-
met:
|
|
560
|
-
|
|
561
|
-
* Redistributions of source code must retain the above copyright notice,
|
|
562
|
-
this list of conditions and the following disclaimer.
|
|
563
|
-
|
|
564
|
-
* Redistributions in binary form must reproduce the above copyright
|
|
565
|
-
notice, this list of conditions and the following disclaimer in the
|
|
566
|
-
documentation and/or other materials provided with the distribution.
|
|
567
|
-
|
|
568
|
-
* Neither the name of Adobe Systems Incorporated nor the names of its
|
|
569
|
-
contributors may be used to endorse or promote products derived from
|
|
570
|
-
this software without specific prior written permission.
|
|
571
|
-
|
|
572
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
|
573
|
-
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
574
|
-
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
575
|
-
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
576
|
-
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
577
|
-
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
578
|
-
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
579
|
-
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
580
|
-
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
581
|
-
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
582
|
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
583
|
-
*/function f2(e){var r,t,n,a,i,o=Math.floor,s=new Array(64),u=new Array(64),c=new Array(64),h=new Array(64),p=new Array(65535),v=new Array(65535),f=new Array(64),_=new Array(64),E=[],w=0,x=7,y=new Array(64),g=new Array(64),S=new Array(64),b=new Array(256),R=new Array(2048),L=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],T=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],F=[0,1,2,3,4,5,6,7,8,9,10,11],I=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],O=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],C=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],A=[0,1,2,3,4,5,6,7,8,9,10,11],j=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],N=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function B(U,D){for(var $=0,Q=0,ee=new Array,te=1;te<=16;te++){for(var ae=1;ae<=U[te];ae++)ee[D[Q]]=[],ee[D[Q]][0]=$,ee[D[Q]][1]=te,Q++,$++;$*=2}return ee}function W(U){for(var D=U[0],$=U[1]-1;$>=0;)D&1<<$&&(w|=1<<x),$--,--x<0&&(w==255?(Y(255),Y(0)):Y(w),x=7,w=0)}function Y(U){E.push(U)}function Z(U){Y(U>>8&255),Y(255&U)}function V(U,D,$,Q,ee){for(var te,ae=ee[0],se=ee[240],ce=function(be,Ae){var Te,he,Oe,Me,ze,pt,yt,He,Qe,Ze,tt=0;for(Qe=0;Qe<8;++Qe){Te=be[tt],he=be[tt+1],Oe=be[tt+2],Me=be[tt+3],ze=be[tt+4],pt=be[tt+5],yt=be[tt+6];var Ht=Te+(He=be[tt+7]),Pt=Te-He,It=he+yt,qt=he-yt,Ie=Oe+pt,ke=Oe-pt,ut=Me+ze,Nt=Me-ze,Ct=Ht+ut,St=Ht-ut,Jt=It+Ie,nr=It-Ie;be[tt]=Ct+Jt,be[tt+4]=Ct-Jt;var Tt=.707106781*(nr+St);be[tt+2]=St+Tt,be[tt+6]=St-Tt;var Xt=.382683433*((Ct=Nt+ke)-(nr=qt+Pt)),Rr=.5411961*Ct+Xt,Je=1.306562965*nr+Xt,mt=.707106781*(Jt=ke+qt),Gt=Pt+mt,bt=Pt-mt;be[tt+5]=bt+Rr,be[tt+3]=bt-Rr,be[tt+1]=Gt+Je,be[tt+7]=Gt-Je,tt+=8}for(tt=0,Qe=0;Qe<8;++Qe){Te=be[tt],he=be[tt+8],Oe=be[tt+16],Me=be[tt+24],ze=be[tt+32],pt=be[tt+40],yt=be[tt+48];var Kt=Te+(He=be[tt+56]),Yt=Te-He,ct=he+yt,_t=he-yt,xt=Oe+pt,rt=Oe-pt,zt=Me+ze,gt=Me-ze,Ft=Kt+zt,br=Kt-zt,hr=ct+xt,Qr=ct-xt;be[tt]=Ft+hr,be[tt+32]=Ft-hr;var Sn=.707106781*(Qr+br);be[tt+16]=br+Sn,be[tt+48]=br-Sn;var Ni=.382683433*((Ft=gt+rt)-(Qr=_t+Yt)),Si=.5411961*Ft+Ni,fa=1.306562965*Qr+Ni,_s=.707106781*(hr=rt+_t),Vo=Yt+_s,tu=Yt-_s;be[tt+40]=tu+Si,be[tt+24]=tu-Si,be[tt+8]=Vo+fa,be[tt+56]=Vo-fa,tt++}for(Qe=0;Qe<64;++Qe)Ze=be[Qe]*Ae[Qe],f[Qe]=Ze>0?Ze+.5|0:Ze-.5|0;return f}(U,D),me=0;me<64;++me)_[L[me]]=ce[me];var _e=_[0]-$;$=_[0],_e==0?W(Q[0]):(W(Q[v[te=32767+_e]]),W(p[te]));for(var Le=63;Le>0&&_[Le]==0;)Le--;if(Le==0)return W(ae),$;for(var Re,Pe=1;Pe<=Le;){for(var ve=Pe;_[Pe]==0&&Pe<=Le;)++Pe;var it=Pe-ve;if(it>=16){Re=it>>4;for(var Se=1;Se<=Re;++Se)W(se);it&=15}te=32767+_[Pe],W(ee[(it<<4)+v[te]]),W(p[te]),Pe++}return Le!=63&&W(ae),$}function H(U){U=Math.min(Math.max(U,1),100),i!=U&&(function(D){for(var $=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],Q=0;Q<64;Q++){var ee=o(($[Q]*D+50)/100);ee=Math.min(Math.max(ee,1),255),s[L[Q]]=ee}for(var te=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],ae=0;ae<64;ae++){var se=o((te[ae]*D+50)/100);se=Math.min(Math.max(se,1),255),u[L[ae]]=se}for(var ce=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],me=0,_e=0;_e<8;_e++)for(var Le=0;Le<8;Le++)c[me]=1/(s[L[me]]*ce[_e]*ce[Le]*8),h[me]=1/(u[L[me]]*ce[_e]*ce[Le]*8),me++}(U<50?Math.floor(5e3/U):Math.floor(200-2*U)),i=U)}this.encode=function(U,D){D&&H(D),E=new Array,w=0,x=7,Z(65496),Z(65504),Z(16),Y(74),Y(70),Y(73),Y(70),Y(0),Y(1),Y(1),Y(0),Z(1),Z(1),Y(0),Y(0),function(){Z(65499),Z(132),Y(0);for(var he=0;he<64;he++)Y(s[he]);Y(1);for(var Oe=0;Oe<64;Oe++)Y(u[Oe])}(),function(he,Oe){Z(65472),Z(17),Y(8),Z(Oe),Z(he),Y(3),Y(1),Y(17),Y(0),Y(2),Y(17),Y(1),Y(3),Y(17),Y(1)}(U.width,U.height),function(){Z(65476),Z(418),Y(0);for(var he=0;he<16;he++)Y(T[he+1]);for(var Oe=0;Oe<=11;Oe++)Y(F[Oe]);Y(16);for(var Me=0;Me<16;Me++)Y(I[Me+1]);for(var ze=0;ze<=161;ze++)Y(O[ze]);Y(1);for(var pt=0;pt<16;pt++)Y(C[pt+1]);for(var yt=0;yt<=11;yt++)Y(A[yt]);Y(17);for(var He=0;He<16;He++)Y(j[He+1]);for(var Qe=0;Qe<=161;Qe++)Y(N[Qe])}(),Z(65498),Z(12),Y(3),Y(1),Y(0),Y(2),Y(17),Y(3),Y(17),Y(0),Y(63),Y(0);var $=0,Q=0,ee=0;w=0,x=7,this.encode.displayName="_encode_";for(var te,ae,se,ce,me,_e,Le,Re,Pe,ve=U.data,it=U.width,Se=U.height,be=4*it,Ae=0;Ae<Se;){for(te=0;te<be;){for(me=be*Ae+te,Le=-1,Re=0,Pe=0;Pe<64;Pe++)_e=me+(Re=Pe>>3)*be+(Le=4*(7&Pe)),Ae+Re>=Se&&(_e-=be*(Ae+1+Re-Se)),te+Le>=be&&(_e-=te+Le-be+4),ae=ve[_e++],se=ve[_e++],ce=ve[_e++],y[Pe]=(R[ae]+R[se+256>>0]+R[ce+512>>0]>>16)-128,g[Pe]=(R[ae+768>>0]+R[se+1024>>0]+R[ce+1280>>0]>>16)-128,S[Pe]=(R[ae+1280>>0]+R[se+1536>>0]+R[ce+1792>>0]>>16)-128;$=V(y,c,$,r,n),Q=V(g,h,Q,t,a),ee=V(S,h,ee,t,a),te+=32}Ae+=8}if(x>=0){var Te=[];Te[1]=x+1,Te[0]=(1<<x+1)-1,W(Te)}return Z(65497),new Uint8Array(E)},e=e||50,function(){for(var U=String.fromCharCode,D=0;D<256;D++)b[D]=U(D)}(),r=B(T,F),t=B(C,A),n=B(I,O),a=B(j,N),function(){for(var U=1,D=2,$=1;$<=15;$++){for(var Q=U;Q<D;Q++)v[32767+Q]=$,p[32767+Q]=[],p[32767+Q][1]=$,p[32767+Q][0]=Q;for(var ee=-(D-1);ee<=-U;ee++)v[32767+ee]=$,p[32767+ee]=[],p[32767+ee][1]=$,p[32767+ee][0]=D-1+ee;U<<=1,D<<=1}}(),function(){for(var U=0;U<256;U++)R[U]=19595*U,R[U+256>>0]=38470*U,R[U+512>>0]=7471*U+32768,R[U+768>>0]=-11059*U,R[U+1024>>0]=-21709*U,R[U+1280>>0]=32768*U+8421375,R[U+1536>>0]=-27439*U,R[U+1792>>0]=-5329*U}(),H(e)}/**
|
|
584
|
-
* @license
|
|
585
|
-
* Copyright (c) 2017 Aras Abbasi
|
|
586
|
-
*
|
|
587
|
-
* Licensed under the MIT License.
|
|
588
|
-
* http://opensource.org/licenses/mit-license
|
|
589
|
-
*/function Hl(e,r){if(this.pos=0,this.buffer=e,this.datav=new DataView(e.buffer),this.is_with_alpha=!!r,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function hw(e){function r(T){if(!T)throw Error("assert :P")}function t(T,F,I){for(var O=0;4>O;O++)if(T[F+O]!=I.charCodeAt(O))return!0;return!1}function n(T,F,I,O,C){for(var A=0;A<C;A++)T[F+A]=I[O+A]}function a(T,F,I,O){for(var C=0;C<O;C++)T[F+C]=I}function i(T){return new Int32Array(T)}function o(T,F){for(var I=[],O=0;O<T;O++)I.push(new F);return I}function s(T,F){var I=[];return function O(C,A,j){for(var N=j[A],B=0;B<N&&(C.push(j.length>A+1?[]:new F),!(j.length<A+1));B++)O(C[B],A+1,j)}(I,0,T),I}var u=function(){var T=this;function F(M,G){for(var re=1<<G-1>>>0;M&re;)re>>>=1;return re?(M&re-1)+re:M}function I(M,G,re,oe,ue){r(!(oe%re));do M[G+(oe-=re)]=ue;while(0<oe)}function O(M,G,re,oe,ue){if(r(2328>=ue),512>=ue)var de=i(512);else if((de=i(ue))==null)return 0;return function(ge,ye,we,Ee,De,Xe){var We,Ve,wt=ye,st=1<<we,je=i(16),qe=i(16);for(r(De!=0),r(Ee!=null),r(ge!=null),r(0<we),Ve=0;Ve<De;++Ve){if(15<Ee[Ve])return 0;++je[Ee[Ve]]}if(je[0]==De)return 0;for(qe[1]=0,We=1;15>We;++We){if(je[We]>1<<We)return 0;qe[We+1]=qe[We]+je[We]}for(Ve=0;Ve<De;++Ve)We=Ee[Ve],0<Ee[Ve]&&(Xe[qe[We]++]=Ve);if(qe[15]==1)return(Ee=new C).g=0,Ee.value=Xe[0],I(ge,wt,1,st,Ee),st;var Ue,ft=-1,vt=st-1,Vt=0,Bt=1,lr=1,jt=1<<we;for(Ve=0,We=1,De=2;We<=we;++We,De<<=1){if(Bt+=lr<<=1,0>(lr-=je[We]))return 0;for(;0<je[We];--je[We])(Ee=new C).g=We,Ee.value=Xe[Ve++],I(ge,wt+Vt,De,jt,Ee),Vt=F(Vt,We)}for(We=we+1,De=2;15>=We;++We,De<<=1){if(Bt+=lr<<=1,0>(lr-=je[We]))return 0;for(;0<je[We];--je[We]){if(Ee=new C,(Vt&vt)!=ft){for(wt+=jt,Ue=1<<(ft=We)-we;15>ft&&!(0>=(Ue-=je[ft]));)++ft,Ue<<=1;st+=jt=1<<(Ue=ft-we),ge[ye+(ft=Vt&vt)].g=Ue+we,ge[ye+ft].value=wt-ye-ft}Ee.g=We-we,Ee.value=Xe[Ve++],I(ge,wt+(Vt>>we),De,jt,Ee),Vt=F(Vt,We)}}return Bt!=2*qe[15]-1?0:st}(M,G,re,oe,ue,de)}function C(){this.value=this.g=0}function A(){this.value=this.g=0}function j(){this.G=o(5,C),this.H=i(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(an,A)}function N(M,G,re,oe){r(M!=null),r(G!=null),r(2147483648>oe),M.Ca=254,M.I=0,M.b=-8,M.Ka=0,M.oa=G,M.pa=re,M.Jd=G,M.Yc=re+oe,M.Zc=4<=oe?re+oe-4+1:re,te(M)}function B(M,G){for(var re=0;0<G--;)re|=se(M,128)<<G;return re}function W(M,G){var re=B(M,G);return ae(M)?-re:re}function Y(M,G,re,oe){var ue,de=0;for(r(M!=null),r(G!=null),r(4294967288>oe),M.Sb=oe,M.Ra=0,M.u=0,M.h=0,4<oe&&(oe=4),ue=0;ue<oe;++ue)de+=G[re+ue]<<8*ue;M.Ra=de,M.bb=oe,M.oa=G,M.pa=re}function Z(M){for(;8<=M.u&&M.bb<M.Sb;)M.Ra>>>=8,M.Ra+=M.oa[M.pa+M.bb]<<Oa-8>>>0,++M.bb,M.u-=8;$(M)&&(M.h=1,M.u=0)}function V(M,G){if(r(0<=G),!M.h&&G<=wl){var re=D(M)&el[G];return M.u+=G,Z(M),re}return M.h=1,M.u=0}function H(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function U(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function D(M){return M.Ra>>>(M.u&Oa-1)>>>0}function $(M){return r(M.bb<=M.Sb),M.h||M.bb==M.Sb&&M.u>Oa}function Q(M,G){M.u=G,M.h=$(M)}function ee(M){M.u>=Ga&&(r(M.u>=Ga),Z(M))}function te(M){r(M!=null&&M.oa!=null),M.pa<M.Zc?(M.I=(M.oa[M.pa++]|M.I<<8)>>>0,M.b+=8):(r(M!=null&&M.oa!=null),M.pa<M.Yc?(M.b+=8,M.I=M.oa[M.pa++]|M.I<<8):M.Ka?M.b=0:(M.I<<=8,M.b+=8,M.Ka=1))}function ae(M){return B(M,1)}function se(M,G){var re=M.Ca;0>M.b&&te(M);var oe=M.b,ue=re*G>>>8,de=(M.I>>>oe>ue)+0;for(de?(re-=ue,M.I-=ue+1<<oe>>>0):re=ue+1,oe=re,ue=0;256<=oe;)ue+=8,oe>>=8;return oe=7^ue+xi[oe],M.b-=oe,M.Ca=(re<<oe)-1,de}function ce(M,G,re){M[G+0]=re>>24&255,M[G+1]=re>>16&255,M[G+2]=re>>8&255,M[G+3]=re>>0&255}function me(M,G){return M[G+0]<<0|M[G+1]<<8}function _e(M,G){return me(M,G)|M[G+2]<<16}function Le(M,G){return me(M,G)|me(M,G+2)<<16}function Re(M,G){var re=1<<G;return r(M!=null),r(0<G),M.X=i(re),M.X==null?0:(M.Mb=32-G,M.Xa=G,1)}function Pe(M,G){r(M!=null),r(G!=null),r(M.Xa==G.Xa),n(G.X,0,M.X,0,1<<G.Xa)}function ve(){this.X=[],this.Xa=this.Mb=0}function it(M,G,re,oe){r(re!=null),r(oe!=null);var ue=re[0],de=oe[0];return ue==0&&(ue=(M*de+G/2)/G),de==0&&(de=(G*ue+M/2)/M),0>=ue||0>=de?0:(re[0]=ue,oe[0]=de,1)}function Se(M,G){return M+(1<<G)-1>>>G}function be(M,G){return((4278255360&M)+(4278255360&G)>>>0&4278255360)+((16711935&M)+(16711935&G)>>>0&16711935)>>>0}function Ae(M,G){T[G]=function(re,oe,ue,de,ge,ye,we){var Ee;for(Ee=0;Ee<ge;++Ee){var De=T[M](ye[we+Ee-1],ue,de+Ee);ye[we+Ee]=be(re[oe+Ee],De)}}}function Te(){this.ud=this.hd=this.jd=0}function he(M,G){return((4278124286&(M^G))>>>1)+(M&G)>>>0}function Oe(M){return 0<=M&&256>M?M:0>M?0:255<M?255:void 0}function Me(M,G){return Oe(M+(M-G+.5>>1))}function ze(M,G,re){return Math.abs(G-re)-Math.abs(M-re)}function pt(M,G,re,oe,ue,de,ge){for(oe=de[ge-1],re=0;re<ue;++re)de[ge+re]=oe=be(M[G+re],oe)}function yt(M,G,re,oe,ue){var de;for(de=0;de<re;++de){var ge=M[G+de],ye=ge>>8&255,we=16711935&(we=(we=16711935&ge)+((ye<<16)+ye));oe[ue+de]=(4278255360&ge)+we>>>0}}function He(M,G){G.jd=M>>0&255,G.hd=M>>8&255,G.ud=M>>16&255}function Qe(M,G,re,oe,ue,de){var ge;for(ge=0;ge<oe;++ge){var ye=G[re+ge],we=ye>>>8,Ee=ye,De=255&(De=(De=ye>>>16)+((M.jd<<24>>24)*(we<<24>>24)>>>5));Ee=255&(Ee=(Ee=Ee+((M.hd<<24>>24)*(we<<24>>24)>>>5))+((M.ud<<24>>24)*(De<<24>>24)>>>5)),ue[de+ge]=(4278255360&ye)+(De<<16)+Ee}}function Ze(M,G,re,oe,ue){T[G]=function(de,ge,ye,we,Ee,De,Xe,We,Ve){for(we=Xe;we<We;++we)for(Xe=0;Xe<Ve;++Xe)Ee[De++]=ue(ye[oe(de[ge++])])},T[M]=function(de,ge,ye,we,Ee,De,Xe){var We=8>>de.b,Ve=de.Ea,wt=de.K[0],st=de.w;if(8>We)for(de=(1<<de.b)-1,st=(1<<We)-1;ge<ye;++ge){var je,qe=0;for(je=0;je<Ve;++je)je&de||(qe=oe(we[Ee++])),De[Xe++]=ue(wt[qe&st]),qe>>=We}else T["VP8LMapColor"+re](we,Ee,wt,st,De,Xe,ge,ye,Ve)}}function tt(M,G,re,oe,ue){for(re=G+re;G<re;){var de=M[G++];oe[ue++]=de>>16&255,oe[ue++]=de>>8&255,oe[ue++]=de>>0&255}}function Ht(M,G,re,oe,ue){for(re=G+re;G<re;){var de=M[G++];oe[ue++]=de>>16&255,oe[ue++]=de>>8&255,oe[ue++]=de>>0&255,oe[ue++]=de>>24&255}}function Pt(M,G,re,oe,ue){for(re=G+re;G<re;){var de=(ge=M[G++])>>16&240|ge>>12&15,ge=ge>>0&240|ge>>28&15;oe[ue++]=de,oe[ue++]=ge}}function It(M,G,re,oe,ue){for(re=G+re;G<re;){var de=(ge=M[G++])>>16&248|ge>>13&7,ge=ge>>5&224|ge>>3&31;oe[ue++]=de,oe[ue++]=ge}}function qt(M,G,re,oe,ue){for(re=G+re;G<re;){var de=M[G++];oe[ue++]=de>>0&255,oe[ue++]=de>>8&255,oe[ue++]=de>>16&255}}function Ie(M,G,re,oe,ue,de){if(de==0)for(re=G+re;G<re;)ce(oe,((de=M[G++])[0]>>24|de[1]>>8&65280|de[2]<<8&16711680|de[3]<<24)>>>0),ue+=32;else n(oe,ue,M,G,re)}function ke(M,G){T[G][0]=T[M+"0"],T[G][1]=T[M+"1"],T[G][2]=T[M+"2"],T[G][3]=T[M+"3"],T[G][4]=T[M+"4"],T[G][5]=T[M+"5"],T[G][6]=T[M+"6"],T[G][7]=T[M+"7"],T[G][8]=T[M+"8"],T[G][9]=T[M+"9"],T[G][10]=T[M+"10"],T[G][11]=T[M+"11"],T[G][12]=T[M+"12"],T[G][13]=T[M+"13"],T[G][14]=T[M+"0"],T[G][15]=T[M+"0"]}function ut(M){return M==Pl||M==ks||M==hu||M==du}function Nt(){this.eb=[],this.size=this.A=this.fb=0}function Ct(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function St(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Nt,this.f.kb=new Ct,this.sd=null}function Jt(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function nr(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function Tt(M){return alert("todo:WebPSamplerProcessPlane"),M.T}function Xt(M,G){var re=M.T,oe=G.ba.f.RGBA,ue=oe.eb,de=oe.fb+M.ka*oe.A,ge=pa[G.ba.S],ye=M.y,we=M.O,Ee=M.f,De=M.N,Xe=M.ea,We=M.W,Ve=G.cc,wt=G.dc,st=G.Mc,je=G.Nc,qe=M.ka,Ue=M.ka+M.T,ft=M.U,vt=ft+1>>1;for(qe==0?ge(ye,we,null,null,Ee,De,Xe,We,Ee,De,Xe,We,ue,de,null,null,ft):(ge(G.ec,G.fc,ye,we,Ve,wt,st,je,Ee,De,Xe,We,ue,de-oe.A,ue,de,ft),++re);qe+2<Ue;qe+=2)Ve=Ee,wt=De,st=Xe,je=We,De+=M.Rc,We+=M.Rc,de+=2*oe.A,ge(ye,(we+=2*M.fa)-M.fa,ye,we,Ve,wt,st,je,Ee,De,Xe,We,ue,de-oe.A,ue,de,ft);return we+=M.fa,M.j+Ue<M.o?(n(G.ec,G.fc,ye,we,ft),n(G.cc,G.dc,Ee,De,vt),n(G.Mc,G.Nc,Xe,We,vt),re--):1&Ue||ge(ye,we,null,null,Ee,De,Xe,We,Ee,De,Xe,We,ue,de+oe.A,null,null,ft),re}function Rr(M,G,re){var oe=M.F,ue=[M.J];if(oe!=null){var de=M.U,ge=G.ba.S,ye=ge==fu||ge==hu;G=G.ba.f.RGBA;var we=[0],Ee=M.ka;we[0]=M.T,M.Kb&&(Ee==0?--we[0]:(--Ee,ue[0]-=M.width),M.j+M.ka+M.T==M.o&&(we[0]=M.o-M.j-Ee));var De=G.eb;Ee=G.fb+Ee*G.A,M=Kr(oe,ue[0],M.width,de,we,De,Ee+(ye?0:3),G.A),r(re==we),M&&ut(ge)&&Ei(De,Ee,ye,de,we,G.A)}return 0}function Je(M){var G=M.ma,re=G.ba.S,oe=11>re,ue=re==Fo||re==El||re==fu||re==hn||re==12||ut(re);if(G.memory=null,G.Ib=null,G.Jb=null,G.Nd=null,!Js(G.Oa,M,ue?11:12))return 0;if(ue&&ut(re)&&Et(),M.da)alert("todo:use_scaling");else{if(oe){if(G.Ib=Tt,M.Kb){if(re=M.U+1>>1,G.memory=i(M.U+2*re),G.memory==null)return 0;G.ec=G.memory,G.fc=0,G.cc=G.ec,G.dc=G.fc+M.U,G.Mc=G.cc,G.Nc=G.dc+re,G.Ib=Xt,Et()}}else alert("todo:EmitYUV");ue&&(G.Jb=Rr,oe&&Ke())}if(oe&&!Pi){for(M=0;256>M;++M)ia[M]=89858*(M-128)+go>>rs,aa[M]=-22014*(M-128)+go,Al[M]=-45773*(M-128),al[M]=113618*(M-128)+go>>rs;for(M=en;M<sn;++M)G=76283*(M-16)+go>>rs,mu[M-en]=Ea(G,255),cf[M-en]=Ea(G+8>>4,15);Pi=1}return 1}function mt(M){var G=M.ma,re=M.U,oe=M.T;return r(!(1&M.ka)),0>=re||0>=oe?0:(re=G.Ib(M,G),G.Jb!=null&&G.Jb(M,G,re),G.Dc+=re,1)}function Gt(M){M.ma.memory=null}function bt(M,G,re,oe){return V(M,8)!=47?0:(G[0]=V(M,14)+1,re[0]=V(M,14)+1,oe[0]=V(M,1),V(M,3)!=0?0:!M.h)}function Kt(M,G){if(4>M)return M+1;var re=M-2>>1;return(2+(1&M)<<re)+V(G,re)+1}function Yt(M,G){return 120<G?G-120:1<=(re=((re=qf[G-1])>>4)*M+(8-(15&re)))?re:1;var re}function ct(M,G,re){var oe=D(re),ue=M[G+=255&oe].g-8;return 0<ue&&(Q(re,re.u+8),oe=D(re),G+=M[G].value,G+=oe&(1<<ue)-1),Q(re,re.u+M[G].g),M[G].value}function _t(M,G,re){return re.g+=M.g,re.value+=M.value<<G>>>0,r(8>=re.g),M.g}function xt(M,G,re){var oe=M.xc;return r((G=oe==0?0:M.vc[M.md*(re>>oe)+(G>>oe)])<M.Wb),M.Ya[G]}function rt(M,G,re,oe){var ue=M.ab,de=M.c*G,ge=M.C;G=ge+G;var ye=re,we=oe;for(oe=M.Ta,re=M.Ua;0<ue--;){var Ee=M.gc[ue],De=ge,Xe=G,We=ye,Ve=we,wt=(we=oe,ye=re,Ee.Ea);switch(r(De<Xe),r(Xe<=Ee.nc),Ee.hc){case 2:Hu(We,Ve,(Xe-De)*wt,we,ye);break;case 0:var st=De,je=Xe,qe=we,Ue=ye,ft=(jt=Ee).Ea;st==0&&(tl(We,Ve,null,null,1,qe,Ue),pt(We,Ve+1,0,0,ft-1,qe,Ue+1),Ve+=ft,Ue+=ft,++st);for(var vt=1<<jt.b,Vt=vt-1,Bt=Se(ft,jt.b),lr=jt.K,jt=jt.w+(st>>jt.b)*Bt;st<je;){var Br=lr,Ur=jt,Ir=1;for(co(We,Ve,qe,Ue-ft,1,qe,Ue);Ir<ft;){var xr=(Ir&~Vt)+vt;xr>ft&&(xr=ft),(0,bi[Br[Ur++]>>8&15])(We,Ve+ +Ir,qe,Ue+Ir-ft,xr-Ir,qe,Ue+Ir),Ir=xr}Ve+=ft,Ue+=ft,++st&Vt||(jt+=Bt)}Xe!=Ee.nc&&n(we,ye-wt,we,ye+(Xe-De-1)*wt,wt);break;case 1:for(wt=We,je=Ve,ft=(We=Ee.Ea)-(Ue=We&~(qe=(Ve=1<<Ee.b)-1)),st=Se(We,Ee.b),vt=Ee.K,Ee=Ee.w+(De>>Ee.b)*st;De<Xe;){for(Vt=vt,Bt=Ee,lr=new Te,jt=je+Ue,Br=je+We;je<jt;)He(Vt[Bt++],lr),Jo(lr,wt,je,Ve,we,ye),je+=Ve,ye+=Ve;je<Br&&(He(Vt[Bt++],lr),Jo(lr,wt,je,ft,we,ye),je+=ft,ye+=ft),++De&qe||(Ee+=st)}break;case 3:if(We==we&&Ve==ye&&0<Ee.b){for(je=we,We=wt=ye+(Xe-De)*wt-(Ue=(Xe-De)*Se(Ee.Ea,Ee.b)),Ve=we,qe=ye,st=[],Ue=(ft=Ue)-1;0<=Ue;--Ue)st[Ue]=Ve[qe+Ue];for(Ue=ft-1;0<=Ue;--Ue)je[We+Ue]=st[Ue];yi(Ee,De,Xe,we,wt,we,ye)}else yi(Ee,De,Xe,We,Ve,we,ye)}ye=oe,we=re}we!=re&&n(oe,re,ye,we,de)}function zt(M,G){var re=M.V,oe=M.Ba+M.c*M.C,ue=G-M.C;if(r(G<=M.l.o),r(16>=ue),0<ue){var de=M.l,ge=M.Ta,ye=M.Ua,we=de.width;if(rt(M,ue,re,oe),ue=ye=[ye],r((re=M.C)<(oe=G)),r(de.v<de.va),oe>de.o&&(oe=de.o),re<de.j){var Ee=de.j-re;re=de.j,ue[0]+=Ee*we}if(re>=oe?re=0:(ue[0]+=4*de.v,de.ka=re-de.j,de.U=de.va-de.v,de.T=oe-re,re=1),re){if(ye=ye[0],11>(re=M.ca).S){var De=re.f.RGBA,Xe=(oe=re.S,ue=de.U,de=de.T,Ee=De.eb,De.A),We=de;for(De=De.fb+M.Ma*De.A;0<We--;){var Ve=ge,wt=ye,st=ue,je=Ee,qe=De;switch(oe){case xl:ci(Ve,wt,st,je,qe);break;case Fo:qi(Ve,wt,st,je,qe);break;case Pl:qi(Ve,wt,st,je,qe),Ei(je,qe,0,st,1,0);break;case sf:fo(Ve,wt,st,je,qe);break;case El:Ie(Ve,wt,st,je,qe,1);break;case ks:Ie(Ve,wt,st,je,qe,1),Ei(je,qe,0,st,1,0);break;case fu:Ie(Ve,wt,st,je,qe,0);break;case hu:Ie(Ve,wt,st,je,qe,0),Ei(je,qe,1,st,1,0);break;case hn:es(Ve,wt,st,je,qe);break;case du:es(Ve,wt,st,je,qe),on(je,qe,st,1,0);break;case Gu:Xr(Ve,wt,st,je,qe);break;default:r(0)}ye+=we,De+=Xe}M.Ma+=de}else alert("todo:EmitRescaledRowsYUVA");r(M.Ma<=re.height)}}M.C=G,r(M.C<=M.i)}function gt(M){var G;if(0<M.ua)return 0;for(G=0;G<M.Wb;++G){var re=M.Ya[G].G,oe=M.Ya[G].H;if(0<re[1][oe[1]+0].g||0<re[2][oe[2]+0].g||0<re[3][oe[3]+0].g)return 0}return 1}function Ft(M,G,re,oe,ue,de){if(M.Z!=0){var ge=M.qd,ye=M.rd;for(r(Gi[M.Z]!=null);G<re;++G)Gi[M.Z](ge,ye,oe,ue,oe,ue,de),ge=oe,ye=ue,ue+=de;M.qd=ge,M.rd=ye}}function br(M,G){var re=M.l.ma,oe=re.Z==0||re.Z==1?M.l.j:M.C;if(oe=M.C<oe?oe:M.C,r(G<=M.l.o),G>oe){var ue=M.l.width,de=re.ca,ge=re.tb+ue*oe,ye=M.V,we=M.Ba+M.c*oe,Ee=M.gc;r(M.ab==1),r(Ee[0].hc==3),Cs(Ee[0],oe,G,ye,we,de,ge),Ft(re,oe,G,de,ge,ue)}M.C=M.Ma=G}function hr(M,G,re,oe,ue,de,ge){var ye=M.$/oe,we=M.$%oe,Ee=M.m,De=M.s,Xe=re+M.$,We=Xe;ue=re+oe*ue;var Ve=re+oe*de,wt=280+De.ua,st=M.Pb?ye:16777216,je=0<De.ua?De.Wa:null,qe=De.wc,Ue=Xe<Ve?xt(De,we,ye):null;r(M.C<de),r(Ve<=ue);var ft=!1;e:for(;;){for(;ft||Xe<Ve;){var vt=0;if(ye>=st){var Vt=Xe-re;r((st=M).Pb),st.wd=st.m,st.xd=Vt,0<st.s.ua&&Pe(st.s.Wa,st.s.vb),st=ye+Vu}if(we&qe||(Ue=xt(De,we,ye)),r(Ue!=null),Ue.Qb&&(G[Xe]=Ue.qb,ft=!0),!ft)if(ee(Ee),Ue.jc){vt=Ee,Vt=G;var Bt=Xe,lr=Ue.pd[D(vt)&an-1];r(Ue.jc),256>lr.g?(Q(vt,vt.u+lr.g),Vt[Bt]=lr.value,vt=0):(Q(vt,vt.u+lr.g-256),r(256<=lr.value),vt=lr.value),vt==0&&(ft=!0)}else vt=ct(Ue.G[0],Ue.H[0],Ee);if(Ee.h)break;if(ft||256>vt){if(!ft)if(Ue.nd)G[Xe]=(Ue.qb|vt<<8)>>>0;else{if(ee(Ee),ft=ct(Ue.G[1],Ue.H[1],Ee),ee(Ee),Vt=ct(Ue.G[2],Ue.H[2],Ee),Bt=ct(Ue.G[3],Ue.H[3],Ee),Ee.h)break;G[Xe]=(Bt<<24|ft<<16|vt<<8|Vt)>>>0}if(ft=!1,++Xe,++we>=oe&&(we=0,++ye,ge!=null&&ye<=de&&!(ye%16)&&ge(M,ye),je!=null))for(;We<Xe;)vt=G[We++],je.X[(506832829*vt&4294967295)>>>je.Mb]=vt}else if(280>vt){if(vt=Kt(vt-256,Ee),Vt=ct(Ue.G[4],Ue.H[4],Ee),ee(Ee),Vt=Yt(oe,Vt=Kt(Vt,Ee)),Ee.h)break;if(Xe-re<Vt||ue-Xe<vt)break e;for(Bt=0;Bt<vt;++Bt)G[Xe+Bt]=G[Xe+Bt-Vt];for(Xe+=vt,we+=vt;we>=oe;)we-=oe,++ye,ge!=null&&ye<=de&&!(ye%16)&&ge(M,ye);if(r(Xe<=ue),we&qe&&(Ue=xt(De,we,ye)),je!=null)for(;We<Xe;)vt=G[We++],je.X[(506832829*vt&4294967295)>>>je.Mb]=vt}else{if(!(vt<wt))break e;for(ft=vt-280,r(je!=null);We<Xe;)vt=G[We++],je.X[(506832829*vt&4294967295)>>>je.Mb]=vt;vt=Xe,r(!(ft>>>(Vt=je).Xa)),G[vt]=Vt.X[ft],ft=!0}ft||r(Ee.h==$(Ee))}if(M.Pb&&Ee.h&&Xe<ue)r(M.m.h),M.a=5,M.m=M.wd,M.$=M.xd,0<M.s.ua&&Pe(M.s.vb,M.s.Wa);else{if(Ee.h)break e;ge!=null&&ge(M,ye>de?de:ye),M.a=0,M.$=Xe-re}return 1}return M.a=3,0}function Qr(M){r(M!=null),M.vc=null,M.yc=null,M.Ya=null;var G=M.Wa;G!=null&&(G.X=null),M.vb=null,r(M!=null)}function Sn(){var M=new za;return M==null?null:(M.a=0,M.xb=gu,ke("Predictor","VP8LPredictors"),ke("Predictor","VP8LPredictors_C"),ke("PredictorAdd","VP8LPredictorsAdd"),ke("PredictorAdd","VP8LPredictorsAdd_C"),Hu=yt,Jo=Qe,ci=tt,qi=Ht,es=Pt,Xr=It,fo=qt,T.VP8LMapColor32b=Bi,T.VP8LMapColor8b=Co,M)}function Ni(M,G,re,oe,ue){var de=1,ge=[M],ye=[G],we=oe.m,Ee=oe.s,De=null,Xe=0;e:for(;;){if(re)for(;de&&V(we,1);){var We=ge,Ve=ye,wt=oe,st=1,je=wt.m,qe=wt.gc[wt.ab],Ue=V(je,2);if(wt.Oc&1<<Ue)de=0;else{switch(wt.Oc|=1<<Ue,qe.hc=Ue,qe.Ea=We[0],qe.nc=Ve[0],qe.K=[null],++wt.ab,r(4>=wt.ab),Ue){case 0:case 1:qe.b=V(je,3)+2,st=Ni(Se(qe.Ea,qe.b),Se(qe.nc,qe.b),0,wt,qe.K),qe.K=qe.K[0];break;case 3:var ft,vt=V(je,8)+1,Vt=16<vt?0:4<vt?1:2<vt?2:3;if(We[0]=Se(qe.Ea,Vt),qe.b=Vt,ft=st=Ni(vt,1,0,wt,qe.K)){var Bt,lr=vt,jt=qe,Br=1<<(8>>jt.b),Ur=i(Br);if(Ur==null)ft=0;else{var Ir=jt.K[0],xr=jt.w;for(Ur[0]=jt.K[0][0],Bt=1;Bt<1*lr;++Bt)Ur[Bt]=be(Ir[xr+Bt],Ur[Bt-1]);for(;Bt<4*Br;++Bt)Ur[Bt]=0;jt.K[0]=null,jt.K[0]=Ur,ft=1}}st=ft;break;case 2:break;default:r(0)}de=st}}if(ge=ge[0],ye=ye[0],de&&V(we,1)&&!(de=1<=(Xe=V(we,4))&&11>=Xe)){oe.a=3;break e}var Zr;if(Zr=de)t:{var tn,tr,Hr,Rn=oe,zn=ge,hi=ye,Ar=Xe,Vi=re,An=Rn.m,Un=Rn.s,di=[null],Oi=1,ga=0,Ya=lf[Ar];r:for(;;){if(Vi&&V(An,1)){var wn=V(An,3)+2,Hn=Se(zn,wn),oa=Se(hi,wn),Do=Hn*oa;if(!Ni(Hn,oa,0,Rn,di))break r;for(di=di[0],Un.xc=wn,tn=0;tn<Do;++tn){var vo=di[tn]>>8&65535;di[tn]=vo,vo>=Oi&&(Oi=vo+1)}}if(An.h)break r;for(tr=0;5>tr;++tr){var qr=il[tr];!tr&&0<Ar&&(qr+=1<<Ar),ga<qr&&(ga=qr)}var mo=o(Oi*Ya,C),yu=Oi,Xu=o(yu,j);if(Xu==null)var Xa=null;else r(65536>=yu),Xa=Xu;var Aa=i(ga);if(Xa==null||Aa==null||mo==null){Rn.a=1;break r}var kl=mo;for(tn=Hr=0;tn<Oi;++tn){var va=Xa[tn],Bo=va.G,yn=va.H,_r=0,rn=1,Cn=0;for(tr=0;5>tr;++tr){qr=il[tr],Bo[tr]=kl,yn[tr]=Hr,!tr&&0<Ar&&(qr+=1<<Ar);i:{var Mn,ri=qr,qo=Rn,dn=Aa,bu=kl,Ts=Hr,pn=0,Ka=qo.m,Ll=V(Ka,1);if(a(dn,0,0,ri),Ll){var sa=V(Ka,1)+1,wu=V(Ka,1),_u=V(Ka,wu==0?1:8);dn[_u]=1,sa==2&&(dn[_u=V(Ka,8)]=1);var Ai=1}else{var ln=i(19),Gn=V(Ka,4)+4;if(19<Gn){qo.a=3;var Vn=0;break i}for(Mn=0;Mn<Gn;++Mn)ln[qh[Mn]]=V(Ka,3);var Za=void 0,yo=void 0,Qa=qo,xc=ln,Wn=ri,Su=dn,ol=0,Ja=Qa.m,_n=8,pi=o(128,C);n:for(;O(pi,0,7,xc,19);){if(V(Ja,1)){var la=2+2*V(Ja,3);if((Za=2+V(Ja,la))>Wn)break n}else Za=Wn;for(yo=0;yo<Wn&&Za--;){ee(Ja);var Wi=pi[0+(127&D(Ja))];Q(Ja,Ja.u+Wi.g);var Rs=Wi.value;if(16>Rs)Su[yo++]=Rs,Rs!=0&&(_n=Rs);else{var Ec=Rs==16,Ku=Rs-16,Wf=bc[Ku],os=V(Ja,pu[Ku])+Wf;if(yo+os>Wn)break n;for(var ff=Ec?_n:0;0<os--;)Su[yo++]=ff}}ol=1;break n}ol||(Qa.a=3),Ai=ol}(Ai=Ai&&!Ka.h)&&(pn=O(bu,Ts,8,dn,ri)),Ai&&pn!=0?Vn=pn:(qo.a=3,Vn=0)}if(Vn==0)break r;if(rn&&Bf[tr]==1&&(rn=kl[Hr].g==0),_r+=kl[Hr].g,Hr+=Vn,3>=tr){var Nl,xu=Aa[0];for(Nl=1;Nl<qr;++Nl)Aa[Nl]>xu&&(xu=Aa[Nl]);Cn+=xu}}if(va.nd=rn,va.Qb=0,rn&&(va.qb=(Bo[3][yn[3]+0].value<<24|Bo[1][yn[1]+0].value<<16|Bo[2][yn[2]+0].value)>>>0,_r==0&&256>Bo[0][yn[0]+0].value&&(va.Qb=1,va.qb+=Bo[0][yn[0]+0].value<<8)),va.jc=!va.Qb&&6>Cn,va.jc){var zo,Ca=va;for(zo=0;zo<an;++zo){var ss=zo,eo=Ca.pd[ss],ls=Ca.G[0][Ca.H[0]+ss];256<=ls.value?(eo.g=ls.g+256,eo.value=ls.value):(eo.g=0,eo.value=0,ss>>=_t(ls,8,eo),ss>>=_t(Ca.G[1][Ca.H[1]+ss],16,eo),ss>>=_t(Ca.G[2][Ca.H[2]+ss],0,eo),_t(Ca.G[3][Ca.H[3]+ss],24,eo))}}}Un.vc=di,Un.Wb=Oi,Un.Ya=Xa,Un.yc=mo,Zr=1;break t}Zr=0}if(!(de=Zr)){oe.a=3;break e}if(0<Xe){if(Ee.ua=1<<Xe,!Re(Ee.Wa,Xe)){oe.a=1,de=0;break e}}else Ee.ua=0;var Pc=oe,Oc=ge,hf=ye,Zu=Pc.s,us=Zu.xc;if(Pc.c=Oc,Pc.i=hf,Zu.md=Se(Oc,us),Zu.wc=us==0?-1:(1<<us)-1,re){oe.xb=po;break e}if((De=i(ge*ye))==null){oe.a=1,de=0;break e}de=(de=hr(oe,De,0,ge,ye,ye,null))&&!we.h;break e}return de?(ue!=null?ue[0]=De:(r(De==null),r(re)),oe.$=0,re||Qr(Ee)):Qr(Ee),de}function Si(M,G){var re=M.c*M.i,oe=re+G+16*G;return r(M.c<=G),M.V=i(oe),M.V==null?(M.Ta=null,M.Ua=0,M.a=1,0):(M.Ta=M.V,M.Ua=M.Ba+re+G,1)}function fa(M,G){var re=M.C,oe=G-re,ue=M.V,de=M.Ba+M.c*re;for(r(G<=M.l.o);0<oe;){var ge=16<oe?16:oe,ye=M.l.ma,we=M.l.width,Ee=we*ge,De=ye.ca,Xe=ye.tb+we*re,We=M.Ta,Ve=M.Ua;rt(M,ge,ue,de),qn(We,Ve,De,Xe,Ee),Ft(ye,re,re+ge,De,Xe,we),oe-=ge,ue+=ge*M.c,re+=ge}r(re==G),M.C=M.Ma=G}function _s(){this.ub=this.yd=this.td=this.Rb=0}function Vo(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function tu(){this.Fb=this.Bb=this.Cb=0,this.Zb=i(4),this.Lb=i(4)}function mc(){this.Yb=function(){var M=[];return function G(re,oe,ue){for(var de=ue[oe],ge=0;ge<de&&(re.push(ue.length>oe+1?[]:0),!(ue.length<oe+1));ge++)G(re[ge],oe+1,ue)}(M,0,[3,11]),M}()}function Fn(){this.jb=i(3),this.Wc=s([4,8],mc),this.Xc=s([4,17],mc)}function Bu(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new i(4),this.od=new i(4)}function oo(){this.ld=this.La=this.dd=this.tc=0}function dl(){this.Na=this.la=0}function Gs(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function qu(){this.ad=i(384),this.Za=0,this.Ob=i(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function ru(){this.uc=this.M=this.Nb=0,this.wa=Array(new oo),this.Y=0,this.ya=Array(new qu),this.aa=0,this.l=new Jr}function so(){this.y=i(16),this.f=i(8),this.ea=i(8)}function gi(){this.cb=this.a=0,this.sc="",this.m=new H,this.Od=new _s,this.Kc=new Vo,this.ed=new Bu,this.Qa=new tu,this.Ic=this.$c=this.Aa=0,this.D=new ru,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=o(8,H),this.ia=0,this.pb=o(4,Gs),this.Pa=new Fn,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new so),this.Hd=0,this.rb=Array(new dl),this.sb=0,this.wa=Array(new oo),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new qu),this.L=this.aa=0,this.gd=s([4,2],oo),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function Jr(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function Nr(){var M=new gi;return M!=null&&(M.a=0,M.sc="OK",M.cb=0,M.Xb=0,Ol||(Ol=Ia)),M}function cn(M,G,re){return M.a==0&&(M.a=G,M.sc=re,M.cb=0),0}function vi(M,G,re){return 3<=re&&M[G+0]==157&&M[G+1]==1&&M[G+2]==42}function Ti(M,G){if(M==null)return 0;if(M.a=0,M.sc="OK",G==null)return cn(M,2,"null VP8Io passed to VP8GetHeaders()");var re=G.data,oe=G.w,ue=G.ha;if(4>ue)return cn(M,7,"Truncated header.");var de=re[oe+0]|re[oe+1]<<8|re[oe+2]<<16,ge=M.Od;if(ge.Rb=!(1&de),ge.td=de>>1&7,ge.yd=de>>4&1,ge.ub=de>>5,3<ge.td)return cn(M,3,"Incorrect keyframe parameters.");if(!ge.yd)return cn(M,4,"Frame not displayable.");oe+=3,ue-=3;var ye=M.Kc;if(ge.Rb){if(7>ue)return cn(M,7,"cannot parse picture header");if(!vi(re,oe,ue))return cn(M,3,"Bad code word");ye.c=16383&(re[oe+4]<<8|re[oe+3]),ye.Td=re[oe+4]>>6,ye.i=16383&(re[oe+6]<<8|re[oe+5]),ye.Ud=re[oe+6]>>6,oe+=7,ue-=7,M.za=ye.c+15>>4,M.Ub=ye.i+15>>4,G.width=ye.c,G.height=ye.i,G.Da=0,G.j=0,G.v=0,G.va=G.width,G.o=G.height,G.da=0,G.ib=G.width,G.hb=G.height,G.U=G.width,G.T=G.height,a((de=M.Pa).jb,0,255,de.jb.length),r((de=M.Qa)!=null),de.Cb=0,de.Bb=0,de.Fb=1,a(de.Zb,0,0,de.Zb.length),a(de.Lb,0,0,de.Lb)}if(ge.ub>ue)return cn(M,7,"bad partition length");N(de=M.m,re,oe,ge.ub),oe+=ge.ub,ue-=ge.ub,ge.Rb&&(ye.Ld=ae(de),ye.Kd=ae(de)),ye=M.Qa;var we,Ee=M.Pa;if(r(de!=null),r(ye!=null),ye.Cb=ae(de),ye.Cb){if(ye.Bb=ae(de),ae(de)){for(ye.Fb=ae(de),we=0;4>we;++we)ye.Zb[we]=ae(de)?W(de,7):0;for(we=0;4>we;++we)ye.Lb[we]=ae(de)?W(de,6):0}if(ye.Bb)for(we=0;3>we;++we)Ee.jb[we]=ae(de)?B(de,8):255}else ye.Bb=0;if(de.Ka)return cn(M,3,"cannot parse segment header");if((ye=M.ed).zd=ae(de),ye.Tb=B(de,6),ye.wb=B(de,3),ye.Pc=ae(de),ye.Pc&&ae(de)){for(Ee=0;4>Ee;++Ee)ae(de)&&(ye.vd[Ee]=W(de,6));for(Ee=0;4>Ee;++Ee)ae(de)&&(ye.od[Ee]=W(de,6))}if(M.L=ye.Tb==0?0:ye.zd?1:2,de.Ka)return cn(M,3,"cannot parse filter header");var De=ue;if(ue=we=oe,oe=we+De,ye=De,M.Xb=(1<<B(M.m,2))-1,De<3*(Ee=M.Xb))re=7;else{for(we+=3*Ee,ye-=3*Ee,De=0;De<Ee;++De){var Xe=re[ue+0]|re[ue+1]<<8|re[ue+2]<<16;Xe>ye&&(Xe=ye),N(M.Jc[+De],re,we,Xe),we+=Xe,ye-=Xe,ue+=3}N(M.Jc[+Ee],re,we,ye),re=we<oe?0:5}if(re!=0)return cn(M,re,"cannot parse partitions");for(re=B(we=M.m,7),ue=ae(we)?W(we,4):0,oe=ae(we)?W(we,4):0,ye=ae(we)?W(we,4):0,Ee=ae(we)?W(we,4):0,we=ae(we)?W(we,4):0,De=M.Qa,Xe=0;4>Xe;++Xe){if(De.Cb){var We=De.Zb[Xe];De.Fb||(We+=re)}else{if(0<Xe){M.pb[Xe]=M.pb[0];continue}We=re}var Ve=M.pb[Xe];Ve.Sc[0]=Ls[Ea(We+ue,127)],Ve.Sc[1]=Wu[Ea(We+0,127)],Ve.Eb[0]=2*Ls[Ea(We+oe,127)],Ve.Eb[1]=101581*Wu[Ea(We+ye,127)]>>16,8>Ve.Eb[1]&&(Ve.Eb[1]=8),Ve.Qc[0]=Ls[Ea(We+Ee,117)],Ve.Qc[1]=Wu[Ea(We+we,127)],Ve.lc=We+we}if(!ge.Rb)return cn(M,4,"Not a key frame.");for(ae(de),ge=M.Pa,re=0;4>re;++re){for(ue=0;8>ue;++ue)for(oe=0;3>oe;++oe)for(ye=0;11>ye;++ye)Ee=se(de,Uf[re][ue][oe][ye])?B(de,8):$u[re][ue][oe][ye],ge.Wc[re][ue].Yb[oe][ye]=Ee;for(ue=0;17>ue;++ue)ge.Xc[re][ue]=ge.Wc[re][_c[ue]]}return M.kc=ae(de),M.kc&&(M.Bd=B(de,8)),M.cb=1}function Ia(M,G,re,oe,ue,de,ge){var ye=G[ue].Yb[re];for(re=0;16>ue;++ue){if(!se(M,ye[re+0]))return ue;for(;!se(M,ye[re+1]);)if(ye=G[++ue].Yb[0],re=0,ue==16)return 16;var we=G[ue+1].Yb;if(se(M,ye[re+2])){var Ee=M,De=0;if(se(Ee,(We=ye)[(Xe=re)+3]))if(se(Ee,We[Xe+6])){for(ye=0,Xe=2*(De=se(Ee,We[Xe+8]))+(We=se(Ee,We[Xe+9+De])),De=0,We=uf[Xe];We[ye];++ye)De+=De+se(Ee,We[ye]);De+=3+(8<<Xe)}else se(Ee,We[Xe+7])?(De=7+2*se(Ee,165),De+=se(Ee,145)):De=5+se(Ee,159);else De=se(Ee,We[Xe+4])?3+se(Ee,We[Xe+5]):2;ye=we[2]}else De=1,ye=we[1];we=ge+$a[ue],0>(Ee=M).b&&te(Ee);var Xe,We=Ee.b,Ve=(Xe=Ee.Ca>>1)-(Ee.I>>We)>>31;--Ee.b,Ee.Ca+=Ve,Ee.Ca|=1,Ee.I-=(Xe+1&Ve)<<We,de[we]=((De^Ve)-Ve)*oe[(0<ue)+0]}return 16}function ja(M){var G=M.rb[M.sb-1];G.la=0,G.Na=0,a(M.zc,0,0,M.zc.length),M.ja=0}function oi(M,G){if(M==null)return 0;if(G==null)return cn(M,2,"NULL VP8Io parameter in VP8Decode().");if(!M.cb&&!Ti(M,G))return 0;if(r(M.cb),G.ac==null||G.ac(G)){G.ob&&(M.L=0);var re=is[M.L];if(M.L==2?(M.yb=0,M.zb=0):(M.yb=G.v-re>>4,M.zb=G.j-re>>4,0>M.yb&&(M.yb=0),0>M.zb&&(M.zb=0)),M.Va=G.o+15+re>>4,M.Hb=G.va+15+re>>4,M.Hb>M.za&&(M.Hb=M.za),M.Va>M.Ub&&(M.Va=M.Ub),0<M.L){var oe=M.ed;for(re=0;4>re;++re){var ue;if(M.Qa.Cb){var de=M.Qa.Lb[re];M.Qa.Fb||(de+=oe.Tb)}else de=oe.Tb;for(ue=0;1>=ue;++ue){var ge=M.gd[re][ue],ye=de;if(oe.Pc&&(ye+=oe.vd[0],ue&&(ye+=oe.od[0])),0<(ye=0>ye?0:63<ye?63:ye)){var we=ye;0<oe.wb&&(we=4<oe.wb?we>>2:we>>1)>9-oe.wb&&(we=9-oe.wb),1>we&&(we=1),ge.dd=we,ge.tc=2*ye+we,ge.ld=40<=ye?2:15<=ye?1:0}else ge.tc=0;ge.La=ue}}}re=0}else cn(M,6,"Frame setup failed"),re=M.a;if(re=re==0){if(re){M.$c=0,0<M.Aa||(M.Ic=as);e:{re=M.Ic,oe=4*(we=M.za);var Ee=32*we,De=we+1,Xe=0<M.L?we*(0<M.Aa?2:1):0,We=(M.Aa==2?2:1)*we;if((ge=oe+832+(ue=3*(16*re+is[M.L])/2*Ee)+(de=M.Fa!=null&&0<M.Fa.length?M.Kc.c*M.Kc.i:0))!=ge)re=0;else{if(ge>M.Vb){if(M.Vb=0,M.Ec=i(ge),M.Fc=0,M.Ec==null){re=cn(M,1,"no memory during frame initialization.");break e}M.Vb=ge}ge=M.Ec,ye=M.Fc,M.Ac=ge,M.Bc=ye,ye+=oe,M.Gd=o(Ee,so),M.Hd=0,M.rb=o(De+1,dl),M.sb=1,M.wa=Xe?o(Xe,oo):null,M.Y=0,M.D.Nb=0,M.D.wa=M.wa,M.D.Y=M.Y,0<M.Aa&&(M.D.Y+=we),r(!0),M.oc=ge,M.pc=ye,ye+=832,M.ya=o(We,qu),M.aa=0,M.D.ya=M.ya,M.D.aa=M.aa,M.Aa==2&&(M.D.aa+=we),M.R=16*we,M.B=8*we,we=(Ee=is[M.L])*M.R,Ee=Ee/2*M.B,M.sa=ge,M.ta=ye+we,M.qa=M.sa,M.ra=M.ta+16*re*M.R+Ee,M.Ha=M.qa,M.Ia=M.ra+8*re*M.B+Ee,M.$c=0,ye+=ue,M.mb=de?ge:null,M.nb=de?ye:null,r(ye+de<=M.Fc+M.Vb),ja(M),a(M.Ac,M.Bc,0,oe),re=1}}if(re){if(G.ka=0,G.y=M.sa,G.O=M.ta,G.f=M.qa,G.N=M.ra,G.ea=M.Ha,G.Vd=M.Ia,G.fa=M.R,G.Rc=M.B,G.F=null,G.J=0,!cu){for(re=-255;255>=re;++re)ti[255+re]=0>re?-re:re;for(re=-1020;1020>=re;++re)Io[1020+re]=-128>re?-128:127<re?127:re;for(re=-112;112>=re;++re)_l[112+re]=-16>re?-16:15<re?15:re;for(re=-255;510>=re;++re)nl[255+re]=0>re?0:255<re?255:re;cu=1}rl=Fr,ko=da,Lo=Vs,Kn=af,Mr=iu,Dr=nu,On=Fi,Zn=En,ts=qa,No=lu,To=ea,Va=ta,Tn=As,ho=Zs,Ro=li,Mo=Ii,zi=ji,fn=vl,Hi[0]=Oo,Hi[1]=Ws,Hi[2]=Ys,Hi[3]=lo,Hi[4]=zu,Hi[5]=Dn,Hi[6]=Xs,Hi[7]=Ks,Hi[8]=ou,Hi[9]=au,Ui[0]=Ps,Ui[1]=yc,Ui[2]=$o,Ui[3]=xs,Ui[4]=mn,Ui[5]=Yo,Ui[6]=Fa,na[0]=Da,na[1]=$s,na[2]=of,na[3]=uo,na[4]=Mi,na[5]=su,na[6]=Ba,re=1}else re=0}re&&(re=function(Ve,wt){for(Ve.M=0;Ve.M<Ve.Va;++Ve.M){var st,je=Ve.Jc[Ve.M&Ve.Xb],qe=Ve.m,Ue=Ve;for(st=0;st<Ue.za;++st){var ft=qe,vt=Ue,Vt=vt.Ac,Bt=vt.Bc+4*st,lr=vt.zc,jt=vt.ya[vt.aa+st];if(vt.Qa.Bb?jt.$b=se(ft,vt.Pa.jb[0])?2+se(ft,vt.Pa.jb[2]):se(ft,vt.Pa.jb[1]):jt.$b=0,vt.kc&&(jt.Ad=se(ft,vt.Bd)),jt.Za=!se(ft,145)+0,jt.Za){var Br=jt.Ob,Ur=0;for(vt=0;4>vt;++vt){var Ir,xr=lr[0+vt];for(Ir=0;4>Ir;++Ir){xr=zf[Vt[Bt+Ir]][xr];for(var Zr=wc[se(ft,xr[0])];0<Zr;)Zr=wc[2*Zr+se(ft,xr[Zr])];xr=-Zr,Vt[Bt+Ir]=xr}n(Br,Ur,Vt,Bt,4),Ur+=4,lr[0+vt]=xr}}else xr=se(ft,156)?se(ft,128)?1:3:se(ft,163)?2:0,jt.Ob[0]=xr,a(Vt,Bt,xr,4),a(lr,0,xr,4);jt.Dd=se(ft,142)?se(ft,114)?se(ft,183)?1:3:2:0}if(Ue.m.Ka)return cn(Ve,7,"Premature end-of-partition0 encountered.");for(;Ve.ja<Ve.za;++Ve.ja){if(Ue=je,ft=(qe=Ve).rb[qe.sb-1],Vt=qe.rb[qe.sb+qe.ja],st=qe.ya[qe.aa+qe.ja],Bt=qe.kc?st.Ad:0)ft.la=Vt.la=0,st.Za||(ft.Na=Vt.Na=0),st.Hc=0,st.Gc=0,st.ia=0;else{var tn,tr;if(ft=Vt,Vt=Ue,Bt=qe.Pa.Xc,lr=qe.ya[qe.aa+qe.ja],jt=qe.pb[lr.$b],vt=lr.ad,Br=0,Ur=qe.rb[qe.sb-1],xr=Ir=0,a(vt,Br,0,384),lr.Za)var Hr=0,Rn=Bt[3];else{Zr=i(16);var zn=ft.Na+Ur.Na;if(zn=Ol(Vt,Bt[1],zn,jt.Eb,0,Zr,0),ft.Na=Ur.Na=(0<zn)+0,1<zn)rl(Zr,0,vt,Br);else{var hi=Zr[0]+3>>3;for(Zr=0;256>Zr;Zr+=16)vt[Br+Zr]=hi}Hr=1,Rn=Bt[0]}var Ar=15&ft.la,Vi=15&Ur.la;for(Zr=0;4>Zr;++Zr){var An=1&Vi;for(hi=tr=0;4>hi;++hi)Ar=Ar>>1|(An=(zn=Ol(Vt,Rn,zn=An+(1&Ar),jt.Sc,Hr,vt,Br))>Hr)<<7,tr=tr<<2|(3<zn?3:1<zn?2:vt[Br+0]!=0),Br+=16;Ar>>=4,Vi=Vi>>1|An<<7,Ir=(Ir<<8|tr)>>>0}for(Rn=Ar,Hr=Vi>>4,tn=0;4>tn;tn+=2){for(tr=0,Ar=ft.la>>4+tn,Vi=Ur.la>>4+tn,Zr=0;2>Zr;++Zr){for(An=1&Vi,hi=0;2>hi;++hi)zn=An+(1&Ar),Ar=Ar>>1|(An=0<(zn=Ol(Vt,Bt[2],zn,jt.Qc,0,vt,Br)))<<3,tr=tr<<2|(3<zn?3:1<zn?2:vt[Br+0]!=0),Br+=16;Ar>>=2,Vi=Vi>>1|An<<5}xr|=tr<<4*tn,Rn|=Ar<<4<<tn,Hr|=(240&Vi)<<tn}ft.la=Rn,Ur.la=Hr,lr.Hc=Ir,lr.Gc=xr,lr.ia=43690&xr?0:jt.ia,Bt=!(Ir|xr)}if(0<qe.L&&(qe.wa[qe.Y+qe.ja]=qe.gd[st.$b][st.Za],qe.wa[qe.Y+qe.ja].La|=!Bt),Ue.Ka)return cn(Ve,7,"Premature end-of-file encountered.")}if(ja(Ve),qe=wt,Ue=1,st=(je=Ve).D,ft=0<je.L&&je.M>=je.zb&&je.M<=je.Va,je.Aa==0)e:{if(st.M=je.M,st.uc=ft,Di(je,st),Ue=1,st=(tr=je.D).Nb,ft=(xr=is[je.L])*je.R,Vt=xr/2*je.B,Zr=16*st*je.R,hi=8*st*je.B,Bt=je.sa,lr=je.ta-ft+Zr,jt=je.qa,vt=je.ra-Vt+hi,Br=je.Ha,Ur=je.Ia-Vt+hi,Vi=(Ar=tr.M)==0,Ir=Ar>=je.Va-1,je.Aa==2&&Di(je,tr),tr.uc)for(An=(zn=je).D.M,r(zn.D.uc),tr=zn.yb;tr<zn.Hb;++tr){Hr=tr,Rn=An;var Un=(di=(qr=zn).D).Nb;tn=qr.R;var di=di.wa[di.Y+Hr],Oi=qr.sa,ga=qr.ta+16*Un*tn+16*Hr,Ya=di.dd,wn=di.tc;if(wn!=0)if(r(3<=wn),qr.L==1)0<Hr&&Mo(Oi,ga,tn,wn+4),di.La&&fn(Oi,ga,tn,wn),0<Rn&&Ro(Oi,ga,tn,wn+4),di.La&&zi(Oi,ga,tn,wn);else{var Hn=qr.B,oa=qr.qa,Do=qr.ra+8*Un*Hn+8*Hr,vo=qr.Ha,qr=qr.Ia+8*Un*Hn+8*Hr;Un=di.ld,0<Hr&&(Zn(Oi,ga,tn,wn+4,Ya,Un),No(oa,Do,vo,qr,Hn,wn+4,Ya,Un)),di.La&&(Va(Oi,ga,tn,wn,Ya,Un),ho(oa,Do,vo,qr,Hn,wn,Ya,Un)),0<Rn&&(On(Oi,ga,tn,wn+4,Ya,Un),ts(oa,Do,vo,qr,Hn,wn+4,Ya,Un)),di.La&&(To(Oi,ga,tn,wn,Ya,Un),Tn(oa,Do,vo,qr,Hn,wn,Ya,Un))}}if(je.ia&&alert("todo:DitherRow"),qe.put!=null){if(tr=16*Ar,Ar=16*(Ar+1),Vi?(qe.y=je.sa,qe.O=je.ta+Zr,qe.f=je.qa,qe.N=je.ra+hi,qe.ea=je.Ha,qe.W=je.Ia+hi):(tr-=xr,qe.y=Bt,qe.O=lr,qe.f=jt,qe.N=vt,qe.ea=Br,qe.W=Ur),Ir||(Ar-=xr),Ar>qe.o&&(Ar=qe.o),qe.F=null,qe.J=null,je.Fa!=null&&0<je.Fa.length&&tr<Ar&&(qe.J=uu(je,qe,tr,Ar-tr),qe.F=je.mb,qe.F==null&&qe.F.length==0)){Ue=cn(je,3,"Could not decode alpha data.");break e}tr<qe.j&&(xr=qe.j-tr,tr=qe.j,r(!(1&xr)),qe.O+=je.R*xr,qe.N+=je.B*(xr>>1),qe.W+=je.B*(xr>>1),qe.F!=null&&(qe.J+=qe.width*xr)),tr<Ar&&(qe.O+=qe.v,qe.N+=qe.v>>1,qe.W+=qe.v>>1,qe.F!=null&&(qe.J+=qe.v),qe.ka=tr-qe.j,qe.U=qe.va-qe.v,qe.T=Ar-tr,Ue=qe.put(qe))}st+1!=je.Ic||Ir||(n(je.sa,je.ta-ft,Bt,lr+16*je.R,ft),n(je.qa,je.ra-Vt,jt,vt+8*je.B,Vt),n(je.Ha,je.Ia-Vt,Br,Ur+8*je.B,Vt))}if(!Ue)return cn(Ve,6,"Output aborted.")}return 1}(M,G)),G.bc!=null&&G.bc(G),re&=1}return re?(M.cb=0,re):0}function Ri(M,G,re,oe,ue){ue=M[G+re+32*oe]+(ue>>3),M[G+re+32*oe]=-256&ue?0>ue?0:255:ue}function pl(M,G,re,oe,ue,de){Ri(M,G,0,re,oe+ue),Ri(M,G,1,re,oe+de),Ri(M,G,2,re,oe-de),Ri(M,G,3,re,oe-ue)}function ha(M){return(20091*M>>16)+M}function Wo(M,G,re,oe){var ue,de=0,ge=i(16);for(ue=0;4>ue;++ue){var ye=M[G+0]+M[G+8],we=M[G+0]-M[G+8],Ee=(35468*M[G+4]>>16)-ha(M[G+12]),De=ha(M[G+4])+(35468*M[G+12]>>16);ge[de+0]=ye+De,ge[de+1]=we+Ee,ge[de+2]=we-Ee,ge[de+3]=ye-De,de+=4,G++}for(ue=de=0;4>ue;++ue)ye=(M=ge[de+0]+4)+ge[de+8],we=M-ge[de+8],Ee=(35468*ge[de+4]>>16)-ha(ge[de+12]),Ri(re,oe,0,0,ye+(De=ha(ge[de+4])+(35468*ge[de+12]>>16))),Ri(re,oe,1,0,we+Ee),Ri(re,oe,2,0,we-Ee),Ri(re,oe,3,0,ye-De),de++,oe+=32}function nu(M,G,re,oe){var ue=M[G+0]+4,de=35468*M[G+4]>>16,ge=ha(M[G+4]),ye=35468*M[G+1]>>16;pl(re,oe,0,ue+ge,M=ha(M[G+1]),ye),pl(re,oe,1,ue+de,M,ye),pl(re,oe,2,ue-de,M,ye),pl(re,oe,3,ue-ge,M,ye)}function da(M,G,re,oe,ue){Wo(M,G,re,oe),ue&&Wo(M,G+16,re,oe+4)}function Vs(M,G,re,oe){ko(M,G+0,re,oe,1),ko(M,G+32,re,oe+128,1)}function af(M,G,re,oe){var ue;for(M=M[G+0]+4,ue=0;4>ue;++ue)for(G=0;4>G;++G)Ri(re,oe,G,ue,M)}function iu(M,G,re,oe){M[G+0]&&Kn(M,G+0,re,oe),M[G+16]&&Kn(M,G+16,re,oe+4),M[G+32]&&Kn(M,G+32,re,oe+128),M[G+48]&&Kn(M,G+48,re,oe+128+4)}function Fr(M,G,re,oe){var ue,de=i(16);for(ue=0;4>ue;++ue){var ge=M[G+0+ue]+M[G+12+ue],ye=M[G+4+ue]+M[G+8+ue],we=M[G+4+ue]-M[G+8+ue],Ee=M[G+0+ue]-M[G+12+ue];de[0+ue]=ge+ye,de[8+ue]=ge-ye,de[4+ue]=Ee+we,de[12+ue]=Ee-we}for(ue=0;4>ue;++ue)ge=(M=de[0+4*ue]+3)+de[3+4*ue],ye=de[1+4*ue]+de[2+4*ue],we=de[1+4*ue]-de[2+4*ue],Ee=M-de[3+4*ue],re[oe+0]=ge+ye>>3,re[oe+16]=Ee+we>>3,re[oe+32]=ge-ye>>3,re[oe+48]=Ee-we>>3,oe+=64}function Ss(M,G,re){var oe,ue=G-32,de=wi,ge=255-M[ue-1];for(oe=0;oe<re;++oe){var ye,we=de,Ee=ge+M[G-1];for(ye=0;ye<re;++ye)M[G+ye]=we[Ee+M[ue+ye]];G+=32}}function Ws(M,G){Ss(M,G,4)}function $s(M,G){Ss(M,G,8)}function yc(M,G){Ss(M,G,16)}function $o(M,G){var re;for(re=0;16>re;++re)n(M,G+32*re,M,G-32,16)}function xs(M,G){var re;for(re=16;0<re;--re)a(M,G,M[G-1],16),G+=32}function Es(M,G,re){var oe;for(oe=0;16>oe;++oe)a(G,re+32*oe,M,16)}function Ps(M,G){var re,oe=16;for(re=0;16>re;++re)oe+=M[G-1+32*re]+M[G+re-32];Es(oe>>5,M,G)}function mn(M,G){var re,oe=8;for(re=0;16>re;++re)oe+=M[G-1+32*re];Es(oe>>4,M,G)}function Yo(M,G){var re,oe=8;for(re=0;16>re;++re)oe+=M[G+re-32];Es(oe>>4,M,G)}function Fa(M,G){Es(128,M,G)}function Dt(M,G,re){return M+2*G+re+2>>2}function Ys(M,G){var re,oe=G-32;for(oe=new Uint8Array([Dt(M[oe-1],M[oe+0],M[oe+1]),Dt(M[oe+0],M[oe+1],M[oe+2]),Dt(M[oe+1],M[oe+2],M[oe+3]),Dt(M[oe+2],M[oe+3],M[oe+4])]),re=0;4>re;++re)n(M,G+32*re,oe,0,oe.length)}function lo(M,G){var re=M[G-1],oe=M[G-1+32],ue=M[G-1+64],de=M[G-1+96];ce(M,G+0,16843009*Dt(M[G-1-32],re,oe)),ce(M,G+32,16843009*Dt(re,oe,ue)),ce(M,G+64,16843009*Dt(oe,ue,de)),ce(M,G+96,16843009*Dt(ue,de,de))}function Oo(M,G){var re,oe=4;for(re=0;4>re;++re)oe+=M[G+re-32]+M[G-1+32*re];for(oe>>=3,re=0;4>re;++re)a(M,G+32*re,oe,4)}function zu(M,G){var re=M[G-1+0],oe=M[G-1+32],ue=M[G-1+64],de=M[G-1-32],ge=M[G+0-32],ye=M[G+1-32],we=M[G+2-32],Ee=M[G+3-32];M[G+0+96]=Dt(oe,ue,M[G-1+96]),M[G+1+96]=M[G+0+64]=Dt(re,oe,ue),M[G+2+96]=M[G+1+64]=M[G+0+32]=Dt(de,re,oe),M[G+3+96]=M[G+2+64]=M[G+1+32]=M[G+0+0]=Dt(ge,de,re),M[G+3+64]=M[G+2+32]=M[G+1+0]=Dt(ye,ge,de),M[G+3+32]=M[G+2+0]=Dt(we,ye,ge),M[G+3+0]=Dt(Ee,we,ye)}function Xs(M,G){var re=M[G+1-32],oe=M[G+2-32],ue=M[G+3-32],de=M[G+4-32],ge=M[G+5-32],ye=M[G+6-32],we=M[G+7-32];M[G+0+0]=Dt(M[G+0-32],re,oe),M[G+1+0]=M[G+0+32]=Dt(re,oe,ue),M[G+2+0]=M[G+1+32]=M[G+0+64]=Dt(oe,ue,de),M[G+3+0]=M[G+2+32]=M[G+1+64]=M[G+0+96]=Dt(ue,de,ge),M[G+3+32]=M[G+2+64]=M[G+1+96]=Dt(de,ge,ye),M[G+3+64]=M[G+2+96]=Dt(ge,ye,we),M[G+3+96]=Dt(ye,we,we)}function Dn(M,G){var re=M[G-1+0],oe=M[G-1+32],ue=M[G-1+64],de=M[G-1-32],ge=M[G+0-32],ye=M[G+1-32],we=M[G+2-32],Ee=M[G+3-32];M[G+0+0]=M[G+1+64]=de+ge+1>>1,M[G+1+0]=M[G+2+64]=ge+ye+1>>1,M[G+2+0]=M[G+3+64]=ye+we+1>>1,M[G+3+0]=we+Ee+1>>1,M[G+0+96]=Dt(ue,oe,re),M[G+0+64]=Dt(oe,re,de),M[G+0+32]=M[G+1+96]=Dt(re,de,ge),M[G+1+32]=M[G+2+96]=Dt(de,ge,ye),M[G+2+32]=M[G+3+96]=Dt(ge,ye,we),M[G+3+32]=Dt(ye,we,Ee)}function Ks(M,G){var re=M[G+0-32],oe=M[G+1-32],ue=M[G+2-32],de=M[G+3-32],ge=M[G+4-32],ye=M[G+5-32],we=M[G+6-32],Ee=M[G+7-32];M[G+0+0]=re+oe+1>>1,M[G+1+0]=M[G+0+64]=oe+ue+1>>1,M[G+2+0]=M[G+1+64]=ue+de+1>>1,M[G+3+0]=M[G+2+64]=de+ge+1>>1,M[G+0+32]=Dt(re,oe,ue),M[G+1+32]=M[G+0+96]=Dt(oe,ue,de),M[G+2+32]=M[G+1+96]=Dt(ue,de,ge),M[G+3+32]=M[G+2+96]=Dt(de,ge,ye),M[G+3+64]=Dt(ge,ye,we),M[G+3+96]=Dt(ye,we,Ee)}function au(M,G){var re=M[G-1+0],oe=M[G-1+32],ue=M[G-1+64],de=M[G-1+96];M[G+0+0]=re+oe+1>>1,M[G+2+0]=M[G+0+32]=oe+ue+1>>1,M[G+2+32]=M[G+0+64]=ue+de+1>>1,M[G+1+0]=Dt(re,oe,ue),M[G+3+0]=M[G+1+32]=Dt(oe,ue,de),M[G+3+32]=M[G+1+64]=Dt(ue,de,de),M[G+3+64]=M[G+2+64]=M[G+0+96]=M[G+1+96]=M[G+2+96]=M[G+3+96]=de}function ou(M,G){var re=M[G-1+0],oe=M[G-1+32],ue=M[G-1+64],de=M[G-1+96],ge=M[G-1-32],ye=M[G+0-32],we=M[G+1-32],Ee=M[G+2-32];M[G+0+0]=M[G+2+32]=re+ge+1>>1,M[G+0+32]=M[G+2+64]=oe+re+1>>1,M[G+0+64]=M[G+2+96]=ue+oe+1>>1,M[G+0+96]=de+ue+1>>1,M[G+3+0]=Dt(ye,we,Ee),M[G+2+0]=Dt(ge,ye,we),M[G+1+0]=M[G+3+32]=Dt(re,ge,ye),M[G+1+32]=M[G+3+64]=Dt(oe,re,ge),M[G+1+64]=M[G+3+96]=Dt(ue,oe,re),M[G+1+96]=Dt(de,ue,oe)}function of(M,G){var re;for(re=0;8>re;++re)n(M,G+32*re,M,G-32,8)}function uo(M,G){var re;for(re=0;8>re;++re)a(M,G,M[G-1],8),G+=32}function si(M,G,re){var oe;for(oe=0;8>oe;++oe)a(G,re+32*oe,M,8)}function Da(M,G){var re,oe=8;for(re=0;8>re;++re)oe+=M[G+re-32]+M[G-1+32*re];si(oe>>4,M,G)}function su(M,G){var re,oe=4;for(re=0;8>re;++re)oe+=M[G+re-32];si(oe>>3,M,G)}function Mi(M,G){var re,oe=4;for(re=0;8>re;++re)oe+=M[G-1+32*re];si(oe>>3,M,G)}function Ba(M,G){si(128,M,G)}function Ao(M,G,re){var oe=M[G-re],ue=M[G+0],de=3*(ue-oe)+jo[1020+M[G-2*re]-M[G+re]],ge=Sl[112+(de+4>>3)];M[G-re]=wi[255+oe+Sl[112+(de+3>>3)]],M[G+0]=wi[255+ue-ge]}function Os(M,G,re,oe){var ue=M[G+0],de=M[G+re];return Wa[255+M[G-2*re]-M[G-re]]>oe||Wa[255+de-ue]>oe}function gl(M,G,re,oe){return 4*Wa[255+M[G-re]-M[G+0]]+Wa[255+M[G-2*re]-M[G+re]]<=oe}function Uu(M,G,re,oe,ue){var de=M[G-3*re],ge=M[G-2*re],ye=M[G-re],we=M[G+0],Ee=M[G+re],De=M[G+2*re],Xe=M[G+3*re];return 4*Wa[255+ye-we]+Wa[255+ge-Ee]>oe?0:Wa[255+M[G-4*re]-de]<=ue&&Wa[255+de-ge]<=ue&&Wa[255+ge-ye]<=ue&&Wa[255+Xe-De]<=ue&&Wa[255+De-Ee]<=ue&&Wa[255+Ee-we]<=ue}function li(M,G,re,oe){var ue=2*oe+1;for(oe=0;16>oe;++oe)gl(M,G+oe,re,ue)&&Ao(M,G+oe,re)}function Ii(M,G,re,oe){var ue=2*oe+1;for(oe=0;16>oe;++oe)gl(M,G+oe*re,1,ue)&&Ao(M,G+oe*re,1)}function ji(M,G,re,oe){var ue;for(ue=3;0<ue;--ue)li(M,G+=4*re,re,oe)}function vl(M,G,re,oe){var ue;for(ue=3;0<ue;--ue)Ii(M,G+=4,re,oe)}function xa(M,G,re,oe,ue,de,ge,ye){for(de=2*de+1;0<ue--;){if(Uu(M,G,re,de,ge))if(Os(M,G,re,ye))Ao(M,G,re);else{var we=M,Ee=G,De=re,Xe=we[Ee-2*De],We=we[Ee-De],Ve=we[Ee+0],wt=we[Ee+De],st=we[Ee+2*De],je=27*(Ue=jo[1020+3*(Ve-We)+jo[1020+Xe-wt]])+63>>7,qe=18*Ue+63>>7,Ue=9*Ue+63>>7;we[Ee-3*De]=wi[255+we[Ee-3*De]+Ue],we[Ee-2*De]=wi[255+Xe+qe],we[Ee-De]=wi[255+We+je],we[Ee+0]=wi[255+Ve-je],we[Ee+De]=wi[255+wt-qe],we[Ee+2*De]=wi[255+st-Ue]}G+=oe}}function xn(M,G,re,oe,ue,de,ge,ye){for(de=2*de+1;0<ue--;){if(Uu(M,G,re,de,ge))if(Os(M,G,re,ye))Ao(M,G,re);else{var we=M,Ee=G,De=re,Xe=we[Ee-De],We=we[Ee+0],Ve=we[Ee+De],wt=Sl[112+((st=3*(We-Xe))+4>>3)],st=Sl[112+(st+3>>3)],je=wt+1>>1;we[Ee-2*De]=wi[255+we[Ee-2*De]+je],we[Ee-De]=wi[255+Xe+st],we[Ee+0]=wi[255+We-wt],we[Ee+De]=wi[255+Ve-je]}G+=oe}}function Fi(M,G,re,oe,ue,de){xa(M,G,re,1,16,oe,ue,de)}function En(M,G,re,oe,ue,de){xa(M,G,1,re,16,oe,ue,de)}function ea(M,G,re,oe,ue,de){var ge;for(ge=3;0<ge;--ge)xn(M,G+=4*re,re,1,16,oe,ue,de)}function ta(M,G,re,oe,ue,de){var ge;for(ge=3;0<ge;--ge)xn(M,G+=4,1,re,16,oe,ue,de)}function qa(M,G,re,oe,ue,de,ge,ye){xa(M,G,ue,1,8,de,ge,ye),xa(re,oe,ue,1,8,de,ge,ye)}function lu(M,G,re,oe,ue,de,ge,ye){xa(M,G,1,ue,8,de,ge,ye),xa(re,oe,1,ue,8,de,ge,ye)}function As(M,G,re,oe,ue,de,ge,ye){xn(M,G+4*ue,ue,1,8,de,ge,ye),xn(re,oe+4*ue,ue,1,8,de,ge,ye)}function Zs(M,G,re,oe,ue,de,ge,ye){xn(M,G+4,1,ue,8,de,ge,ye),xn(re,oe+4,1,ue,8,de,ge,ye)}function Xn(){this.ba=new St,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new nr,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function mi(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function nn(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Qs(){this.ua=0,this.Wa=new ve,this.vb=new ve,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new j,this.yc=new C}function za(){this.xb=this.a=0,this.l=new Jr,this.ca=new St,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new U,this.Pb=0,this.wd=new U,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Qs,this.ab=0,this.gc=o(4,nn),this.Oc=0}function ml(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Jr,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Xo(M,G,re,oe,ue,de,ge){for(M=M==null?0:M[G+0],G=0;G<ge;++G)ue[de+G]=M+re[oe+G]&255,M=ue[de+G]}function yl(M,G,re,oe,ue,de,ge){var ye;if(M==null)Xo(null,null,re,oe,ue,de,ge);else for(ye=0;ye<ge;++ye)ue[de+ye]=M[G+ye]+re[oe+ye]&255}function Ko(M,G,re,oe,ue,de,ge){if(M==null)Xo(null,null,re,oe,ue,de,ge);else{var ye,we=M[G+0],Ee=we,De=we;for(ye=0;ye<ge;++ye)Ee=De+(we=M[G+ye])-Ee,De=re[oe+ye]+(-256&Ee?0>Ee?0:255:Ee)&255,Ee=we,ue[de+ye]=De}}function uu(M,G,re,oe){var ue=G.width,de=G.o;if(r(M!=null&&G!=null),0>re||0>=oe||re+oe>de)return null;if(!M.Cc){if(M.ga==null){var ge;if(M.ga=new ml,(ge=M.ga==null)||(ge=G.width*G.o,r(M.Gb.length==0),M.Gb=i(ge),M.Uc=0,M.Gb==null?ge=0:(M.mb=M.Gb,M.nb=M.Uc,M.rc=null,ge=1),ge=!ge),!ge){ge=M.ga;var ye=M.Fa,we=M.P,Ee=M.qc,De=M.mb,Xe=M.nb,We=we+1,Ve=Ee-1,wt=ge.l;if(r(ye!=null&&De!=null&&G!=null),Gi[0]=null,Gi[1]=Xo,Gi[2]=yl,Gi[3]=Ko,ge.ca=De,ge.tb=Xe,ge.c=G.width,ge.i=G.height,r(0<ge.c&&0<ge.i),1>=Ee)G=0;else if(ge.$a=ye[we+0]>>0&3,ge.Z=ye[we+0]>>2&3,ge.Lc=ye[we+0]>>4&3,we=ye[we+0]>>6&3,0>ge.$a||1<ge.$a||4<=ge.Z||1<ge.Lc||we)G=0;else if(wt.put=mt,wt.ac=Je,wt.bc=Gt,wt.ma=ge,wt.width=G.width,wt.height=G.height,wt.Da=G.Da,wt.v=G.v,wt.va=G.va,wt.j=G.j,wt.o=G.o,ge.$a)e:{r(ge.$a==1),G=Sn();t:for(;;){if(G==null){G=0;break e}if(r(ge!=null),ge.mc=G,G.c=ge.c,G.i=ge.i,G.l=ge.l,G.l.ma=ge,G.l.width=ge.c,G.l.height=ge.i,G.a=0,Y(G.m,ye,We,Ve),!Ni(ge.c,ge.i,1,G,null)||(G.ab==1&&G.gc[0].hc==3&>(G.s)?(ge.ic=1,ye=G.c*G.i,G.Ta=null,G.Ua=0,G.V=i(ye),G.Ba=0,G.V==null?(G.a=1,G=0):G=1):(ge.ic=0,G=Si(G,ge.c)),!G))break t;G=1;break e}ge.mc=null,G=0}else G=Ve>=ge.c*ge.i;ge=!G}if(ge)return null;M.ga.Lc!=1?M.Ga=0:oe=de-re}r(M.ga!=null),r(re+oe<=de);e:{if(G=(ye=M.ga).c,de=ye.l.o,ye.$a==0){if(We=M.rc,Ve=M.Vc,wt=M.Fa,we=M.P+1+re*G,Ee=M.mb,De=M.nb+re*G,r(we<=M.P+M.qc),ye.Z!=0)for(r(Gi[ye.Z]!=null),ge=0;ge<oe;++ge)Gi[ye.Z](We,Ve,wt,we,Ee,De,G),We=Ee,Ve=De,De+=G,we+=G;else for(ge=0;ge<oe;++ge)n(Ee,De,wt,we,G),We=Ee,Ve=De,De+=G,we+=G;M.rc=We,M.Vc=Ve}else{if(r(ye.mc!=null),G=re+oe,r((ge=ye.mc)!=null),r(G<=ge.i),ge.C>=G)G=1;else if(ye.ic||Ke(),ye.ic){ye=ge.V,We=ge.Ba,Ve=ge.c;var st=ge.i,je=(wt=1,we=ge.$/Ve,Ee=ge.$%Ve,De=ge.m,Xe=ge.s,ge.$),qe=Ve*st,Ue=Ve*G,ft=Xe.wc,vt=je<Ue?xt(Xe,Ee,we):null;r(je<=qe),r(G<=st),r(gt(Xe));t:for(;;){for(;!De.h&&je<Ue;){if(Ee&ft||(vt=xt(Xe,Ee,we)),r(vt!=null),ee(De),256>(st=ct(vt.G[0],vt.H[0],De)))ye[We+je]=st,++je,++Ee>=Ve&&(Ee=0,++we<=G&&!(we%16)&&br(ge,we));else{if(!(280>st)){wt=0;break t}st=Kt(st-256,De);var Vt,Bt=ct(vt.G[4],vt.H[4],De);if(ee(De),!(je>=(Bt=Yt(Ve,Bt=Kt(Bt,De)))&&qe-je>=st)){wt=0;break t}for(Vt=0;Vt<st;++Vt)ye[We+je+Vt]=ye[We+je+Vt-Bt];for(je+=st,Ee+=st;Ee>=Ve;)Ee-=Ve,++we<=G&&!(we%16)&&br(ge,we);je<Ue&&Ee&ft&&(vt=xt(Xe,Ee,we))}r(De.h==$(De))}br(ge,we>G?G:we);break t}!wt||De.h&&je<qe?(wt=0,ge.a=De.h?5:3):ge.$=je,G=wt}else G=hr(ge,ge.V,ge.Ba,ge.c,ge.i,G,fa);if(!G){oe=0;break e}}re+oe>=de&&(M.Cc=1),oe=1}if(!oe)return null;if(M.Cc&&((oe=M.ga)!=null&&(oe.mc=null),M.ga=null,0<M.Ga))return alert("todo:WebPDequantizeLevels"),null}return M.nb+re*ue}function X(M,G,re,oe,ue,de){for(;0<ue--;){var ge,ye=M,we=G+(re?1:0),Ee=M,De=G+(re?0:3);for(ge=0;ge<oe;++ge){var Xe=Ee[De+4*ge];Xe!=255&&(Xe*=32897,ye[we+4*ge+0]=ye[we+4*ge+0]*Xe>>23,ye[we+4*ge+1]=ye[we+4*ge+1]*Xe>>23,ye[we+4*ge+2]=ye[we+4*ge+2]*Xe>>23)}G+=de}}function fe(M,G,re,oe,ue){for(;0<oe--;){var de;for(de=0;de<re;++de){var ge=M[G+2*de+0],ye=15&(Ee=M[G+2*de+1]),we=4369*ye,Ee=(240&Ee|Ee>>4)*we>>16;M[G+2*de+0]=(240&ge|ge>>4)*we>>16&240|(15&ge|ge<<4)*we>>16>>4&15,M[G+2*de+1]=240&Ee|ye}G+=ue}}function Ce(M,G,re,oe,ue,de,ge,ye){var we,Ee,De=255;for(Ee=0;Ee<ue;++Ee){for(we=0;we<oe;++we){var Xe=M[G+we];de[ge+4*we]=Xe,De&=Xe}G+=re,ge+=ye}return De!=255}function Fe(M,G,re,oe,ue){var de;for(de=0;de<ue;++de)re[oe+de]=M[G+de]>>8}function Ke(){Ei=X,on=fe,Kr=Ce,qn=Fe}function ht(M,G,re){T[M]=function(oe,ue,de,ge,ye,we,Ee,De,Xe,We,Ve,wt,st,je,qe,Ue,ft){var vt,Vt=ft-1>>1,Bt=ye[we+0]|Ee[De+0]<<16,lr=Xe[We+0]|Ve[wt+0]<<16;r(oe!=null);var jt=3*Bt+lr+131074>>2;for(G(oe[ue+0],255&jt,jt>>16,st,je),de!=null&&(jt=3*lr+Bt+131074>>2,G(de[ge+0],255&jt,jt>>16,qe,Ue)),vt=1;vt<=Vt;++vt){var Br=ye[we+vt]|Ee[De+vt]<<16,Ur=Xe[We+vt]|Ve[wt+vt]<<16,Ir=Bt+Br+lr+Ur+524296,xr=Ir+2*(Br+lr)>>3;jt=xr+Bt>>1,Bt=(Ir=Ir+2*(Bt+Ur)>>3)+Br>>1,G(oe[ue+2*vt-1],255&jt,jt>>16,st,je+(2*vt-1)*re),G(oe[ue+2*vt-0],255&Bt,Bt>>16,st,je+(2*vt-0)*re),de!=null&&(jt=Ir+lr>>1,Bt=xr+Ur>>1,G(de[ge+2*vt-1],255&jt,jt>>16,qe,Ue+(2*vt-1)*re),G(de[ge+2*vt+0],255&Bt,Bt>>16,qe,Ue+(2*vt+0)*re)),Bt=Br,lr=Ur}1&ft||(jt=3*Bt+lr+131074>>2,G(oe[ue+ft-1],255&jt,jt>>16,st,je+(ft-1)*re),de!=null&&(jt=3*lr+Bt+131074>>2,G(de[ge+ft-1],255&jt,jt>>16,qe,Ue+(ft-1)*re)))}}function Et(){pa[xl]=Hf,pa[Fo]=Ns,pa[sf]=Gf,pa[El]=vu,pa[fu]=fi,pa[hn]=_i,pa[Gu]=Sc,pa[Pl]=Ns,pa[ks]=vu,pa[hu]=fi,pa[du]=_i}function Ut(M){return M&-16384?0>M?0:255:M>>ns}function sr(M,G){return Ut((19077*M>>8)+(26149*G>>8)-14234)}function wr(M,G,re){return Ut((19077*M>>8)-(6419*G>>8)-(13320*re>>8)+8708)}function mr(M,G){return Ut((19077*M>>8)+(33050*G>>8)-17685)}function Or(M,G,re,oe,ue){oe[ue+0]=sr(M,re),oe[ue+1]=wr(M,G,re),oe[ue+2]=mr(M,G)}function Nn(M,G,re,oe,ue){oe[ue+0]=mr(M,G),oe[ue+1]=wr(M,G,re),oe[ue+2]=sr(M,re)}function Pn(M,G,re,oe,ue){var de=wr(M,G,re);G=de<<3&224|mr(M,G)>>3,oe[ue+0]=248&sr(M,re)|de>>5,oe[ue+1]=G}function Bn(M,G,re,oe,ue){var de=240&mr(M,G)|15;oe[ue+0]=240&sr(M,re)|wr(M,G,re)>>4,oe[ue+1]=de}function ei(M,G,re,oe,ue){oe[ue+0]=255,Or(M,G,re,oe,ue+1)}function ui(M,G,re,oe,ue){Nn(M,G,re,oe,ue),oe[ue+3]=255}function Ua(M,G,re,oe,ue){Or(M,G,re,oe,ue),oe[ue+3]=255}function Ea(M,G){return 0>M?0:M>G?G:M}function Pa(M,G,re){T[M]=function(oe,ue,de,ge,ye,we,Ee,De,Xe){for(var We=De+(-2&Xe)*re;De!=We;)G(oe[ue+0],de[ge+0],ye[we+0],Ee,De),G(oe[ue+1],de[ge+0],ye[we+0],Ee,De+re),ue+=2,++ge,++we,De+=2*re;1&Xe&&G(oe[ue+0],de[ge+0],ye[we+0],Ee,De)}}function Zo(M,G,re){return re==0?M==0?G==0?6:5:G==0?4:0:re}function Qo(M,G,re,oe,ue){switch(M>>>30){case 3:ko(G,re,oe,ue,0);break;case 2:Dr(G,re,oe,ue);break;case 1:Kn(G,re,oe,ue)}}function Di(M,G){var re,oe,ue=G.M,de=G.Nb,ge=M.oc,ye=M.pc+40,we=M.oc,Ee=M.pc+584,De=M.oc,Xe=M.pc+600;for(re=0;16>re;++re)ge[ye+32*re-1]=129;for(re=0;8>re;++re)we[Ee+32*re-1]=129,De[Xe+32*re-1]=129;for(0<ue?ge[ye-1-32]=we[Ee-1-32]=De[Xe-1-32]=129:(a(ge,ye-32-1,127,21),a(we,Ee-32-1,127,9),a(De,Xe-32-1,127,9)),oe=0;oe<M.za;++oe){var We=G.ya[G.aa+oe];if(0<oe){for(re=-1;16>re;++re)n(ge,ye+32*re-4,ge,ye+32*re+12,4);for(re=-1;8>re;++re)n(we,Ee+32*re-4,we,Ee+32*re+4,4),n(De,Xe+32*re-4,De,Xe+32*re+4,4)}var Ve=M.Gd,wt=M.Hd+oe,st=We.ad,je=We.Hc;if(0<ue&&(n(ge,ye-32,Ve[wt].y,0,16),n(we,Ee-32,Ve[wt].f,0,8),n(De,Xe-32,Ve[wt].ea,0,8)),We.Za){var qe=ge,Ue=ye-32+16;for(0<ue&&(oe>=M.za-1?a(qe,Ue,Ve[wt].y[15],4):n(qe,Ue,Ve[wt+1].y,0,4)),re=0;4>re;re++)qe[Ue+128+re]=qe[Ue+256+re]=qe[Ue+384+re]=qe[Ue+0+re];for(re=0;16>re;++re,je<<=2)qe=ge,Ue=ye+Yu[re],Hi[We.Ob[re]](qe,Ue),Qo(je,st,16*+re,qe,Ue)}else if(qe=Zo(oe,ue,We.Ob[0]),Ui[qe](ge,ye),je!=0)for(re=0;16>re;++re,je<<=2)Qo(je,st,16*+re,ge,ye+Yu[re]);for(re=We.Gc,qe=Zo(oe,ue,We.Dd),na[qe](we,Ee),na[qe](De,Xe),je=st,qe=we,Ue=Ee,255&(We=re>>0)&&(170&We?Lo(je,256,qe,Ue):Mr(je,256,qe,Ue)),We=De,je=Xe,255&(re>>=8)&&(170&re?Lo(st,320,We,je):Mr(st,320,We,je)),ue<M.Ub-1&&(n(Ve[wt].y,0,ge,ye+480,16),n(Ve[wt].f,0,we,Ee+224,8),n(Ve[wt].ea,0,De,Xe+224,8)),re=8*de*M.B,Ve=M.sa,wt=M.ta+16*oe+16*de*M.R,st=M.qa,We=M.ra+8*oe+re,je=M.Ha,qe=M.Ia+8*oe+re,re=0;16>re;++re)n(Ve,wt+re*M.R,ge,ye+32*re,16);for(re=0;8>re;++re)n(st,We+re*M.B,we,Ee+32*re,8),n(je,qe+re*M.B,De,Xe+32*re,8)}}function Ha(M,G,re,oe,ue,de,ge,ye,we){var Ee=[0],De=[0],Xe=0,We=we!=null?we.kd:0,Ve=we??new mi;if(M==null||12>re)return 7;Ve.data=M,Ve.w=G,Ve.ha=re,G=[G],re=[re],Ve.gb=[Ve.gb];e:{var wt=G,st=re,je=Ve.gb;if(r(M!=null),r(st!=null),r(je!=null),je[0]=0,12<=st[0]&&!t(M,wt[0],"RIFF")){if(t(M,wt[0]+8,"WEBP")){je=3;break e}var qe=Le(M,wt[0]+4);if(12>qe||4294967286<qe){je=3;break e}if(We&&qe>st[0]-8){je=7;break e}je[0]=qe,wt[0]+=12,st[0]-=12}je=0}if(je!=0)return je;for(qe=0<Ve.gb[0],re=re[0];;){e:{var Ue=M;st=G,je=re;var ft=Ee,vt=De,Vt=wt=[0];if((jt=Xe=[Xe])[0]=0,8>je[0])je=7;else{if(!t(Ue,st[0],"VP8X")){if(Le(Ue,st[0]+4)!=10){je=3;break e}if(18>je[0]){je=7;break e}var Bt=Le(Ue,st[0]+8),lr=1+_e(Ue,st[0]+12);if(2147483648<=lr*(Ue=1+_e(Ue,st[0]+15))){je=3;break e}Vt!=null&&(Vt[0]=Bt),ft!=null&&(ft[0]=lr),vt!=null&&(vt[0]=Ue),st[0]+=18,je[0]-=18,jt[0]=1}je=0}}if(Xe=Xe[0],wt=wt[0],je!=0)return je;if(st=!!(2&wt),!qe&&Xe)return 3;if(de!=null&&(de[0]=!!(16&wt)),ge!=null&&(ge[0]=st),ye!=null&&(ye[0]=0),ge=Ee[0],wt=De[0],Xe&&st&&we==null){je=0;break}if(4>re){je=7;break}if(qe&&Xe||!qe&&!Xe&&!t(M,G[0],"ALPH")){re=[re],Ve.na=[Ve.na],Ve.P=[Ve.P],Ve.Sa=[Ve.Sa];e:{Bt=M,je=G,qe=re;var jt=Ve.gb;ft=Ve.na,vt=Ve.P,Vt=Ve.Sa,lr=22,r(Bt!=null),r(qe!=null),Ue=je[0];var Br=qe[0];for(r(ft!=null),r(Vt!=null),ft[0]=null,vt[0]=null,Vt[0]=0;;){if(je[0]=Ue,qe[0]=Br,8>Br){je=7;break e}var Ur=Le(Bt,Ue+4);if(4294967286<Ur){je=3;break e}var Ir=8+Ur+1&-2;if(lr+=Ir,0<jt&&lr>jt){je=3;break e}if(!t(Bt,Ue,"VP8 ")||!t(Bt,Ue,"VP8L")){je=0;break e}if(Br[0]<Ir){je=7;break e}t(Bt,Ue,"ALPH")||(ft[0]=Bt,vt[0]=Ue+8,Vt[0]=Ur),Ue+=Ir,Br-=Ir}}if(re=re[0],Ve.na=Ve.na[0],Ve.P=Ve.P[0],Ve.Sa=Ve.Sa[0],je!=0)break}re=[re],Ve.Ja=[Ve.Ja],Ve.xa=[Ve.xa];e:if(jt=M,je=G,qe=re,ft=Ve.gb[0],vt=Ve.Ja,Vt=Ve.xa,Bt=je[0],Ue=!t(jt,Bt,"VP8 "),lr=!t(jt,Bt,"VP8L"),r(jt!=null),r(qe!=null),r(vt!=null),r(Vt!=null),8>qe[0])je=7;else{if(Ue||lr){if(jt=Le(jt,Bt+4),12<=ft&&jt>ft-12){je=3;break e}if(We&&jt>qe[0]-8){je=7;break e}vt[0]=jt,je[0]+=8,qe[0]-=8,Vt[0]=lr}else Vt[0]=5<=qe[0]&&jt[Bt+0]==47&&!(jt[Bt+4]>>5),vt[0]=qe[0];je=0}if(re=re[0],Ve.Ja=Ve.Ja[0],Ve.xa=Ve.xa[0],G=G[0],je!=0)break;if(4294967286<Ve.Ja)return 3;if(ye==null||st||(ye[0]=Ve.xa?2:1),ge=[ge],wt=[wt],Ve.xa){if(5>re){je=7;break}ye=ge,We=wt,st=de,M==null||5>re?M=0:5<=re&&M[G+0]==47&&!(M[G+4]>>5)?(qe=[0],jt=[0],ft=[0],Y(vt=new U,M,G,re),bt(vt,qe,jt,ft)?(ye!=null&&(ye[0]=qe[0]),We!=null&&(We[0]=jt[0]),st!=null&&(st[0]=ft[0]),M=1):M=0):M=0}else{if(10>re){je=7;break}ye=wt,M==null||10>re||!vi(M,G+3,re-3)?M=0:(We=M[G+0]|M[G+1]<<8|M[G+2]<<16,st=16383&(M[G+7]<<8|M[G+6]),M=16383&(M[G+9]<<8|M[G+8]),1&We||3<(We>>1&7)||!(We>>4&1)||We>>5>=Ve.Ja||!st||!M?M=0:(ge&&(ge[0]=st),ye&&(ye[0]=M),M=1))}if(!M||(ge=ge[0],wt=wt[0],Xe&&(Ee[0]!=ge||De[0]!=wt)))return 3;we!=null&&(we[0]=Ve,we.offset=G-we.w,r(4294967286>G-we.w),r(we.offset==we.ha-re));break}return je==0||je==7&&Xe&&we==null?(de!=null&&(de[0]|=Ve.na!=null&&0<Ve.na.length),oe!=null&&(oe[0]=ge),ue!=null&&(ue[0]=wt),0):je}function Js(M,G,re){var oe=G.width,ue=G.height,de=0,ge=0,ye=oe,we=ue;if(G.Da=M!=null&&0<M.Da,G.Da&&(ye=M.cd,we=M.bd,de=M.v,ge=M.j,11>re||(de&=-2,ge&=-2),0>de||0>ge||0>=ye||0>=we||de+ye>oe||ge+we>ue))return 0;if(G.v=de,G.j=ge,G.va=de+ye,G.o=ge+we,G.U=ye,G.T=we,G.da=M!=null&&0<M.da,G.da){if(!it(ye,we,re=[M.ib],de=[M.hb]))return 0;G.ib=re[0],G.hb=de[0]}return G.ob=M!=null&&M.ob,G.Kb=M==null||!M.Sd,G.da&&(G.ob=G.ib<3*oe/4&&G.hb<3*ue/4,G.Kb=0),1}function bl(M){if(M==null)return 2;if(11>M.S){var G=M.f.RGBA;G.fb+=(M.height-1)*G.A,G.A=-G.A}else G=M.f.kb,M=M.height,G.O+=(M-1)*G.fa,G.fa=-G.fa,G.N+=(M-1>>1)*G.Ab,G.Ab=-G.Ab,G.W+=(M-1>>1)*G.Db,G.Db=-G.Db,G.F!=null&&(G.J+=(M-1)*G.lb,G.lb=-G.lb);return 0}function ra(M,G,re,oe){if(oe==null||0>=M||0>=G)return 2;if(re!=null){if(re.Da){var ue=re.cd,de=re.bd,ge=-2&re.v,ye=-2&re.j;if(0>ge||0>ye||0>=ue||0>=de||ge+ue>M||ye+de>G)return 2;M=ue,G=de}if(re.da){if(!it(M,G,ue=[re.ib],de=[re.hb]))return 2;M=ue[0],G=de[0]}}oe.width=M,oe.height=G;e:{var we=oe.width,Ee=oe.height;if(M=oe.S,0>=we||0>=Ee||!(M>=xl&&13>M))M=2;else{if(0>=oe.Rd&&oe.sd==null){ge=de=ue=G=0;var De=(ye=we*Cl[M])*Ee;if(11>M||(de=(Ee+1)/2*(G=(we+1)/2),M==12&&(ge=(ue=we)*Ee)),(Ee=i(De+2*de+ge))==null){M=1;break e}oe.sd=Ee,11>M?((we=oe.f.RGBA).eb=Ee,we.fb=0,we.A=ye,we.size=De):((we=oe.f.kb).y=Ee,we.O=0,we.fa=ye,we.Fd=De,we.f=Ee,we.N=0+De,we.Ab=G,we.Cd=de,we.ea=Ee,we.W=0+De+de,we.Db=G,we.Ed=de,M==12&&(we.F=Ee,we.J=0+De+2*de),we.Tc=ge,we.lb=ue)}if(G=1,ue=oe.S,de=oe.width,ge=oe.height,ue>=xl&&13>ue)if(11>ue)M=oe.f.RGBA,G&=(ye=Math.abs(M.A))*(ge-1)+de<=M.size,G&=ye>=de*Cl[ue],G&=M.eb!=null;else{M=oe.f.kb,ye=(de+1)/2,De=(ge+1)/2,we=Math.abs(M.fa),Ee=Math.abs(M.Ab);var Xe=Math.abs(M.Db),We=Math.abs(M.lb),Ve=We*(ge-1)+de;G&=we*(ge-1)+de<=M.Fd,G&=Ee*(De-1)+ye<=M.Cd,G=(G&=Xe*(De-1)+ye<=M.Ed)&we>=de&Ee>=ye&Xe>=ye,G&=M.y!=null,G&=M.f!=null,G&=M.ea!=null,ue==12&&(G&=We>=de,G&=Ve<=M.Tc,G&=M.F!=null)}else G=0;M=G?0:2}}return M!=0||re!=null&&re.fd&&(M=bl(oe)),M}var an=64,el=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],wl=24,Oa=32,Ga=8,xi=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];Ae("Predictor0","PredictorAdd0"),T.Predictor0=function(){return 4278190080},T.Predictor1=function(M){return M},T.Predictor2=function(M,G,re){return G[re+0]},T.Predictor3=function(M,G,re){return G[re+1]},T.Predictor4=function(M,G,re){return G[re-1]},T.Predictor5=function(M,G,re){return he(he(M,G[re+1]),G[re+0])},T.Predictor6=function(M,G,re){return he(M,G[re-1])},T.Predictor7=function(M,G,re){return he(M,G[re+0])},T.Predictor8=function(M,G,re){return he(G[re-1],G[re+0])},T.Predictor9=function(M,G,re){return he(G[re+0],G[re+1])},T.Predictor10=function(M,G,re){return he(he(M,G[re-1]),he(G[re+0],G[re+1]))},T.Predictor11=function(M,G,re){var oe=G[re+0];return 0>=ze(oe>>24&255,M>>24&255,(G=G[re-1])>>24&255)+ze(oe>>16&255,M>>16&255,G>>16&255)+ze(oe>>8&255,M>>8&255,G>>8&255)+ze(255&oe,255&M,255&G)?oe:M},T.Predictor12=function(M,G,re){var oe=G[re+0];return(Oe((M>>24&255)+(oe>>24&255)-((G=G[re-1])>>24&255))<<24|Oe((M>>16&255)+(oe>>16&255)-(G>>16&255))<<16|Oe((M>>8&255)+(oe>>8&255)-(G>>8&255))<<8|Oe((255&M)+(255&oe)-(255&G)))>>>0},T.Predictor13=function(M,G,re){var oe=G[re-1];return(Me((M=he(M,G[re+0]))>>24&255,oe>>24&255)<<24|Me(M>>16&255,oe>>16&255)<<16|Me(M>>8&255,oe>>8&255)<<8|Me(M>>0&255,oe>>0&255))>>>0};var tl=T.PredictorAdd0;T.PredictorAdd1=pt,Ae("Predictor2","PredictorAdd2"),Ae("Predictor3","PredictorAdd3"),Ae("Predictor4","PredictorAdd4"),Ae("Predictor5","PredictorAdd5"),Ae("Predictor6","PredictorAdd6"),Ae("Predictor7","PredictorAdd7"),Ae("Predictor8","PredictorAdd8"),Ae("Predictor9","PredictorAdd9"),Ae("Predictor10","PredictorAdd10"),Ae("Predictor11","PredictorAdd11"),Ae("Predictor12","PredictorAdd12"),Ae("Predictor13","PredictorAdd13");var co=T.PredictorAdd2;Ze("ColorIndexInverseTransform","MapARGB","32b",function(M){return M>>8&255},function(M){return M}),Ze("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(M){return M},function(M){return M>>8&255});var Hu,yi=T.ColorIndexInverseTransform,Bi=T.MapARGB,Cs=T.VP8LColorIndexInverseTransformAlpha,Co=T.MapAlpha,bi=T.VP8LPredictorsAdd=[];bi.length=16,(T.VP8LPredictors=[]).length=16,(T.VP8LPredictorsAdd_C=[]).length=16,(T.VP8LPredictors_C=[]).length=16;var Jo,ci,qi,es,Xr,fo,rl,ko,Dr,Lo,Kn,Mr,On,Zn,ts,No,To,Va,Tn,ho,Ro,Mo,zi,fn,Ei,on,Kr,qn,ti=i(511),Io=i(2041),_l=i(225),nl=i(767),cu=0,jo=Io,Sl=_l,wi=nl,Wa=ti,xl=0,Fo=1,sf=2,El=3,fu=4,hn=5,Gu=6,Pl=7,ks=8,hu=9,du=10,pu=[2,3,7],bc=[3,3,11],il=[280,256,256,256,40],Bf=[0,1,1,1,0],qh=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],qf=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],lf=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Vu=8,Ls=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],Wu=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],Ol=null,uf=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],$a=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],wc=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],$u=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],zf=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],Uf=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],_c=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Ui=[],Hi=[],na=[],po=1,gu=2,Gi=[],pa=[];ht("UpsampleRgbLinePair",Or,3),ht("UpsampleBgrLinePair",Nn,3),ht("UpsampleRgbaLinePair",Ua,4),ht("UpsampleBgraLinePair",ui,4),ht("UpsampleArgbLinePair",ei,4),ht("UpsampleRgba4444LinePair",Bn,2),ht("UpsampleRgb565LinePair",Pn,2);var Hf=T.UpsampleRgbLinePair,Gf=T.UpsampleBgrLinePair,Ns=T.UpsampleRgbaLinePair,vu=T.UpsampleBgraLinePair,fi=T.UpsampleArgbLinePair,_i=T.UpsampleRgba4444LinePair,Sc=T.UpsampleRgb565LinePair,rs=16,go=1<<rs-1,en=-227,sn=482,ns=6,Pi=0,ia=i(256),al=i(256),Al=i(256),aa=i(256),mu=i(sn-en),cf=i(sn-en);Pa("YuvToRgbRow",Or,3),Pa("YuvToBgrRow",Nn,3),Pa("YuvToRgbaRow",Ua,4),Pa("YuvToBgraRow",ui,4),Pa("YuvToArgbRow",ei,4),Pa("YuvToRgba4444Row",Bn,2),Pa("YuvToRgb565Row",Pn,2);var Yu=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],is=[0,2,8],Vf=[8,7,6,4,4,2,2,2,1,1,1,1],as=1;this.WebPDecodeRGBA=function(M,G,re,oe,ue){var de=Fo,ge=new Xn,ye=new St;ge.ba=ye,ye.S=de,ye.width=[ye.width],ye.height=[ye.height];var we=ye.width,Ee=ye.height,De=new Jt;if(De==null||M==null)var Xe=2;else r(De!=null),Xe=Ha(M,G,re,De.width,De.height,De.Pd,De.Qd,De.format,null);if(Xe!=0?we=0:(we!=null&&(we[0]=De.width[0]),Ee!=null&&(Ee[0]=De.height[0]),we=1),we){ye.width=ye.width[0],ye.height=ye.height[0],oe!=null&&(oe[0]=ye.width),ue!=null&&(ue[0]=ye.height);e:{if(oe=new Jr,(ue=new mi).data=M,ue.w=G,ue.ha=re,ue.kd=1,G=[0],r(ue!=null),((M=Ha(ue.data,ue.w,ue.ha,null,null,null,G,null,ue))==0||M==7)&&G[0]&&(M=4),(G=M)==0){if(r(ge!=null),oe.data=ue.data,oe.w=ue.w+ue.offset,oe.ha=ue.ha-ue.offset,oe.put=mt,oe.ac=Je,oe.bc=Gt,oe.ma=ge,ue.xa){if((M=Sn())==null){ge=1;break e}if(function(We,Ve){var wt=[0],st=[0],je=[0];t:for(;;){if(We==null)return 0;if(Ve==null)return We.a=2,0;if(We.l=Ve,We.a=0,Y(We.m,Ve.data,Ve.w,Ve.ha),!bt(We.m,wt,st,je)){We.a=3;break t}if(We.xb=gu,Ve.width=wt[0],Ve.height=st[0],!Ni(wt[0],st[0],1,We,null))break t;return 1}return r(We.a!=0),0}(M,oe)){if(oe=(G=ra(oe.width,oe.height,ge.Oa,ge.ba))==0){t:{oe=M;r:for(;;){if(oe==null){oe=0;break t}if(r(oe.s.yc!=null),r(oe.s.Ya!=null),r(0<oe.s.Wb),r((re=oe.l)!=null),r((ue=re.ma)!=null),oe.xb!=0){if(oe.ca=ue.ba,oe.tb=ue.tb,r(oe.ca!=null),!Js(ue.Oa,re,El)){oe.a=2;break r}if(!Si(oe,re.width)||re.da)break r;if((re.da||ut(oe.ca.S))&&Ke(),11>oe.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),oe.ca.f.kb.F!=null&&Ke()),oe.Pb&&0<oe.s.ua&&oe.s.vb.X==null&&!Re(oe.s.vb,oe.s.Wa.Xa)){oe.a=1;break r}oe.xb=0}if(!hr(oe,oe.V,oe.Ba,oe.c,oe.i,re.o,zt))break r;ue.Dc=oe.Ma,oe=1;break t}r(oe.a!=0),oe=0}oe=!oe}oe&&(G=M.a)}else G=M.a}else{if((M=new Nr)==null){ge=1;break e}if(M.Fa=ue.na,M.P=ue.P,M.qc=ue.Sa,Ti(M,oe)){if((G=ra(oe.width,oe.height,ge.Oa,ge.ba))==0){if(M.Aa=0,re=ge.Oa,r((ue=M)!=null),re!=null){if(0<(we=0>(we=re.Md)?0:100<we?255:255*we/100)){for(Ee=De=0;4>Ee;++Ee)12>(Xe=ue.pb[Ee]).lc&&(Xe.ia=we*Vf[0>Xe.lc?0:Xe.lc]>>3),De|=Xe.ia;De&&(alert("todo:VP8InitRandom"),ue.ia=1)}ue.Ga=re.Id,100<ue.Ga?ue.Ga=100:0>ue.Ga&&(ue.Ga=0)}oi(M,oe)||(G=M.a)}}else G=M.a}G==0&&ge.Oa!=null&&ge.Oa.fd&&(G=bl(ge.ba))}ge=G}de=ge!=0?null:11>de?ye.f.RGBA.eb:ye.f.kb.y}else de=null;return de};var Cl=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function c(T,F){for(var I="",O=0;O<4;O++)I+=String.fromCharCode(T[F++]);return I}function h(T,F){return(T[F+0]<<0|T[F+1]<<8|T[F+2]<<16)>>>0}function p(T,F){return(T[F+0]<<0|T[F+1]<<8|T[F+2]<<16|T[F+3]<<24)>>>0}new u;var v=[0],f=[0],_=[],E=new u,w=e,x=function(T,F){var I={},O=0,C=!1,A=0,j=0;if(I.frames=[],!function(D,$,Q,ee){for(var te=0;te<ee;te++)if(D[$+te]!=Q.charCodeAt(te))return!0;return!1}(T,F,"RIFF",4)){for(p(T,F+=4),F+=8;F<T.length;){var N=c(T,F),B=p(T,F+=4);F+=4;var W=B+(1&B);switch(N){case"VP8 ":case"VP8L":I.frames[O]===void 0&&(I.frames[O]={}),(V=I.frames[O]).src_off=C?j:F-8,V.src_size=A+B+8,O++,C&&(C=!1,A=0,j=0);break;case"VP8X":(V=I.header={}).feature_flags=T[F];var Y=F+4;V.canvas_width=1+h(T,Y),Y+=3,V.canvas_height=1+h(T,Y),Y+=3;break;case"ALPH":C=!0,A=W+8,j=F-8;break;case"ANIM":(V=I.header).bgcolor=p(T,F),Y=F+4,V.loop_count=(H=T)[(U=Y)+0]<<0|H[U+1]<<8,Y+=2;break;case"ANMF":var Z,V;(V=I.frames[O]={}).offset_x=2*h(T,F),F+=3,V.offset_y=2*h(T,F),F+=3,V.width=1+h(T,F),F+=3,V.height=1+h(T,F),F+=3,V.duration=h(T,F),F+=3,Z=T[F++],V.dispose=1&Z,V.blend=Z>>1&1}N!="ANMF"&&(F+=W)}var H,U;return I}}(w,0);x.response=w,x.rgbaoutput=!0,x.dataurl=!1;var y=x.header?x.header:null,g=x.frames?x.frames:null;if(y){y.loop_counter=y.loop_count,v=[y.canvas_height],f=[y.canvas_width];for(var S=0;S<g.length&&g[S].blend!=0;S++);}var b=g[0],R=E.WebPDecodeRGBA(w,b.src_off,b.src_size,f,v);b.rgba=R,b.imgwidth=f[0],b.imgheight=v[0];for(var L=0;L<f[0]*v[0]*4;L++)_[L]=R[L];return this.width=f,this.height=v,this.data=_,this}(function(e){var r=function(){return typeof T2=="function"},t=function(v,f,_,E){var w=4,x=o;switch(E){case e.image_compression.FAST:w=1,x=i;break;case e.image_compression.MEDIUM:w=6,x=s;break;case e.image_compression.SLOW:w=9,x=u}v=n(v,f,_,x);var y=T2(v,{level:w});return e.__addimage__.arrayBufferToBinaryString(y)},n=function(v,f,_,E){for(var w,x,y,g=v.length/f,S=new Uint8Array(v.length+g),b=h(),R=0;R<g;R+=1){if(y=R*f,w=v.subarray(y,y+f),E)S.set(E(w,_,x),y+R);else{for(var L,T=b.length,F=[];L<T;L+=1)F[L]=b[L](w,_,x);var I=p(F.concat());S.set(F[I],y+R)}x=w}return S},a=function(v){var f=Array.apply([],v);return f.unshift(0),f},i=function(v,f){var _,E=[],w=v.length;E[0]=1;for(var x=0;x<w;x+=1)_=v[x-f]||0,E[x+1]=v[x]-_+256&255;return E},o=function(v,f,_){var E,w=[],x=v.length;w[0]=2;for(var y=0;y<x;y+=1)E=_&&_[y]||0,w[y+1]=v[y]-E+256&255;return w},s=function(v,f,_){var E,w,x=[],y=v.length;x[0]=3;for(var g=0;g<y;g+=1)E=v[g-f]||0,w=_&&_[g]||0,x[g+1]=v[g]+256-(E+w>>>1)&255;return x},u=function(v,f,_){var E,w,x,y,g=[],S=v.length;g[0]=4;for(var b=0;b<S;b+=1)E=v[b-f]||0,w=_&&_[b]||0,x=_&&_[b-f]||0,y=c(E,w,x),g[b+1]=v[b]-y+256&255;return g},c=function(v,f,_){if(v===f&&f===_)return v;var E=Math.abs(f-_),w=Math.abs(v-_),x=Math.abs(v+f-_-_);return E<=w&&E<=x?v:w<=x?f:_},h=function(){return[a,i,o,s,u]},p=function(v){var f=v.map(function(_){return _.reduce(function(E,w){return E+Math.abs(w)},0)});return f.indexOf(Math.min.apply(null,f))};e.processPNG=function(v,f,_,E){var w,x,y,g,S,b,R,L,T,F,I,O,C,A,j,N=this.decode.FLATE_DECODE,B="";if(this.__addimage__.isArrayBuffer(v)&&(v=new Uint8Array(v)),this.__addimage__.isArrayBufferView(v)){if(v=(y=new nL(v)).imgData,x=y.bits,w=y.colorSpace,S=y.colors,[4,6].indexOf(y.colorType)!==-1){if(y.bits===8){T=(L=y.pixelBitlength==32?new Uint32Array(y.decodePixels().buffer):y.pixelBitlength==16?new Uint16Array(y.decodePixels().buffer):new Uint8Array(y.decodePixels().buffer)).length,I=new Uint8Array(T*y.colors),F=new Uint8Array(T);var W,Y=y.pixelBitlength-y.bits;for(A=0,j=0;A<T;A++){for(C=L[A],W=0;W<Y;)I[j++]=C>>>W&255,W+=y.bits;F[A]=C>>>W&255}}if(y.bits===16){T=(L=new Uint32Array(y.decodePixels().buffer)).length,I=new Uint8Array(T*(32/y.pixelBitlength)*y.colors),F=new Uint8Array(T*(32/y.pixelBitlength)),O=y.colors>1,A=0,j=0;for(var Z=0;A<T;)C=L[A++],I[j++]=C>>>0&255,O&&(I[j++]=C>>>16&255,C=L[A++],I[j++]=C>>>0&255),F[Z++]=C>>>16&255;x=8}E!==e.image_compression.NONE&&r()?(v=t(I,y.width*y.colors,y.colors,E),R=t(F,y.width,1,E)):(v=I,R=F,N=void 0)}if(y.colorType===3&&(w=this.color_spaces.INDEXED,b=y.palette,y.transparency.indexed)){var V=y.transparency.indexed,H=0;for(A=0,T=V.length;A<T;++A)H+=V[A];if((H/=255)===T-1&&V.indexOf(0)!==-1)g=[V.indexOf(0)];else if(H!==T){for(L=y.decodePixels(),F=new Uint8Array(L.length),A=0,T=L.length;A<T;A++)F[A]=V[L[A]];R=t(F,y.width,1)}}var U=function(D){var $;switch(D){case e.image_compression.FAST:$=11;break;case e.image_compression.MEDIUM:$=13;break;case e.image_compression.SLOW:$=14;break;default:$=12}return $}(E);return N===this.decode.FLATE_DECODE&&(B="/Predictor "+U+" "),B+="/Colors "+S+" /BitsPerComponent "+x+" /Columns "+y.width,(this.__addimage__.isArrayBuffer(v)||this.__addimage__.isArrayBufferView(v))&&(v=this.__addimage__.arrayBufferToBinaryString(v)),(R&&this.__addimage__.isArrayBuffer(R)||this.__addimage__.isArrayBufferView(R))&&(R=this.__addimage__.arrayBufferToBinaryString(R)),{alias:_,data:v,index:f,filter:N,decodeParameters:B,transparency:g,palette:b,sMask:R,predictor:U,width:y.width,height:y.height,bitsPerComponent:x,colorSpace:w}}}})(vr.API),function(e){e.processGIF89A=function(r,t,n,a){var i=new iL(r),o=i.width,s=i.height,u=[];i.decodeAndBlitFrameRGBA(0,u);var c={data:u,width:o,height:s},h=new f2(100).encode(c,100);return e.processJPEG.call(this,h,t,n,a)},e.processGIF87A=e.processGIF89A}(vr.API),Hl.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var e=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(e);for(var r=0;r<e;r++){var t=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0);this.palette[r]={red:a,green:n,blue:t,quad:i}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Hl.prototype.parseBGR=function(){this.pos=this.offset;try{var e="bit"+this.bitPP,r=this.width*this.height*4;this.data=new Uint8Array(r),this[e]()}catch(t){Yn.log("bit decode error:"+t)}},Hl.prototype.bit1=function(){var e,r=Math.ceil(this.width/8),t=r%4;for(e=this.height-1;e>=0;e--){for(var n=this.bottom_up?e:this.height-1-e,a=0;a<r;a++)for(var i=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+8*a*4,s=0;s<8&&8*a+s<this.width;s++){var u=this.palette[i>>7-s&1];this.data[o+4*s]=u.blue,this.data[o+4*s+1]=u.green,this.data[o+4*s+2]=u.red,this.data[o+4*s+3]=255}t!==0&&(this.pos+=4-t)}},Hl.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),r=e%4,t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,a=0;a<e;a++){var i=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+2*a*4,s=i>>4,u=15&i,c=this.palette[s];if(this.data[o]=c.blue,this.data[o+1]=c.green,this.data[o+2]=c.red,this.data[o+3]=255,2*a+1>=this.width)break;c=this.palette[u],this.data[o+4]=c.blue,this.data[o+4+1]=c.green,this.data[o+4+2]=c.red,this.data[o+4+3]=255}r!==0&&(this.pos+=4-r)}},Hl.prototype.bit8=function(){for(var e=this.width%4,r=this.height-1;r>=0;r--){for(var t=this.bottom_up?r:this.height-1-r,n=0;n<this.width;n++){var a=this.datav.getUint8(this.pos++,!0),i=t*this.width*4+4*n;if(a<this.palette.length){var o=this.palette[a];this.data[i]=o.red,this.data[i+1]=o.green,this.data[i+2]=o.blue,this.data[i+3]=255}else this.data[i]=255,this.data[i+1]=255,this.data[i+2]=255,this.data[i+3]=255}e!==0&&(this.pos+=4-e)}},Hl.prototype.bit15=function(){for(var e=this.width%3,r=parseInt("11111",2),t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,a=0;a<this.width;a++){var i=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(i&r)/r*255|0,s=(i>>5&r)/r*255|0,u=(i>>10&r)/r*255|0,c=i>>15?255:0,h=n*this.width*4+4*a;this.data[h]=u,this.data[h+1]=s,this.data[h+2]=o,this.data[h+3]=c}this.pos+=e}},Hl.prototype.bit16=function(){for(var e=this.width%3,r=parseInt("11111",2),t=parseInt("111111",2),n=this.height-1;n>=0;n--){for(var a=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(o&r)/r*255|0,u=(o>>5&t)/t*255|0,c=(o>>11)/r*255|0,h=a*this.width*4+4*i;this.data[h]=c,this.data[h+1]=u,this.data[h+2]=s,this.data[h+3]=255}this.pos+=e}},Hl.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var r=this.bottom_up?e:this.height-1-e,t=0;t<this.width;t++){var n=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+4*t;this.data[o]=i,this.data[o+1]=a,this.data[o+2]=n,this.data[o+3]=255}this.pos+=this.width%4}},Hl.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var r=this.bottom_up?e:this.height-1-e,t=0;t<this.width;t++){var n=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),s=r*this.width*4+4*t;this.data[s]=i,this.data[s+1]=a,this.data[s+2]=n,this.data[s+3]=o}},Hl.prototype.getData=function(){return this.data},function(e){e.processBMP=function(r,t,n,a){var i=new Hl(r,!1),o=i.width,s=i.height,u={data:i.getData(),width:o,height:s},c=new f2(100).encode(u,100);return e.processJPEG.call(this,c,t,n,a)}}(vr.API),hw.prototype.getData=function(){return this.data},function(e){e.processWEBP=function(r,t,n,a){var i=new hw(r),o=i.width,s=i.height,u={data:i.getData(),width:o,height:s},c=new f2(100).encode(u,100);return e.processJPEG.call(this,c,t,n,a)}}(vr.API),vr.API.processRGBA=function(e,r,t){for(var n=e.data,a=n.length,i=new Uint8Array(a/4*3),o=new Uint8Array(a/4),s=0,u=0,c=0;c<a;c+=4){var h=n[c],p=n[c+1],v=n[c+2],f=n[c+3];i[s++]=h,i[s++]=p,i[s++]=v,o[u++]=f}var _=this.__addimage__.arrayBufferToBinaryString(i);return{alpha:this.__addimage__.arrayBufferToBinaryString(o),data:_,index:r,alias:t,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},vr.API.setLanguage=function(e){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[e]!==void 0&&(this.internal.languageSettings.languageCode=e,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},ah=vr.API,p1=ah.getCharWidthsArray=function(e,r){var t,n,a=(r=r||{}).font||this.internal.getFont(),i=r.fontSize||this.internal.getFontSize(),o=r.charSpace||this.internal.getCharSpace(),s=r.widths?r.widths:a.metadata.Unicode.widths,u=s.fof?s.fof:1,c=r.kerning?r.kerning:a.metadata.Unicode.kerning,h=c.fof?c.fof:1,p=r.doKerning!==!1,v=0,f=e.length,_=0,E=s[0]||u,w=[];for(t=0;t<f;t++)n=e.charCodeAt(t),typeof a.metadata.widthOfString=="function"?w.push((a.metadata.widthOfGlyph(a.metadata.characterToGlyph(n))+o*(1e3/i)||0)/1e3):(v=p&&kn(c[n])==="object"&&!isNaN(parseInt(c[n][_],10))?c[n][_]/h:0,w.push((s[n]||E)/u+v)),_=n;return w},lw=ah.getStringUnitWidth=function(e,r){var t=(r=r||{}).fontSize||this.internal.getFontSize(),n=r.font||this.internal.getFont(),a=r.charSpace||this.internal.getCharSpace();return ah.processArabic&&(e=ah.processArabic(e)),typeof n.metadata.widthOfString=="function"?n.metadata.widthOfString(e,t,a)/t:p1.apply(this,arguments).reduce(function(i,o){return i+o},0)},uw=function(e,r,t,n){for(var a=[],i=0,o=e.length,s=0;i!==o&&s+r[i]<t;)s+=r[i],i++;a.push(e.slice(0,i));var u=i;for(s=0;i!==o;)s+r[i]>n&&(a.push(e.slice(u,i)),s=0,u=i),s+=r[i],i++;return u!==i&&a.push(e.slice(u,i)),a},cw=function(e,r,t){t||(t={});var n,a,i,o,s,u,c,h=[],p=[h],v=t.textIndent||0,f=0,_=0,E=e.split(" "),w=p1.apply(this,[" ",t])[0];if(u=t.lineIndent===-1?E[0].length+2:t.lineIndent||0){var x=Array(u).join(" "),y=[];E.map(function(S){(S=S.split(/\s*\n/)).length>1?y=y.concat(S.map(function(b,R){return(R&&b.length?`
|
|
590
|
-
`:"")+b})):y.push(S[0])}),E=y,u=lw.apply(this,[x,t])}for(i=0,o=E.length;i<o;i++){var g=0;if(n=E[i],u&&n[0]==`
|
|
591
|
-
`&&(n=n.substr(1),g=1),v+f+(_=(a=p1.apply(this,[n,t])).reduce(function(S,b){return S+b},0))>r||g){if(_>r){for(s=uw.apply(this,[n,a,r-(v+f),r]),h.push(s.shift()),h=[s.pop()];s.length;)p.push([s.shift()]);_=a.slice(n.length-(h[0]?h[0].length:0)).reduce(function(S,b){return S+b},0)}else h=[n];p.push(h),v=_+u,f=w}else h.push(n),v+=f+_,f=w}return c=u?function(S,b){return(b?x:"")+S.join(" ")}:function(S){return S.join(" ")},p.map(c)},ah.splitTextToSize=function(e,r,t){var n,a=(t=t||{}).fontSize||this.internal.getFontSize(),i=(function(h){if(h.widths&&h.kerning)return{widths:h.widths,kerning:h.kerning};var p=this.internal.getFont(h.fontName,h.fontStyle);return p.metadata.Unicode?{widths:p.metadata.Unicode.widths||{0:1},kerning:p.metadata.Unicode.kerning||{}}:{font:p.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,t);n=Array.isArray(e)?e:String(e).split(/\r?\n/);var o=1*this.internal.scaleFactor*r/a;i.textIndent=t.textIndent?1*t.textIndent*this.internal.scaleFactor/a:0,i.lineIndent=t.lineIndent;var s,u,c=[];for(s=0,u=n.length;s<u;s++)c=c.concat(cw.apply(this,[n[s],o,i]));return c},function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var r="klmnopqrstuvwxyz",t={},n={},a=0;a<r.length;a++)t[r[a]]="0123456789abcdef"[a],n["0123456789abcdef"[a]]=r[a];var i=function(p){return"0x"+parseInt(p,10).toString(16)},o=e.__fontmetrics__.compress=function(p){var v,f,_,E,w=["{"];for(var x in p){if(v=p[x],isNaN(parseInt(x,10))?f="'"+x+"'":(x=parseInt(x,10),f=(f=i(x).slice(2)).slice(0,-1)+n[f.slice(-1)]),typeof v=="number")v<0?(_=i(v).slice(3),E="-"):(_=i(v).slice(2),E=""),_=E+_.slice(0,-1)+n[_.slice(-1)];else{if(kn(v)!=="object")throw new Error("Don't know what to do with value type "+kn(v)+".");_=o(v)}w.push(f+_)}return w.push("}"),w.join("")},s=e.__fontmetrics__.uncompress=function(p){if(typeof p!="string")throw new Error("Invalid argument passed to uncompress.");for(var v,f,_,E,w={},x=1,y=w,g=[],S="",b="",R=p.length-1,L=1;L<R;L+=1)(E=p[L])=="'"?v?(_=v.join(""),v=void 0):v=[]:v?v.push(E):E=="{"?(g.push([y,_]),y={},_=void 0):E=="}"?((f=g.pop())[0][f[1]]=y,_=void 0,y=f[0]):E=="-"?x=-1:_===void 0?t.hasOwnProperty(E)?(S+=t[E],_=parseInt(S,16)*x,x=1,S=""):S+=E:t.hasOwnProperty(E)?(b+=t[E],y[_]=parseInt(b,16)*x,x=1,_=void 0,b=""):b+=E;return w},u={codePages:["WinAnsiEncoding"],WinAnsiEncoding:s("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},c={Unicode:{Courier:u,"Courier-Bold":u,"Courier-BoldOblique":u,"Courier-Oblique":u,Helvetica:u,"Helvetica-Bold":u,"Helvetica-BoldOblique":u,"Helvetica-Oblique":u,"Times-Roman":u,"Times-Bold":u,"Times-BoldItalic":u,"Times-Italic":u}},h={Unicode:{"Courier-Oblique":s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":s("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":s("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":s("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:s("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:s("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":s("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:s("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":s("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":s("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":s("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":s("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};e.events.push(["addFont",function(p){var v=p.font,f=h.Unicode[v.postScriptName];f&&(v.metadata.Unicode={},v.metadata.Unicode.widths=f.widths,v.metadata.Unicode.kerning=f.kerning);var _=c.Unicode[v.postScriptName];_&&(v.metadata.Unicode.encoding=_,v.encoding=_.codePages[0])}])}(vr.API),function(e){var r=function(t){for(var n=t.length,a=new Uint8Array(n),i=0;i<n;i++)a[i]=t.charCodeAt(i);return a};e.API.events.push(["addFont",function(t){var n=void 0,a=t.font,i=t.instance;if(!a.isStandardFont){if(i===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");if(typeof(n=i.existsFileInVFS(a.postScriptName)===!1?i.loadFile(a.postScriptName):i.getFileFromVFS(a.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");(function(o,s){s=/^\x00\x01\x00\x00/.test(s)?r(s):r(cp(s)),o.metadata=e.API.TTFFont.open(s),o.metadata.Unicode=o.metadata.Unicode||{encoding:{},kerning:{},widths:[]},o.metadata.glyIdsUsed=[0]})(a,n)}}])}(vr),function(e){function r(){return(yr.canvg?Promise.resolve(yr.canvg):A2(()=>import("./index.es-Uuln-F6j.js"),[],import.meta.url)).catch(function(t){return Promise.reject(new Error("Could not load canvg: "+t))}).then(function(t){return t.default?t.default:t})}vr.API.addSvgAsImage=function(t,n,a,i,o,s,u,c){if(isNaN(n)||isNaN(a))throw Yn.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(o))throw Yn.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var h=document.createElement("canvas");h.width=i,h.height=o;var p=h.getContext("2d");p.fillStyle="#fff",p.fillRect(0,0,h.width,h.height);var v={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},f=this;return r().then(function(_){return _.fromString(p,t,v)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(_){return _.render(v)}).then(function(){f.addImage(h.toDataURL("image/jpeg",1),n,a,i,o,u,c)})}}(),vr.API.putTotalPages=function(e){var r,t=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(r=new RegExp(e,"g"),t=this.internal.getNumberOfPages()):(r=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),t=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var a=0;a<this.internal.pages[n].length;a++)this.internal.pages[n][a]=this.internal.pages[n][a].replace(r,t);return this},vr.API.viewerPreferences=function(e,r){var t;e=e||{},r=r||!1;var n,a,i,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},s=Object.keys(o),u=[],c=0,h=0,p=0;function v(_,E){var w,x=!1;for(w=0;w<_.length;w+=1)_[w]===E&&(x=!0);return x}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),t=this.internal.viewerpreferences.configuration,e==="reset"||r===!0){var f=s.length;for(p=0;p<f;p+=1)t[s[p]].value=t[s[p]].defaultValue,t[s[p]].explicitSet=!1}if(kn(e)==="object"){for(a in e)if(i=e[a],v(s,a)&&i!==void 0){if(t[a].type==="boolean"&&typeof i=="boolean")t[a].value=i;else if(t[a].type==="name"&&v(t[a].valueSet,i))t[a].value=i;else if(t[a].type==="integer"&&Number.isInteger(i))t[a].value=i;else if(t[a].type==="array"){for(c=0;c<i.length;c+=1)if(n=!0,i[c].length===1&&typeof i[c][0]=="number")u.push(String(i[c]-1));else if(i[c].length>1){for(h=0;h<i[c].length;h+=1)typeof i[c][h]!="number"&&(n=!1);n===!0&&u.push([i[c][0]-1,i[c][1]-1].join(" "))}t[a].value="["+u.join(" ")+"]"}else t[a].value=t[a].defaultValue;t[a].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var _,E=[];for(_ in t)t[_].explicitSet===!0&&(t[_].type==="name"?E.push("/"+_+" /"+t[_].value):E.push("/"+_+" "+t[_].value));E.length!==0&&this.internal.write(`/ViewerPreferences
|
|
592
|
-
<<
|
|
593
|
-
`+E.join(`
|
|
594
|
-
`)+`
|
|
595
|
-
>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=t,this},function(e){var r=function(){var n='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceuri+'"><jspdf:metadata>',a=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),i=unescape(encodeURIComponent(n)),o=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),s=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),u=unescape(encodeURIComponent("</x:xmpmeta>")),c=i.length+o.length+s.length+a.length+u.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+c+" >>"),this.internal.write("stream"),this.internal.write(a+i+o+s+u),this.internal.write("endstream"),this.internal.write("endobj")},t=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")};e.addMetadata=function(n,a){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:n,namespaceuri:a||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",t),this.internal.events.subscribe("postPutResources",r)),this}}(vr.API),function(e){var r=e.API,t=r.pdfEscape16=function(i,o){for(var s,u=o.metadata.Unicode.widths,c=["","0","00","000","0000"],h=[""],p=0,v=i.length;p<v;++p){if(s=o.metadata.characterToGlyph(i.charCodeAt(p)),o.metadata.glyIdsUsed.push(s),o.metadata.toUnicode[s]=i.charCodeAt(p),u.indexOf(s)==-1&&(u.push(s),u.push([parseInt(o.metadata.widthOfGlyph(s),10)])),s=="0")return h.join("");s=s.toString(16),h.push(c[4-s.length],s)}return h.join("")},n=function(i){var o,s,u,c,h,p,v;for(h=`/CIDInit /ProcSet findresource begin
|
|
596
|
-
12 dict begin
|
|
597
|
-
begincmap
|
|
598
|
-
/CIDSystemInfo <<
|
|
599
|
-
/Registry (Adobe)
|
|
600
|
-
/Ordering (UCS)
|
|
601
|
-
/Supplement 0
|
|
602
|
-
>> def
|
|
603
|
-
/CMapName /Adobe-Identity-UCS def
|
|
604
|
-
/CMapType 2 def
|
|
605
|
-
1 begincodespacerange
|
|
606
|
-
<0000><ffff>
|
|
607
|
-
endcodespacerange`,u=[],p=0,v=(s=Object.keys(i).sort(function(f,_){return f-_})).length;p<v;p++)o=s[p],u.length>=100&&(h+=`
|
|
608
|
-
`+u.length+` beginbfchar
|
|
609
|
-
`+u.join(`
|
|
610
|
-
`)+`
|
|
611
|
-
endbfchar`,u=[]),i[o]!==void 0&&i[o]!==null&&typeof i[o].toString=="function"&&(c=("0000"+i[o].toString(16)).slice(-4),o=("0000"+(+o).toString(16)).slice(-4),u.push("<"+o+"><"+c+">"));return u.length&&(h+=`
|
|
612
|
-
`+u.length+` beginbfchar
|
|
613
|
-
`+u.join(`
|
|
614
|
-
`)+`
|
|
615
|
-
endbfchar
|
|
616
|
-
`),h+=`endcmap
|
|
617
|
-
CMapName currentdict /CMap defineresource pop
|
|
618
|
-
end
|
|
619
|
-
end`};r.events.push(["putFont",function(i){(function(o){var s=o.font,u=o.out,c=o.newObject,h=o.putStream;if(s.metadata instanceof e.API.TTFFont&&s.encoding==="Identity-H"){for(var p=s.metadata.Unicode.widths,v=s.metadata.subset.encode(s.metadata.glyIdsUsed,1),f="",_=0;_<v.length;_++)f+=String.fromCharCode(v[_]);var E=c();h({data:f,addLength1:!0,objectId:E}),u("endobj");var w=c();h({data:n(s.metadata.toUnicode),addLength1:!0,objectId:w}),u("endobj");var x=c();u("<<"),u("/Type /FontDescriptor"),u("/FontName /"+uh(s.fontName)),u("/FontFile2 "+E+" 0 R"),u("/FontBBox "+e.API.PDFObject.convert(s.metadata.bbox)),u("/Flags "+s.metadata.flags),u("/StemV "+s.metadata.stemV),u("/ItalicAngle "+s.metadata.italicAngle),u("/Ascent "+s.metadata.ascender),u("/Descent "+s.metadata.decender),u("/CapHeight "+s.metadata.capHeight),u(">>"),u("endobj");var y=c();u("<<"),u("/Type /Font"),u("/BaseFont /"+uh(s.fontName)),u("/FontDescriptor "+x+" 0 R"),u("/W "+e.API.PDFObject.convert(p)),u("/CIDToGIDMap /Identity"),u("/DW 1000"),u("/Subtype /CIDFontType2"),u("/CIDSystemInfo"),u("<<"),u("/Supplement 0"),u("/Registry (Adobe)"),u("/Ordering ("+s.encoding+")"),u(">>"),u(">>"),u("endobj"),s.objectNumber=c(),u("<<"),u("/Type /Font"),u("/Subtype /Type0"),u("/ToUnicode "+w+" 0 R"),u("/BaseFont /"+uh(s.fontName)),u("/Encoding /"+s.encoding),u("/DescendantFonts ["+y+" 0 R]"),u(">>"),u("endobj"),s.isAlreadyPutted=!0}})(i)}]),r.events.push(["putFont",function(i){(function(o){var s=o.font,u=o.out,c=o.newObject,h=o.putStream;if(s.metadata instanceof e.API.TTFFont&&s.encoding==="WinAnsiEncoding"){for(var p=s.metadata.rawData,v="",f=0;f<p.length;f++)v+=String.fromCharCode(p[f]);var _=c();h({data:v,addLength1:!0,objectId:_}),u("endobj");var E=c();h({data:n(s.metadata.toUnicode),addLength1:!0,objectId:E}),u("endobj");var w=c();u("<<"),u("/Descent "+s.metadata.decender),u("/CapHeight "+s.metadata.capHeight),u("/StemV "+s.metadata.stemV),u("/Type /FontDescriptor"),u("/FontFile2 "+_+" 0 R"),u("/Flags 96"),u("/FontBBox "+e.API.PDFObject.convert(s.metadata.bbox)),u("/FontName /"+uh(s.fontName)),u("/ItalicAngle "+s.metadata.italicAngle),u("/Ascent "+s.metadata.ascender),u(">>"),u("endobj"),s.objectNumber=c();for(var x=0;x<s.metadata.hmtx.widths.length;x++)s.metadata.hmtx.widths[x]=parseInt(s.metadata.hmtx.widths[x]*(1e3/s.metadata.head.unitsPerEm));u("<</Subtype/TrueType/Type/Font/ToUnicode "+E+" 0 R/BaseFont/"+uh(s.fontName)+"/FontDescriptor "+w+" 0 R/Encoding/"+s.encoding+" /FirstChar 29 /LastChar 255 /Widths "+e.API.PDFObject.convert(s.metadata.hmtx.widths)+">>"),u("endobj"),s.isAlreadyPutted=!0}})(i)}]);var a=function(i){var o,s=i.text||"",u=i.x,c=i.y,h=i.options||{},p=i.mutex||{},v=p.pdfEscape,f=p.activeFontKey,_=p.fonts,E=f,w="",x=0,y="",g=_[E].encoding;if(_[E].encoding!=="Identity-H")return{text:s,x:u,y:c,options:h,mutex:p};for(y=s,E=f,Array.isArray(s)&&(y=s[0]),x=0;x<y.length;x+=1)_[E].metadata.hasOwnProperty("cmap")&&(o=_[E].metadata.cmap.unicode.codeMap[y[x].charCodeAt(0)]),o||y[x].charCodeAt(0)<256&&_[E].metadata.hasOwnProperty("Unicode")?w+=y[x]:w+="";var S="";return parseInt(E.slice(1))<14||g==="WinAnsiEncoding"?S=v(w,E).split("").map(function(b){return b.charCodeAt(0).toString(16)}).join(""):g==="Identity-H"&&(S=t(w,_[E])),p.isHex=!0,{text:S,x:u,y:c,options:h,mutex:p}};r.events.push(["postProcessText",function(i){var o=i.text||"",s=[],u={text:o,x:i.x,y:i.y,options:i.options,mutex:i.mutex};if(Array.isArray(o)){var c=0;for(c=0;c<o.length;c+=1)Array.isArray(o[c])&&o[c].length===3?s.push([a(Object.assign({},u,{text:o[c][0]})).text,o[c][1],o[c][2]]):s.push(a(Object.assign({},u,{text:o[c]})).text);i.text=s}else i.text=a(Object.assign({},u,{text:o})).text}])}(vr),function(e){var r=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(t){return r.call(this),this.internal.vFS[t]!==void 0},e.addFileToVFS=function(t,n){return r.call(this),this.internal.vFS[t]=n,this},e.getFileFromVFS=function(t){return r.call(this),this.internal.vFS[t]!==void 0?this.internal.vFS[t]:null}}(vr.API),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(n){var a,i,o,s,u,c,h,p=r,v=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],f=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],_={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},E={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},w=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],x=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),y=!1,g=0;this.__bidiEngine__={};var S=function(O){var C=O.charCodeAt(),A=C>>8,j=E[A];return j!==void 0?p[256*j+(255&C)]:A===252||A===253?"AL":x.test(A)?"L":A===8?"R":"N"},b=function(O){for(var C,A=0;A<O.length;A++){if((C=S(O.charAt(A)))==="L")return!1;if(C==="R")return!0}return!1},R=function(O,C,A,j){var N,B,W,Y,Z=C[j];switch(Z){case"L":case"R":y=!1;break;case"N":case"AN":break;case"EN":y&&(Z="AN");break;case"AL":y=!0,Z="R";break;case"WS":Z="N";break;case"CS":j<1||j+1>=C.length||(N=A[j-1])!=="EN"&&N!=="AN"||(B=C[j+1])!=="EN"&&B!=="AN"?Z="N":y&&(B="AN"),Z=B===N?B:"N";break;case"ES":Z=(N=j>0?A[j-1]:"B")==="EN"&&j+1<C.length&&C[j+1]==="EN"?"EN":"N";break;case"ET":if(j>0&&A[j-1]==="EN"){Z="EN";break}if(y){Z="N";break}for(W=j+1,Y=C.length;W<Y&&C[W]==="ET";)W++;Z=W<Y&&C[W]==="EN"?"EN":"N";break;case"NSM":if(o&&!s){for(Y=C.length,W=j+1;W<Y&&C[W]==="NSM";)W++;if(W<Y){var V=O[j],H=V>=1425&&V<=2303||V===64286;if(N=C[W],H&&(N==="R"||N==="AL")){Z="R";break}}}Z=j<1||(N=C[j-1])==="B"?"N":A[j-1];break;case"B":y=!1,a=!0,Z=g;break;case"S":i=!0,Z="N";break;case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":y=!1;break;case"BN":Z="N"}return Z},L=function(O,C,A){var j=O.split("");return A&&T(j,A,{hiLevel:g}),j.reverse(),C&&C.reverse(),j.join("")},T=function(O,C,A){var j,N,B,W,Y,Z=-1,V=O.length,H=0,U=[],D=g?f:v,$=[];for(y=!1,a=!1,i=!1,N=0;N<V;N++)$[N]=S(O[N]);for(B=0;B<V;B++){if(Y=H,U[B]=R(O,$,U,B),j=240&(H=D[Y][_[U[B]]]),H&=15,C[B]=W=D[H][5],j>0)if(j===16){for(N=Z;N<B;N++)C[N]=1;Z=-1}else Z=-1;if(D[H][6])Z===-1&&(Z=B);else if(Z>-1){for(N=Z;N<B;N++)C[N]=W;Z=-1}$[B]==="B"&&(C[B]=0),A.hiLevel|=W}i&&function(Q,ee,te){for(var ae=0;ae<te;ae++)if(Q[ae]==="S"){ee[ae]=g;for(var se=ae-1;se>=0&&Q[se]==="WS";se--)ee[se]=g}}($,C,V)},F=function(O,C,A,j,N){if(!(N.hiLevel<O)){if(O===1&&g===1&&!a)return C.reverse(),void(A&&A.reverse());for(var B,W,Y,Z,V=C.length,H=0;H<V;){if(j[H]>=O){for(Y=H+1;Y<V&&j[Y]>=O;)Y++;for(Z=H,W=Y-1;Z<W;Z++,W--)B=C[Z],C[Z]=C[W],C[W]=B,A&&(B=A[Z],A[Z]=A[W],A[W]=B);H=Y}H++}}},I=function(O,C,A){var j=O.split(""),N={hiLevel:g};return A||(A=[]),T(j,A,N),function(B,W,Y){if(Y.hiLevel!==0&&h)for(var Z,V=0;V<B.length;V++)W[V]===1&&(Z=w.indexOf(B[V]))>=0&&(B[V]=w[Z+1])}(j,A,N),F(2,j,C,A,N),F(1,j,C,A,N),j.join("")};return this.__bidiEngine__.doBidiReorder=function(O,C,A){if(function(N,B){if(B)for(var W=0;W<N.length;W++)B[W]=W;s===void 0&&(s=b(N)),c===void 0&&(c=b(N))}(O,C),o||!u||c)if(o&&u&&s^c)g=s?1:0,O=L(O,C,A);else if(!o&&u&&c)g=s?1:0,O=I(O,C,A),O=L(O,C);else if(!o||s||u||c){if(o&&!u&&s^c)O=L(O,C),s?(g=0,O=I(O,C,A)):(g=1,O=I(O,C,A),O=L(O,C));else if(o&&s&&!u&&c)g=1,O=I(O,C,A),O=L(O,C);else if(!o&&!u&&s^c){var j=h;s?(g=1,O=I(O,C,A),g=0,h=!1,O=I(O,C,A),h=j):(g=0,O=I(O,C,A),O=L(O,C),g=1,h=!1,O=I(O,C,A),h=j,O=L(O,C))}}else g=0,O=I(O,C,A);else g=s?1:0,O=I(O,C,A);return O},this.__bidiEngine__.setOptions=function(O){O&&(o=O.isInputVisual,u=O.isOutputVisual,s=O.isInputRtl,c=O.isOutputRtl,h=O.isSymmetricSwapping)},this.__bidiEngine__.setOptions(n),this.__bidiEngine__};var r=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],t=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(n){var a=n.text;n.x,n.y;var i=n.options||{};n.mutex,i.lang;var o=[];if(i.isInputVisual=typeof i.isInputVisual!="boolean"||i.isInputVisual,t.setOptions(i),Object.prototype.toString.call(a)==="[object Array]"){var s=0;for(o=[],s=0;s<a.length;s+=1)Object.prototype.toString.call(a[s])==="[object Array]"?o.push([t.doBidiReorder(a[s][0]),a[s][1],a[s][2]]):o.push([t.doBidiReorder(a[s])]);n.text=o}else n.text=t.doBidiReorder(a);t.setOptions({isInputVisual:!0})}])}(vr),vr.API.TTFFont=function(){function e(r){var t;if(this.rawData=r,t=this.contents=new Kc(r),this.contents.pos=4,t.readString(4)==="ttcf")throw new Error("TTCF not supported.");t.pos=0,this.parse(),this.subset=new bL(this),this.registerTTF()}return e.open=function(r){return new e(r)},e.prototype.parse=function(){return this.directory=new aL(this.contents),this.head=new sL(this),this.name=new hL(this),this.cmap=new T_(this),this.toUnicode={},this.hhea=new lL(this),this.maxp=new dL(this),this.hmtx=new pL(this),this.post=new cL(this),this.os2=new uL(this),this.loca=new yL(this),this.glyf=new gL(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},e.prototype.registerTTF=function(){var r,t,n,a,i;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var o,s,u,c;for(c=[],o=0,s=(u=this.bbox).length;o<s;o++)r=u[o],c.push(Math.round(r*this.scaleFactor));return c}).call(this),this.stemV=0,this.post.exists?(n=255&(a=this.post.italic_angle),(32768&(t=a>>16))!=0&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+n)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(i=this.familyClass)===1||i===2||i===3||i===4||i===5||i===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},e.prototype.characterToGlyph=function(r){var t;return((t=this.cmap.unicode)!=null?t.codeMap[r]:void 0)||0},e.prototype.widthOfGlyph=function(r){var t;return t=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(r).advance*t},e.prototype.widthOfString=function(r,t,n){var a,i,o,s;for(o=0,i=0,s=(r=""+r).length;0<=s?i<s:i>s;i=0<=s?++i:--i)a=r.charCodeAt(i),o+=this.widthOfGlyph(this.characterToGlyph(a))+n*(1e3/t)||0;return o*(t/1e3)},e.prototype.lineHeight=function(r,t){var n;return t==null&&(t=!1),n=t?this.lineGap:0,(this.ascender+n-this.decender)/1e3*r},e}();var eu,Kc=function(){function e(r){this.data=r??[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(r){return this.data[this.pos++]=r},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(r){return this.writeByte(r>>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r)},e.prototype.readInt32=function(){var r;return(r=this.readUInt32())>=2147483648?r-4294967296:r},e.prototype.writeInt32=function(r){return r<0&&(r+=4294967296),this.writeUInt32(r)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(r){return this.writeByte(r>>8&255),this.writeByte(255&r)},e.prototype.readInt16=function(){var r;return(r=this.readUInt16())>=32768?r-65536:r},e.prototype.writeInt16=function(r){return r<0&&(r+=65536),this.writeUInt16(r)},e.prototype.readString=function(r){var t,n;for(n=[],t=0;0<=r?t<r:t>r;t=0<=r?++t:--t)n[t]=String.fromCharCode(this.readByte());return n.join("")},e.prototype.writeString=function(r){var t,n,a;for(a=[],t=0,n=r.length;0<=n?t<n:t>n;t=0<=n?++t:--t)a.push(this.writeByte(r.charCodeAt(t)));return a},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(r){return this.writeInt16(r)},e.prototype.readLongLong=function(){var r,t,n,a,i,o,s,u;return r=this.readByte(),t=this.readByte(),n=this.readByte(),a=this.readByte(),i=this.readByte(),o=this.readByte(),s=this.readByte(),u=this.readByte(),128&r?-1*(72057594037927940*(255^r)+281474976710656*(255^t)+1099511627776*(255^n)+4294967296*(255^a)+16777216*(255^i)+65536*(255^o)+256*(255^s)+(255^u)+1):72057594037927940*r+281474976710656*t+1099511627776*n+4294967296*a+16777216*i+65536*o+256*s+u},e.prototype.writeLongLong=function(r){var t,n;return t=Math.floor(r/4294967296),n=4294967295&r,this.writeByte(t>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(r){return this.writeInt32(r)},e.prototype.read=function(r){var t,n;for(t=[],n=0;0<=r?n<r:n>r;n=0<=r?++n:--n)t.push(this.readByte());return t},e.prototype.write=function(r){var t,n,a,i;for(i=[],n=0,a=r.length;n<a;n++)t=r[n],i.push(this.writeByte(t));return i},e}(),aL=function(){var e;function r(t){var n,a,i;for(this.scalarType=t.readInt(),this.tableCount=t.readShort(),this.searchRange=t.readShort(),this.entrySelector=t.readShort(),this.rangeShift=t.readShort(),this.tables={},a=0,i=this.tableCount;0<=i?a<i:a>i;a=0<=i?++a:--a)n={tag:t.readString(4),checksum:t.readInt(),offset:t.readInt(),length:t.readInt()},this.tables[n.tag]=n}return r.prototype.encode=function(t){var n,a,i,o,s,u,c,h,p,v,f,_,E;for(E in f=Object.keys(t).length,u=Math.log(2),p=16*Math.floor(Math.log(f)/u),o=Math.floor(p/u),h=16*f-p,(a=new Kc).writeInt(this.scalarType),a.writeShort(f),a.writeShort(p),a.writeShort(o),a.writeShort(h),i=16*f,c=a.pos+i,s=null,_=[],t)for(v=t[E],a.writeString(E),a.writeInt(e(v)),a.writeInt(c),a.writeInt(v.length),_=_.concat(v),E==="head"&&(s=c),c+=v.length;c%4;)_.push(0),c++;return a.write(_),n=2981146554-e(a.data),a.pos=s+8,a.writeUInt32(n),a.data},e=function(t){var n,a,i,o;for(t=R_.call(t);t.length%4;)t.push(0);for(i=new Kc(t),a=0,n=0,o=t.length;n<o;n=n+=4)a+=i.readUInt32();return 4294967295&a},r}(),oL={}.hasOwnProperty,Du=function(e,r){for(var t in r)oL.call(r,t)&&(e[t]=r[t]);function n(){this.constructor=e}return n.prototype=r.prototype,e.prototype=new n,e.__super__=r.prototype,e};eu=function(){function e(r){var t;this.file=r,t=this.file.directory.tables[this.tag],this.exists=!!t,t&&(this.offset=t.offset,this.length=t.length,this.parse(this.file.contents))}return e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e}();var sL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="head",r.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.revision=t.readInt(),this.checkSumAdjustment=t.readInt(),this.magicNumber=t.readInt(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.readLongLong(),this.modified=t.readLongLong(),this.xMin=t.readShort(),this.yMin=t.readShort(),this.xMax=t.readShort(),this.yMax=t.readShort(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort(),this.indexToLocFormat=t.readShort(),this.glyphDataFormat=t.readShort()},r.prototype.encode=function(t){var n;return(n=new Kc).writeInt(this.version),n.writeInt(this.revision),n.writeInt(this.checkSumAdjustment),n.writeInt(this.magicNumber),n.writeShort(this.flags),n.writeShort(this.unitsPerEm),n.writeLongLong(this.created),n.writeLongLong(this.modified),n.writeShort(this.xMin),n.writeShort(this.yMin),n.writeShort(this.xMax),n.writeShort(this.yMax),n.writeShort(this.macStyle),n.writeShort(this.lowestRecPPEM),n.writeShort(this.fontDirectionHint),n.writeShort(t),n.writeShort(this.glyphDataFormat),n.data},r}(),dw=function(){function e(r,t){var n,a,i,o,s,u,c,h,p,v,f,_,E,w,x,y,g;switch(this.platformID=r.readUInt16(),this.encodingID=r.readShort(),this.offset=t+r.readInt(),p=r.pos,r.pos=this.offset,this.format=r.readUInt16(),this.length=r.readUInt16(),this.language=r.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(u=0;u<256;++u)this.codeMap[u]=r.readByte();break;case 4:for(f=r.readUInt16(),v=f/2,r.pos+=6,i=function(){var S,b;for(b=[],u=S=0;0<=v?S<v:S>v;u=0<=v?++S:--S)b.push(r.readUInt16());return b}(),r.pos+=2,E=function(){var S,b;for(b=[],u=S=0;0<=v?S<v:S>v;u=0<=v?++S:--S)b.push(r.readUInt16());return b}(),c=function(){var S,b;for(b=[],u=S=0;0<=v?S<v:S>v;u=0<=v?++S:--S)b.push(r.readUInt16());return b}(),h=function(){var S,b;for(b=[],u=S=0;0<=v?S<v:S>v;u=0<=v?++S:--S)b.push(r.readUInt16());return b}(),a=(this.length-r.pos+this.offset)/2,s=function(){var S,b;for(b=[],u=S=0;0<=a?S<a:S>a;u=0<=a?++S:--S)b.push(r.readUInt16());return b}(),u=x=0,g=i.length;x<g;u=++x)for(w=i[u],n=y=_=E[u];_<=w?y<=w:y>=w;n=_<=w?++y:--y)h[u]===0?o=n+c[u]:(o=s[h[u]/2+(n-_)-(v-u)]||0)!==0&&(o+=c[u]),this.codeMap[n]=65535&o}r.pos=p}return e.encode=function(r,t){var n,a,i,o,s,u,c,h,p,v,f,_,E,w,x,y,g,S,b,R,L,T,F,I,O,C,A,j,N,B,W,Y,Z,V,H,U,D,$,Q,ee,te,ae,se,ce,me,_e;switch(j=new Kc,o=Object.keys(r).sort(function(Le,Re){return Le-Re}),t){case"macroman":for(E=0,w=function(){var Le=[];for(_=0;_<256;++_)Le.push(0);return Le}(),y={0:0},i={},N=0,Z=o.length;N<Z;N++)y[se=r[a=o[N]]]==null&&(y[se]=++E),i[a]={old:r[a],new:y[r[a]]},w[a]=y[r[a]];return j.writeUInt16(1),j.writeUInt16(0),j.writeUInt32(12),j.writeUInt16(0),j.writeUInt16(262),j.writeUInt16(0),j.write(w),{charMap:i,subtable:j.data,maxGlyphID:E+1};case"unicode":for(C=[],p=[],g=0,y={},n={},x=c=null,B=0,V=o.length;B<V;B++)y[b=r[a=o[B]]]==null&&(y[b]=++g),n[a]={old:b,new:y[b]},s=y[b]-a,x!=null&&s===c||(x&&p.push(x),C.push(a),c=s),x=a;for(x&&p.push(x),p.push(65535),C.push(65535),I=2*(F=C.length),T=2*Math.pow(Math.log(F)/Math.LN2,2),v=Math.log(T/2)/Math.LN2,L=2*F-T,u=[],R=[],f=[],_=W=0,H=C.length;W<H;_=++W){if(O=C[_],h=p[_],O===65535){u.push(0),R.push(0);break}if(O-(A=n[O].new)>=32768)for(u.push(0),R.push(2*(f.length+F-_)),a=Y=O;O<=h?Y<=h:Y>=h;a=O<=h?++Y:--Y)f.push(n[a].new);else u.push(A-O),R.push(0)}for(j.writeUInt16(3),j.writeUInt16(1),j.writeUInt32(12),j.writeUInt16(4),j.writeUInt16(16+8*F+2*f.length),j.writeUInt16(0),j.writeUInt16(I),j.writeUInt16(T),j.writeUInt16(v),j.writeUInt16(L),te=0,U=p.length;te<U;te++)a=p[te],j.writeUInt16(a);for(j.writeUInt16(0),ae=0,D=C.length;ae<D;ae++)a=C[ae],j.writeUInt16(a);for(ce=0,$=u.length;ce<$;ce++)s=u[ce],j.writeUInt16(s);for(me=0,Q=R.length;me<Q;me++)S=R[me],j.writeUInt16(S);for(_e=0,ee=f.length;_e<ee;_e++)E=f[_e],j.writeUInt16(E);return{charMap:n,subtable:j.data,maxGlyphID:g+1}}},e}(),T_=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="cmap",r.prototype.parse=function(t){var n,a,i;for(t.pos=this.offset,this.version=t.readUInt16(),i=t.readUInt16(),this.tables=[],this.unicode=null,a=0;0<=i?a<i:a>i;a=0<=i?++a:--a)n=new dw(t,this.offset),this.tables.push(n),n.isUnicode&&this.unicode==null&&(this.unicode=n);return!0},r.encode=function(t,n){var a,i;return n==null&&(n="macroman"),a=dw.encode(t,n),(i=new Kc).writeUInt16(0),i.writeUInt16(1),a.table=i.data.concat(a.subtable),a},r}(),lL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="hhea",r.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.ascender=t.readShort(),this.decender=t.readShort(),this.lineGap=t.readShort(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort(),this.minRightSideBearing=t.readShort(),this.xMaxExtent=t.readShort(),this.caretSlopeRise=t.readShort(),this.caretSlopeRun=t.readShort(),this.caretOffset=t.readShort(),t.pos+=8,this.metricDataFormat=t.readShort(),this.numberOfMetrics=t.readUInt16()},r}(),uL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="OS/2",r.prototype.parse=function(t){if(t.pos=this.offset,this.version=t.readUInt16(),this.averageCharWidth=t.readShort(),this.weightClass=t.readUInt16(),this.widthClass=t.readUInt16(),this.type=t.readShort(),this.ySubscriptXSize=t.readShort(),this.ySubscriptYSize=t.readShort(),this.ySubscriptXOffset=t.readShort(),this.ySubscriptYOffset=t.readShort(),this.ySuperscriptXSize=t.readShort(),this.ySuperscriptYSize=t.readShort(),this.ySuperscriptXOffset=t.readShort(),this.ySuperscriptYOffset=t.readShort(),this.yStrikeoutSize=t.readShort(),this.yStrikeoutPosition=t.readShort(),this.familyClass=t.readShort(),this.panose=function(){var n,a;for(a=[],n=0;n<10;++n)a.push(t.readByte());return a}(),this.charRange=function(){var n,a;for(a=[],n=0;n<4;++n)a.push(t.readInt());return a}(),this.vendorID=t.readString(4),this.selection=t.readShort(),this.firstCharIndex=t.readShort(),this.lastCharIndex=t.readShort(),this.version>0&&(this.ascent=t.readShort(),this.descent=t.readShort(),this.lineGap=t.readShort(),this.winAscent=t.readShort(),this.winDescent=t.readShort(),this.codePageRange=function(){var n,a;for(a=[],n=0;n<2;n=++n)a.push(t.readInt());return a}(),this.version>1))return this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()},r}(),cL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="post",r.prototype.parse=function(t){var n,a,i;switch(t.pos=this.offset,this.format=t.readInt(),this.italicAngle=t.readInt(),this.underlinePosition=t.readShort(),this.underlineThickness=t.readShort(),this.isFixedPitch=t.readInt(),this.minMemType42=t.readInt(),this.maxMemType42=t.readInt(),this.minMemType1=t.readInt(),this.maxMemType1=t.readInt(),this.format){case 65536:break;case 131072:var o;for(a=t.readUInt16(),this.glyphNameIndex=[],o=0;0<=a?o<a:o>a;o=0<=a?++o:--o)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],i=[];t.pos<this.offset+this.length;)n=t.readByte(),i.push(this.names.push(t.readString(n)));return i;case 151552:return a=t.readUInt16(),this.offsets=t.read(a);case 196608:break;case 262144:return this.map=(function(){var s,u,c;for(c=[],o=s=0,u=this.file.maxp.numGlyphs;0<=u?s<u:s>u;o=0<=u?++s:--s)c.push(t.readUInt32());return c}).call(this)}},r}(),fL=function(e,r){this.raw=e,this.length=e.length,this.platformID=r.platformID,this.encodingID=r.encodingID,this.languageID=r.languageID},hL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="name",r.prototype.parse=function(t){var n,a,i,o,s,u,c,h,p,v,f;for(t.pos=this.offset,t.readShort(),n=t.readShort(),u=t.readShort(),a=[],o=0;0<=n?o<n:o>n;o=0<=n?++o:--o)a.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+u+t.readShort()});for(c={},o=p=0,v=a.length;p<v;o=++p)i=a[o],t.pos=i.offset,h=t.readString(i.length),s=new fL(h,i),c[f=i.nameID]==null&&(c[f]=[]),c[i.nameID].push(s);this.strings=c,this.copyright=c[0],this.fontFamily=c[1],this.fontSubfamily=c[2],this.uniqueSubfamily=c[3],this.fontName=c[4],this.version=c[5];try{this.postscriptName=c[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=c[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=c[7],this.manufacturer=c[8],this.designer=c[9],this.description=c[10],this.vendorUrl=c[11],this.designerUrl=c[12],this.license=c[13],this.licenseUrl=c[14],this.preferredFamily=c[15],this.preferredSubfamily=c[17],this.compatibleFull=c[18],this.sampleText=c[19]},r}(),dL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="maxp",r.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.numGlyphs=t.readUInt16(),this.maxPoints=t.readUInt16(),this.maxContours=t.readUInt16(),this.maxCompositePoints=t.readUInt16(),this.maxComponentContours=t.readUInt16(),this.maxZones=t.readUInt16(),this.maxTwilightPoints=t.readUInt16(),this.maxStorage=t.readUInt16(),this.maxFunctionDefs=t.readUInt16(),this.maxInstructionDefs=t.readUInt16(),this.maxStackElements=t.readUInt16(),this.maxSizeOfInstructions=t.readUInt16(),this.maxComponentElements=t.readUInt16(),this.maxComponentDepth=t.readUInt16()},r}(),pL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="hmtx",r.prototype.parse=function(t){var n,a,i,o,s,u,c;for(t.pos=this.offset,this.metrics=[],n=0,u=this.file.hhea.numberOfMetrics;0<=u?n<u:n>u;n=0<=u?++n:--n)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(i=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var h,p;for(p=[],n=h=0;0<=i?h<i:h>i;n=0<=i?++h:--h)p.push(t.readInt16());return p}(),this.widths=(function(){var h,p,v,f;for(f=[],h=0,p=(v=this.metrics).length;h<p;h++)o=v[h],f.push(o.advance);return f}).call(this),a=this.widths[this.widths.length-1],c=[],n=s=0;0<=i?s<i:s>i;n=0<=i?++s:--s)c.push(this.widths.push(a));return c},r.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},r}(),R_=[].slice,gL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="glyf",r.prototype.parse=function(){return this.cache={}},r.prototype.glyphFor=function(t){var n,a,i,o,s,u,c,h,p,v;return t in this.cache?this.cache[t]:(o=this.file.loca,n=this.file.contents,a=o.indexOf(t),(i=o.lengthOf(t))===0?this.cache[t]=null:(n.pos=this.offset+a,s=(u=new Kc(n.read(i))).readShort(),h=u.readShort(),v=u.readShort(),c=u.readShort(),p=u.readShort(),this.cache[t]=s===-1?new mL(u,h,v,c,p):new vL(u,s,h,v,c,p),this.cache[t]))},r.prototype.encode=function(t,n,a){var i,o,s,u,c;for(s=[],o=[],u=0,c=n.length;u<c;u++)i=t[n[u]],o.push(s.length),i&&(s=s.concat(i.encode(a)));return o.push(s.length),{table:s,offsets:o}},r}(),vL=function(){function e(r,t,n,a,i,o){this.raw=r,this.numberOfContours=t,this.xMin=n,this.yMin=a,this.xMax=i,this.yMax=o,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e}(),mL=function(){function e(r,t,n,a,i){var o,s;for(this.raw=r,this.xMin=t,this.yMin=n,this.xMax=a,this.yMax=i,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],o=this.raw;s=o.readShort(),this.glyphOffsets.push(o.pos),this.glyphIDs.push(o.readUInt16()),32&s;)o.pos+=1&s?4:2,128&s?o.pos+=8:64&s?o.pos+=4:8&s&&(o.pos+=2)}return e.prototype.encode=function(){var r,t,n;for(t=new Kc(R_.call(this.raw.data)),r=0,n=this.glyphIDs.length;r<n;++r)t.pos=this.glyphOffsets[r];return t.data},e}(),yL=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return Du(r,eu),r.prototype.tag="loca",r.prototype.parse=function(t){var n,a;return t.pos=this.offset,n=this.file.head.indexToLocFormat,this.offsets=n===0?(function(){var i,o;for(o=[],a=0,i=this.length;a<i;a+=2)o.push(2*t.readUInt16());return o}).call(this):(function(){var i,o;for(o=[],a=0,i=this.length;a<i;a+=4)o.push(t.readUInt32());return o}).call(this)},r.prototype.indexOf=function(t){return this.offsets[t]},r.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]},r.prototype.encode=function(t,n){for(var a=new Uint32Array(this.offsets.length),i=0,o=0,s=0;s<a.length;++s)if(a[s]=i,o<n.length&&n[o]==s){++o,a[s]=i;var u=this.offsets[s],c=this.offsets[s+1]-u;c>0&&(i+=c)}for(var h=new Array(4*a.length),p=0;p<a.length;++p)h[4*p+3]=255&a[p],h[4*p+2]=(65280&a[p])>>8,h[4*p+1]=(16711680&a[p])>>16,h[4*p]=(4278190080&a[p])>>24;return h},r}(),bL=function(){function e(r){this.font=r,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var r,t,n,a,i;for(t in a=this.font.cmap.tables[0].codeMap,r={},i=this.subset)n=i[t],r[t]=a[n];return r},e.prototype.glyphsFor=function(r){var t,n,a,i,o,s,u;for(a={},o=0,s=r.length;o<s;o++)a[i=r[o]]=this.font.glyf.glyphFor(i);for(i in t=[],a)(n=a[i])!=null&&n.compound&&t.push.apply(t,n.glyphIDs);if(t.length>0)for(i in u=this.glyphsFor(t))n=u[i],a[i]=n;return a},e.prototype.encode=function(r,t){var n,a,i,o,s,u,c,h,p,v,f,_,E,w,x;for(a in n=T_.encode(this.generateCmap(),"unicode"),o=this.glyphsFor(r),f={0:0},x=n.charMap)f[(u=x[a]).old]=u.new;for(_ in v=n.maxGlyphID,o)_ in f||(f[_]=v++);return h=function(y){var g,S;for(g in S={},y)S[y[g]]=g;return S}(f),p=Object.keys(h).sort(function(y,g){return y-g}),E=function(){var y,g,S;for(S=[],y=0,g=p.length;y<g;y++)s=p[y],S.push(h[s]);return S}(),i=this.font.glyf.encode(o,E,f),c=this.font.loca.encode(i.offsets,E),w={cmap:this.font.cmap.raw(),glyf:i.table,loca:c,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(t)},this.font.os2.exists&&(w["OS/2"]=this.font.os2.raw()),this.font.directory.encode(w)},e}();vr.API.PDFObject=function(){var e;function r(){}return e=function(t,n){return(Array(n+1).join("0")+t).slice(-n)},r.convert=function(t){var n,a,i,o;if(Array.isArray(t))return"["+function(){var s,u,c;for(c=[],s=0,u=t.length;s<u;s++)n=t[s],c.push(r.convert(n));return c}().join(" ")+"]";if(typeof t=="string")return"/"+t;if(t!=null&&t.isString)return"("+t+")";if(t instanceof Date)return"(D:"+e(t.getUTCFullYear(),4)+e(t.getUTCMonth(),2)+e(t.getUTCDate(),2)+e(t.getUTCHours(),2)+e(t.getUTCMinutes(),2)+e(t.getUTCSeconds(),2)+"Z)";if({}.toString.call(t)==="[object Object]"){for(a in i=["<<"],t)o=t[a],i.push("/"+a+" "+r.convert(o));return i.push(">>"),i.join(`
|
|
620
|
-
`)}return""+t},r}();window.jspdf={jsPDF:vr};bk.toggleFadeInAnimation(!1);ap.setTextOverflow("change-font-size");const wL=new URLSearchParams(location.search).get("key"),M_=yk.createStore({key:wL});window.store=M_;window.config={addGlobalFont:wk.addGlobalFont,unstable_useHtmlTextRender:ap.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:ap.setTextVerticalResizeEnabled,unstable_setTextOverflow:ap.setTextOverflow,onLoadError:r2.onLoadError,setAssetLoadTimeout:r2.setAssetLoadTimeout,setFontLoadTimeout:r2.setFontLoadTimeout,unstable_setTextSplitAllowed:ap.setTextSplitAllowed};const _L=gw.createRoot(document.getElementById("root"));_L.render($r.createElement(mk.WorkspaceCanvas,{visiblePagesOffset:0,renderOnlyActivePage:!0,store:M_,components:{PageControls:()=>null,Tooltip:()=>null}}));export{kn as _,bh as c,yp as g};
|