polotno-node 2.11.10 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/dist/assets/index-Bw37pW_y.js +561 -0
- package/dist/assets/{index.es-CilQ1Z1u.js → index.es-Csa83WQy.js} +1 -1
- package/dist/index.html +1 -1
- package/index.js +2 -0
- package/instance.js +11 -4
- package/package.json +6 -6
- package/dist/assets/index-CECWxSDu.js +0 -523
|
@@ -1,523 +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 wh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Kc(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:{}},Br={};/**
|
|
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 hy;function J_(){if(hy)return Br;hy=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"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function w(H){return H===null||typeof H!="object"?null:(H=p&&H[p]||H["@@iterator"],typeof H=="function"?H:null)}var d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,E={};function S(H,z,D){this.props=H,this.context=z,this.refs=E,this.updater=D||d}S.prototype.isReactComponent={},S.prototype.setState=function(H,z){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,z,"setState")},S.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function y(){}y.prototype=S.prototype;function g(H,z,D){this.props=H,this.context=z,this.refs=E,this.updater=D||d}var v=g.prototype=new y;v.constructor=g,_(v,S.prototype),v.isPureReactComponent=!0;var b=Array.isArray,O=Object.prototype.hasOwnProperty,j={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function M(H,z,D){var K,ne={},Z=null,ee=null;if(z!=null)for(K in z.ref!==void 0&&(ee=z.ref),z.key!==void 0&&(Z=""+z.key),z)O.call(z,K)&&!T.hasOwnProperty(K)&&(ne[K]=z[K]);var ae=arguments.length-2;if(ae===1)ne.children=D;else if(1<ae){for(var se=Array(ae),ce=0;ce<ae;ce++)se[ce]=arguments[ce+2];ne.children=se}if(H&&H.defaultProps)for(K in ae=H.defaultProps,ae)ne[K]===void 0&&(ne[K]=ae[K]);return{$$typeof:e,type:H,key:Z,ref:ee,props:ne,_owner:j.current}}function F(H,z){return{$$typeof:e,type:H.type,key:z,ref:H.ref,props:H.props,_owner:H._owner}}function C(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function x(H){var z={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(D){return z[D]})}var L=/\/+/g;function A(H,z){return typeof H=="object"&&H!==null&&H.key!=null?x(""+H.key):z.toString(36)}function N(H,z,D,K,ne){var Z=typeof H;(Z==="undefined"||Z==="boolean")&&(H=null);var ee=!1;if(H===null)ee=!0;else switch(Z){case"string":case"number":ee=!0;break;case"object":switch(H.$$typeof){case e:case r:ee=!0}}if(ee)return ee=H,ne=ne(ee),H=K===""?"."+A(ee,0):K,b(ne)?(D="",H!=null&&(D=H.replace(L,"$&/")+"/"),N(ne,z,D,"",function(ce){return ce})):ne!=null&&(C(ne)&&(ne=F(ne,D+(!ne.key||ee&&ee.key===ne.key?"":(""+ne.key).replace(L,"$&/")+"/")+H)),z.push(ne)),1;if(ee=0,K=K===""?".":K+":",b(H))for(var ae=0;ae<H.length;ae++){Z=H[ae];var se=K+A(Z,ae);ee+=N(Z,z,D,se,ne)}else if(se=w(H),typeof se=="function")for(H=se.call(H),ae=0;!(Z=H.next()).done;)Z=Z.value,se=K+A(Z,ae++),ee+=N(Z,z,D,se,ne);else if(Z==="object")throw z=String(H),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.");return ee}function I(H,z,D){if(H==null)return H;var K=[],ne=0;return N(H,K,"","",function(Z){return z.call(D,Z,ne++)}),K}function W(H){if(H._status===-1){var z=H._result;z=z(),z.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=z)}if(H._status===1)return H._result.default;throw H._result}var G={current:null},$={transition:null},J={ReactCurrentDispatcher:G,ReactCurrentBatchConfig:$,ReactCurrentOwner:j};function V(){throw Error("act(...) is not supported in production builds of React.")}return Br.Children={map:I,forEach:function(H,z,D){I(H,function(){z.apply(this,arguments)},D)},count:function(H){var z=0;return I(H,function(){z++}),z},toArray:function(H){return I(H,function(z){return z})||[]},only:function(H){if(!C(H))throw Error("React.Children.only expected to receive a single React element child.");return H}},Br.Component=S,Br.Fragment=t,Br.Profiler=a,Br.PureComponent=g,Br.StrictMode=n,Br.Suspense=u,Br.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J,Br.act=V,Br.cloneElement=function(H,z,D){if(H==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+H+".");var K=_({},H.props),ne=H.key,Z=H.ref,ee=H._owner;if(z!=null){if(z.ref!==void 0&&(Z=z.ref,ee=j.current),z.key!==void 0&&(ne=""+z.key),H.type&&H.type.defaultProps)var ae=H.type.defaultProps;for(se in z)O.call(z,se)&&!T.hasOwnProperty(se)&&(K[se]=z[se]===void 0&&ae!==void 0?ae[se]:z[se])}var se=arguments.length-2;if(se===1)K.children=D;else if(1<se){ae=Array(se);for(var ce=0;ce<se;ce++)ae[ce]=arguments[ce+2];K.children=ae}return{$$typeof:e,type:H.type,key:ne,ref:Z,props:K,_owner:ee}},Br.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},Br.createElement=M,Br.createFactory=function(H){var z=M.bind(null,H);return z.type=H,z},Br.createRef=function(){return{current:null}},Br.forwardRef=function(H){return{$$typeof:l,render:H}},Br.isValidElement=C,Br.lazy=function(H){return{$$typeof:h,_payload:{_status:-1,_result:H},_init:W}},Br.memo=function(H,z){return{$$typeof:c,type:H,compare:z===void 0?null:z}},Br.startTransition=function(H){var z=$.transition;$.transition={};try{H()}finally{$.transition=z}},Br.unstable_act=V,Br.useCallback=function(H,z){return G.current.useCallback(H,z)},Br.useContext=function(H){return G.current.useContext(H)},Br.useDebugValue=function(){},Br.useDeferredValue=function(H){return G.current.useDeferredValue(H)},Br.useEffect=function(H,z){return G.current.useEffect(H,z)},Br.useId=function(){return G.current.useId()},Br.useImperativeHandle=function(H,z,D){return G.current.useImperativeHandle(H,z,D)},Br.useInsertionEffect=function(H,z){return G.current.useInsertionEffect(H,z)},Br.useLayoutEffect=function(H,z){return G.current.useLayoutEffect(H,z)},Br.useMemo=function(H,z){return G.current.useMemo(H,z)},Br.useReducer=function(H,z,D){return G.current.useReducer(H,z,D)},Br.useRef=function(H){return G.current.useRef(H)},Br.useState=function(H){return G.current.useState(H)},Br.useSyncExternalStore=function(H,z,D){return G.current.useSyncExternalStore(H,z,D)},Br.useTransition=function(){return G.current.useTransition()},Br.version="18.3.1",Br}var dy;function di(){return dy||(dy=1,B0.exports=J_()),B0.exports}var ni=di();const Gr=mp(ni);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 py;function e7(){return py||(py=1,function(e){function r($,J){var V=$.length;$.push(J);e:for(;0<V;){var H=V-1>>>1,z=$[H];if(0<a(z,J))$[H]=J,$[V]=z,V=H;else break e}}function t($){return $.length===0?null:$[0]}function n($){if($.length===0)return null;var J=$[0],V=$.pop();if(V!==J){$[0]=V;e:for(var H=0,z=$.length,D=z>>>1;H<D;){var K=2*(H+1)-1,ne=$[K],Z=K+1,ee=$[Z];if(0>a(ne,V))Z<z&&0>a(ee,ne)?($[H]=ee,$[Z]=V,H=Z):($[H]=ne,$[K]=V,H=K);else if(Z<z&&0>a(ee,V))$[H]=ee,$[Z]=V,H=Z;else break e}}return J}function a($,J){var V=$.sortIndex-J.sortIndex;return V!==0?V:$.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var u=[],c=[],h=1,p=null,w=3,d=!1,_=!1,E=!1,S=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v($){for(var J=t(c);J!==null;){if(J.callback===null)n(c);else if(J.startTime<=$)n(c),J.sortIndex=J.expirationTime,r(u,J);else break;J=t(c)}}function b($){if(E=!1,v($),!_)if(t(u)!==null)_=!0,W(O);else{var J=t(c);J!==null&&G(b,J.startTime-$)}}function O($,J){_=!1,E&&(E=!1,y(M),M=-1),d=!0;var V=w;try{for(v(J),p=t(u);p!==null&&(!(p.expirationTime>J)||$&&!x());){var H=p.callback;if(typeof H=="function"){p.callback=null,w=p.priorityLevel;var z=H(p.expirationTime<=J);J=e.unstable_now(),typeof z=="function"?p.callback=z:p===t(u)&&n(u),v(J)}else n(u);p=t(u)}if(p!==null)var D=!0;else{var K=t(c);K!==null&&G(b,K.startTime-J),D=!1}return D}finally{p=null,w=V,d=!1}}var j=!1,T=null,M=-1,F=5,C=-1;function x(){return!(e.unstable_now()-C<F)}function L(){if(T!==null){var $=e.unstable_now();C=$;var J=!0;try{J=T(!0,$)}finally{J?A():(j=!1,T=null)}}else j=!1}var A;if(typeof g=="function")A=function(){g(L)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,I=N.port2;N.port1.onmessage=L,A=function(){I.postMessage(null)}}else A=function(){S(L,0)};function W($){T=$,j||(j=!0,A())}function G($,J){M=S(function(){$(e.unstable_now())},J)}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($){$.callback=null},e.unstable_continueExecution=function(){_||d||(_=!0,W(O))},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_getFirstCallbackNode=function(){return t(u)},e.unstable_next=function($){switch(w){case 1:case 2:case 3:var J=3;break;default:J=w}var V=w;w=J;try{return $()}finally{w=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,J){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var V=w;w=$;try{return J()}finally{w=V}},e.unstable_scheduleCallback=function($,J,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,$){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=V+z,$={id:h++,callback:J,priorityLevel:$,startTime:V,expirationTime:z,sortIndex:-1},V>H?($.sortIndex=V,r(c,$),t(u)===null&&$===t(c)&&(E?(y(M),M=-1):E=!0,G(b,V-H))):($.sortIndex=z,r(u,$),_||d||(_=!0,W(O))),$},e.unstable_shouldYield=x,e.unstable_wrapCallback=function($){var J=w;return function(){var V=w;w=J;try{return $.apply(this,arguments)}finally{w=V}}}}(U0)),U0}var gy;function D2(){return gy||(gy=1,z0.exports=e7()),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 vy;function t7(){if(vy)return hs;vy=1;var e=di(),r=D2();function t(s){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+s,k=1;k<arguments.length;k++)f+="&args[]="+encodeURIComponent(arguments[k]);return"Minified React error #"+s+"; visit "+f+" 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(s,f){o(s,f),o(s+"Capture",f)}function o(s,f){for(a[s]=f,s=0;s<f.length;s++)n.add(f[s])}var l=!(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 w(s){return u.call(p,s)?!0:u.call(h,s)?!1:c.test(s)?p[s]=!0:(h[s]=!0,!1)}function d(s,f,k,q){if(k!==null&&k.type===0)return!1;switch(typeof f){case"function":case"symbol":return!0;case"boolean":return q?!1:k!==null?!k.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function _(s,f,k,q){if(f===null||typeof f>"u"||d(s,f,k,q))return!0;if(q)return!1;if(k!==null)switch(k.type){case 3:return!f;case 4:return f===!1;case 5:return isNaN(f);case 6:return isNaN(f)||1>f}return!1}function E(s,f,k,q,Q,ie,pe){this.acceptsBooleans=f===2||f===3||f===4,this.attributeName=q,this.attributeNamespace=Q,this.mustUseProperty=k,this.propertyName=s,this.type=f,this.sanitizeURL=ie,this.removeEmptyString=pe}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){S[s]=new E(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var f=s[0];S[f]=new E(f,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){S[s]=new E(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){S[s]=new E(s,2,!1,s,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(s){S[s]=new E(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){S[s]=new E(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){S[s]=new E(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){S[s]=new E(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){S[s]=new E(s,5,!1,s.toLowerCase(),null,!1,!1)});var y=/[\-:]([a-z])/g;function g(s){return s[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(s){var f=s.replace(y,g);S[f]=new E(f,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var f=s.replace(y,g);S[f]=new E(f,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var f=s.replace(y,g);S[f]=new E(f,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){S[s]=new E(s,1,!1,s.toLowerCase(),null,!1,!1)}),S.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){S[s]=new E(s,1,!1,s.toLowerCase(),null,!0,!0)});function v(s,f,k,q){var Q=S.hasOwnProperty(f)?S[f]:null;(Q!==null?Q.type!==0:q||!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(_(f,k,Q,q)&&(k=null),q||Q===null?w(f)&&(k===null?s.removeAttribute(f):s.setAttribute(f,""+k)):Q.mustUseProperty?s[Q.propertyName]=k===null?Q.type===3?!1:"":k:(f=Q.attributeName,q=Q.attributeNamespace,k===null?s.removeAttribute(f):(Q=Q.type,k=Q===3||Q===4&&k===!0?"":""+k,q?s.setAttributeNS(q,f,k):s.setAttribute(f,k))))}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,O=Symbol.for("react.element"),j=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),x=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),G=Symbol.for("react.offscreen"),$=Symbol.iterator;function J(s){return s===null||typeof s!="object"?null:(s=$&&s[$]||s["@@iterator"],typeof s=="function"?s:null)}var V=Object.assign,H;function z(s){if(H===void 0)try{throw Error()}catch(k){var f=k.stack.trim().match(/\n( *(at )?)/);H=f&&f[1]||""}return`
|
|
26
|
-
`+H+s}var D=!1;function K(s,f){if(!s||D)return"";D=!0;var k=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(f)if(f=function(){throw Error()},Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(st){var q=st}Reflect.construct(s,[],f)}else{try{f.call()}catch(st){q=st}s.call(f.prototype)}else{try{throw Error()}catch(st){q=st}s()}}catch(st){if(st&&q&&typeof st.stack=="string"){for(var Q=st.stack.split(`
|
|
27
|
-
`),ie=q.stack.split(`
|
|
28
|
-
`),pe=Q.length-1,Te=ie.length-1;1<=pe&&0<=Te&&Q[pe]!==ie[Te];)Te--;for(;1<=pe&&0<=Te;pe--,Te--)if(Q[pe]!==ie[Te]){if(pe!==1||Te!==1)do if(pe--,Te--,0>Te||Q[pe]!==ie[Te]){var Be=`
|
|
29
|
-
`+Q[pe].replace(" at new "," at ");return s.displayName&&Be.includes("<anonymous>")&&(Be=Be.replace("<anonymous>",s.displayName)),Be}while(1<=pe&&0<=Te);break}}}finally{D=!1,Error.prepareStackTrace=k}return(s=s?s.displayName||s.name:"")?z(s):""}function ne(s){switch(s.tag){case 5:return z(s.type);case 16:return z("Lazy");case 13:return z("Suspense");case 19:return z("SuspenseList");case 0:case 2:case 15:return s=K(s.type,!1),s;case 11:return s=K(s.type.render,!1),s;case 1:return s=K(s.type,!0),s;default:return""}}function Z(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case T:return"Fragment";case j:return"Portal";case F:return"Profiler";case M:return"StrictMode";case A:return"Suspense";case N:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case x:return(s.displayName||"Context")+".Consumer";case C:return(s._context.displayName||"Context")+".Provider";case L:var f=s.render;return s=s.displayName,s||(s=f.displayName||f.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case I:return f=s.displayName||null,f!==null?f:Z(s.type)||"Memo";case W:f=s._payload,s=s._init;try{return Z(s(f))}catch{}}return null}function ee(s){var f=s.type;switch(s.tag){case 24:return"Cache";case 9:return(f.displayName||"Context")+".Consumer";case 10:return(f._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=f.render,s=s.displayName||s.name||"",f.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return f;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Z(f);case 8:return f===M?"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 f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f}return null}function ae(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function se(s){var f=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(f==="checkbox"||f==="radio")}function ce(s){var f=se(s)?"checked":"value",k=Object.getOwnPropertyDescriptor(s.constructor.prototype,f),q=""+s[f];if(!s.hasOwnProperty(f)&&typeof k<"u"&&typeof k.get=="function"&&typeof k.set=="function"){var Q=k.get,ie=k.set;return Object.defineProperty(s,f,{configurable:!0,get:function(){return Q.call(this)},set:function(pe){q=""+pe,ie.call(this,pe)}}),Object.defineProperty(s,f,{enumerable:k.enumerable}),{getValue:function(){return q},setValue:function(pe){q=""+pe},stopTracking:function(){s._valueTracker=null,delete s[f]}}}}function me(s){s._valueTracker||(s._valueTracker=ce(s))}function xe(s){if(!s)return!1;var f=s._valueTracker;if(!f)return!0;var k=f.getValue(),q="";return s&&(q=se(s)?s.checked?"true":"false":s.value),s=q,s!==k?(f.setValue(s),!0):!1}function Oe(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function Re(s,f){var k=f.checked;return V({},f,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:k??s._wrapperState.initialChecked})}function Se(s,f){var k=f.defaultValue==null?"":f.defaultValue,q=f.checked!=null?f.checked:f.defaultChecked;k=ae(f.value!=null?f.value:k),s._wrapperState={initialChecked:q,initialValue:k,controlled:f.type==="checkbox"||f.type==="radio"?f.checked!=null:f.value!=null}}function ve(s,f){f=f.checked,f!=null&&v(s,"checked",f,!1)}function He(s,f){ve(s,f);var k=ae(f.value),q=f.type;if(k!=null)q==="number"?(k===0&&s.value===""||s.value!=k)&&(s.value=""+k):s.value!==""+k&&(s.value=""+k);else if(q==="submit"||q==="reset"){s.removeAttribute("value");return}f.hasOwnProperty("value")?Ae(s,f.type,k):f.hasOwnProperty("defaultValue")&&Ae(s,f.type,ae(f.defaultValue)),f.checked==null&&f.defaultChecked!=null&&(s.defaultChecked=!!f.defaultChecked)}function we(s,f,k){if(f.hasOwnProperty("value")||f.hasOwnProperty("defaultValue")){var q=f.type;if(!(q!=="submit"&&q!=="reset"||f.value!==void 0&&f.value!==null))return;f=""+s._wrapperState.initialValue,k||f===s.value||(s.value=f),s.defaultValue=f}k=s.name,k!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,k!==""&&(s.name=k)}function Ae(s,f,k){(f!=="number"||Oe(s.ownerDocument)!==s)&&(k==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+k&&(s.defaultValue=""+k))}var Ee=Array.isArray;function Ne(s,f,k,q){if(s=s.options,f){f={};for(var Q=0;Q<k.length;Q++)f["$"+k[Q]]=!0;for(k=0;k<s.length;k++)Q=f.hasOwnProperty("$"+s[k].value),s[k].selected!==Q&&(s[k].selected=Q),Q&&q&&(s[k].defaultSelected=!0)}else{for(k=""+ae(k),f=null,Q=0;Q<s.length;Q++){if(s[Q].value===k){s[Q].selected=!0,q&&(s[Q].defaultSelected=!0);return}f!==null||s[Q].disabled||(f=s[Q])}f!==null&&(f.selected=!0)}}function he(s,f){if(f.dangerouslySetInnerHTML!=null)throw Error(t(91));return V({},f,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function Le(s,f){var k=f.value;if(k==null){if(k=f.children,f=f.defaultValue,k!=null){if(f!=null)throw Error(t(92));if(Ee(k)){if(1<k.length)throw Error(t(93));k=k[0]}f=k}f==null&&(f=""),k=f}s._wrapperState={initialValue:ae(k)}}function Ce(s,f){var k=ae(f.value),q=ae(f.defaultValue);k!=null&&(k=""+k,k!==s.value&&(s.value=k),f.defaultValue==null&&s.defaultValue!==k&&(s.defaultValue=k)),q!=null&&(s.defaultValue=""+q)}function De(s){var f=s.textContent;f===s._wrapperState.initialValue&&f!==""&&f!==null&&(s.value=f)}function tt(s){switch(s){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 vt(s,f){return s==null||s==="http://www.w3.org/1999/xhtml"?tt(f):s==="http://www.w3.org/2000/svg"&&f==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var mt,Et=function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(f,k,q,Q){MSApp.execUnsafeLocalFunction(function(){return s(f,k,q,Q)})}:s}(function(s,f){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=f;else{for(mt=mt||document.createElement("div"),mt.innerHTML="<svg>"+f.valueOf().toString()+"</svg>",f=mt.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;f.firstChild;)s.appendChild(f.firstChild)}});function nt(s,f){if(f){var k=s.firstChild;if(k&&k===s.lastChild&&k.nodeType===3){k.nodeValue=f;return}}s.textContent=f}var at={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},qt=["Webkit","ms","Moz","O"];Object.keys(at).forEach(function(s){qt.forEach(function(f){f=f+s.charAt(0).toUpperCase()+s.substring(1),at[f]=at[s]})});function Ct(s,f,k){return f==null||typeof f=="boolean"||f===""?"":k||typeof f!="number"||f===0||at.hasOwnProperty(s)&&at[s]?(""+f).trim():f+"px"}function or(s,f){s=s.style;for(var k in f)if(f.hasOwnProperty(k)){var q=k.indexOf("--")===0,Q=Ct(k,f[k],q);k==="float"&&(k="cssFloat"),q?s.setProperty(k,Q):s[k]=Q}}var Xt=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 qe(s,f){if(f){if(Xt[s]&&(f.children!=null||f.dangerouslySetInnerHTML!=null))throw Error(t(137,s));if(f.dangerouslySetInnerHTML!=null){if(f.children!=null)throw Error(t(60));if(typeof f.dangerouslySetInnerHTML!="object"||!("__html"in f.dangerouslySetInnerHTML))throw Error(t(61))}if(f.style!=null&&typeof f.style!="object")throw Error(t(62))}}function We(s,f){if(s.indexOf("-")===-1)return typeof f.is=="string";switch(s){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 Nt=null;function ht(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var gt=null,wt=null,tr=null;function Vt(s){if(s=vu(s)){if(typeof gt!="function")throw Error(t(280));var f=s.stateNode;f&&(f=wi(f),gt(s.stateNode,s.type,f))}}function _t(s){wt?tr?tr.push(s):tr=[s]:wt=s}function it(){if(wt){var s=wt,f=tr;if(tr=wt=null,Vt(s),f)for(s=0;s<f.length;s++)Vt(f[s])}}function Bt(s,f){return s(f)}function Ve(){}var Fe=!1;function bt(s,f,k){if(Fe)return s(f,k);Fe=!0;try{return Bt(s,f,k)}finally{Fe=!1,(wt!==null||tr!==null)&&(Ve(),it())}}function Ue(s,f){var k=s.stateNode;if(k===null)return null;var q=wi(k);if(q===null)return null;k=q[f];e:switch(f){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(q=!q.disabled)||(s=s.type,q=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!q;break e;default:s=!1}if(s)return null;if(k&&typeof k!="function")throw Error(t(231,f,typeof k));return k}var St=!1;if(l)try{var kt={};Object.defineProperty(kt,"passive",{get:function(){St=!0}}),window.addEventListener("test",kt,kt),window.removeEventListener("test",kt,kt)}catch{St=!1}function Ft(s,f,k,q,Q,ie,pe,Te,Be){var st=Array.prototype.slice.call(arguments,3);try{f.apply(k,st)}catch(Ot){this.onError(Ot)}}var zt=!1,Wt=null,_r=!1,kr=null,Lr={onError:function(s){zt=!0,Wt=s}};function Nr(s,f,k,q,Q,ie,pe,Te,Be){zt=!1,Wt=null,Ft.apply(Lr,arguments)}function Wn(s,f,k,q,Q,ie,pe,Te,Be){if(Nr.apply(this,arguments),zt){if(zt){var st=Wt;zt=!1,Wt=null}else throw Error(t(198));_r||(_r=!0,kr=st)}}function en(s){var f=s,k=s;if(s.alternate)for(;f.return;)f=f.return;else{s=f;do f=s,(f.flags&4098)!==0&&(k=f.return),s=f.return;while(s)}return f.tag===3?k:null}function Qn(s){if(s.tag===13){var f=s.memoizedState;if(f===null&&(s=s.alternate,s!==null&&(f=s.memoizedState)),f!==null)return f.dehydrated}return null}function _i(s){if(en(s)!==s)throw Error(t(188))}function Ni(s){var f=s.alternate;if(!f){if(f=en(s),f===null)throw Error(t(188));return f!==s?null:s}for(var k=s,q=f;;){var Q=k.return;if(Q===null)break;var ie=Q.alternate;if(ie===null){if(q=Q.return,q!==null){k=q;continue}break}if(Q.child===ie.child){for(ie=Q.child;ie;){if(ie===k)return _i(Q),s;if(ie===q)return _i(Q),f;ie=ie.sibling}throw Error(t(188))}if(k.return!==q.return)k=Q,q=ie;else{for(var pe=!1,Te=Q.child;Te;){if(Te===k){pe=!0,k=Q,q=ie;break}if(Te===q){pe=!0,q=Q,k=ie;break}Te=Te.sibling}if(!pe){for(Te=ie.child;Te;){if(Te===k){pe=!0,k=ie,q=Q;break}if(Te===q){pe=!0,q=ie,k=Q;break}Te=Te.sibling}if(!pe)throw Error(t(189))}}if(k.alternate!==q)throw Error(t(190))}if(k.tag!==3)throw Error(t(188));return k.stateNode.current===k?s:f}function Si(s){return s=Ni(s),s!==null?fa(s):null}function fa(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var f=fa(s);if(f!==null)return f;s=s.sibling}return null}var ws=r.unstable_scheduleCallback,Go=r.unstable_cancelCallback,tu=r.unstable_shouldYield,vc=r.unstable_requestPaint,Mn=r.unstable_now,Bu=r.unstable_getCurrentPriorityLevel,oo=r.unstable_ImmediatePriority,dl=r.unstable_UserBlockingPriority,Hs=r.unstable_NormalPriority,qu=r.unstable_LowPriority,ru=r.unstable_IdlePriority,so=null,pi=null;function Kr(s){if(pi&&typeof pi.onCommitFiberRoot=="function")try{pi.onCommitFiberRoot(so,s,void 0,(s.current.flags&128)===128)}catch{}}var Ar=Math.clz32?Math.clz32:Ti,ln=Math.log,gi=Math.LN2;function Ti(s){return s>>>=0,s===0?32:31-(ln(s)/gi|0)|0}var Ia=64,ja=4194304;function ii(s){switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function Ri(s,f){var k=s.pendingLanes;if(k===0)return 0;var q=0,Q=s.suspendedLanes,ie=s.pingedLanes,pe=k&268435455;if(pe!==0){var Te=pe&~Q;Te!==0?q=ii(Te):(ie&=pe,ie!==0&&(q=ii(ie)))}else pe=k&~Q,pe!==0?q=ii(pe):ie!==0&&(q=ii(ie));if(q===0)return 0;if(f!==0&&f!==q&&(f&Q)===0&&(Q=q&-q,ie=f&-f,Q>=ie||Q===16&&(ie&4194240)!==0))return f;if((q&4)!==0&&(q|=k&16),f=s.entangledLanes,f!==0)for(s=s.entanglements,f&=q;0<f;)k=31-Ar(f),Q=1<<k,q|=s[k],f&=~Q;return q}function pl(s,f){switch(s){case 1:case 2:case 4:return f+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 f+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(s,f){for(var k=s.suspendedLanes,q=s.pingedLanes,Q=s.expirationTimes,ie=s.pendingLanes;0<ie;){var pe=31-Ar(ie),Te=1<<pe,Be=Q[pe];Be===-1?((Te&k)===0||(Te&q)!==0)&&(Q[pe]=pl(Te,f)):Be<=f&&(s.expiredLanes|=Te),ie&=~Te}}function Wo(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function nu(){var s=Ia;return Ia<<=1,(Ia&4194240)===0&&(Ia=64),s}function da(s){for(var f=[],k=0;31>k;k++)f.push(s);return f}function Vs(s,f,k){s.pendingLanes|=f,f!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,f=31-Ar(f),s[f]=k}function af(s,f){var k=s.pendingLanes&~f;s.pendingLanes=f,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=f,s.mutableReadLanes&=f,s.entangledLanes&=f,f=s.entanglements;var q=s.eventTimes;for(s=s.expirationTimes;0<k;){var Q=31-Ar(k),ie=1<<Q;f[Q]=0,q[Q]=-1,s[Q]=-1,k&=~ie}}function iu(s,f){var k=s.entangledLanes|=f;for(s=s.entanglements;k;){var q=31-Ar(k),Q=1<<q;Q&f|s[q]&f&&(s[q]|=f),k&=~Q}}var Ir=0;function _s(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var Gs,Ws,mc,$o,Ss,xs=!1,Es=[],gn=null,Yo=null,Fa=null,It=new Map,$s=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(s,f){switch(s){case"focusin":case"focusout":gn=null;break;case"dragenter":case"dragleave":Yo=null;break;case"mouseover":case"mouseout":Fa=null;break;case"pointerover":case"pointerout":It.delete(f.pointerId);break;case"gotpointercapture":case"lostpointercapture":$s.delete(f.pointerId)}}function Ys(s,f,k,q,Q,ie){return s===null||s.nativeEvent!==ie?(s={blockedOn:f,domEventName:k,eventSystemFlags:q,nativeEvent:ie,targetContainers:[Q]},f!==null&&(f=vu(f),f!==null&&Ws(f)),s):(s.eventSystemFlags|=q,f=s.targetContainers,Q!==null&&f.indexOf(Q)===-1&&f.push(Q),s)}function In(s,f,k,q,Q){switch(f){case"focusin":return gn=Ys(gn,s,f,k,q,Q),!0;case"dragenter":return Yo=Ys(Yo,s,f,k,q,Q),!0;case"mouseover":return Fa=Ys(Fa,s,f,k,q,Q),!0;case"pointerover":var ie=Q.pointerId;return It.set(ie,Ys(It.get(ie)||null,s,f,k,q,Q)),!0;case"gotpointercapture":return ie=Q.pointerId,$s.set(ie,Ys($s.get(ie)||null,s,f,k,q,Q)),!0}return!1}function Xs(s){var f=Ls(s.target);if(f!==null){var k=en(f);if(k!==null){if(f=k.tag,f===13){if(f=Qn(k),f!==null){s.blockedOn=f,Ss(s.priority,function(){mc(k)});return}}else if(f===3&&k.stateNode.current.memoizedState.isDehydrated){s.blockedOn=k.tag===3?k.stateNode.containerInfo:null;return}}}s.blockedOn=null}function au(s){if(s.blockedOn!==null)return!1;for(var f=s.targetContainers;0<f.length;){var k=gl(s.domEventName,s.eventSystemFlags,f[0],s.nativeEvent);if(k===null){k=s.nativeEvent;var q=new k.constructor(k.type,k);Nt=q,k.target.dispatchEvent(q),Nt=null}else return f=vu(k),f!==null&&Ws(f),s.blockedOn=k,!1;f.shift()}return!0}function ou(s,f,k){au(s)&&k.delete(f)}function of(){xs=!1,gn!==null&&au(gn)&&(gn=null),Yo!==null&&au(Yo)&&(Yo=null),Fa!==null&&au(Fa)&&(Fa=null),It.forEach(ou),$s.forEach(ou)}function uo(s,f){s.blockedOn===f&&(s.blockedOn=null,xs||(xs=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,of)))}function ai(s){function f(Q){return uo(Q,s)}if(0<Es.length){uo(Es[0],s);for(var k=1;k<Es.length;k++){var q=Es[k];q.blockedOn===s&&(q.blockedOn=null)}}for(gn!==null&&uo(gn,s),Yo!==null&&uo(Yo,s),Fa!==null&&uo(Fa,s),It.forEach(f),$s.forEach(f),k=0;k<lo.length;k++)q=lo[k],q.blockedOn===s&&(q.blockedOn=null);for(;0<lo.length&&(k=lo[0],k.blockedOn===null);)Xs(k),k.blockedOn===null&&lo.shift()}var Da=b.ReactCurrentBatchConfig,su=!0;function Mi(s,f,k,q){var Q=Ir,ie=Da.transition;Da.transition=null;try{Ir=1,Ao(s,f,k,q)}finally{Ir=Q,Da.transition=ie}}function Ba(s,f,k,q){var Q=Ir,ie=Da.transition;Da.transition=null;try{Ir=4,Ao(s,f,k,q)}finally{Ir=Q,Da.transition=ie}}function Ao(s,f,k,q){if(su){var Q=gl(s,f,k,q);if(Q===null)du(s,f,q,Ps,k),zu(s,q);else if(In(Q,s,f,k,q))q.stopPropagation();else if(zu(s,q),f&4&&-1<Oo.indexOf(s)){for(;Q!==null;){var ie=vu(Q);if(ie!==null&&Gs(ie),ie=gl(s,f,k,q),ie===null&&du(s,f,q,Ps,k),ie===Q)break;Q=ie}Q!==null&&q.stopPropagation()}else du(s,f,q,null,k)}}var Ps=null;function gl(s,f,k,q){if(Ps=null,s=ht(q),s=Ls(s),s!==null)if(f=en(s),f===null)s=null;else if(k=f.tag,k===13){if(s=Qn(f),s!==null)return s;s=null}else if(k===3){if(f.stateNode.current.memoizedState.isDehydrated)return f.tag===3?f.stateNode.containerInfo:null;s=null}else f!==s&&(s=null);return Ps=s,null}function Uu(s){switch(s){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 Hs:case qu:return 16;case ru:return 536870912;default:return 16}default:return 16}}var oi=null,Ii=null,ji=null;function vl(){if(ji)return ji;var s,f=Ii,k=f.length,q,Q="value"in oi?oi.value:oi.textContent,ie=Q.length;for(s=0;s<k&&f[s]===Q[s];s++);var pe=k-s;for(q=1;q<=pe&&f[k-q]===Q[ie-q];q++);return ji=Q.slice(s,1<q?1-q:void 0)}function xa(s){var f=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&f===13&&(s=13)):s=f,s===10&&(s=13),32<=s||s===13?s:0}function wn(){return!0}function Fi(){return!1}function _n(s){function f(k,q,Q,ie,pe){this._reactName=k,this._targetInst=Q,this.type=q,this.nativeEvent=ie,this.target=pe,this.currentTarget=null;for(var Te in s)s.hasOwnProperty(Te)&&(k=s[Te],this[Te]=k?k(ie):ie[Te]);return this.isDefaultPrevented=(ie.defaultPrevented!=null?ie.defaultPrevented:ie.returnValue===!1)?wn:Fi,this.isPropagationStopped=Fi,this}return V(f.prototype,{preventDefault:function(){this.defaultPrevented=!0;var k=this.nativeEvent;k&&(k.preventDefault?k.preventDefault():typeof k.returnValue!="unknown"&&(k.returnValue=!1),this.isDefaultPrevented=wn)},stopPropagation:function(){var k=this.nativeEvent;k&&(k.stopPropagation?k.stopPropagation():typeof k.cancelBubble!="unknown"&&(k.cancelBubble=!0),this.isPropagationStopped=wn)},persist:function(){},isPersistent:wn}),f}var ea={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ta=_n(ea),qa=V({},ea,{view:0,detail:0}),lu=_n(qa),Os,Ks,$n,vi=V({},qa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dt,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==$n&&($n&&s.type==="mousemove"?(Os=s.screenX-$n.screenX,Ks=s.screenY-$n.screenY):Ks=Os=0,$n=s),Os)},movementY:function(s){return"movementY"in s?s.movementY:Ks}}),tn=_n(vi),Zs=V({},vi,{dataTransfer:0}),za=_n(Zs),ml=V({},qa,{relatedTarget:0}),Xo=_n(ml),yl=V({},ea,{animationName:0,elapsedTime:0,pseudoElement:0}),Ko=_n(yl),uu=V({},ea,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),Y=_n(uu),fe=V({},ea,{data:0}),ke=_n(fe),Ie={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Je={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"},ft={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xt(s){var f=this.nativeEvent;return f.getModifierState?f.getModifierState(s):(s=ft[s])?!!f[s]:!1}function Dt(){return xt}var nr=V({},qa,{key:function(s){if(s.key){var f=Ie[s.key]||s.key;if(f!=="Unidentified")return f}return s.type==="keypress"?(s=xa(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?Je[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dt,charCode:function(s){return s.type==="keypress"?xa(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?xa(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),gr=_n(nr),dr=V({},vi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sr=_n(dr),Cn=V({},qa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dt}),Sn=_n(Cn),jn=V({},ea,{propertyName:0,elapsedTime:0,pseudoElement:0}),Jn=_n(jn),si=V({},vi,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),Ua=_n(si),Ea=[9,13,27,32],Pa=l&&"CompositionEvent"in window,Zo=null;l&&"documentMode"in document&&(Zo=document.documentMode);var Qo=l&&"TextEvent"in window&&!Zo,Di=l&&(!Pa||Zo&&8<Zo&&11>=Zo),Ha=" ",Qs=!1;function bl(s,f){switch(s){case"keyup":return Ea.indexOf(f.keyCode)!==-1;case"keydown":return f.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ra(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var rn=!1;function Js(s,f){switch(s){case"compositionend":return ra(f);case"keypress":return f.which!==32?null:(Qs=!0,Ha);case"textInput":return s=f.data,s===Ha&&Qs?null:s;default:return null}}function wl(s,f){if(rn)return s==="compositionend"||!Pa&&bl(s,f)?(s=vl(),ji=Ii=oi=null,rn=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(f.ctrlKey||f.altKey||f.metaKey)||f.ctrlKey&&f.altKey){if(f.char&&1<f.char.length)return f.char;if(f.which)return String.fromCharCode(f.which)}return null;case"compositionend":return Di&&f.locale!=="ko"?null:f.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 Va(s){var f=s&&s.nodeName&&s.nodeName.toLowerCase();return f==="input"?!!Oa[s.type]:f==="textarea"}function xi(s,f,k,q){_t(q),f=yc(f,"onChange"),0<f.length&&(k=new ta("onChange","change",null,k,q),s.push({event:k,listeners:f}))}var el=null,co=null;function Hu(s){fu(s,0)}function mi(s){var f=ui(s);if(xe(f))return s}function Bi(s,f){if(s==="change")return f}var As=!1;if(l){var Co;if(l){var yi="oninput"in document;if(!yi){var Jo=document.createElement("div");Jo.setAttribute("oninput","return;"),yi=typeof Jo.oninput=="function"}Co=yi}else Co=!1;As=Co&&(!document.documentMode||9<document.documentMode)}function li(){el&&(el.detachEvent("onpropertychange",qi),co=el=null)}function qi(s){if(s.propertyName==="value"&&mi(co)){var f=[];xi(f,co,s,ht(s)),bt(Hu,f)}}function es(s,f,k){s==="focusin"?(li(),el=f,co=k,el.attachEvent("onpropertychange",qi)):s==="focusout"&&li()}function $r(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return mi(co)}function fo(s,f){if(s==="click")return mi(f)}function tl(s,f){if(s==="input"||s==="change")return mi(f)}function ko(s,f){return s===f&&(s!==0||1/s===1/f)||s!==s&&f!==f}var jr=typeof Object.is=="function"?Object.is:ko;function Lo(s,f){if(jr(s,f))return!0;if(typeof s!="object"||s===null||typeof f!="object"||f===null)return!1;var k=Object.keys(s),q=Object.keys(f);if(k.length!==q.length)return!1;for(q=0;q<k.length;q++){var Q=k[q];if(!u.call(f,Q)||!jr(s[Q],f[Q]))return!1}return!0}function Yn(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function Tr(s,f){var k=Yn(s);s=0;for(var q;k;){if(k.nodeType===3){if(q=s+k.textContent.length,s<=f&&q>=f)return{node:k,offset:f-s};s=q}e:{for(;k;){if(k.nextSibling){k=k.nextSibling;break e}k=k.parentNode}k=void 0}k=Yn(k)}}function xn(s,f){return s&&f?s===f?!0:s&&s.nodeType===3?!1:f&&f.nodeType===3?xn(s,f.parentNode):"contains"in s?s.contains(f):s.compareDocumentPosition?!!(s.compareDocumentPosition(f)&16):!1:!1}function Xn(){for(var s=window,f=Oe();f instanceof s.HTMLIFrameElement;){try{var k=typeof f.contentWindow.location.href=="string"}catch{k=!1}if(k)s=f.contentWindow;else break;f=Oe(s.document)}return f}function ts(s){var f=s&&s.nodeName&&s.nodeName.toLowerCase();return f&&(f==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||f==="textarea"||s.contentEditable==="true")}function No(s){var f=Xn(),k=s.focusedElem,q=s.selectionRange;if(f!==k&&k&&k.ownerDocument&&xn(k.ownerDocument.documentElement,k)){if(q!==null&&ts(k)){if(f=q.start,s=q.end,s===void 0&&(s=f),"selectionStart"in k)k.selectionStart=f,k.selectionEnd=Math.min(s,k.value.length);else if(s=(f=k.ownerDocument||document)&&f.defaultView||window,s.getSelection){s=s.getSelection();var Q=k.textContent.length,ie=Math.min(q.start,Q);q=q.end===void 0?ie:Math.min(q.end,Q),!s.extend&&ie>q&&(Q=q,q=ie,ie=Q),Q=Tr(k,ie);var pe=Tr(k,q);Q&&pe&&(s.rangeCount!==1||s.anchorNode!==Q.node||s.anchorOffset!==Q.offset||s.focusNode!==pe.node||s.focusOffset!==pe.offset)&&(f=f.createRange(),f.setStart(Q.node,Q.offset),s.removeAllRanges(),ie>q?(s.addRange(f),s.extend(pe.node,pe.offset)):(f.setEnd(pe.node,pe.offset),s.addRange(f)))}}for(f=[],s=k;s=s.parentNode;)s.nodeType===1&&f.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<f.length;k++)s=f[k],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var To=l&&"documentMode"in document&&11>=document.documentMode,Ga=null,kn=null,ho=null,Ro=!1;function Mo(s,f,k){var q=k.window===k?k.document:k.nodeType===9?k:k.ownerDocument;Ro||Ga==null||Ga!==Oe(q)||(q=Ga,"selectionStart"in q&&ts(q)?q={start:q.selectionStart,end:q.selectionEnd}:(q=(q.ownerDocument&&q.ownerDocument.defaultView||window).getSelection(),q={anchorNode:q.anchorNode,anchorOffset:q.anchorOffset,focusNode:q.focusNode,focusOffset:q.focusOffset}),ho&&Lo(ho,q)||(ho=q,q=yc(kn,"onSelect"),0<q.length&&(f=new ta("onSelect","select",null,f,k),s.push({event:f,listeners:q}),f.target=Ga)))}function zi(s,f){var k={};return k[s.toLowerCase()]=f.toLowerCase(),k["Webkit"+s]="webkit"+f,k["Moz"+s]="moz"+f,k}var un={animationend:zi("Animation","AnimationEnd"),animationiteration:zi("Animation","AnimationIteration"),animationstart:zi("Animation","AnimationStart"),transitionend:zi("Transition","TransitionEnd")},Ei={},nn={};l&&(nn=document.createElement("div").style,"AnimationEvent"in window||(delete un.animationend.animation,delete un.animationiteration.animation,delete un.animationstart.animation),"TransitionEvent"in window||delete un.transitionend.transition);function Yr(s){if(Ei[s])return Ei[s];if(!un[s])return s;var f=un[s],k;for(k in f)if(f.hasOwnProperty(k)&&k in nn)return Ei[s]=f[k];return s}var Fn=Yr("animationend"),ei=Yr("animationiteration"),Io=Yr("animationstart"),_l=Yr("transitionend"),rl=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(s,f){rl.set(s,f),i(f,[s])}for(var Sl=0;Sl<cu.length;Sl++){var bi=cu[Sl],Wa=bi.toLowerCase(),xl=bi[0].toUpperCase()+bi.slice(1);jo(Wa,"on"+xl)}jo(Fn,"onAnimationEnd"),jo(ei,"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(s,f,k){var q=s.type||"unknown-event";s.currentTarget=k,Wn(q,f,void 0,s),s.currentTarget=null}function fu(s,f){f=(f&4)!==0;for(var k=0;k<s.length;k++){var q=s[k],Q=q.event;q=q.listeners;e:{var ie=void 0;if(f)for(var pe=q.length-1;0<=pe;pe--){var Te=q[pe],Be=Te.instance,st=Te.currentTarget;if(Te=Te.listener,Be!==ie&&Q.isPropagationStopped())break e;El(Q,Te,st),ie=Be}else for(pe=0;pe<q.length;pe++){if(Te=q[pe],Be=Te.instance,st=Te.currentTarget,Te=Te.listener,Be!==ie&&Q.isPropagationStopped())break e;El(Q,Te,st),ie=Be}}}if(_r)throw s=kr,_r=!1,kr=null,s}function cn(s,f){var k=f[pa];k===void 0&&(k=f[pa]=new Set);var q=s+"__bubble";k.has(q)||(hu(f,s,2,!1),k.add(q))}function Vu(s,f,k){var q=0;f&&(q|=4),hu(k,s,q,f)}var Pl="_reactListening"+Math.random().toString(36).slice(2);function Cs(s){if(!s[Pl]){s[Pl]=!0,n.forEach(function(k){k!=="selectionchange"&&(sf.has(k)||Vu(k,!1,s),Vu(k,!0,s))});var f=s.nodeType===9?s:s.ownerDocument;f===null||f[Pl]||(f[Pl]=!0,Vu("selectionchange",!1,f))}}function hu(s,f,k,q){switch(Uu(f)){case 1:var Q=Mi;break;case 4:Q=Ba;break;default:Q=Ao}k=Q.bind(null,f,k,s),Q=void 0,!St||f!=="touchstart"&&f!=="touchmove"&&f!=="wheel"||(Q=!0),q?Q!==void 0?s.addEventListener(f,k,{capture:!0,passive:Q}):s.addEventListener(f,k,!0):Q!==void 0?s.addEventListener(f,k,{passive:Q}):s.addEventListener(f,k,!1)}function du(s,f,k,q,Q){var ie=q;if((f&1)===0&&(f&2)===0&&q!==null)e:for(;;){if(q===null)return;var pe=q.tag;if(pe===3||pe===4){var Te=q.stateNode.containerInfo;if(Te===Q||Te.nodeType===8&&Te.parentNode===Q)break;if(pe===4)for(pe=q.return;pe!==null;){var Be=pe.tag;if((Be===3||Be===4)&&(Be=pe.stateNode.containerInfo,Be===Q||Be.nodeType===8&&Be.parentNode===Q))return;pe=pe.return}for(;Te!==null;){if(pe=Ls(Te),pe===null)return;if(Be=pe.tag,Be===5||Be===6){q=ie=pe;continue e}Te=Te.parentNode}}q=q.return}bt(function(){var st=ie,Ot=ht(k),At=[];e:{var Pt=rl.get(s);if(Pt!==void 0){var $t=ta,Jt=s;switch(s){case"keypress":if(xa(k)===0)break e;case"keydown":case"keyup":$t=gr;break;case"focusin":Jt="focus",$t=Xo;break;case"focusout":Jt="blur",$t=Xo;break;case"beforeblur":case"afterblur":$t=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":$t=tn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$t=za;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$t=Sn;break;case Fn:case ei:case Io:$t=Ko;break;case _l:$t=Jn;break;case"scroll":$t=lu;break;case"wheel":$t=Ua;break;case"copy":case"cut":case"paste":$t=Y;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$t=Sr}var ar=(f&4)!==0,Yi=!ar&&s==="scroll",et=ar?Pt!==null?Pt+"Capture":null:Pt;ar=[];for(var $e=st,rt;$e!==null;){rt=$e;var Tt=rt.stateNode;if(rt.tag===5&&Tt!==null&&(rt=Tt,et!==null&&(Tt=Ue($e,et),Tt!=null&&ar.push(pu($e,Tt,rt)))),Yi)break;$e=$e.return}0<ar.length&&(Pt=new $t(Pt,Jt,null,k,Ot),At.push({event:Pt,listeners:ar}))}}if((f&7)===0){e:{if(Pt=s==="mouseover"||s==="pointerover",$t=s==="mouseout"||s==="pointerout",Pt&&k!==Nt&&(Jt=k.relatedTarget||k.fromElement)&&(Ls(Jt)||Jt[Vi]))break e;if(($t||Pt)&&(Pt=Ot.window===Ot?Ot:(Pt=Ot.ownerDocument)?Pt.defaultView||Pt.parentWindow:window,$t?(Jt=k.relatedTarget||k.toElement,$t=st,Jt=Jt?Ls(Jt):null,Jt!==null&&(Yi=en(Jt),Jt!==Yi||Jt.tag!==5&&Jt.tag!==6)&&(Jt=null)):($t=null,Jt=st),$t!==Jt)){if(ar=tn,Tt="onMouseLeave",et="onMouseEnter",$e="mouse",(s==="pointerout"||s==="pointerover")&&(ar=Sr,Tt="onPointerLeave",et="onPointerEnter",$e="pointer"),Yi=$t==null?Pt:ui($t),rt=Jt==null?Pt:ui(Jt),Pt=new ar(Tt,$e+"leave",$t,k,Ot),Pt.target=Yi,Pt.relatedTarget=rt,Tt=null,Ls(Ot)===st&&(ar=new ar(et,$e+"enter",Jt,k,Ot),ar.target=rt,ar.relatedTarget=Yi,Tt=ar),Yi=Tt,$t&&Jt)t:{for(ar=$t,et=Jt,$e=0,rt=ar;rt;rt=nl(rt))$e++;for(rt=0,Tt=et;Tt;Tt=nl(Tt))rt++;for(;0<$e-rt;)ar=nl(ar),$e--;for(;0<rt-$e;)et=nl(et),rt--;for(;$e--;){if(ar===et||et!==null&&ar===et.alternate)break t;ar=nl(ar),et=nl(et)}ar=null}else ar=null;$t!==null&&qf(At,Pt,$t,ar,!1),Jt!==null&&Yi!==null&&qf(At,Yi,Jt,ar,!0)}}e:{if(Pt=st?ui(st):window,$t=Pt.nodeName&&Pt.nodeName.toLowerCase(),$t==="select"||$t==="input"&&Pt.type==="file")var sr=Bi;else if(Va(Pt))if(As)sr=tl;else{sr=$r;var cr=es}else($t=Pt.nodeName)&&$t.toLowerCase()==="input"&&(Pt.type==="checkbox"||Pt.type==="radio")&&(sr=fo);if(sr&&(sr=sr(s,st))){xi(At,sr,k,Ot);break e}cr&&cr(s,Pt,st),s==="focusout"&&(cr=Pt._wrapperState)&&cr.controlled&&Pt.type==="number"&&Ae(Pt,"number",Pt.value)}switch(cr=st?ui(st):window,s){case"focusin":(Va(cr)||cr.contentEditable==="true")&&(Ga=cr,kn=st,ho=null);break;case"focusout":ho=kn=Ga=null;break;case"mousedown":Ro=!0;break;case"contextmenu":case"mouseup":case"dragend":Ro=!1,Mo(At,k,Ot);break;case"selectionchange":if(To)break;case"keydown":case"keyup":Mo(At,k,Ot)}var fr;if(Pa)e:{switch(s){case"compositionstart":var mr="onCompositionStart";break e;case"compositionend":mr="onCompositionEnd";break e;case"compositionupdate":mr="onCompositionUpdate";break e}mr=void 0}else rn?bl(s,k)&&(mr="onCompositionEnd"):s==="keydown"&&k.keyCode===229&&(mr="onCompositionStart");mr&&(Di&&k.locale!=="ko"&&(rn||mr!=="onCompositionStart"?mr==="onCompositionEnd"&&rn&&(fr=vl()):(oi=Ot,Ii="value"in oi?oi.value:oi.textContent,rn=!0)),cr=yc(st,mr),0<cr.length&&(mr=new ke(mr,s,null,k,Ot),At.push({event:mr,listeners:cr}),fr?mr.data=fr:(fr=ra(k),fr!==null&&(mr.data=fr)))),(fr=Qo?Js(s,k):wl(s,k))&&(st=yc(st,"onBeforeInput"),0<st.length&&(Ot=new ke("onBeforeInput","beforeinput",null,k,Ot),At.push({event:Ot,listeners:st}),Ot.data=fr))}fu(At,f)})}function pu(s,f,k){return{instance:s,listener:f,currentTarget:k}}function yc(s,f){for(var k=f+"Capture",q=[];s!==null;){var Q=s,ie=Q.stateNode;Q.tag===5&&ie!==null&&(Q=ie,ie=Ue(s,k),ie!=null&&q.unshift(pu(s,ie,Q)),ie=Ue(s,f),ie!=null&&q.push(pu(s,ie,Q))),s=s.return}return q}function nl(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function qf(s,f,k,q,Q){for(var ie=f._reactName,pe=[];k!==null&&k!==q;){var Te=k,Be=Te.alternate,st=Te.stateNode;if(Be!==null&&Be===q)break;Te.tag===5&&st!==null&&(Te=st,Q?(Be=Ue(k,ie),Be!=null&&pe.unshift(pu(k,Be,Te))):Q||(Be=Ue(k,ie),Be!=null&&pe.push(pu(k,Be,Te)))),k=k.return}pe.length!==0&&s.push({event:f,listeners:pe})}var Bh=/\r\n?/g,zf=/\u0000|\uFFFD/g;function lf(s){return(typeof s=="string"?s:""+s).replace(Bh,`
|
|
30
|
-
`).replace(zf,"")}function Gu(s,f,k){if(f=lf(f),lf(s)!==f&&k)throw Error(t(425))}function ks(){}var Wu=null,Ol=null;function uf(s,f){return s==="textarea"||s==="noscript"||typeof f.children=="string"||typeof f.children=="number"||typeof f.dangerouslySetInnerHTML=="object"&&f.dangerouslySetInnerHTML!==null&&f.dangerouslySetInnerHTML.__html!=null}var $a=typeof setTimeout=="function"?setTimeout:void 0,bc=typeof clearTimeout=="function"?clearTimeout:void 0,$u=typeof Promise=="function"?Promise:void 0,Uf=typeof queueMicrotask=="function"?queueMicrotask:typeof $u<"u"?function(s){return $u.resolve(null).then(s).catch(Hf)}:$a;function Hf(s){setTimeout(function(){throw s})}function wc(s,f){var k=f,q=0;do{var Q=k.nextSibling;if(s.removeChild(k),Q&&Q.nodeType===8)if(k=Q.data,k==="/$"){if(q===0){s.removeChild(Q),ai(f);return}q--}else k!=="$"&&k!=="$?"&&k!=="$!"||q++;k=Q}while(k);ai(f)}function Ui(s){for(;s!=null;s=s.nextSibling){var f=s.nodeType;if(f===1||f===3)break;if(f===8){if(f=s.data,f==="$"||f==="$!"||f==="$?")break;if(f==="/$")return null}}return s}function Hi(s){s=s.previousSibling;for(var f=0;s;){if(s.nodeType===8){var k=s.data;if(k==="$"||k==="$!"||k==="$?"){if(f===0)return s;f--}else k==="/$"&&f++}s=s.previousSibling}return null}var na=Math.random().toString(36).slice(2),po="__reactFiber$"+na,gu="__reactProps$"+na,Vi="__reactContainer$"+na,pa="__reactEvents$"+na,Vf="__reactListeners$"+na,Gf="__reactHandles$"+na;function Ls(s){var f=s[po];if(f)return f;for(var k=s.parentNode;k;){if(f=k[Vi]||k[po]){if(k=f.alternate,f.child!==null||k!==null&&k.child!==null)for(s=Hi(s);s!==null;){if(k=s[po])return k;s=Hi(s)}return f}s=k,k=s.parentNode}return null}function vu(s){return s=s[po]||s[Vi],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function ui(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(t(33))}function wi(s){return s[gu]||null}var _c=[],rs=-1;function go(s){return{current:s}}function Zr(s){0>rs||(s.current=_c[rs],_c[rs]=null,rs--)}function an(s,f){rs++,_c[rs]=s.current,s.current=f}var ns={},Pi=go(ns),ia=go(!1),il=ns;function Al(s,f){var k=s.type.contextTypes;if(!k)return ns;var q=s.stateNode;if(q&&q.__reactInternalMemoizedUnmaskedChildContext===f)return q.__reactInternalMemoizedMaskedChildContext;var Q={},ie;for(ie in k)Q[ie]=f[ie];return q&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=f,s.__reactInternalMemoizedMaskedChildContext=Q),Q}function aa(s){return s=s.childContextTypes,s!=null}function mu(){Zr(ia),Zr(Pi)}function cf(s,f,k){if(Pi.current!==ns)throw Error(t(168));an(Pi,f),an(ia,k)}function Yu(s,f,k){var q=s.stateNode;if(f=f.childContextTypes,typeof q.getChildContext!="function")return k;q=q.getChildContext();for(var Q in q)if(!(Q in f))throw Error(t(108,ee(s)||"Unknown",Q));return V({},k,q)}function is(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||ns,il=Pi.current,an(Pi,s),an(ia,ia.current),!0}function Wf(s,f,k){var q=s.stateNode;if(!q)throw Error(t(169));k?(s=Yu(s,f,il),q.__reactInternalMemoizedMergedChildContext=s,Zr(ia),Zr(Pi),an(Pi,s)):Zr(ia),an(ia,k)}var as=null,Cl=!1,R=!1;function U(s){as===null?as=[s]:as.push(s)}function te(s){Cl=!0,U(s)}function oe(){if(!R&&as!==null){R=!0;var s=0,f=Ir;try{var k=as;for(Ir=1;s<k.length;s++){var q=k[s];do q=q(!0);while(q!==null)}as=null,Cl=!1}catch(Q){throw as!==null&&(as=as.slice(s+1)),ws(oo,oe),Q}finally{Ir=f,R=!1}}return null}var ue=[],de=0,ge=null,ye=0,be=[],Pe=0,je=null,Qe=1,Xe="";function Ye(s,f){ue[de++]=ye,ue[de++]=ge,ge=s,ye=f}function yt(s,f,k){be[Pe++]=Qe,be[Pe++]=Xe,be[Pe++]=je,je=s;var q=Qe;s=Xe;var Q=32-Ar(q)-1;q&=~(1<<Q),k+=1;var ie=32-Ar(f)+Q;if(30<ie){var pe=Q-Q%5;ie=(q&(1<<pe)-1).toString(32),q>>=pe,Q-=pe,Qe=1<<32-Ar(f)+Q|k<<Q|q,Xe=ie+s}else Qe=1<<ie|k<<Q|q,Xe=s}function lt(s){s.return!==null&&(Ye(s,1),yt(s,1,0))}function Me(s){for(;s===ge;)ge=ue[--de],ue[de]=null,ye=ue[--de],ue[de]=null;for(;s===je;)je=be[--Pe],be[Pe]=null,Xe=be[--Pe],be[Pe]=null,Qe=be[--Pe],be[Pe]=null}var ze=null,Ge=null,ct=!1,pt=null;function Ut(s,f){var k=ll(5,null,null,0);k.elementType="DELETED",k.stateNode=f,k.return=s,f=s.deletions,f===null?(s.deletions=[k],s.flags|=16):f.push(k)}function jt(s,f){switch(s.tag){case 5:var k=s.type;return f=f.nodeType!==1||k.toLowerCase()!==f.nodeName.toLowerCase()?null:f,f!==null?(s.stateNode=f,ze=s,Ge=Ui(f.firstChild),!0):!1;case 6:return f=s.pendingProps===""||f.nodeType!==3?null:f,f!==null?(s.stateNode=f,ze=s,Ge=null,!0):!1;case 13:return f=f.nodeType!==8?null:f,f!==null?(k=je!==null?{id:Qe,overflow:Xe}:null,s.memoizedState={dehydrated:f,treeContext:k,retryLane:1073741824},k=ll(18,null,null,0),k.stateNode=f,k.return=s,s.child=k,ze=s,Ge=null,!0):!1;default:return!1}}function ir(s){return(s.mode&1)!==0&&(s.flags&128)===0}function Mt(s){if(ct){var f=Ge;if(f){var k=f;if(!jt(s,f)){if(ir(s))throw Error(t(418));f=Ui(k.nextSibling);var q=ze;f&&jt(s,f)?Ut(q,k):(s.flags=s.flags&-4097|2,ct=!1,ze=s)}}else{if(ir(s))throw Error(t(418));s.flags=s.flags&-4097|2,ct=!1,ze=s}}}function Fr(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;ze=s}function qr(s){if(s!==ze)return!1;if(!ct)return Fr(s),ct=!0,!1;var f;if((f=s.tag!==3)&&!(f=s.tag!==5)&&(f=s.type,f=f!=="head"&&f!=="body"&&!uf(s.type,s.memoizedProps)),f&&(f=Ge)){if(ir(s))throw Rr(),Error(t(418));for(;f;)Ut(s,f),f=Ui(f.nextSibling)}if(Fr(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(t(317));e:{for(s=s.nextSibling,f=0;s;){if(s.nodeType===8){var k=s.data;if(k==="/$"){if(f===0){Ge=Ui(s.nextSibling);break e}f--}else k!=="$"&&k!=="$!"&&k!=="$?"||f++}s=s.nextSibling}Ge=null}}else Ge=ze?Ui(s.stateNode.nextSibling):null;return!0}function Rr(){for(var s=Ge;s;)s=Ui(s.nextSibling)}function yr(){Ge=ze=null,ct=!1}function Xr(s){pt===null?pt=[s]:pt.push(s)}var Qr=b.ReactCurrentBatchConfig;function Zt(s,f,k){if(s=k.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(k._owner){if(k=k._owner,k){if(k.tag!==1)throw Error(t(309));var q=k.stateNode}if(!q)throw Error(t(147,s));var Q=q,ie=""+s;return f!==null&&f.ref!==null&&typeof f.ref=="function"&&f.ref._stringRef===ie?f.ref:(f=function(pe){var Te=Q.refs;pe===null?delete Te[ie]:Te[ie]=pe},f._stringRef=ie,f)}if(typeof s!="string")throw Error(t(284));if(!k._owner)throw Error(t(290,s))}return s}function zr(s,f){throw s=Object.prototype.toString.call(f),Error(t(31,s==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":s))}function Ln(s){var f=s._init;return f(s._payload)}function Dn(s){function f(et,$e){if(s){var rt=et.deletions;rt===null?(et.deletions=[$e],et.flags|=16):rt.push($e)}}function k(et,$e){if(!s)return null;for(;$e!==null;)f(et,$e),$e=$e.sibling;return null}function q(et,$e){for(et=new Map;$e!==null;)$e.key!==null?et.set($e.key,$e):et.set($e.index,$e),$e=$e.sibling;return et}function Q(et,$e){return et=Ic(et,$e),et.index=0,et.sibling=null,et}function ie(et,$e,rt){return et.index=rt,s?(rt=et.alternate,rt!==null?(rt=rt.index,rt<$e?(et.flags|=2,$e):rt):(et.flags|=2,$e)):(et.flags|=1048576,$e)}function pe(et){return s&&et.alternate===null&&(et.flags|=2),et}function Te(et,$e,rt,Tt){return $e===null||$e.tag!==6?($e=R0(rt,et.mode,Tt),$e.return=et,$e):($e=Q($e,rt),$e.return=et,$e)}function Be(et,$e,rt,Tt){var sr=rt.type;return sr===T?Ot(et,$e,rt.props.children,Tt,rt.key):$e!==null&&($e.elementType===sr||typeof sr=="object"&&sr!==null&&sr.$$typeof===W&&Ln(sr)===$e.type)?(Tt=Q($e,rt.props),Tt.ref=Zt(et,$e,rt),Tt.return=et,Tt):(Tt=Yp(rt.type,rt.key,rt.props,null,et.mode,Tt),Tt.ref=Zt(et,$e,rt),Tt.return=et,Tt)}function st(et,$e,rt,Tt){return $e===null||$e.tag!==4||$e.stateNode.containerInfo!==rt.containerInfo||$e.stateNode.implementation!==rt.implementation?($e=M0(rt,et.mode,Tt),$e.return=et,$e):($e=Q($e,rt.children||[]),$e.return=et,$e)}function Ot(et,$e,rt,Tt,sr){return $e===null||$e.tag!==7?($e=mf(rt,et.mode,Tt,sr),$e.return=et,$e):($e=Q($e,rt),$e.return=et,$e)}function At(et,$e,rt){if(typeof $e=="string"&&$e!==""||typeof $e=="number")return $e=R0(""+$e,et.mode,rt),$e.return=et,$e;if(typeof $e=="object"&&$e!==null){switch($e.$$typeof){case O:return rt=Yp($e.type,$e.key,$e.props,null,et.mode,rt),rt.ref=Zt(et,null,$e),rt.return=et,rt;case j:return $e=M0($e,et.mode,rt),$e.return=et,$e;case W:var Tt=$e._init;return At(et,Tt($e._payload),rt)}if(Ee($e)||J($e))return $e=mf($e,et.mode,rt,null),$e.return=et,$e;zr(et,$e)}return null}function Pt(et,$e,rt,Tt){var sr=$e!==null?$e.key:null;if(typeof rt=="string"&&rt!==""||typeof rt=="number")return sr!==null?null:Te(et,$e,""+rt,Tt);if(typeof rt=="object"&&rt!==null){switch(rt.$$typeof){case O:return rt.key===sr?Be(et,$e,rt,Tt):null;case j:return rt.key===sr?st(et,$e,rt,Tt):null;case W:return sr=rt._init,Pt(et,$e,sr(rt._payload),Tt)}if(Ee(rt)||J(rt))return sr!==null?null:Ot(et,$e,rt,Tt,null);zr(et,rt)}return null}function $t(et,$e,rt,Tt,sr){if(typeof Tt=="string"&&Tt!==""||typeof Tt=="number")return et=et.get(rt)||null,Te($e,et,""+Tt,sr);if(typeof Tt=="object"&&Tt!==null){switch(Tt.$$typeof){case O:return et=et.get(Tt.key===null?rt:Tt.key)||null,Be($e,et,Tt,sr);case j:return et=et.get(Tt.key===null?rt:Tt.key)||null,st($e,et,Tt,sr);case W:var cr=Tt._init;return $t(et,$e,rt,cr(Tt._payload),sr)}if(Ee(Tt)||J(Tt))return et=et.get(rt)||null,Ot($e,et,Tt,sr,null);zr($e,Tt)}return null}function Jt(et,$e,rt,Tt){for(var sr=null,cr=null,fr=$e,mr=$e=0,Na=null;fr!==null&&mr<rt.length;mr++){fr.index>mr?(Na=fr,fr=null):Na=fr.sibling;var dn=Pt(et,fr,rt[mr],Tt);if(dn===null){fr===null&&(fr=Na);break}s&&fr&&dn.alternate===null&&f(et,fr),$e=ie(dn,$e,mr),cr===null?sr=dn:cr.sibling=dn,cr=dn,fr=Na}if(mr===rt.length)return k(et,fr),ct&&Ye(et,mr),sr;if(fr===null){for(;mr<rt.length;mr++)fr=At(et,rt[mr],Tt),fr!==null&&($e=ie(fr,$e,mr),cr===null?sr=fr:cr.sibling=fr,cr=fr);return ct&&Ye(et,mr),sr}for(fr=q(et,fr);mr<rt.length;mr++)Na=$t(fr,et,mr,rt[mr],Tt),Na!==null&&(s&&Na.alternate!==null&&fr.delete(Na.key===null?mr:Na.key),$e=ie(Na,$e,mr),cr===null?sr=Na:cr.sibling=Na,cr=Na);return s&&fr.forEach(function(jc){return f(et,jc)}),ct&&Ye(et,mr),sr}function ar(et,$e,rt,Tt){var sr=J(rt);if(typeof sr!="function")throw Error(t(150));if(rt=sr.call(rt),rt==null)throw Error(t(151));for(var cr=sr=null,fr=$e,mr=$e=0,Na=null,dn=rt.next();fr!==null&&!dn.done;mr++,dn=rt.next()){fr.index>mr?(Na=fr,fr=null):Na=fr.sibling;var jc=Pt(et,fr,dn.value,Tt);if(jc===null){fr===null&&(fr=Na);break}s&&fr&&jc.alternate===null&&f(et,fr),$e=ie(jc,$e,mr),cr===null?sr=jc:cr.sibling=jc,cr=jc,fr=Na}if(dn.done)return k(et,fr),ct&&Ye(et,mr),sr;if(fr===null){for(;!dn.done;mr++,dn=rt.next())dn=At(et,dn.value,Tt),dn!==null&&($e=ie(dn,$e,mr),cr===null?sr=dn:cr.sibling=dn,cr=dn);return ct&&Ye(et,mr),sr}for(fr=q(et,fr);!dn.done;mr++,dn=rt.next())dn=$t(fr,et,mr,dn.value,Tt),dn!==null&&(s&&dn.alternate!==null&&fr.delete(dn.key===null?mr:dn.key),$e=ie(dn,$e,mr),cr===null?sr=dn:cr.sibling=dn,cr=dn);return s&&fr.forEach(function(Q_){return f(et,Q_)}),ct&&Ye(et,mr),sr}function Yi(et,$e,rt,Tt){if(typeof rt=="object"&&rt!==null&&rt.type===T&&rt.key===null&&(rt=rt.props.children),typeof rt=="object"&&rt!==null){switch(rt.$$typeof){case O:e:{for(var sr=rt.key,cr=$e;cr!==null;){if(cr.key===sr){if(sr=rt.type,sr===T){if(cr.tag===7){k(et,cr.sibling),$e=Q(cr,rt.props.children),$e.return=et,et=$e;break e}}else if(cr.elementType===sr||typeof sr=="object"&&sr!==null&&sr.$$typeof===W&&Ln(sr)===cr.type){k(et,cr.sibling),$e=Q(cr,rt.props),$e.ref=Zt(et,cr,rt),$e.return=et,et=$e;break e}k(et,cr);break}else f(et,cr);cr=cr.sibling}rt.type===T?($e=mf(rt.props.children,et.mode,Tt,rt.key),$e.return=et,et=$e):(Tt=Yp(rt.type,rt.key,rt.props,null,et.mode,Tt),Tt.ref=Zt(et,$e,rt),Tt.return=et,et=Tt)}return pe(et);case j:e:{for(cr=rt.key;$e!==null;){if($e.key===cr)if($e.tag===4&&$e.stateNode.containerInfo===rt.containerInfo&&$e.stateNode.implementation===rt.implementation){k(et,$e.sibling),$e=Q($e,rt.children||[]),$e.return=et,et=$e;break e}else{k(et,$e);break}else f(et,$e);$e=$e.sibling}$e=M0(rt,et.mode,Tt),$e.return=et,et=$e}return pe(et);case W:return cr=rt._init,Yi(et,$e,cr(rt._payload),Tt)}if(Ee(rt))return Jt(et,$e,rt,Tt);if(J(rt))return ar(et,$e,rt,Tt);zr(et,rt)}return typeof rt=="string"&&rt!==""||typeof rt=="number"?(rt=""+rt,$e!==null&&$e.tag===6?(k(et,$e.sibling),$e=Q($e,rt),$e.return=et,et=$e):(k(et,$e),$e=R0(rt,et.mode,Tt),$e.return=et,et=$e),pe(et)):k(et,$e)}return Yi}var ci=Dn(!0),xr=Dn(!1),Gi=go(null),En=null,Bn=null,fi=null;function Oi(){fi=Bn=En=null}function ga(s){var f=Gi.current;Zr(Gi),s._currentValue=f}function Ya(s,f,k){for(;s!==null;){var q=s.alternate;if((s.childLanes&f)!==f?(s.childLanes|=f,q!==null&&(q.childLanes|=f)):q!==null&&(q.childLanes&f)!==f&&(q.childLanes|=f),s===k)break;s=s.return}}function yn(s,f){En=s,fi=Bn=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&f)!==0&&(le=!0),s.firstContext=null)}function qn(s){var f=s._currentValue;if(fi!==s)if(s={context:s,memoizedValue:f,next:null},Bn===null){if(En===null)throw Error(t(308));Bn=s,En.dependencies={lanes:0,firstContext:s}}else Bn=Bn.next=s;return f}var oa=null;function Do(s){oa===null?oa=[s]:oa.push(s)}function vo(s,f,k,q){var Q=f.interleaved;return Q===null?(k.next=k,Do(f)):(k.next=Q.next,Q.next=k),f.interleaved=k,Dr(s,q)}function Dr(s,f){s.lanes|=f;var k=s.alternate;for(k!==null&&(k.lanes|=f),k=s,s=s.return;s!==null;)s.childLanes|=f,k=s.alternate,k!==null&&(k.childLanes|=f),k=s,s=s.return;return k.tag===3?k.stateNode:null}var mo=!1;function yu(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xu(s,f){s=s.updateQueue,f.updateQueue===s&&(f.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function Xa(s,f){return{eventTime:s,lane:f,tag:0,payload:null,callback:null,next:null}}function Aa(s,f,k){var q=s.updateQueue;if(q===null)return null;if(q=q.shared,(sn&2)!==0){var Q=q.pending;return Q===null?f.next=f:(f.next=Q.next,Q.next=f),q.pending=f,Dr(s,k)}return Q=q.interleaved,Q===null?(f.next=f,Do(q)):(f.next=Q.next,Q.next=f),q.interleaved=f,Dr(s,k)}function kl(s,f,k){if(f=f.updateQueue,f!==null&&(f=f.shared,(k&4194240)!==0)){var q=f.lanes;q&=s.pendingLanes,k|=q,f.lanes=k,iu(s,k)}}function va(s,f){var k=s.updateQueue,q=s.alternate;if(q!==null&&(q=q.updateQueue,k===q)){var Q=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?Q=ie=pe:ie=ie.next=pe,k=k.next}while(k!==null);ie===null?Q=ie=f:ie=ie.next=f}else Q=ie=f;k={baseState:q.baseState,firstBaseUpdate:Q,lastBaseUpdate:ie,shared:q.shared,effects:q.effects},s.updateQueue=k;return}s=k.lastBaseUpdate,s===null?k.firstBaseUpdate=f:s.next=f,k.lastBaseUpdate=f}function Bo(s,f,k,q){var Q=s.updateQueue;mo=!1;var ie=Q.firstBaseUpdate,pe=Q.lastBaseUpdate,Te=Q.shared.pending;if(Te!==null){Q.shared.pending=null;var Be=Te,st=Be.next;Be.next=null,pe===null?ie=st:pe.next=st,pe=Be;var Ot=s.alternate;Ot!==null&&(Ot=Ot.updateQueue,Te=Ot.lastBaseUpdate,Te!==pe&&(Te===null?Ot.firstBaseUpdate=st:Te.next=st,Ot.lastBaseUpdate=Be))}if(ie!==null){var At=Q.baseState;pe=0,Ot=st=Be=null,Te=ie;do{var Pt=Te.lane,$t=Te.eventTime;if((q&Pt)===Pt){Ot!==null&&(Ot=Ot.next={eventTime:$t,lane:0,tag:Te.tag,payload:Te.payload,callback:Te.callback,next:null});e:{var Jt=s,ar=Te;switch(Pt=f,$t=k,ar.tag){case 1:if(Jt=ar.payload,typeof Jt=="function"){At=Jt.call($t,At,Pt);break e}At=Jt;break e;case 3:Jt.flags=Jt.flags&-65537|128;case 0:if(Jt=ar.payload,Pt=typeof Jt=="function"?Jt.call($t,At,Pt):Jt,Pt==null)break e;At=V({},At,Pt);break e;case 2:mo=!0}}Te.callback!==null&&Te.lane!==0&&(s.flags|=64,Pt=Q.effects,Pt===null?Q.effects=[Te]:Pt.push(Te))}else $t={eventTime:$t,lane:Pt,tag:Te.tag,payload:Te.payload,callback:Te.callback,next:null},Ot===null?(st=Ot=$t,Be=At):Ot=Ot.next=$t,pe|=Pt;if(Te=Te.next,Te===null){if(Te=Q.shared.pending,Te===null)break;Pt=Te,Te=Pt.next,Pt.next=null,Q.lastBaseUpdate=Pt,Q.shared.pending=null}}while(!0);if(Ot===null&&(Be=At),Q.baseState=Be,Q.firstBaseUpdate=st,Q.lastBaseUpdate=Ot,f=Q.shared.interleaved,f!==null){Q=f;do pe|=Q.lane,Q=Q.next;while(Q!==f)}else ie===null&&(Q.shared.lanes=0);df|=pe,s.lanes=pe,s.memoizedState=At}}function vn(s,f,k){if(s=f.effects,f.effects=null,s!==null)for(f=0;f<s.length;f++){var q=s[f],Q=q.callback;if(Q!==null){if(q.callback=null,q=k,typeof Q!="function")throw Error(t(191,Q));Q.call(q)}}}var vr={},Jr=go(vr),Pn=go(vr),Nn=go(vr);function ti(s){if(s===vr)throw Error(t(174));return s}function qo(s,f){switch(an(Nn,f),an(Pn,s),an(Jr,vr),s=f.nodeType,s){case 9:case 11:f=(f=f.documentElement)?f.namespaceURI:vt(null,"");break;default:s=s===8?f.parentNode:f,f=s.namespaceURI||null,s=s.tagName,f=vt(f,s)}Zr(Jr),an(Jr,f)}function fn(){Zr(Jr),Zr(Pn),Zr(Nn)}function bu(s){ti(Nn.current);var f=ti(Jr.current),k=vt(f,s.type);f!==k&&(an(Pn,s),an(Jr,k))}function Ns(s){Pn.current===s&&(Zr(Jr),Zr(Pn))}var hn=go(0);function Ka(s){for(var f=s;f!==null;){if(f.tag===13){var k=f.memoizedState;if(k!==null&&(k=k.dehydrated,k===null||k.data==="$?"||k.data==="$!"))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if((f.flags&128)!==0)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===s)break;for(;f.sibling===null;){if(f.return===null||f.return===s)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var Ll=[];function sa(){for(var s=0;s<Ll.length;s++)Ll[s]._workInProgressVersionPrimary=null;Ll.length=0}var wu=b.ReactCurrentDispatcher,_u=b.ReactCurrentBatchConfig,Ai=0,on=null,zn=null,Un=null,Za=!1,yo=!1,Qa=0,Sc=0;function Hn(){throw Error(t(321))}function Su(s,f){if(f===null)return!1;for(var k=0;k<f.length&&k<s.length;k++)if(!jr(s[k],f[k]))return!1;return!0}function al(s,f,k,q,Q,ie){if(Ai=ie,on=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,wu.current=s===null||s.memoizedState===null?p0:Eu,s=k(q,Q),yo){ie=0;do{if(yo=!1,Qa=0,25<=ie)throw Error(t(301));ie+=1,Un=zn=null,f.updateQueue=null,wu.current=Yf,s=k(q,Q)}while(yo)}if(wu.current=Oc,f=zn!==null&&zn.next!==null,Ai=0,Un=zn=on=null,Za=!1,f)throw Error(t(300));return s}function Ja(){var s=Qa!==0;return Qa=0,s}function bn(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Un===null?on.memoizedState=Un=s:Un=Un.next=s,Un}function hi(){if(zn===null){var s=on.alternate;s=s!==null?s.memoizedState:null}else s=zn.next;var f=Un===null?on.memoizedState:Un.next;if(f!==null)Un=f,zn=s;else{if(s===null)throw Error(t(310));zn=s,s={memoizedState:zn.memoizedState,baseState:zn.baseState,baseQueue:zn.baseQueue,queue:zn.queue,next:null},Un===null?on.memoizedState=Un=s:Un=Un.next=s}return Un}function la(s,f){return typeof f=="function"?f(s):f}function Wi(s){var f=hi(),k=f.queue;if(k===null)throw Error(t(311));k.lastRenderedReducer=s;var q=zn,Q=q.baseQueue,ie=k.pending;if(ie!==null){if(Q!==null){var pe=Q.next;Q.next=ie.next,ie.next=pe}q.baseQueue=Q=ie,k.pending=null}if(Q!==null){ie=Q.next,q=q.baseState;var Te=pe=null,Be=null,st=ie;do{var Ot=st.lane;if((Ai&Ot)===Ot)Be!==null&&(Be=Be.next={lane:0,action:st.action,hasEagerState:st.hasEagerState,eagerState:st.eagerState,next:null}),q=st.hasEagerState?st.eagerState:s(q,st.action);else{var At={lane:Ot,action:st.action,hasEagerState:st.hasEagerState,eagerState:st.eagerState,next:null};Be===null?(Te=Be=At,pe=q):Be=Be.next=At,on.lanes|=Ot,df|=Ot}st=st.next}while(st!==null&&st!==ie);Be===null?pe=q:Be.next=Te,jr(q,f.memoizedState)||(le=!0),f.memoizedState=q,f.baseState=pe,f.baseQueue=Be,k.lastRenderedState=q}if(s=k.interleaved,s!==null){Q=s;do ie=Q.lane,on.lanes|=ie,df|=ie,Q=Q.next;while(Q!==s)}else Q===null&&(k.lanes=0);return[f.memoizedState,k.dispatch]}function Ts(s){var f=hi(),k=f.queue;if(k===null)throw Error(t(311));k.lastRenderedReducer=s;var q=k.dispatch,Q=k.pending,ie=f.memoizedState;if(Q!==null){k.pending=null;var pe=Q=Q.next;do ie=s(ie,pe.action),pe=pe.next;while(pe!==Q);jr(ie,f.memoizedState)||(le=!0),f.memoizedState=ie,f.baseQueue===null&&(f.baseState=ie),k.lastRenderedState=ie}return[ie,q]}function xc(){}function Ku(s,f){var k=on,q=hi(),Q=f(),ie=!jr(q.memoizedState,Q);if(ie&&(q.memoizedState=Q,le=!0),q=q.queue,Pc(ff.bind(null,k,q,s),[s]),q.getSnapshot!==f||ie||Un!==null&&Un.memoizedState.tag&1){if(k.flags|=2048,Ca(9,os.bind(null,k,q,Q,f),void 0,null),La===null)throw Error(t(349));(Ai&30)!==0||$f(k,f,Q)}return Q}function $f(s,f,k){s.flags|=16384,s={getSnapshot:f,value:k},f=on.updateQueue,f===null?(f={lastEffect:null,stores:null},on.updateQueue=f,f.stores=[s]):(k=f.stores,k===null?f.stores=[s]:k.push(s))}function os(s,f,k,q){f.value=k,f.getSnapshot=q,Nl(f)&&xu(s)}function ff(s,f,k){return k(function(){Nl(f)&&xu(s)})}function Nl(s){var f=s.getSnapshot;s=s.value;try{var k=f();return!jr(s,k)}catch{return!0}}function xu(s){var f=Dr(s,1);f!==null&&Il(f,s,1,-1)}function zo(s){var f=bn();return typeof s=="function"&&(s=s()),f.memoizedState=f.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:s},f.queue=s,s=s.dispatch=Mp.bind(null,on,s),[f.memoizedState,s]}function Ca(s,f,k,q){return s={tag:s,create:f,destroy:k,deps:q,next:null},f=on.updateQueue,f===null?(f={lastEffect:null,stores:null},on.updateQueue=f,f.lastEffect=s.next=s):(k=f.lastEffect,k===null?f.lastEffect=s.next=s:(q=k.next,k.next=s,s.next=q,f.lastEffect=s)),s}function ss(){return hi().memoizedState}function eo(s,f,k,q){var Q=bn();on.flags|=s,Q.memoizedState=Ca(1|f,k,void 0,q===void 0?null:q)}function ls(s,f,k,q){var Q=hi();q=q===void 0?null:q;var ie=void 0;if(zn!==null){var pe=zn.memoizedState;if(ie=pe.destroy,q!==null&&Su(q,pe.deps)){Q.memoizedState=Ca(f,k,ie,q);return}}on.flags|=s,Q.memoizedState=Ca(1|f,k,ie,q)}function Ec(s,f){return eo(8390656,8,s,f)}function Pc(s,f){return ls(2048,8,s,f)}function hf(s,f){return ls(4,2,s,f)}function Zu(s,f){return ls(4,4,s,f)}function us(s,f){if(typeof f=="function")return s=s(),f(s),function(){f(null)};if(f!=null)return s=s(),f.current=s,function(){f.current=null}}function Lp(s,f,k){return k=k!=null?k.concat([s]):null,ls(4,4,us.bind(null,f,s),k)}function Tl(){}function qh(s,f){var k=hi();f=f===void 0?null:f;var q=k.memoizedState;return q!==null&&f!==null&&Su(f,q[1])?q[0]:(k.memoizedState=[s,f],s)}function Vn(s,f){var k=hi();f=f===void 0?null:f;var q=k.memoizedState;return q!==null&&f!==null&&Su(f,q[1])?q[0]:(s=s(),k.memoizedState=[s,f],s)}function Np(s,f,k){return(Ai&21)===0?(s.baseState&&(s.baseState=!1,le=!0),s.memoizedState=k):(jr(k,f)||(k=nu(),on.lanes|=k,df|=k,s.baseState=!0),f)}function Tp(s,f){var k=Ir;Ir=k!==0&&4>k?k:4,s(!0);var q=_u.transition;_u.transition={};try{s(!1),f()}finally{Ir=k,_u.transition=q}}function Rp(){return hi().memoizedState}function d0(s,f,k){var q=Rc(s);if(k={lane:q,action:k,hasEagerState:!1,eagerState:null,next:null},zh(s))Ip(f,k);else if(k=vo(s,f,k,q),k!==null){var Q=Ho();Il(k,s,q,Q),Uo(k,f,q)}}function Mp(s,f,k){var q=Rc(s),Q={lane:q,action:k,hasEagerState:!1,eagerState:null,next:null};if(zh(s))Ip(f,Q);else{var ie=s.alternate;if(s.lanes===0&&(ie===null||ie.lanes===0)&&(ie=f.lastRenderedReducer,ie!==null))try{var pe=f.lastRenderedState,Te=ie(pe,k);if(Q.hasEagerState=!0,Q.eagerState=Te,jr(Te,pe)){var Be=f.interleaved;Be===null?(Q.next=Q,Do(f)):(Q.next=Be.next,Be.next=Q),f.interleaved=Q;return}}catch{}finally{}k=vo(s,f,Q,q),k!==null&&(Q=Ho(),Il(k,s,q,Q),Uo(k,f,q))}}function zh(s){var f=s.alternate;return s===on||f!==null&&f===on}function Ip(s,f){yo=Za=!0;var k=s.pending;k===null?f.next=f:(f.next=k.next,k.next=f),s.pending=f}function Uo(s,f,k){if((k&4194240)!==0){var q=f.lanes;q&=s.pendingLanes,k|=q,f.lanes=k,iu(s,k)}}var Oc={readContext:qn,useCallback:Hn,useContext:Hn,useEffect:Hn,useImperativeHandle:Hn,useInsertionEffect:Hn,useLayoutEffect:Hn,useMemo:Hn,useReducer:Hn,useRef:Hn,useState:Hn,useDebugValue:Hn,useDeferredValue:Hn,useTransition:Hn,useMutableSource:Hn,useSyncExternalStore:Hn,useId:Hn,unstable_isNewReconciler:!1},p0={readContext:qn,useCallback:function(s,f){return bn().memoizedState=[s,f===void 0?null:f],s},useContext:qn,useEffect:Ec,useImperativeHandle:function(s,f,k){return k=k!=null?k.concat([s]):null,eo(4194308,4,us.bind(null,f,s),k)},useLayoutEffect:function(s,f){return eo(4194308,4,s,f)},useInsertionEffect:function(s,f){return eo(4,2,s,f)},useMemo:function(s,f){var k=bn();return f=f===void 0?null:f,s=s(),k.memoizedState=[s,f],s},useReducer:function(s,f,k){var q=bn();return f=k!==void 0?k(f):f,q.memoizedState=q.baseState=f,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:f},q.queue=s,s=s.dispatch=d0.bind(null,on,s),[q.memoizedState,s]},useRef:function(s){var f=bn();return s={current:s},f.memoizedState=s},useState:zo,useDebugValue:Tl,useDeferredValue:function(s){return bn().memoizedState=s},useTransition:function(){var s=zo(!1),f=s[0];return s=Tp.bind(null,s[1]),bn().memoizedState=s,[f,s]},useMutableSource:function(){},useSyncExternalStore:function(s,f,k){var q=on,Q=bn();if(ct){if(k===void 0)throw Error(t(407));k=k()}else{if(k=f(),La===null)throw Error(t(349));(Ai&30)!==0||$f(q,f,k)}Q.memoizedState=k;var ie={value:k,getSnapshot:f};return Q.queue=ie,Ec(ff.bind(null,q,ie,s),[s]),q.flags|=2048,Ca(9,os.bind(null,q,ie,k,f),void 0,null),k},useId:function(){var s=bn(),f=La.identifierPrefix;if(ct){var k=Xe,q=Qe;k=(q&~(1<<32-Ar(q)-1)).toString(32)+k,f=":"+f+"R"+k,k=Qa++,0<k&&(f+="H"+k.toString(32)),f+=":"}else k=Sc++,f=":"+f+"r"+k.toString(32)+":";return s.memoizedState=f},unstable_isNewReconciler:!1},Eu={readContext:qn,useCallback:qh,useContext:qn,useEffect:Pc,useImperativeHandle:Lp,useInsertionEffect:hf,useLayoutEffect:Zu,useMemo:Vn,useReducer:Wi,useRef:ss,useState:function(){return Wi(la)},useDebugValue:Tl,useDeferredValue:function(s){var f=hi();return Np(f,zn.memoizedState,s)},useTransition:function(){var s=Wi(la)[0],f=hi().memoizedState;return[s,f]},useMutableSource:xc,useSyncExternalStore:Ku,useId:Rp,unstable_isNewReconciler:!1},Yf={readContext:qn,useCallback:qh,useContext:qn,useEffect:Pc,useImperativeHandle:Lp,useInsertionEffect:hf,useLayoutEffect:Zu,useMemo:Vn,useReducer:Ts,useRef:ss,useState:function(){return Ts(la)},useDebugValue:Tl,useDeferredValue:function(s){var f=hi();return zn===null?f.memoizedState=s:Np(f,zn.memoizedState,s)},useTransition:function(){var s=Ts(la)[0],f=hi().memoizedState;return[s,f]},useMutableSource:xc,useSyncExternalStore:Ku,useId:Rp,unstable_isNewReconciler:!1};function ma(s,f){if(s&&s.defaultProps){f=V({},f),s=s.defaultProps;for(var k in s)f[k]===void 0&&(f[k]=s[k]);return f}return f}function Ac(s,f,k,q){f=s.memoizedState,k=k(q,f),k=k==null?f:V({},f,k),s.memoizedState=k,s.lanes===0&&(s.updateQueue.baseState=k)}var Cc={isMounted:function(s){return(s=s._reactInternals)?en(s)===s:!1},enqueueSetState:function(s,f,k){s=s._reactInternals;var q=Ho(),Q=Rc(s),ie=Xa(q,Q);ie.payload=f,k!=null&&(ie.callback=k),f=Aa(s,ie,Q),f!==null&&(Il(f,s,Q,q),kl(f,s,Q))},enqueueReplaceState:function(s,f,k){s=s._reactInternals;var q=Ho(),Q=Rc(s),ie=Xa(q,Q);ie.tag=1,ie.payload=f,k!=null&&(ie.callback=k),f=Aa(s,ie,Q),f!==null&&(Il(f,s,Q,q),kl(f,s,Q))},enqueueForceUpdate:function(s,f){s=s._reactInternals;var k=Ho(),q=Rc(s),Q=Xa(k,q);Q.tag=2,f!=null&&(Q.callback=f),f=Aa(s,Q,q),f!==null&&(Il(f,s,q,k),kl(f,s,q))}};function Xf(s,f,k,q,Q,ie,pe){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(q,ie,pe):f.prototype&&f.prototype.isPureReactComponent?!Lo(k,q)||!Lo(Q,ie):!0}function jp(s,f,k){var q=!1,Q=ns,ie=f.contextType;return typeof ie=="object"&&ie!==null?ie=qn(ie):(Q=aa(f)?il:Pi.current,q=f.contextTypes,ie=(q=q!=null)?Al(s,Q):ns),f=new f(k,ie),s.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Cc,s.stateNode=f,f._reactInternals=s,q&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=Q,s.__reactInternalMemoizedMaskedChildContext=ie),f}function Uh(s,f,k,q){s=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(k,q),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(k,q),f.state!==s&&Cc.enqueueReplaceState(f,f.state,null)}function Kf(s,f,k,q){var Q=s.stateNode;Q.props=k,Q.state=s.memoizedState,Q.refs={},yu(s);var ie=f.contextType;typeof ie=="object"&&ie!==null?Q.context=qn(ie):(ie=aa(f)?il:Pi.current,Q.context=Al(s,ie)),Q.state=s.memoizedState,ie=f.getDerivedStateFromProps,typeof ie=="function"&&(Ac(s,f,ie,k),Q.state=s.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof Q.getSnapshotBeforeUpdate=="function"||typeof Q.UNSAFE_componentWillMount!="function"&&typeof Q.componentWillMount!="function"||(f=Q.state,typeof Q.componentWillMount=="function"&&Q.componentWillMount(),typeof Q.UNSAFE_componentWillMount=="function"&&Q.UNSAFE_componentWillMount(),f!==Q.state&&Cc.enqueueReplaceState(Q,Q.state,null),Bo(s,k,Q,q),Q.state=s.memoizedState),typeof Q.componentDidMount=="function"&&(s.flags|=4194308)}function Qu(s,f){try{var k="",q=f;do k+=ne(q),q=q.return;while(q);var Q=k}catch(ie){Q=`
|
|
31
|
-
Error generating stack: `+ie.message+`
|
|
32
|
-
`+ie.stack}return{value:s,source:f,stack:Q,digest:null}}function Zf(s,f,k){return{value:s,source:null,stack:k??null,digest:f??null}}function kc(s,f){try{console.error(f.value)}catch(k){setTimeout(function(){throw k})}}var g0=typeof WeakMap=="function"?WeakMap:Map;function Fp(s,f,k){k=Xa(-1,k),k.tag=3,k.payload={element:null};var q=f.value;return k.callback=function(){Up||(Up=!0,P0=q),kc(s,f)},k}function m(s,f,k){k=Xa(-1,k),k.tag=3;var q=s.type.getDerivedStateFromError;if(typeof q=="function"){var Q=f.value;k.payload=function(){return q(Q)},k.callback=function(){kc(s,f)}}var ie=s.stateNode;return ie!==null&&typeof ie.componentDidCatch=="function"&&(k.callback=function(){kc(s,f),typeof q!="function"&&(Nc===null?Nc=new Set([this]):Nc.add(this));var pe=f.stack;this.componentDidCatch(f.value,{componentStack:pe!==null?pe:""})}),k}function P(s,f,k){var q=s.pingCache;if(q===null){q=s.pingCache=new g0;var Q=new Set;q.set(f,Q)}else Q=q.get(f),Q===void 0&&(Q=new Set,q.set(f,Q));Q.has(k)||(Q.add(k),s=z_.bind(null,s,f,k),f.then(s,s))}function B(s){do{var f;if((f=s.tag===13)&&(f=s.memoizedState,f=f!==null?f.dehydrated!==null:!0),f)return s;s=s.return}while(s!==null);return null}function X(s,f,k,q,Q){return(s.mode&1)===0?(s===f?s.flags|=65536:(s.flags|=128,k.flags|=131072,k.flags&=-52805,k.tag===1&&(k.alternate===null?k.tag=17:(f=Xa(-1,1),f.tag=2,Aa(k,f,1))),k.lanes|=1),s):(s.flags|=65536,s.lanes=Q,s)}var re=b.ReactCurrentOwner,le=!1;function _e(s,f,k,q){f.child=s===null?xr(f,null,k,q):ci(f,s.child,k,q)}function Ke(s,f,k,q,Q){k=k.render;var ie=f.ref;return yn(f,Q),q=al(s,f,k,q,ie,Q),k=Ja(),s!==null&&!le?(f.updateQueue=s.updateQueue,f.flags&=-2053,s.lanes&=~Q,ka(s,f,Q)):(ct&&k&<(f),f.flags|=1,_e(s,f,q,Q),f.child)}function ut(s,f,k,q,Q){if(s===null){var ie=k.type;return typeof ie=="function"&&!T0(ie)&&ie.defaultProps===void 0&&k.compare===null&&k.defaultProps===void 0?(f.tag=15,f.type=ie,Lt(s,f,ie,q,Q)):(s=Yp(k.type,null,q,f,f.mode,Q),s.ref=f.ref,s.return=f,f.child=s)}if(ie=s.child,(s.lanes&Q)===0){var pe=ie.memoizedProps;if(k=k.compare,k=k!==null?k:Lo,k(pe,q)&&s.ref===f.ref)return ka(s,f,Q)}return f.flags|=1,s=Ic(ie,q),s.ref=f.ref,s.return=f,f.child=s}function Lt(s,f,k,q,Q){if(s!==null){var ie=s.memoizedProps;if(Lo(ie,q)&&s.ref===f.ref)if(le=!1,f.pendingProps=q=ie,(s.lanes&Q)!==0)(s.flags&131072)!==0&&(le=!0);else return f.lanes=s.lanes,ka(s,f,Q)}return Ht(s,f,k,q,Q)}function Kt(s,f,k){var q=f.pendingProps,Q=q.children,ie=s!==null?s.memoizedState:null;if(q.mode==="hidden")if((f.mode&1)===0)f.memoizedState={baseLanes:0,cachePool:null,transitions:null},an(Jf,Rs),Rs|=k;else{if((k&1073741824)===0)return s=ie!==null?ie.baseLanes|k:k,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:s,cachePool:null,transitions:null},f.updateQueue=null,an(Jf,Rs),Rs|=s,null;f.memoizedState={baseLanes:0,cachePool:null,transitions:null},q=ie!==null?ie.baseLanes:k,an(Jf,Rs),Rs|=q}else ie!==null?(q=ie.baseLanes|k,f.memoizedState=null):q=k,an(Jf,Rs),Rs|=q;return _e(s,f,Q,k),f.child}function br(s,f){var k=f.ref;(s===null&&k!==null||s!==null&&s.ref!==k)&&(f.flags|=512,f.flags|=2097152)}function Ht(s,f,k,q,Q){var ie=aa(k)?il:Pi.current;return ie=Al(f,ie),yn(f,Q),k=al(s,f,k,q,ie,Q),q=Ja(),s!==null&&!le?(f.updateQueue=s.updateQueue,f.flags&=-2053,s.lanes&=~Q,ka(s,f,Q)):(ct&&q&<(f),f.flags|=1,_e(s,f,k,Q),f.child)}function Tn(s,f,k,q,Q){if(aa(k)){var ie=!0;is(f)}else ie=!1;if(yn(f,Q),f.stateNode===null)Ur(s,f),jp(f,k,q),Kf(f,k,q,Q),q=!0;else if(s===null){var pe=f.stateNode,Te=f.memoizedProps;pe.props=Te;var Be=pe.context,st=k.contextType;typeof st=="object"&&st!==null?st=qn(st):(st=aa(k)?il:Pi.current,st=Al(f,st));var Ot=k.getDerivedStateFromProps,At=typeof Ot=="function"||typeof pe.getSnapshotBeforeUpdate=="function";At||typeof pe.UNSAFE_componentWillReceiveProps!="function"&&typeof pe.componentWillReceiveProps!="function"||(Te!==q||Be!==st)&&Uh(f,pe,q,st),mo=!1;var Pt=f.memoizedState;pe.state=Pt,Bo(f,q,pe,Q),Be=f.memoizedState,Te!==q||Pt!==Be||ia.current||mo?(typeof Ot=="function"&&(Ac(f,k,Ot,q),Be=f.memoizedState),(Te=mo||Xf(f,k,Te,q,Pt,Be,st))?(At||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"&&(f.flags|=4194308)):(typeof pe.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=q,f.memoizedState=Be),pe.props=q,pe.state=Be,pe.context=st,q=Te):(typeof pe.componentDidMount=="function"&&(f.flags|=4194308),q=!1)}else{pe=f.stateNode,Xu(s,f),Te=f.memoizedProps,st=f.type===f.elementType?Te:ma(f.type,Te),pe.props=st,At=f.pendingProps,Pt=pe.context,Be=k.contextType,typeof Be=="object"&&Be!==null?Be=qn(Be):(Be=aa(k)?il:Pi.current,Be=Al(f,Be));var $t=k.getDerivedStateFromProps;(Ot=typeof $t=="function"||typeof pe.getSnapshotBeforeUpdate=="function")||typeof pe.UNSAFE_componentWillReceiveProps!="function"&&typeof pe.componentWillReceiveProps!="function"||(Te!==At||Pt!==Be)&&Uh(f,pe,q,Be),mo=!1,Pt=f.memoizedState,pe.state=Pt,Bo(f,q,pe,Q);var Jt=f.memoizedState;Te!==At||Pt!==Jt||ia.current||mo?(typeof $t=="function"&&(Ac(f,k,$t,q),Jt=f.memoizedState),(st=mo||Xf(f,k,st,q,Pt,Jt,Be)||!1)?(Ot||typeof pe.UNSAFE_componentWillUpdate!="function"&&typeof pe.componentWillUpdate!="function"||(typeof pe.componentWillUpdate=="function"&&pe.componentWillUpdate(q,Jt,Be),typeof pe.UNSAFE_componentWillUpdate=="function"&&pe.UNSAFE_componentWillUpdate(q,Jt,Be)),typeof pe.componentDidUpdate=="function"&&(f.flags|=4),typeof pe.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof pe.componentDidUpdate!="function"||Te===s.memoizedProps&&Pt===s.memoizedState||(f.flags|=4),typeof pe.getSnapshotBeforeUpdate!="function"||Te===s.memoizedProps&&Pt===s.memoizedState||(f.flags|=1024),f.memoizedProps=q,f.memoizedState=Jt),pe.props=q,pe.state=Jt,pe.context=Be,q=st):(typeof pe.componentDidUpdate!="function"||Te===s.memoizedProps&&Pt===s.memoizedState||(f.flags|=4),typeof pe.getSnapshotBeforeUpdate!="function"||Te===s.memoizedProps&&Pt===s.memoizedState||(f.flags|=1024),q=!1)}return mn(s,f,k,q,ie,Q)}function mn(s,f,k,q,Q,ie){br(s,f);var pe=(f.flags&128)!==0;if(!q&&!pe)return Q&&Wf(f,k,!1),ka(s,f,ie);q=f.stateNode,re.current=f;var Te=pe&&typeof k.getDerivedStateFromError!="function"?null:q.render();return f.flags|=1,s!==null&&pe?(f.child=ci(f,s.child,null,ie),f.child=ci(f,null,Te,ie)):_e(s,f,Te,ie),f.memoizedState=q.state,Q&&Wf(f,k,!0),f.child}function to(s){var f=s.stateNode;f.pendingContext?cf(s,f.pendingContext,f.pendingContext!==f.context):f.context&&cf(s,f.context,!1),qo(s,f.containerInfo)}function ol(s,f,k,q,Q){return yr(),Xr(Q),f.flags|=256,_e(s,f,k,q),f.child}var ot={dehydrated:null,treeContext:null,retryLane:0};function Ze(s){return{baseLanes:s,cachePool:null,transitions:null}}function dt(s,f,k){var q=f.pendingProps,Q=hn.current,ie=!1,pe=(f.flags&128)!==0,Te;if((Te=pe)||(Te=s!==null&&s.memoizedState===null?!1:(Q&2)!==0),Te?(ie=!0,f.flags&=-129):(s===null||s.memoizedState!==null)&&(Q|=1),an(hn,Q&1),s===null)return Mt(f),s=f.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?((f.mode&1)===0?f.lanes=1:s.data==="$!"?f.lanes=8:f.lanes=1073741824,null):(pe=q.children,s=q.fallback,ie?(q=f.mode,ie=f.child,pe={mode:"hidden",children:pe},(q&1)===0&&ie!==null?(ie.childLanes=0,ie.pendingProps=pe):ie=Xp(pe,q,0,null),s=mf(s,q,k,null),ie.return=f,s.return=f,ie.sibling=s,f.child=ie,f.child.memoizedState=Ze(k),f.memoizedState=ot,s):Gt(f,pe));if(Q=s.memoizedState,Q!==null&&(Te=Q.dehydrated,Te!==null))return Cr(s,f,pe,q,Te,Q,k);if(ie){ie=q.fallback,pe=f.mode,Q=s.child,Te=Q.sibling;var Be={mode:"hidden",children:q.children};return(pe&1)===0&&f.child!==Q?(q=f.child,q.childLanes=0,q.pendingProps=Be,f.deletions=null):(q=Ic(Q,Be),q.subtreeFlags=Q.subtreeFlags&14680064),Te!==null?ie=Ic(Te,ie):(ie=mf(ie,pe,k,null),ie.flags|=2),ie.return=f,q.return=f,q.sibling=ie,f.child=q,q=ie,ie=f.child,pe=s.child.memoizedState,pe=pe===null?Ze(k):{baseLanes:pe.baseLanes|k,cachePool:null,transitions:pe.transitions},ie.memoizedState=pe,ie.childLanes=s.childLanes&~k,f.memoizedState=ot,q}return ie=s.child,s=ie.sibling,q=Ic(ie,{mode:"visible",children:q.children}),(f.mode&1)===0&&(q.lanes=k),q.return=f,q.sibling=null,s!==null&&(k=f.deletions,k===null?(f.deletions=[s],f.flags|=16):k.push(s)),f.child=q,f.memoizedState=null,q}function Gt(s,f){return f=Xp({mode:"visible",children:f},s.mode,0,null),f.return=s,s.child=f}function ur(s,f,k,q){return q!==null&&Xr(q),ci(f,s.child,null,k),s=Gt(f,f.pendingProps.children),s.flags|=2,f.memoizedState=null,s}function Cr(s,f,k,q,Q,ie,pe){if(k)return f.flags&256?(f.flags&=-257,q=Zf(Error(t(422))),ur(s,f,pe,q)):f.memoizedState!==null?(f.child=s.child,f.flags|=128,null):(ie=q.fallback,Q=f.mode,q=Xp({mode:"visible",children:q.children},Q,0,null),ie=mf(ie,Q,pe,null),ie.flags|=2,q.return=f,ie.return=f,q.sibling=ie,f.child=q,(f.mode&1)!==0&&ci(f,s.child,null,pe),f.child.memoizedState=Ze(pe),f.memoizedState=ot,ie);if((f.mode&1)===0)return ur(s,f,pe,null);if(Q.data==="$!"){if(q=Q.nextSibling&&Q.nextSibling.dataset,q)var Te=q.dgst;return q=Te,ie=Error(t(419)),q=Zf(ie,q,void 0),ur(s,f,pe,q)}if(Te=(pe&s.childLanes)!==0,le||Te){if(q=La,q!==null){switch(pe&-pe){case 4:Q=2;break;case 16:Q=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:Q=32;break;case 536870912:Q=268435456;break;default:Q=0}Q=(Q&(q.suspendedLanes|pe))!==0?0:Q,Q!==0&&Q!==ie.retryLane&&(ie.retryLane=Q,Dr(s,Q),Il(q,s,Q,-1))}return N0(),q=Zf(Error(t(421))),ur(s,f,pe,q)}return Q.data==="$?"?(f.flags|=128,f.child=s.child,f=U_.bind(null,s),Q._reactRetry=f,null):(s=ie.treeContext,Ge=Ui(Q.nextSibling),ze=f,ct=!0,pt=null,s!==null&&(be[Pe++]=Qe,be[Pe++]=Xe,be[Pe++]=je,Qe=s.id,Xe=s.overflow,je=f),f=Gt(f,q.children),f.flags|=4096,f)}function wr(s,f,k){s.lanes|=f;var q=s.alternate;q!==null&&(q.lanes|=f),Ya(s.return,f,k)}function Vr(s,f,k,q,Q){var ie=s.memoizedState;ie===null?s.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:q,tail:k,tailMode:Q}:(ie.isBackwards=f,ie.rendering=null,ie.renderingStartTime=0,ie.last=q,ie.tail=k,ie.tailMode=Q)}function $i(s,f,k){var q=f.pendingProps,Q=q.revealOrder,ie=q.tail;if(_e(s,f,q.children,k),q=hn.current,(q&2)!==0)q=q&1|2,f.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=f.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&wr(s,k,f);else if(s.tag===19)wr(s,k,f);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===f)break e;for(;s.sibling===null;){if(s.return===null||s.return===f)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}q&=1}if(an(hn,q),(f.mode&1)===0)f.memoizedState=null;else switch(Q){case"forwards":for(k=f.child,Q=null;k!==null;)s=k.alternate,s!==null&&Ka(s)===null&&(Q=k),k=k.sibling;k=Q,k===null?(Q=f.child,f.child=null):(Q=k.sibling,k.sibling=null),Vr(f,!1,Q,k,ie);break;case"backwards":for(k=null,Q=f.child,f.child=null;Q!==null;){if(s=Q.alternate,s!==null&&Ka(s)===null){f.child=Q;break}s=Q.sibling,Q.sibling=k,k=Q,Q=s}Vr(f,!0,k,null,ie);break;case"together":Vr(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function Ur(s,f){(f.mode&1)===0&&s!==null&&(s.alternate=null,f.alternate=null,f.flags|=2)}function ka(s,f,k){if(s!==null&&(f.dependencies=s.dependencies),df|=f.lanes,(k&f.childLanes)===0)return null;if(s!==null&&f.child!==s.child)throw Error(t(153));if(f.child!==null){for(s=f.child,k=Ic(s,s.pendingProps),f.child=k,k.return=f;s.sibling!==null;)s=s.sibling,k=k.sibling=Ic(s,s.pendingProps),k.return=f;k.sibling=null}return f.child}function v0(s,f,k){switch(f.tag){case 3:to(f),yr();break;case 5:bu(f);break;case 1:aa(f.type)&&is(f);break;case 4:qo(f,f.stateNode.containerInfo);break;case 10:var q=f.type._context,Q=f.memoizedProps.value;an(Gi,q._currentValue),q._currentValue=Q;break;case 13:if(q=f.memoizedState,q!==null)return q.dehydrated!==null?(an(hn,hn.current&1),f.flags|=128,null):(k&f.child.childLanes)!==0?dt(s,f,k):(an(hn,hn.current&1),s=ka(s,f,k),s!==null?s.sibling:null);an(hn,hn.current&1);break;case 19:if(q=(k&f.childLanes)!==0,(s.flags&128)!==0){if(q)return $i(s,f,k);f.flags|=128}if(Q=f.memoizedState,Q!==null&&(Q.rendering=null,Q.tail=null,Q.lastEffect=null),an(hn,hn.current),q)break;return null;case 22:case 23:return f.lanes=0,Kt(s,f,k)}return ka(s,f,k)}var Fm,m0,Dm,Bm;Fm=function(s,f){for(var k=f.child;k!==null;){if(k.tag===5||k.tag===6)s.appendChild(k.stateNode);else if(k.tag!==4&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===f)break;for(;k.sibling===null;){if(k.return===null||k.return===f)return;k=k.return}k.sibling.return=k.return,k=k.sibling}},m0=function(){},Dm=function(s,f,k,q){var Q=s.memoizedProps;if(Q!==q){s=f.stateNode,ti(Jr.current);var ie=null;switch(k){case"input":Q=Re(s,Q),q=Re(s,q),ie=[];break;case"select":Q=V({},Q,{value:void 0}),q=V({},q,{value:void 0}),ie=[];break;case"textarea":Q=he(s,Q),q=he(s,q),ie=[];break;default:typeof Q.onClick!="function"&&typeof q.onClick=="function"&&(s.onclick=ks)}qe(k,q);var pe;k=null;for(st in Q)if(!q.hasOwnProperty(st)&&Q.hasOwnProperty(st)&&Q[st]!=null)if(st==="style"){var Te=Q[st];for(pe in Te)Te.hasOwnProperty(pe)&&(k||(k={}),k[pe]="")}else st!=="dangerouslySetInnerHTML"&&st!=="children"&&st!=="suppressContentEditableWarning"&&st!=="suppressHydrationWarning"&&st!=="autoFocus"&&(a.hasOwnProperty(st)?ie||(ie=[]):(ie=ie||[]).push(st,null));for(st in q){var Be=q[st];if(Te=Q!=null?Q[st]:void 0,q.hasOwnProperty(st)&&Be!==Te&&(Be!=null||Te!=null))if(st==="style")if(Te){for(pe in Te)!Te.hasOwnProperty(pe)||Be&&Be.hasOwnProperty(pe)||(k||(k={}),k[pe]="");for(pe in Be)Be.hasOwnProperty(pe)&&Te[pe]!==Be[pe]&&(k||(k={}),k[pe]=Be[pe])}else k||(ie||(ie=[]),ie.push(st,k)),k=Be;else st==="dangerouslySetInnerHTML"?(Be=Be?Be.__html:void 0,Te=Te?Te.__html:void 0,Be!=null&&Te!==Be&&(ie=ie||[]).push(st,Be)):st==="children"?typeof Be!="string"&&typeof Be!="number"||(ie=ie||[]).push(st,""+Be):st!=="suppressContentEditableWarning"&&st!=="suppressHydrationWarning"&&(a.hasOwnProperty(st)?(Be!=null&&st==="onScroll"&&cn("scroll",s),ie||Te===Be||(ie=[])):(ie=ie||[]).push(st,Be))}k&&(ie=ie||[]).push("style",k);var st=ie;(f.updateQueue=st)&&(f.flags|=4)}},Bm=function(s,f,k,q){k!==q&&(f.flags|=4)};function Hh(s,f){if(!ct)switch(s.tailMode){case"hidden":f=s.tail;for(var k=null;f!==null;)f.alternate!==null&&(k=f),f=f.sibling;k===null?s.tail=null:k.sibling=null;break;case"collapsed":k=s.tail;for(var q=null;k!==null;)k.alternate!==null&&(q=k),k=k.sibling;q===null?f||s.tail===null?s.tail=null:s.tail.sibling=null:q.sibling=null}}function bo(s){var f=s.alternate!==null&&s.alternate.child===s.child,k=0,q=0;if(f)for(var Q=s.child;Q!==null;)k|=Q.lanes|Q.childLanes,q|=Q.subtreeFlags&14680064,q|=Q.flags&14680064,Q.return=s,Q=Q.sibling;else for(Q=s.child;Q!==null;)k|=Q.lanes|Q.childLanes,q|=Q.subtreeFlags,q|=Q.flags,Q.return=s,Q=Q.sibling;return s.subtreeFlags|=q,s.childLanes=k,f}function N_(s,f,k){var q=f.pendingProps;switch(Me(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bo(f),null;case 1:return aa(f.type)&&mu(),bo(f),null;case 3:return q=f.stateNode,fn(),Zr(ia),Zr(Pi),sa(),q.pendingContext&&(q.context=q.pendingContext,q.pendingContext=null),(s===null||s.child===null)&&(qr(f)?f.flags|=4:s===null||s.memoizedState.isDehydrated&&(f.flags&256)===0||(f.flags|=1024,pt!==null&&(C0(pt),pt=null))),m0(s,f),bo(f),null;case 5:Ns(f);var Q=ti(Nn.current);if(k=f.type,s!==null&&f.stateNode!=null)Dm(s,f,k,q,Q),s.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!q){if(f.stateNode===null)throw Error(t(166));return bo(f),null}if(s=ti(Jr.current),qr(f)){q=f.stateNode,k=f.type;var ie=f.memoizedProps;switch(q[po]=f,q[gu]=ie,s=(f.mode&1)!==0,k){case"dialog":cn("cancel",q),cn("close",q);break;case"iframe":case"object":case"embed":cn("load",q);break;case"video":case"audio":for(Q=0;Q<Fo.length;Q++)cn(Fo[Q],q);break;case"source":cn("error",q);break;case"img":case"image":case"link":cn("error",q),cn("load",q);break;case"details":cn("toggle",q);break;case"input":Se(q,ie),cn("invalid",q);break;case"select":q._wrapperState={wasMultiple:!!ie.multiple},cn("invalid",q);break;case"textarea":Le(q,ie),cn("invalid",q)}qe(k,ie),Q=null;for(var pe in ie)if(ie.hasOwnProperty(pe)){var Te=ie[pe];pe==="children"?typeof Te=="string"?q.textContent!==Te&&(ie.suppressHydrationWarning!==!0&&Gu(q.textContent,Te,s),Q=["children",Te]):typeof Te=="number"&&q.textContent!==""+Te&&(ie.suppressHydrationWarning!==!0&&Gu(q.textContent,Te,s),Q=["children",""+Te]):a.hasOwnProperty(pe)&&Te!=null&&pe==="onScroll"&&cn("scroll",q)}switch(k){case"input":me(q),we(q,ie,!0);break;case"textarea":me(q),De(q);break;case"select":case"option":break;default:typeof ie.onClick=="function"&&(q.onclick=ks)}q=Q,f.updateQueue=q,q!==null&&(f.flags|=4)}else{pe=Q.nodeType===9?Q:Q.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=tt(k)),s==="http://www.w3.org/1999/xhtml"?k==="script"?(s=pe.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof q.is=="string"?s=pe.createElement(k,{is:q.is}):(s=pe.createElement(k),k==="select"&&(pe=s,q.multiple?pe.multiple=!0:q.size&&(pe.size=q.size))):s=pe.createElementNS(s,k),s[po]=f,s[gu]=q,Fm(s,f,!1,!1),f.stateNode=s;e:{switch(pe=We(k,q),k){case"dialog":cn("cancel",s),cn("close",s),Q=q;break;case"iframe":case"object":case"embed":cn("load",s),Q=q;break;case"video":case"audio":for(Q=0;Q<Fo.length;Q++)cn(Fo[Q],s);Q=q;break;case"source":cn("error",s),Q=q;break;case"img":case"image":case"link":cn("error",s),cn("load",s),Q=q;break;case"details":cn("toggle",s),Q=q;break;case"input":Se(s,q),Q=Re(s,q),cn("invalid",s);break;case"option":Q=q;break;case"select":s._wrapperState={wasMultiple:!!q.multiple},Q=V({},q,{value:void 0}),cn("invalid",s);break;case"textarea":Le(s,q),Q=he(s,q),cn("invalid",s);break;default:Q=q}qe(k,Q),Te=Q;for(ie in Te)if(Te.hasOwnProperty(ie)){var Be=Te[ie];ie==="style"?or(s,Be):ie==="dangerouslySetInnerHTML"?(Be=Be?Be.__html:void 0,Be!=null&&Et(s,Be)):ie==="children"?typeof Be=="string"?(k!=="textarea"||Be!=="")&&nt(s,Be):typeof Be=="number"&&nt(s,""+Be):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(a.hasOwnProperty(ie)?Be!=null&&ie==="onScroll"&&cn("scroll",s):Be!=null&&v(s,ie,Be,pe))}switch(k){case"input":me(s),we(s,q,!1);break;case"textarea":me(s),De(s);break;case"option":q.value!=null&&s.setAttribute("value",""+ae(q.value));break;case"select":s.multiple=!!q.multiple,ie=q.value,ie!=null?Ne(s,!!q.multiple,ie,!1):q.defaultValue!=null&&Ne(s,!!q.multiple,q.defaultValue,!0);break;default:typeof Q.onClick=="function"&&(s.onclick=ks)}switch(k){case"button":case"input":case"select":case"textarea":q=!!q.autoFocus;break e;case"img":q=!0;break e;default:q=!1}}q&&(f.flags|=4)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return bo(f),null;case 6:if(s&&f.stateNode!=null)Bm(s,f,s.memoizedProps,q);else{if(typeof q!="string"&&f.stateNode===null)throw Error(t(166));if(k=ti(Nn.current),ti(Jr.current),qr(f)){if(q=f.stateNode,k=f.memoizedProps,q[po]=f,(ie=q.nodeValue!==k)&&(s=ze,s!==null))switch(s.tag){case 3:Gu(q.nodeValue,k,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&Gu(q.nodeValue,k,(s.mode&1)!==0)}ie&&(f.flags|=4)}else q=(k.nodeType===9?k:k.ownerDocument).createTextNode(q),q[po]=f,f.stateNode=q}return bo(f),null;case 13:if(Zr(hn),q=f.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(ct&&Ge!==null&&(f.mode&1)!==0&&(f.flags&128)===0)Rr(),yr(),f.flags|=98560,ie=!1;else if(ie=qr(f),q!==null&&q.dehydrated!==null){if(s===null){if(!ie)throw Error(t(318));if(ie=f.memoizedState,ie=ie!==null?ie.dehydrated:null,!ie)throw Error(t(317));ie[po]=f}else yr(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;bo(f),ie=!1}else pt!==null&&(C0(pt),pt=null),ie=!0;if(!ie)return f.flags&65536?f:null}return(f.flags&128)!==0?(f.lanes=k,f):(q=q!==null,q!==(s!==null&&s.memoizedState!==null)&&q&&(f.child.flags|=8192,(f.mode&1)!==0&&(s===null||(hn.current&1)!==0?ya===0&&(ya=3):N0())),f.updateQueue!==null&&(f.flags|=4),bo(f),null);case 4:return fn(),m0(s,f),s===null&&Cs(f.stateNode.containerInfo),bo(f),null;case 10:return ga(f.type._context),bo(f),null;case 17:return aa(f.type)&&mu(),bo(f),null;case 19:if(Zr(hn),ie=f.memoizedState,ie===null)return bo(f),null;if(q=(f.flags&128)!==0,pe=ie.rendering,pe===null)if(q)Hh(ie,!1);else{if(ya!==0||s!==null&&(s.flags&128)!==0)for(s=f.child;s!==null;){if(pe=Ka(s),pe!==null){for(f.flags|=128,Hh(ie,!1),q=pe.updateQueue,q!==null&&(f.updateQueue=q,f.flags|=4),f.subtreeFlags=0,q=k,k=f.child;k!==null;)ie=k,s=q,ie.flags&=14680066,pe=ie.alternate,pe===null?(ie.childLanes=0,ie.lanes=s,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,s=pe.dependencies,ie.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),k=k.sibling;return an(hn,hn.current&1|2),f.child}s=s.sibling}ie.tail!==null&&Mn()>eh&&(f.flags|=128,q=!0,Hh(ie,!1),f.lanes=4194304)}else{if(!q)if(s=Ka(pe),s!==null){if(f.flags|=128,q=!0,k=s.updateQueue,k!==null&&(f.updateQueue=k,f.flags|=4),Hh(ie,!0),ie.tail===null&&ie.tailMode==="hidden"&&!pe.alternate&&!ct)return bo(f),null}else 2*Mn()-ie.renderingStartTime>eh&&k!==1073741824&&(f.flags|=128,q=!0,Hh(ie,!1),f.lanes=4194304);ie.isBackwards?(pe.sibling=f.child,f.child=pe):(k=ie.last,k!==null?k.sibling=pe:f.child=pe,ie.last=pe)}return ie.tail!==null?(f=ie.tail,ie.rendering=f,ie.tail=f.sibling,ie.renderingStartTime=Mn(),f.sibling=null,k=hn.current,an(hn,q?k&1|2:k&1),f):(bo(f),null);case 22:case 23:return L0(),q=f.memoizedState!==null,s!==null&&s.memoizedState!==null!==q&&(f.flags|=8192),q&&(f.mode&1)!==0?(Rs&1073741824)!==0&&(bo(f),f.subtreeFlags&6&&(f.flags|=8192)):bo(f),null;case 24:return null;case 25:return null}throw Error(t(156,f.tag))}function T_(s,f){switch(Me(f),f.tag){case 1:return aa(f.type)&&mu(),s=f.flags,s&65536?(f.flags=s&-65537|128,f):null;case 3:return fn(),Zr(ia),Zr(Pi),sa(),s=f.flags,(s&65536)!==0&&(s&128)===0?(f.flags=s&-65537|128,f):null;case 5:return Ns(f),null;case 13:if(Zr(hn),s=f.memoizedState,s!==null&&s.dehydrated!==null){if(f.alternate===null)throw Error(t(340));yr()}return s=f.flags,s&65536?(f.flags=s&-65537|128,f):null;case 19:return Zr(hn),null;case 4:return fn(),null;case 10:return ga(f.type._context),null;case 22:case 23:return L0(),null;case 24:return null;default:return null}}var Dp=!1,wo=!1,R_=typeof WeakSet=="function"?WeakSet:Set,Qt=null;function Qf(s,f){var k=s.ref;if(k!==null)if(typeof k=="function")try{k(null)}catch(q){Ci(s,f,q)}else k.current=null}function y0(s,f,k){try{k()}catch(q){Ci(s,f,q)}}var qm=!1;function M_(s,f){if(Wu=su,s=Xn(),ts(s)){if("selectionStart"in s)var k={start:s.selectionStart,end:s.selectionEnd};else e:{k=(k=s.ownerDocument)&&k.defaultView||window;var q=k.getSelection&&k.getSelection();if(q&&q.rangeCount!==0){k=q.anchorNode;var Q=q.anchorOffset,ie=q.focusNode;q=q.focusOffset;try{k.nodeType,ie.nodeType}catch{k=null;break e}var pe=0,Te=-1,Be=-1,st=0,Ot=0,At=s,Pt=null;t:for(;;){for(var $t;At!==k||Q!==0&&At.nodeType!==3||(Te=pe+Q),At!==ie||q!==0&&At.nodeType!==3||(Be=pe+q),At.nodeType===3&&(pe+=At.nodeValue.length),($t=At.firstChild)!==null;)Pt=At,At=$t;for(;;){if(At===s)break t;if(Pt===k&&++st===Q&&(Te=pe),Pt===ie&&++Ot===q&&(Be=pe),($t=At.nextSibling)!==null)break;At=Pt,Pt=At.parentNode}At=$t}k=Te===-1||Be===-1?null:{start:Te,end:Be}}else k=null}k=k||{start:0,end:0}}else k=null;for(Ol={focusedElem:s,selectionRange:k},su=!1,Qt=f;Qt!==null;)if(f=Qt,s=f.child,(f.subtreeFlags&1028)!==0&&s!==null)s.return=f,Qt=s;else for(;Qt!==null;){f=Qt;try{var Jt=f.alternate;if((f.flags&1024)!==0)switch(f.tag){case 0:case 11:case 15:break;case 1:if(Jt!==null){var ar=Jt.memoizedProps,Yi=Jt.memoizedState,et=f.stateNode,$e=et.getSnapshotBeforeUpdate(f.elementType===f.type?ar:ma(f.type,ar),Yi);et.__reactInternalSnapshotBeforeUpdate=$e}break;case 3:var rt=f.stateNode.containerInfo;rt.nodeType===1?rt.textContent="":rt.nodeType===9&&rt.documentElement&&rt.removeChild(rt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(Tt){Ci(f,f.return,Tt)}if(s=f.sibling,s!==null){s.return=f.return,Qt=s;break}Qt=f.return}return Jt=qm,qm=!1,Jt}function Vh(s,f,k){var q=f.updateQueue;if(q=q!==null?q.lastEffect:null,q!==null){var Q=q=q.next;do{if((Q.tag&s)===s){var ie=Q.destroy;Q.destroy=void 0,ie!==void 0&&y0(f,k,ie)}Q=Q.next}while(Q!==q)}}function Bp(s,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var k=f=f.next;do{if((k.tag&s)===s){var q=k.create;k.destroy=q()}k=k.next}while(k!==f)}}function b0(s){var f=s.ref;if(f!==null){var k=s.stateNode;switch(s.tag){case 5:s=k;break;default:s=k}typeof f=="function"?f(s):f.current=s}}function zm(s){var f=s.alternate;f!==null&&(s.alternate=null,zm(f)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(f=s.stateNode,f!==null&&(delete f[po],delete f[gu],delete f[pa],delete f[Vf],delete f[Gf])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function Um(s){return s.tag===5||s.tag===3||s.tag===4}function Hm(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Um(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function w0(s,f,k){var q=s.tag;if(q===5||q===6)s=s.stateNode,f?k.nodeType===8?k.parentNode.insertBefore(s,f):k.insertBefore(s,f):(k.nodeType===8?(f=k.parentNode,f.insertBefore(s,k)):(f=k,f.appendChild(s)),k=k._reactRootContainer,k!=null||f.onclick!==null||(f.onclick=ks));else if(q!==4&&(s=s.child,s!==null))for(w0(s,f,k),s=s.sibling;s!==null;)w0(s,f,k),s=s.sibling}function _0(s,f,k){var q=s.tag;if(q===5||q===6)s=s.stateNode,f?k.insertBefore(s,f):k.appendChild(s);else if(q!==4&&(s=s.child,s!==null))for(_0(s,f,k),s=s.sibling;s!==null;)_0(s,f,k),s=s.sibling}var ro=null,Rl=!1;function Lc(s,f,k){for(k=k.child;k!==null;)Vm(s,f,k),k=k.sibling}function Vm(s,f,k){if(pi&&typeof pi.onCommitFiberUnmount=="function")try{pi.onCommitFiberUnmount(so,k)}catch{}switch(k.tag){case 5:wo||Qf(k,f);case 6:var q=ro,Q=Rl;ro=null,Lc(s,f,k),ro=q,Rl=Q,ro!==null&&(Rl?(s=ro,k=k.stateNode,s.nodeType===8?s.parentNode.removeChild(k):s.removeChild(k)):ro.removeChild(k.stateNode));break;case 18:ro!==null&&(Rl?(s=ro,k=k.stateNode,s.nodeType===8?wc(s.parentNode,k):s.nodeType===1&&wc(s,k),ai(s)):wc(ro,k.stateNode));break;case 4:q=ro,Q=Rl,ro=k.stateNode.containerInfo,Rl=!0,Lc(s,f,k),ro=q,Rl=Q;break;case 0:case 11:case 14:case 15:if(!wo&&(q=k.updateQueue,q!==null&&(q=q.lastEffect,q!==null))){Q=q=q.next;do{var ie=Q,pe=ie.destroy;ie=ie.tag,pe!==void 0&&((ie&2)!==0||(ie&4)!==0)&&y0(k,f,pe),Q=Q.next}while(Q!==q)}Lc(s,f,k);break;case 1:if(!wo&&(Qf(k,f),q=k.stateNode,typeof q.componentWillUnmount=="function"))try{q.props=k.memoizedProps,q.state=k.memoizedState,q.componentWillUnmount()}catch(Te){Ci(k,f,Te)}Lc(s,f,k);break;case 21:Lc(s,f,k);break;case 22:k.mode&1?(wo=(q=wo)||k.memoizedState!==null,Lc(s,f,k),wo=q):Lc(s,f,k);break;default:Lc(s,f,k)}}function Gm(s){var f=s.updateQueue;if(f!==null){s.updateQueue=null;var k=s.stateNode;k===null&&(k=s.stateNode=new R_),f.forEach(function(q){var Q=H_.bind(null,s,q);k.has(q)||(k.add(q),q.then(Q,Q))})}}function Ml(s,f){var k=f.deletions;if(k!==null)for(var q=0;q<k.length;q++){var Q=k[q];try{var ie=s,pe=f,Te=pe;e:for(;Te!==null;){switch(Te.tag){case 5:ro=Te.stateNode,Rl=!1;break e;case 3:ro=Te.stateNode.containerInfo,Rl=!0;break e;case 4:ro=Te.stateNode.containerInfo,Rl=!0;break e}Te=Te.return}if(ro===null)throw Error(t(160));Vm(ie,pe,Q),ro=null,Rl=!1;var Be=Q.alternate;Be!==null&&(Be.return=null),Q.return=null}catch(st){Ci(Q,f,st)}}if(f.subtreeFlags&12854)for(f=f.child;f!==null;)Wm(f,s),f=f.sibling}function Wm(s,f){var k=s.alternate,q=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(Ml(f,s),Pu(s),q&4){try{Vh(3,s,s.return),Bp(3,s)}catch(ar){Ci(s,s.return,ar)}try{Vh(5,s,s.return)}catch(ar){Ci(s,s.return,ar)}}break;case 1:Ml(f,s),Pu(s),q&512&&k!==null&&Qf(k,k.return);break;case 5:if(Ml(f,s),Pu(s),q&512&&k!==null&&Qf(k,k.return),s.flags&32){var Q=s.stateNode;try{nt(Q,"")}catch(ar){Ci(s,s.return,ar)}}if(q&4&&(Q=s.stateNode,Q!=null)){var ie=s.memoizedProps,pe=k!==null?k.memoizedProps:ie,Te=s.type,Be=s.updateQueue;if(s.updateQueue=null,Be!==null)try{Te==="input"&&ie.type==="radio"&&ie.name!=null&&ve(Q,ie),We(Te,pe);var st=We(Te,ie);for(pe=0;pe<Be.length;pe+=2){var Ot=Be[pe],At=Be[pe+1];Ot==="style"?or(Q,At):Ot==="dangerouslySetInnerHTML"?Et(Q,At):Ot==="children"?nt(Q,At):v(Q,Ot,At,st)}switch(Te){case"input":He(Q,ie);break;case"textarea":Ce(Q,ie);break;case"select":var Pt=Q._wrapperState.wasMultiple;Q._wrapperState.wasMultiple=!!ie.multiple;var $t=ie.value;$t!=null?Ne(Q,!!ie.multiple,$t,!1):Pt!==!!ie.multiple&&(ie.defaultValue!=null?Ne(Q,!!ie.multiple,ie.defaultValue,!0):Ne(Q,!!ie.multiple,ie.multiple?[]:"",!1))}Q[gu]=ie}catch(ar){Ci(s,s.return,ar)}}break;case 6:if(Ml(f,s),Pu(s),q&4){if(s.stateNode===null)throw Error(t(162));Q=s.stateNode,ie=s.memoizedProps;try{Q.nodeValue=ie}catch(ar){Ci(s,s.return,ar)}}break;case 3:if(Ml(f,s),Pu(s),q&4&&k!==null&&k.memoizedState.isDehydrated)try{ai(f.containerInfo)}catch(ar){Ci(s,s.return,ar)}break;case 4:Ml(f,s),Pu(s);break;case 13:Ml(f,s),Pu(s),Q=s.child,Q.flags&8192&&(ie=Q.memoizedState!==null,Q.stateNode.isHidden=ie,!ie||Q.alternate!==null&&Q.alternate.memoizedState!==null||(E0=Mn())),q&4&&Gm(s);break;case 22:if(Ot=k!==null&&k.memoizedState!==null,s.mode&1?(wo=(st=wo)||Ot,Ml(f,s),wo=st):Ml(f,s),Pu(s),q&8192){if(st=s.memoizedState!==null,(s.stateNode.isHidden=st)&&!Ot&&(s.mode&1)!==0)for(Qt=s,Ot=s.child;Ot!==null;){for(At=Qt=Ot;Qt!==null;){switch(Pt=Qt,$t=Pt.child,Pt.tag){case 0:case 11:case 14:case 15:Vh(4,Pt,Pt.return);break;case 1:Qf(Pt,Pt.return);var Jt=Pt.stateNode;if(typeof Jt.componentWillUnmount=="function"){q=Pt,k=Pt.return;try{f=q,Jt.props=f.memoizedProps,Jt.state=f.memoizedState,Jt.componentWillUnmount()}catch(ar){Ci(q,k,ar)}}break;case 5:Qf(Pt,Pt.return);break;case 22:if(Pt.memoizedState!==null){Xm(At);continue}}$t!==null?($t.return=Pt,Qt=$t):Xm(At)}Ot=Ot.sibling}e:for(Ot=null,At=s;;){if(At.tag===5){if(Ot===null){Ot=At;try{Q=At.stateNode,st?(ie=Q.style,typeof ie.setProperty=="function"?ie.setProperty("display","none","important"):ie.display="none"):(Te=At.stateNode,Be=At.memoizedProps.style,pe=Be!=null&&Be.hasOwnProperty("display")?Be.display:null,Te.style.display=Ct("display",pe))}catch(ar){Ci(s,s.return,ar)}}}else if(At.tag===6){if(Ot===null)try{At.stateNode.nodeValue=st?"":At.memoizedProps}catch(ar){Ci(s,s.return,ar)}}else if((At.tag!==22&&At.tag!==23||At.memoizedState===null||At===s)&&At.child!==null){At.child.return=At,At=At.child;continue}if(At===s)break e;for(;At.sibling===null;){if(At.return===null||At.return===s)break e;Ot===At&&(Ot=null),At=At.return}Ot===At&&(Ot=null),At.sibling.return=At.return,At=At.sibling}}break;case 19:Ml(f,s),Pu(s),q&4&&Gm(s);break;case 21:break;default:Ml(f,s),Pu(s)}}function Pu(s){var f=s.flags;if(f&2){try{e:{for(var k=s.return;k!==null;){if(Um(k)){var q=k;break e}k=k.return}throw Error(t(160))}switch(q.tag){case 5:var Q=q.stateNode;q.flags&32&&(nt(Q,""),q.flags&=-33);var ie=Hm(s);_0(s,ie,Q);break;case 3:case 4:var pe=q.stateNode.containerInfo,Te=Hm(s);w0(s,Te,pe);break;default:throw Error(t(161))}}catch(Be){Ci(s,s.return,Be)}s.flags&=-3}f&4096&&(s.flags&=-4097)}function I_(s,f,k){Qt=s,$m(s)}function $m(s,f,k){for(var q=(s.mode&1)!==0;Qt!==null;){var Q=Qt,ie=Q.child;if(Q.tag===22&&q){var pe=Q.memoizedState!==null||Dp;if(!pe){var Te=Q.alternate,Be=Te!==null&&Te.memoizedState!==null||wo;Te=Dp;var st=wo;if(Dp=pe,(wo=Be)&&!st)for(Qt=Q;Qt!==null;)pe=Qt,Be=pe.child,pe.tag===22&&pe.memoizedState!==null?Km(Q):Be!==null?(Be.return=pe,Qt=Be):Km(Q);for(;ie!==null;)Qt=ie,$m(ie),ie=ie.sibling;Qt=Q,Dp=Te,wo=st}Ym(s)}else(Q.subtreeFlags&8772)!==0&&ie!==null?(ie.return=Q,Qt=ie):Ym(s)}}function Ym(s){for(;Qt!==null;){var f=Qt;if((f.flags&8772)!==0){var k=f.alternate;try{if((f.flags&8772)!==0)switch(f.tag){case 0:case 11:case 15:wo||Bp(5,f);break;case 1:var q=f.stateNode;if(f.flags&4&&!wo)if(k===null)q.componentDidMount();else{var Q=f.elementType===f.type?k.memoizedProps:ma(f.type,k.memoizedProps);q.componentDidUpdate(Q,k.memoizedState,q.__reactInternalSnapshotBeforeUpdate)}var ie=f.updateQueue;ie!==null&&vn(f,ie,q);break;case 3:var pe=f.updateQueue;if(pe!==null){if(k=null,f.child!==null)switch(f.child.tag){case 5:k=f.child.stateNode;break;case 1:k=f.child.stateNode}vn(f,pe,k)}break;case 5:var Te=f.stateNode;if(k===null&&f.flags&4){k=Te;var Be=f.memoizedProps;switch(f.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(f.memoizedState===null){var st=f.alternate;if(st!==null){var Ot=st.memoizedState;if(Ot!==null){var At=Ot.dehydrated;At!==null&&ai(At)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}wo||f.flags&512&&b0(f)}catch(Pt){Ci(f,f.return,Pt)}}if(f===s){Qt=null;break}if(k=f.sibling,k!==null){k.return=f.return,Qt=k;break}Qt=f.return}}function Xm(s){for(;Qt!==null;){var f=Qt;if(f===s){Qt=null;break}var k=f.sibling;if(k!==null){k.return=f.return,Qt=k;break}Qt=f.return}}function Km(s){for(;Qt!==null;){var f=Qt;try{switch(f.tag){case 0:case 11:case 15:var k=f.return;try{Bp(4,f)}catch(Be){Ci(f,k,Be)}break;case 1:var q=f.stateNode;if(typeof q.componentDidMount=="function"){var Q=f.return;try{q.componentDidMount()}catch(Be){Ci(f,Q,Be)}}var ie=f.return;try{b0(f)}catch(Be){Ci(f,ie,Be)}break;case 5:var pe=f.return;try{b0(f)}catch(Be){Ci(f,pe,Be)}}}catch(Be){Ci(f,f.return,Be)}if(f===s){Qt=null;break}var Te=f.sibling;if(Te!==null){Te.return=f.return,Qt=Te;break}Qt=f.return}}var j_=Math.ceil,qp=b.ReactCurrentDispatcher,S0=b.ReactCurrentOwner,sl=b.ReactCurrentBatchConfig,sn=0,La=null,ua=null,no=0,Rs=0,Jf=go(0),ya=0,Gh=null,df=0,zp=0,x0=0,Wh=null,cs=null,E0=0,eh=1/0,Ju=null,Up=!1,P0=null,Nc=null,Hp=!1,Tc=null,Vp=0,$h=0,O0=null,Gp=-1,Wp=0;function Ho(){return(sn&6)!==0?Mn():Gp!==-1?Gp:Gp=Mn()}function Rc(s){return(s.mode&1)===0?1:(sn&2)!==0&&no!==0?no&-no:Qr.transition!==null?(Wp===0&&(Wp=nu()),Wp):(s=Ir,s!==0||(s=window.event,s=s===void 0?16:Uu(s.type)),s)}function Il(s,f,k,q){if(50<$h)throw $h=0,O0=null,Error(t(185));Vs(s,k,q),((sn&2)===0||s!==La)&&(s===La&&((sn&2)===0&&(zp|=k),ya===4&&Mc(s,no)),fs(s,q),k===1&&sn===0&&(f.mode&1)===0&&(eh=Mn()+500,Cl&&oe()))}function fs(s,f){var k=s.callbackNode;ha(s,f);var q=Ri(s,s===La?no:0);if(q===0)k!==null&&Go(k),s.callbackNode=null,s.callbackPriority=0;else if(f=q&-q,s.callbackPriority!==f){if(k!=null&&Go(k),f===1)s.tag===0?te(Qm.bind(null,s)):U(Qm.bind(null,s)),Uf(function(){(sn&6)===0&&oe()}),k=null;else{switch(_s(q)){case 1:k=oo;break;case 4:k=dl;break;case 16:k=Hs;break;case 536870912:k=ru;break;default:k=Hs}k=oy(k,Zm.bind(null,s))}s.callbackPriority=f,s.callbackNode=k}}function Zm(s,f){if(Gp=-1,Wp=0,(sn&6)!==0)throw Error(t(327));var k=s.callbackNode;if(th()&&s.callbackNode!==k)return null;var q=Ri(s,s===La?no:0);if(q===0)return null;if((q&30)!==0||(q&s.expiredLanes)!==0||f)f=$p(s,q);else{f=q;var Q=sn;sn|=2;var ie=ey();(La!==s||no!==f)&&(Ju=null,eh=Mn()+500,gf(s,f));do try{B_();break}catch(Te){Jm(s,Te)}while(!0);Oi(),qp.current=ie,sn=Q,ua!==null?f=0:(La=null,no=0,f=ya)}if(f!==0){if(f===2&&(Q=Wo(s),Q!==0&&(q=Q,f=A0(s,Q))),f===1)throw k=Gh,gf(s,0),Mc(s,q),fs(s,Mn()),k;if(f===6)Mc(s,q);else{if(Q=s.current.alternate,(q&30)===0&&!F_(Q)&&(f=$p(s,q),f===2&&(ie=Wo(s),ie!==0&&(q=ie,f=A0(s,ie))),f===1))throw k=Gh,gf(s,0),Mc(s,q),fs(s,Mn()),k;switch(s.finishedWork=Q,s.finishedLanes=q,f){case 0:case 1:throw Error(t(345));case 2:vf(s,cs,Ju);break;case 3:if(Mc(s,q),(q&130023424)===q&&(f=E0+500-Mn(),10<f)){if(Ri(s,0)!==0)break;if(Q=s.suspendedLanes,(Q&q)!==q){Ho(),s.pingedLanes|=s.suspendedLanes&Q;break}s.timeoutHandle=$a(vf.bind(null,s,cs,Ju),f);break}vf(s,cs,Ju);break;case 4:if(Mc(s,q),(q&4194240)===q)break;for(f=s.eventTimes,Q=-1;0<q;){var pe=31-Ar(q);ie=1<<pe,pe=f[pe],pe>Q&&(Q=pe),q&=~ie}if(q=Q,q=Mn()-q,q=(120>q?120:480>q?480:1080>q?1080:1920>q?1920:3e3>q?3e3:4320>q?4320:1960*j_(q/1960))-q,10<q){s.timeoutHandle=$a(vf.bind(null,s,cs,Ju),q);break}vf(s,cs,Ju);break;case 5:vf(s,cs,Ju);break;default:throw Error(t(329))}}}return fs(s,Mn()),s.callbackNode===k?Zm.bind(null,s):null}function A0(s,f){var k=Wh;return s.current.memoizedState.isDehydrated&&(gf(s,f).flags|=256),s=$p(s,f),s!==2&&(f=cs,cs=k,f!==null&&C0(f)),s}function C0(s){cs===null?cs=s:cs.push.apply(cs,s)}function F_(s){for(var f=s;;){if(f.flags&16384){var k=f.updateQueue;if(k!==null&&(k=k.stores,k!==null))for(var q=0;q<k.length;q++){var Q=k[q],ie=Q.getSnapshot;Q=Q.value;try{if(!jr(ie(),Q))return!1}catch{return!1}}}if(k=f.child,f.subtreeFlags&16384&&k!==null)k.return=f,f=k;else{if(f===s)break;for(;f.sibling===null;){if(f.return===null||f.return===s)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function Mc(s,f){for(f&=~x0,f&=~zp,s.suspendedLanes|=f,s.pingedLanes&=~f,s=s.expirationTimes;0<f;){var k=31-Ar(f),q=1<<k;s[k]=-1,f&=~q}}function Qm(s){if((sn&6)!==0)throw Error(t(327));th();var f=Ri(s,0);if((f&1)===0)return fs(s,Mn()),null;var k=$p(s,f);if(s.tag!==0&&k===2){var q=Wo(s);q!==0&&(f=q,k=A0(s,q))}if(k===1)throw k=Gh,gf(s,0),Mc(s,f),fs(s,Mn()),k;if(k===6)throw Error(t(345));return s.finishedWork=s.current.alternate,s.finishedLanes=f,vf(s,cs,Ju),fs(s,Mn()),null}function k0(s,f){var k=sn;sn|=1;try{return s(f)}finally{sn=k,sn===0&&(eh=Mn()+500,Cl&&oe())}}function pf(s){Tc!==null&&Tc.tag===0&&(sn&6)===0&&th();var f=sn;sn|=1;var k=sl.transition,q=Ir;try{if(sl.transition=null,Ir=1,s)return s()}finally{Ir=q,sl.transition=k,sn=f,(sn&6)===0&&oe()}}function L0(){Rs=Jf.current,Zr(Jf)}function gf(s,f){s.finishedWork=null,s.finishedLanes=0;var k=s.timeoutHandle;if(k!==-1&&(s.timeoutHandle=-1,bc(k)),ua!==null)for(k=ua.return;k!==null;){var q=k;switch(Me(q),q.tag){case 1:q=q.type.childContextTypes,q!=null&&mu();break;case 3:fn(),Zr(ia),Zr(Pi),sa();break;case 5:Ns(q);break;case 4:fn();break;case 13:Zr(hn);break;case 19:Zr(hn);break;case 10:ga(q.type._context);break;case 22:case 23:L0()}k=k.return}if(La=s,ua=s=Ic(s.current,null),no=Rs=f,ya=0,Gh=null,x0=zp=df=0,cs=Wh=null,oa!==null){for(f=0;f<oa.length;f++)if(k=oa[f],q=k.interleaved,q!==null){k.interleaved=null;var Q=q.next,ie=k.pending;if(ie!==null){var pe=ie.next;ie.next=Q,q.next=pe}k.pending=q}oa=null}return s}function Jm(s,f){do{var k=ua;try{if(Oi(),wu.current=Oc,Za){for(var q=on.memoizedState;q!==null;){var Q=q.queue;Q!==null&&(Q.pending=null),q=q.next}Za=!1}if(Ai=0,Un=zn=on=null,yo=!1,Qa=0,S0.current=null,k===null||k.return===null){ya=1,Gh=f,ua=null;break}e:{var ie=s,pe=k.return,Te=k,Be=f;if(f=no,Te.flags|=32768,Be!==null&&typeof Be=="object"&&typeof Be.then=="function"){var st=Be,Ot=Te,At=Ot.tag;if((Ot.mode&1)===0&&(At===0||At===11||At===15)){var Pt=Ot.alternate;Pt?(Ot.updateQueue=Pt.updateQueue,Ot.memoizedState=Pt.memoizedState,Ot.lanes=Pt.lanes):(Ot.updateQueue=null,Ot.memoizedState=null)}var $t=B(pe);if($t!==null){$t.flags&=-257,X($t,pe,Te,ie,f),$t.mode&1&&P(ie,st,f),f=$t,Be=st;var Jt=f.updateQueue;if(Jt===null){var ar=new Set;ar.add(Be),f.updateQueue=ar}else Jt.add(Be);break e}else{if((f&1)===0){P(ie,st,f),N0();break e}Be=Error(t(426))}}else if(ct&&Te.mode&1){var Yi=B(pe);if(Yi!==null){(Yi.flags&65536)===0&&(Yi.flags|=256),X(Yi,pe,Te,ie,f),Xr(Qu(Be,Te));break e}}ie=Be=Qu(Be,Te),ya!==4&&(ya=2),Wh===null?Wh=[ie]:Wh.push(ie),ie=pe;do{switch(ie.tag){case 3:ie.flags|=65536,f&=-f,ie.lanes|=f;var et=Fp(ie,Be,f);va(ie,et);break e;case 1:Te=Be;var $e=ie.type,rt=ie.stateNode;if((ie.flags&128)===0&&(typeof $e.getDerivedStateFromError=="function"||rt!==null&&typeof rt.componentDidCatch=="function"&&(Nc===null||!Nc.has(rt)))){ie.flags|=65536,f&=-f,ie.lanes|=f;var Tt=m(ie,Te,f);va(ie,Tt);break e}}ie=ie.return}while(ie!==null)}ry(k)}catch(sr){f=sr,ua===k&&k!==null&&(ua=k=k.return);continue}break}while(!0)}function ey(){var s=qp.current;return qp.current=Oc,s===null?Oc:s}function N0(){(ya===0||ya===3||ya===2)&&(ya=4),La===null||(df&268435455)===0&&(zp&268435455)===0||Mc(La,no)}function $p(s,f){var k=sn;sn|=2;var q=ey();(La!==s||no!==f)&&(Ju=null,gf(s,f));do try{D_();break}catch(Q){Jm(s,Q)}while(!0);if(Oi(),sn=k,qp.current=q,ua!==null)throw Error(t(261));return La=null,no=0,ya}function D_(){for(;ua!==null;)ty(ua)}function B_(){for(;ua!==null&&!tu();)ty(ua)}function ty(s){var f=ay(s.alternate,s,Rs);s.memoizedProps=s.pendingProps,f===null?ry(s):ua=f,S0.current=null}function ry(s){var f=s;do{var k=f.alternate;if(s=f.return,(f.flags&32768)===0){if(k=N_(k,f,Rs),k!==null){ua=k;return}}else{if(k=T_(k,f),k!==null){k.flags&=32767,ua=k;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{ya=6,ua=null;return}}if(f=f.sibling,f!==null){ua=f;return}ua=f=s}while(f!==null);ya===0&&(ya=5)}function vf(s,f,k){var q=Ir,Q=sl.transition;try{sl.transition=null,Ir=1,q_(s,f,k,q)}finally{sl.transition=Q,Ir=q}return null}function q_(s,f,k,q){do th();while(Tc!==null);if((sn&6)!==0)throw Error(t(327));k=s.finishedWork;var Q=s.finishedLanes;if(k===null)return null;if(s.finishedWork=null,s.finishedLanes=0,k===s.current)throw Error(t(177));s.callbackNode=null,s.callbackPriority=0;var ie=k.lanes|k.childLanes;if(af(s,ie),s===La&&(ua=La=null,no=0),(k.subtreeFlags&2064)===0&&(k.flags&2064)===0||Hp||(Hp=!0,oy(Hs,function(){return th(),null})),ie=(k.flags&15990)!==0,(k.subtreeFlags&15990)!==0||ie){ie=sl.transition,sl.transition=null;var pe=Ir;Ir=1;var Te=sn;sn|=4,S0.current=null,M_(s,k),Wm(k,s),No(Ol),su=!!Wu,Ol=Wu=null,s.current=k,I_(k),vc(),sn=Te,Ir=pe,sl.transition=ie}else s.current=k;if(Hp&&(Hp=!1,Tc=s,Vp=Q),ie=s.pendingLanes,ie===0&&(Nc=null),Kr(k.stateNode),fs(s,Mn()),f!==null)for(q=s.onRecoverableError,k=0;k<f.length;k++)Q=f[k],q(Q.value,{componentStack:Q.stack,digest:Q.digest});if(Up)throw Up=!1,s=P0,P0=null,s;return(Vp&1)!==0&&s.tag!==0&&th(),ie=s.pendingLanes,(ie&1)!==0?s===O0?$h++:($h=0,O0=s):$h=0,oe(),null}function th(){if(Tc!==null){var s=_s(Vp),f=sl.transition,k=Ir;try{if(sl.transition=null,Ir=16>s?16:s,Tc===null)var q=!1;else{if(s=Tc,Tc=null,Vp=0,(sn&6)!==0)throw Error(t(331));var Q=sn;for(sn|=4,Qt=s.current;Qt!==null;){var ie=Qt,pe=ie.child;if((Qt.flags&16)!==0){var Te=ie.deletions;if(Te!==null){for(var Be=0;Be<Te.length;Be++){var st=Te[Be];for(Qt=st;Qt!==null;){var Ot=Qt;switch(Ot.tag){case 0:case 11:case 15:Vh(8,Ot,ie)}var At=Ot.child;if(At!==null)At.return=Ot,Qt=At;else for(;Qt!==null;){Ot=Qt;var Pt=Ot.sibling,$t=Ot.return;if(zm(Ot),Ot===st){Qt=null;break}if(Pt!==null){Pt.return=$t,Qt=Pt;break}Qt=$t}}}var Jt=ie.alternate;if(Jt!==null){var ar=Jt.child;if(ar!==null){Jt.child=null;do{var Yi=ar.sibling;ar.sibling=null,ar=Yi}while(ar!==null)}}Qt=ie}}if((ie.subtreeFlags&2064)!==0&&pe!==null)pe.return=ie,Qt=pe;else e:for(;Qt!==null;){if(ie=Qt,(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,Qt=et;break e}Qt=ie.return}}var $e=s.current;for(Qt=$e;Qt!==null;){pe=Qt;var rt=pe.child;if((pe.subtreeFlags&2064)!==0&&rt!==null)rt.return=pe,Qt=rt;else e:for(pe=$e;Qt!==null;){if(Te=Qt,(Te.flags&2048)!==0)try{switch(Te.tag){case 0:case 11:case 15:Bp(9,Te)}}catch(sr){Ci(Te,Te.return,sr)}if(Te===pe){Qt=null;break e}var Tt=Te.sibling;if(Tt!==null){Tt.return=Te.return,Qt=Tt;break e}Qt=Te.return}}if(sn=Q,oe(),pi&&typeof pi.onPostCommitFiberRoot=="function")try{pi.onPostCommitFiberRoot(so,s)}catch{}q=!0}return q}finally{Ir=k,sl.transition=f}}return!1}function ny(s,f,k){f=Qu(k,f),f=Fp(s,f,1),s=Aa(s,f,1),f=Ho(),s!==null&&(Vs(s,1,f),fs(s,f))}function Ci(s,f,k){if(s.tag===3)ny(s,s,k);else for(;f!==null;){if(f.tag===3){ny(f,s,k);break}else if(f.tag===1){var q=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof q.componentDidCatch=="function"&&(Nc===null||!Nc.has(q))){s=Qu(k,s),s=m(f,s,1),f=Aa(f,s,1),s=Ho(),f!==null&&(Vs(f,1,s),fs(f,s));break}}f=f.return}}function z_(s,f,k){var q=s.pingCache;q!==null&&q.delete(f),f=Ho(),s.pingedLanes|=s.suspendedLanes&k,La===s&&(no&k)===k&&(ya===4||ya===3&&(no&130023424)===no&&500>Mn()-E0?gf(s,0):x0|=k),fs(s,f)}function iy(s,f){f===0&&((s.mode&1)===0?f=1:(f=ja,ja<<=1,(ja&130023424)===0&&(ja=4194304)));var k=Ho();s=Dr(s,f),s!==null&&(Vs(s,f,k),fs(s,k))}function U_(s){var f=s.memoizedState,k=0;f!==null&&(k=f.retryLane),iy(s,k)}function H_(s,f){var k=0;switch(s.tag){case 13:var q=s.stateNode,Q=s.memoizedState;Q!==null&&(k=Q.retryLane);break;case 19:q=s.stateNode;break;default:throw Error(t(314))}q!==null&&q.delete(f),iy(s,k)}var ay;ay=function(s,f,k){if(s!==null)if(s.memoizedProps!==f.pendingProps||ia.current)le=!0;else{if((s.lanes&k)===0&&(f.flags&128)===0)return le=!1,v0(s,f,k);le=(s.flags&131072)!==0}else le=!1,ct&&(f.flags&1048576)!==0&&yt(f,ye,f.index);switch(f.lanes=0,f.tag){case 2:var q=f.type;Ur(s,f),s=f.pendingProps;var Q=Al(f,Pi.current);yn(f,k),Q=al(null,f,q,s,Q,k);var ie=Ja();return f.flags|=1,typeof Q=="object"&&Q!==null&&typeof Q.render=="function"&&Q.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,aa(q)?(ie=!0,is(f)):ie=!1,f.memoizedState=Q.state!==null&&Q.state!==void 0?Q.state:null,yu(f),Q.updater=Cc,f.stateNode=Q,Q._reactInternals=f,Kf(f,q,s,k),f=mn(null,f,q,!0,ie,k)):(f.tag=0,ct&&ie&<(f),_e(null,f,Q,k),f=f.child),f;case 16:q=f.elementType;e:{switch(Ur(s,f),s=f.pendingProps,Q=q._init,q=Q(q._payload),f.type=q,Q=f.tag=G_(q),s=ma(q,s),Q){case 0:f=Ht(null,f,q,s,k);break e;case 1:f=Tn(null,f,q,s,k);break e;case 11:f=Ke(null,f,q,s,k);break e;case 14:f=ut(null,f,q,ma(q.type,s),k);break e}throw Error(t(306,q,""))}return f;case 0:return q=f.type,Q=f.pendingProps,Q=f.elementType===q?Q:ma(q,Q),Ht(s,f,q,Q,k);case 1:return q=f.type,Q=f.pendingProps,Q=f.elementType===q?Q:ma(q,Q),Tn(s,f,q,Q,k);case 3:e:{if(to(f),s===null)throw Error(t(387));q=f.pendingProps,ie=f.memoizedState,Q=ie.element,Xu(s,f),Bo(f,q,null,k);var pe=f.memoizedState;if(q=pe.element,ie.isDehydrated)if(ie={element:q,isDehydrated:!1,cache:pe.cache,pendingSuspenseBoundaries:pe.pendingSuspenseBoundaries,transitions:pe.transitions},f.updateQueue.baseState=ie,f.memoizedState=ie,f.flags&256){Q=Qu(Error(t(423)),f),f=ol(s,f,q,k,Q);break e}else if(q!==Q){Q=Qu(Error(t(424)),f),f=ol(s,f,q,k,Q);break e}else for(Ge=Ui(f.stateNode.containerInfo.firstChild),ze=f,ct=!0,pt=null,k=xr(f,null,q,k),f.child=k;k;)k.flags=k.flags&-3|4096,k=k.sibling;else{if(yr(),q===Q){f=ka(s,f,k);break e}_e(s,f,q,k)}f=f.child}return f;case 5:return bu(f),s===null&&Mt(f),q=f.type,Q=f.pendingProps,ie=s!==null?s.memoizedProps:null,pe=Q.children,uf(q,Q)?pe=null:ie!==null&&uf(q,ie)&&(f.flags|=32),br(s,f),_e(s,f,pe,k),f.child;case 6:return s===null&&Mt(f),null;case 13:return dt(s,f,k);case 4:return qo(f,f.stateNode.containerInfo),q=f.pendingProps,s===null?f.child=ci(f,null,q,k):_e(s,f,q,k),f.child;case 11:return q=f.type,Q=f.pendingProps,Q=f.elementType===q?Q:ma(q,Q),Ke(s,f,q,Q,k);case 7:return _e(s,f,f.pendingProps,k),f.child;case 8:return _e(s,f,f.pendingProps.children,k),f.child;case 12:return _e(s,f,f.pendingProps.children,k),f.child;case 10:e:{if(q=f.type._context,Q=f.pendingProps,ie=f.memoizedProps,pe=Q.value,an(Gi,q._currentValue),q._currentValue=pe,ie!==null)if(jr(ie.value,pe)){if(ie.children===Q.children&&!ia.current){f=ka(s,f,k);break e}}else for(ie=f.child,ie!==null&&(ie.return=f);ie!==null;){var Te=ie.dependencies;if(Te!==null){pe=ie.child;for(var Be=Te.firstContext;Be!==null;){if(Be.context===q){if(ie.tag===1){Be=Xa(-1,k&-k),Be.tag=2;var st=ie.updateQueue;if(st!==null){st=st.shared;var Ot=st.pending;Ot===null?Be.next=Be:(Be.next=Ot.next,Ot.next=Be),st.pending=Be}}ie.lanes|=k,Be=ie.alternate,Be!==null&&(Be.lanes|=k),Ya(ie.return,k,f),Te.lanes|=k;break}Be=Be.next}}else if(ie.tag===10)pe=ie.type===f.type?null:ie.child;else if(ie.tag===18){if(pe=ie.return,pe===null)throw Error(t(341));pe.lanes|=k,Te=pe.alternate,Te!==null&&(Te.lanes|=k),Ya(pe,k,f),pe=ie.sibling}else pe=ie.child;if(pe!==null)pe.return=ie;else for(pe=ie;pe!==null;){if(pe===f){pe=null;break}if(ie=pe.sibling,ie!==null){ie.return=pe.return,pe=ie;break}pe=pe.return}ie=pe}_e(s,f,Q.children,k),f=f.child}return f;case 9:return Q=f.type,q=f.pendingProps.children,yn(f,k),Q=qn(Q),q=q(Q),f.flags|=1,_e(s,f,q,k),f.child;case 14:return q=f.type,Q=ma(q,f.pendingProps),Q=ma(q.type,Q),ut(s,f,q,Q,k);case 15:return Lt(s,f,f.type,f.pendingProps,k);case 17:return q=f.type,Q=f.pendingProps,Q=f.elementType===q?Q:ma(q,Q),Ur(s,f),f.tag=1,aa(q)?(s=!0,is(f)):s=!1,yn(f,k),jp(f,q,Q),Kf(f,q,Q,k),mn(null,f,q,!0,s,k);case 19:return $i(s,f,k);case 22:return Kt(s,f,k)}throw Error(t(156,f.tag))};function oy(s,f){return ws(s,f)}function V_(s,f,k,q){this.tag=s,this.key=k,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=q,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ll(s,f,k,q){return new V_(s,f,k,q)}function T0(s){return s=s.prototype,!(!s||!s.isReactComponent)}function G_(s){if(typeof s=="function")return T0(s)?1:0;if(s!=null){if(s=s.$$typeof,s===L)return 11;if(s===I)return 14}return 2}function Ic(s,f){var k=s.alternate;return k===null?(k=ll(s.tag,f,s.key,s.mode),k.elementType=s.elementType,k.type=s.type,k.stateNode=s.stateNode,k.alternate=s,s.alternate=k):(k.pendingProps=f,k.type=s.type,k.flags=0,k.subtreeFlags=0,k.deletions=null),k.flags=s.flags&14680064,k.childLanes=s.childLanes,k.lanes=s.lanes,k.child=s.child,k.memoizedProps=s.memoizedProps,k.memoizedState=s.memoizedState,k.updateQueue=s.updateQueue,f=s.dependencies,k.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},k.sibling=s.sibling,k.index=s.index,k.ref=s.ref,k}function Yp(s,f,k,q,Q,ie){var pe=2;if(q=s,typeof s=="function")T0(s)&&(pe=1);else if(typeof s=="string")pe=5;else e:switch(s){case T:return mf(k.children,Q,ie,f);case M:pe=8,Q|=8;break;case F:return s=ll(12,k,f,Q|2),s.elementType=F,s.lanes=ie,s;case A:return s=ll(13,k,f,Q),s.elementType=A,s.lanes=ie,s;case N:return s=ll(19,k,f,Q),s.elementType=N,s.lanes=ie,s;case G:return Xp(k,Q,ie,f);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case C:pe=10;break e;case x:pe=9;break e;case L:pe=11;break e;case I:pe=14;break e;case W:pe=16,q=null;break e}throw Error(t(130,s==null?s:typeof s,""))}return f=ll(pe,k,f,Q),f.elementType=s,f.type=q,f.lanes=ie,f}function mf(s,f,k,q){return s=ll(7,s,q,f),s.lanes=k,s}function Xp(s,f,k,q){return s=ll(22,s,q,f),s.elementType=G,s.lanes=k,s.stateNode={isHidden:!1},s}function R0(s,f,k){return s=ll(6,s,null,f),s.lanes=k,s}function M0(s,f,k){return f=ll(4,s.children!==null?s.children:[],s.key,f),f.lanes=k,f.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},f}function W_(s,f,k,q,Q){this.tag=f,this.containerInfo=s,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=q,this.onRecoverableError=Q,this.mutableSourceEagerHydrationData=null}function I0(s,f,k,q,Q,ie,pe,Te,Be){return s=new W_(s,f,k,Te,Be),f===1?(f=1,ie===!0&&(f|=8)):f=0,ie=ll(3,null,null,f),s.current=ie,ie.stateNode=s,ie.memoizedState={element:q,isDehydrated:k,cache:null,transitions:null,pendingSuspenseBoundaries:null},yu(ie),s}function $_(s,f,k){var q=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:j,key:q==null?null:""+q,children:s,containerInfo:f,implementation:k}}function sy(s){if(!s)return ns;s=s._reactInternals;e:{if(en(s)!==s||s.tag!==1)throw Error(t(170));var f=s;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(aa(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(t(171))}if(s.tag===1){var k=s.type;if(aa(k))return Yu(s,k,f)}return f}function ly(s,f,k,q,Q,ie,pe,Te,Be){return s=I0(k,q,!0,s,Q,ie,pe,Te,Be),s.context=sy(null),k=s.current,q=Ho(),Q=Rc(k),ie=Xa(q,Q),ie.callback=f??null,Aa(k,ie,Q),s.current.lanes=Q,Vs(s,Q,q),fs(s,q),s}function Kp(s,f,k,q){var Q=f.current,ie=Ho(),pe=Rc(Q);return k=sy(k),f.context===null?f.context=k:f.pendingContext=k,f=Xa(ie,pe),f.payload={element:s},q=q===void 0?null:q,q!==null&&(f.callback=q),s=Aa(Q,f,pe),s!==null&&(Il(s,Q,pe,ie),kl(s,Q,pe)),pe}function Zp(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function uy(s,f){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var k=s.retryLane;s.retryLane=k!==0&&k<f?k:f}}function j0(s,f){uy(s,f),(s=s.alternate)&&uy(s,f)}function Y_(){return null}var cy=typeof reportError=="function"?reportError:function(s){console.error(s)};function F0(s){this._internalRoot=s}Qp.prototype.render=F0.prototype.render=function(s){var f=this._internalRoot;if(f===null)throw Error(t(409));Kp(s,f,null,null)},Qp.prototype.unmount=F0.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var f=s.containerInfo;pf(function(){Kp(null,s,null,null)}),f[Vi]=null}};function Qp(s){this._internalRoot=s}Qp.prototype.unstable_scheduleHydration=function(s){if(s){var f=$o();s={blockedOn:null,target:s,priority:f};for(var k=0;k<lo.length&&f!==0&&f<lo[k].priority;k++);lo.splice(k,0,s),k===0&&Xs(s)}};function D0(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function Jp(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function fy(){}function X_(s,f,k,q,Q){if(Q){if(typeof q=="function"){var ie=q;q=function(){var st=Zp(pe);ie.call(st)}}var pe=ly(f,q,s,0,null,!1,!1,"",fy);return s._reactRootContainer=pe,s[Vi]=pe.current,Cs(s.nodeType===8?s.parentNode:s),pf(),pe}for(;Q=s.lastChild;)s.removeChild(Q);if(typeof q=="function"){var Te=q;q=function(){var st=Zp(Be);Te.call(st)}}var Be=I0(s,0,!1,null,null,!1,!1,"",fy);return s._reactRootContainer=Be,s[Vi]=Be.current,Cs(s.nodeType===8?s.parentNode:s),pf(function(){Kp(f,Be,k,q)}),Be}function e1(s,f,k,q,Q){var ie=k._reactRootContainer;if(ie){var pe=ie;if(typeof Q=="function"){var Te=Q;Q=function(){var Be=Zp(pe);Te.call(Be)}}Kp(f,pe,s,Q)}else pe=X_(k,f,s,Q,q);return Zp(pe)}Gs=function(s){switch(s.tag){case 3:var f=s.stateNode;if(f.current.memoizedState.isDehydrated){var k=ii(f.pendingLanes);k!==0&&(iu(f,k|1),fs(f,Mn()),(sn&6)===0&&(eh=Mn()+500,oe()))}break;case 13:pf(function(){var q=Dr(s,1);if(q!==null){var Q=Ho();Il(q,s,1,Q)}}),j0(s,1)}},Ws=function(s){if(s.tag===13){var f=Dr(s,134217728);if(f!==null){var k=Ho();Il(f,s,134217728,k)}j0(s,134217728)}},mc=function(s){if(s.tag===13){var f=Rc(s),k=Dr(s,f);if(k!==null){var q=Ho();Il(k,s,f,q)}j0(s,f)}},$o=function(){return Ir},Ss=function(s,f){var k=Ir;try{return Ir=s,f()}finally{Ir=k}},gt=function(s,f,k){switch(f){case"input":if(He(s,k),f=k.name,k.type==="radio"&&f!=null){for(k=s;k.parentNode;)k=k.parentNode;for(k=k.querySelectorAll("input[name="+JSON.stringify(""+f)+'][type="radio"]'),f=0;f<k.length;f++){var q=k[f];if(q!==s&&q.form===s.form){var Q=wi(q);if(!Q)throw Error(t(90));xe(q),He(q,Q)}}}break;case"textarea":Ce(s,k);break;case"select":f=k.value,f!=null&&Ne(s,!!k.multiple,f,!1)}},Bt=k0,Ve=pf;var K_={usingClientEntryPoint:!1,Events:[vu,ui,wi,_t,it,k0]},Yh={findFiberByHostInstance:Ls,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Z_={bundleType:Yh.bundleType,version:Yh.version,rendererPackageName:Yh.rendererPackageName,rendererConfig:Yh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:b.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=Si(s),s===null?null:s.stateNode},findFiberByHostInstance:Yh.findFiberByHostInstance||Y_,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(Z_),pi=t1}catch{}}return hs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=K_,hs.createPortal=function(s,f){var k=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!D0(f))throw Error(t(200));return $_(s,f,null,k)},hs.createRoot=function(s,f){if(!D0(s))throw Error(t(299));var k=!1,q="",Q=cy;return f!=null&&(f.unstable_strictMode===!0&&(k=!0),f.identifierPrefix!==void 0&&(q=f.identifierPrefix),f.onRecoverableError!==void 0&&(Q=f.onRecoverableError)),f=I0(s,1,!1,null,null,k,!1,q,Q),s[Vi]=f.current,Cs(s.nodeType===8?s.parentNode:s),new F0(f)},hs.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var f=s._reactInternals;if(f===void 0)throw typeof s.render=="function"?Error(t(188)):(s=Object.keys(s).join(","),Error(t(268,s)));return s=Si(f),s=s===null?null:s.stateNode,s},hs.flushSync=function(s){return pf(s)},hs.hydrate=function(s,f,k){if(!Jp(f))throw Error(t(200));return e1(null,s,f,!0,k)},hs.hydrateRoot=function(s,f,k){if(!D0(s))throw Error(t(405));var q=k!=null&&k.hydratedSources||null,Q=!1,ie="",pe=cy;if(k!=null&&(k.unstable_strictMode===!0&&(Q=!0),k.identifierPrefix!==void 0&&(ie=k.identifierPrefix),k.onRecoverableError!==void 0&&(pe=k.onRecoverableError)),f=ly(f,null,s,1,k??null,Q,!1,ie,pe),s[Vi]=f.current,Cs(s),q)for(s=0;s<q.length;s++)k=q[s],Q=k._getVersion,Q=Q(k._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[k,Q]:f.mutableSourceEagerHydrationData.push(k,Q);return new Qp(f)},hs.render=function(s,f,k){if(!Jp(f))throw Error(t(200));return e1(null,s,f,!1,k)},hs.unmountComponentAtNode=function(s){if(!Jp(s))throw Error(t(40));return s._reactRootContainer?(pf(function(){e1(null,null,s,!1,function(){s._reactRootContainer=null,s[Vi]=null})}),!0):!1},hs.unstable_batchedUpdates=k0,hs.unstable_renderSubtreeIntoContainer=function(s,f,k,q){if(!Jp(k))throw Error(t(200));if(s==null||s._reactInternals===void 0)throw Error(t(38));return e1(s,f,k,!1,q)},hs.version="18.3.1-next-f1338f8080-20240426",hs}var my;function cw(){if(my)return q0.exports;my=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=t7(),q0.exports}var yy;function r7(){if(yy)return r1;yy=1;var e=cw();return r1.createRoot=e.createRoot,r1.hydrateRoot=e.hydrateRoot,r1}var n7=r7();const fw=mp(n7);var Xh={};function Pr(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 i7={};function z1(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:i7}var hw=Object.assign,P1=Object.getOwnPropertyDescriptor,Nu=Object.defineProperty,yp=Object.prototype,f2=[];Object.freeze(f2);var B2={};Object.freeze(B2);var a7=typeof Proxy<"u",o7=Object.toString();function dw(){a7||Pr("Proxy not available")}function pw(e){var r=!1;return function(){if(!r)return r=!0,e.apply(this,arguments)}}var fh=function(){};function Bs(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()===o7}function gw(e){var r=e==null?void 0:e.constructor;return r?r.name==="GeneratorFunction"||r.displayName==="GeneratorFunction":!1}function bp(e,r,t){Nu(e,r,{enumerable:!1,writable:!0,configurable:!0,value:t})}function vw(e,r,t){Nu(e,r,{enumerable:!1,writable:!1,configurable:!0,value:t})}function Zc(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 s7(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 mw=typeof Object.getOwnPropertySymbols<"u";function l7(e){var r=Object.keys(e);if(!mw)return r;var t=Object.getOwnPropertySymbols(e);return t.length?[].concat(r,t.filter(function(n){return yp.propertyIsEnumerable.call(e,n)})):r}var _h=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:mw?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function yw(e){return e===null?null:typeof e=="object"?""+e:e}function cc(e,r){return yp.hasOwnProperty.call(e,r)}var u7=Object.getOwnPropertyDescriptors||function(r){var t={};return _h(r).forEach(function(n){t[n]=P1(r,n)}),t};function js(e,r){return!!(e&r)}function Fs(e,r,t){return t?e|=r:e&=~r,e}function by(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 c7(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,h7(n.key),n)}}function Rh(e,r,t){return r&&c7(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function hh(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=d7(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 Wc(){return Wc=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},Wc.apply(null,arguments)}function bw(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,h2(e,r)}function h2(e,r){return h2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},h2(e,r)}function f7(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 h7(e){var r=f7(e,"string");return typeof r=="symbol"?r:r+""}function d7(e,r){if(e){if(typeof e=="string")return by(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)?by(e,r):void 0}}var ku=Symbol("mobx-stored-annotations");function Wl(e){function r(t,n){if(_p(n))return e.decorate_20223_(t,n);wp(t,n,e)}return Object.assign(r,e)}function wp(e,r,t){cc(e,ku)||bp(e,ku,Wc({},e[ku])),S7(t)||(e[ku][r]=t)}function p7(e){return cc(e,ku)||bp(e,ku,Wc({},e[ku])),e[ku]}function _p(e){return typeof e=="object"&&typeof e.kind=="string"}var lr=Symbol("mobx administration"),Qc=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_=pn.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 Dw(this)},r.reportChanged=function(){ps(),Bw(this),gs()},r.toString=function(){return this.name_},Rh(e,[{key:"isBeingObserved",get:function(){return js(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=Fs(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return js(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=Fs(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return js(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Fs(this.flags_,e.diffValueMask_,n===1)}}])}();Qc.isBeingObservedMask_=1;Qc.isPendingUnobservationMask_=2;Qc.diffValueMask_=4;var q2=Zc("Atom",Qc);function up(e,r,t){r===void 0&&(r=fh),t===void 0&&(t=fh);var n=new Qc(e);return r!==fh&&Yw(n,r),t!==fh&&W2(n,t),n}function g7(e,r){return e===r}function v7(e,r){return rm(e,r)}function m7(e,r){return rm(e,r,1)}function y7(e,r){return Object.is?Object.is(e,r):e===r?e!==0||1/e===1/r:e!==e&&r!==r}var Cf={identity:g7,structural:v7,default:y7,shallow:m7};function kf(e,r,t){return K1(e)?e:Array.isArray(e)?Rn.array(e,{name:t}):dc(e)?Rn.object(e,void 0,{name:t}):Th(e)?Rn.map(e,{name:t}):uc(e)?Rn.set(e,{name:t}):typeof e=="function"&&!Eh(e)&&!Ph(e)?gw(e)?Nf(e):Sh(t,e):e}function b7(e,r,t){if(e==null||Ra(e)||Vo(e)||ao(e)||ba(e))return e;if(Array.isArray(e))return Rn.array(e,{name:t,deep:!1});if(dc(e))return Rn.object(e,void 0,{name:t,deep:!1});if(Th(e))return Rn.map(e,{name:t,deep:!1});if(uc(e))return Rn.set(e,{name:t,deep:!1})}function H1(e){return e}function w7(e,r){return rm(e,r)?r:e}var ww="override",_7=Wl({annotationType_:ww,make_:x7,extend_:E7,decorate_20223_:P7});function S7(e){return e.annotationType_===ww}function x7(e,r){return 0}function E7(e,r,t,n){Pr("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function P7(e,r){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}function Sp(e,r){return{annotationType_:e,options_:r,make_:O7,extend_:A7,decorate_20223_:C7}}function O7(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(Eh(t.value))return 1;var i=_w(e,this,r,t,!1);return Nu(n,r,i),2}function A7(e,r,t,n){var a=_w(e,this,r,t);return e.defineProperty_(r,a,n)}function C7(e,r){var t=r.kind,n=r.name,a=r.addInitializer,i=this,o=function(c){var h,p,w,d;return $c((h=(p=i.options_)==null?void 0:p.name)!=null?h:n.toString(),c,(w=(d=i.options_)==null?void 0:d.autoAction)!=null?w:!1)};if(t=="field")return function(u){var c,h=u;return Eh(h)||(h=o(h)),(c=i.options_)!=null&&c.bound&&(h=h.bind(this),h.isMobxAction=!0),h};if(t=="method"){var l;return Eh(e)||(e=o(e)),(l=this.options_)!=null&&l.bound&&a(function(){var u=this,c=u[n].bind(u);c.isMobxAction=!0,u[n]=c}),e}Pr("Cannot apply '"+i.annotationType_+"' to '"+String(n)+"' (kind: "+t+"):"+(`
|
|
34
|
-
'`+i.annotationType_+"' can only be used on properties with a function value."))}function k7(e,r,t,n){r.annotationType_,n.value}function _w(e,r,t,n,a){var i,o,l,u,c,h,p;a===void 0&&(a=Rt.safeDescriptors),k7(e,r,t,n);var w=n.value;if((i=r.options_)!=null&&i.bound){var d;w=w.bind((d=e.proxy_)!=null?d:e.target_)}return{value:$c((o=(l=r.options_)==null?void 0:l.name)!=null?o:t.toString(),w,(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 Sw(e,r){return{annotationType_:e,options_:r,make_:L7,extend_:N7,decorate_20223_:T7}}function L7(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)||!Ph(e.target_[r]))&&this.extend_(e,r,t,!1)===null)return 0;if(Ph(t.value))return 1;var i=xw(e,this,r,t,!1,!1);return Nu(n,r,i),2}function N7(e,r,t,n){var a,i=xw(e,this,r,t,(a=this.options_)==null?void 0:a.bound);return e.defineProperty_(r,i,n)}function T7(e,r){var t,n=r.name,a=r.addInitializer;return Ph(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 R7(e,r,t,n){r.annotationType_,n.value}function xw(e,r,t,n,a,i){i===void 0&&(i=Rt.safeDescriptors),R7(e,r,t,n);var o=n.value;if(Ph(o)||(o=Nf(o)),a){var l;o=o.bind((l=e.proxy_)!=null?l:e.target_),o.isMobXFlow=!0}return{value:o,configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function z2(e,r){return{annotationType_:e,options_:r,make_:M7,extend_:I7,decorate_20223_:j7}}function M7(e,r,t){return this.extend_(e,r,t,!1)===null?0:1}function I7(e,r,t,n){return F7(e,this,r,t),e.defineComputedProperty_(r,Wc({},this.options_,{get:t.get,set:t.set}),n)}function j7(e,r){var t=this,n=r.name,a=r.addInitializer;return a(function(){var i=Mf(this)[lr],o=Wc({},t.options_,{get:e,context:this});o.name||(o.name="ObservableObject."+n.toString()),i.values_.set(n,new Xl(o))}),function(){return this[lr].getObservablePropValue_(n)}}function F7(e,r,t,n){r.annotationType_,n.get}function V1(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){var a,i;return z7(e,this),e.defineObservableProperty_(r,t.value,(a=(i=this.options_)==null?void 0:i.enhancer)!=null?a:kf,n)}function q7(e,r){var t=this,n=r.kind,a=r.name,i=new WeakSet;function o(l,u){var c,h,p=Mf(l)[lr],w=new Vc(u,(c=(h=t.options_)==null?void 0:h.enhancer)!=null?c:kf,"ObservableObject."+a.toString(),!1);p.values_.set(a,w),i.add(l)}if(n=="accessor")return{get:function(){return i.has(this)||o(this,e.get.call(this)),this[lr].getObservablePropValue_(a)},set:function(u){return i.has(this)||o(this,u),this[lr].setObservablePropValue_(a,u)},init:function(u){return i.has(this)||o(this,u),u}}}function z7(e,r,t,n){r.annotationType_}var U7="true",H7=Ew();function Ew(e){return{annotationType_:U7,options_:e,make_:V7,extend_:G7,decorate_20223_:W7}}function V7(e,r,t,n){var a,i;if(t.get)return Tf.make_(e,r,t,n);if(t.set){var o=$c(r.toString(),t.set);return n===e.target_?e.defineProperty_(r,{configurable:Rt.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 l;if(gw(t.value)){var u,c=(u=this.options_)!=null&&u.autoBind?Nf.bound:Nf;return c.make_(e,r,t,n)}var h=(l=this.options_)!=null&&l.autoBind?Sh.bound:Sh;return h.make_(e,r,t,n)}var p=((a=this.options_)==null?void 0:a.deep)===!1?Rn.ref:Rn;if(typeof t.value=="function"&&(i=this.options_)!=null&&i.autoBind){var w;t.value=t.value.bind((w=e.proxy_)!=null?w:e.target_)}return p.make_(e,r,t,n)}function G7(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:Rt.safeDescriptors?e.isPlainObject_:!0,set:$c(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 l=((i=this.options_)==null?void 0:i.deep)===!1?Rn.ref:Rn;return l.extend_(e,r,t,n)}function W7(e,r){Pr("'"+this.annotationType_+"' cannot be used as a decorator")}var $7="observable",Y7="observable.ref",X7="observable.shallow",K7="observable.struct",Pw={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Pw);function n1(e){return e||Pw}var d2=V1($7),Z7=V1(Y7,{enhancer:H1}),Q7=V1(X7,{enhancer:b7}),J7=V1(K7,{enhancer:w7}),Ow=Wl(d2);function i1(e){return e.deep===!0?kf:e.deep===!1?H1:t9(e.defaultDecorator)}function e9(e){var r;return e?(r=e.defaultDecorator)!=null?r:Ew(e):void 0}function t9(e){var r,t;return e&&(r=(t=e.options_)==null?void 0:t.enhancer)!=null?r:kf}function Aw(e,r,t){if(_p(r))return d2.decorate_20223_(e,r);if(Af(r)){wp(e,r,d2);return}return K1(e)?e:dc(e)?Rn.object(e,r,t):Array.isArray(e)?Rn.array(e,r):Th(e)?Rn.map(e,r):uc(e)?Rn.set(e,r):typeof e=="object"&&e!==null?e:Rn.box(e,r)}hw(Aw,Ow);var r9={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(Rt.useProxies===!1||n.proxy===!1?lS:Q9)(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 em(r,i1(n),n.name)},object:function(r,t,n){return Jc(function(){return $2(Rt.useProxies===!1||(n==null?void 0:n.proxy)===!1?Mf({},n):Y9({},n),r,t)})},ref:Wl(Z7),shallow:Wl(Q7),deep:Ow,struct:Wl(J7)},Rn=hw(Aw,r9),Cw="computed",n9="computed.struct",p2=z2(Cw),i9=z2(n9,{equals:Cf.structural}),Tf=function(r,t){if(_p(t))return p2.decorate_20223_(r,t);if(Af(t))return wp(r,t,p2);if(dc(r))return Wl(z2(Cw,r));var n=dc(t)?t:{};return n.get=r,n.name||(n.name=r.name||""),new Xl(n)};Object.assign(Tf,p2);Tf.struct=Wl(i9);var wy,_y,O1=0,a9=1,o9=(wy=(_y=P1(function(){},"name"))==null?void 0:_y.configurable)!=null?wy:!1,Sy={value:"action",configurable:!0,writable:!1,enumerable:!1};function $c(e,r,t,n){t===void 0&&(t=!1);function a(){return kw(e,t,r,n||this,arguments)}return a.isMobxAction=!0,a.toString=function(){return r.toString()},o9&&(Sy.value=e,Nu(a,"name",Sy)),a}function kw(e,r,t,n,a){var i=Lw(e,r);try{return t.apply(n,a)}catch(o){throw i.error_=o,o}finally{Nw(i)}}function Lw(e,r,t,n){var a=!1,i=0,o=Rt.trackingDerivation,l=!r||!o;ps();var u=Rt.allowStateChanges;l&&(Rf(),u=G1(!0));var c=$1(!0),h={runAsAction_:l,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:c,notifySpy_:a,startTime_:i,actionId_:a9++,parentActionId_:O1};return O1=h.actionId_,h}function Nw(e){O1!==e.actionId_&&Pr(30),O1=e.parentActionId_,e.error_!==void 0&&(Rt.suppressReactionErrors=!0),W1(e.prevAllowStateChanges_),gh(e.prevAllowStateReads_),gs(),e.runAsAction_&&fc(e.prevDerivation_),Rt.suppressReactionErrors=!1}function U2(e,r){var t=G1(e);try{return r()}finally{W1(t)}}function G1(e){var r=Rt.allowStateChanges;return Rt.allowStateChanges=e,r}function W1(e){Rt.allowStateChanges=e}var Vc=function(e){function r(n,a,i,o,l){var u;return i===void 0&&(i="ObservableValue"),l===void 0&&(l=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=l,u.value_=a(n,void 0,i),u}bw(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!==Rt.UNCHANGED&&this.setNewValue_(a)},t.prepareNewValue_=function(a){if(ul(this)){var i=cl(this,{object:this,type:Tu,newValue:a});if(!i)return Rt.UNCHANGED;a=i.newValue}return a=this.enhancer(a,this.value_,this.name_),this.equals(this.value_,a)?Rt.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 xp(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}),Ep(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 yw(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},r}(Qc),H2=Zc("ObservableValue",Vc),Xl=function(){function e(t){this.dependenciesState_=pn.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=pn.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||Pr(31),this.derivation=t.get,this.name_=t.name||"ComputedValue",t.set&&(this.setter_=$c("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(){v9(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&&Pr(32,this.name_,this.derivation),Rt.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)g2(this)&&(this.warnAboutUntrackedRead_(),ps(),this.value_=this.computeValue_(!1),gs());else if(Dw(this),g2(this)){var n=Rt.trackingContext;this.keepAlive_&&!n&&(Rt.trackingContext=this),this.trackAndCompute()&&g9(this),Rt.trackingContext=n}var a=this.value_;if(g1(a))throw a.cause;return a},r.set=function(n){if(this.setter_){this.isRunningSetter&&Pr(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else Pr(34,this.name_)},r.trackAndCompute=function(){var n=this.value_,a=this.dependenciesState_===pn.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=G1(!1),i;if(n)i=Tw(this,this.derivation,this.scope_);else if(Rt.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_||(v2(this),this.value_=void 0)},r.observe_=function(n,a){var i=this,o=!0,l=void 0;return G2(function(){var u=i.get();if(!o||a){var c=Rf();n({observableKind:"computed",debugObjectName:i.name_,type:Tu,object:i,newValue:u,oldValue:l}),fc(c)}o=!1,l=u})},r.warnAboutUntrackedRead_=function(){},r.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},r.valueOf=function(){return yw(this.get())},r[Symbol.toPrimitive]=function(){return this.valueOf()},Rh(e,[{key:"isComputing",get:function(){return js(this.flags_,e.isComputingMask_)},set:function(n){this.flags_=Fs(this.flags_,e.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return js(this.flags_,e.isRunningSetterMask_)},set:function(n){this.flags_=Fs(this.flags_,e.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return js(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=Fs(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return js(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=Fs(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return js(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Fs(this.flags_,e.diffValueMask_,n===1)}}])}();Xl.isComputingMask_=1;Xl.isRunningSetterMask_=2;Xl.isBeingObservedMask_=4;Xl.isPendingUnobservationMask_=8;Xl.diffValueMask_=16;var Lf=Zc("ComputedValue",Xl),pn;(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_"})(pn||(pn={}));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 g2(e){switch(e.dependenciesState_){case pn.UP_TO_DATE_:return!1;case pn.NOT_TRACKING_:case pn.STALE_:return!0;case pn.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(Rt.disableErrorBoundaries)o.get();else try{o.get()}catch{return fc(t),gh(r),!0}if(e.dependenciesState_===pn.STALE_)return fc(t),gh(r),!0}}return Rw(e),fc(t),gh(r),!1}}}function s9(){return Rt.trackingDerivation!==null}function Tw(e,r,t){var n=$1(!0);Rw(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++Rt.runId;var a=Rt.trackingDerivation;Rt.trackingDerivation=e,Rt.inBatch++;var i;if(Rt.disableErrorBoundaries===!0)i=r.call(t);else try{i=r.call(t)}catch(o){i=new C1(o)}return Rt.inBatch--,Rt.trackingDerivation=a,l9(e),gh(n),i}function l9(e){for(var r=e.observing_,t=e.observing_=e.newObserving_,n=pn.UP_TO_DATE_,a=0,i=e.unboundDepsCount_,o=0;o<i;o++){var l=t[o];l.diffValue===0&&(l.diffValue=1,a!==o&&(t[a]=l),a++),l.dependenciesState_>n&&(n=l.dependenciesState_)}for(t.length=a,e.newObserving_=null,i=r.length;i--;){var u=r[i];u.diffValue===0&&jw(u,e),u.diffValue=0}for(;a--;){var c=t[a];c.diffValue===1&&(c.diffValue=0,p9(c,e))}n!==pn.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function v2(e){var r=e.observing_;e.observing_=[];for(var t=r.length;t--;)jw(r[t],e);e.dependenciesState_=pn.NOT_TRACKING_}function V2(e){var r=Rf();try{return e()}finally{fc(r)}}function Rf(){var e=Rt.trackingDerivation;return Rt.trackingDerivation=null,e}function fc(e){Rt.trackingDerivation=e}function $1(e){var r=Rt.allowStateReads;return Rt.allowStateReads=e,r}function gh(e){Rt.allowStateReads=e}function Rw(e){if(e.dependenciesState_!==pn.UP_TO_DATE_){e.dependenciesState_=pn.UP_TO_DATE_;for(var r=e.observing_,t=r.length;t--;)r[t].lowestObserverState_=pn.UP_TO_DATE_}}var u9=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],ip=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,Mw=!1,Rt=function(){var e=z1();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(v1=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new ip().version&&(v1=!1),v1?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new ip):(setTimeout(function(){Mw||Pr(35)},1),new ip)}();function c9(){if((Rt.pendingReactions.length||Rt.inBatch||Rt.isRunningReactions)&&Pr(36),Mw=!0,v1){var e=z1();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Rt=new ip}}function Iw(){return Rt}function f9(){var e=new ip;for(var r in e)u9.indexOf(r)===-1&&(Rt[r]=e[r]);Rt.allowStateChanges=!Rt.enforceActions}function h9(e){return e.observers_&&e.observers_.size>0}function d9(e){return e.observers_}function p9(e,r){e.observers_.add(r),e.lowestObserverState_>r.dependenciesState_&&(e.lowestObserverState_=r.dependenciesState_)}function jw(e,r){e.observers_.delete(r),e.observers_.size===0&&Fw(e)}function Fw(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,Rt.pendingUnobservations.push(e))}function ps(){Rt.inBatch++}function gs(){if(--Rt.inBatch===0){qw();for(var e=Rt.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_())}Rt.pendingUnobservations=[]}}function Dw(e){var r=Rt.trackingDerivation;return r!==null?(r.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=r.runId_,r.newObserving_[r.unboundDepsCount_++]=e,!e.isBeingObserved&&Rt.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&Rt.inBatch>0&&Fw(e),!1)}function Bw(e){e.lowestObserverState_!==pn.STALE_&&(e.lowestObserverState_=pn.STALE_,e.observers_.forEach(function(r){r.dependenciesState_===pn.UP_TO_DATE_&&r.onBecomeStale_(),r.dependenciesState_=pn.STALE_}))}function g9(e){e.lowestObserverState_!==pn.STALE_&&(e.lowestObserverState_=pn.STALE_,e.observers_.forEach(function(r){r.dependenciesState_===pn.POSSIBLY_STALE_?r.dependenciesState_=pn.STALE_:r.dependenciesState_===pn.UP_TO_DATE_&&(e.lowestObserverState_=pn.UP_TO_DATE_)}))}function v9(e){e.lowestObserverState_===pn.UP_TO_DATE_&&(e.lowestObserverState_=pn.POSSIBLY_STALE_,e.observers_.forEach(function(r){r.dependenciesState_===pn.UP_TO_DATE_&&(r.dependenciesState_=pn.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_=pn.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,Rt.pendingReactions.push(this),qw())},r.runReaction_=function(){if(!this.isDisposed){ps(),this.isScheduled=!1;var n=Rt.trackingContext;if(Rt.trackingContext=this,g2(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(a){this.reportExceptionInDerivation_(a)}}Rt.trackingContext=n,gs()}},r.track=function(n){if(!this.isDisposed){ps(),this.isRunning=!0;var a=Rt.trackingContext;Rt.trackingContext=this;var i=Tw(this,n,void 0);Rt.trackingContext=a,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&v2(this),g1(i)&&this.reportExceptionInDerivation_(i.cause),gs()}},r.reportExceptionInDerivation_=function(n){var a=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(Rt.disableErrorBoundaries)throw n;var i="[mobx] uncaught error in '"+this+"'";Rt.suppressReactionErrors||console.error(i,n),Rt.globalReactionErrorHandlers.forEach(function(o){return o(n,a)})},r.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(ps(),v2(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[lr]=this,i},r.toString=function(){return"Reaction["+this.name_+"]"},r.trace=function(n){},Rh(e,[{key:"isDisposed",get:function(){return js(this.flags_,e.isDisposedMask_)},set:function(n){this.flags_=Fs(this.flags_,e.isDisposedMask_,n)}},{key:"isScheduled",get:function(){return js(this.flags_,e.isScheduledMask_)},set:function(n){this.flags_=Fs(this.flags_,e.isScheduledMask_,n)}},{key:"isTrackPending",get:function(){return js(this.flags_,e.isTrackPendingMask_)},set:function(n){this.flags_=Fs(this.flags_,e.isTrackPendingMask_,n)}},{key:"isRunning",get:function(){return js(this.flags_,e.isRunningMask_)},set:function(n){this.flags_=Fs(this.flags_,e.isRunningMask_,n)}},{key:"diffValue",get:function(){return js(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Fs(this.flags_,e.diffValueMask_,n===1)}}])}();Kl.isDisposedMask_=1;Kl.isScheduledMask_=2;Kl.isTrackPendingMask_=4;Kl.isRunningMask_=8;Kl.diffValueMask_=16;function m9(e){return Rt.globalReactionErrorHandlers.push(e),function(){var r=Rt.globalReactionErrorHandlers.indexOf(e);r>=0&&Rt.globalReactionErrorHandlers.splice(r,1)}}var y9=100,m2=function(r){return r()};function qw(){Rt.inBatch>0||Rt.isRunningReactions||m2(b9)}function b9(){Rt.isRunningReactions=!0;for(var e=Rt.pendingReactions,r=0;e.length>0;){++r===y9&&(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_()}Rt.isRunningReactions=!1}var k1=Zc("Reaction",Kl);function w9(e){var r=m2;m2=function(n){return e(function(){return r(n)})}}function ap(){return!1}function zw(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var Uw="action",_9="action.bound",Hw="autoAction",S9="autoAction.bound",Vw="<unnamed action>",y2=Sp(Uw),x9=Sp(_9,{bound:!0}),b2=Sp(Hw,{autoAction:!0}),E9=Sp(S9,{autoAction:!0,bound:!0});function Gw(e){var r=function(n,a){if(Bs(n))return $c(n.name||Vw,n,e);if(Bs(a))return $c(n,a,e);if(_p(a))return(e?b2:y2).decorate_20223_(n,a);if(Af(a))return wp(n,a,e?b2:y2);if(Af(n))return Wl(Sp(e?Hw:Uw,{name:n,autoAction:e}))};return r}var ca=Gw(!1);Object.assign(ca,y2);var Sh=Gw(!0);Object.assign(Sh,b2);ca.bound=Wl(x9);Sh.bound=Wl(E9);function xh(e){return kw(e.name||Vw,!1,e,this,void 0)}function Eh(e){return Bs(e)&&e.isMobxAction===!0}function G2(e,r){var t,n,a,i;r===void 0&&(r=B2);var o=(t=(n=r)==null?void 0:n.name)!=null?t:"Autorun",l=!r.scheduler&&!r.delay,u;if(l)u=new Kl(o,function(){this.track(p)},r.onError,r.requiresObservable);else{var c=Ww(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 P9=function(r){return r()};function Ww(e){return e.scheduler?e.scheduler:e.delay?function(r){return setTimeout(r,e.delay)}:P9}function $w(e,r,t){var n,a,i;t===void 0&&(t=B2);var o=(n=t.name)!=null?n:"Reaction",l=ca(o,t.onError?O9(t.onError,r):r),u=!t.scheduler&&!t.delay,c=Ww(t),h=!0,p=!1,w,d=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 S=!1,y=w;_.track(function(){var g=U2(!1,function(){return e(_)});S=h||!d(w,g),w=g}),(h&&t.fireImmediately||!h&&S)&&l(w,y,_),h=!1}}return(a=t)!=null&&(a=a.signal)!=null&&a.aborted||_.schedule_(),_.getDisposer_((i=t)==null?void 0:i.signal)}function O9(e,r){return function(){try{return r.apply(this,arguments)}catch(t){e.call(this,t)}}}var A9="onBO",C9="onBUO";function Yw(e,r,t){return Xw(A9,e,r,t)}function W2(e,r,t){return Xw(C9,e,r,t)}function Xw(e,r,t,n){var a=typeof n=="function"?Mu(r,t):Mu(r),i=Bs(n)?n:t,o=e+"L";return a[o]?a[o].add(i):a[o]=new Set([i]),function(){var l=a[o];l&&(l.delete(i),l.size===0&&delete a[o])}}var k9="never",a1="always",L9="observed";function Kw(e){e.isolateGlobalState===!0&&c9();var r=e.useProxies,t=e.enforceActions;if(r!==void 0&&(Rt.useProxies=r===a1?!0:r===k9?!1:typeof Proxy<"u"),r==="ifavailable"&&(Rt.verifyProxies=!0),t!==void 0){var n=t===a1?a1:t===L9;Rt.enforceActions=n,Rt.allowStateChanges=!(n===!0||n===a1)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(a){a in e&&(Rt[a]=!!e[a])}),Rt.allowStateReads=!Rt.observableRequiresReaction,e.reactionScheduler&&w9(e.reactionScheduler)}function $2(e,r,t,n){var a=u7(r);return Jc(function(){var i=Mf(e,n)[lr];_h(a).forEach(function(o){i.extend_(o,a[o],t&&o in t?t[o]:!0)})}),e}function Zw(e,r){return Qw(Mu(e,r))}function Qw(e){var r={name:e.name_};return e.observing_&&e.observing_.length>0&&(r.dependencies=T9(e.observing_).map(Qw)),r}function N9(e,r){return Jw(Mu(e,r))}function Jw(e){var r={name:e.name_};return h9(e)&&(r.observers=Array.from(d9(e)).map(Jw)),r}function T9(e){return Array.from(new Set(e))}var R9=0;function Y1(){this.message="FLOW_CANCELLED"}Y1.prototype=Object.create(Error.prototype);function M9(e){return e instanceof Y1}var H0=Sw("flow"),I9=Sw("flow.bound",{bound:!0}),Nf=Object.assign(function(r,t){if(_p(t))return H0.decorate_20223_(r,t);if(Af(t))return wp(r,t,H0);var n=r,a=n.name||"<unnamed flow>",i=function(){var l=this,u=arguments,c=++R9,h=ca(a+" - runid: "+c+" - init",n).apply(l,u),p,w=void 0,d=new Promise(function(_,E){var S=0;p=E;function y(b){w=void 0;var O;try{O=ca(a+" - runid: "+c+" - yield "+S++,h.next).call(h,b)}catch(j){return E(j)}v(O)}function g(b){w=void 0;var O;try{O=ca(a+" - runid: "+c+" - yield "+S++,h.throw).call(h,b)}catch(j){return E(j)}v(O)}function v(b){if(Bs(b==null?void 0:b.then)){b.then(v,E);return}return b.done?_(b.value):(w=Promise.resolve(b.value),w.then(y,g))}y(void 0)});return d.cancel=ca(a+" - runid: "+c+" - cancel",function(){try{w&&xy(w);var _=h.return(void 0),E=Promise.resolve(_.value);E.then(fh,fh),xy(E),p(new Y1)}catch(S){p(S)}}),d};return i.isMobXFlow=!0,i},H0);Nf.bound=Wl(I9);function xy(e){Bs(e.cancel)&&e.cancel()}function j9(e){return e}function Ph(e){return(e==null?void 0:e.isMobXFlow)===!0}function Y2(e,r,t){var n;return ao(e)||Vo(e)||H2(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 Bs(t)?D9(e,r,t):F9(e,r)}function F9(e,r){return Zl(e).intercept_(r)}function D9(e,r,t){return Zl(e,r).intercept_(t)}function e6(e,r){if(r===void 0)return Lf(e);if(Ra(e)===!1||!e[lr].values_.has(r))return!1;var t=Mu(e,r);return Lf(t)}function B9(e){return e6(e)}function t6(e,r){return e6(e,r)}function r6(e,r){return e?r!==void 0?Ra(e)?e[lr].values_.has(r):!1:Ra(e)||!!e[lr]||q2(e)||k1(e)||Lf(e):!1}function K1(e){return r6(e)}function n6(e,r){return r6(e,r)}function cp(e){if(Ra(e))return e[lr].keys_();if(ao(e)||ba(e))return Array.from(e.keys());if(Vo(e))return e.map(function(r,t){return t});Pr(5)}function X2(e){if(Ra(e))return cp(e).map(function(r){return e[r]});if(ao(e))return cp(e).map(function(r){return e.get(r)});if(ba(e))return Array.from(e.values());if(Vo(e))return e.slice();Pr(6)}function i6(e){if(Ra(e))return cp(e).map(function(r){return[r,e[r]]});if(ao(e))return cp(e).map(function(r){return[r,e.get(r)]});if(ba(e))return Array.from(e.entries());if(Vo(e))return e.map(function(r,t){return[t,r]});Pr(7)}function K2(e,r,t){if(arguments.length===2&&!ba(e)){ps();var n=r;try{for(var a in n)K2(e,a,n[a])}finally{gs()}return}Ra(e)?e[lr].set_(r,t):ao(e)?e.set(r,t):ba(e)?e.add(r):Vo(e)?(typeof r!="number"&&(r=parseInt(r,10)),r<0&&Pr("Invalid index: '"+r+"'"),ps(),r>=e.length&&(e.length=r+1),e[r]=t,gs()):Pr(8)}function q9(e,r){Ra(e)?e[lr].delete_(r):ao(e)||ba(e)?e.delete(r):Vo(e)?(typeof r!="number"&&(r=parseInt(r,10)),e.splice(r,1)):Pr(9)}function a6(e,r){if(Ra(e))return e[lr].has_(r);if(ao(e))return e.has(r);if(ba(e))return e.has(r);if(Vo(e))return r>=0&&r<e.length;Pr(10)}function z9(e,r){if(a6(e,r)){if(Ra(e))return e[lr].get_(r);if(ao(e))return e.get(r);if(Vo(e))return e[r];Pr(11)}}function Z2(e,r,t){if(Ra(e))return e[lr].defineProperty_(r,t);Pr(39)}function o6(e){if(Ra(e))return e[lr].ownKeys_();Pr(38)}function Z1(e,r,t,n){return Bs(t)?H9(e,r,t,n):U9(e,r,t)}function U9(e,r,t){return Zl(e).observe_(r,t)}function H9(e,r,t,n){return Zl(e,r).observe_(t,n)}function o1(e,r,t){return e.set(r,t),t}function sh(e,r){if(e==null||typeof e!="object"||e instanceof Date||!K1(e))return e;if(H2(e)||Lf(e))return sh(e.get(),r);if(r.has(e))return r.get(e);if(Vo(e)){var t=o1(r,e,new Array(e.length));return e.forEach(function(o,l){t[l]=sh(o,r)}),t}if(ba(e)){var n=o1(r,e,new Set);return e.forEach(function(o){n.add(sh(o,r))}),n}if(ao(e)){var a=o1(r,e,new Map);return e.forEach(function(o,l){a.set(l,sh(o,r))}),a}else{var i=o1(r,e,{});return o6(e).forEach(function(o){yp.propertyIsEnumerable.call(e,o)&&(i[o]=sh(e[o],r))}),i}}function V9(e,r){return sh(e,new Map)}function G9(){}function Cu(e,r){r===void 0&&(r=void 0),ps();try{return e.apply(r)}finally{gs()}}function w2(e,r,t){return arguments.length===1||r&&typeof r=="object"?W9(e,r):s6(e,r,t||{})}function s6(e,r,t){var n;if(typeof t.timeout=="number"){var a=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!o[lr].isDisposed)if(o(),t.onError)t.onError(a);else throw a},t.timeout)}t.name="When";var i=$c("When-effect",r),o=G2(function(l){var u=U2(!1,e);u&&(l.dispose(),n&&clearTimeout(n),i())},t);return o}function W9(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,l){var u,c=s6(e,o,Wc({},r,{onError:l}));n=function(){c(),l(new Error("WHEN_CANCELLED"))},a=function(){c(),l(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 rh(e){return e[lr]}var $9={has:function(r,t){return rh(r).has_(t)},get:function(r,t){return rh(r).get_(t)},set:function(r,t,n){var a;return Af(t)?(a=rh(r).set_(t,n,!0))!=null?a:!0:!1},deleteProperty:function(r,t){var n;return Af(t)?(n=rh(r).delete_(t,!0))!=null?n:!0:!1},defineProperty:function(r,t,n){var a;return(a=rh(r).defineProperty_(t,n))!=null?a:!0},ownKeys:function(r){return rh(r).ownKeys_()},preventExtensions:function(r){Pr(13)}};function Y9(e,r){var t,n;return dw(),e=Mf(e,r),(n=(t=e[lr]).proxy_)!=null?n:t.proxy_=new Proxy(e,$9)}function ul(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function xp(e,r){var t=e.interceptors_||(e.interceptors_=[]);return t.push(r),pw(function(){var n=t.indexOf(r);n!==-1&&t.splice(n,1)})}function cl(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&&Pr(14),!!r);a++);return r}finally{fc(t)}}function $l(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Ep(e,r){var t=e.changeListeners_||(e.changeListeners_=[]);return t.push(r),pw(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 Q2(e,r,t){return Jc(function(){var n,a=Mf(e,t)[lr];(n=r)!=null||(r=p7(e)),_h(r).forEach(function(i){return a.make_(i,r[i])})}),e}var V0=Symbol("mobx-keys");function X9(e,r,t){return dc(e)?$2(e,e,r,t):(Jc(function(){var n=Mf(e,t)[lr];if(!e[V0]){var a=Object.getPrototypeOf(e),i=new Set([].concat(_h(e),_h(a)));i.delete("constructor"),i.delete(lr),bp(a,V0,i)}e[V0].forEach(function(o){return n.make_(o,r&&o in r?r[o]:!0)})}),e)}var Ey="splice",Tu="update",K9=1e4,Z9={get:function(r,t){var n=r[lr];return t===lr?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[lr];return t==="length"&&a.setArrayLength_(n),typeof t=="symbol"||isNaN(t)?r[t]=n:a.set_(parseInt(t),n),!0},preventExtensions:function(){Pr(15)}},J2=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 Qc(t),this.enhancer_=function(o,l){return n(o,l,"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 xp(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}),Ep(this,n)},r.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},r.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&Pr("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_&&Pr(16),this.lastKnownLength_+=a,this.legacyMode_&&a>0&&h6(n+a+1)},r.spliceWithArray_=function(n,a,i){var o=this;this.atom_;var l=this.values_.length;if(n===void 0?n=0:n>l?n=l:n<0&&(n=Math.max(0,l+n)),arguments.length===1?a=l-n:a==null?a=0:a=Math.max(0,Math.min(a,l-n)),i===void 0&&(i=f2),ul(this)){var u=cl(this,{object:this.proxy_,type:Ey,index:n,removedCount:a,added:i});if(!u)return f2;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_(l,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<K9){var o;return(o=this.values_).splice.apply(o,[n,a].concat(i))}else{var l=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 l}},r.notifyArrayChildUpdate_=function(n,a,i){var o=!this.owned_&&ap(),l=$l(this),u=l||o?{observableKind:"array",object:this.proxy_,type:Tu,debugObjectName:this.atom_.name_,index:n,newValue:a,oldValue:i}:null;this.atom_.reportChanged(),l&&Yl(this,u)},r.notifyArraySplice_=function(n,a,i){var o=!this.owned_&&ap(),l=$l(this),u=l||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Ey,index:n,removed:i,added:a,removedCount:i.length,addedCount:a.length}:null;this.atom_.reportChanged(),l&&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&&Pr(17,n,i.length),n<i.length){this.atom_;var o=i[n];if(ul(this)){var l=cl(this,{type:Tu,object:this.proxy_,index:n,newValue:a});if(!l)return;a=l.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 Q9(e,r,t,n){return t===void 0&&(t="ObservableArray"),n===void 0&&(n=!1),dw(),Jc(function(){var a=new J2(t,r,n,!1);vw(a.values_,lr,a);var i=new Proxy(a.values_,Z9);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[lr];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[lr];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[lr].spliceWithArray_(r,t,n)},push:function(){for(var r=this[lr],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[lr].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var r=this[lr],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 Rt.trackingDerivation&&Pr(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Rt.trackingDerivation&&Pr(37,"sort");var r=this.slice();return r.sort.apply(r,arguments),this.replace(r),this},remove:function(r){var t=this[lr],n=t.dehanceValues_(t.values_).indexOf(r);return n>-1?(this.splice(n,1),!0):!1}};Kn("at",qs);Kn("concat",qs);Kn("flat",qs);Kn("includes",qs);Kn("indexOf",qs);Kn("join",qs);Kn("lastIndexOf",qs);Kn("slice",qs);Kn("toString",qs);Kn("toLocaleString",qs);Kn("toSorted",qs);Kn("toSpliced",qs);Kn("with",qs);Kn("every",Ql);Kn("filter",Ql);Kn("find",Ql);Kn("findIndex",Ql);Kn("findLast",Ql);Kn("findLastIndex",Ql);Kn("flatMap",Ql);Kn("forEach",Ql);Kn("map",Ql);Kn("some",Ql);Kn("toReversed",Ql);Kn("reduce",l6);Kn("reduceRight",l6);function Kn(e,r){typeof Array.prototype[e]=="function"&&(L1[e]=r(e))}function qs(e){return function(){var r=this[lr];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[lr];a.atom_.reportObserved();var i=a.dehanceValues_(a.values_);return i[e](function(o,l){return r.call(t,o,l,n)})}}function l6(e){return function(){var r=this,t=this[lr];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_),a=arguments[0];return arguments[0]=function(i,o,l){return a(i,o,l,r)},n[e].apply(n,arguments)}}var J9=Zc("ObservableArrayAdministration",J2);function Vo(e){return U1(e)&&J9(e[lr])}var eS={},Uc="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[lr]=eS,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,Bs(Map)||Pr(18),Jc(function(){i.keysAtom_=up("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(!Rt.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),W2(o,function(){return a.hasMap_.delete(n)})}return i.get()},r.set=function(n,a){var i=this.has_(n);if(ul(this)){var o=cl(this,{type:i?Tu:Uc,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_,ul(this)){var i=cl(this,{type:N1,object:this,name:n});if(!i)return!1}if(this.has_(n)){var o=ap(),l=$l(this),u=l||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)}),l&&Yl(this,u),!0}return!1},r.updateValue_=function(n,a){var i=this.data_.get(n);if(a=i.prepareNewValue_(a),a!==Rt.UNCHANGED){var o=ap(),l=$l(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:Tu,object:this,oldValue:i.value_,name:n,newValue:a}:null;i.setNewValue_(a),l&&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=ap(),l=$l(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:Uc,object:this,name:n,newValue:a}:null;l&&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 Py({next:function(){var o=a.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:n.get(u)}}})},r.entries=function(){var n=this,a=this.keys();return Py({next:function(){var o=a.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:[u,n.get(u)]}}})},r[Symbol.iterator]=function(){return this.entries()},r.forEach=function(n,a){for(var i=hh(this),o;!(o=i()).done;){var l=o.value,u=l[0],c=l[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)?l7(n).forEach(function(i){return a.set(i,n[i])}):Array.isArray(n)?n.forEach(function(i){var o=i[0],l=i[1];return a.set(o,l)}):Th(n)?(s7(n)||Pr(19,n),n.forEach(function(i,o){return a.set(o,i)})):n!=null&&Pr(20,n)}),this},r.clear=function(){var n=this;Cu(function(){V2(function(){for(var a=hh(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=tS(n),o=new Map,l=!1,u=hh(a.data_.keys()),c;!(c=u()).done;){var h=c.value;if(!i.has(h)){var p=a.delete(h);if(p)l=!0;else{var w=a.data_.get(h);o.set(h,w)}}}for(var d=hh(i.entries()),_;!(_=d()).done;){var E=_.value,S=E[0],y=E[1],g=a.data_.has(S);if(a.set(S,y),a.data_.has(S)){var v=a.data_.get(S);o.set(S,v),g||(l=!0)}}if(!l)if(a.data_.size!==o.size)a.keysAtom_.reportChanged();else for(var b=a.data_.keys(),O=o.keys(),j=b.next(),T=O.next();!j.done;){if(j.value!==T.value){a.keysAtom_.reportChanged();break}j=b.next(),T=O.next()}a.data_=o}),this},r.toString=function(){return"[object ObservableMap]"},r.toJSON=function(){return Array.from(this)},r.observe_=function(n,a){return Ep(this,n)},r.intercept_=function(n){return xp(this,n)},Rh(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),ao=Zc("ObservableMap",Q1);function Py(e){return e[Symbol.toStringTag]="MapIterator",nm(e)}function tS(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 Pr(21,e)}var rS={},em=function(){function e(t,n,a){var i=this;n===void 0&&(n=kf),a===void 0&&(a="ObservableSet"),this.name_=void 0,this[lr]=rS,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,Bs(Set)||Pr(22),this.enhancer_=function(o,l){return n(o,l,a)},Jc(function(){i.atom_=up(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=hh(n.data_.values()),i;!(i=a()).done;){var o=i.value;n.delete(o)}})})},r.forEach=function(n,a){for(var i=hh(this),o;!(o=i()).done;){var l=o.value;n.call(a,l,l,this)}},r.add=function(n){var a=this;if(this.atom_,ul(this)){var i=cl(this,{type:Uc,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,l=$l(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:Uc,object:this,newValue:n}:null;l&&Yl(this,u)}return this},r.delete=function(n){var a=this;if(ul(this)){var i=cl(this,{type:N1,object:this,oldValue:n});if(!i)return!1}if(this.has(n)){var o=!1,l=$l(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:N1,object:this,oldValue:n}:null;return Cu(function(){a.atom_.reportChanged(),a.data_.delete(n)}),l&&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 Oy({next:function(){var i=n.next(),o=i.value,l=i.done;return l?{value:void 0,done:l}:{value:[o,o],done:l}}})},r.keys=function(){return this.values()},r.values=function(){this.atom_.reportObserved();var n=this,a=this.data_.values();return Oy({next:function(){var o=a.next(),l=o.value,u=o.done;return u?{value:void 0,done:u}:{value:n.dehanceValue_(l),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&&Pr("Cannot initialize set from "+n)}),this},r.observe_=function(n,a){return Ep(this,n)},r.intercept_=function(n){return xp(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=Zc("ObservableSet",em);function Oy(e){return e[Symbol.toStringTag]="SetIterator",nm(e)}var Ay=Object.create(null),Cy="remove",u6=function(){function e(t,n,a,i){n===void 0&&(n=new Map),i===void 0&&(i=H7),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 Qc("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(ul(this)){var o=cl(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!==Rt.UNCHANGED){var l=$l(this),u=!1,c=l||u?{type:Tu,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:i.value_,name:n,newValue:a}:null;i.setNewValue_(a),l&&Yl(this,c)}return!0},r.get_=function(n){return Rt.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(!Rt.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;Pr(1,a.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==yp;){var l=P1(o,n);if(l){var u=a.make_(this,n,l,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}Ly(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 l=i.extend_(this,n,a,o);return l&&Ly(this,i,n),l},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(ul(this)){var l=cl(this,{object:this.proxy_||this.target_,name:n,type:Uc,newValue:a.value});if(!l)return null;var u=l.newValue;a.value!==u&&(a=Wc({},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 l=this.delete_(n);if(!l)return l;if(ul(this)){var u=cl(this,{object:this.proxy_||this.target_,name:n,type:Uc,newValue:a});if(!u)return null;a=u.newValue}var c=ky(n),h={configurable:Rt.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(ul(this)){var l=cl(this,{object:this.proxy_||this.target_,name:n,type:Uc,newValue:void 0});if(!l)return null}a.name||(a.name="ObservableObject.key"),a.context=this.proxy_||this.target_;var u=ky(n),c={configurable:Rt.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(ul(this)){var i=cl(this,{object:this.proxy_||this.target_,name:n,type:Cy});if(!i)return null}try{var o;ps();var l=$l(this),u=!1,c=this.values_.get(n),h=void 0;if(!c&&(l||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_),Bw(c)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(n))==null||o.set(n in this.target_),l||u){var w={type:Cy,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:h,name:n};l&&Yl(this,w)}}finally{gs()}return!0},r.observe_=function(n,a){return Ep(this,n)},r.intercept_=function(n){return xp(this,n)},r.notifyPropertyAddition_=function(n,a){var i,o=$l(this),l=!1;if(o||l){var u=o||l?{type:Uc,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(),_h(this.target_)},r.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Mf(e,r){var t;if(cc(e,lr))return e;var n=(t=r==null?void 0:r.name)!=null?t:"ObservableObject",a=new u6(e,new Map,String(n),e9(r));return bp(e,lr,a),e}var nS=Zc("ObservableObjectAdministration",u6);function ky(e){return Ay[e]||(Ay[e]={get:function(){return this[lr].getObservablePropValue_(e)},set:function(t){return this[lr].setObservablePropValue_(e,t)}})}function Ra(e){return U1(e)?nS(e[lr]):!1}function Ly(e,r,t){var n;(n=e.target_[ku])==null||delete n[t]}var iS=f6(0),aS=function(){var e=!1,r={};return Object.defineProperty(r,"0",{set:function(){e=!0}}),Object.create(r)[0]=1,e===!1}(),G0=0,c6=function(){};function oS(e,r){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,r):e.prototype.__proto__!==void 0?e.prototype.__proto__=r:e.prototype=r}oS(c6,Array.prototype);var tm=function(e){function r(n,a,i,o){var l;return i===void 0&&(i="ObservableArray"),o===void 0&&(o=!1),l=e.call(this)||this,Jc(function(){var u=new J2(i,a,o,!0);u.proxy_=l,vw(l,lr,u),n&&n.length&&l.spliceWithArray(0,0,n),aS&&Object.defineProperty(l,"0",iS)}),l}bw(r,e);var t=r.prototype;return t.concat=function(){this[lr].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(l){return Vo(l)?l.slice():l}))},t[Symbol.iterator]=function(){var n=this,a=0;return nm({next:function(){return a<n.length?{value:n[a++],done:!1}:{done:!0,value:void 0}}})},Rh(r,[{key:"length",get:function(){return this[lr].getArrayLength_()},set:function(a){this[lr].setArrayLength_(a)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(c6);Object.entries(L1).forEach(function(e){var r=e[0],t=e[1];r!=="concat"&&bp(tm.prototype,r,t)});function f6(e){return{enumerable:!1,configurable:!0,get:function(){return this[lr].get_(e)},set:function(t){this[lr].set_(e,t)}}}function sS(e){Nu(tm.prototype,""+e,f6(e))}function h6(e){if(e>G0){for(var r=G0;r<e+100;r++)sS(r);G0=e}}h6(1e3);function lS(e,r,t){return new tm(e,r,t)}function Mu(e,r){if(typeof e=="object"&&e!==null){if(Vo(e))return r!==void 0&&Pr(23),e[lr].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||Pr(25,r,T1(e)),t}if(Ra(e)){if(!r)return Pr(26);var n=e[lr].values_.get(r);return n||Pr(27,r,T1(e)),n}if(q2(e)||Lf(e)||k1(e))return e}else if(Bs(e)&&k1(e[lr]))return e[lr];Pr(28)}function Zl(e,r){if(e||Pr(29),r!==void 0)return Zl(Mu(e,r));if(q2(e)||Lf(e)||k1(e)||ao(e)||ba(e))return e;if(e[lr])return e[lr];Pr(24,e)}function T1(e,r){var t;if(r!==void 0)t=Mu(e,r);else{if(Eh(e))return e.name;Ra(e)||ao(e)||ba(e)?t=Zl(e):t=Mu(e)}return t.name_}function Jc(e){var r=Rf(),t=G1(!0);ps();try{return e()}finally{gs(),W1(t),fc(r)}}var Ny=yp.toString;function rm(e,r,t){return t===void 0&&(t=-1),_2(e,r,t)}function _2(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=Ny.call(e);if(o!==Ny.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=Ty(e),r=Ty(r);var l=o==="[object Array]";if(!l){if(typeof e!="object"||typeof r!="object")return!1;var u=e.constructor,c=r.constructor;if(u!==c&&!(Bs(u)&&u instanceof u&&Bs(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),l){if(h=e.length,h!==r.length)return!1;for(;h--;)if(!_2(e[h],r[h],t-1,n,a))return!1}else{var p=Object.keys(e),w=p.length;if(Object.keys(r).length!==w)return!1;for(var d=0;d<w;d++){var _=p[d];if(!(cc(r,_)&&_2(e[_],r[_],t-1,n,a)))return!1}}return n.pop(),a.pop(),!0}function Ty(e){return Vo(e)?e.slice():Th(e)||ao(e)||uc(e)||ba(e)?Array.from(e.entries()):e}var Ry,uS=((Ry=z1().Iterator)==null?void 0:Ry.prototype)||{};function nm(e){return e[Symbol.iterator]=cS,Object.assign(Object.create(uS),e)}function cS(){return this}["Symbol","Map","Set"].forEach(function(e){var r=z1();typeof r[e]>"u"&&Pr("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:zw,extras:{getDebugName:T1},$mobx:lr});const fS=Object.freeze(Object.defineProperty({__proto__:null,$mobx:lr,FlowCancellationError:Y1,ObservableMap:Q1,ObservableSet:em,Reaction:Kl,_allowStateChanges:U2,_allowStateChangesInsideComputed:xh,_allowStateReadsEnd:gh,_allowStateReadsStart:$1,_autoAction:Sh,_endAction:Nw,_getAdministration:Zl,_getGlobalState:Iw,_interceptReads:Y2,_isComputingDerivation:s9,_resetGlobalState:f9,_startAction:Lw,action:ca,autorun:G2,comparer:Cf,computed:Tf,configure:Kw,createAtom:up,defineProperty:Z2,entries:i6,extendObservable:$2,flow:Nf,flowResult:j9,get:z9,getAtom:Mu,getDebugName:T1,getDependencyTree:Zw,getObserverTree:N9,has:a6,intercept:X1,isAction:Eh,isBoxedObservable:H2,isComputed:B9,isComputedProp:t6,isFlow:Ph,isFlowCancellationError:M9,isObservable:K1,isObservableArray:Vo,isObservableMap:ao,isObservableObject:Ra,isObservableProp:n6,isObservableSet:ba,keys:cp,makeAutoObservable:X9,makeObservable:Q2,observable:Rn,observe:Z1,onBecomeObserved:Yw,onBecomeUnobserved:W2,onReactionError:m9,override:_7,ownKeys:o6,reaction:$w,remove:q9,runInAction:xh,set:K2,spy:zw,toJS:V9,trace:G9,transaction:Cu,untracked:V2,values:X2,when:w2},Symbol.toStringTag,{value:"Module"}));if(!ni.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!Q2)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var hS=cw();function dS(e){e()}function d6(e){e||(e=dS),Kw({reactionScheduler:e})}var pS=function(){return!0};function gS(e){return Zw(e)}var p6=!1;function g6(e){p6=e}function im(){return p6}var vS=1e4,mS=1e4,yS=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=vS),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,mS))}}),e}(),bS=typeof FinalizationRegistry<"u"?FinalizationRegistry:yS,R1=new bS(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 My;function wS(){if(My)return $0;My=1;var e=di();function r(p,w){return p===w&&(p!==0||1/p===1/w)||p!==p&&w!==w}var t=typeof Object.is=="function"?Object.is:r,n=e.useState,a=e.useEffect,i=e.useLayoutEffect,o=e.useDebugValue;function l(p,w){var d=w(),_=n({inst:{value:d,getSnapshot:w}}),E=_[0].inst,S=_[1];return i(function(){E.value=d,E.getSnapshot=w,u(E)&&S({inst:E})},[p,d,w]),a(function(){return u(E)&&S({inst:E}),p(function(){u(E)&&S({inst:E})})},[p]),o(d),d}function u(p){var w=p.getSnapshot;p=p.value;try{var d=w();return!t(p,d)}catch{return!0}}function c(p,w){return w()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:l;return $0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,$0}var Iy;function _S(){return Iy||(Iy=1,W0.exports=wS()),W0.exports}var SS=_S();function jy(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 am(e,r){if(r===void 0&&(r="observed"),im())return e();var t=Gr.useRef(null);if(!t.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:r,subscribe:function(l){return R1.unregister(n),n.onStoreChange=l,n.reaction||(jy(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||(jy(a),R1.register(t,a,a)),Gr.useDebugValue(a.reaction,gS),SS.useSyncExternalStore(a.subscribe,a.getSnapshot,a.getSnapshot);var i,o;if(a.reaction.track(function(){try{i=e()}catch(l){o=l}}),o)throw o;return i}var Y0,X0,v6=typeof Symbol=="function"&&Symbol.for,xS=(X0=(Y0=Object.getOwnPropertyDescriptor(function(){},"name"))===null||Y0===void 0?void 0:Y0.configurable)!==null&&X0!==void 0?X0:!1,Fy=v6?Symbol.for("react.forward_ref"):typeof ni.forwardRef=="function"&&ni.forwardRef(function(e){return null}).$$typeof,Dy=v6?Symbol.for("react.memo"):typeof ni.memo=="function"&&ni.memo(function(e){return null}).$$typeof;function ES(e,r){var t;if(Dy&&e.$$typeof===Dy)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(im())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(Fy&&e.$$typeof===Fy&&(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(l,u){return am(function(){return a(l,u)},i)};return o.displayName=e.displayName,xS&&Object.defineProperty(o,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(o.contextTypes=e.contextTypes),n&&(o=ni.forwardRef(o)),o=ni.memo(o),OS(e,o),o}var PS={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function OS(e,r){Object.keys(e).forEach(function(t){PS[t]||Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))})}function m6(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:am(n)}m6.displayName="Observer";function AS(e,r){return ni.useState(function(){return Rn(e(),r,{autoBind:!0})})[0]}function y6(e){var r=ni.useState(function(){return Rn(e,{},{deep:!1})})[0];return xh(function(){Object.assign(r,e)}),r}function CS(e,r){var t=r&&y6(r);return ni.useState(function(){return Rn(e(t),void 0,{autoBind:!0})})[0]}var K0;d6(hS.unstable_batchedUpdates);var kS=(K0=R1.finalizeAllImmediately)!==null&&K0!==void 0?K0:function(){};function LS(e,r){return r===void 0&&(r="observed"),am(e,r)}function NS(e){g6(e)}const TS=Object.freeze(Object.defineProperty({__proto__:null,Observer:m6,_observerFinalizationRegistry:R1,clearTimers:kS,enableStaticRendering:g6,isObserverBatched:pS,isUsingStaticRendering:im,observer:ES,observerBatching:d6,useAsObservableSource:y6,useLocalObservable:AS,useLocalStore:CS,useObserver:LS,useStaticRendering:NS},Symbol.toStringTag,{value:"Module"})),zs=Kc(TS);var yf={};const fl=Kc(fS);var m1={exports:{}},Kh={},Z0={},Q0={},By;function Mr(){return By||(By=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 wh<"u"?wh: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={},qy;function Li(){return qy||(qy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const r=Mr();class t{constructor(b=[1,0,0,1,0,0]){this.dirty=!1,this.m=b&&b.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new t(this.m)}copyInto(b){b.m[0]=this.m[0],b.m[1]=this.m[1],b.m[2]=this.m[2],b.m[3]=this.m[3],b.m[4]=this.m[4],b.m[5]=this.m[5]}point(b){const O=this.m;return{x:O[0]*b.x+O[2]*b.y+O[4],y:O[1]*b.x+O[3]*b.y+O[5]}}translate(b,O){return this.m[4]+=this.m[0]*b+this.m[2]*O,this.m[5]+=this.m[1]*b+this.m[3]*O,this}scale(b,O){return this.m[0]*=b,this.m[1]*=b,this.m[2]*=O,this.m[3]*=O,this}rotate(b){const O=Math.cos(b),j=Math.sin(b),T=this.m[0]*O+this.m[2]*j,M=this.m[1]*O+this.m[3]*j,F=this.m[0]*-j+this.m[2]*O,C=this.m[1]*-j+this.m[3]*O;return this.m[0]=T,this.m[1]=M,this.m[2]=F,this.m[3]=C,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(b,O){const j=this.m[0]+this.m[2]*O,T=this.m[1]+this.m[3]*O,M=this.m[2]+this.m[0]*b,F=this.m[3]+this.m[1]*b;return this.m[0]=j,this.m[1]=T,this.m[2]=M,this.m[3]=F,this}multiply(b){const O=this.m[0]*b.m[0]+this.m[2]*b.m[1],j=this.m[1]*b.m[0]+this.m[3]*b.m[1],T=this.m[0]*b.m[2]+this.m[2]*b.m[3],M=this.m[1]*b.m[2]+this.m[3]*b.m[3],F=this.m[0]*b.m[4]+this.m[2]*b.m[5]+this.m[4],C=this.m[1]*b.m[4]+this.m[3]*b.m[5]+this.m[5];return this.m[0]=O,this.m[1]=j,this.m[2]=T,this.m[3]=M,this.m[4]=F,this.m[5]=C,this}invert(){const b=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),O=this.m[3]*b,j=-this.m[1]*b,T=-this.m[2]*b,M=this.m[0]*b,F=b*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),C=b*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=O,this.m[1]=j,this.m[2]=T,this.m[3]=M,this.m[4]=F,this.m[5]=C,this}getMatrix(){return this.m}decompose(){const b=this.m[0],O=this.m[1],j=this.m[2],T=this.m[3],M=this.m[4],F=this.m[5],C=b*T-O*j,x={x:M,y:F,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(b!=0||O!=0){const L=Math.sqrt(b*b+O*O);x.rotation=O>0?Math.acos(b/L):-Math.acos(b/L),x.scaleX=L,x.scaleY=C/L,x.skewX=(b*j+O*T)/C,x.skewY=0}else if(j!=0||T!=0){const L=Math.sqrt(j*j+T*T);x.rotation=Math.PI/2-(T>0?Math.acos(-j/L):-Math.acos(j/L)),x.scaleX=C/L,x.scaleY=L,x.skewX=0,x.skewY=(b*j+O*T)/C}return x.rotation=e.Util._getRotation(x.rotation),x}}e.Transform=t;const n="[object Array]",a="[object Number]",i="[object String]",o="[object Boolean]",l=Math.PI/180,u=180/Math.PI,c="#",h="",p="0",w="Konva warning: ",d="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]},S=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let y=[];const g=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(v){setTimeout(v,60)};e.Util={_isElement(v){return!!(v&&v.nodeType==1)},_isFunction(v){return!!(v&&v.constructor&&v.call&&v.apply)},_isPlainObject(v){return!!v&&v.constructor===Object},_isArray(v){return Object.prototype.toString.call(v)===n},_isNumber(v){return Object.prototype.toString.call(v)===a&&!isNaN(v)&&isFinite(v)},_isString(v){return Object.prototype.toString.call(v)===i},_isBoolean(v){return Object.prototype.toString.call(v)===o},isObject(v){return v instanceof Object},isValidSelector(v){if(typeof v!="string")return!1;const b=v[0];return b==="#"||b==="."||b===b.toUpperCase()},_sign(v){return v===0||v>0?1:-1},requestAnimFrame(v){y.push(v),y.length===1&&g(function(){const b=y;y=[],b.forEach(function(O){O()})})},createCanvasElement(){const v=document.createElement("canvas");try{v.style=v.style||{}}catch{}return v},createImageElement(){return document.createElement("img")},_isInDocument(v){for(;v=v.parentNode;)if(v==document)return!0;return!1},_urlToImage(v,b){const O=e.Util.createImageElement();O.onload=function(){b(O)},O.src=v},_rgbToHex(v,b,O){return((1<<24)+(v<<16)+(b<<8)+O).toString(16).slice(1)},_hexToRgb(v){v=v.replace(c,h);const b=parseInt(v,16);return{r:b>>16&255,g:b>>8&255,b:b&255}},getRandomColor(){let v=(Math.random()*16777215<<0).toString(16);for(;v.length<6;)v=p+v;return c+v},getRGB(v){let b;return v in E?(b=E[v],{r:b[0],g:b[1],b:b[2]}):v[0]===c?this._hexToRgb(v.substring(1)):v.substr(0,4)===_?(b=S.exec(v.replace(/ /g,"")),{r:parseInt(b[1],10),g:parseInt(b[2],10),b:parseInt(b[3],10)}):{r:0,g:0,b:0}},colorToRGBA(v){return v=v||"black",e.Util._namedColorToRBA(v)||e.Util._hex3ColorToRGBA(v)||e.Util._hex4ColorToRGBA(v)||e.Util._hex6ColorToRGBA(v)||e.Util._hex8ColorToRGBA(v)||e.Util._rgbColorToRGBA(v)||e.Util._rgbaColorToRGBA(v)||e.Util._hslColorToRGBA(v)},_namedColorToRBA(v){const b=E[v.toLowerCase()];return b?{r:b[0],g:b[1],b:b[2],a:1}:null},_rgbColorToRGBA(v){if(v.indexOf("rgb(")===0){v=v.match(/rgb\(([^)]+)\)/)[1];const b=v.split(/ *, */).map(Number);return{r:b[0],g:b[1],b:b[2],a:1}}},_rgbaColorToRGBA(v){if(v.indexOf("rgba(")===0){v=v.match(/rgba\(([^)]+)\)/)[1];const b=v.split(/ *, */).map((O,j)=>O.slice(-1)==="%"?j===3?parseInt(O)/100:parseInt(O)/100*255:Number(O));return{r:b[0],g:b[1],b:b[2],a:b[3]}}},_hex8ColorToRGBA(v){if(v[0]==="#"&&v.length===9)return{r:parseInt(v.slice(1,3),16),g:parseInt(v.slice(3,5),16),b:parseInt(v.slice(5,7),16),a:parseInt(v.slice(7,9),16)/255}},_hex6ColorToRGBA(v){if(v[0]==="#"&&v.length===7)return{r:parseInt(v.slice(1,3),16),g:parseInt(v.slice(3,5),16),b:parseInt(v.slice(5,7),16),a:1}},_hex4ColorToRGBA(v){if(v[0]==="#"&&v.length===5)return{r:parseInt(v[1]+v[1],16),g:parseInt(v[2]+v[2],16),b:parseInt(v[3]+v[3],16),a:parseInt(v[4]+v[4],16)/255}},_hex3ColorToRGBA(v){if(v[0]==="#"&&v.length===4)return{r:parseInt(v[1]+v[1],16),g:parseInt(v[2]+v[2],16),b:parseInt(v[3]+v[3],16),a:1}},_hslColorToRGBA(v){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(v)){const[b,...O]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(v),j=Number(O[0])/360,T=Number(O[1])/100,M=Number(O[2])/100;let F,C,x;if(T===0)return x=M*255,{r:Math.round(x),g:Math.round(x),b:Math.round(x),a:1};M<.5?F=M*(1+T):F=M+T-M*T;const L=2*M-F,A=[0,0,0];for(let N=0;N<3;N++)C=j+1/3*-(N-1),C<0&&C++,C>1&&C--,6*C<1?x=L+(F-L)*6*C:2*C<1?x=F:3*C<2?x=L+(F-L)*(2/3-C)*6:x=L,A[N]=x*255;return{r:Math.round(A[0]),g:Math.round(A[1]),b:Math.round(A[2]),a:1}}},haveIntersection(v,b){return!(b.x>v.x+v.width||b.x+b.width<v.x||b.y>v.y+v.height||b.y+b.height<v.y)},cloneObject(v){const b={};for(const O in v)this._isPlainObject(v[O])?b[O]=this.cloneObject(v[O]):this._isArray(v[O])?b[O]=this.cloneArray(v[O]):b[O]=v[O];return b},cloneArray(v){return v.slice(0)},degToRad(v){return v*l},radToDeg(v){return v*u},_degToRad(v){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(v)},_radToDeg(v){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(v)},_getRotation(v){return r.Konva.angleDeg?e.Util.radToDeg(v):v},_capitalize(v){return v.charAt(0).toUpperCase()+v.slice(1)},throw(v){throw new Error(d+v)},error(v){console.error(d+v)},warn(v){r.Konva.showWarnings&&console.warn(w+v)},each(v,b){for(const O in v)b(O,v[O])},_inRange(v,b,O){return b<=v&&v<O},_getProjectionToSegment(v,b,O,j,T,M){let F,C,x;const L=(v-O)*(v-O)+(b-j)*(b-j);if(L==0)F=v,C=b,x=(T-O)*(T-O)+(M-j)*(M-j);else{const A=((T-v)*(O-v)+(M-b)*(j-b))/L;A<0?(F=v,C=b,x=(v-T)*(v-T)+(b-M)*(b-M)):A>1?(F=O,C=j,x=(O-T)*(O-T)+(j-M)*(j-M)):(F=v+A*(O-v),C=b+A*(j-b),x=(F-T)*(F-T)+(C-M)*(C-M))}return[F,C,x]},_getProjectionToLine(v,b,O){const j=e.Util.cloneObject(v);let T=Number.MAX_VALUE;return b.forEach(function(M,F){if(!O&&F===b.length-1)return;const C=b[(F+1)%b.length],x=e.Util._getProjectionToSegment(M.x,M.y,C.x,C.y,v.x,v.y),L=x[0],A=x[1],N=x[2];N<T&&(j.x=L,j.y=A,T=N)}),j},_prepareArrayForTween(v,b,O){const j=[],T=[];if(v.length>b.length){const F=b;b=v,v=F}for(let F=0;F<v.length;F+=2)j.push({x:v[F],y:v[F+1]});for(let F=0;F<b.length;F+=2)T.push({x:b[F],y:b[F+1]});const M=[];return T.forEach(function(F){const C=e.Util._getProjectionToLine(F,j,O);M.push(C.x),M.push(C.y)}),M},_prepareToStringify(v){let b;v.visitedByCircularReferenceRemoval=!0;for(const O in v)if(v.hasOwnProperty(O)&&v[O]&&typeof v[O]=="object"){if(b=Object.getOwnPropertyDescriptor(v,O),v[O].visitedByCircularReferenceRemoval||e.Util._isElement(v[O]))if(b.configurable)delete v[O];else return null;else if(e.Util._prepareToStringify(v[O])===null)if(b.configurable)delete v[O];else return null}return delete v.visitedByCircularReferenceRemoval,v},_assign(v,b){for(const O in b)v[O]=b[O];return v},_getFirstPointerId(v){return v.touches?v.changedTouches[0].identifier:v.pointerId||999},releaseCanvas(...v){r.Konva.releaseCanvasOnDestroy&&v.forEach(b=>{b.width=0,b.height=0})},drawRoundedRectPath(v,b,O,j){let T=0,M=0,F=0,C=0;typeof j=="number"?T=M=F=C=Math.min(j,b/2,O/2):(T=Math.min(j[0]||0,b/2,O/2),M=Math.min(j[1]||0,b/2,O/2),C=Math.min(j[2]||0,b/2,O/2),F=Math.min(j[3]||0,b/2,O/2)),v.moveTo(T,0),v.lineTo(b-M,0),v.arc(b-M,M,M,Math.PI*3/2,0,!1),v.lineTo(b,O-C),v.arc(b-C,O-C,C,0,Math.PI/2,!1),v.lineTo(F,O),v.arc(F,O-F,F,Math.PI/2,Math.PI,!1),v.lineTo(0,T),v.arc(T,T,T,Math.PI,Math.PI*3/2,!1)}}}(J0)),J0}var Zh={},eg={},ds={},zy;function Wr(){if(zy)return ds;zy=1,Object.defineProperty(ds,"__esModule",{value:!0}),ds.RGBComponent=n,ds.alphaComponent=a,ds.getNumberValidator=i,ds.getNumberOrArrayOfNumbersValidator=o,ds.getNumberOrAutoValidator=l,ds.getStringValidator=u,ds.getStringOrGradientValidator=c,ds.getFunctionValidator=h,ds.getNumberArrayValidator=p,ds.getBooleanValidator=w,ds.getComponentValidator=d;const e=Mr(),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,S){let y=r.Util._isNumber(E),g=r.Util._isArray(E)&&E.length==_;return!y&&!g&&r.Util.warn(t(E)+' is a not valid value for "'+S+'" attribute. The value should be a number or Array<number>('+_+")"),E}}function l(){if(e.Konva.isUnminified)return function(_,E){var S=r.Util._isNumber(_),y=_==="auto";return S||y||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 S=r.Util._isString(_),y=Object.prototype.toString.call(_)==="[object CanvasGradient]"||_&&_.addColorStop;return S||y||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 S=Int8Array?Object.getPrototypeOf(Int8Array):null;return S&&_ instanceof S||(r.Util._isArray(_)?_.forEach(function(y){r.Util._isNumber(y)||r.Util.warn('"'+E+'" attribute has non numeric element '+y+". 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 w(){if(e.Konva.isUnminified)return function(_,E){var S=_===!0||_===!1;return S||r.Util.warn(t(_)+' is a not valid value for "'+E+'" attribute. The value should be a boolean.'),_}}function d(_){if(e.Konva.isUnminified)return function(E,S){return E==null||r.Util.isObject(E)||r.Util.warn(t(E)+' is a not valid value for "'+S+'" attribute. The value should be an object with properties '+_),E}}return ds}var Uy;function Hr(){return Uy||(Uy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const r=Li(),t=Wr(),n="get",a="set";e.Factory={addGetterSetter(i,o,l,u,c){e.Factory.addGetter(i,o,l),e.Factory.addSetter(i,o,u,c),e.Factory.addOverloadedGetterSetter(i,o)},addGetter(i,o,l){var u=n+r.Util._capitalize(o);i.prototype[u]=i.prototype[u]||function(){const c=this.attrs[o];return c===void 0?l:c}},addSetter(i,o,l,u){var c=a+r.Util._capitalize(o);i.prototype[c]||e.Factory.overWriteSetter(i,o,l,u)},overWriteSetter(i,o,l,u){var c=a+r.Util._capitalize(o);i.prototype[c]=function(h){return l&&h!==void 0&&h!==null&&(h=l.call(this,h,o)),this._setAttr(o,h),u&&u.call(this),this}},addComponentsGetterSetter(i,o,l,u,c){const h=l.length,p=r.Util._capitalize,w=n+p(o),d=a+p(o);i.prototype[w]=function(){const E={};for(let S=0;S<h;S++){const y=l[S];E[y]=this.getAttr(o+p(y))}return E};const _=(0,t.getComponentValidator)(l);i.prototype[d]=function(E){const S=this.attrs[o];u&&(E=u.call(this,E,o)),_&&_.call(this,E,o);for(const y in E)E.hasOwnProperty(y)&&this._setAttr(o+p(y),E[y]);return E||l.forEach(y=>{this._setAttr(o+p(y),void 0)}),this._fireChangeEvent(o,S,E),c&&c.call(this),this},e.Factory.addOverloadedGetterSetter(i,o)},addOverloadedGetterSetter(i,o){var l=r.Util._capitalize(o),u=a+l,c=n+l;i.prototype[o]=function(){return arguments.length?(this[u](arguments[0]),this):this[c]()}},addDeprecatedGetterSetter(i,o,l,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?l: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(l,u){const c=i.prototype[u],h=n+r.Util._capitalize(l),p=a+r.Util._capitalize(l);function w(){c.apply(this,arguments),r.Util.error('"'+l+'" method is deprecated and will be removed soon. Use ""'+u+'" instead.')}i.prototype[l]=w,i.prototype[h]=w,i.prototype[p]=w})},afterSetFilter(){this._filterUpToDate=!1}}}(eg)),eg}var ec={},tc={},Hy;function b6(){if(Hy)return tc;Hy=1,Object.defineProperty(tc,"__esModule",{value:!0}),tc.HitContext=tc.SceneContext=tc.Context=void 0;const e=Li(),r=Mr();function t(y){const g=[],v=y.length,b=e.Util;for(let O=0;O<v;O++){let j=y[O];b._isNumber(j)?j=Math.round(j*1e3)/1e3:b._isString(j)||(j=j+""),g.push(j)}return g}const n=",",a="(",i=")",o="([",l="])",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"],w=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"],d=100;let _=class{constructor(g){this.canvas=g,r.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(g){g.fillEnabled()&&this._fill(g)}_fill(g){}strokeShape(g){g.hasStroke()&&this._stroke(g)}_stroke(g){}fillStrokeShape(g){g.attrs.fillAfterStrokeEnabled?(this.strokeShape(g),this.fillShape(g)):(this.fillShape(g),this.strokeShape(g))}getTrace(g,v){let b=this.traceArr,O=b.length,j="",T,M,F,C;for(T=0;T<O;T++)M=b[T],F=M.method,F?(C=M.args,j+=F,g?j+=c:e.Util._isArray(C[0])?j+=o+C.join(n)+l:(v&&(C=C.map(x=>typeof x=="number"?Math.floor(x):x)),j+=a+C.join(n)+i)):(j+=M.property,g||(j+=h+M.val)),j+=u;return j}clearTrace(){this.traceArr=[]}_trace(g){let v=this.traceArr,b;v.push(g),b=v.length,b>=d&&v.shift()}reset(){const g=this.getCanvas().getPixelRatio();this.setTransform(1*g,0,0,1*g,0,0)}getCanvas(){return this.canvas}clear(g){const v=this.getCanvas();g?this.clearRect(g.x||0,g.y||0,g.width||0,g.height||0):this.clearRect(0,0,v.getWidth()/v.pixelRatio,v.getHeight()/v.pixelRatio)}_applyLineCap(g){const v=g.attrs.lineCap;v&&this.setAttr("lineCap",v)}_applyOpacity(g){const v=g.getAbsoluteOpacity();v!==1&&this.setAttr("globalAlpha",v)}_applyLineJoin(g){const v=g.attrs.lineJoin;v&&this.setAttr("lineJoin",v)}setAttr(g,v){this._context[g]=v}arc(g,v,b,O,j,T){this._context.arc(g,v,b,O,j,T)}arcTo(g,v,b,O,j){this._context.arcTo(g,v,b,O,j)}beginPath(){this._context.beginPath()}bezierCurveTo(g,v,b,O,j,T){this._context.bezierCurveTo(g,v,b,O,j,T)}clearRect(g,v,b,O){this._context.clearRect(g,v,b,O)}clip(...g){this._context.clip.apply(this._context,g)}closePath(){this._context.closePath()}createImageData(g,v){const b=arguments;if(b.length===2)return this._context.createImageData(g,v);if(b.length===1)return this._context.createImageData(g)}createLinearGradient(g,v,b,O){return this._context.createLinearGradient(g,v,b,O)}createPattern(g,v){return this._context.createPattern(g,v)}createRadialGradient(g,v,b,O,j,T){return this._context.createRadialGradient(g,v,b,O,j,T)}drawImage(g,v,b,O,j,T,M,F,C){const x=arguments,L=this._context;x.length===3?L.drawImage(g,v,b):x.length===5?L.drawImage(g,v,b,O,j):x.length===9&&L.drawImage(g,v,b,O,j,T,M,F,C)}ellipse(g,v,b,O,j,T,M,F){this._context.ellipse(g,v,b,O,j,T,M,F)}isPointInPath(g,v,b,O){return b?this._context.isPointInPath(b,g,v,O):this._context.isPointInPath(g,v,O)}fill(...g){this._context.fill.apply(this._context,g)}fillRect(g,v,b,O){this._context.fillRect(g,v,b,O)}strokeRect(g,v,b,O){this._context.strokeRect(g,v,b,O)}fillText(g,v,b,O){O?this._context.fillText(g,v,b,O):this._context.fillText(g,v,b)}measureText(g){return this._context.measureText(g)}getImageData(g,v,b,O){return this._context.getImageData(g,v,b,O)}lineTo(g,v){this._context.lineTo(g,v)}moveTo(g,v){this._context.moveTo(g,v)}rect(g,v,b,O){this._context.rect(g,v,b,O)}roundRect(g,v,b,O,j){this._context.roundRect(g,v,b,O,j)}putImageData(g,v,b){this._context.putImageData(g,v,b)}quadraticCurveTo(g,v,b,O){this._context.quadraticCurveTo(g,v,b,O)}restore(){this._context.restore()}rotate(g){this._context.rotate(g)}save(){this._context.save()}scale(g,v){this._context.scale(g,v)}setLineDash(g){this._context.setLineDash?this._context.setLineDash(g):"mozDash"in this._context?this._context.mozDash=g:"webkitLineDash"in this._context&&(this._context.webkitLineDash=g)}getLineDash(){return this._context.getLineDash()}setTransform(g,v,b,O,j,T){this._context.setTransform(g,v,b,O,j,T)}stroke(g){g?this._context.stroke(g):this._context.stroke()}strokeText(g,v,b,O){this._context.strokeText(g,v,b,O)}transform(g,v,b,O,j,T){this._context.transform(g,v,b,O,j,T)}translate(g,v){this._context.translate(g,v)}_enableTrace(){let g=this,v=p.length,b=this.setAttr,O,j;const T=function(M){let F=g[M],C;g[M]=function(){return j=t(Array.prototype.slice.call(arguments,0)),C=F.apply(g,arguments),g._trace({method:M,args:j}),C}};for(O=0;O<v;O++)T(p[O]);g.setAttr=function(){b.apply(g,arguments);const M=arguments[0];let F=arguments[1];(M==="shadowOffsetX"||M==="shadowOffsetY"||M==="shadowBlur")&&(F=F/this.canvas.getPixelRatio()),g._trace({property:M,val:F})}}_applyGlobalCompositeOperation(g){const v=g.attrs.globalCompositeOperation;!v||v==="source-over"||this.setAttr("globalCompositeOperation",v)}};tc.Context=_,w.forEach(function(y){Object.defineProperty(_.prototype,y,{get(){return this._context[y]},set(g){this._context[y]=g}})});class E extends _{constructor(g,{willReadFrequently:v=!1}={}){super(g),this._context=g._canvas.getContext("2d",{willReadFrequently:v})}_fillColor(g){const v=g.fill();this.setAttr("fillStyle",v),g._fillFunc(this)}_fillPattern(g){this.setAttr("fillStyle",g._getFillPattern()),g._fillFunc(this)}_fillLinearGradient(g){const v=g._getLinearGradient();v&&(this.setAttr("fillStyle",v),g._fillFunc(this))}_fillRadialGradient(g){const v=g._getRadialGradient();v&&(this.setAttr("fillStyle",v),g._fillFunc(this))}_fill(g){const v=g.fill(),b=g.getFillPriority();if(v&&b==="color"){this._fillColor(g);return}const O=g.getFillPatternImage();if(O&&b==="pattern"){this._fillPattern(g);return}const j=g.getFillLinearGradientColorStops();if(j&&b==="linear-gradient"){this._fillLinearGradient(g);return}const T=g.getFillRadialGradientColorStops();if(T&&b==="radial-gradient"){this._fillRadialGradient(g);return}v?this._fillColor(g):O?this._fillPattern(g):j?this._fillLinearGradient(g):T&&this._fillRadialGradient(g)}_strokeLinearGradient(g){const v=g.getStrokeLinearGradientStartPoint(),b=g.getStrokeLinearGradientEndPoint(),O=g.getStrokeLinearGradientColorStops(),j=this.createLinearGradient(v.x,v.y,b.x,b.y);if(O){for(let T=0;T<O.length;T+=2)j.addColorStop(O[T],O[T+1]);this.setAttr("strokeStyle",j)}}_stroke(g){const v=g.dash(),b=g.getStrokeScaleEnabled();if(g.hasStroke()){if(!b){this.save();const j=this.getCanvas().getPixelRatio();this.setTransform(j,0,0,j,0,0)}this._applyLineCap(g),v&&g.dashEnabled()&&(this.setLineDash(v),this.setAttr("lineDashOffset",g.dashOffset())),this.setAttr("lineWidth",g.strokeWidth()),g.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),g.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(g):this.setAttr("strokeStyle",g.stroke()),g._strokeFunc(this),b||this.restore()}}_applyShadow(g){var v,b,O;const j=(v=g.getShadowRGBA())!==null&&v!==void 0?v:"black",T=(b=g.getShadowBlur())!==null&&b!==void 0?b:5,M=(O=g.getShadowOffset())!==null&&O!==void 0?O:{x:0,y:0},F=g.getAbsoluteScale(),C=this.canvas.getPixelRatio(),x=F.x*C,L=F.y*C;this.setAttr("shadowColor",j),this.setAttr("shadowBlur",T*Math.min(Math.abs(x),Math.abs(L))),this.setAttr("shadowOffsetX",M.x*x),this.setAttr("shadowOffsetY",M.y*L)}}tc.SceneContext=E;class S extends _{constructor(g){super(g),this._context=g._canvas.getContext("2d",{willReadFrequently:!0})}_fill(g){this.save(),this.setAttr("fillStyle",g.colorKey),g._fillFuncHit(this),this.restore()}strokeShape(g){g.hasHitStroke()&&this._stroke(g)}_stroke(g){if(g.hasHitStroke()){const v=g.getStrokeScaleEnabled();if(!v){this.save();const j=this.getCanvas().getPixelRatio();this.setTransform(j,0,0,j,0,0)}this._applyLineCap(g);const b=g.hitStrokeWidth(),O=b==="auto"?g.strokeWidth():b;this.setAttr("lineWidth",O),this.setAttr("strokeStyle",g.colorKey),g._strokeFuncHit(this),v||this.restore()}}}return tc.HitContext=S,tc}var Vy;function J1(){if(Vy)return ec;Vy=1,Object.defineProperty(ec,"__esModule",{value:!0}),ec.HitCanvas=ec.SceneCanvas=ec.Canvas=void 0;const e=Li(),r=b6(),t=Mr();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(w){return e.Util.error("Unable to get data URL. "+w.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 l 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=l,ec}var tg={},Gy;function om(){return Gy||(Gy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const r=Mr(),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:l}=i,u=l.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=l.dragDistance();if(Math.max(Math.abs(c.x-i.startPointerPos.x),Math.abs(c.y-i.startPointerPos.y))<h||(l.startDrag({evt:n}),!l.isDragging()))return}l._setDragPosition(n,i),a.push(l)}}),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,l=o.getStage();if(n&&l.setPointersPositions(n),!l._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 Wy;function Ji(){if(Wy)return Zh;Wy=1,Object.defineProperty(Zh,"__esModule",{value:!0}),Zh.Node=void 0;const e=Li(),r=Hr(),t=J1(),n=Mr(),a=om(),i=Wr(),o="absoluteOpacity",l="allEventListeners",u="absoluteTransform",c="absoluteScale",h="canvas",p="Change",w="children",d="konva",_="listening",E="mouseenter",S="mouseleave",y="set",g="Shape",v=" ",b="stage",O="transform",j="Stage",T="visible",M=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(v);let F=1;class C{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===O||A===u)&&this._cache.get(A)?this._cache.get(A).dirty=!0:A?this._cache.delete(A):this._cache.clear()}_getCache(A,N){let I=this._cache.get(A);return(I===void 0||(A===O||A===u)&&I.dirty===!0)&&(I=N.call(this),this._cache.set(A,I)),I}_calculate(A,N,I){if(!this._attachedDepsListeners.get(A)){const W=N.map(G=>G+"Change.konva").join(v);this.on(W,()=>{this._clearCache(A)}),this._attachedDepsListeners.set(A,!0)}return this._getCache(A,I)}_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:N,hit:I}=this._cache.get(h);e.Util.releaseCanvas(A,N,I),this._cache.delete(h)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(A){const N=A||{};let I={};(N.x===void 0||N.y===void 0||N.width===void 0||N.height===void 0)&&(I=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let W=Math.ceil(N.width||I.width),G=Math.ceil(N.height||I.height),$=N.pixelRatio,J=N.x===void 0?Math.floor(I.x):N.x,V=N.y===void 0?Math.floor(I.y):N.y,H=N.offset||0,z=N.drawBorder||!1,D=N.hitCanvasPixelRatio||1;if(!W||!G){e.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const K=Math.abs(Math.round(I.x)-J)>.5?1:0,ne=Math.abs(Math.round(I.y)-V)>.5?1:0;W+=H*2+K,G+=H*2+ne,J-=H,V-=H;const Z=new t.SceneCanvas({pixelRatio:$,width:W,height:G}),ee=new t.SceneCanvas({pixelRatio:$,width:0,height:0,willReadFrequently:!0}),ae=new t.HitCanvas({pixelRatio:D,width:W,height:G}),se=Z.getContext(),ce=ae.getContext();return ae.isCache=!0,Z.isCache=!0,this._cache.delete(h),this._filterUpToDate=!1,N.imageSmoothingEnabled===!1&&(Z.getContext()._context.imageSmoothingEnabled=!1,ee.getContext()._context.imageSmoothingEnabled=!1),se.save(),ce.save(),se.translate(-J,-V),ce.translate(-J,-V),this._isUnderCache=!0,this._clearSelfAndDescendantCache(o),this._clearSelfAndDescendantCache(c),this.drawScene(Z,this),this.drawHit(ae,this),this._isUnderCache=!1,se.restore(),ce.restore(),z&&(se.save(),se.beginPath(),se.rect(0,0,W,G),se.closePath(),se.setAttr("strokeStyle","red"),se.setAttr("lineWidth",5),se.stroke(),se.restore()),this._cache.set(h,{scene:Z,filter:ee,hit:ae,x:J,y:V}),this._requestDraw(),this}isCached(){return this._cache.has(h)}getClientRect(A){throw new Error('abstract "getClientRect" method call')}_transformedRect(A,N){const I=[{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 W=1/0,G=1/0,$=-1/0,J=-1/0;const V=this.getAbsoluteTransform(N);return I.forEach(function(H){const z=V.point(H);W===void 0&&(W=$=z.x,G=J=z.y),W=Math.min(W,z.x),G=Math.min(G,z.y),$=Math.max($,z.x),J=Math.max(J,z.y)}),{x:W,y:G,width:$-W,height:J-G}}_drawCachedSceneCanvas(A){A.save(),A._applyOpacity(this),A._applyGlobalCompositeOperation(this);const N=this._getCanvasCache();A.translate(N.x,N.y);const I=this._getCachedSceneCanvas(),W=I.pixelRatio;A.drawImage(I._canvas,0,0,I.width/W,I.height/W),A.restore()}_drawCachedHitCanvas(A){const N=this._getCanvasCache(),I=N.hit;A.save(),A.translate(N.x,N.y),A.drawImage(I._canvas,0,0,I.width/I.pixelRatio,I.height/I.pixelRatio),A.restore()}_getCachedSceneCanvas(){let A=this.filters(),N=this._getCanvasCache(),I=N.scene,W=N.filter,G=W.getContext(),$,J,V,H;if(A){if(!this._filterUpToDate){const z=I.pixelRatio;W.setSize(I.width/I.pixelRatio,I.height/I.pixelRatio);try{for($=A.length,G.clear(),G.drawImage(I._canvas,0,0,I.getWidth()/z,I.getHeight()/z),J=G.getImageData(0,0,W.getWidth(),W.getHeight()),V=0;V<$;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,J),G.putImageData(J,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 W}return I}on(A,N){if(this._cache&&this._cache.delete(l),arguments.length===3)return this._delegate.apply(this,arguments);let I=A.split(v),W=I.length,G,$,J,V,H;for(G=0;G<W;G++)$=I[G],J=$.split("."),V=J[0],H=J[1]||"",this.eventListeners[V]||(this.eventListeners[V]=[]),this.eventListeners[V].push({name:H,handler:N});return this}off(A,N){let I=(A||"").split(v),W=I.length,G,$,J,V,H,z;if(this._cache&&this._cache.delete(l),!A)for($ in this.eventListeners)this._off($);for(G=0;G<W;G++)if(J=I[G],V=J.split("."),H=V[0],z=V[1],H)this.eventListeners[H]&&this._off(H,z,N);else for($ in this.eventListeners)this._off($,z,N);return this}dispatchEvent(A){const N={target:this,type:A.type,evt:A};return this.fire(A.type,N),this}addEventListener(A,N){return this.on(A,function(I){N.call(this,I.evt)}),this}removeEventListener(A){return this.off(A),this}_delegate(A,N,I){const W=this;this.on(A,function(G){const $=G.target.findAncestors(N,!0,W);for(let J=0;J<$.length;J++)G=e.Util.cloneObject(G),G.currentTarget=$[J],I.call($[J],G)})}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(b),this._clearSelfAndDescendantCache(T),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 N="get"+e.Util._capitalize(A);return e.Util._isFunction(this[N])?this[N]():this.attrs[A]}getAncestors(){let A=this.getParent(),N=[];for(;A;)N.push(A),A=A.getParent();return N}getAttrs(){return this.attrs||{}}setAttrs(A){return this._batchTransformChanges(()=>{let N,I;if(!A)return this;for(N in A)N!==w&&(I=y+e.Util._capitalize(N),e.Util._isFunction(this[I])?this[I](A[N]):this._setAttr(N,A[N]))}),this}isListening(){return this._getCache(_,this._isListening)}_isListening(A){if(!this.listening())return!1;const I=this.getParent();return I&&I!==A&&this!==A?I._isListening(A):!0}isVisible(){return this._getCache(T,this._isVisible)}_isVisible(A){if(!this.visible())return!1;const I=this.getParent();return I&&I!==A&&this!==A?I._isVisible(A):!0}shouldDrawHit(A,N=!1){if(A)return this._isVisible(A)&&this._isListening(A);const I=this.getLayer();let W=!1;a.DD._dragElements.forEach($=>{$.dragStatus==="dragging"&&($.node.nodeType==="Stage"||$.node.getLayer()===I)&&(W=!0)});const G=!N&&!n.Konva.hitOnDragEnabled&&(W||n.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!G}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let A=this.getDepth(),N=this,I=0,W,G,$,J;function V(z){for(W=[],G=z.length,$=0;$<G;$++)J=z[$],I++,J.nodeType!==g&&(W=W.concat(J.getChildren().slice())),J._id===N._id&&($=G);W.length>0&&W[0].getDepth()<=A&&V(W)}const H=this.getStage();return N.nodeType!==j&&H&&V(H.getChildren()),I}getDepth(){let A=0,N=this.parent;for(;N;)A++,N=N.parent;return A}_batchTransformChanges(A){this._batchingTransformChange=!0,A(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(O),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 N=A.getPointerPosition();if(!N)return null;const I=this.getAbsoluteTransform().copy();return I.invert(),I.point(N)}getAbsolutePosition(A){let N=!1,I=this.parent;for(;I;){if(I.isCached()){N=!0;break}I=I.parent}N&&!A&&(A=!0);const W=this.getAbsoluteTransform(A).getMatrix(),G=new e.Transform,$=this.offset();return G.m=W.slice(),G.translate($.x,$.y),G.getTranslation()}setAbsolutePosition(A){const{x:N,y:I,...W}=this._clearTransform();this.attrs.x=N,this.attrs.y=I,this._clearCache(O);const G=this._getAbsoluteTransform().copy();return G.invert(),G.translate(A.x,A.y),A={x:this.attrs.x+G.getTranslation().x,y:this.attrs.y+G.getTranslation().y},this._setTransform(W),this.setPosition({x:A.x,y:A.y}),this._clearCache(O),this._clearSelfAndDescendantCache(u),this}_setTransform(A){let N;for(N in A)this.attrs[N]=A[N]}_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 N=A.x,I=A.y,W=this.x(),G=this.y();return N!==void 0&&(W+=N),I!==void 0&&(G+=I),this.setPosition({x:W,y:G}),this}_eachAncestorReverse(A,N){let I=[],W=this.getParent(),G,$;if(!(N&&N._id===this._id)){for(I.unshift(this);W&&(!N||W._id!==N._id);)I.unshift(W),W=W.parent;for(G=I.length,$=0;$<G;$++)A(I[$])}}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,N=this.parent.getChildren().length;return A<N-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,N=this.parent.getChildren().length;return A<N-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 N=this.index;return this.parent.children.splice(N,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 N=this.getParent();return N&&!N._isUnderCache&&(A*=N.getAbsoluteOpacity()),A}moveTo(A){return this.getParent()!==A&&(this._remove(),A.add(this)),this}toObject(){let A=this.getAttrs(),N,I,W,G,$;const J={attrs:{},className:this.getClassName()};for(N in A)I=A[N],$=e.Util.isObject(I)&&!e.Util._isPlainObject(I)&&!e.Util._isArray(I),!$&&(W=typeof this[N]=="function"&&this[N],delete A[N],G=W?W.call(this):null,A[N]=I,G!==I&&(J.attrs[N]=I));return e.Util._prepareToStringify(J)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(A,N,I){const W=[];N&&this._isMatch(A)&&W.push(this);let G=this.parent;for(;G;){if(G===I)return W;G._isMatch(A)&&W.push(G),G=G.parent}return W}isAncestorOf(A){return!1}findAncestor(A,N,I){return this.findAncestors(A,N,I)[0]}_isMatch(A){if(!A)return!1;if(typeof A=="function")return A(this);let N=A.replace(/ /g,"").split(","),I=N.length,W,G;for(W=0;W<I;W++)if(G=N[W],e.Util.isValidSelector(G)||(e.Util.warn('Selector "'+G+'" 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?")),G.charAt(0)==="#"){if(this.id()===G.slice(1))return!0}else if(G.charAt(0)==="."){if(this.hasName(G.slice(1)))return!0}else if(this.className===G||this.nodeType===G)return!0;return!1}getLayer(){const A=this.getParent();return A?A.getLayer():null}getStage(){return this._getCache(b,this._getStage)}_getStage(){const A=this.getParent();return A?A.getStage():null}fire(A,N={},I){return N.target=N.target||this,I?this._fireAndBubble(A,N):this._fire(A,N),this}getAbsoluteTransform(A){return A?this._getAbsoluteTransform(A):this._getCache(u,this._getAbsoluteTransform)}_getAbsoluteTransform(A){let N;if(A)return N=new e.Transform,this._eachAncestorReverse(function(I){const W=I.transformsEnabled();W==="all"?N.multiply(I.getTransform()):W==="position"&&N.translate(I.x()-I.offsetX(),I.y()-I.offsetY())},A),N;{N=this._cache.get(u)||new e.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(N):N.reset();const I=this.transformsEnabled();if(I==="all")N.multiply(this.getTransform());else if(I==="position"){const W=this.attrs.x||0,G=this.attrs.y||0,$=this.attrs.offsetX||0,J=this.attrs.offsetY||0;N.translate(W-$,G-J)}return N.dirty=!1,N}}getAbsoluteScale(A){let N=this;for(;N;)N._isUnderCache&&(A=N),N=N.getParent();const W=this.getAbsoluteTransform(A).decompose();return{x:W.scaleX,y:W.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(O,this._getTransform)}_getTransform(){var A,N;const I=this._cache.get(O)||new e.Transform;I.reset();const W=this.x(),G=this.y(),$=n.Konva.getAngle(this.rotation()),J=(A=this.attrs.scaleX)!==null&&A!==void 0?A:1,V=(N=this.attrs.scaleY)!==null&&N!==void 0?N:1,H=this.attrs.skewX||0,z=this.attrs.skewY||0,D=this.attrs.offsetX||0,K=this.attrs.offsetY||0;return(W!==0||G!==0)&&I.translate(W,G),$!==0&&I.rotate($),(H!==0||z!==0)&&I.skew(H,z),(J!==1||V!==1)&&I.scale(J,V),(D!==0||K!==0)&&I.translate(-1*D,-1*K),I.dirty=!1,I}clone(A){let N=e.Util.cloneObject(this.attrs),I,W,G,$,J;for(I in A)N[I]=A[I];const V=new this.constructor(N);for(I in this.eventListeners)for(W=this.eventListeners[I],G=W.length,$=0;$<G;$++)J=W[$],J.name.indexOf(d)<0&&(V.eventListeners[I]||(V.eventListeners[I]=[]),V.eventListeners[I].push(J));return V}_toKonvaCanvas(A){A=A||{};const N=this.getClientRect(),I=this.getStage(),W=A.x!==void 0?A.x:Math.floor(N.x),G=A.y!==void 0?A.y:Math.floor(N.y),$=A.pixelRatio||1,J=new t.SceneCanvas({width:A.width||Math.ceil(N.width)||(I?I.width():0),height:A.height||Math.ceil(N.height)||(I?I.height():0),pixelRatio:$}),V=J.getContext(),H=new t.SceneCanvas({width:J.width/J.pixelRatio+Math.abs(W),height:J.height/J.pixelRatio+Math.abs(G),pixelRatio:J.pixelRatio});return A.imageSmoothingEnabled===!1&&(V._context.imageSmoothingEnabled=!1),V.save(),(W||G)&&V.translate(-1*W,-1*G),this.drawScene(J,void 0,H),V.restore(),J}toCanvas(A){return this._toKonvaCanvas(A)._canvas}toDataURL(A){A=A||{};const N=A.mimeType||null,I=A.quality||null,W=this._toKonvaCanvas(A).toDataURL(N,I);return A.callback&&A.callback(W),W}toImage(A){return new Promise((N,I)=>{try{const W=A==null?void 0:A.callback;W&&delete A.callback,e.Util._urlToImage(this.toDataURL(A),function(G){N(G),W==null||W(G)})}catch(W){I(W)}})}toBlob(A){return new Promise((N,I)=>{try{const W=A==null?void 0:A.callback;W&&delete A.callback,this.toCanvas(A).toBlob(G=>{N(G),W==null||W(G)},A==null?void 0:A.mimeType,A==null?void 0:A.quality)}catch(W){I(W)}})}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,N,I){let W=this.eventListeners[A],G,$,J;for(G=0;G<W.length;G++)if($=W[G].name,J=W[G].handler,($!=="konva"||N==="konva")&&(!N||$===N)&&(!I||I===J)){if(W.splice(G,1),W.length===0){delete this.eventListeners[A];break}G--}}_fireChangeEvent(A,N,I){this._fire(A+p,{oldVal:N,newVal:I})}addName(A){if(!this.hasName(A)){const N=this.name(),I=N?N+" "+A:A;this.name(I)}return this}hasName(A){if(!A)return!1;const N=this.name();return N?(N||"").split(/\s/g).indexOf(A)!==-1:!1}removeName(A){const N=(this.name()||"").split(/\s/g),I=N.indexOf(A);return I!==-1&&(N.splice(I,1),this.name(N.join(" "))),this}setAttr(A,N){const I=this[y+e.Util._capitalize(A)];return e.Util._isFunction(I)?I.call(this,N):this._setAttr(A,N),this}_requestDraw(){if(n.Konva.autoDrawEnabled){const A=this.getLayer()||this.getStage();A==null||A.batchDraw()}}_setAttr(A,N){const I=this.attrs[A];I===N&&!e.Util.isObject(N)||(N==null?delete this.attrs[A]:this.attrs[A]=N,this._shouldFireChangeEvents&&this._fireChangeEvent(A,I,N),this._requestDraw())}_setComponentAttr(A,N,I){let W;I!==void 0&&(W=this.attrs[A],W||(this.attrs[A]=this.getAttr(A)),this.attrs[A][N]=I,this._fireChangeEvent(A,W,I))}_fireAndBubble(A,N,I){if(N&&this.nodeType===g&&(N.target=this),!((A===E||A===S)&&(I&&(this===I||this.isAncestorOf&&this.isAncestorOf(I))||this.nodeType==="Stage"&&!I))){this._fire(A,N);const G=(A===E||A===S)&&I&&I.isAncestorOf&&I.isAncestorOf(this)&&!I.isAncestorOf(this.parent);(N&&!N.cancelBubble||!N)&&this.parent&&this.parent.isListening()&&!G&&(I&&I.parent?this._fireAndBubble.call(this.parent,A,N,I):this._fireAndBubble.call(this.parent,A,N))}}_getProtoListeners(A){var N,I,W;const G=(N=this._cache.get(l))!==null&&N!==void 0?N:{};let $=G==null?void 0:G[A];if($===void 0){$=[];let J=Object.getPrototypeOf(this);for(;J;){const V=(W=(I=J.eventListeners)===null||I===void 0?void 0:I[A])!==null&&W!==void 0?W:[];$.push(...V),J=Object.getPrototypeOf(J)}G[A]=$,this._cache.set(l,G)}return $}_fire(A,N){N=N||{},N.currentTarget=this,N.type=A;const I=this._getProtoListeners(A);if(I)for(var W=0;W<I.length;W++)I[W].handler.call(this,N);const G=this.eventListeners[A];if(G)for(var W=0;W<G.length;W++)G[W].handler.call(this,N)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(A){const N=A?A.pointerId:void 0,I=this.getStage(),W=this.getAbsolutePosition();if(!I)return;const G=I._getPointerById(N)||I._changedPointerPositions[0]||W;a.DD._dragElements.set(this._id,{node:this,startPointerPos:G,offset:{x:G.x-W.x,y:G.y-W.y},dragStatus:"ready",pointerId:N})}startDrag(A,N=!0){a.DD._dragElements.has(this._id)||this._createDragElement(A);const I=a.DD._dragElements.get(this._id);I.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:A&&A.evt},N)}_setDragPosition(A,N){const I=this.getStage()._getPointerById(N.pointerId);if(!I)return;let W={x:I.x-N.offset.x,y:I.y-N.offset.y};const G=this.dragBoundFunc();if(G!==void 0){const $=G.call(this,W,A);$?W=$: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!==W.x||this._lastPos.y!==W.y)&&(this.setAbsolutePosition(W),this._requestDraw()),this._lastPos=W}stopDrag(A){const N=a.DD._dragElements.get(this._id);N&&(N.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 W=!1;a.DD._dragElements.forEach(G=>{this.isAncestorOf(G.node)&&(W=!0)}),W||this._createDragElement(A)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const N=a.DD._dragElements.get(this._id),I=N&&N.dragStatus==="dragging",W=N&&N.dragStatus==="ready";I?this.stopDrag():W&&a.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(A={x:0,y:0}){const N=this.getStage();if(!N)return!1;const I={x:-A.x,y:-A.y,width:N.width()+2*A.x,height:N.height()+2*A.y};return e.Util.haveIntersection(I,this.getClientRect())}static create(A,N){return e.Util._isString(A)&&(A=JSON.parse(A)),this._createNode(A,N)}static _createNode(A,N){let I=C.prototype.getClassName.call(A),W=A.children,G,$,J;N&&(A.attrs.container=N),n.Konva[I]||(e.Util.warn('Can not find a node with class name "'+I+'". Fallback to "Shape".'),I="Shape");const V=n.Konva[I];if(G=new V(A.attrs),W)for($=W.length,J=0;J<$;J++)G.add(C._createNode(W[J]));return G}}Zh.Node=C,C.prototype.nodeType="Node",C.prototype._attrsAffectingSize=[],C.prototype.eventListeners={},C.prototype.on.call(C.prototype,M,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(O),this._clearSelfAndDescendantCache(u)}),C.prototype.on.call(C.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(T)}),C.prototype.on.call(C.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(_)}),C.prototype.on.call(C.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(o)});const x=r.Factory.addGetterSetter;return x(C,"zIndex"),x(C,"absolutePosition"),x(C,"position"),x(C,"x",0,(0,i.getNumberValidator)()),x(C,"y",0,(0,i.getNumberValidator)()),x(C,"globalCompositeOperation","source-over",(0,i.getStringValidator)()),x(C,"opacity",1,(0,i.getNumberValidator)()),x(C,"name","",(0,i.getStringValidator)()),x(C,"id","",(0,i.getStringValidator)()),x(C,"rotation",0,(0,i.getNumberValidator)()),r.Factory.addComponentsGetterSetter(C,"scale",["x","y"]),x(C,"scaleX",1,(0,i.getNumberValidator)()),x(C,"scaleY",1,(0,i.getNumberValidator)()),r.Factory.addComponentsGetterSetter(C,"skew",["x","y"]),x(C,"skewX",0,(0,i.getNumberValidator)()),x(C,"skewY",0,(0,i.getNumberValidator)()),r.Factory.addComponentsGetterSetter(C,"offset",["x","y"]),x(C,"offsetX",0,(0,i.getNumberValidator)()),x(C,"offsetY",0,(0,i.getNumberValidator)()),x(C,"dragDistance",void 0,(0,i.getNumberValidator)()),x(C,"width",0,(0,i.getNumberValidator)()),x(C,"height",0,(0,i.getNumberValidator)()),x(C,"listening",!0,(0,i.getBooleanValidator)()),x(C,"preventDefault",!0,(0,i.getBooleanValidator)()),x(C,"filters",void 0,function(L){return this._filterUpToDate=!1,L}),x(C,"visible",!0,(0,i.getBooleanValidator)()),x(C,"transformsEnabled","all",(0,i.getStringValidator)()),x(C,"size"),x(C,"dragBoundFunc"),x(C,"draggable",!1,(0,i.getBooleanValidator)()),r.Factory.backCompat(C,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"}),Zh}var Qh={},$y;function e0(){if($y)return Qh;$y=1,Object.defineProperty(Qh,"__esModule",{value:!0}),Qh.Container=void 0;const e=Hr(),r=Ji(),t=Wr();let n=class extends r.Node{constructor(){super(...arguments),this.children=[]}getChildren(i){if(!i)return this.children||[];const o=this.children||[],l=[];return o.forEach(function(u){i(u)&&l.push(u)}),l}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 l=0;l<i.length;l++)this.add(i[l]);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 l=[];return this._descendants(u=>{const c=u._isMatch(i);return c&&l.push(u),!!(c&&o)}),l}_descendants(i){let o=!1;const l=this.getChildren();for(const u of l){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(l){o.add(l.clone())}),o}getAllIntersections(i){const o=[];return this.find("Shape").forEach(l=>{l.isVisible()&&l.intersects(i)&&o.push(l)}),o}_clearSelfAndDescendantCache(i){var o;super._clearSelfAndDescendantCache(i),!this.isCached()&&((o=this.children)===null||o===void 0||o.forEach(function(l){l._clearSelfAndDescendantCache(i)}))}_setChildrenIndices(){var i;(i=this.children)===null||i===void 0||i.forEach(function(o,l){o.index=l}),this._requestDraw()}drawScene(i,o,l){const u=this.getLayer(),c=i||u&&u.getCanvas(),h=c&&c.getContext(),p=this._getCanvasCache(),w=p&&p.scene,d=c&&c.isCache;if(!this.isVisible()&&!d)return this;if(w){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,l);return this}drawHit(i,o){if(!this.shouldDrawHit(o))return this;const l=this.getLayer(),u=i||l&&l.hitCanvas,c=u&&u.getContext(),h=this._getCanvasCache();if(h&&h.hit){c.save();const w=this.getAbsoluteTransform(o).getMatrix();c.transform(w[0],w[1],w[2],w[3],w[4],w[5]),this._drawCachedHitCanvas(c),c.restore()}else this._drawChildren("drawHit",u,o);return this}_drawChildren(i,o,l,u){var c;const h=o&&o.getContext(),p=this.clipWidth(),w=this.clipHeight(),d=this.clipFunc(),_=typeof p=="number"&&typeof w=="number"||d,E=l===this;if(_){h.save();const y=this.getAbsoluteTransform(l);let g=y.getMatrix();h.transform(g[0],g[1],g[2],g[3],g[4],g[5]),h.beginPath();let v;if(d)v=d.call(this,h,this);else{const b=this.clipX(),O=this.clipY();h.rect(b||0,O||0,p,w)}h.clip.apply(h,v),g=y.copy().invert().getMatrix(),h.transform(g[0],g[1],g[2],g[3],g[4],g[5])}const S=!E&&this.globalCompositeOperation()!=="source-over"&&i==="drawScene";S&&(h.save(),h._applyGlobalCompositeOperation(this)),(c=this.children)===null||c===void 0||c.forEach(function(y){y[i](o,l,u)}),S&&h.restore(),_&&h.restore()}getClientRect(i={}){var o;const l=i.skipTransform,u=i.relativeTo;let c,h,p,w,d={x:1/0,y:1/0,width:0,height:0};const _=this;(o=this.children)===null||o===void 0||o.forEach(function(y){if(!y.visible())return;const g=y.getClientRect({relativeTo:_,skipShadow:i.skipShadow,skipStroke:i.skipStroke});g.width===0&&g.height===0||(c===void 0?(c=g.x,h=g.y,p=g.x+g.width,w=g.y+g.height):(c=Math.min(c,g.x),h=Math.min(h,g.y),p=Math.max(p,g.x+g.width),w=Math.max(w,g.y+g.height)))});const E=this.find("Shape");let S=!1;for(let y=0;y<E.length;y++)if(E[y]._isVisible(this)){S=!0;break}return S&&c!==void 0?d={x:c,y:h,width:p-c,height:w-h}:d={x:0,y:0,width:0,height:0},l?d:this._transformedRect(d,u)}};return Qh.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"),Qh}var rg={},Fc={},Yy;function w6(){if(Yy)return Fc;Yy=1,Object.defineProperty(Fc,"__esModule",{value:!0}),Fc.getCapturedShape=n,Fc.createEvent=a,Fc.hasPointerCapture=i,Fc.setPointerCapture=o,Fc.releaseCapture=l;const e=Mr(),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){l(u),c.getStage()&&(r.set(u,c),t&&c._fire("gotpointercapture",a(new PointerEvent("gotpointercapture"))))}function l(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 Fc}var Xy;function RS(){return Xy||(Xy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const r=Li(),t=Hr(),n=e0(),a=Mr(),i=J1(),o=om(),l=Mr(),u=w6(),c="Stage",h="string",p="px",w="mouseout",d="mouseleave",_="mouseover",E="mouseenter",S="mousemove",y="mousedown",g="mouseup",v="pointermove",b="pointerdown",O="pointerup",j="pointercancel",T="lostpointercapture",M="pointerout",F="pointerleave",C="pointerover",x="pointerenter",L="contextmenu",A="touchstart",N="touchend",I="touchmove",W="touchcancel",G="wheel",$=5,J=[[E,"_pointerenter"],[y,"_pointerdown"],[S,"_pointermove"],[g,"_pointerup"],[d,"_pointerleave"],[A,"_pointerdown"],[I,"_pointermove"],[N,"_pointerup"],[W,"_pointercancel"],[_,"_pointerover"],[G,"_wheel"],[L,"_contextmenu"],[b,"_pointerdown"],[v,"_pointermove"],[O,"_pointerup"],[j,"_pointercancel"],[T,"_lostpointercapture"]],V={mouse:{[M]:w,[F]:d,[C]:_,[x]:E,[v]:S,[b]:y,[O]:g,[j]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[M]:"touchout",[F]:"touchleave",[C]:"touchover",[x]:"touchenter",[v]:I,[b]:A,[O]:N,[j]:W,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[M]:M,[F]:F,[C]:C,[x]:x,[v]:v,[b]:b,[O]:O,[j]:j,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},H=Z=>Z.indexOf("pointer")>=0?"pointer":Z.indexOf("touch")>=0?"touch":"mouse",z=Z=>{const ee=H(Z);if(ee==="pointer")return a.Konva.pointerEventsEnabled&&V.pointer;if(ee==="touch")return V.touch;if(ee==="mouse")return V.mouse};function D(Z={}){return(Z.clipFunc||Z.clipWidth||Z.clipHeight)&&r.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),Z}const K="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";e.stages=[];class ne extends n.Container{constructor(ee){super(D(ee)),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(ee){const ae=ee.getType()==="Layer",se=ee.getType()==="FastLayer";ae||se||r.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const ee=this.visible()?"":"none";this.content.style.display=ee}setContainer(ee){if(typeof ee===h){if(ee.charAt(0)==="."){const se=ee.slice(1);ee=document.getElementsByClassName(se)[0]}else{var ae;ee.charAt(0)!=="#"?ae=ee:ae=ee.slice(1),ee=document.getElementById(ae)}if(!ee)throw"Can not find container in document with id "+ae}return this._setAttr("container",ee),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),ee.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const ee=this.children,ae=ee.length;for(let se=0;se<ae;se++)ee[se].clear();return this}clone(ee){return ee||(ee={}),ee.container=typeof document<"u"&&document.createElement("div"),n.Container.prototype.clone.call(this,ee)}destroy(){super.destroy();const ee=this.content;ee&&r.Util._isInDocument(ee)&&this.container().removeChild(ee);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 ee=this._pointerPositions[0]||this._changedPointerPositions[0];return ee?{x:ee.x,y:ee.y}:(r.Util.warn(K),null)}_getPointerById(ee){return this._pointerPositions.find(ae=>ae.id===ee)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(ee){ee=ee||{},ee.x=ee.x||0,ee.y=ee.y||0,ee.width=ee.width||this.width(),ee.height=ee.height||this.height();const ae=new i.SceneCanvas({width:ee.width,height:ee.height,pixelRatio:ee.pixelRatio||1}),se=ae.getContext()._context,ce=this.children;return(ee.x||ee.y)&&se.translate(-1*ee.x,-1*ee.y),ce.forEach(function(me){if(!me.isVisible())return;const xe=me._toKonvaCanvas(ee);se.drawImage(xe._canvas,ee.x,ee.y,xe.getWidth()/xe.getPixelRatio(),xe.getHeight()/xe.getPixelRatio())}),ae}getIntersection(ee){if(!ee)return null;const ae=this.children,se=ae.length,ce=se-1;for(let me=ce;me>=0;me--){const xe=ae[me].getIntersection(ee);if(xe)return xe}return null}_resizeDOM(){const ee=this.width(),ae=this.height();this.content&&(this.content.style.width=ee+p,this.content.style.height=ae+p),this.bufferCanvas.setSize(ee,ae),this.bufferHitCanvas.setSize(ee,ae),this.children.forEach(se=>{se.setSize({width:ee,height:ae}),se.draw()})}add(ee,...ae){if(arguments.length>1){for(let ce=0;ce<arguments.length;ce++)this.add(arguments[ce]);return this}super.add(ee);const se=this.children.length;return se>$&&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."),ee.setSize({width:this.width(),height:this.height()}),ee.draw(),a.Konva.isBrowser&&this.content.appendChild(ee.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(ee){return u.hasPointerCapture(ee,this)}setPointerCapture(ee){u.setPointerCapture(ee,this)}releaseCapture(ee){u.releaseCapture(ee,this)}getLayers(){return this.children}_bindContentEvents(){a.Konva.isBrowser&&J.forEach(([ee,ae])=>{this.content.addEventListener(ee,se=>{this[ae](se)},{passive:!1})})}_pointerenter(ee){this.setPointersPositions(ee);const ae=z(ee.type);ae&&this._fire(ae.pointerenter,{evt:ee,target:this,currentTarget:this})}_pointerover(ee){this.setPointersPositions(ee);const ae=z(ee.type);ae&&this._fire(ae.pointerover,{evt:ee,target:this,currentTarget:this})}_getTargetShape(ee){let ae=this[ee+"targetShape"];return ae&&!ae.getStage()&&(ae=null),ae}_pointerleave(ee){const ae=z(ee.type),se=H(ee.type);if(!ae)return;this.setPointersPositions(ee);const ce=this._getTargetShape(se),me=!(a.Konva.isDragging()||a.Konva.isTransforming())||a.Konva.hitOnDragEnabled;ce&&me?(ce._fireAndBubble(ae.pointerout,{evt:ee}),ce._fireAndBubble(ae.pointerleave,{evt:ee}),this._fire(ae.pointerleave,{evt:ee,target:this,currentTarget:this}),this[se+"targetShape"]=null):me&&(this._fire(ae.pointerleave,{evt:ee,target:this,currentTarget:this}),this._fire(ae.pointerout,{evt:ee,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(ee){const ae=z(ee.type),se=H(ee.type);if(!ae)return;this.setPointersPositions(ee);let ce=!1;this._changedPointerPositions.forEach(me=>{const xe=this.getIntersection(me);if(o.DD.justDragged=!1,a.Konva["_"+se+"ListenClick"]=!0,!xe||!xe.isListening()){this[se+"ClickStartShape"]=void 0;return}a.Konva.capturePointerEventsEnabled&&xe.setPointerCapture(me.id),this[se+"ClickStartShape"]=xe,xe._fireAndBubble(ae.pointerdown,{evt:ee,pointerId:me.id}),ce=!0;const Oe=ee.type.indexOf("touch")>=0;xe.preventDefault()&&ee.cancelable&&Oe&&ee.preventDefault()}),ce||this._fire(ae.pointerdown,{evt:ee,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(ee){const ae=z(ee.type),se=H(ee.type);if(!ae||(a.Konva.isDragging()&&o.DD.node.preventDefault()&&ee.cancelable&&ee.preventDefault(),this.setPointersPositions(ee),!(!(a.Konva.isDragging()||a.Konva.isTransforming())||a.Konva.hitOnDragEnabled)))return;const me={};let xe=!1;const Oe=this._getTargetShape(se);this._changedPointerPositions.forEach(Re=>{const Se=u.getCapturedShape(Re.id)||this.getIntersection(Re),ve=Re.id,He={evt:ee,pointerId:ve},we=Oe!==Se;if(we&&Oe&&(Oe._fireAndBubble(ae.pointerout,{...He},Se),Oe._fireAndBubble(ae.pointerleave,{...He},Se)),Se){if(me[Se._id])return;me[Se._id]=!0}Se&&Se.isListening()?(xe=!0,we&&(Se._fireAndBubble(ae.pointerover,{...He},Oe),Se._fireAndBubble(ae.pointerenter,{...He},Oe),this[se+"targetShape"]=Se),Se._fireAndBubble(ae.pointermove,{...He})):Oe&&(this._fire(ae.pointerover,{evt:ee,target:this,currentTarget:this,pointerId:ve}),this[se+"targetShape"]=null)}),xe||this._fire(ae.pointermove,{evt:ee,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(ee){const ae=z(ee.type),se=H(ee.type);if(!ae)return;this.setPointersPositions(ee);const ce=this[se+"ClickStartShape"],me=this[se+"ClickEndShape"],xe={};let Oe=!1;this._changedPointerPositions.forEach(Re=>{const Se=u.getCapturedShape(Re.id)||this.getIntersection(Re);if(Se){if(Se.releaseCapture(Re.id),xe[Se._id])return;xe[Se._id]=!0}const ve=Re.id,He={evt:ee,pointerId:ve};let we=!1;a.Konva["_"+se+"InDblClickWindow"]?(we=!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),Se&&Se.isListening()?(Oe=!0,this[se+"ClickEndShape"]=Se,Se._fireAndBubble(ae.pointerup,{...He}),a.Konva["_"+se+"ListenClick"]&&ce&&ce===Se&&(Se._fireAndBubble(ae.pointerclick,{...He}),we&&me&&me===Se&&Se._fireAndBubble(ae.pointerdblclick,{...He}))):(this[se+"ClickEndShape"]=null,a.Konva["_"+se+"ListenClick"]&&this._fire(ae.pointerclick,{evt:ee,target:this,currentTarget:this,pointerId:ve}),we&&this._fire(ae.pointerdblclick,{evt:ee,target:this,currentTarget:this,pointerId:ve}))}),Oe||this._fire(ae.pointerup,{evt:ee,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),a.Konva["_"+se+"ListenClick"]=!1,ee.cancelable&&se!=="touch"&&se!=="pointer"&&ee.preventDefault()}_contextmenu(ee){this.setPointersPositions(ee);const ae=this.getIntersection(this.getPointerPosition());ae&&ae.isListening()?ae._fireAndBubble(L,{evt:ee}):this._fire(L,{evt:ee,target:this,currentTarget:this})}_wheel(ee){this.setPointersPositions(ee);const ae=this.getIntersection(this.getPointerPosition());ae&&ae.isListening()?ae._fireAndBubble(G,{evt:ee}):this._fire(G,{evt:ee,target:this,currentTarget:this})}_pointercancel(ee){this.setPointersPositions(ee);const ae=u.getCapturedShape(ee.pointerId)||this.getIntersection(this.getPointerPosition());ae&&ae._fireAndBubble(O,u.createEvent(ee)),u.releaseCapture(ee.pointerId)}_lostpointercapture(ee){u.releaseCapture(ee.pointerId)}setPointersPositions(ee){const ae=this._getContentPosition();let se=null,ce=null;ee=ee||window.event,ee.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(ee.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(ee.changedTouches||ee.touches,me=>{this._changedPointerPositions.push({id:me.identifier,x:(me.clientX-ae.left)/ae.scaleX,y:(me.clientY-ae.top)/ae.scaleY})})):(se=(ee.clientX-ae.left)/ae.scaleX,ce=(ee.clientY-ae.top)/ae.scaleY,this.pointerPos={x:se,y:ce},this._pointerPositions=[{x:se,y:ce,id:r.Util._getFirstPointerId(ee)}],this._changedPointerPositions=[{x:se,y:ce,id:r.Util._getFirstPointerId(ee)}])}_setPointerPosition(ee){r.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(ee)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const ee=this.content.getBoundingClientRect();return{top:ee.top,left:ee.left,scaleX:ee.width/this.content.clientWidth||1,scaleY:ee.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 ee=this.container();if(!ee)throw"Stage has no container. A container is required.";ee.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"),ee.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(ee){ee.batchDraw()}),this}}e.Stage=ne,ne.prototype.nodeType=c,(0,l._registerNode)(ne),t.Factory.addGetterSetter(ne,"container"),a.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach(Z=>{Z.batchDraw()})})}(rg)),rg}var Jh={},ng={},Ky;function Ma(){return Ky||(Ky=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const r=Mr(),t=Li(),n=Hr(),a=Ji(),i=Wr(),o=Mr(),l=w6(),u="hasShadow",c="shadowRGBA",h="patternImage",p="linearGradient",w="radialGradient";let d;function _(){return d||(d=t.Util.createCanvasElement().getContext("2d"),d)}e.shapes={};function E(F){const C=this.attrs.fillRule;C?F.fill(C):F.fill()}function S(F){F.stroke()}function y(F){const C=this.attrs.fillRule;C?F.fill(C):F.fill()}function g(F){F.stroke()}function v(){this._clearCache(u)}function b(){this._clearCache(c)}function O(){this._clearCache(h)}function j(){this._clearCache(p)}function T(){this._clearCache(w)}class M extends a.Node{constructor(C){super(C);let x;for(;x=t.Util.getRandomColor(),!(x&&!(x in e.shapes)););this.colorKey=x,e.shapes[x]=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 x=_().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(x&&x.setTransform){const L=new t.Transform;L.translate(this.fillPatternX(),this.fillPatternY()),L.rotate(r.Konva.getAngle(this.fillPatternRotation())),L.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),L.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const A=L.getMatrix(),N=typeof DOMMatrix>"u"?{a:A[0],b:A[1],c:A[2],d:A[3],e:A[4],f:A[5]}:new DOMMatrix(A);x.setTransform(N)}return x}}_getLinearGradient(){return this._getCache(p,this.__getLinearGradient)}__getLinearGradient(){const C=this.fillLinearGradientColorStops();if(C){const x=_(),L=this.fillLinearGradientStartPoint(),A=this.fillLinearGradientEndPoint(),N=x.createLinearGradient(L.x,L.y,A.x,A.y);for(let I=0;I<C.length;I+=2)N.addColorStop(C[I],C[I+1]);return N}}_getRadialGradient(){return this._getCache(w,this.__getRadialGradient)}__getRadialGradient(){const C=this.fillRadialGradientColorStops();if(C){const x=_(),L=this.fillRadialGradientStartPoint(),A=this.fillRadialGradientEndPoint(),N=x.createRadialGradient(L.x,L.y,this.fillRadialGradientStartRadius(),A.x,A.y,this.fillRadialGradientEndRadius());for(let I=0;I<C.length;I+=2)N.addColorStop(C[I],C[I+1]);return N}}getShadowRGBA(){return this._getCache(c,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const C=t.Util.colorToRGBA(this.shadowColor());if(C)return"rgba("+C.r+","+C.g+","+C.b+","+C.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 C=this.hitStrokeWidth();return C==="auto"?this.hasStroke():this.strokeEnabled()&&!!C}intersects(C){const x=this.getStage();if(!x)return!1;const L=x.bufferHitCanvas;return L.getContext().clear(),this.drawHit(L,void 0,!0),L.context.getImageData(Math.round(C.x),Math.round(C.y),1,1).data[3]>0}destroy(){return a.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(C){var x;if(!((x=this.attrs.perfectDrawEnabled)!==null&&x!==void 0?x:!0))return!1;const A=C||this.hasFill(),N=this.hasStroke(),I=this.getAbsoluteOpacity()!==1;if(A&&N&&I)return!0;const W=this.hasShadow(),G=this.shadowForStrokeEnabled();return!!(A&&N&&W&&G)}setStrokeHitEnabled(C){t.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),C?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const C=this.size();return{x:this._centroid?-C.width/2:0,y:this._centroid?-C.height/2:0,width:C.width,height:C.height}}getClientRect(C={}){let x=!1,L=this.getParent();for(;L;){if(L.isCached()){x=!0;break}L=L.getParent()}const A=C.skipTransform,N=C.relativeTo||x&&this.getStage()||void 0,I=this.getSelfRect(),G=!C.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,$=I.width+G,J=I.height+G,V=!C.skipShadow&&this.hasShadow(),H=V?this.shadowOffsetX():0,z=V?this.shadowOffsetY():0,D=$+Math.abs(H),K=J+Math.abs(z),ne=V&&this.shadowBlur()||0,Z=D+ne*2,ee=K+ne*2,ae={width:Z,height:ee,x:-(G/2+ne)+Math.min(H,0)+I.x,y:-(G/2+ne)+Math.min(z,0)+I.y};return A?ae:this._transformedRect(ae,N)}drawScene(C,x,L){const A=this.getLayer();let N=C||A.getCanvas(),I=N.getContext(),W=this._getCanvasCache(),G=this.getSceneFunc(),$=this.hasShadow(),J,V;const H=N.isCache,z=x===this;if(!this.isVisible()&&!z)return this;if(W){I.save();const K=this.getAbsoluteTransform(x).getMatrix();return I.transform(K[0],K[1],K[2],K[3],K[4],K[5]),this._drawCachedSceneCanvas(I),I.restore(),this}if(!G)return this;if(I.save(),this._useBufferCanvas()&&!H){J=this.getStage();const K=L||J.bufferCanvas;V=K.getContext(),V.clear(),V.save(),V._applyLineJoin(this);var D=this.getAbsoluteTransform(x).getMatrix();V.transform(D[0],D[1],D[2],D[3],D[4],D[5]),G.call(this,V,this),V.restore();const ne=K.pixelRatio;$&&I._applyShadow(this),I._applyOpacity(this),I._applyGlobalCompositeOperation(this),I.drawImage(K._canvas,0,0,K.width/ne,K.height/ne)}else{if(I._applyLineJoin(this),!z){var D=this.getAbsoluteTransform(x).getMatrix();I.transform(D[0],D[1],D[2],D[3],D[4],D[5]),I._applyOpacity(this),I._applyGlobalCompositeOperation(this)}$&&I._applyShadow(this),G.call(this,I,this)}return I.restore(),this}drawHit(C,x,L=!1){if(!this.shouldDrawHit(x,L))return this;const A=this.getLayer(),N=C||A.hitCanvas,I=N&&N.getContext(),W=this.hitFunc()||this.sceneFunc(),G=this._getCanvasCache(),$=G&&G.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()"),$){I.save();const V=this.getAbsoluteTransform(x).getMatrix();return I.transform(V[0],V[1],V[2],V[3],V[4],V[5]),this._drawCachedHitCanvas(I),I.restore(),this}if(!W)return this;if(I.save(),I._applyLineJoin(this),!(this===x)){const V=this.getAbsoluteTransform(x).getMatrix();I.transform(V[0],V[1],V[2],V[3],V[4],V[5])}return W.call(this,I,this),I.restore(),this}drawHitFromCache(C=0){const x=this._getCanvasCache(),L=this._getCachedSceneCanvas(),A=x.hit,N=A.getContext(),I=A.getWidth(),W=A.getHeight();N.clear(),N.drawImage(L._canvas,0,0,I,W);try{const G=N.getImageData(0,0,I,W),$=G.data,J=$.length,V=t.Util._hexToRgb(this.colorKey);for(let H=0;H<J;H+=4)$[H+3]>C?($[H]=V.r,$[H+1]=V.g,$[H+2]=V.b,$[H+3]=255):$[H+3]=0;N.putImageData(G,0,0)}catch(G){t.Util.error("Unable to draw hit graph from cached scene canvas. "+G.message)}return this}hasPointerCapture(C){return l.hasPointerCapture(C,this)}setPointerCapture(C){l.setPointerCapture(C,this)}releaseCapture(C){l.releaseCapture(C,this)}}e.Shape=M,M.prototype._fillFunc=E,M.prototype._strokeFunc=S,M.prototype._fillFuncHit=y,M.prototype._strokeFuncHit=g,M.prototype._centroid=!1,M.prototype.nodeType="Shape",(0,o._registerNode)(M),M.prototype.eventListeners={},M.prototype.on.call(M.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",v),M.prototype.on.call(M.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",b),M.prototype.on.call(M.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",O),M.prototype.on.call(M.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",j),M.prototype.on.call(M.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",T),n.Factory.addGetterSetter(M,"stroke",void 0,(0,i.getStringOrGradientValidator)()),n.Factory.addGetterSetter(M,"strokeWidth",2,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(M,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(M,"hitStrokeWidth","auto",(0,i.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(M,"strokeHitEnabled",!0,(0,i.getBooleanValidator)()),n.Factory.addGetterSetter(M,"perfectDrawEnabled",!0,(0,i.getBooleanValidator)()),n.Factory.addGetterSetter(M,"shadowForStrokeEnabled",!0,(0,i.getBooleanValidator)()),n.Factory.addGetterSetter(M,"lineJoin"),n.Factory.addGetterSetter(M,"lineCap"),n.Factory.addGetterSetter(M,"sceneFunc"),n.Factory.addGetterSetter(M,"hitFunc"),n.Factory.addGetterSetter(M,"dash"),n.Factory.addGetterSetter(M,"dashOffset",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(M,"shadowColor",void 0,(0,i.getStringValidator)()),n.Factory.addGetterSetter(M,"shadowBlur",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(M,"shadowOpacity",1,(0,i.getNumberValidator)()),n.Factory.addComponentsGetterSetter(M,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(M,"shadowOffsetX",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(M,"shadowOffsetY",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(M,"fillPatternImage"),n.Factory.addGetterSetter(M,"fill",void 0,(0,i.getStringOrGradientValidator)()),n.Factory.addGetterSetter(M,"fillPatternX",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(M,"fillPatternY",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(M,"fillLinearGradientColorStops"),n.Factory.addGetterSetter(M,"strokeLinearGradientColorStops"),n.Factory.addGetterSetter(M,"fillRadialGradientStartRadius",0),n.Factory.addGetterSetter(M,"fillRadialGradientEndRadius",0),n.Factory.addGetterSetter(M,"fillRadialGradientColorStops"),n.Factory.addGetterSetter(M,"fillPatternRepeat","repeat"),n.Factory.addGetterSetter(M,"fillEnabled",!0),n.Factory.addGetterSetter(M,"strokeEnabled",!0),n.Factory.addGetterSetter(M,"shadowEnabled",!0),n.Factory.addGetterSetter(M,"dashEnabled",!0),n.Factory.addGetterSetter(M,"strokeScaleEnabled",!0),n.Factory.addGetterSetter(M,"fillPriority","color"),n.Factory.addComponentsGetterSetter(M,"fillPatternOffset",["x","y"]),n.Factory.addGetterSetter(M,"fillPatternOffsetX",0,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(M,"fillPatternOffsetY",0,(0,i.getNumberValidator)()),n.Factory.addComponentsGetterSetter(M,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(M,"fillPatternScaleX",1,(0,i.getNumberValidator)()),n.Factory.addGetterSetter(M,"fillPatternScaleY",1,(0,i.getNumberValidator)()),n.Factory.addComponentsGetterSetter(M,"fillLinearGradientStartPoint",["x","y"]),n.Factory.addComponentsGetterSetter(M,"strokeLinearGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(M,"fillLinearGradientStartPointX",0),n.Factory.addGetterSetter(M,"strokeLinearGradientStartPointX",0),n.Factory.addGetterSetter(M,"fillLinearGradientStartPointY",0),n.Factory.addGetterSetter(M,"strokeLinearGradientStartPointY",0),n.Factory.addComponentsGetterSetter(M,"fillLinearGradientEndPoint",["x","y"]),n.Factory.addComponentsGetterSetter(M,"strokeLinearGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(M,"fillLinearGradientEndPointX",0),n.Factory.addGetterSetter(M,"strokeLinearGradientEndPointX",0),n.Factory.addGetterSetter(M,"fillLinearGradientEndPointY",0),n.Factory.addGetterSetter(M,"strokeLinearGradientEndPointY",0),n.Factory.addComponentsGetterSetter(M,"fillRadialGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(M,"fillRadialGradientStartPointX",0),n.Factory.addGetterSetter(M,"fillRadialGradientStartPointY",0),n.Factory.addComponentsGetterSetter(M,"fillRadialGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(M,"fillRadialGradientEndPointX",0),n.Factory.addGetterSetter(M,"fillRadialGradientEndPointY",0),n.Factory.addGetterSetter(M,"fillPatternRotation",0),n.Factory.addGetterSetter(M,"fillRule",void 0,(0,i.getStringValidator)()),n.Factory.backCompat(M,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})}(ng)),ng}var Zy;function _6(){if(Zy)return Jh;Zy=1,Object.defineProperty(Jh,"__esModule",{value:!0}),Jh.Layer=void 0;const e=Li(),r=e0(),t=Ji(),n=Hr(),a=J1(),i=Wr(),o=Ma(),l=Mr(),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}],w=p.length;class d 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 S=this.getStage();return S&&S.content&&(S.content.removeChild(this.getNativeCanvasElement()),E<S.children.length-1?S.content.insertBefore(this.getNativeCanvasElement(),S.children[E+1].getCanvas()._canvas):S.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 S=this.getStage();return!S||!S.content?!1:(S.content.removeChild(this.getNativeCanvasElement()),this.index<S.children.length-1?S.content.insertBefore(this.getNativeCanvasElement(),S.children[this.index+1].getCanvas()._canvas):S.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(t.Node.prototype.moveDown.call(this)){const E=this.getStage();if(E){const S=E.children;E.content&&(E.content.removeChild(this.getNativeCanvasElement()),E.content.insertBefore(this.getNativeCanvasElement(),S[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(t.Node.prototype.moveToBottom.call(this)){const E=this.getStage();if(E){const S=E.children;E.content&&(E.content.removeChild(this.getNativeCanvasElement()),E.content.insertBefore(this.getNativeCanvasElement(),S[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:S}){return this.canvas.setSize(E,S),this.hitCanvas.setSize(E,S),this._setSmoothEnabled(),this}_validateAdd(E){const S=E.getType();S!=="Group"&&S!=="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 S=1,y=!1;for(;;){for(let g=0;g<w;g++){const v=p[g],b=this._getIntersection({x:E.x+v.x*S,y:E.y+v.y*S}),O=b.shape;if(O)return O;if(y=!!b.antialiased,!b.antialiased)break}if(y)S+=1;else return null}}_getIntersection(E){const S=this.hitCanvas.pixelRatio,y=this.hitCanvas.context.getImageData(Math.round(E.x*S),Math.round(E.y*S),1,1).data,g=y[3];if(g===255){const v=e.Util._rgbToHex(y[0],y[1],y[2]),b=o.shapes[u+v];return b?{shape:b}:{antialiased:!0}}else if(g>0)return{antialiased:!0};return{}}drawScene(E,S){const y=this.getLayer(),g=E||y&&y.getCanvas();return this._fire(c,{node:this}),this.clearBeforeDraw()&&g.getContext().clear(),r.Container.prototype.drawScene.call(this,g,S),this._fire(h,{node:this}),this}drawHit(E,S){const y=this.getLayer(),g=E||y&&y.hitCanvas;return y&&y.clearBeforeDraw()&&y.getHitCanvas().getContext().clear(),r.Container.prototype.drawHit.call(this,g,S),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 Jh.Layer=d,d.prototype.nodeType="Layer",(0,l._registerNode)(d),n.Factory.addGetterSetter(d,"imageSmoothingEnabled",!0),n.Factory.addGetterSetter(d,"clearBeforeDraw",!0),n.Factory.addGetterSetter(d,"hitGraphEnabled",!0,(0,i.getBooleanValidator)()),Jh}var ed={},Qy;function MS(){if(Qy)return ed;Qy=1,Object.defineProperty(ed,"__esModule",{value:!0}),ed.FastLayer=void 0;const e=Li(),r=_6(),t=Mr();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 ed.FastLayer=n,n.prototype.nodeType="FastLayer",(0,t._registerNode)(n),ed}var td={},Jy;function sm(){if(Jy)return td;Jy=1,Object.defineProperty(td,"__esModule",{value:!0}),td.Group=void 0;const e=Li(),r=e0(),t=Mr();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 td.Group=n,n.prototype.nodeType="Group",(0,t._registerNode)(n),td}var rd={},e5;function lm(){if(e5)return rd;e5=1,Object.defineProperty(rd,"__esModule",{value:!0}),rd.Animation=void 0;const e=Mr(),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 lh{constructor(i,o){this.id=lh.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,l=o.length;for(let u=0;u<l;u++)if(o[u]._id===i._id)return!1;return this.layers.push(i),!0}isRunning(){const o=lh.animations,l=o.length;for(let u=0;u<l;u++)if(o[u].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=t(),lh._addAnimation(this),this}stop(){return lh._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,l=this.animations,u=l.length;for(let c=0;c<u;c++)if(l[c].id===o){this.animations.splice(c,1);break}}static _runFrames(){const i={},o=this.animations;for(let l=0;l<o.length;l++){const u=o[l],c=u.layers,h=u.func;u._updateFrameObject(t());const p=c.length;let w;if(h?w=h.call(u,u.frame)!==!1:w=!0,!!w)for(let d=0;d<p;d++){const _=c[d];_._id!==void 0&&(i[_._id]=_)}}for(const l in i)i.hasOwnProperty(l)&&i[l].batchDraw()}static _animationLoop(){const i=lh;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 rd.Animation=n,n.animations=[],n.animIdCounter=0,n.animRunning=!1,rd}var ig={},t5;function IS(){return t5||(t5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const r=Li(),t=lm(),n=Ji(),a=Mr(),i={node:1,duration:1,easing:1,onFinish:1,yoyo:1},o=1,l=2,u=3,c=["fill","stroke","shadowColor"];let h=0;class p{constructor(_,E,S,y,g,v,b){this.prop=_,this.propFunc=E,this.begin=y,this._pos=y,this.duration=v,this._change=0,this.prevPos=0,this.yoyo=b,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=S,this._change=g-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=l,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=u,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(_){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===l?this.setTime(_):this.state===u&&this.setTime(this.duration-_)}pause(){this.state=o,this.fire("onPause")}getTimer(){return new Date().getTime()}}class w{constructor(_){const E=this,S=_.node,y=S._id,g=_.easing||e.Easings.Linear,v=!!_.yoyo;let b,O;typeof _.duration>"u"?b=.3:_.duration===0?b=.001:b=_.duration,this.node=S,this._id=h++;const j=S.getLayer()||(S instanceof a.Konva.Stage?S.getLayers():null);j||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()},j),this.tween=new p(O,function(T){E._tweenFunc(T)},g,0,1,b*1e3,v),this._addListeners(),w.attrs[y]||(w.attrs[y]={}),w.attrs[y][this._id]||(w.attrs[y][this._id]={}),w.tweens[y]||(w.tweens[y]={});for(O in _)i[O]===void 0&&this._addAttr(O,_[O]);this.reset(),this.onFinish=_.onFinish,this.onReset=_.onReset,this.onUpdate=_.onUpdate}_addAttr(_,E){const S=this.node,y=S._id;let g,v,b,O,j;const T=w.tweens[y][_];T&&delete w.attrs[y][T][_];let M=S.getAttr(_);if(r.Util._isArray(E))if(g=[],v=Math.max(E.length,M.length),_==="points"&&E.length!==M.length&&(E.length>M.length?(O=M,M=r.Util._prepareArrayForTween(M,E,S.closed())):(b=E,E=r.Util._prepareArrayForTween(E,M,S.closed()))),_.indexOf("fill")===0)for(let F=0;F<v;F++)if(F%2===0)g.push(E[F]-M[F]);else{const C=r.Util.colorToRGBA(M[F]);j=r.Util.colorToRGBA(E[F]),M[F]=C,g.push({r:j.r-C.r,g:j.g-C.g,b:j.b-C.b,a:j.a-C.a})}else for(let F=0;F<v;F++)g.push(E[F]-M[F]);else c.indexOf(_)!==-1?(M=r.Util.colorToRGBA(M),j=r.Util.colorToRGBA(E),g={r:j.r-M.r,g:j.g-M.g,b:j.b-M.b,a:j.a-M.a}):g=E-M;w.attrs[y][this._id][_]={start:M,diff:g,end:E,trueEnd:b,trueStart:O},w.tweens[y][_]=this._id}_tweenFunc(_){const E=this.node,S=w.attrs[E._id][this._id];let y,g,v,b,O,j,T,M;for(y in S){if(g=S[y],v=g.start,b=g.diff,M=g.end,r.Util._isArray(v))if(O=[],T=Math.max(v.length,M.length),y.indexOf("fill")===0)for(j=0;j<T;j++)j%2===0?O.push((v[j]||0)+b[j]*_):O.push("rgba("+Math.round(v[j].r+b[j].r*_)+","+Math.round(v[j].g+b[j].g*_)+","+Math.round(v[j].b+b[j].b*_)+","+(v[j].a+b[j].a*_)+")");else for(j=0;j<T;j++)O.push((v[j]||0)+b[j]*_);else c.indexOf(y)!==-1?O="rgba("+Math.round(v.r+b.r*_)+","+Math.round(v.g+b.g*_)+","+Math.round(v.b+b.b*_)+","+(v.a+b.a*_)+")":O=v+b*_;E.setAttr(y,O)}}_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=w.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=w.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,S=w.tweens[_];this.pause();for(const y in S)delete w.tweens[_][y];delete w.attrs[_][E]}}e.Tween=w,w.attrs={},w.tweens={},n.Node.prototype.to=function(d){const _=d.onFinish;d.node=this,d.onFinish=function(){this.destroy(),_&&_()},new w(d).play()},e.Easings={BackEaseIn(d,_,E,S){return E*(d/=S)*d*((1.70158+1)*d-1.70158)+_},BackEaseOut(d,_,E,S){return E*((d=d/S-1)*d*((1.70158+1)*d+1.70158)+1)+_},BackEaseInOut(d,_,E,S){let y=1.70158;return(d/=S/2)<1?E/2*(d*d*(((y*=1.525)+1)*d-y))+_:E/2*((d-=2)*d*(((y*=1.525)+1)*d+y)+2)+_},ElasticEaseIn(d,_,E,S,y,g){let v=0;return d===0?_:(d/=S)===1?_+E:(g||(g=S*.3),!y||y<Math.abs(E)?(y=E,v=g/4):v=g/(2*Math.PI)*Math.asin(E/y),-(y*Math.pow(2,10*(d-=1))*Math.sin((d*S-v)*(2*Math.PI)/g))+_)},ElasticEaseOut(d,_,E,S,y,g){let v=0;return d===0?_:(d/=S)===1?_+E:(g||(g=S*.3),!y||y<Math.abs(E)?(y=E,v=g/4):v=g/(2*Math.PI)*Math.asin(E/y),y*Math.pow(2,-10*d)*Math.sin((d*S-v)*(2*Math.PI)/g)+E+_)},ElasticEaseInOut(d,_,E,S,y,g){let v=0;return d===0?_:(d/=S/2)===2?_+E:(g||(g=S*(.3*1.5)),!y||y<Math.abs(E)?(y=E,v=g/4):v=g/(2*Math.PI)*Math.asin(E/y),d<1?-.5*(y*Math.pow(2,10*(d-=1))*Math.sin((d*S-v)*(2*Math.PI)/g))+_:y*Math.pow(2,-10*(d-=1))*Math.sin((d*S-v)*(2*Math.PI)/g)*.5+E+_)},BounceEaseOut(d,_,E,S){return(d/=S)<1/2.75?E*(7.5625*d*d)+_:d<2/2.75?E*(7.5625*(d-=1.5/2.75)*d+.75)+_:d<2.5/2.75?E*(7.5625*(d-=2.25/2.75)*d+.9375)+_:E*(7.5625*(d-=2.625/2.75)*d+.984375)+_},BounceEaseIn(d,_,E,S){return E-e.Easings.BounceEaseOut(S-d,0,E,S)+_},BounceEaseInOut(d,_,E,S){return d<S/2?e.Easings.BounceEaseIn(d*2,0,E,S)*.5+_:e.Easings.BounceEaseOut(d*2-S,0,E,S)*.5+E*.5+_},EaseIn(d,_,E,S){return E*(d/=S)*d+_},EaseOut(d,_,E,S){return-E*(d/=S)*(d-2)+_},EaseInOut(d,_,E,S){return(d/=S/2)<1?E/2*d*d+_:-E/2*(--d*(d-2)-1)+_},StrongEaseIn(d,_,E,S){return E*(d/=S)*d*d*d*d+_},StrongEaseOut(d,_,E,S){return E*((d=d/S-1)*d*d*d*d+1)+_},StrongEaseInOut(d,_,E,S){return(d/=S/2)<1?E/2*d*d*d*d*d+_:E/2*((d-=2)*d*d*d*d+2)+_},Linear(d,_,E,S){return E*d/S+_}}}(ig)),ig}var r5;function S2(){return r5||(r5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const r=Mr(),t=Li(),n=Ji(),a=e0(),i=RS(),o=_6(),l=MS(),u=sm(),c=om(),h=Ma(),p=lm(),w=IS(),d=b6(),_=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:l.FastLayer,Group:u.Group,DD:c.DD,Shape:h.Shape,shapes:h.shapes,Animation:p.Animation,Tween:w.Tween,Easings:w.Easings,Context:d.Context,Canvas:_.Canvas}),e.default=e.Konva}(Z0)),Z0}var nd={},n5;function jS(){if(n5)return nd;n5=1,Object.defineProperty(nd,"__esModule",{value:!0}),nd.Arc=void 0;const e=Hr(),r=Ma(),t=Mr(),n=Wr(),a=Mr();class i extends r.Shape{_sceneFunc(l){const u=t.Konva.getAngle(this.angle()),c=this.clockwise();l.beginPath(),l.arc(0,0,this.outerRadius(),0,u,c),l.arc(0,0,this.innerRadius(),u,0,!c),l.closePath(),l.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(l){this.outerRadius(l/2)}setHeight(l){this.outerRadius(l/2)}getSelfRect(){const l=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)),w=1,d=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?l:u),S=w*u,y=d*(d>0?l:u),g=_*(_>0?u:l);return{x:E,y:c?-1*g:y,width:S-E,height:g-y}}}return nd.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)()),nd}var id={},ad={},i5;function S6(){if(i5)return ad;i5=1,Object.defineProperty(ad,"__esModule",{value:!0}),ad.Line=void 0;const e=Hr(),r=Mr(),t=Ma(),n=Wr();function a(l,u,c,h,p,w,d){const _=Math.sqrt(Math.pow(c-l,2)+Math.pow(h-u,2)),E=Math.sqrt(Math.pow(p-c,2)+Math.pow(w-h,2)),S=d*_/(_+E),y=d*E/(_+E),g=c-S*(p-l),v=h-S*(w-u),b=c+y*(p-l),O=h+y*(w-u);return[g,v,b,O]}function i(l,u){const c=l.length,h=[];for(let p=2;p<c-2;p+=2){const w=a(l[p-2],l[p-1],l[p],l[p+1],l[p+2],l[p+3],u);isNaN(w[0])||(h.push(w[0]),h.push(w[1]),h.push(l[p]),h.push(l[p+1]),h.push(w[2]),h.push(w[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(),w=this.closed(),d=this.bezier(),_,E,S;if(h){if(u.beginPath(),u.moveTo(c[0],c[1]),p!==0&&h>4){for(_=this.getTensionPoints(),E=_.length,S=w?0:4,w||u.quadraticCurveTo(_[0],_[1],_[2],_[3]);S<E-2;)u.bezierCurveTo(_[S++],_[S++],_[S++],_[S++],_[S++],_[S++]);w||u.quadraticCurveTo(_[E-2],_[E-1],c[h-2],c[h-1])}else if(d)for(S=2;S<h;)u.bezierCurveTo(c[S++],c[S++],c[S++],c[S++],c[S++],c[S++]);else for(S=2;S<h;S+=2)u.lineTo(c[S],c[S+1]);w?(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),w=a(u[c-4],u[c-3],u[c-2],u[c-1],u[0],u[1],h),d=i(u,h);return[p[2],p[3]].concat(d).concat([w[0],w[1],u[c-2],u[c-1],w[2],w[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],w=u[1],d,_;for(let E=0;E<u.length/2;E++)d=u[E*2],_=u[E*2+1],c=Math.min(c,d),h=Math.max(h,d),p=Math.min(p,_),w=Math.max(w,_);return{x:c,y:p,width:h-c,height:w-p}}}return ad.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)()),ad}var od={},ag={},a5;function FS(){return a5||(a5=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,l,u)=>{let c,h;const w=u/2;c=0;for(let d=0;d<20;d++)h=w*e.tValues[20][d]+w,c+=e.cValues[20][d]*n(o,l,h);return w*c};e.getCubicArcLength=r;const t=(o,l,u)=>{u===void 0&&(u=1);const c=o[0]-2*o[1]+o[2],h=l[0]-2*l[1]+l[2],p=2*o[1]-2*o[0],w=2*l[1]-2*l[0],d=4*(c*c+h*h),_=4*(c*p+h*w),E=p*p+w*w;if(d===0)return u*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(l[2]-l[0],2));const S=_/(2*d),y=E/d,g=u+S,v=y-S*S,b=g*g+v>0?Math.sqrt(g*g+v):0,O=S*S+v>0?Math.sqrt(S*S+v):0,j=S+Math.sqrt(S*S+v)!==0?v*Math.log(Math.abs((g+b)/(S+O))):0;return Math.sqrt(d)/2*(g*b-S*O+j)};e.getQuadraticArcLength=t;function n(o,l,u){const c=a(1,u,o),h=a(1,u,l),p=c*c+h*h;return Math.sqrt(p)}const a=(o,l,u)=>{const c=u.length-1;let h,p;if(c===0)return 0;if(o===0){p=0;for(let w=0;w<=c;w++)p+=e.binomialCoefficients[c][w]*Math.pow(1-l,c-w)*Math.pow(l,w)*u[w];return p}else{h=new Array(c);for(let w=0;w<c;w++)h[w]=c*(u[w+1]-u[w]);return a(o-1,l,h)}},i=(o,l,u)=>{let c=1,h=o/l,p=(o-u(h))/l,w=0;for(;c>.001;){const d=u(h+p),_=Math.abs(o-d)/l;if(_<c)c=_,h+=p;else{const E=u(h-p),S=Math.abs(o-E)/l;S<c?(c=S,h-=p):p/=2}if(w++,w>500)break}return h};e.t2length=i}(ag)),ag}var o5;function um(){if(o5)return od;o5=1,Object.defineProperty(od,"__esModule",{value:!0}),od.Path=void 0;const e=Hr(),r=Ma(),t=Mr(),n=FS();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 l=this.dataArray;o.beginPath();let u=!1;for(let b=0;b<l.length;b++){const O=l[b].command,j=l[b].points;switch(O){case"L":o.lineTo(j[0],j[1]);break;case"M":o.moveTo(j[0],j[1]);break;case"C":o.bezierCurveTo(j[0],j[1],j[2],j[3],j[4],j[5]);break;case"Q":o.quadraticCurveTo(j[0],j[1],j[2],j[3]);break;case"A":var c=j[0],h=j[1],p=j[2],w=j[3],d=j[4],_=j[5],E=j[6],S=j[7],y=p>w?p:w,g=p>w?1:p/w,v=p>w?w/p:1;o.translate(c,h),o.rotate(E),o.scale(g,v),o.arc(0,0,y,d,d+_,1-S),o.scale(1/g,1/v),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(d){if(d.command==="A"){const _=d.points[4],E=d.points[5],S=d.points[4]+E;let y=Math.PI/180;if(Math.abs(_-S)<y&&(y=Math.abs(_-S)),E<0)for(let g=_-y;g>S;g-=y){const v=a.getPointOnEllipticalArc(d.points[0],d.points[1],d.points[2],d.points[3],g,0);o.push(v.x,v.y)}else for(let g=_+y;g<S;g+=y){const v=a.getPointOnEllipticalArc(d.points[0],d.points[1],d.points[2],d.points[3],g,0);o.push(v.x,v.y)}}else if(d.command==="C")for(let _=0;_<=1;_+=.01){const E=a.getPointOnCubicBezier(_,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3],d.points[4],d.points[5]);o.push(E.x,E.y)}else o=o.concat(d.points)});let l=o[0],u=o[0],c=o[1],h=o[1],p,w;for(let d=0;d<o.length/2;d++)p=o[d*2],w=o[d*2+1],isNaN(p)||(l=Math.min(l,p),u=Math.max(u,p)),isNaN(w)||(c=Math.min(c,w),h=Math.max(h,w));return{x:l,y:c,width:u-l,height:h-c}}getLength(){return this.pathLength}getPointAtLength(o){return a.getPointAtLengthOfDataArray(o,this.dataArray)}static getLineLength(o,l,u,c){return Math.sqrt((u-o)*(u-o)+(c-l)*(c-l))}static getPathLength(o){let l=0;for(let u=0;u<o.length;++u)l+=o[u].pathLength;return l}static getPointAtLengthOfDataArray(o,l){let u,c=0,h=l.length;if(!h)return null;for(;c<h&&o>l[c].pathLength;)o-=l[c].pathLength,++c;if(c===h)return u=l[c-1].points.slice(-2),{x:u[0],y:u[1]};if(o<.01)return u=l[c].points.slice(0,2),{x:u[0],y:u[1]};const p=l[c],w=p.points;switch(p.command){case"L":return a.getPointOnLine(o,p.start.x,p.start.y,w[0],w[1]);case"C":return a.getPointOnCubicBezier((0,n.t2length)(o,a.getPathLength(l),b=>(0,n.getCubicArcLength)([p.start.x,w[0],w[2],w[4]],[p.start.y,w[1],w[3],w[5]],b)),p.start.x,p.start.y,w[0],w[1],w[2],w[3],w[4],w[5]);case"Q":return a.getPointOnQuadraticBezier((0,n.t2length)(o,a.getPathLength(l),b=>(0,n.getQuadraticArcLength)([p.start.x,w[0],w[2]],[p.start.y,w[1],w[3]],b)),p.start.x,p.start.y,w[0],w[1],w[2],w[3]);case"A":var d=w[0],_=w[1],E=w[2],S=w[3],y=w[4],g=w[5],v=w[6];return y+=g*o/p.pathLength,a.getPointOnEllipticalArc(d,_,E,S,y,v)}return null}static getPointOnLine(o,l,u,c,h,p,w){p=p??l,w=w??u;const d=this.getLineLength(l,u,c,h);if(d<1e-10)return{x:l,y:u};if(c===l)return{x:p,y:w+(h>u?o:-o)};const _=(h-u)/(c-l),E=Math.sqrt(o*o/(1+_*_))*(c<l?-1:1),S=_*E;if(Math.abs(w-u-_*(p-l))<1e-10)return{x:p+E,y:w+S};const y=((p-l)*(c-l)+(w-u)*(h-u))/(d*d),g=l+y*(c-l),v=u+y*(h-u),b=this.getLineLength(p,w,g,v),O=Math.sqrt(o*o-b*b),j=Math.sqrt(O*O/(1+_*_))*(c<l?-1:1),T=_*j;return{x:g+j,y:v+T}}static getPointOnCubicBezier(o,l,u,c,h,p,w,d,_){function E(O){return O*O*O}function S(O){return 3*O*O*(1-O)}function y(O){return 3*O*(1-O)*(1-O)}function g(O){return(1-O)*(1-O)*(1-O)}const v=d*E(o)+p*S(o)+c*y(o)+l*g(o),b=_*E(o)+w*S(o)+h*y(o)+u*g(o);return{x:v,y:b}}static getPointOnQuadraticBezier(o,l,u,c,h,p,w){function d(g){return g*g}function _(g){return 2*g*(1-g)}function E(g){return(1-g)*(1-g)}const S=p*d(o)+c*_(o)+l*E(o),y=w*d(o)+h*_(o)+u*E(o);return{x:S,y}}static getPointOnEllipticalArc(o,l,u,c,h,p){const w=Math.cos(p),d=Math.sin(p),_={x:u*Math.cos(h),y:c*Math.sin(h)};return{x:o+(_.x*w-_.y*d),y:l+(_.x*d+_.y*w)}}static parsePathData(o){if(!o)return[];let l=o;const u=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];l=l.replace(new RegExp(" ","g"),",");for(var c=0;c<u.length;c++)l=l.replace(new RegExp(u[c],"g"),"|"+u[c]);const h=l.split("|"),p=[],w=[];let d=0,_=0;const E=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let S;for(c=1;c<h.length;c++){let A=h[c],N=A.charAt(0);for(A=A.slice(1),w.length=0;S=E.exec(A);)w.push(S[0]);const I=[];for(let W=0,G=w.length;W<G;W++){if(w[W]==="00"){I.push(0,0);continue}const $=parseFloat(w[W]);isNaN($)?I.push(0):I.push($)}for(;I.length>0&&!isNaN(I[0]);){let W="",G=[];const $=d,J=_;var y,g,v,b,O,j,T,M,F,C;switch(N){case"l":d+=I.shift(),_+=I.shift(),W="L",G.push(d,_);break;case"L":d=I.shift(),_=I.shift(),G.push(d,_);break;case"m":var x=I.shift(),L=I.shift();if(d+=x,_+=L,W="M",p.length>2&&p[p.length-1].command==="z"){for(let V=p.length-2;V>=0;V--)if(p[V].command==="M"){d=p[V].points[0]+x,_=p[V].points[1]+L;break}}G.push(d,_),N="l";break;case"M":d=I.shift(),_=I.shift(),W="M",G.push(d,_),N="L";break;case"h":d+=I.shift(),W="L",G.push(d,_);break;case"H":d=I.shift(),W="L",G.push(d,_);break;case"v":_+=I.shift(),W="L",G.push(d,_);break;case"V":_=I.shift(),W="L",G.push(d,_);break;case"C":G.push(I.shift(),I.shift(),I.shift(),I.shift()),d=I.shift(),_=I.shift(),G.push(d,_);break;case"c":G.push(d+I.shift(),_+I.shift(),d+I.shift(),_+I.shift()),d+=I.shift(),_+=I.shift(),W="C",G.push(d,_);break;case"S":g=d,v=_,y=p[p.length-1],y.command==="C"&&(g=d+(d-y.points[2]),v=_+(_-y.points[3])),G.push(g,v,I.shift(),I.shift()),d=I.shift(),_=I.shift(),W="C",G.push(d,_);break;case"s":g=d,v=_,y=p[p.length-1],y.command==="C"&&(g=d+(d-y.points[2]),v=_+(_-y.points[3])),G.push(g,v,d+I.shift(),_+I.shift()),d+=I.shift(),_+=I.shift(),W="C",G.push(d,_);break;case"Q":G.push(I.shift(),I.shift()),d=I.shift(),_=I.shift(),G.push(d,_);break;case"q":G.push(d+I.shift(),_+I.shift()),d+=I.shift(),_+=I.shift(),W="Q",G.push(d,_);break;case"T":g=d,v=_,y=p[p.length-1],y.command==="Q"&&(g=d+(d-y.points[0]),v=_+(_-y.points[1])),d=I.shift(),_=I.shift(),W="Q",G.push(g,v,d,_);break;case"t":g=d,v=_,y=p[p.length-1],y.command==="Q"&&(g=d+(d-y.points[0]),v=_+(_-y.points[1])),d+=I.shift(),_+=I.shift(),W="Q",G.push(g,v,d,_);break;case"A":b=I.shift(),O=I.shift(),j=I.shift(),T=I.shift(),M=I.shift(),F=d,C=_,d=I.shift(),_=I.shift(),W="A",G=this.convertEndpointToCenterParameterization(F,C,d,_,T,M,b,O,j);break;case"a":b=I.shift(),O=I.shift(),j=I.shift(),T=I.shift(),M=I.shift(),F=d,C=_,d+=I.shift(),_+=I.shift(),W="A",G=this.convertEndpointToCenterParameterization(F,C,d,_,T,M,b,O,j);break}p.push({command:W||N,points:G,start:{x:$,y:J},pathLength:this.calcLength($,J,W||N,G)})}(N==="z"||N==="Z")&&p.push({command:"z",points:[],start:void 0,pathLength:0})}return p}static calcLength(o,l,u,c){let h,p,w,d;const _=a;switch(u){case"L":return _.getLineLength(o,l,c[0],c[1]);case"C":return(0,n.getCubicArcLength)([o,c[0],c[2],c[4]],[l,c[1],c[3],c[5]],1);case"Q":return(0,n.getQuadraticArcLength)([o,c[0],c[2]],[l,c[1],c[3]],1);case"A":h=0;var E=c[4],S=c[5],y=c[4]+S,g=Math.PI/180;if(Math.abs(E-y)<g&&(g=Math.abs(E-y)),p=_.getPointOnEllipticalArc(c[0],c[1],c[2],c[3],E,0),S<0)for(d=E-g;d>y;d-=g)w=_.getPointOnEllipticalArc(c[0],c[1],c[2],c[3],d,0),h+=_.getLineLength(p.x,p.y,w.x,w.y),p=w;else for(d=E+g;d<y;d+=g)w=_.getPointOnEllipticalArc(c[0],c[1],c[2],c[3],d,0),h+=_.getLineLength(p.x,p.y,w.x,w.y),p=w;return w=_.getPointOnEllipticalArc(c[0],c[1],c[2],c[3],y,0),h+=_.getLineLength(p.x,p.y,w.x,w.y),h}return 0}static convertEndpointToCenterParameterization(o,l,u,c,h,p,w,d,_){const E=_*(Math.PI/180),S=Math.cos(E)*(o-u)/2+Math.sin(E)*(l-c)/2,y=-1*Math.sin(E)*(o-u)/2+Math.cos(E)*(l-c)/2,g=S*S/(w*w)+y*y/(d*d);g>1&&(w*=Math.sqrt(g),d*=Math.sqrt(g));let v=Math.sqrt((w*w*(d*d)-w*w*(y*y)-d*d*(S*S))/(w*w*(y*y)+d*d*(S*S)));h===p&&(v*=-1),isNaN(v)&&(v=0);const b=v*w*y/d,O=v*-d*S/w,j=(o+u)/2+Math.cos(E)*b-Math.sin(E)*O,T=(l+c)/2+Math.sin(E)*b+Math.cos(E)*O,M=function(I){return Math.sqrt(I[0]*I[0]+I[1]*I[1])},F=function(I,W){return(I[0]*W[0]+I[1]*W[1])/(M(I)*M(W))},C=function(I,W){return(I[0]*W[1]<I[1]*W[0]?-1:1)*Math.acos(F(I,W))},x=C([1,0],[(S-b)/w,(y-O)/d]),L=[(S-b)/w,(y-O)/d],A=[(-1*S-b)/w,(-1*y-O)/d];let N=C(L,A);return F(L,A)<=-1&&(N=Math.PI),F(L,A)>=1&&(N=0),p===0&&N>0&&(N=N-2*Math.PI),p===1&&N<0&&(N=N+2*Math.PI),[j,T,w,d,x,N,E,p]}}return od.Path=a,a.prototype.className="Path",a.prototype._attrsAffectingSize=["data"],(0,t._registerNode)(a),e.Factory.addGetterSetter(a,"data"),od}var s5;function DS(){if(s5)return id;s5=1,Object.defineProperty(id,"__esModule",{value:!0}),id.Arrow=void 0;const e=Hr(),r=S6(),t=Wr(),n=Mr(),a=um();class i extends r.Line{_sceneFunc(l){super._sceneFunc(l);const u=Math.PI*2,c=this.points();let h=c;const p=this.tension()!==0&&c.length>4;p&&(h=this.getTensionPoints());const w=this.pointerLength(),d=c.length;let _,E;if(p){const g=[h[h.length-4],h[h.length-3],h[h.length-2],h[h.length-1],c[d-2],c[d-1]],v=a.Path.calcLength(h[h.length-4],h[h.length-3],"C",g),b=a.Path.getPointOnQuadraticBezier(Math.min(1,1-w/v),g[0],g[1],g[2],g[3],g[4],g[5]);_=c[d-2]-b.x,E=c[d-1]-b.y}else _=c[d-2]-c[d-4],E=c[d-1]-c[d-3];const S=(Math.atan2(E,_)+u)%u,y=this.pointerWidth();this.pointerAtEnding()&&(l.save(),l.beginPath(),l.translate(c[d-2],c[d-1]),l.rotate(S),l.moveTo(0,0),l.lineTo(-w,y/2),l.lineTo(-w,-y/2),l.closePath(),l.restore(),this.__fillStroke(l)),this.pointerAtBeginning()&&(l.save(),l.beginPath(),l.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]),l.rotate((Math.atan2(-E,-_)+u)%u),l.moveTo(0,0),l.lineTo(-w,y/2),l.lineTo(-w,-y/2),l.closePath(),l.restore(),this.__fillStroke(l))}__fillStroke(l){const u=this.dashEnabled();u&&(this.attrs.dashEnabled=!1,l.setLineDash([])),l.fillStrokeShape(this),u&&(this.attrs.dashEnabled=!0)}getSelfRect(){const l=super.getSelfRect(),u=this.pointerWidth()/2;return{x:l.x,y:l.y-u,width:l.width,height:l.height+u*2}}}return id.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),id}var sd={},l5;function BS(){if(l5)return sd;l5=1,Object.defineProperty(sd,"__esModule",{value:!0}),sd.Circle=void 0;const e=Hr(),r=Ma(),t=Wr(),n=Mr();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 sd.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)()),sd}var ld={},u5;function qS(){if(u5)return ld;u5=1,Object.defineProperty(ld,"__esModule",{value:!0}),ld.Ellipse=void 0;const e=Hr(),r=Ma(),t=Wr(),n=Mr();class a extends r.Shape{_sceneFunc(o){const l=this.radiusX(),u=this.radiusY();o.beginPath(),o.save(),l!==u&&o.scale(1,u/l),o.arc(0,0,l,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 ld.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)()),ld}var ud={},c5;function zS(){if(c5)return ud;c5=1,Object.defineProperty(ud,"__esModule",{value:!0}),ud.Image=void 0;const e=Li(),r=Hr(),t=Ma(),n=Mr(),a=Wr();class i extends t.Shape{constructor(l){super(l),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",u=>{this._removeImageLoad(u.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const l=this.image();l&&l.complete||l&&l.readyState===4||l&&l.addEventListener&&l.addEventListener("load",this._loadListener)}_removeImageLoad(l){l&&l.removeEventListener&&l.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const l=!!this.cornerRadius(),u=this.hasShadow();return l&&u?!0:super._useBufferCanvas(!0)}_sceneFunc(l){const u=this.getWidth(),c=this.getHeight(),h=this.cornerRadius(),p=this.attrs.image;let w;if(p){const d=this.attrs.cropWidth,_=this.attrs.cropHeight;d&&_?w=[p,this.cropX(),this.cropY(),d,_,0,0,u,c]:w=[p,0,0,u,c]}(this.hasFill()||this.hasStroke()||h)&&(l.beginPath(),h?e.Util.drawRoundedRectPath(l,u,c,h):l.rect(0,0,u,c),l.closePath(),l.fillStrokeShape(this)),p&&(h&&l.clip(),l.drawImage.apply(l,w))}_hitFunc(l){const u=this.width(),c=this.height(),h=this.cornerRadius();l.beginPath(),h?e.Util.drawRoundedRectPath(l,u,c,h):l.rect(0,0,u,c),l.closePath(),l.fillStrokeShape(this)}getWidth(){var l,u;return(l=this.attrs.width)!==null&&l!==void 0?l:(u=this.image())===null||u===void 0?void 0:u.width}getHeight(){var l,u;return(l=this.attrs.height)!==null&&l!==void 0?l:(u=this.image())===null||u===void 0?void 0:u.height}static fromURL(l,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=l}}return ud.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)()),ud}var bf={},f5;function US(){if(f5)return bf;f5=1,Object.defineProperty(bf,"__esModule",{value:!0}),bf.Tag=bf.Label=void 0;const e=Hr(),r=Ma(),t=sm(),n=Wr(),a=Mr(),i=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],o="Change.konva",l="none",u="up",c="right",h="down",p="left",w=i.length;class d extends t.Group{constructor(S){super(S),this.on("add.konva",function(y){this._addListeners(y.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(S){let y=this,g;const v=function(){y._sync()};for(g=0;g<w;g++)S.on(i[g]+o,v)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let S=this.getText(),y=this.getTag(),g,v,b,O,j,T,M;if(S&&y){switch(g=S.width(),v=S.height(),b=y.pointerDirection(),O=y.pointerWidth(),M=y.pointerHeight(),j=0,T=0,b){case u:j=g/2,T=-1*M;break;case c:j=g+O,T=v/2;break;case h:j=g/2,T=v+M;break;case p:j=-1*O,T=v/2;break}y.setAttrs({x:-1*j,y:-1*T,width:g,height:v}),S.setAttrs({x:-1*j,y:-1*T})}}}bf.Label=d,d.prototype.className="Label",(0,a._registerNode)(d);class _ extends r.Shape{_sceneFunc(S){const y=this.width(),g=this.height(),v=this.pointerDirection(),b=this.pointerWidth(),O=this.pointerHeight(),j=this.cornerRadius();let T=0,M=0,F=0,C=0;typeof j=="number"?T=M=F=C=Math.min(j,y/2,g/2):(T=Math.min(j[0]||0,y/2,g/2),M=Math.min(j[1]||0,y/2,g/2),C=Math.min(j[2]||0,y/2,g/2),F=Math.min(j[3]||0,y/2,g/2)),S.beginPath(),S.moveTo(T,0),v===u&&(S.lineTo((y-b)/2,0),S.lineTo(y/2,-1*O),S.lineTo((y+b)/2,0)),S.lineTo(y-M,0),S.arc(y-M,M,M,Math.PI*3/2,0,!1),v===c&&(S.lineTo(y,(g-O)/2),S.lineTo(y+b,g/2),S.lineTo(y,(g+O)/2)),S.lineTo(y,g-C),S.arc(y-C,g-C,C,0,Math.PI/2,!1),v===h&&(S.lineTo((y+b)/2,g),S.lineTo(y/2,g+O),S.lineTo((y-b)/2,g)),S.lineTo(F,g),S.arc(F,g-F,F,Math.PI/2,Math.PI,!1),v===p&&(S.lineTo(0,(g+O)/2),S.lineTo(-1*b,g/2),S.lineTo(0,(g-O)/2)),S.lineTo(0,T),S.arc(T,T,T,Math.PI,Math.PI*3/2,!1),S.closePath(),S.fillStrokeShape(this)}getSelfRect(){let S=0,y=0,g=this.pointerWidth(),v=this.pointerHeight(),b=this.pointerDirection(),O=this.width(),j=this.height();return b===u?(y-=v,j+=v):b===h?j+=v:b===p?(S-=g*1.5,O+=g):b===c&&(O+=g*1.5),{x:S,y,width:O,height:j}}}return bf.Tag=_,_.prototype.className="Tag",(0,a._registerNode)(_),e.Factory.addGetterSetter(_,"pointerDirection",l),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 cd={},h5;function x6(){if(h5)return cd;h5=1,Object.defineProperty(cd,"__esModule",{value:!0}),cd.Rect=void 0;const e=Hr(),r=Ma(),t=Mr(),n=Li(),a=Wr();class i extends r.Shape{_sceneFunc(l){const u=this.cornerRadius(),c=this.width(),h=this.height();l.beginPath(),u?n.Util.drawRoundedRectPath(l,c,h,u):l.rect(0,0,c,h),l.closePath(),l.fillStrokeShape(this)}}return cd.Rect=i,i.prototype.className="Rect",(0,t._registerNode)(i),e.Factory.addGetterSetter(i,"cornerRadius",0,(0,a.getNumberOrArrayOfNumbersValidator)(4)),cd}var fd={},d5;function HS(){if(d5)return fd;d5=1,Object.defineProperty(fd,"__esModule",{value:!0}),fd.RegularPolygon=void 0;const e=Hr(),r=Ma(),t=Wr(),n=Mr();class a extends r.Shape{_sceneFunc(o){const l=this._getPoints();o.beginPath(),o.moveTo(l[0].x,l[0].y);for(let u=1;u<l.length;u++)o.lineTo(l[u].x,l[u].y);o.closePath(),o.fillStrokeShape(this)}_getPoints(){const o=this.attrs.sides,l=this.attrs.radius||0,u=[];for(let c=0;c<o;c++)u.push({x:l*Math.sin(c*2*Math.PI/o),y:-1*l*Math.cos(c*2*Math.PI/o)});return u}getSelfRect(){const o=this._getPoints();let l=o[0].x,u=o[0].y,c=o[0].x,h=o[0].y;return o.forEach(p=>{l=Math.min(l,p.x),u=Math.max(u,p.x),c=Math.min(c,p.y),h=Math.max(h,p.y)}),{x:l,y:c,width:u-l,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 fd.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)()),fd}var hd={},p5;function VS(){if(p5)return hd;p5=1,Object.defineProperty(hd,"__esModule",{value:!0}),hd.Ring=void 0;const e=Hr(),r=Ma(),t=Wr(),n=Mr(),a=Math.PI*2;class i extends r.Shape{_sceneFunc(l){l.beginPath(),l.arc(0,0,this.innerRadius(),0,a,!1),l.moveTo(this.outerRadius(),0),l.arc(0,0,this.outerRadius(),a,0,!0),l.closePath(),l.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(l){this.outerRadius(l/2)}setHeight(l){this.outerRadius(l/2)}}return hd.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)()),hd}var dd={},g5;function GS(){if(g5)return dd;g5=1,Object.defineProperty(dd,"__esModule",{value:!0}),dd.Sprite=void 0;const e=Hr(),r=Ma(),t=lm(),n=Wr(),a=Mr();class i extends r.Shape{constructor(l){super(l),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(l){const u=this.animation(),c=this.frameIndex(),h=c*4,p=this.animations()[u],w=this.frameOffsets(),d=p[h+0],_=p[h+1],E=p[h+2],S=p[h+3],y=this.image();if((this.hasFill()||this.hasStroke())&&(l.beginPath(),l.rect(0,0,E,S),l.closePath(),l.fillStrokeShape(this)),y)if(w){const g=w[u],v=c*2;l.drawImage(y,d,_,E,S,g[v+0],g[v+1],E,S)}else l.drawImage(y,d,_,E,S,0,0,E,S)}_hitFunc(l){const u=this.animation(),c=this.frameIndex(),h=c*4,p=this.animations()[u],w=this.frameOffsets(),d=p[h+2],_=p[h+3];if(l.beginPath(),w){const E=w[u],S=c*2;l.rect(E[S+0],E[S+1],d,_)}else l.rect(0,0,d,_);l.closePath(),l.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const l=this;this.interval=setInterval(function(){l._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const l=this.getLayer();this.anim.setLayers(l),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const l=this.frameIndex(),u=this.animation(),c=this.animations(),h=c[u],p=h.length/4;l<p-1?this.frameIndex(l+1):this.frameIndex(0)}}return dd.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"}),dd}var pd={},v5;function WS(){if(v5)return pd;v5=1,Object.defineProperty(pd,"__esModule",{value:!0}),pd.Star=void 0;const e=Hr(),r=Ma(),t=Wr(),n=Mr();class a extends r.Shape{_sceneFunc(o){const l=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:l,w=p*Math.sin(h*Math.PI/c),d=-1*p*Math.cos(h*Math.PI/c);o.lineTo(w,d)}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 pd.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)()),pd}var nh={},m5;function E6(){if(m5)return nh;m5=1,Object.defineProperty(nh,"__esModule",{value:!0}),nh.Text=void 0,nh.stringToArray=o;const e=Li(),r=Hr(),t=Ma(),n=Mr(),a=Wr(),i=Mr();function o(z){return[...z].reduce((D,K,ne,Z)=>{if(new RegExp("\\p{Emoji}","u").test(K)){const ee=Z[ne+1];ee&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(ee)?(D.push(K+ee),Z[ne+1]=""):D.push(K)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(K+(Z[ne+1]||""))?D.push(K+Z[ne+1]):ne>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(K)?D[D.length-1]+=K:K&&D.push(K);return D},[])}const l="auto",u="center",c="inherit",h="justify",p="Change.konva",w="2d",d="-",_="left",E="text",S="Text",y="top",g="bottom",v="middle",b="normal",O="px ",j=" ",T="right",M="rtl",F="word",C="char",x="none",L="…",A=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],N=A.length;function I(z){return z.split(",").map(D=>{D=D.trim();const K=D.indexOf(" ")>=0,ne=D.indexOf('"')>=0||D.indexOf("'")>=0;return K&&!ne&&(D=`"${D}"`),D}).join(", ")}let W;function G(){return W||(W=e.Util.createCanvasElement().getContext(w),W)}function $(z){z.fillText(this._partialText,this._partialTextX,this._partialTextY)}function J(z){z.setAttr("miterLimit",2),z.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function V(z){return z=z||{},!z.fillLinearGradientColorStops&&!z.fillRadialGradientColorStops&&!z.fillPatternImage&&(z.fill=z.fill||"black"),z}class H extends t.Shape{constructor(D){super(V(D)),this._partialTextX=0,this._partialTextY=0;for(let K=0;K<N;K++)this.on(A[K]+p,this._setTextData);this._setTextData()}_sceneFunc(D){const K=this.textArr,ne=K.length;if(!this.text())return;let Z=this.padding(),ee=this.fontSize(),ae=this.lineHeight()*ee,se=this.verticalAlign(),ce=this.direction(),me=0,xe=this.align(),Oe=this.getWidth(),Re=this.letterSpacing(),Se=this.fill(),ve=this.textDecoration(),He=ve.indexOf("underline")!==-1,we=ve.indexOf("line-through")!==-1,Ae;ce=ce===c?D.direction:ce;let Ee=ae/2,Ne=v;if(n.Konva._fixTextRendering){const nt=this.measureSize("M");Ne="alphabetic",Ee=(nt.fontBoundingBoxAscent-nt.fontBoundingBoxDescent)/2+ae/2}var he=0,Le=0;for(ce===M&&D.setAttr("direction",ce),D.setAttr("font",this._getContextFont()),D.setAttr("textBaseline",Ne),D.setAttr("textAlign",_),se===v?me=(this.getHeight()-ne*ae-Z*2)/2:se===g&&(me=this.getHeight()-ne*ae-Z*2),D.translate(Z,me+Z),Ae=0;Ae<ne;Ae++){var he=0,Le=0,Ce=K[Ae],De=Ce.text,tt=Ce.width,vt=Ce.lastInParagraph,mt,Et;if(D.save(),xe===T?he+=Oe-tt-Z*2:xe===u&&(he+=(Oe-tt-Z*2)/2),He){D.save(),D.beginPath();const qt=n.Konva._fixTextRendering?Math.round(ee/4):Math.round(ee/2),Ct=he,or=Ee+Le+qt;D.moveTo(Ct,or),mt=De.split(" ").length-1,Et=xe===h&&!vt?Oe-Z*2:tt,D.lineTo(Ct+Math.round(Et),or),D.lineWidth=ee/15;const Xt=this._getLinearGradient();D.strokeStyle=Xt||Se,D.stroke(),D.restore()}if(we){D.save(),D.beginPath();const qt=n.Konva._fixTextRendering?-Math.round(ee/4):0;D.moveTo(he,Ee+Le+qt),mt=De.split(" ").length-1,Et=xe===h&&!vt?Oe-Z*2:tt,D.lineTo(he+Math.round(Et),Ee+Le+qt),D.lineWidth=ee/15;const Ct=this._getLinearGradient();D.strokeStyle=Ct||Se,D.stroke(),D.restore()}if(ce!==M&&(Re!==0||xe===h)){mt=De.split(" ").length-1;const qt=o(De);for(let Ct=0;Ct<qt.length;Ct++){const or=qt[Ct];or===" "&&!vt&&xe===h&&(he+=(Oe-Z*2-tt)/mt),this._partialTextX=he,this._partialTextY=Ee+Le,this._partialText=or,D.fillStrokeShape(this),he+=this.measureSize(or).width+Re}}else Re!==0&&D.setAttr("letterSpacing",`${Re}px`),this._partialTextX=he,this._partialTextY=Ee+Le,this._partialText=De,D.fillStrokeShape(this);D.restore(),ne>1&&(Ee+=ae)}}_hitFunc(D){const K=this.getWidth(),ne=this.getHeight();D.beginPath(),D.rect(0,0,K,ne),D.closePath(),D.fillStrokeShape(this)}setText(D){const K=e.Util._isString(D)?D:D==null?"":D+"";return this._setAttr(E,K),this}getWidth(){return this.attrs.width===l||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===l||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 K,ne,Z,ee,ae,se,ce,me,xe,Oe,Re;let Se=G(),ve=this.fontSize(),He;Se.save(),Se.font=this._getContextFont(),He=Se.measureText(D),Se.restore();const we=ve/100;return{actualBoundingBoxAscent:(K=He.actualBoundingBoxAscent)!==null&&K!==void 0?K:71.58203125*we,actualBoundingBoxDescent:(ne=He.actualBoundingBoxDescent)!==null&&ne!==void 0?ne:0,actualBoundingBoxLeft:(Z=He.actualBoundingBoxLeft)!==null&&Z!==void 0?Z:-7.421875*we,actualBoundingBoxRight:(ee=He.actualBoundingBoxRight)!==null&&ee!==void 0?ee:75.732421875*we,alphabeticBaseline:(ae=He.alphabeticBaseline)!==null&&ae!==void 0?ae:0,emHeightAscent:(se=He.emHeightAscent)!==null&&se!==void 0?se:100*we,emHeightDescent:(ce=He.emHeightDescent)!==null&&ce!==void 0?ce:-20*we,fontBoundingBoxAscent:(me=He.fontBoundingBoxAscent)!==null&&me!==void 0?me:91*we,fontBoundingBoxDescent:(xe=He.fontBoundingBoxDescent)!==null&&xe!==void 0?xe:21*we,hangingBaseline:(Oe=He.hangingBaseline)!==null&&Oe!==void 0?Oe:72.80000305175781*we,ideographicBaseline:(Re=He.ideographicBaseline)!==null&&Re!==void 0?Re:-21*we,width:He.width,height:ve}}_getContextFont(){return this.fontStyle()+j+this.fontVariant()+j+(this.fontSize()+O)+I(this.fontFamily())}_addTextLine(D){this.align()===h&&(D=D.trim());const ne=this._getTextWidth(D);return this.textArr.push({text:D,width:ne,lastInParagraph:!1})}_getTextWidth(D){const K=this.letterSpacing(),ne=D.length;return G().measureText(D).width+K*ne}_setTextData(){let D=this.text().split(`
|
|
43
|
-
`),K=+this.fontSize(),ne=0,Z=this.lineHeight()*K,ee=this.attrs.width,ae=this.attrs.height,se=ee!==l&&ee!==void 0,ce=ae!==l&&ae!==void 0,me=this.padding(),xe=ee-me*2,Oe=ae-me*2,Re=0,Se=this.wrap(),ve=Se!==x,He=Se!==C&&ve,we=this.ellipsis();this.textArr=[],G().font=this._getContextFont();const Ae=we?this._getTextWidth(L):0;for(let Ee=0,Ne=D.length;Ee<Ne;++Ee){let he=D[Ee],Le=this._getTextWidth(he);if(se&&Le>xe)for(;he.length>0;){let Ce=0,De=o(he).length,tt="",vt=0;for(;Ce<De;){const mt=Ce+De>>>1,Et=o(he),nt=Et.slice(0,mt+1).join(""),at=this._getTextWidth(nt);(we&&ce&&Re+Z>Oe?at+Ae:at)<=xe?(Ce=mt+1,tt=nt,vt=at):De=mt}if(tt){if(He){const nt=o(he),at=o(tt),qt=nt[at.length],Ct=qt===j||qt===d;let or;if(Ct&&vt<=xe)or=at.length;else{const Xt=at.lastIndexOf(j),qe=at.lastIndexOf(d);or=Math.max(Xt,qe)+1}or>0&&(Ce=or,tt=nt.slice(0,Ce).join(""),vt=this._getTextWidth(tt))}if(tt=tt.trimRight(),this._addTextLine(tt),ne=Math.max(ne,vt),Re+=Z,this._shouldHandleEllipsis(Re)){this._tryToAddEllipsisToLastLine();break}if(he=o(he).slice(Ce).join("").trimLeft(),he.length>0&&(Le=this._getTextWidth(he),Le<=xe)){this._addTextLine(he),Re+=Z,ne=Math.max(ne,Le);break}}else break}else this._addTextLine(he),Re+=Z,ne=Math.max(ne,Le),this._shouldHandleEllipsis(Re)&&Ee<Ne-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),ce&&Re+Z>Oe)break}this.textHeight=K,this.textWidth=ne}_shouldHandleEllipsis(D){const K=+this.fontSize(),ne=this.lineHeight()*K,Z=this.attrs.height,ee=Z!==l&&Z!==void 0,ae=this.padding(),se=Z-ae*2;return!(this.wrap()!==x)||ee&&D+ne>se}_tryToAddEllipsisToLastLine(){const D=this.attrs.width,K=D!==l&&D!==void 0,ne=this.padding(),Z=D-ne*2,ee=this.ellipsis(),ae=this.textArr[this.textArr.length-1];!ae||!ee||(K&&(this._getTextWidth(ae.text+L)<Z||(ae.text=ae.text.slice(0,ae.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(ae.text+L))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const D=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,K=this.hasShadow();return D&&K?!0:super._useBufferCanvas()}}return nh.Text=H,H.prototype._fillFunc=$,H.prototype._strokeFunc=J,H.prototype.className=S,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",b),r.Factory.addGetterSetter(H,"fontVariant",b),r.Factory.addGetterSetter(H,"padding",0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(H,"align",_),r.Factory.addGetterSetter(H,"verticalAlign",y),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",""),nh}var gd={},y5;function $S(){if(y5)return gd;y5=1,Object.defineProperty(gd,"__esModule",{value:!0}),gd.TextPath=void 0;const e=Li(),r=Hr(),t=Ma(),n=um(),a=E6(),i=Wr(),o=Mr(),l="",u="normal";function c(w){w.fillText(this.partialText,0,0)}function h(w){w.strokeText(this.partialText,0,0)}class p extends t.Shape{constructor(d){super(d),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(d){if(!this.attrs.data)return null;const _=this.pathLength;return d-1>_?null:n.Path.getPointAtLengthOfDataArray(d,this.dataArray)}_readDataAttribute(){this.dataArray=n.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(d){d.setAttr("font",this._getContextFont()),d.setAttr("textBaseline",this.textBaseline()),d.setAttr("textAlign","left"),d.save();const _=this.textDecoration(),E=this.fill(),S=this.fontSize(),y=this.glyphInfo;_==="underline"&&d.beginPath();for(let g=0;g<y.length;g++){d.save();const v=y[g].p0;d.translate(v.x,v.y),d.rotate(y[g].rotation),this.partialText=y[g].text,d.fillStrokeShape(this),_==="underline"&&(g===0&&d.moveTo(0,S/2+1),d.lineTo(S,S/2+1)),d.restore()}_==="underline"&&(d.strokeStyle=E,d.lineWidth=S/20,d.stroke()),d.restore()}_hitFunc(d){d.beginPath();const _=this.glyphInfo;if(_.length>=1){const E=_[0].p0;d.moveTo(E.x,E.y)}for(let E=0;E<_.length;E++){const S=_[E].p1;d.lineTo(S.x,S.y)}d.setAttr("lineWidth",this.fontSize()),d.setAttr("strokeStyle",this.colorKey),d.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(d){return a.Text.prototype.setText.call(this,d)}_getContextFont(){return a.Text.prototype._getContextFont.call(this)}_getTextSize(d){const E=this.dummyCanvas.getContext("2d");E.save(),E.font=this._getContextFont();const S=E.measureText(d);return E.restore(),{width:S.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:d,height:_}=this._getTextSize(this.attrs.text);if(this.textWidth=d,this.textHeight=_,this.glyphInfo=[],!this.attrs.data)return null;const E=this.letterSpacing(),S=this.align(),y=this.kerningFunc(),g=Math.max(this.textWidth+((this.attrs.text||"").length-1)*E,0);let v=0;S==="center"&&(v=Math.max(0,this.pathLength/2-g/2)),S==="right"&&(v=Math.max(0,this.pathLength-g));const b=(0,a.stringToArray)(this.text());let O=v;for(let j=0;j<b.length;j++){const T=this._getPointAtLength(O);if(!T)return;let M=this._getTextSize(b[j]).width+E;if(b[j]===" "&&S==="justify"){const N=this.text().split(" ").length-1;M+=(this.pathLength-g)/N}const F=this._getPointAtLength(O+M);if(!F)return;const C=n.Path.getLineLength(T.x,T.y,F.x,F.y);let x=0;if(y)try{x=y(b[j-1],b[j])*this.fontSize()}catch{x=0}T.x+=x,F.x+=x,this.textWidth+=x;const L=n.Path.getPointOnLine(x+C/2,T.x,T.y,F.x,F.y),A=Math.atan2(F.y-T.y,F.x-T.x);this.glyphInfo.push({transposeX:L.x,transposeY:L.y,text:b[j],rotation:A,p0:T,p1:F}),O+=M}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const d=[];this.glyphInfo.forEach(function(O){d.push(O.p0.x),d.push(O.p0.y),d.push(O.p1.x),d.push(O.p1.y)});let _=d[0]||0,E=d[0]||0,S=d[1]||0,y=d[1]||0,g,v;for(let O=0;O<d.length/2;O++)g=d[O*2],v=d[O*2+1],_=Math.min(_,g),E=Math.max(E,g),S=Math.min(S,v),y=Math.max(y,v);const b=this.fontSize();return{x:_-b/2,y:S-b/2,width:E-_+b,height:y-S+b}}destroy(){return e.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}return gd.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",l),r.Factory.addGetterSetter(p,"textDecoration",""),r.Factory.addGetterSetter(p,"kerningFunc",void 0),gd}var vd={},b5;function YS(){if(b5)return vd;b5=1,Object.defineProperty(vd,"__esModule",{value:!0}),vd.Transformer=void 0;const e=Li(),r=Hr(),t=Ji(),n=Ma(),a=x6(),i=sm(),o=Mr(),l=Wr(),u=Mr(),c="tr-konva",h=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(M=>M+`.${c}`).join(" "),p="nodesRect",w=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],d={"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(M,F,C){if(M==="rotater")return C;F+=e.Util.degToRad(d[M]||0);const x=(e.Util.radToDeg(F)%360+360)%360;return e.Util._inRange(x,315+22.5,360)||e.Util._inRange(x,0,22.5)?"ns-resize":e.Util._inRange(x,45-22.5,45+22.5)?"nesw-resize":e.Util._inRange(x,90-22.5,90+22.5)?"ew-resize":e.Util._inRange(x,135-22.5,135+22.5)?"nwse-resize":e.Util._inRange(x,180-22.5,180+22.5)?"ns-resize":e.Util._inRange(x,225-22.5,225+22.5)?"nesw-resize":e.Util._inRange(x,270-22.5,270+22.5)?"ew-resize":e.Util._inRange(x,315-22.5,315+22.5)?"nwse-resize":(e.Util.error("Transformer has unknown angle for cursor detection: "+x),"pointer")}const S=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function y(M){return{x:M.x+M.width/2*Math.cos(M.rotation)+M.height/2*Math.sin(-M.rotation),y:M.y+M.height/2*Math.cos(M.rotation)+M.width/2*Math.sin(M.rotation)}}function g(M,F,C){const x=C.x+(M.x-C.x)*Math.cos(F)-(M.y-C.y)*Math.sin(F),L=C.y+(M.x-C.x)*Math.sin(F)+(M.y-C.y)*Math.cos(F);return{...M,rotation:M.rotation+F,x,y:L}}function v(M,F){const C=y(M);return g(M,F,C)}function b(M,F,C){let x=F;for(let L=0;L<M.length;L++){const A=o.Konva.getAngle(M[L]),N=Math.abs(A-F)%(Math.PI*2);Math.min(N,Math.PI*2-N)<C&&(x=A)}return x}let O=0;class j 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 C=F.filter(L=>L.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=C,F.length===1&&this.useSingleNodeRotation()?this.rotation(F[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(L=>{const A=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(L._attrsAffectingSize.length){const N=L._attrsAffectingSize.map(I=>I+"Change."+this._getEventNamespace()).join(" ");L.on(N,A)}L.on(w.map(N=>N+`.${this._getEventNamespace()}`).join(" "),A),L.on(`absoluteTransformChange.${this._getEventNamespace()}`,A),this._proxyDrag(L)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(F){let C;F.on(`dragstart.${this._getEventNamespace()}`,x=>{C=F.getAbsolutePosition(),!this.isDragging()&&F!==this.findOne(".back")&&this.startDrag(x,!1)}),F.on(`dragmove.${this._getEventNamespace()}`,x=>{if(!C)return;const L=F.getAbsolutePosition(),A=L.x-C.x,N=L.y-C.y;this.nodes().forEach(I=>{if(I===F||I.isDragging())return;const W=I.getAbsolutePosition();I.setAbsolutePosition({x:W.x+A,y:W.y+N}),I.startDrag(x)}),C=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,C=this.rotation(),x){const L=F.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),A=F.getAbsoluteScale(x),N=F.getAbsolutePosition(x),I=L.x*A.x-F.offsetX()*A.x,W=L.y*A.y-F.offsetY()*A.y,G=(o.Konva.getAngle(F.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),$={x:N.x+I*Math.cos(G)+W*Math.sin(-G),y:N.y+W*Math.cos(G)+I*Math.sin(G),width:L.width*A.x,height:L.height*A.y,rotation:G};return g($,-o.Konva.getAngle(C),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const C=[];this.nodes().map(G=>{const $=G.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),J=[{x:$.x,y:$.y},{x:$.x+$.width,y:$.y},{x:$.x+$.width,y:$.y+$.height},{x:$.x,y:$.y+$.height}],V=G.getAbsoluteTransform();J.forEach(function(H){const z=V.point(H);C.push(z)})});const x=new e.Transform;x.rotate(-o.Konva.getAngle(this.rotation()));let L=1/0,A=1/0,N=-1/0,I=-1/0;C.forEach(function(G){const $=x.point(G);L===void 0&&(L=N=$.x,A=I=$.y),L=Math.min(L,$.x),A=Math.min(A,$.y),N=Math.max(N,$.x),I=Math.max(I,$.y)}),x.invert();const W=x.point({x:L,y:A});return{x:W.x,y:W.y,width:N-L,height:I-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(),S.forEach(F=>{this._createAnchor(F)}),this._createAnchor("rotater")}_createAnchor(F){const C=new a.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:F+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:_?10:"auto"}),x=this;C.on("mousedown touchstart",function(L){x._handleMouseDown(L)}),C.on("dragstart",L=>{C.stopDrag(),L.cancelBubble=!0}),C.on("dragend",L=>{L.cancelBubble=!0}),C.on("mouseenter",()=>{const L=o.Konva.getAngle(this.rotation()),A=this.rotateAnchorCursor(),N=E(F,L,A);C.getStage().content&&(C.getStage().content.style.cursor=N),this._cursorChange=!0}),C.on("mouseout",()=>{C.getStage().content&&(C.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(C)}_createBack(){const F=new n.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(C,x){const L=x.getParent(),A=L.padding();C.beginPath(),C.rect(-A,-A,x.width()+A*2,x.height()+A*2),C.moveTo(x.width()/2,-A),L.rotateEnabled()&&L.rotateLineVisible()&&C.lineTo(x.width()/2,-L.rotateAnchorOffset()*e.Util._sign(x.height())-A),C.fillStrokeShape(x)},hitFunc:(C,x)=>{if(!this.shouldOverdrawWholeArea())return;const L=this.padding();C.beginPath(),C.rect(-L,-L,x.width()+L*2,x.height()+L*2),C.fillStrokeShape(x)}});this.add(F),this._proxyDrag(F),F.on("dragstart",C=>{C.cancelBubble=!0}),F.on("dragmove",C=>{C.cancelBubble=!0}),F.on("dragend",C=>{C.cancelBubble=!0}),this.on("dragmove",C=>{this.update()})}_handleMouseDown(F){if(this._transforming)return;this._movingAnchorName=F.target.name().split(" ")[0];const C=this._getNodeRect(),x=C.width,L=C.height,A=Math.sqrt(Math.pow(x,2)+Math.pow(L,2));this.sin=Math.abs(L/A),this.cos=Math.abs(x/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 N=F.target.getAbsolutePosition(),I=F.target.getStage().getPointerPosition();this._anchorDragOffset={x:I.x-N.x,y:I.y-N.y},O++,this._fire("transformstart",{evt:F.evt,target:this.getNode()}),this._nodes.forEach(W=>{W._fire("transformstart",{evt:F.evt,target:W})})}_handleMouseMove(F){let C,x,L;const A=this.findOne("."+this._movingAnchorName),N=A.getStage();N.setPointersPositions(F);const I=N.getPointerPosition();let W={x:I.x-this._anchorDragOffset.x,y:I.y-this._anchorDragOffset.y};const G=A.getAbsolutePosition();this.anchorDragBoundFunc()&&(W=this.anchorDragBoundFunc()(G,W,F)),A.setAbsolutePosition(W);const $=A.getAbsolutePosition();if(G.x===$.x&&G.y===$.y)return;if(this._movingAnchorName==="rotater"){const se=this._getNodeRect();C=A.x()-se.width/2,x=-A.y()+se.height/2;let ce=Math.atan2(-x,C)+Math.PI/2;se.height<0&&(ce-=Math.PI);const xe=o.Konva.getAngle(this.rotation())+ce,Oe=o.Konva.getAngle(this.rotationSnapTolerance()),Se=b(this.rotationSnaps(),xe,Oe)-se.rotation,ve=v(se,Se);this._fitNodesInto(ve,F);return}const J=this.shiftBehavior();let V;J==="inverted"?V=this.keepRatio()&&!F.shiftKey:J==="none"?V=this.keepRatio():V=this.keepRatio()||F.shiftKey;var ne=this.centeredScaling()||F.altKey;if(this._movingAnchorName==="top-left"){if(V){var H=ne?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};L=Math.sqrt(Math.pow(H.x-A.x(),2)+Math.pow(H.y-A.y(),2));var z=this.findOne(".top-left").x()>H.x?-1:1,D=this.findOne(".top-left").y()>H.y?-1:1;C=L*this.cos*z,x=L*this.sin*D,this.findOne(".top-left").x(H.x-C),this.findOne(".top-left").y(H.y-x)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(A.y());else if(this._movingAnchorName==="top-right"){if(V){var H=ne?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};L=Math.sqrt(Math.pow(A.x()-H.x,2)+Math.pow(H.y-A.y(),2));var z=this.findOne(".top-right").x()<H.x?-1:1,D=this.findOne(".top-right").y()>H.y?-1:1;C=L*this.cos*z,x=L*this.sin*D,this.findOne(".top-right").x(H.x+C),this.findOne(".top-right").y(H.y-x)}var K=A.position();this.findOne(".top-left").y(K.y),this.findOne(".bottom-right").x(K.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=ne?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};L=Math.sqrt(Math.pow(H.x-A.x(),2)+Math.pow(A.y()-H.y,2));var z=H.x<A.x()?-1:1,D=A.y()<H.y?-1:1;C=L*this.cos*z,x=L*this.sin*D,A.x(H.x-C),A.y(H.y+x)}K=A.position(),this.findOne(".top-left").x(K.x),this.findOne(".bottom-right").y(K.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(A.y());else if(this._movingAnchorName==="bottom-right"){if(V){var H=ne?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};L=Math.sqrt(Math.pow(A.x()-H.x,2)+Math.pow(A.y()-H.y,2));var z=this.findOne(".bottom-right").x()<H.x?-1:1,D=this.findOne(".bottom-right").y()<H.y?-1:1;C=L*this.cos*z,x=L*this.sin*D,this.findOne(".bottom-right").x(H.x+C),this.findOne(".bottom-right").y(H.y+x)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var ne=this.centeredScaling()||F.altKey;if(ne){const se=this.findOne(".top-left"),ce=this.findOne(".bottom-right"),me=se.x(),xe=se.y(),Oe=this.getWidth()-ce.x(),Re=this.getHeight()-ce.y();ce.move({x:-me,y:-xe}),se.move({x:Oe,y:Re})}const Z=this.findOne(".top-left").getAbsolutePosition();C=Z.x,x=Z.y;const ee=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),ae=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:C,y:x,width:ee,height:ae,rotation:o.Konva.getAngle(this.rotation())},F)}_handleMouseUp(F){this._removeEvents(F)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(F){var C;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 x=this.getNode();O--,this._fire("transformend",{evt:F,target:x}),(C=this.getLayer())===null||C===void 0||C.batchDraw(),x&&this._nodes.forEach(L=>{var A;L._fire("transformend",{evt:F,target:L}),(A=L.getLayer())===null||A===void 0||A.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(F,C){const x=this._getNodeRect(),L=1;if(e.Util._inRange(F.width,-this.padding()*2-L,L)){this.update();return}if(e.Util._inRange(F.height,-this.padding()*2-L,L)){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()(x,F);V?F=V:e.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const N=1e7,I=new e.Transform;I.translate(x.x,x.y),I.rotate(x.rotation),I.scale(x.width/N,x.height/N);const W=new e.Transform,G=F.width/N,$=F.height/N;this.flipEnabled()===!1?(W.translate(F.x,F.y),W.rotate(F.rotation),W.translate(F.width<0?F.width:0,F.height<0?F.height:0),W.scale(Math.abs(G),Math.abs($))):(W.translate(F.x,F.y),W.rotate(F.rotation),W.scale(G,$));const J=W.multiply(I.invert());this._nodes.forEach(V=>{var H;const z=V.getParent().getAbsoluteTransform(),D=V.getTransform().copy();D.translate(V.offsetX(),V.offsetY());const K=new e.Transform;K.multiply(z.copy().invert()).multiply(J).multiply(z).multiply(D);const ne=K.decompose();V.setAttrs(ne),(H=V.getLayer())===null||H===void 0||H.batchDraw()}),this.rotation(e.Util._getRotation(F.rotation)),this._nodes.forEach(V=>{this._fire("transform",{evt:C,target:V}),V._fire("transform",{evt:C,target:V})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(F,C){this.findOne(F).setAttrs(C)}update(){var F;const C=this._getNodeRect();this.rotation(e.Util._getRotation(C.rotation));const x=C.width,L=C.height,A=this.enabledAnchors(),N=this.resizeEnabled(),I=this.padding(),W=this.anchorSize(),G=this.find("._anchor");G.forEach(J=>{J.setAttrs({width:W,height:W,offsetX:W/2,offsetY:W/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:W/2+I,offsetY:W/2+I,visible:N&&A.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:x/2,y:0,offsetY:W/2+I,visible:N&&A.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x,y:0,offsetX:W/2-I,offsetY:W/2+I,visible:N&&A.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:L/2,offsetX:W/2+I,visible:N&&A.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x,y:L/2,offsetX:W/2-I,visible:N&&A.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:L,offsetX:W/2+I,offsetY:W/2-I,visible:N&&A.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:x/2,y:L,offsetY:W/2-I,visible:N&&A.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x,y:L,offsetX:W/2-I,offsetY:W/2-I,visible:N&&A.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:x/2,y:-this.rotateAnchorOffset()*e.Util._sign(L)-I,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:x,height:L,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const $=this.anchorStyleFunc();$&&G.forEach(J=>{$(J)}),(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}}}vd.Transformer=j,j.isTransforming=()=>O>0;function T(M){return M instanceof Array||e.Util.warn("enabledAnchors value should be an array"),M instanceof Array&&M.forEach(function(F){S.indexOf(F)===-1&&e.Util.warn("Unknown anchor name: "+F+". Available names are: "+S.join(", "))}),M||[]}return j.prototype.className="Transformer",(0,u._registerNode)(j),r.Factory.addGetterSetter(j,"enabledAnchors",S,T),r.Factory.addGetterSetter(j,"flipEnabled",!0,(0,l.getBooleanValidator)()),r.Factory.addGetterSetter(j,"resizeEnabled",!0),r.Factory.addGetterSetter(j,"anchorSize",10,(0,l.getNumberValidator)()),r.Factory.addGetterSetter(j,"rotateEnabled",!0),r.Factory.addGetterSetter(j,"rotateLineVisible",!0),r.Factory.addGetterSetter(j,"rotationSnaps",[]),r.Factory.addGetterSetter(j,"rotateAnchorOffset",50,(0,l.getNumberValidator)()),r.Factory.addGetterSetter(j,"rotateAnchorCursor","crosshair"),r.Factory.addGetterSetter(j,"rotationSnapTolerance",5,(0,l.getNumberValidator)()),r.Factory.addGetterSetter(j,"borderEnabled",!0),r.Factory.addGetterSetter(j,"anchorStroke","rgb(0, 161, 255)"),r.Factory.addGetterSetter(j,"anchorStrokeWidth",1,(0,l.getNumberValidator)()),r.Factory.addGetterSetter(j,"anchorFill","white"),r.Factory.addGetterSetter(j,"anchorCornerRadius",0,(0,l.getNumberValidator)()),r.Factory.addGetterSetter(j,"borderStroke","rgb(0, 161, 255)"),r.Factory.addGetterSetter(j,"borderStrokeWidth",1,(0,l.getNumberValidator)()),r.Factory.addGetterSetter(j,"borderDash"),r.Factory.addGetterSetter(j,"keepRatio",!0),r.Factory.addGetterSetter(j,"shiftBehavior","default"),r.Factory.addGetterSetter(j,"centeredScaling",!1),r.Factory.addGetterSetter(j,"ignoreStroke",!1),r.Factory.addGetterSetter(j,"padding",0,(0,l.getNumberValidator)()),r.Factory.addGetterSetter(j,"nodes"),r.Factory.addGetterSetter(j,"node"),r.Factory.addGetterSetter(j,"boundBoxFunc"),r.Factory.addGetterSetter(j,"anchorDragBoundFunc"),r.Factory.addGetterSetter(j,"anchorStyleFunc"),r.Factory.addGetterSetter(j,"shouldOverdrawWholeArea",!1),r.Factory.addGetterSetter(j,"useSingleNodeRotation",!0),r.Factory.backCompat(j,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"}),vd}var md={},w5;function XS(){if(w5)return md;w5=1,Object.defineProperty(md,"__esModule",{value:!0}),md.Wedge=void 0;const e=Hr(),r=Ma(),t=Mr(),n=Wr(),a=Mr();class i extends r.Shape{_sceneFunc(l){l.beginPath(),l.arc(0,0,this.radius(),0,t.Konva.getAngle(this.angle()),this.clockwise()),l.lineTo(0,0),l.closePath(),l.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(l){this.radius(l/2)}setHeight(l){this.radius(l/2)}}return md.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"}),md}var yd={},_5;function KS(){if(_5)return yd;_5=1,Object.defineProperty(yd,"__esModule",{value:!0}),yd.Blur=void 0;const e=Hr(),r=Ji(),t=Wr();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,w=u.height;let d,_,E,S,y,g,v,b,O,j,T,M,F,C,x,L,A,N,I,W,G,$,J,V;const H=c+c+1,z=p-1,D=w-1,K=c+1,ne=K*(K+1)/2,Z=new n,ee=a[c],ae=i[c];let se=null,ce=Z,me=null,xe=null;for(E=1;E<H;E++)ce=ce.next=new n,E===K&&(se=ce);for(ce.next=Z,v=g=0,_=0;_<w;_++){for(L=A=N=I=b=O=j=T=0,M=K*(W=h[g]),F=K*(G=h[g+1]),C=K*($=h[g+2]),x=K*(J=h[g+3]),b+=ne*W,O+=ne*G,j+=ne*$,T+=ne*J,ce=Z,E=0;E<K;E++)ce.r=W,ce.g=G,ce.b=$,ce.a=J,ce=ce.next;for(E=1;E<K;E++)S=g+((z<E?z:E)<<2),b+=(ce.r=W=h[S])*(V=K-E),O+=(ce.g=G=h[S+1])*V,j+=(ce.b=$=h[S+2])*V,T+=(ce.a=J=h[S+3])*V,L+=W,A+=G,N+=$,I+=J,ce=ce.next;for(me=Z,xe=se,d=0;d<p;d++)h[g+3]=J=T*ee>>ae,J!==0?(J=255/J,h[g]=(b*ee>>ae)*J,h[g+1]=(O*ee>>ae)*J,h[g+2]=(j*ee>>ae)*J):h[g]=h[g+1]=h[g+2]=0,b-=M,O-=F,j-=C,T-=x,M-=me.r,F-=me.g,C-=me.b,x-=me.a,S=v+((S=d+c+1)<z?S:z)<<2,L+=me.r=h[S],A+=me.g=h[S+1],N+=me.b=h[S+2],I+=me.a=h[S+3],b+=L,O+=A,j+=N,T+=I,me=me.next,M+=W=xe.r,F+=G=xe.g,C+=$=xe.b,x+=J=xe.a,L-=W,A-=G,N-=$,I-=J,xe=xe.next,g+=4;v+=p}for(d=0;d<p;d++){for(A=N=I=L=O=j=T=b=0,g=d<<2,M=K*(W=h[g]),F=K*(G=h[g+1]),C=K*($=h[g+2]),x=K*(J=h[g+3]),b+=ne*W,O+=ne*G,j+=ne*$,T+=ne*J,ce=Z,E=0;E<K;E++)ce.r=W,ce.g=G,ce.b=$,ce.a=J,ce=ce.next;for(y=p,E=1;E<=c;E++)g=y+d<<2,b+=(ce.r=W=h[g])*(V=K-E),O+=(ce.g=G=h[g+1])*V,j+=(ce.b=$=h[g+2])*V,T+=(ce.a=J=h[g+3])*V,L+=W,A+=G,N+=$,I+=J,ce=ce.next,E<D&&(y+=p);for(g=d,me=Z,xe=se,_=0;_<w;_++)S=g<<2,h[S+3]=J=T*ee>>ae,J>0?(J=255/J,h[S]=(b*ee>>ae)*J,h[S+1]=(O*ee>>ae)*J,h[S+2]=(j*ee>>ae)*J):h[S]=h[S+1]=h[S+2]=0,b-=M,O-=F,j-=C,T-=x,M-=me.r,F-=me.g,C-=me.b,x-=me.a,S=d+((S=_+K)<D?S:D)*p<<2,b+=L+=me.r=h[S],O+=A+=me.g=h[S+1],j+=N+=me.b=h[S+2],T+=I+=me.a=h[S+3],me=me.next,M+=W=xe.r,F+=G=xe.g,C+=$=xe.b,x+=J=xe.a,L-=W,A-=G,N-=$,I-=J,xe=xe.next,g+=p}}const l=function(c){const h=Math.round(this.blurRadius());h>0&&o(c,h)};return yd.Blur=l,e.Factory.addGetterSetter(r.Node,"blurRadius",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),yd}var bd={},S5;function ZS(){if(S5)return bd;S5=1,Object.defineProperty(bd,"__esModule",{value:!0}),bd.Brighten=void 0;const e=Hr(),r=Ji(),t=Wr(),n=function(a){const i=this.brightness()*255,o=a.data,l=o.length;for(let u=0;u<l;u+=4)o[u]+=i,o[u+1]+=i,o[u+2]+=i};return bd.Brighten=n,e.Factory.addGetterSetter(r.Node,"brightness",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),bd}var wd={},x5;function QS(){if(x5)return wd;x5=1,Object.defineProperty(wd,"__esModule",{value:!0}),wd.Contrast=void 0;const e=Hr(),r=Ji(),t=Wr(),n=function(a){const i=Math.pow((this.contrast()+100)/100,2),o=a.data,l=o.length;let u=150,c=150,h=150;for(let p=0;p<l;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 wd.Contrast=n,e.Factory.addGetterSetter(r.Node,"contrast",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),wd}var _d={},E5;function JS(){if(E5)return _d;E5=1,Object.defineProperty(_d,"__esModule",{value:!0}),_d.Emboss=void 0;const e=Hr(),r=Ji(),t=Li(),n=Wr(),a=function(i){const o=this.embossStrength()*10,l=this.embossWhiteLevel()*255,u=this.embossDirection(),c=this.embossBlend(),h=i.data,p=i.width,w=i.height,d=p*4;let _=0,E=0,S=w;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 y=(S-1)*d;let g=_;S+g<1&&(g=0),S+g>w&&(g=0);const v=(S-1+g)*p*4;let b=p;do{const O=y+(b-1)*4;let j=E;b+j<1&&(j=0),b+j>p&&(j=0);const T=v+(b-1+j)*4,M=h[O]-h[T],F=h[O+1]-h[T+1],C=h[O+2]-h[T+2];let x=M;const L=x>0?x:-x,A=F>0?F:-F,N=C>0?C:-C;if(A>L&&(x=F),N>L&&(x=C),x*=o,c){const I=h[O]+x,W=h[O+1]+x,G=h[O+2]+x;h[O]=I>255?255:I<0?0:I,h[O+1]=W>255?255:W<0?0:W,h[O+2]=G>255?255:G<0?0:G}else{let I=l-x;I<0?I=0:I>255&&(I=255),h[O]=h[O+1]=h[O+2]=I}}while(--b)}while(--S)};return _d.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),_d}var Sd={},P5;function ex(){if(P5)return Sd;P5=1,Object.defineProperty(Sd,"__esModule",{value:!0}),Sd.Enhance=void 0;const e=Hr(),r=Ji(),t=Wr();function n(i,o,l,u,c){const h=l-o,p=c-u;if(h===0)return u+p/2;if(p===0)return u;let w=(i-o)/h;return w=p*w+u,w}const a=function(i){const o=i.data,l=o.length;let u=o[0],c=u,h,p=o[1],w=p,d,_=o[2],E=_,S;const y=this.enhance();if(y===0)return;for(let x=0;x<l;x+=4)h=o[x+0],h<u?u=h:h>c&&(c=h),d=o[x+1],d<p?p=d:d>w&&(w=d),S=o[x+2],S<_?_=S:S>E&&(E=S);c===u&&(c=255,u=0),w===p&&(w=255,p=0),E===_&&(E=255,_=0);let g,v,b,O,j,T,M,F,C;y>0?(v=c+y*(255-c),b=u-y*(u-0),j=w+y*(255-w),T=p-y*(p-0),F=E+y*(255-E),C=_-y*(_-0)):(g=(c+u)*.5,v=c+y*(c-g),b=u+y*(u-g),O=(w+p)*.5,j=w+y*(w-O),T=p+y*(p-O),M=(E+_)*.5,F=E+y*(E-M),C=_+y*(_-M));for(let x=0;x<l;x+=4)o[x+0]=n(o[x+0],u,c,b,v),o[x+1]=n(o[x+1],p,w,T,j),o[x+2]=n(o[x+2],_,E,C,F)};return Sd.Enhance=a,e.Factory.addGetterSetter(r.Node,"enhance",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Sd}var xd={},O5;function tx(){if(O5)return xd;O5=1,Object.defineProperty(xd,"__esModule",{value:!0}),xd.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 xd.Grayscale=e,xd}var Ed={},A5;function rx(){if(A5)return Ed;A5=1,Object.defineProperty(Ed,"__esModule",{value:!0}),Ed.HSL=void 0;const e=Hr(),r=Ji(),t=Wr();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,l=1,u=Math.pow(2,this.saturation()),c=Math.abs(this.hue()+360)%360,h=this.luminance()*127,p=l*u*Math.cos(c*Math.PI/180),w=l*u*Math.sin(c*Math.PI/180),d=.299*l+.701*p+.167*w,_=.587*l-.587*p+.33*w,E=.114*l-.114*p-.497*w,S=.299*l-.299*p-.328*w,y=.587*l+.413*p+.035*w,g=.114*l-.114*p+.293*w,v=.299*l-.3*p+1.25*w,b=.587*l-.586*p-1.05*w,O=.114*l+.886*p-.2*w;let j,T,M,F;for(let C=0;C<o;C+=4)j=i[C+0],T=i[C+1],M=i[C+2],F=i[C+3],i[C+0]=d*j+_*T+E*M+h,i[C+1]=S*j+y*T+g*M+h,i[C+2]=v*j+b*T+O*M+h,i[C+3]=F};return Ed.HSL=n,Ed}var Pd={},C5;function nx(){if(C5)return Pd;C5=1,Object.defineProperty(Pd,"__esModule",{value:!0}),Pd.HSV=void 0;const e=Hr(),r=Ji(),t=Wr(),n=function(a){const i=a.data,o=i.length,l=Math.pow(2,this.value()),u=Math.pow(2,this.saturation()),c=Math.abs(this.hue()+360)%360,h=l*u*Math.cos(c*Math.PI/180),p=l*u*Math.sin(c*Math.PI/180),w=.299*l+.701*h+.167*p,d=.587*l-.587*h+.33*p,_=.114*l-.114*h-.497*p,E=.299*l-.299*h-.328*p,S=.587*l+.413*h+.035*p,y=.114*l-.114*h+.293*p,g=.299*l-.3*h+1.25*p,v=.587*l-.586*h-1.05*p,b=.114*l+.886*h-.2*p;let O,j,T,M;for(let F=0;F<o;F+=4)O=i[F+0],j=i[F+1],T=i[F+2],M=i[F+3],i[F+0]=w*O+d*j+_*T,i[F+1]=E*O+S*j+y*T,i[F+2]=g*O+v*j+b*T,i[F+3]=M};return Pd.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),Pd}var Od={},k5;function ix(){if(k5)return Od;k5=1,Object.defineProperty(Od,"__esModule",{value:!0}),Od.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 Od.Invert=e,Od}var Ad={},L5;function ax(){if(L5)return Ad;L5=1,Object.defineProperty(Ad,"__esModule",{value:!0}),Ad.Kaleidoscope=void 0;const e=Hr(),r=Ji(),t=Li(),n=Wr(),a=function(l,u,c){const h=l.data,p=u.data,w=l.width,d=l.height,_=c.polarCenterX||w/2,E=c.polarCenterY||d/2;let S=Math.sqrt(_*_+E*E),y=w-_,g=d-E;const v=Math.sqrt(y*y+g*g);S=v>S?v:S;const b=d,O=w,j=360/O*Math.PI/180;for(let T=0;T<O;T+=1){const M=Math.sin(T*j),F=Math.cos(T*j);for(let C=0;C<b;C+=1){y=Math.floor(_+S*C/b*F),g=Math.floor(E+S*C/b*M);let x=(g*w+y)*4;const L=h[x+0],A=h[x+1],N=h[x+2],I=h[x+3];x=(T+C*w)*4,p[x+0]=L,p[x+1]=A,p[x+2]=N,p[x+3]=I}}},i=function(l,u,c){const h=l.data,p=u.data,w=l.width,d=l.height,_=c.polarCenterX||w/2,E=c.polarCenterY||d/2;let S=Math.sqrt(_*_+E*E),y=w-_,g=d-E;const v=Math.sqrt(y*y+g*g);S=v>S?v:S;const b=d,O=w,j=0;let T,M;for(y=0;y<w;y+=1)for(g=0;g<d;g+=1){const F=y-_,C=g-E,x=Math.sqrt(F*F+C*C)*b/S;let L=(Math.atan2(C,F)*180/Math.PI+360+j)%360;L=L*O/360,T=Math.floor(L),M=Math.floor(x);let A=(M*w+T)*4;const N=h[A+0],I=h[A+1],W=h[A+2],G=h[A+3];A=(g*w+y)*4,p[A+0]=N,p[A+1]=I,p[A+2]=W,p[A+3]=G}},o=function(l){const u=l.width,c=l.height;let h,p,w,d,_,E,S,y,g,v,b=Math.round(this.kaleidoscopePower());const O=Math.round(this.kaleidoscopeAngle()),j=Math.floor(u*(O%360)/360);if(b<1)return;const T=t.Util.createCanvasElement();T.width=u,T.height=c;const M=T.getContext("2d").getImageData(0,0,u,c);t.Util.releaseCanvas(T),a(l,M,{polarCenterX:u/2,polarCenterY:c/2});let F=u/Math.pow(2,b);for(;F<=8;)F=F*2,b-=1;F=Math.ceil(F);let C=F,x=0,L=C,A=1;for(j+F>u&&(x=C,L=0,A=-1),p=0;p<c;p+=1)for(h=x;h!==L;h+=A)w=Math.round(h+j)%u,g=(u*p+w)*4,_=M.data[g+0],E=M.data[g+1],S=M.data[g+2],y=M.data[g+3],v=(u*p+h)*4,M.data[v+0]=_,M.data[v+1]=E,M.data[v+2]=S,M.data[v+3]=y;for(p=0;p<c;p+=1)for(C=Math.floor(F),d=0;d<b;d+=1){for(h=0;h<C+1;h+=1)g=(u*p+h)*4,_=M.data[g+0],E=M.data[g+1],S=M.data[g+2],y=M.data[g+3],v=(u*p+C*2-h-1)*4,M.data[v+0]=_,M.data[v+1]=E,M.data[v+2]=S,M.data[v+3]=y;C*=2}i(M,l,{})};return Ad.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),Ad}var Cd={},N5;function ox(){if(N5)return Cd;N5=1,Object.defineProperty(Cd,"__esModule",{value:!0}),Cd.Mask=void 0;const e=Hr(),r=Ji(),t=Wr();function n(w,d,_){let E=(_*w.width+d)*4;const S=[];return S.push(w.data[E++],w.data[E++],w.data[E++],w.data[E++]),S}function a(w,d){return Math.sqrt(Math.pow(w[0]-d[0],2)+Math.pow(w[1]-d[1],2)+Math.pow(w[2]-d[2],2))}function i(w){const d=[0,0,0];for(let _=0;_<w.length;_++)d[0]+=w[_][0],d[1]+=w[_][1],d[2]+=w[_][2];return d[0]/=w.length,d[1]/=w.length,d[2]/=w.length,d}function o(w,d){const _=n(w,0,0),E=n(w,w.width-1,0),S=n(w,0,w.height-1),y=n(w,w.width-1,w.height-1),g=d||10;if(a(_,E)<g&&a(E,y)<g&&a(y,S)<g&&a(S,_)<g){const v=i([E,_,y,S]),b=[];for(let O=0;O<w.width*w.height;O++){const j=a(v,[w.data[O*4],w.data[O*4+1],w.data[O*4+2]]);b[O]=j<g?0:255}return b}}function l(w,d){for(let _=0;_<w.width*w.height;_++)w.data[4*_+3]=d[_]}function u(w,d,_){const E=[1,1,1,1,0,1,1,1,1],S=Math.round(Math.sqrt(E.length)),y=Math.floor(S/2),g=[];for(let v=0;v<_;v++)for(let b=0;b<d;b++){const O=v*d+b;let j=0;for(let T=0;T<S;T++)for(let M=0;M<S;M++){const F=v+T-y,C=b+M-y;if(F>=0&&F<_&&C>=0&&C<d){const x=F*d+C,L=E[T*S+M];j+=w[x]*L}}g[O]=j===255*8?255:0}return g}function c(w,d,_){const E=[1,1,1,1,1,1,1,1,1],S=Math.round(Math.sqrt(E.length)),y=Math.floor(S/2),g=[];for(let v=0;v<_;v++)for(let b=0;b<d;b++){const O=v*d+b;let j=0;for(let T=0;T<S;T++)for(let M=0;M<S;M++){const F=v+T-y,C=b+M-y;if(F>=0&&F<_&&C>=0&&C<d){const x=F*d+C,L=E[T*S+M];j+=w[x]*L}}g[O]=j>=255*4?255:0}return g}function h(w,d,_){const E=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],S=Math.round(Math.sqrt(E.length)),y=Math.floor(S/2),g=[];for(let v=0;v<_;v++)for(let b=0;b<d;b++){const O=v*d+b;let j=0;for(let T=0;T<S;T++)for(let M=0;M<S;M++){const F=v+T-y,C=b+M-y;if(F>=0&&F<_&&C>=0&&C<d){const x=F*d+C,L=E[T*S+M];j+=w[x]*L}}g[O]=j}return g}const p=function(w){const d=this.threshold();let _=o(w,d);return _&&(_=u(_,w.width,w.height),_=c(_,w.width,w.height),_=h(_,w.width,w.height),l(w,_)),w};return Cd.Mask=p,e.Factory.addGetterSetter(r.Node,"threshold",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Cd}var kd={},T5;function sx(){if(T5)return kd;T5=1,Object.defineProperty(kd,"__esModule",{value:!0}),kd.Noise=void 0;const e=Hr(),r=Ji(),t=Wr(),n=function(a){const i=this.noise()*255,o=a.data,l=o.length,u=i/2;for(let c=0;c<l;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 kd.Noise=n,e.Factory.addGetterSetter(r.Node,"noise",.2,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),kd}var Ld={},R5;function lx(){if(R5)return Ld;R5=1,Object.defineProperty(Ld,"__esModule",{value:!0}),Ld.Pixelate=void 0;const e=Hr(),r=Li(),t=Ji(),n=Wr(),a=function(i){let o=Math.ceil(this.pixelSize()),l=i.width,u=i.height,c,h,p,w,d,_,E,S=Math.ceil(l/o),y=Math.ceil(u/o),g,v,b,O,j,T,M,F=i.data;if(o<=0){r.Util.error("pixelSize value can not be <= 0");return}for(j=0;j<S;j+=1)for(T=0;T<y;T+=1){for(w=0,d=0,_=0,E=0,g=j*o,v=g+o,b=T*o,O=b+o,M=0,c=g;c<v;c+=1)if(!(c>=l))for(h=b;h<O;h+=1)h>=u||(p=(l*h+c)*4,w+=F[p+0],d+=F[p+1],_+=F[p+2],E+=F[p+3],M+=1);for(w=w/M,d=d/M,_=_/M,E=E/M,c=g;c<v;c+=1)if(!(c>=l))for(h=b;h<O;h+=1)h>=u||(p=(l*h+c)*4,F[p+0]=w,F[p+1]=d,F[p+2]=_,F[p+3]=E)}};return Ld.Pixelate=a,e.Factory.addGetterSetter(t.Node,"pixelSize",8,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),Ld}var Nd={},M5;function ux(){if(M5)return Nd;M5=1,Object.defineProperty(Nd,"__esModule",{value:!0}),Nd.Posterize=void 0;const e=Hr(),r=Ji(),t=Wr(),n=function(a){const i=Math.round(this.levels()*254)+1,o=a.data,l=o.length,u=255/i;for(let c=0;c<l;c+=1)o[c]=Math.floor(o[c]/u)*u};return Nd.Posterize=n,e.Factory.addGetterSetter(r.Node,"levels",.5,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Nd}var Td={},I5;function cx(){if(I5)return Td;I5=1,Object.defineProperty(Td,"__esModule",{value:!0}),Td.RGB=void 0;const e=Hr(),r=Ji(),t=Wr(),n=function(a){const i=a.data,o=i.length,l=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*l,i[h+1]=p*u,i[h+2]=p*c,i[h+3]=i[h+3]}};return Td.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),Td}var Rd={},j5;function fx(){if(j5)return Rd;j5=1,Object.defineProperty(Rd,"__esModule",{value:!0}),Rd.RGBA=void 0;const e=Hr(),r=Ji(),t=Wr(),n=function(a){const i=a.data,o=i.length,l=this.red(),u=this.green(),c=this.blue(),h=this.alpha();for(let p=0;p<o;p+=4){const w=1-h;i[p]=l*h+i[p]*w,i[p+1]=u*h+i[p+1]*w,i[p+2]=c*h+i[p+2]*w}};return Rd.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}),Rd}var Md={},F5;function hx(){if(F5)return Md;F5=1,Object.defineProperty(Md,"__esModule",{value:!0}),Md.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],l=t[a+2];t[a+0]=Math.min(255,i*.393+o*.769+l*.189),t[a+1]=Math.min(255,i*.349+o*.686+l*.168),t[a+2]=Math.min(255,i*.272+o*.534+l*.131)}};return Md.Sepia=e,Md}var Id={},D5;function dx(){if(D5)return Id;D5=1,Object.defineProperty(Id,"__esModule",{value:!0}),Id.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 l=(o-1)*i;let u=n;do{const c=l+(u-1)*4;let h=t[c],p=t[c+1],w=t[c+2];h>127&&(h=255-h),p>127&&(p=255-p),w>127&&(w=255-w),t[c]=h,t[c+1]=p,t[c+2]=w}while(--u)}while(--o)};return Id.Solarize=e,Id}var jd={},B5;function px(){if(B5)return jd;B5=1,Object.defineProperty(jd,"__esModule",{value:!0}),jd.Threshold=void 0;const e=Hr(),r=Ji(),t=Wr(),n=function(a){const i=this.threshold()*255,o=a.data,l=o.length;for(let u=0;u<l;u+=1)o[u]=o[u]<i?0:255};return jd.Threshold=n,e.Factory.addGetterSetter(r.Node,"threshold",.5,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),jd}var q5;function gx(){if(q5)return Kh;q5=1,Object.defineProperty(Kh,"__esModule",{value:!0}),Kh.Konva=void 0;const e=S2(),r=jS(),t=DS(),n=BS(),a=qS(),i=zS(),o=US(),l=S6(),u=um(),c=x6(),h=HS(),p=VS(),w=GS(),d=WS(),_=E6(),E=$S(),S=YS(),y=XS(),g=KS(),v=ZS(),b=QS(),O=JS(),j=ex(),T=tx(),M=rx(),F=nx(),C=ix(),x=ax(),L=ox(),A=sx(),N=lx(),I=ux(),W=cx(),G=fx(),$=hx(),J=dx(),V=px();return Kh.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:l.Line,Path:u.Path,Rect:c.Rect,RegularPolygon:h.RegularPolygon,Ring:p.Ring,Sprite:w.Sprite,Star:d.Star,Text:_.Text,TextPath:E.TextPath,Transformer:S.Transformer,Wedge:y.Wedge,Filters:{Blur:g.Blur,Brighten:v.Brighten,Contrast:b.Contrast,Emboss:O.Emboss,Enhance:j.Enhance,Grayscale:T.Grayscale,HSL:M.HSL,HSV:F.HSV,Invert:C.Invert,Kaleidoscope:x.Kaleidoscope,Mask:L.Mask,Noise:A.Noise,Pixelate:N.Pixelate,Posterize:I.Posterize,RGB:W.RGB,RGBA:G.RGBA,Sepia:$.Sepia,Solarize:J.Solarize,Threshold:V.Threshold}}),Kh}var vx=m1.exports,z5;function Us(){if(z5)return m1.exports;z5=1,Object.defineProperty(vx,"__esModule",{value:!0});const e=gx();return m1.exports=e.Konva,m1.exports}Us();var s1={exports:{}},U5;function mx(){return U5||(U5=1,function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Konva=void 0;var t=S2();Object.defineProperty(r,"Konva",{enumerable:!0,get:function(){return t.Konva}});const n=S2();e.exports=n.Konva}(s1,s1.exports)),s1.exports}var yx=mx();const fp=mp(yx);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,H5;function bx(){return H5||(H5=1,sg=function(r){var t={},n=di(),a=D2(),i=Object.assign;function o(m){for(var P="https://reactjs.org/docs/error-decoder.html?invariant="+m,B=1;B<arguments.length;B++)P+="&args[]="+encodeURIComponent(arguments[B]);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 l=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"),w=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),_=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),O=Symbol.iterator;function j(m){return m===null||typeof m!="object"?null:(m=O&&m[O]||m["@@iterator"],typeof m=="function"?m:null)}function T(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 w:return"Profiler";case p:return"StrictMode";case S:return"Suspense";case y:return"SuspenseList"}if(typeof m=="object")switch(m.$$typeof){case _:return(m.displayName||"Context")+".Consumer";case d: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 g:return P=m.displayName||null,P!==null?P:T(m.type)||"Memo";case v:P=m._payload,m=m._init;try{return T(m(P))}catch{}}return null}function M(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 T(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,B=m;if(m.alternate)for(;P.return;)P=P.return;else{m=P;do P=m,(P.flags&4098)!==0&&(B=P.return),m=P.return;while(m)}return P.tag===3?B:null}function C(m){if(F(m)!==m)throw Error(o(188))}function x(m){var P=m.alternate;if(!P){if(P=F(m),P===null)throw Error(o(188));return P!==m?null:m}for(var B=m,X=P;;){var re=B.return;if(re===null)break;var le=re.alternate;if(le===null){if(X=re.return,X!==null){B=X;continue}break}if(re.child===le.child){for(le=re.child;le;){if(le===B)return C(re),m;if(le===X)return C(re),P;le=le.sibling}throw Error(o(188))}if(B.return!==X.return)B=re,X=le;else{for(var _e=!1,Ke=re.child;Ke;){if(Ke===B){_e=!0,B=re,X=le;break}if(Ke===X){_e=!0,X=re,B=le;break}Ke=Ke.sibling}if(!_e){for(Ke=le.child;Ke;){if(Ke===B){_e=!0,B=le,X=re;break}if(Ke===X){_e=!0,X=le,B=re;break}Ke=Ke.sibling}if(!_e)throw Error(o(189))}}if(B.alternate!==X)throw Error(o(190))}if(B.tag!==3)throw Error(o(188));return B.stateNode.current===B?m:P}function L(m){return m=x(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 N(m){if(m.tag===5||m.tag===6)return m;for(m=m.child;m!==null;){if(m.tag!==4){var P=N(m);if(P!==null)return P}m=m.sibling}return null}var I=Array.isArray,W=r.getPublicInstance,G=r.getRootHostContext,$=r.getChildHostContext,J=r.prepareForCommit,V=r.resetAfterCommit,H=r.createInstance,z=r.appendInitialChild,D=r.finalizeInitialChildren,K=r.prepareUpdate,ne=r.shouldSetTextContent,Z=r.createTextInstance,ee=r.scheduleTimeout,ae=r.cancelTimeout,se=r.noTimeout,ce=r.isPrimaryRenderer,me=r.supportsMutation,xe=r.supportsPersistence,Oe=r.supportsHydration,Re=r.getInstanceFromNode,Se=r.preparePortalMount,ve=r.getCurrentEventPriority,He=r.detachDeletedInstance,we=r.supportsMicrotasks,Ae=r.scheduleMicrotask,Ee=r.supportsTestSelectors,Ne=r.findFiberRoot,he=r.getBoundingRect,Le=r.getTextContent,Ce=r.isHiddenSubtree,De=r.matchAccessibilityRole,tt=r.setFocusIfFocusable,vt=r.setupIntersectionObserver,mt=r.appendChild,Et=r.appendChildToContainer,nt=r.commitTextUpdate,at=r.commitMount,qt=r.commitUpdate,Ct=r.insertBefore,or=r.insertInContainerBefore,Xt=r.removeChild,qe=r.removeChildFromContainer,We=r.resetTextContent,Nt=r.hideInstance,ht=r.hideTextInstance,gt=r.unhideInstance,wt=r.unhideTextInstance,tr=r.clearContainer,Vt=r.cloneInstance,_t=r.createContainerChildSet,it=r.appendChildToContainerChildSet,Bt=r.finalizeContainerChildren,Ve=r.replaceContainerChildren,Fe=r.cloneHiddenInstance,bt=r.cloneHiddenTextInstance,Ue=r.canHydrateInstance,St=r.canHydrateTextInstance,kt=r.canHydrateSuspenseInstance,Ft=r.isSuspenseInstancePending,zt=r.isSuspenseInstanceFallback,Wt=r.getSuspenseInstanceFallbackErrorDetails,_r=r.registerSuspenseInstanceRetry,kr=r.getNextHydratableSibling,Lr=r.getFirstHydratableChild,Nr=r.getFirstHydratableChildWithinContainer,Wn=r.getFirstHydratableChildWithinSuspenseInstance,en=r.hydrateInstance,Qn=r.hydrateTextInstance,_i=r.hydrateSuspenseInstance,Ni=r.getNextHydratableInstanceAfterSuspenseInstance,Si=r.commitHydratedContainer,fa=r.commitHydratedSuspenseInstance,ws=r.clearSuspenseBoundary,Go=r.clearSuspenseBoundaryFromContainer,tu=r.shouldDeleteUnhydratedTailInstances,vc=r.didNotMatchHydratedContainerTextInstance,Mn=r.didNotMatchHydratedTextInstance,Bu;function oo(m){if(Bu===void 0)try{throw Error()}catch(B){var P=B.stack.trim().match(/\n( *(at )?)/);Bu=P&&P[1]||""}return`
|
|
52
|
-
`+Bu+m}var dl=!1;function Hs(m,P){if(!m||dl)return"";dl=!0;var B=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 X=Lt}Reflect.construct(m,[],P)}else{try{P.call()}catch(Lt){X=Lt}m.call(P.prototype)}else{try{throw Error()}catch(Lt){X=Lt}m()}}catch(Lt){if(Lt&&X&&typeof Lt.stack=="string"){for(var re=Lt.stack.split(`
|
|
53
|
-
`),le=X.stack.split(`
|
|
54
|
-
`),_e=re.length-1,Ke=le.length-1;1<=_e&&0<=Ke&&re[_e]!==le[Ke];)Ke--;for(;1<=_e&&0<=Ke;_e--,Ke--)if(re[_e]!==le[Ke]){if(_e!==1||Ke!==1)do if(_e--,Ke--,0>Ke||re[_e]!==le[Ke]){var ut=`
|
|
55
|
-
`+re[_e].replace(" at new "," at ");return m.displayName&&ut.includes("<anonymous>")&&(ut=ut.replace("<anonymous>",m.displayName)),ut}while(1<=_e&&0<=Ke);break}}}finally{dl=!1,Error.prepareStackTrace=B}return(m=m?m.displayName||m.name:"")?oo(m):""}var qu=Object.prototype.hasOwnProperty,ru=[],so=-1;function pi(m){return{current:m}}function Kr(m){0>so||(m.current=ru[so],ru[so]=null,so--)}function Ar(m,P){so++,ru[so]=m.current,m.current=P}var ln={},gi=pi(ln),Ti=pi(!1),Ia=ln;function ja(m,P){var B=m.type.contextTypes;if(!B)return ln;var X=m.stateNode;if(X&&X.__reactInternalMemoizedUnmaskedChildContext===P)return X.__reactInternalMemoizedMaskedChildContext;var re={},le;for(le in B)re[le]=P[le];return X&&(m=m.stateNode,m.__reactInternalMemoizedUnmaskedChildContext=P,m.__reactInternalMemoizedMaskedChildContext=re),re}function ii(m){return m=m.childContextTypes,m!=null}function Ri(){Kr(Ti),Kr(gi)}function pl(m,P,B){if(gi.current!==ln)throw Error(o(168));Ar(gi,P),Ar(Ti,B)}function ha(m,P,B){var X=m.stateNode;if(P=P.childContextTypes,typeof X.getChildContext!="function")return B;X=X.getChildContext();for(var re in X)if(!(re in P))throw Error(o(108,M(m)||"Unknown",re));return i({},B,X)}function Wo(m){return m=(m=m.stateNode)&&m.__reactInternalMemoizedMergedChildContext||ln,Ia=gi.current,Ar(gi,m),Ar(Ti,Ti.current),!0}function nu(m,P,B){var X=m.stateNode;if(!X)throw Error(o(169));B?(m=ha(m,P,Ia),X.__reactInternalMemoizedMergedChildContext=m,Kr(Ti),Kr(gi),Ar(gi,m)):Kr(Ti),Ar(Ti,B)}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 Ir=64,_s=4194304;function Gs(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 Ws(m,P){var B=m.pendingLanes;if(B===0)return 0;var X=0,re=m.suspendedLanes,le=m.pingedLanes,_e=B&268435455;if(_e!==0){var Ke=_e&~re;Ke!==0?X=Gs(Ke):(le&=_e,le!==0&&(X=Gs(le)))}else _e=B&~re,_e!==0?X=Gs(_e):le!==0&&(X=Gs(le));if(X===0)return 0;if(P!==0&&P!==X&&(P&re)===0&&(re=X&-X,le=P&-P,re>=le||re===16&&(le&4194240)!==0))return P;if((X&4)!==0&&(X|=B&16),P=m.entangledLanes,P!==0)for(m=m.entanglements,P&=X;0<P;)B=31-da(P),re=1<<B,X|=m[B],P&=~re;return X}function mc(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 B=m.suspendedLanes,X=m.pingedLanes,re=m.expirationTimes,le=m.pendingLanes;0<le;){var _e=31-da(le),Ke=1<<_e,ut=re[_e];ut===-1?((Ke&B)===0||(Ke&X)!==0)&&(re[_e]=mc(Ke,P)):ut<=P&&(m.expiredLanes|=Ke),le&=~Ke}}function Ss(m){return m=m.pendingLanes&-1073741825,m!==0?m:m&1073741824?1073741824:0}function xs(){var m=Ir;return Ir<<=1,(Ir&4194240)===0&&(Ir=64),m}function Es(m){for(var P=[],B=0;31>B;B++)P.push(m);return P}function gn(m,P,B){m.pendingLanes|=P,P!==536870912&&(m.suspendedLanes=0,m.pingedLanes=0),m=m.eventTimes,P=31-da(P),m[P]=B}function Yo(m,P){var B=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 X=m.eventTimes;for(m=m.expirationTimes;0<B;){var re=31-da(B),le=1<<re;P[re]=0,X[re]=-1,m[re]=-1,B&=~le}}function Fa(m,P){var B=m.entangledLanes|=P;for(m=m.entanglements;B;){var X=31-da(B),re=1<<X;re&P|m[X]&P&&(m[X]|=P),B&=~re}}var It=0;function $s(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,Ys=a.unstable_requestPaint,In=a.unstable_now,Xs=a.unstable_ImmediatePriority,au=a.unstable_UserBlockingPriority,ou=a.unstable_NormalPriority,of=a.unstable_IdlePriority,uo=null,ai=null;function Da(m){if(ai&&typeof ai.onCommitFiberRoot=="function")try{ai.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,Ps=!1;function gl(m){Ba===null?Ba=[m]:Ba.push(m)}function Uu(m){Ao=!0,gl(m)}function oi(){if(!Ps&&Ba!==null){Ps=!0;var m=0,P=It;try{var B=Ba;for(It=1;m<B.length;m++){var X=B[m];do X=X(!0);while(X!==null)}Ba=null,Ao=!1}catch(re){throw Ba!==null&&(Ba=Ba.slice(m+1)),lo(Xs,oi),re}finally{It=P,Ps=!1}}return null}var Ii=[],ji=0,vl=null,xa=0,wn=[],Fi=0,_n=null,ea=1,ta="";function qa(m,P){Ii[ji++]=xa,Ii[ji++]=vl,vl=m,xa=P}function lu(m,P,B){wn[Fi++]=ea,wn[Fi++]=ta,wn[Fi++]=_n,_n=m;var X=ea;m=ta;var re=32-da(X)-1;X&=~(1<<re),B+=1;var le=32-da(P)+re;if(30<le){var _e=re-re%5;le=(X&(1<<_e)-1).toString(32),X>>=_e,re-=_e,ea=1<<32-da(P)+re|B<<re|X,ta=le+m}else ea=1<<le|B<<re|X,ta=m}function Os(m){m.return!==null&&(qa(m,1),lu(m,1,0))}function Ks(m){for(;m===vl;)vl=Ii[--ji],Ii[ji]=null,xa=Ii[--ji],Ii[ji]=null;for(;m===_n;)_n=wn[--Fi],wn[Fi]=null,ta=wn[--Fi],wn[Fi]=null,ea=wn[--Fi],wn[Fi]=null}var $n=null,vi=null,tn=!1,Zs=!1,za=null;function ml(m,P){var B=Uo(5,null,null,0);B.elementType="DELETED",B.stateNode=P,B.return=m,P=m.deletions,P===null?(m.deletions=[B],m.flags|=16):P.push(B)}function Xo(m,P){switch(m.tag){case 5:return P=Ue(P,m.type,m.pendingProps),P!==null?(m.stateNode=P,$n=m,vi=Lr(P),!0):!1;case 6:return P=St(P,m.pendingProps),P!==null?(m.stateNode=P,$n=m,vi=null,!0):!1;case 13:if(P=kt(P),P!==null){var B=_n!==null?{id:ea,overflow:ta}:null;return m.memoizedState={dehydrated:P,treeContext:B,retryLane:1073741824},B=Uo(18,null,null,0),B.stateNode=P,B.return=m,m.child=B,$n=m,vi=null,!0}return!1;default:return!1}}function yl(m){return(m.mode&1)!==0&&(m.flags&128)===0}function Ko(m){if(tn){var P=vi;if(P){var B=P;if(!Xo(m,P)){if(yl(m))throw Error(o(418));P=kr(B);var X=$n;P&&Xo(m,P)?ml(X,B):(m.flags=m.flags&-4097|2,tn=!1,$n=m)}}else{if(yl(m))throw Error(o(418));m.flags=m.flags&-4097|2,tn=!1,$n=m}}}function uu(m){for(m=m.return;m!==null&&m.tag!==5&&m.tag!==3&&m.tag!==13;)m=m.return;$n=m}function Y(m){if(!Oe||m!==$n)return!1;if(!tn)return uu(m),tn=!0,!1;if(m.tag!==3&&(m.tag!==5||tu(m.type)&&!ne(m.type,m.memoizedProps))){var P=vi;if(P){if(yl(m))throw fe(),Error(o(418));for(;P;)ml(m,P),P=kr(P)}}if(uu(m),m.tag===13){if(!Oe)throw Error(o(316));if(m=m.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(o(317));vi=Ni(m)}else vi=$n?kr(m.stateNode):null;return!0}function fe(){for(var m=vi;m;)m=kr(m)}function ke(){Oe&&(vi=$n=null,Zs=tn=!1)}function Ie(m){za===null?za=[m]:za.push(m)}var Je=l.ReactCurrentBatchConfig;function ft(m,P){if(Mi(m,P))return!0;if(typeof m!="object"||m===null||typeof P!="object"||P===null)return!1;var B=Object.keys(m),X=Object.keys(P);if(B.length!==X.length)return!1;for(X=0;X<B.length;X++){var re=B[X];if(!qu.call(P,re)||!Mi(m[re],P[re]))return!1}return!0}function xt(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=Hs(m.type,!1),m;case 11:return m=Hs(m.type.render,!1),m;case 1:return m=Hs(m.type,!0),m;default:return""}}function Dt(m,P,B){if(m=B.ref,m!==null&&typeof m!="function"&&typeof m!="object"){if(B._owner){if(B=B._owner,B){if(B.tag!==1)throw Error(o(309));var X=B.stateNode}if(!X)throw Error(o(147,m));var re=X,le=""+m;return P!==null&&P.ref!==null&&typeof P.ref=="function"&&P.ref._stringRef===le?P.ref:(P=function(_e){var Ke=re.refs;_e===null?delete Ke[le]:Ke[le]=_e},P._stringRef=le,P)}if(typeof m!="string")throw Error(o(284));if(!B._owner)throw Error(o(290,m))}return m}function nr(m,P){throw m=Object.prototype.toString.call(P),Error(o(31,m==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":m))}function gr(m){var P=m._init;return P(m._payload)}function dr(m){function P(ot,Ze){if(m){var dt=ot.deletions;dt===null?(ot.deletions=[Ze],ot.flags|=16):dt.push(Ze)}}function B(ot,Ze){if(!m)return null;for(;Ze!==null;)P(ot,Ze),Ze=Ze.sibling;return null}function X(ot,Ze){for(ot=new Map;Ze!==null;)Ze.key!==null?ot.set(Ze.key,Ze):ot.set(Ze.index,Ze),Ze=Ze.sibling;return ot}function re(ot,Ze){return ot=Eu(ot,Ze),ot.index=0,ot.sibling=null,ot}function le(ot,Ze,dt){return ot.index=dt,m?(dt=ot.alternate,dt!==null?(dt=dt.index,dt<Ze?(ot.flags|=2,Ze):dt):(ot.flags|=2,Ze)):(ot.flags|=1048576,Ze)}function _e(ot){return m&&ot.alternate===null&&(ot.flags|=2),ot}function Ke(ot,Ze,dt,Gt){return Ze===null||Ze.tag!==6?(Ze=Cc(dt,ot.mode,Gt),Ze.return=ot,Ze):(Ze=re(Ze,dt),Ze.return=ot,Ze)}function ut(ot,Ze,dt,Gt){var ur=dt.type;return ur===h?Kt(ot,Ze,dt.props.children,Gt,dt.key):Ze!==null&&(Ze.elementType===ur||typeof ur=="object"&&ur!==null&&ur.$$typeof===v&&gr(ur)===Ze.type)?(Gt=re(Ze,dt.props),Gt.ref=Dt(ot,Ze,dt),Gt.return=ot,Gt):(Gt=Yf(dt.type,dt.key,dt.props,null,ot.mode,Gt),Gt.ref=Dt(ot,Ze,dt),Gt.return=ot,Gt)}function Lt(ot,Ze,dt,Gt){return Ze===null||Ze.tag!==4||Ze.stateNode.containerInfo!==dt.containerInfo||Ze.stateNode.implementation!==dt.implementation?(Ze=Xf(dt,ot.mode,Gt),Ze.return=ot,Ze):(Ze=re(Ze,dt.children||[]),Ze.return=ot,Ze)}function Kt(ot,Ze,dt,Gt,ur){return Ze===null||Ze.tag!==7?(Ze=ma(dt,ot.mode,Gt,ur),Ze.return=ot,Ze):(Ze=re(Ze,dt),Ze.return=ot,Ze)}function br(ot,Ze,dt){if(typeof Ze=="string"&&Ze!==""||typeof Ze=="number")return Ze=Cc(""+Ze,ot.mode,dt),Ze.return=ot,Ze;if(typeof Ze=="object"&&Ze!==null){switch(Ze.$$typeof){case u:return dt=Yf(Ze.type,Ze.key,Ze.props,null,ot.mode,dt),dt.ref=Dt(ot,null,Ze),dt.return=ot,dt;case c:return Ze=Xf(Ze,ot.mode,dt),Ze.return=ot,Ze;case v:var Gt=Ze._init;return br(ot,Gt(Ze._payload),dt)}if(I(Ze)||j(Ze))return Ze=ma(Ze,ot.mode,dt,null),Ze.return=ot,Ze;nr(ot,Ze)}return null}function Ht(ot,Ze,dt,Gt){var ur=Ze!==null?Ze.key:null;if(typeof dt=="string"&&dt!==""||typeof dt=="number")return ur!==null?null:Ke(ot,Ze,""+dt,Gt);if(typeof dt=="object"&&dt!==null){switch(dt.$$typeof){case u:return dt.key===ur?ut(ot,Ze,dt,Gt):null;case c:return dt.key===ur?Lt(ot,Ze,dt,Gt):null;case v:return ur=dt._init,Ht(ot,Ze,ur(dt._payload),Gt)}if(I(dt)||j(dt))return ur!==null?null:Kt(ot,Ze,dt,Gt,null);nr(ot,dt)}return null}function Tn(ot,Ze,dt,Gt,ur){if(typeof Gt=="string"&&Gt!==""||typeof Gt=="number")return ot=ot.get(dt)||null,Ke(Ze,ot,""+Gt,ur);if(typeof Gt=="object"&&Gt!==null){switch(Gt.$$typeof){case u:return ot=ot.get(Gt.key===null?dt:Gt.key)||null,ut(Ze,ot,Gt,ur);case c:return ot=ot.get(Gt.key===null?dt:Gt.key)||null,Lt(Ze,ot,Gt,ur);case v:var Cr=Gt._init;return Tn(ot,Ze,dt,Cr(Gt._payload),ur)}if(I(Gt)||j(Gt))return ot=ot.get(dt)||null,Kt(Ze,ot,Gt,ur,null);nr(Ze,Gt)}return null}function mn(ot,Ze,dt,Gt){for(var ur=null,Cr=null,wr=Ze,Vr=Ze=0,$i=null;wr!==null&&Vr<dt.length;Vr++){wr.index>Vr?($i=wr,wr=null):$i=wr.sibling;var Ur=Ht(ot,wr,dt[Vr],Gt);if(Ur===null){wr===null&&(wr=$i);break}m&&wr&&Ur.alternate===null&&P(ot,wr),Ze=le(Ur,Ze,Vr),Cr===null?ur=Ur:Cr.sibling=Ur,Cr=Ur,wr=$i}if(Vr===dt.length)return B(ot,wr),tn&&qa(ot,Vr),ur;if(wr===null){for(;Vr<dt.length;Vr++)wr=br(ot,dt[Vr],Gt),wr!==null&&(Ze=le(wr,Ze,Vr),Cr===null?ur=wr:Cr.sibling=wr,Cr=wr);return tn&&qa(ot,Vr),ur}for(wr=X(ot,wr);Vr<dt.length;Vr++)$i=Tn(wr,ot,Vr,dt[Vr],Gt),$i!==null&&(m&&$i.alternate!==null&&wr.delete($i.key===null?Vr:$i.key),Ze=le($i,Ze,Vr),Cr===null?ur=$i:Cr.sibling=$i,Cr=$i);return m&&wr.forEach(function(ka){return P(ot,ka)}),tn&&qa(ot,Vr),ur}function to(ot,Ze,dt,Gt){var ur=j(dt);if(typeof ur!="function")throw Error(o(150));if(dt=ur.call(dt),dt==null)throw Error(o(151));for(var Cr=ur=null,wr=Ze,Vr=Ze=0,$i=null,Ur=dt.next();wr!==null&&!Ur.done;Vr++,Ur=dt.next()){wr.index>Vr?($i=wr,wr=null):$i=wr.sibling;var ka=Ht(ot,wr,Ur.value,Gt);if(ka===null){wr===null&&(wr=$i);break}m&&wr&&ka.alternate===null&&P(ot,wr),Ze=le(ka,Ze,Vr),Cr===null?ur=ka:Cr.sibling=ka,Cr=ka,wr=$i}if(Ur.done)return B(ot,wr),tn&&qa(ot,Vr),ur;if(wr===null){for(;!Ur.done;Vr++,Ur=dt.next())Ur=br(ot,Ur.value,Gt),Ur!==null&&(Ze=le(Ur,Ze,Vr),Cr===null?ur=Ur:Cr.sibling=Ur,Cr=Ur);return tn&&qa(ot,Vr),ur}for(wr=X(ot,wr);!Ur.done;Vr++,Ur=dt.next())Ur=Tn(wr,ot,Vr,Ur.value,Gt),Ur!==null&&(m&&Ur.alternate!==null&&wr.delete(Ur.key===null?Vr:Ur.key),Ze=le(Ur,Ze,Vr),Cr===null?ur=Ur:Cr.sibling=Ur,Cr=Ur);return m&&wr.forEach(function(v0){return P(ot,v0)}),tn&&qa(ot,Vr),ur}function ol(ot,Ze,dt,Gt){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 ur=dt.key,Cr=Ze;Cr!==null;){if(Cr.key===ur){if(ur=dt.type,ur===h){if(Cr.tag===7){B(ot,Cr.sibling),Ze=re(Cr,dt.props.children),Ze.return=ot,ot=Ze;break e}}else if(Cr.elementType===ur||typeof ur=="object"&&ur!==null&&ur.$$typeof===v&&gr(ur)===Cr.type){B(ot,Cr.sibling),Ze=re(Cr,dt.props),Ze.ref=Dt(ot,Cr,dt),Ze.return=ot,ot=Ze;break e}B(ot,Cr);break}else P(ot,Cr);Cr=Cr.sibling}dt.type===h?(Ze=ma(dt.props.children,ot.mode,Gt,dt.key),Ze.return=ot,ot=Ze):(Gt=Yf(dt.type,dt.key,dt.props,null,ot.mode,Gt),Gt.ref=Dt(ot,Ze,dt),Gt.return=ot,ot=Gt)}return _e(ot);case c:e:{for(Cr=dt.key;Ze!==null;){if(Ze.key===Cr)if(Ze.tag===4&&Ze.stateNode.containerInfo===dt.containerInfo&&Ze.stateNode.implementation===dt.implementation){B(ot,Ze.sibling),Ze=re(Ze,dt.children||[]),Ze.return=ot,ot=Ze;break e}else{B(ot,Ze);break}else P(ot,Ze);Ze=Ze.sibling}Ze=Xf(dt,ot.mode,Gt),Ze.return=ot,ot=Ze}return _e(ot);case v:return Cr=dt._init,ol(ot,Ze,Cr(dt._payload),Gt)}if(I(dt))return mn(ot,Ze,dt,Gt);if(j(dt))return to(ot,Ze,dt,Gt);nr(ot,dt)}return typeof dt=="string"&&dt!==""||typeof dt=="number"?(dt=""+dt,Ze!==null&&Ze.tag===6?(B(ot,Ze.sibling),Ze=re(Ze,dt),Ze.return=ot,ot=Ze):(B(ot,Ze),Ze=Cc(dt,ot.mode,Gt),Ze.return=ot,ot=Ze),_e(ot)):B(ot,Ze)}return ol}var Sr=dr(!0),Cn=dr(!1),Sn=pi(null),jn=null,Jn=null,si=null;function Ua(){si=Jn=jn=null}function Ea(m,P,B){ce?(Ar(Sn,P._currentValue),P._currentValue=B):(Ar(Sn,P._currentValue2),P._currentValue2=B)}function Pa(m){var P=Sn.current;Kr(Sn),ce?m._currentValue=P:m._currentValue2=P}function Zo(m,P,B){for(;m!==null;){var X=m.alternate;if((m.childLanes&P)!==P?(m.childLanes|=P,X!==null&&(X.childLanes|=P)):X!==null&&(X.childLanes&P)!==P&&(X.childLanes|=P),m===B)break;m=m.return}}function Qo(m,P){jn=m,si=Jn=null,m=m.dependencies,m!==null&&m.firstContext!==null&&((m.lanes&P)!==0&&(ui=!0),m.firstContext=null)}function Di(m){var P=ce?m._currentValue:m._currentValue2;if(si!==m)if(m={context:m,memoizedValue:P,next:null},Jn===null){if(jn===null)throw Error(o(308));Jn=m,jn.dependencies={lanes:0,firstContext:m}}else Jn=Jn.next=m;return P}var Ha=null;function Qs(m){Ha===null?Ha=[m]:Ha.push(m)}function bl(m,P,B,X){var re=P.interleaved;return re===null?(B.next=B,Qs(P)):(B.next=re.next,re.next=B),P.interleaved=B,ra(m,X)}function ra(m,P){m.lanes|=P;var B=m.alternate;for(B!==null&&(B.lanes|=P),B=m,m=m.return;m!==null;)m.childLanes|=P,B=m.alternate,B!==null&&(B.childLanes|=P),B=m,m=m.return;return B.tag===3?B.stateNode:null}var rn=!1;function Js(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 Va(m,P,B){var X=m.updateQueue;if(X===null)return null;if(X=X.shared,(vr&2)!==0){var re=X.pending;return re===null?P.next=P:(P.next=re.next,re.next=P),X.pending=P,ra(m,B)}return re=X.interleaved,re===null?(P.next=P,Qs(X)):(P.next=re.next,re.next=P),X.interleaved=P,ra(m,B)}function xi(m,P,B){if(P=P.updateQueue,P!==null&&(P=P.shared,(B&4194240)!==0)){var X=P.lanes;X&=m.pendingLanes,B|=X,P.lanes=B,Fa(m,B)}}function el(m,P){var B=m.updateQueue,X=m.alternate;if(X!==null&&(X=X.updateQueue,B===X)){var re=null,le=null;if(B=B.firstBaseUpdate,B!==null){do{var _e={eventTime:B.eventTime,lane:B.lane,tag:B.tag,payload:B.payload,callback:B.callback,next:null};le===null?re=le=_e:le=le.next=_e,B=B.next}while(B!==null);le===null?re=le=P:le=le.next=P}else re=le=P;B={baseState:X.baseState,firstBaseUpdate:re,lastBaseUpdate:le,shared:X.shared,effects:X.effects},m.updateQueue=B;return}m=B.lastBaseUpdate,m===null?B.firstBaseUpdate=P:m.next=P,B.lastBaseUpdate=P}function co(m,P,B,X){var re=m.updateQueue;rn=!1;var le=re.firstBaseUpdate,_e=re.lastBaseUpdate,Ke=re.shared.pending;if(Ke!==null){re.shared.pending=null;var ut=Ke,Lt=ut.next;ut.next=null,_e===null?le=Lt:_e.next=Lt,_e=ut;var Kt=m.alternate;Kt!==null&&(Kt=Kt.updateQueue,Ke=Kt.lastBaseUpdate,Ke!==_e&&(Ke===null?Kt.firstBaseUpdate=Lt:Ke.next=Lt,Kt.lastBaseUpdate=ut))}if(le!==null){var br=re.baseState;_e=0,Kt=Lt=ut=null,Ke=le;do{var Ht=Ke.lane,Tn=Ke.eventTime;if((X&Ht)===Ht){Kt!==null&&(Kt=Kt.next={eventTime:Tn,lane:0,tag:Ke.tag,payload:Ke.payload,callback:Ke.callback,next:null});e:{var mn=m,to=Ke;switch(Ht=P,Tn=B,to.tag){case 1:if(mn=to.payload,typeof mn=="function"){br=mn.call(Tn,br,Ht);break e}br=mn;break e;case 3:mn.flags=mn.flags&-65537|128;case 0:if(mn=to.payload,Ht=typeof mn=="function"?mn.call(Tn,br,Ht):mn,Ht==null)break e;br=i({},br,Ht);break e;case 2:rn=!0}}Ke.callback!==null&&Ke.lane!==0&&(m.flags|=64,Ht=re.effects,Ht===null?re.effects=[Ke]:Ht.push(Ke))}else Tn={eventTime:Tn,lane:Ht,tag:Ke.tag,payload:Ke.payload,callback:Ke.callback,next:null},Kt===null?(Lt=Kt=Tn,ut=br):Kt=Kt.next=Tn,_e|=Ht;if(Ke=Ke.next,Ke===null){if(Ke=re.shared.pending,Ke===null)break;Ht=Ke,Ke=Ht.next,Ht.next=null,re.lastBaseUpdate=Ht,re.shared.pending=null}}while(!0);if(Kt===null&&(ut=br),re.baseState=ut,re.firstBaseUpdate=Lt,re.lastBaseUpdate=Kt,P=re.shared.interleaved,P!==null){re=P;do _e|=re.lane,re=re.next;while(re!==P)}else le===null&&(re.shared.lanes=0);Ns|=_e,m.lanes=_e,m.memoizedState=br}}function Hu(m,P,B){if(m=P.effects,P.effects=null,m!==null)for(P=0;P<m.length;P++){var X=m[P],re=X.callback;if(re!==null){if(X.callback=null,X=B,typeof re!="function")throw Error(o(191,re));re.call(X)}}}var mi={},Bi=pi(mi),As=pi(mi),Co=pi(mi);function yi(m){if(m===mi)throw Error(o(174));return m}function Jo(m,P){Ar(Co,P),Ar(As,m),Ar(Bi,mi),m=G(P),Kr(Bi),Ar(Bi,m)}function li(){Kr(Bi),Kr(As),Kr(Co)}function qi(m){var P=yi(Co.current),B=yi(Bi.current);P=$(B,m.type,P),B!==P&&(Ar(As,m),Ar(Bi,P))}function es(m){As.current===m&&(Kr(Bi),Kr(As))}var $r=pi(0);function fo(m){for(var P=m;P!==null;){if(P.tag===13){var B=P.memoizedState;if(B!==null&&(B=B.dehydrated,B===null||Ft(B)||zt(B)))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 tl=[];function ko(){for(var m=0;m<tl.length;m++){var P=tl[m];ce?P._workInProgressVersionPrimary=null:P._workInProgressVersionSecondary=null}tl.length=0}var jr=l.ReactCurrentDispatcher,Lo=l.ReactCurrentBatchConfig,Yn=0,Tr=null,xn=null,Xn=null,ts=!1,No=!1,To=0,Ga=0;function kn(){throw Error(o(321))}function ho(m,P){if(P===null)return!1;for(var B=0;B<P.length&&B<m.length;B++)if(!Mi(m[B],P[B]))return!1;return!0}function Ro(m,P,B,X,re,le){if(Yn=le,Tr=P,P.memoizedState=null,P.updateQueue=null,P.lanes=0,jr.current=m===null||m.memoizedState===null?Wu:Ol,m=B(X,re),No){le=0;do{if(No=!1,To=0,25<=le)throw Error(o(301));le+=1,Xn=xn=null,P.updateQueue=null,jr.current=uf,m=B(X,re)}while(No)}if(jr.current=ks,P=xn!==null&&xn.next!==null,Yn=0,Xn=xn=Tr=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 Xn===null?Tr.memoizedState=Xn=m:Xn=Xn.next=m,Xn}function un(){if(xn===null){var m=Tr.alternate;m=m!==null?m.memoizedState:null}else m=xn.next;var P=Xn===null?Tr.memoizedState:Xn.next;if(P!==null)Xn=P,xn=m;else{if(m===null)throw Error(o(310));xn=m,m={memoizedState:xn.memoizedState,baseState:xn.baseState,baseQueue:xn.baseQueue,queue:xn.queue,next:null},Xn===null?Tr.memoizedState=Xn=m:Xn=Xn.next=m}return Xn}function Ei(m,P){return typeof P=="function"?P(m):P}function nn(m){var P=un(),B=P.queue;if(B===null)throw Error(o(311));B.lastRenderedReducer=m;var X=xn,re=X.baseQueue,le=B.pending;if(le!==null){if(re!==null){var _e=re.next;re.next=le.next,le.next=_e}X.baseQueue=re=le,B.pending=null}if(re!==null){le=re.next,X=X.baseState;var Ke=_e=null,ut=null,Lt=le;do{var Kt=Lt.lane;if((Yn&Kt)===Kt)ut!==null&&(ut=ut.next={lane:0,action:Lt.action,hasEagerState:Lt.hasEagerState,eagerState:Lt.eagerState,next:null}),X=Lt.hasEagerState?Lt.eagerState:m(X,Lt.action);else{var br={lane:Kt,action:Lt.action,hasEagerState:Lt.hasEagerState,eagerState:Lt.eagerState,next:null};ut===null?(Ke=ut=br,_e=X):ut=ut.next=br,Tr.lanes|=Kt,Ns|=Kt}Lt=Lt.next}while(Lt!==null&&Lt!==le);ut===null?_e=X:ut.next=Ke,Mi(X,P.memoizedState)||(ui=!0),P.memoizedState=X,P.baseState=_e,P.baseQueue=ut,B.lastRenderedState=X}if(m=B.interleaved,m!==null){re=m;do le=re.lane,Tr.lanes|=le,Ns|=le,re=re.next;while(re!==m)}else re===null&&(B.lanes=0);return[P.memoizedState,B.dispatch]}function Yr(m){var P=un(),B=P.queue;if(B===null)throw Error(o(311));B.lastRenderedReducer=m;var X=B.dispatch,re=B.pending,le=P.memoizedState;if(re!==null){B.pending=null;var _e=re=re.next;do le=m(le,_e.action),_e=_e.next;while(_e!==re);Mi(le,P.memoizedState)||(ui=!0),P.memoizedState=le,P.baseQueue===null&&(P.baseState=le),B.lastRenderedState=le}return[le,X]}function Fn(){}function ei(m,P){var B=Tr,X=un(),re=P(),le=!Mi(X.memoizedState,re);if(le&&(X.memoizedState=re,ui=!0),X=X.queue,El(rl.bind(null,B,X,m),[m]),X.getSnapshot!==P||le||Xn!==null&&Xn.memoizedState.tag&1){if(B.flags|=2048,bi(9,_l.bind(null,B,X,re,P),void 0,null),Jr===null)throw Error(o(349));(Yn&30)!==0||Io(B,P,re)}return re}function Io(m,P,B){m.flags|=16384,m={getSnapshot:P,value:B},P=Tr.updateQueue,P===null?(P={lastEffect:null,stores:null},Tr.updateQueue=P,P.stores=[m]):(B=P.stores,B===null?P.stores=[m]:B.push(m))}function _l(m,P,B,X){P.value=B,P.getSnapshot=X,cu(P)&&jo(m)}function rl(m,P,B){return B(function(){cu(P)&&jo(m)})}function cu(m){var P=m.getSnapshot;m=m.value;try{var B=P();return!Mi(m,B)}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=Bh.bind(null,Tr,m),[P.memoizedState,m]}function bi(m,P,B,X){return m={tag:m,create:P,destroy:B,deps:X,next:null},P=Tr.updateQueue,P===null?(P={lastEffect:null,stores:null},Tr.updateQueue=P,P.lastEffect=m.next=m):(B=P.lastEffect,B===null?P.lastEffect=m.next=m:(X=B.next,B.next=m,m.next=X,P.lastEffect=m)),m}function Wa(){return un().memoizedState}function xl(m,P,B,X){var re=zi();Tr.flags|=m,re.memoizedState=bi(1|P,B,void 0,X===void 0?null:X)}function Fo(m,P,B,X){var re=un();X=X===void 0?null:X;var le=void 0;if(xn!==null){var _e=xn.memoizedState;if(le=_e.destroy,X!==null&&ho(X,_e.deps)){re.memoizedState=bi(P,B,le,X);return}}Tr.flags|=m,re.memoizedState=bi(1|P,B,le,X)}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 cn(m,P){return Fo(4,4,m,P)}function Vu(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,B){return B=B!=null?B.concat([m]):null,Fo(4,4,Vu.bind(null,P,m),B)}function Cs(){}function hu(m,P){var B=un();P=P===void 0?null:P;var X=B.memoizedState;return X!==null&&P!==null&&ho(P,X[1])?X[0]:(B.memoizedState=[m,P],m)}function du(m,P){var B=un();P=P===void 0?null:P;var X=B.memoizedState;return X!==null&&P!==null&&ho(P,X[1])?X[0]:(m=m(),B.memoizedState=[m,P],m)}function pu(m,P,B){return(Yn&21)===0?(m.baseState&&(m.baseState=!1,ui=!0),m.memoizedState=B):(Mi(B,P)||(B=xs(),Tr.lanes|=B,Ns|=B,m.baseState=!0),P)}function yc(m,P){var B=It;It=B!==0&&4>B?B:4,m(!0);var X=Lo.transition;Lo.transition={};try{m(!1),P()}finally{It=B,Lo.transition=X}}function nl(){return un().memoizedState}function qf(m,P,B){var X=hi(m);if(B={lane:X,action:B,hasEagerState:!1,eagerState:null,next:null},zf(m))lf(P,B);else if(B=bl(m,P,B,X),B!==null){var re=bn();la(B,m,X,re),Gu(B,P,X)}}function Bh(m,P,B){var X=hi(m),re={lane:X,action:B,hasEagerState:!1,eagerState:null,next:null};if(zf(m))lf(P,re);else{var le=m.alternate;if(m.lanes===0&&(le===null||le.lanes===0)&&(le=P.lastRenderedReducer,le!==null))try{var _e=P.lastRenderedState,Ke=le(_e,B);if(re.hasEagerState=!0,re.eagerState=Ke,Mi(Ke,_e)){var ut=P.interleaved;ut===null?(re.next=re,Qs(P)):(re.next=ut.next,ut.next=re),P.interleaved=re;return}}catch{}finally{}B=bl(m,P,re,X),B!==null&&(re=bn(),la(B,m,X,re),Gu(B,P,X))}}function zf(m){var P=m.alternate;return m===Tr||P!==null&&P===Tr}function lf(m,P){No=ts=!0;var B=m.pending;B===null?P.next=P:(P.next=B.next,B.next=P),m.pending=P}function Gu(m,P,B){if((B&4194240)!==0){var X=P.lanes;X&=m.pendingLanes,B|=X,P.lanes=B,Fa(m,B)}}var ks={readContext:Di,useCallback:kn,useContext:kn,useEffect:kn,useImperativeHandle:kn,useInsertionEffect:kn,useLayoutEffect:kn,useMemo:kn,useReducer:kn,useRef:kn,useState:kn,useDebugValue:kn,useDeferredValue:kn,useTransition:kn,useMutableSource:kn,useSyncExternalStore:kn,useId:kn,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,B){return B=B!=null?B.concat([m]):null,xl(4194308,4,Vu.bind(null,P,m),B)},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 B=zi();return P=P===void 0?null:P,m=m(),B.memoizedState=[m,P],m},useReducer:function(m,P,B){var X=zi();return P=B!==void 0?B(P):P,X.memoizedState=X.baseState=P,m={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:m,lastRenderedState:P},X.queue=m,m=m.dispatch=qf.bind(null,Tr,m),[X.memoizedState,m]},useRef:function(m){var P=zi();return m={current:m},P.memoizedState=m},useState:Sl,useDebugValue:Cs,useDeferredValue:function(m){return zi().memoizedState=m},useTransition:function(){var m=Sl(!1),P=m[0];return m=yc.bind(null,m[1]),zi().memoizedState=m,[P,m]},useMutableSource:function(){},useSyncExternalStore:function(m,P,B){var X=Tr,re=zi();if(tn){if(B===void 0)throw Error(o(407));B=B()}else{if(B=P(),Jr===null)throw Error(o(349));(Yn&30)!==0||Io(X,P,B)}re.memoizedState=B;var le={value:B,getSnapshot:P};return re.queue=le,sf(rl.bind(null,X,le,m),[m]),X.flags|=2048,bi(9,_l.bind(null,X,le,B,P),void 0,null),B},useId:function(){var m=zi(),P=Jr.identifierPrefix;if(tn){var B=ta,X=ea;B=(X&~(1<<32-da(X)-1)).toString(32)+B,P=":"+P+"R"+B,B=To++,0<B&&(P+="H"+B.toString(32)),P+=":"}else B=Ga++,P=":"+P+"r"+B.toString(32)+":";return m.memoizedState=P},unstable_isNewReconciler:!1},Ol={readContext:Di,useCallback:hu,useContext:Di,useEffect:El,useImperativeHandle:Pl,useInsertionEffect:fu,useLayoutEffect:cn,useMemo:du,useReducer:nn,useRef:Wa,useState:function(){return nn(Ei)},useDebugValue:Cs,useDeferredValue:function(m){var P=un();return pu(P,xn.memoizedState,m)},useTransition:function(){var m=nn(Ei)[0],P=un().memoizedState;return[m,P]},useMutableSource:Fn,useSyncExternalStore:ei,useId:nl,unstable_isNewReconciler:!1},uf={readContext:Di,useCallback:hu,useContext:Di,useEffect:El,useImperativeHandle:Pl,useInsertionEffect:fu,useLayoutEffect:cn,useMemo:du,useReducer:Yr,useRef:Wa,useState:function(){return Yr(Ei)},useDebugValue:Cs,useDeferredValue:function(m){var P=un();return xn===null?P.memoizedState=m:pu(P,xn.memoizedState,m)},useTransition:function(){var m=Yr(Ei)[0],P=un().memoizedState;return[m,P]},useMutableSource:Fn,useSyncExternalStore:ei,useId:nl,unstable_isNewReconciler:!1};function $a(m,P){if(m&&m.defaultProps){P=i({},P),m=m.defaultProps;for(var B in m)P[B]===void 0&&(P[B]=m[B]);return P}return P}function bc(m,P,B,X){P=m.memoizedState,B=B(X,P),B=B==null?P:i({},P,B),m.memoizedState=B,m.lanes===0&&(m.updateQueue.baseState=B)}var $u={isMounted:function(m){return(m=m._reactInternals)?F(m)===m:!1},enqueueSetState:function(m,P,B){m=m._reactInternals;var X=bn(),re=hi(m),le=Oa(X,re);le.payload=P,B!=null&&(le.callback=B),P=Va(m,le,re),P!==null&&(la(P,m,re,X),xi(P,m,re))},enqueueReplaceState:function(m,P,B){m=m._reactInternals;var X=bn(),re=hi(m),le=Oa(X,re);le.tag=1,le.payload=P,B!=null&&(le.callback=B),P=Va(m,le,re),P!==null&&(la(P,m,re,X),xi(P,m,re))},enqueueForceUpdate:function(m,P){m=m._reactInternals;var B=bn(),X=hi(m),re=Oa(B,X);re.tag=2,P!=null&&(re.callback=P),P=Va(m,re,X),P!==null&&(la(P,m,X,B),xi(P,m,X))}};function Uf(m,P,B,X,re,le,_e){return m=m.stateNode,typeof m.shouldComponentUpdate=="function"?m.shouldComponentUpdate(X,le,_e):P.prototype&&P.prototype.isPureReactComponent?!ft(B,X)||!ft(re,le):!0}function Hf(m,P,B){var X=!1,re=ln,le=P.contextType;return typeof le=="object"&&le!==null?le=Di(le):(re=ii(P)?Ia:gi.current,X=P.contextTypes,le=(X=X!=null)?ja(m,re):ln),P=new P(B,le),m.memoizedState=P.state!==null&&P.state!==void 0?P.state:null,P.updater=$u,m.stateNode=P,P._reactInternals=m,X&&(m=m.stateNode,m.__reactInternalMemoizedUnmaskedChildContext=re,m.__reactInternalMemoizedMaskedChildContext=le),P}function wc(m,P,B,X){m=P.state,typeof P.componentWillReceiveProps=="function"&&P.componentWillReceiveProps(B,X),typeof P.UNSAFE_componentWillReceiveProps=="function"&&P.UNSAFE_componentWillReceiveProps(B,X),P.state!==m&&$u.enqueueReplaceState(P,P.state,null)}function Ui(m,P,B,X){var re=m.stateNode;re.props=B,re.state=m.memoizedState,re.refs={},Js(m);var le=P.contextType;typeof le=="object"&&le!==null?re.context=Di(le):(le=ii(P)?Ia:gi.current,re.context=ja(m,le)),re.state=m.memoizedState,le=P.getDerivedStateFromProps,typeof le=="function"&&(bc(m,P,le,B),re.state=m.memoizedState),typeof P.getDerivedStateFromProps=="function"||typeof re.getSnapshotBeforeUpdate=="function"||typeof re.UNSAFE_componentWillMount!="function"&&typeof re.componentWillMount!="function"||(P=re.state,typeof re.componentWillMount=="function"&&re.componentWillMount(),typeof re.UNSAFE_componentWillMount=="function"&&re.UNSAFE_componentWillMount(),P!==re.state&&$u.enqueueReplaceState(re,re.state,null),co(m,B,re,X),re.state=m.memoizedState),typeof re.componentDidMount=="function"&&(m.flags|=4194308)}function Hi(m,P){try{var B="",X=P;do B+=xt(X),X=X.return;while(X);var re=B}catch(le){re=`
|
|
56
|
-
Error generating stack: `+le.message+`
|
|
57
|
-
`+le.stack}return{value:m,source:P,stack:re,digest:null}}function na(m,P,B){return{value:m,source:null,stack:B??null,digest:P??null}}function po(m,P){try{console.error(P.value)}catch(B){setTimeout(function(){throw B})}}var gu=typeof WeakMap=="function"?WeakMap:Map;function Vi(m,P,B){B=Oa(-1,B),B.tag=3,B.payload={element:null};var X=P.value;return B.callback=function(){zn||(zn=!0,Un=X),po(m,P)},B}function pa(m,P,B){B=Oa(-1,B),B.tag=3;var X=m.type.getDerivedStateFromError;if(typeof X=="function"){var re=P.value;B.payload=function(){return X(re)},B.callback=function(){po(m,P)}}var le=m.stateNode;return le!==null&&typeof le.componentDidCatch=="function"&&(B.callback=function(){po(m,P),typeof X!="function"&&(Za===null?Za=new Set([this]):Za.add(this));var _e=P.stack;this.componentDidCatch(P.value,{componentStack:_e!==null?_e:""})}),B}function Vf(m,P,B){var X=m.pingCache;if(X===null){X=m.pingCache=new gu;var re=new Set;X.set(P,re)}else re=X.get(P),re===void 0&&(re=new Set,X.set(P,re));re.has(B)||(re.add(B),m=Np.bind(null,m,P,B),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 Ls(m,P,B,X,re){return(m.mode&1)===0?(m===P?m.flags|=65536:(m.flags|=128,B.flags|=131072,B.flags&=-52805,B.tag===1&&(B.alternate===null?B.tag=17:(P=Oa(-1,1),P.tag=2,Va(B,P,1))),B.lanes|=1),m):(m.flags|=65536,m.lanes=re,m)}var vu=l.ReactCurrentOwner,ui=!1;function wi(m,P,B,X){P.child=m===null?Cn(P,null,B,X):Sr(P,m.child,B,X)}function _c(m,P,B,X,re){B=B.render;var le=P.ref;return Qo(P,re),X=Ro(m,P,B,X,le,re),B=Mo(),m!==null&&!ui?(P.updateQueue=m.updateQueue,P.flags&=-2053,m.lanes&=~re,te(m,P,re)):(tn&&B&&Os(P),P.flags|=1,wi(m,P,X,re),P.child)}function rs(m,P,B,X,re){if(m===null){var le=B.type;return typeof le=="function"&&!Oc(le)&&le.defaultProps===void 0&&B.compare===null&&B.defaultProps===void 0?(P.tag=15,P.type=le,go(m,P,le,X,re)):(m=Yf(B.type,null,X,P,P.mode,re),m.ref=P.ref,m.return=P,P.child=m)}if(le=m.child,(m.lanes&re)===0){var _e=le.memoizedProps;if(B=B.compare,B=B!==null?B:ft,B(_e,X)&&m.ref===P.ref)return te(m,P,re)}return P.flags|=1,m=Eu(le,X),m.ref=P.ref,m.return=P,P.child=m}function go(m,P,B,X,re){if(m!==null){var le=m.memoizedProps;if(ft(le,X)&&m.ref===P.ref)if(ui=!1,P.pendingProps=X=le,(m.lanes&re)!==0)(m.flags&131072)!==0&&(ui=!0);else return P.lanes=m.lanes,te(m,P,re)}return ns(m,P,B,X,re)}function Zr(m,P,B){var X=P.pendingProps,re=X.children,le=m!==null?m.memoizedState:null;if(X.mode==="hidden")if((P.mode&1)===0)P.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ar(qo,ti),ti|=B;else{if((B&1073741824)===0)return m=le!==null?le.baseLanes|B:B,P.lanes=P.childLanes=1073741824,P.memoizedState={baseLanes:m,cachePool:null,transitions:null},P.updateQueue=null,Ar(qo,ti),ti|=m,null;P.memoizedState={baseLanes:0,cachePool:null,transitions:null},X=le!==null?le.baseLanes:B,Ar(qo,ti),ti|=X}else le!==null?(X=le.baseLanes|B,P.memoizedState=null):X=B,Ar(qo,ti),ti|=X;return wi(m,P,re,B),P.child}function an(m,P){var B=P.ref;(m===null&&B!==null||m!==null&&m.ref!==B)&&(P.flags|=512,P.flags|=2097152)}function ns(m,P,B,X,re){var le=ii(B)?Ia:gi.current;return le=ja(P,le),Qo(P,re),B=Ro(m,P,B,X,le,re),X=Mo(),m!==null&&!ui?(P.updateQueue=m.updateQueue,P.flags&=-2053,m.lanes&=~re,te(m,P,re)):(tn&&X&&Os(P),P.flags|=1,wi(m,P,B,re),P.child)}function Pi(m,P,B,X,re){if(ii(B)){var le=!0;Wo(P)}else le=!1;if(Qo(P,re),P.stateNode===null)U(m,P),Hf(P,B,X),Ui(P,B,X,re),X=!0;else if(m===null){var _e=P.stateNode,Ke=P.memoizedProps;_e.props=Ke;var ut=_e.context,Lt=B.contextType;typeof Lt=="object"&&Lt!==null?Lt=Di(Lt):(Lt=ii(B)?Ia:gi.current,Lt=ja(P,Lt));var Kt=B.getDerivedStateFromProps,br=typeof Kt=="function"||typeof _e.getSnapshotBeforeUpdate=="function";br||typeof _e.UNSAFE_componentWillReceiveProps!="function"&&typeof _e.componentWillReceiveProps!="function"||(Ke!==X||ut!==Lt)&&wc(P,_e,X,Lt),rn=!1;var Ht=P.memoizedState;_e.state=Ht,co(P,X,_e,re),ut=P.memoizedState,Ke!==X||Ht!==ut||Ti.current||rn?(typeof Kt=="function"&&(bc(P,B,Kt,X),ut=P.memoizedState),(Ke=rn||Uf(P,B,Ke,X,Ht,ut,Lt))?(br||typeof _e.UNSAFE_componentWillMount!="function"&&typeof _e.componentWillMount!="function"||(typeof _e.componentWillMount=="function"&&_e.componentWillMount(),typeof _e.UNSAFE_componentWillMount=="function"&&_e.UNSAFE_componentWillMount()),typeof _e.componentDidMount=="function"&&(P.flags|=4194308)):(typeof _e.componentDidMount=="function"&&(P.flags|=4194308),P.memoizedProps=X,P.memoizedState=ut),_e.props=X,_e.state=ut,_e.context=Lt,X=Ke):(typeof _e.componentDidMount=="function"&&(P.flags|=4194308),X=!1)}else{_e=P.stateNode,wl(m,P),Ke=P.memoizedProps,Lt=P.type===P.elementType?Ke:$a(P.type,Ke),_e.props=Lt,br=P.pendingProps,Ht=_e.context,ut=B.contextType,typeof ut=="object"&&ut!==null?ut=Di(ut):(ut=ii(B)?Ia:gi.current,ut=ja(P,ut));var Tn=B.getDerivedStateFromProps;(Kt=typeof Tn=="function"||typeof _e.getSnapshotBeforeUpdate=="function")||typeof _e.UNSAFE_componentWillReceiveProps!="function"&&typeof _e.componentWillReceiveProps!="function"||(Ke!==br||Ht!==ut)&&wc(P,_e,X,ut),rn=!1,Ht=P.memoizedState,_e.state=Ht,co(P,X,_e,re);var mn=P.memoizedState;Ke!==br||Ht!==mn||Ti.current||rn?(typeof Tn=="function"&&(bc(P,B,Tn,X),mn=P.memoizedState),(Lt=rn||Uf(P,B,Lt,X,Ht,mn,ut)||!1)?(Kt||typeof _e.UNSAFE_componentWillUpdate!="function"&&typeof _e.componentWillUpdate!="function"||(typeof _e.componentWillUpdate=="function"&&_e.componentWillUpdate(X,mn,ut),typeof _e.UNSAFE_componentWillUpdate=="function"&&_e.UNSAFE_componentWillUpdate(X,mn,ut)),typeof _e.componentDidUpdate=="function"&&(P.flags|=4),typeof _e.getSnapshotBeforeUpdate=="function"&&(P.flags|=1024)):(typeof _e.componentDidUpdate!="function"||Ke===m.memoizedProps&&Ht===m.memoizedState||(P.flags|=4),typeof _e.getSnapshotBeforeUpdate!="function"||Ke===m.memoizedProps&&Ht===m.memoizedState||(P.flags|=1024),P.memoizedProps=X,P.memoizedState=mn),_e.props=X,_e.state=mn,_e.context=ut,X=Lt):(typeof _e.componentDidUpdate!="function"||Ke===m.memoizedProps&&Ht===m.memoizedState||(P.flags|=4),typeof _e.getSnapshotBeforeUpdate!="function"||Ke===m.memoizedProps&&Ht===m.memoizedState||(P.flags|=1024),X=!1)}return ia(m,P,B,X,le,re)}function ia(m,P,B,X,re,le){an(m,P);var _e=(P.flags&128)!==0;if(!X&&!_e)return re&&nu(P,B,!1),te(m,P,le);X=P.stateNode,vu.current=P;var Ke=_e&&typeof B.getDerivedStateFromError!="function"?null:X.render();return P.flags|=1,m!==null&&_e?(P.child=Sr(P,m.child,null,le),P.child=Sr(P,null,Ke,le)):wi(m,P,Ke,le),P.memoizedState=X.state,re&&nu(P,B,!0),P.child}function il(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,B,X,re){return ke(),Ie(re),P.flags|=256,wi(m,P,B,X),P.child}var aa={dehydrated:null,treeContext:null,retryLane:0};function mu(m){return{baseLanes:m,cachePool:null,transitions:null}}function cf(m,P,B){var X=P.pendingProps,re=$r.current,le=!1,_e=(P.flags&128)!==0,Ke;if((Ke=_e)||(Ke=m!==null&&m.memoizedState===null?!1:(re&2)!==0),Ke?(le=!0,P.flags&=-129):(m===null||m.memoizedState!==null)&&(re|=1),Ar($r,re&1),m===null)return Ko(P),m=P.memoizedState,m!==null&&(m=m.dehydrated,m!==null)?((P.mode&1)===0?P.lanes=1:zt(m)?P.lanes=8:P.lanes=1073741824,null):(_e=X.children,m=X.fallback,le?(X=P.mode,le=P.child,_e={mode:"hidden",children:_e},(X&1)===0&&le!==null?(le.childLanes=0,le.pendingProps=_e):le=Ac(_e,X,0,null),m=ma(m,X,B,null),le.return=P,m.return=P,le.sibling=m,P.child=le,P.child.memoizedState=mu(B),P.memoizedState=aa,m):Yu(P,_e));if(re=m.memoizedState,re!==null&&(Ke=re.dehydrated,Ke!==null))return Wf(m,P,_e,X,Ke,re,B);if(le){le=X.fallback,_e=P.mode,re=m.child,Ke=re.sibling;var ut={mode:"hidden",children:X.children};return(_e&1)===0&&P.child!==re?(X=P.child,X.childLanes=0,X.pendingProps=ut,P.deletions=null):(X=Eu(re,ut),X.subtreeFlags=re.subtreeFlags&14680064),Ke!==null?le=Eu(Ke,le):(le=ma(le,_e,B,null),le.flags|=2),le.return=P,X.return=P,X.sibling=le,P.child=X,X=le,le=P.child,_e=m.child.memoizedState,_e=_e===null?mu(B):{baseLanes:_e.baseLanes|B,cachePool:null,transitions:_e.transitions},le.memoizedState=_e,le.childLanes=m.childLanes&~B,P.memoizedState=aa,X}return le=m.child,m=le.sibling,X=Eu(le,{mode:"visible",children:X.children}),(P.mode&1)===0&&(X.lanes=B),X.return=P,X.sibling=null,m!==null&&(B=P.deletions,B===null?(P.deletions=[m],P.flags|=16):B.push(m)),P.child=X,P.memoizedState=null,X}function Yu(m,P){return P=Ac({mode:"visible",children:P},m.mode,0,null),P.return=m,m.child=P}function is(m,P,B,X){return X!==null&&Ie(X),Sr(P,m.child,null,B),m=Yu(P,P.pendingProps.children),m.flags|=2,P.memoizedState=null,m}function Wf(m,P,B,X,re,le,_e){if(B)return P.flags&256?(P.flags&=-257,X=na(Error(o(422))),is(m,P,_e,X)):P.memoizedState!==null?(P.child=m.child,P.flags|=128,null):(le=X.fallback,re=P.mode,X=Ac({mode:"visible",children:X.children},re,0,null),le=ma(le,re,_e,null),le.flags|=2,X.return=P,le.return=P,X.sibling=le,P.child=X,(P.mode&1)!==0&&Sr(P,m.child,null,_e),P.child.memoizedState=mu(_e),P.memoizedState=aa,le);if((P.mode&1)===0)return is(m,P,_e,null);if(zt(re))return X=Wt(re).digest,le=Error(o(419)),X=na(le,X,void 0),is(m,P,_e,X);if(B=(_e&m.childLanes)!==0,ui||B){if(X=Jr,X!==null){switch(_e&-_e){case 4:re=2;break;case 16:re=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:re=32;break;case 536870912:re=268435456;break;default:re=0}re=(re&(X.suspendedLanes|_e))!==0?0:re,re!==0&&re!==le.retryLane&&(le.retryLane=re,ra(m,re),la(X,m,re,-1))}return eo(),X=na(Error(o(421))),is(m,P,_e,X)}return Ft(re)?(P.flags|=128,P.child=m.child,P=Rp.bind(null,m),_r(re,P),null):(m=le.treeContext,Oe&&(vi=Wn(re),$n=P,tn=!0,za=null,Zs=!1,m!==null&&(wn[Fi++]=ea,wn[Fi++]=ta,wn[Fi++]=_n,ea=m.id,ta=m.overflow,_n=P)),P=Yu(P,X.children),P.flags|=4096,P)}function as(m,P,B){m.lanes|=P;var X=m.alternate;X!==null&&(X.lanes|=P),Zo(m.return,P,B)}function Cl(m,P,B,X,re){var le=m.memoizedState;le===null?m.memoizedState={isBackwards:P,rendering:null,renderingStartTime:0,last:X,tail:B,tailMode:re}:(le.isBackwards=P,le.rendering=null,le.renderingStartTime=0,le.last=X,le.tail=B,le.tailMode=re)}function R(m,P,B){var X=P.pendingProps,re=X.revealOrder,le=X.tail;if(wi(m,P,X.children,B),X=$r.current,(X&2)!==0)X=X&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,B,P);else if(m.tag===19)as(m,B,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}X&=1}if(Ar($r,X),(P.mode&1)===0)P.memoizedState=null;else switch(re){case"forwards":for(B=P.child,re=null;B!==null;)m=B.alternate,m!==null&&fo(m)===null&&(re=B),B=B.sibling;B=re,B===null?(re=P.child,P.child=null):(re=B.sibling,B.sibling=null),Cl(P,!1,re,B,le);break;case"backwards":for(B=null,re=P.child,P.child=null;re!==null;){if(m=re.alternate,m!==null&&fo(m)===null){P.child=re;break}m=re.sibling,re.sibling=B,B=re,re=m}Cl(P,!0,B,null,le);break;case"together":Cl(P,!1,null,null,void 0);break;default:P.memoizedState=null}return P.child}function U(m,P){(P.mode&1)===0&&m!==null&&(m.alternate=null,P.alternate=null,P.flags|=2)}function te(m,P,B){if(m!==null&&(P.dependencies=m.dependencies),Ns|=P.lanes,(B&P.childLanes)===0)return null;if(m!==null&&P.child!==m.child)throw Error(o(153));if(P.child!==null){for(m=P.child,B=Eu(m,m.pendingProps),P.child=B,B.return=P;m.sibling!==null;)m=m.sibling,B=B.sibling=Eu(m,m.pendingProps),B.return=P;B.sibling=null}return P.child}function oe(m,P,B){switch(P.tag){case 3:il(P),ke();break;case 5:qi(P);break;case 1:ii(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 X=P.memoizedState;if(X!==null)return X.dehydrated!==null?(Ar($r,$r.current&1),P.flags|=128,null):(B&P.child.childLanes)!==0?cf(m,P,B):(Ar($r,$r.current&1),m=te(m,P,B),m!==null?m.sibling:null);Ar($r,$r.current&1);break;case 19:if(X=(B&P.childLanes)!==0,(m.flags&128)!==0){if(X)return R(m,P,B);P.flags|=128}var re=P.memoizedState;if(re!==null&&(re.rendering=null,re.tail=null,re.lastEffect=null),Ar($r,$r.current),X)break;return null;case 22:case 23:return P.lanes=0,Zr(m,P,B)}return te(m,P,B)}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,be,Pe;if(me)ge=function(m,P){for(var B=P.child;B!==null;){if(B.tag===5||B.tag===6)z(m,B.stateNode);else if(B.tag!==4&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===P)break;for(;B.sibling===null;){if(B.return===null||B.return===P)return;B=B.return}B.sibling.return=B.return,B=B.sibling}},ye=function(){},be=function(m,P,B,X,re){if(m=m.memoizedProps,m!==X){var le=P.stateNode,_e=yi(Bi.current);B=K(le,B,m,X,re,_e),(P.updateQueue=B)&&ue(P)}},Pe=function(m,P,B,X){B!==X&&ue(P)};else if(xe){ge=function(m,P,B,X){for(var re=P.child;re!==null;){if(re.tag===5){var le=re.stateNode;B&&X&&(le=Fe(le,re.type,re.memoizedProps,re)),z(m,le)}else if(re.tag===6)le=re.stateNode,B&&X&&(le=bt(le,re.memoizedProps,re)),z(m,le);else if(re.tag!==4){if(re.tag===22&&re.memoizedState!==null)le=re.child,le!==null&&(le.return=re),ge(m,re,!0,!0);else if(re.child!==null){re.child.return=re,re=re.child;continue}}if(re===P)break;for(;re.sibling===null;){if(re.return===null||re.return===P)return;re=re.return}re.sibling.return=re.return,re=re.sibling}};var je=function(m,P,B,X){for(var re=P.child;re!==null;){if(re.tag===5){var le=re.stateNode;B&&X&&(le=Fe(le,re.type,re.memoizedProps,re)),it(m,le)}else if(re.tag===6)le=re.stateNode,B&&X&&(le=bt(le,re.memoizedProps,re)),it(m,le);else if(re.tag!==4){if(re.tag===22&&re.memoizedState!==null)le=re.child,le!==null&&(le.return=re),je(m,re,!0,!0);else if(re.child!==null){re.child.return=re,re=re.child;continue}}if(re===P)break;for(;re.sibling===null;){if(re.return===null||re.return===P)return;re=re.return}re.sibling.return=re.return,re=re.sibling}};ye=function(m,P){var B=P.stateNode;if(!de(m,P)){m=B.containerInfo;var X=_t(m);je(X,P,!1,!1),B.pendingChildren=X,ue(P),Bt(m,X)}},be=function(m,P,B,X,re){var le=m.stateNode,_e=m.memoizedProps;if((m=de(m,P))&&_e===X)P.stateNode=le;else{var Ke=P.stateNode,ut=yi(Bi.current),Lt=null;_e!==X&&(Lt=K(Ke,B,_e,X,re,ut)),m&&Lt===null?P.stateNode=le:(le=Vt(le,Lt,B,_e,X,P,m,Ke),D(le,B,X,re,ut)&&ue(P),P.stateNode=le,m?ue(P):ge(le,P,!1,!1))}},Pe=function(m,P,B,X){B!==X?(m=yi(Co.current),B=yi(Bi.current),P.stateNode=Z(X,m,B,P),ue(P)):P.stateNode=m.stateNode}}else ye=function(){},be=function(){},Pe=function(){};function Qe(m,P){if(!tn)switch(m.tailMode){case"hidden":P=m.tail;for(var B=null;P!==null;)P.alternate!==null&&(B=P),P=P.sibling;B===null?m.tail=null:B.sibling=null;break;case"collapsed":B=m.tail;for(var X=null;B!==null;)B.alternate!==null&&(X=B),B=B.sibling;X===null?P||m.tail===null?m.tail=null:m.tail.sibling=null:X.sibling=null}}function Xe(m){var P=m.alternate!==null&&m.alternate.child===m.child,B=0,X=0;if(P)for(var re=m.child;re!==null;)B|=re.lanes|re.childLanes,X|=re.subtreeFlags&14680064,X|=re.flags&14680064,re.return=m,re=re.sibling;else for(re=m.child;re!==null;)B|=re.lanes|re.childLanes,X|=re.subtreeFlags,X|=re.flags,re.return=m,re=re.sibling;return m.subtreeFlags|=X,m.childLanes=B,P}function Ye(m,P,B){var X=P.pendingProps;switch(Ks(P),P.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(P),null;case 1:return ii(P.type)&&Ri(),Xe(P),null;case 3:return B=P.stateNode,li(),Kr(Ti),Kr(gi),ko(),B.pendingContext&&(B.context=B.pendingContext,B.pendingContext=null),(m===null||m.child===null)&&(Y(P)?ue(P):m===null||m.memoizedState.isDehydrated&&(P.flags&256)===0||(P.flags|=1024,za!==null&&(Ku(za),za=null))),ye(m,P),Xe(P),null;case 5:es(P),B=yi(Co.current);var re=P.type;if(m!==null&&P.stateNode!=null)be(m,P,re,X,B),m.ref!==P.ref&&(P.flags|=512,P.flags|=2097152);else{if(!X){if(P.stateNode===null)throw Error(o(166));return Xe(P),null}if(m=yi(Bi.current),Y(P)){if(!Oe)throw Error(o(175));m=en(P.stateNode,P.type,P.memoizedProps,B,m,P,!Zs),P.updateQueue=m,m!==null&&ue(P)}else{var le=H(re,X,B,m,P);ge(le,P,!1,!1),P.stateNode=le,D(le,re,X,B,m)&&ue(P)}P.ref!==null&&(P.flags|=512,P.flags|=2097152)}return Xe(P),null;case 6:if(m&&P.stateNode!=null)Pe(m,P,m.memoizedProps,X);else{if(typeof X!="string"&&P.stateNode===null)throw Error(o(166));if(m=yi(Co.current),B=yi(Bi.current),Y(P)){if(!Oe)throw Error(o(176));if(m=P.stateNode,B=P.memoizedProps,(X=Qn(m,B,P,!Zs))&&(re=$n,re!==null))switch(re.tag){case 3:vc(re.stateNode.containerInfo,m,B,(re.mode&1)!==0);break;case 5:Mn(re.type,re.memoizedProps,re.stateNode,m,B,(re.mode&1)!==0)}X&&ue(P)}else P.stateNode=Z(X,m,B,P)}return Xe(P),null;case 13:if(Kr($r),X=P.memoizedState,m===null||m.memoizedState!==null&&m.memoizedState.dehydrated!==null){if(tn&&vi!==null&&(P.mode&1)!==0&&(P.flags&128)===0)fe(),ke(),P.flags|=98560,re=!1;else if(re=Y(P),X!==null&&X.dehydrated!==null){if(m===null){if(!re)throw Error(o(318));if(!Oe)throw Error(o(344));if(re=P.memoizedState,re=re!==null?re.dehydrated:null,!re)throw Error(o(317));_i(re,P)}else ke(),(P.flags&128)===0&&(P.memoizedState=null),P.flags|=4;Xe(P),re=!1}else za!==null&&(Ku(za),za=null),re=!0;if(!re)return P.flags&65536?P:null}return(P.flags&128)!==0?(P.lanes=B,P):(B=X!==null,B!==(m!==null&&m.memoizedState!==null)&&B&&(P.child.flags|=8192,(P.mode&1)!==0&&(m===null||($r.current&1)!==0?fn===0&&(fn=3):eo())),P.updateQueue!==null&&(P.flags|=4),Xe(P),null);case 4:return li(),ye(m,P),m===null&&Se(P.stateNode.containerInfo),Xe(P),null;case 10:return Pa(P.type._context),Xe(P),null;case 17:return ii(P.type)&&Ri(),Xe(P),null;case 19:if(Kr($r),re=P.memoizedState,re===null)return Xe(P),null;if(X=(P.flags&128)!==0,le=re.rendering,le===null)if(X)Qe(re,!1);else{if(fn!==0||m!==null&&(m.flags&128)!==0)for(m=P.child;m!==null;){if(le=fo(m),le!==null){for(P.flags|=128,Qe(re,!1),m=le.updateQueue,m!==null&&(P.updateQueue=m,P.flags|=4),P.subtreeFlags=0,m=B,B=P.child;B!==null;)X=B,re=m,X.flags&=14680066,le=X.alternate,le===null?(X.childLanes=0,X.lanes=re,X.child=null,X.subtreeFlags=0,X.memoizedProps=null,X.memoizedState=null,X.updateQueue=null,X.dependencies=null,X.stateNode=null):(X.childLanes=le.childLanes,X.lanes=le.lanes,X.child=le.child,X.subtreeFlags=0,X.deletions=null,X.memoizedProps=le.memoizedProps,X.memoizedState=le.memoizedState,X.updateQueue=le.updateQueue,X.type=le.type,re=le.dependencies,X.dependencies=re===null?null:{lanes:re.lanes,firstContext:re.firstContext}),B=B.sibling;return Ar($r,$r.current&1|2),P.child}m=m.sibling}re.tail!==null&&In()>_u&&(P.flags|=128,X=!0,Qe(re,!1),P.lanes=4194304)}else{if(!X)if(m=fo(le),m!==null){if(P.flags|=128,X=!0,m=m.updateQueue,m!==null&&(P.updateQueue=m,P.flags|=4),Qe(re,!0),re.tail===null&&re.tailMode==="hidden"&&!le.alternate&&!tn)return Xe(P),null}else 2*In()-re.renderingStartTime>_u&&B!==1073741824&&(P.flags|=128,X=!0,Qe(re,!1),P.lanes=4194304);re.isBackwards?(le.sibling=P.child,P.child=le):(m=re.last,m!==null?m.sibling=le:P.child=le,re.last=le)}return re.tail!==null?(P=re.tail,re.rendering=P,re.tail=P.sibling,re.renderingStartTime=In(),P.sibling=null,m=$r.current,Ar($r,X?m&1|2:m&1),P):(Xe(P),null);case 22:case 23:return xu(),B=P.memoizedState!==null,m!==null&&m.memoizedState!==null!==B&&(P.flags|=8192),B&&(P.mode&1)!==0?(ti&1073741824)!==0&&(Xe(P),me&&P.subtreeFlags&6&&(P.flags|=8192)):Xe(P),null;case 24:return null;case 25:return null}throw Error(o(156,P.tag))}function yt(m,P){switch(Ks(P),P.tag){case 1:return ii(P.type)&&Ri(),m=P.flags,m&65536?(P.flags=m&-65537|128,P):null;case 3:return li(),Kr(Ti),Kr(gi),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(Kr($r),m=P.memoizedState,m!==null&&m.dehydrated!==null){if(P.alternate===null)throw Error(o(340));ke()}return m=P.flags,m&65536?(P.flags=m&-65537|128,P):null;case 19:return Kr($r),null;case 4:return li(),null;case 10:return Pa(P.type._context),null;case 22:case 23:return xu(),null;case 24:return null;default:return null}}var lt=!1,Me=!1,ze=typeof WeakSet=="function"?WeakSet:Set,Ge=null;function ct(m,P){var B=m.ref;if(B!==null)if(typeof B=="function")try{B(null)}catch(X){Vn(m,P,X)}else B.current=null}function pt(m,P,B){try{B()}catch(X){Vn(m,P,X)}}var Ut=!1;function jt(m,P){for(J(m.containerInfo),Ge=P;Ge!==null;)if(m=Ge,P=m.child,(m.subtreeFlags&1028)!==0&&P!==null)P.return=m,Ge=P;else for(;Ge!==null;){m=Ge;try{var B=m.alternate;if((m.flags&1024)!==0)switch(m.tag){case 0:case 11:case 15:break;case 1:if(B!==null){var X=B.memoizedProps,re=B.memoizedState,le=m.stateNode,_e=le.getSnapshotBeforeUpdate(m.elementType===m.type?X:$a(m.type,X),re);le.__reactInternalSnapshotBeforeUpdate=_e}break;case 3:me&&tr(m.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Ke){Vn(m,m.return,Ke)}if(P=m.sibling,P!==null){P.return=m.return,Ge=P;break}Ge=m.return}return B=Ut,Ut=!1,B}function ir(m,P,B){var X=P.updateQueue;if(X=X!==null?X.lastEffect:null,X!==null){var re=X=X.next;do{if((re.tag&m)===m){var le=re.destroy;re.destroy=void 0,le!==void 0&&pt(P,B,le)}re=re.next}while(re!==X)}}function Mt(m,P){if(P=P.updateQueue,P=P!==null?P.lastEffect:null,P!==null){var B=P=P.next;do{if((B.tag&m)===m){var X=B.create;B.destroy=X()}B=B.next}while(B!==P)}}function Fr(m){var P=m.ref;if(P!==null){var B=m.stateNode;switch(m.tag){case 5:m=W(B);break;default:m=B}typeof P=="function"?P(m):P.current=m}}function qr(m){var P=m.alternate;P!==null&&(m.alternate=null,qr(P)),m.child=null,m.deletions=null,m.sibling=null,m.tag===5&&(P=m.stateNode,P!==null&&He(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 Rr(m){return m.tag===5||m.tag===3||m.tag===4}function yr(m){e:for(;;){for(;m.sibling===null;){if(m.return===null||Rr(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 Xr(m,P,B){var X=m.tag;if(X===5||X===6)m=m.stateNode,P?or(B,m,P):Et(B,m);else if(X!==4&&(m=m.child,m!==null))for(Xr(m,P,B),m=m.sibling;m!==null;)Xr(m,P,B),m=m.sibling}function Qr(m,P,B){var X=m.tag;if(X===5||X===6)m=m.stateNode,P?Ct(B,m,P):mt(B,m);else if(X!==4&&(m=m.child,m!==null))for(Qr(m,P,B),m=m.sibling;m!==null;)Qr(m,P,B),m=m.sibling}var Zt=null,zr=!1;function Ln(m,P,B){for(B=B.child;B!==null;)Dn(m,P,B),B=B.sibling}function Dn(m,P,B){if(ai&&typeof ai.onCommitFiberUnmount=="function")try{ai.onCommitFiberUnmount(uo,B)}catch{}switch(B.tag){case 5:Me||ct(B,P);case 6:if(me){var X=Zt,re=zr;Zt=null,Ln(m,P,B),Zt=X,zr=re,Zt!==null&&(zr?qe(Zt,B.stateNode):Xt(Zt,B.stateNode))}else Ln(m,P,B);break;case 18:me&&Zt!==null&&(zr?Go(Zt,B.stateNode):ws(Zt,B.stateNode));break;case 4:me?(X=Zt,re=zr,Zt=B.stateNode.containerInfo,zr=!0,Ln(m,P,B),Zt=X,zr=re):(xe&&(X=B.stateNode.containerInfo,re=_t(X),Ve(X,re)),Ln(m,P,B));break;case 0:case 11:case 14:case 15:if(!Me&&(X=B.updateQueue,X!==null&&(X=X.lastEffect,X!==null))){re=X=X.next;do{var le=re,_e=le.destroy;le=le.tag,_e!==void 0&&((le&2)!==0||(le&4)!==0)&&pt(B,P,_e),re=re.next}while(re!==X)}Ln(m,P,B);break;case 1:if(!Me&&(ct(B,P),X=B.stateNode,typeof X.componentWillUnmount=="function"))try{X.props=B.memoizedProps,X.state=B.memoizedState,X.componentWillUnmount()}catch(Ke){Vn(B,P,Ke)}Ln(m,P,B);break;case 21:Ln(m,P,B);break;case 22:B.mode&1?(Me=(X=Me)||B.memoizedState!==null,Ln(m,P,B),Me=X):Ln(m,P,B);break;default:Ln(m,P,B)}}function ci(m){var P=m.updateQueue;if(P!==null){m.updateQueue=null;var B=m.stateNode;B===null&&(B=m.stateNode=new ze),P.forEach(function(X){var re=d0.bind(null,m,X);B.has(X)||(B.add(X),X.then(re,re))})}}function xr(m,P){var B=P.deletions;if(B!==null)for(var X=0;X<B.length;X++){var re=B[X];try{var le=m,_e=P;if(me){var Ke=_e;e:for(;Ke!==null;){switch(Ke.tag){case 5:Zt=Ke.stateNode,zr=!1;break e;case 3:Zt=Ke.stateNode.containerInfo,zr=!0;break e;case 4:Zt=Ke.stateNode.containerInfo,zr=!0;break e}Ke=Ke.return}if(Zt===null)throw Error(o(160));Dn(le,_e,re),Zt=null,zr=!1}else Dn(le,_e,re);var ut=re.alternate;ut!==null&&(ut.return=null),re.return=null}catch(Lt){Vn(re,P,Lt)}}if(P.subtreeFlags&12854)for(P=P.child;P!==null;)Gi(P,m),P=P.sibling}function Gi(m,P){var B=m.alternate,X=m.flags;switch(m.tag){case 0:case 11:case 14:case 15:if(xr(P,m),En(m),X&4){try{ir(3,m,m.return),Mt(3,m)}catch(Ht){Vn(m,m.return,Ht)}try{ir(5,m,m.return)}catch(Ht){Vn(m,m.return,Ht)}}break;case 1:xr(P,m),En(m),X&512&&B!==null&&ct(B,B.return);break;case 5:if(xr(P,m),En(m),X&512&&B!==null&&ct(B,B.return),me){if(m.flags&32){var re=m.stateNode;try{We(re)}catch(Ht){Vn(m,m.return,Ht)}}if(X&4&&(re=m.stateNode,re!=null)){var le=m.memoizedProps;if(B=B!==null?B.memoizedProps:le,X=m.type,P=m.updateQueue,m.updateQueue=null,P!==null)try{qt(re,P,X,B,le,m)}catch(Ht){Vn(m,m.return,Ht)}}}break;case 6:if(xr(P,m),En(m),X&4&&me){if(m.stateNode===null)throw Error(o(162));re=m.stateNode,le=m.memoizedProps,B=B!==null?B.memoizedProps:le;try{nt(re,B,le)}catch(Ht){Vn(m,m.return,Ht)}}break;case 3:if(xr(P,m),En(m),X&4){if(me&&Oe&&B!==null&&B.memoizedState.isDehydrated)try{Si(P.containerInfo)}catch(Ht){Vn(m,m.return,Ht)}if(xe){re=P.containerInfo,le=P.pendingChildren;try{Ve(re,le)}catch(Ht){Vn(m,m.return,Ht)}}}break;case 4:if(xr(P,m),En(m),X&4&&xe){le=m.stateNode,re=le.containerInfo,le=le.pendingChildren;try{Ve(re,le)}catch(Ht){Vn(m,m.return,Ht)}}break;case 13:xr(P,m),En(m),re=m.child,re.flags&8192&&(le=re.memoizedState!==null,re.stateNode.isHidden=le,!le||re.alternate!==null&&re.alternate.memoizedState!==null||(wu=In())),X&4&&ci(m);break;case 22:var _e=B!==null&&B.memoizedState!==null;if(m.mode&1?(Me=(B=Me)||_e,xr(P,m),Me=B):xr(P,m),En(m),X&8192){if(B=m.memoizedState!==null,(m.stateNode.isHidden=B)&&!_e&&(m.mode&1)!==0)for(Ge=m,X=m.child;X!==null;){for(P=Ge=X;Ge!==null;){_e=Ge;var Ke=_e.child;switch(_e.tag){case 0:case 11:case 14:case 15:ir(4,_e,_e.return);break;case 1:ct(_e,_e.return);var ut=_e.stateNode;if(typeof ut.componentWillUnmount=="function"){var Lt=_e,Kt=_e.return;try{var br=Lt;ut.props=br.memoizedProps,ut.state=br.memoizedState,ut.componentWillUnmount()}catch(Ht){Vn(Lt,Kt,Ht)}}break;case 5:ct(_e,_e.return);break;case 22:if(_e.memoizedState!==null){ga(P);continue}}Ke!==null?(Ke.return=_e,Ge=Ke):ga(P)}X=X.sibling}if(me){e:if(X=null,me)for(P=m;;){if(P.tag===5){if(X===null){X=P;try{re=P.stateNode,B?Nt(re):gt(P.stateNode,P.memoizedProps)}catch(Ht){Vn(m,m.return,Ht)}}}else if(P.tag===6){if(X===null)try{le=P.stateNode,B?ht(le):wt(le,P.memoizedProps)}catch(Ht){Vn(m,m.return,Ht)}}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;X===P&&(X=null),P=P.return}X===P&&(X=null),P.sibling.return=P.return,P=P.sibling}}}break;case 19:xr(P,m),En(m),X&4&&ci(m);break;case 21:break;default:xr(P,m),En(m)}}function En(m){var P=m.flags;if(P&2){try{if(me){e:{for(var B=m.return;B!==null;){if(Rr(B)){var X=B;break e}B=B.return}throw Error(o(160))}switch(X.tag){case 5:var re=X.stateNode;X.flags&32&&(We(re),X.flags&=-33);var le=yr(m);Qr(m,le,re);break;case 3:case 4:var _e=X.stateNode.containerInfo,Ke=yr(m);Xr(m,Ke,_e);break;default:throw Error(o(161))}}}catch(ut){Vn(m,m.return,ut)}m.flags&=-3}P&4096&&(m.flags&=-4097)}function Bn(m,P,B){Ge=m,fi(m)}function fi(m,P,B){for(var X=(m.mode&1)!==0;Ge!==null;){var re=Ge,le=re.child;if(re.tag===22&&X){var _e=re.memoizedState!==null||lt;if(!_e){var Ke=re.alternate,ut=Ke!==null&&Ke.memoizedState!==null||Me;Ke=lt;var Lt=Me;if(lt=_e,(Me=ut)&&!Lt)for(Ge=re;Ge!==null;)_e=Ge,ut=_e.child,_e.tag===22&&_e.memoizedState!==null?Ya(re):ut!==null?(ut.return=_e,Ge=ut):Ya(re);for(;le!==null;)Ge=le,fi(le),le=le.sibling;Ge=re,lt=Ke,Me=Lt}Oi(m)}else(re.subtreeFlags&8772)!==0&&le!==null?(le.return=re,Ge=le):Oi(m)}}function Oi(m){for(;Ge!==null;){var P=Ge;if((P.flags&8772)!==0){var B=P.alternate;try{if((P.flags&8772)!==0)switch(P.tag){case 0:case 11:case 15:Me||Mt(5,P);break;case 1:var X=P.stateNode;if(P.flags&4&&!Me)if(B===null)X.componentDidMount();else{var re=P.elementType===P.type?B.memoizedProps:$a(P.type,B.memoizedProps);X.componentDidUpdate(re,B.memoizedState,X.__reactInternalSnapshotBeforeUpdate)}var le=P.updateQueue;le!==null&&Hu(P,le,X);break;case 3:var _e=P.updateQueue;if(_e!==null){if(B=null,P.child!==null)switch(P.child.tag){case 5:B=W(P.child.stateNode);break;case 1:B=P.child.stateNode}Hu(P,_e,B)}break;case 5:var Ke=P.stateNode;B===null&&P.flags&4&&at(Ke,P.type,P.memoizedProps,P);break;case 6:break;case 4:break;case 12:break;case 13:if(Oe&&P.memoizedState===null){var ut=P.alternate;if(ut!==null){var Lt=ut.memoizedState;if(Lt!==null){var Kt=Lt.dehydrated;Kt!==null&&fa(Kt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Me||P.flags&512&&Fr(P)}catch(br){Vn(P,P.return,br)}}if(P===m){Ge=null;break}if(B=P.sibling,B!==null){B.return=P.return,Ge=B;break}Ge=P.return}}function ga(m){for(;Ge!==null;){var P=Ge;if(P===m){Ge=null;break}var B=P.sibling;if(B!==null){B.return=P.return,Ge=B;break}Ge=P.return}}function Ya(m){for(;Ge!==null;){var P=Ge;try{switch(P.tag){case 0:case 11:case 15:var B=P.return;try{Mt(4,P)}catch(ut){Vn(P,B,ut)}break;case 1:var X=P.stateNode;if(typeof X.componentDidMount=="function"){var re=P.return;try{X.componentDidMount()}catch(ut){Vn(P,re,ut)}}var le=P.return;try{Fr(P)}catch(ut){Vn(P,le,ut)}break;case 5:var _e=P.return;try{Fr(P)}catch(ut){Vn(P,_e,ut)}}}catch(ut){Vn(P,P.return,ut)}if(P===m){Ge=null;break}var Ke=P.sibling;if(Ke!==null){Ke.return=P.return,Ge=Ke;break}Ge=P.return}}var yn=0,qn=1,oa=2,Do=3,vo=4;if(typeof Symbol=="function"&&Symbol.for){var Dr=Symbol.for;yn=Dr("selector.component"),qn=Dr("selector.has_pseudo_class"),oa=Dr("selector.role"),Do=Dr("selector.test_id"),vo=Dr("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=Ne(m),m===null)throw Error(o(362));return m.stateNode.current}function yu(m,P){switch(P.$$typeof){case yn:if(m.type===P.value)return!0;break;case qn:e:{P=P.value,m=[m,0];for(var B=0;B<m.length;){var X=m[B++],re=m[B++],le=P[re];if(X.tag!==5||!Ce(X)){for(;le!=null&&yu(X,le);)re++,le=P[re];if(re===P.length){P=!0;break e}else for(X=X.child;X!==null;)m.push(X,re),X=X.sibling}}P=!1}return P;case oa:if(m.tag===5&&De(m.stateNode,P.value))return!0;break;case vo:if((m.tag===5||m.tag===6)&&(m=Le(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 yn:return"<"+(T(m.value)||"Unknown")+">";case qn: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 B=[];m=[m,0];for(var X=0;X<m.length;){var re=m[X++],le=m[X++],_e=P[le];if(re.tag!==5||!Ce(re)){for(;_e!=null&&yu(re,_e);)le++,_e=P[le];if(le===P.length)B.push(re);else for(re=re.child;re!==null;)m.push(re,le),re=re.sibling}}return B}function Aa(m,P){if(!Ee)throw Error(o(363));m=mo(m),m=Xa(m,P),P=[],m=Array.from(m);for(var B=0;B<m.length;){var X=m[B++];if(X.tag===5)Ce(X)||P.push(X.stateNode);else for(X=X.child;X!==null;)m.push(X),X=X.sibling}return P}var kl=Math.ceil,va=l.ReactCurrentDispatcher,Bo=l.ReactCurrentOwner,vn=l.ReactCurrentBatchConfig,vr=0,Jr=null,Pn=null,Nn=0,ti=0,qo=pi(0),fn=0,bu=null,Ns=0,hn=0,Ka=0,Ll=null,sa=null,wu=0,_u=1/0,Ai=null;function on(){_u=In()+500}var zn=!1,Un=null,Za=null,yo=!1,Qa=null,Sc=0,Hn=0,Su=null,al=-1,Ja=0;function bn(){return(vr&6)!==0?In():al!==-1?al:al=In()}function hi(m){return(m.mode&1)===0?1:(vr&2)!==0&&Nn!==0?Nn&-Nn:Je.transition!==null?(Ja===0&&(Ja=xs()),Ja):(m=It,m!==0?m:ve())}function la(m,P,B,X){if(50<Hn)throw Hn=0,Su=null,Error(o(185));gn(m,B,X),((vr&2)===0||m!==Jr)&&(m===Jr&&((vr&2)===0&&(hn|=B),fn===4&&os(m,Nn)),Wi(m,X),B===1&&vr===0&&(P.mode&1)===0&&(on(),Ao&&oi()))}function Wi(m,P){var B=m.callbackNode;$o(m,P);var X=Ws(m,m===Jr?Nn:0);if(X===0)B!==null&&Oo(B),m.callbackNode=null,m.callbackPriority=0;else if(P=X&-X,m.callbackPriority!==P){if(B!=null&&Oo(B),P===1)m.tag===0?Uu(ff.bind(null,m)):gl(ff.bind(null,m)),we?Ae(function(){(vr&6)===0&&oi()}):lo(Xs,oi),B=null;else{switch($s(X)){case 1:B=Xs;break;case 4:B=au;break;case 16:B=ou;break;case 536870912:B=of;break;default:B=ou}B=zh(B,Ts.bind(null,m))}m.callbackPriority=P,m.callbackNode=B}}function Ts(m,P){if(al=-1,Ja=0,(vr&6)!==0)throw Error(o(327));var B=m.callbackNode;if(Tl()&&m.callbackNode!==B)return null;var X=Ws(m,m===Jr?Nn:0);if(X===0)return null;if((X&30)!==0||(X&m.expiredLanes)!==0||P)P=ls(m,X);else{P=X;var re=vr;vr|=2;var le=ss();(Jr!==m||Nn!==P)&&(Ai=null,on(),zo(m,P));do try{Pc();break}catch(Ke){Ca(m,Ke)}while(!0);Ua(),va.current=le,vr=re,Pn!==null?P=0:(Jr=null,Nn=0,P=fn)}if(P!==0){if(P===2&&(re=Ss(m),re!==0&&(X=re,P=xc(m,re))),P===1)throw B=bu,zo(m,0),os(m,X),Wi(m,In()),B;if(P===6)os(m,X);else{if(re=m.current.alternate,(X&30)===0&&!$f(re)&&(P=ls(m,X),P===2&&(le=Ss(m),le!==0&&(X=le,P=xc(m,le))),P===1))throw B=bu,zo(m,0),os(m,X),Wi(m,In()),B;switch(m.finishedWork=re,m.finishedLanes=X,P){case 0:case 1:throw Error(o(345));case 2:us(m,sa,Ai);break;case 3:if(os(m,X),(X&130023424)===X&&(P=wu+500-In(),10<P)){if(Ws(m,0)!==0)break;if(re=m.suspendedLanes,(re&X)!==X){bn(),m.pingedLanes|=m.suspendedLanes&re;break}m.timeoutHandle=ee(us.bind(null,m,sa,Ai),P);break}us(m,sa,Ai);break;case 4:if(os(m,X),(X&4194240)===X)break;for(P=m.eventTimes,re=-1;0<X;){var _e=31-da(X);le=1<<_e,_e=P[_e],_e>re&&(re=_e),X&=~le}if(X=re,X=In()-X,X=(120>X?120:480>X?480:1080>X?1080:1920>X?1920:3e3>X?3e3:4320>X?4320:1960*kl(X/1960))-X,10<X){m.timeoutHandle=ee(us.bind(null,m,sa,Ai),X);break}us(m,sa,Ai);break;case 5:us(m,sa,Ai);break;default:throw Error(o(329))}}}return Wi(m,In()),m.callbackNode===B?Ts.bind(null,m):null}function xc(m,P){var B=Ll;return m.current.memoizedState.isDehydrated&&(zo(m,P).flags|=256),m=ls(m,P),m!==2&&(P=sa,sa=B,P!==null&&Ku(P)),m}function Ku(m){sa===null?sa=m:sa.push.apply(sa,m)}function $f(m){for(var P=m;;){if(P.flags&16384){var B=P.updateQueue;if(B!==null&&(B=B.stores,B!==null))for(var X=0;X<B.length;X++){var re=B[X],le=re.getSnapshot;re=re.value;try{if(!Mi(le(),re))return!1}catch{return!1}}}if(B=P.child,P.subtreeFlags&16384&&B!==null)B.return=P,P=B;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&=~hn,m.suspendedLanes|=P,m.pingedLanes&=~P,m=m.expirationTimes;0<P;){var B=31-da(P),X=1<<B;m[B]=-1,P&=~X}}function ff(m){if((vr&6)!==0)throw Error(o(327));Tl();var P=Ws(m,0);if((P&1)===0)return Wi(m,In()),null;var B=ls(m,P);if(m.tag!==0&&B===2){var X=Ss(m);X!==0&&(P=X,B=xc(m,X))}if(B===1)throw B=bu,zo(m,0),os(m,P),Wi(m,In()),B;if(B===6)throw Error(o(345));return m.finishedWork=m.current.alternate,m.finishedLanes=P,us(m,sa,Ai),Wi(m,In()),null}function Nl(m){Qa!==null&&Qa.tag===0&&(vr&6)===0&&Tl();var P=vr;vr|=1;var B=vn.transition,X=It;try{if(vn.transition=null,It=1,m)return m()}finally{It=X,vn.transition=B,vr=P,(vr&6)===0&&oi()}}function xu(){ti=qo.current,Kr(qo)}function zo(m,P){m.finishedWork=null,m.finishedLanes=0;var B=m.timeoutHandle;if(B!==se&&(m.timeoutHandle=se,ae(B)),Pn!==null)for(B=Pn.return;B!==null;){var X=B;switch(Ks(X),X.tag){case 1:X=X.type.childContextTypes,X!=null&&Ri();break;case 3:li(),Kr(Ti),Kr(gi),ko();break;case 5:es(X);break;case 4:li();break;case 13:Kr($r);break;case 19:Kr($r);break;case 10:Pa(X.type._context);break;case 22:case 23:xu()}B=B.return}if(Jr=m,Pn=m=Eu(m.current,null),Nn=ti=P,fn=0,bu=null,Ka=hn=Ns=0,sa=Ll=null,Ha!==null){for(P=0;P<Ha.length;P++)if(B=Ha[P],X=B.interleaved,X!==null){B.interleaved=null;var re=X.next,le=B.pending;if(le!==null){var _e=le.next;le.next=re,X.next=_e}B.pending=X}Ha=null}return m}function Ca(m,P){do{var B=Pn;try{if(Ua(),jr.current=ks,ts){for(var X=Tr.memoizedState;X!==null;){var re=X.queue;re!==null&&(re.pending=null),X=X.next}ts=!1}if(Yn=0,Xn=xn=Tr=null,No=!1,To=0,Bo.current=null,B===null||B.return===null){fn=1,bu=P,Pn=null;break}e:{var le=m,_e=B.return,Ke=B,ut=P;if(P=Nn,Ke.flags|=32768,ut!==null&&typeof ut=="object"&&typeof ut.then=="function"){var Lt=ut,Kt=Ke,br=Kt.tag;if((Kt.mode&1)===0&&(br===0||br===11||br===15)){var Ht=Kt.alternate;Ht?(Kt.updateQueue=Ht.updateQueue,Kt.memoizedState=Ht.memoizedState,Kt.lanes=Ht.lanes):(Kt.updateQueue=null,Kt.memoizedState=null)}var Tn=Gf(_e);if(Tn!==null){Tn.flags&=-257,Ls(Tn,_e,Ke,le,P),Tn.mode&1&&Vf(le,Lt,P),P=Tn,ut=Lt;var mn=P.updateQueue;if(mn===null){var to=new Set;to.add(ut),P.updateQueue=to}else mn.add(ut);break e}else{if((P&1)===0){Vf(le,Lt,P),eo();break e}ut=Error(o(426))}}else if(tn&&Ke.mode&1){var ol=Gf(_e);if(ol!==null){(ol.flags&65536)===0&&(ol.flags|=256),Ls(ol,_e,Ke,le,P),Ie(Hi(ut,Ke));break e}}le=ut=Hi(ut,Ke),fn!==4&&(fn=2),Ll===null?Ll=[le]:Ll.push(le),le=_e;do{switch(le.tag){case 3:le.flags|=65536,P&=-P,le.lanes|=P;var ot=Vi(le,ut,P);el(le,ot);break e;case 1:Ke=ut;var Ze=le.type,dt=le.stateNode;if((le.flags&128)===0&&(typeof Ze.getDerivedStateFromError=="function"||dt!==null&&typeof dt.componentDidCatch=="function"&&(Za===null||!Za.has(dt)))){le.flags|=65536,P&=-P,le.lanes|=P;var Gt=pa(le,Ke,P);el(le,Gt);break e}}le=le.return}while(le!==null)}Zu(B)}catch(ur){P=ur,Pn===B&&B!==null&&(Pn=B=B.return);continue}break}while(!0)}function ss(){var m=va.current;return va.current=ks,m===null?ks:m}function eo(){(fn===0||fn===3||fn===2)&&(fn=4),Jr===null||(Ns&268435455)===0&&(hn&268435455)===0||os(Jr,Nn)}function ls(m,P){var B=vr;vr|=2;var X=ss();(Jr!==m||Nn!==P)&&(Ai=null,zo(m,P));do try{Ec();break}catch(re){Ca(m,re)}while(!0);if(Ua(),vr=B,va.current=X,Pn!==null)throw Error(o(261));return Jr=null,Nn=0,fn}function Ec(){for(;Pn!==null;)hf(Pn)}function Pc(){for(;Pn!==null&&!zu();)hf(Pn)}function hf(m){var P=Mp(m.alternate,m,ti);m.memoizedProps=m.pendingProps,P===null?Zu(m):Pn=P,Bo.current=null}function Zu(m){var P=m;do{var B=P.alternate;if(m=P.return,(P.flags&32768)===0){if(B=Ye(B,P,ti),B!==null){Pn=B;return}}else{if(B=yt(B,P),B!==null){B.flags&=32767,Pn=B;return}if(m!==null)m.flags|=32768,m.subtreeFlags=0,m.deletions=null;else{fn=6,Pn=null;return}}if(P=P.sibling,P!==null){Pn=P;return}Pn=P=m}while(P!==null);fn===0&&(fn=5)}function us(m,P,B){var X=It,re=vn.transition;try{vn.transition=null,It=1,Lp(m,P,B,X)}finally{vn.transition=re,It=X}return null}function Lp(m,P,B,X){do Tl();while(Qa!==null);if((vr&6)!==0)throw Error(o(327));B=m.finishedWork;var re=m.finishedLanes;if(B===null)return null;if(m.finishedWork=null,m.finishedLanes=0,B===m.current)throw Error(o(177));m.callbackNode=null,m.callbackPriority=0;var le=B.lanes|B.childLanes;if(Yo(m,le),m===Jr&&(Pn=Jr=null,Nn=0),(B.subtreeFlags&2064)===0&&(B.flags&2064)===0||yo||(yo=!0,zh(ou,function(){return Tl(),null})),le=(B.flags&15990)!==0,(B.subtreeFlags&15990)!==0||le){le=vn.transition,vn.transition=null;var _e=It;It=1;var Ke=vr;vr|=4,Bo.current=null,jt(m,B),Gi(B,m),V(m.containerInfo),m.current=B,Bn(B),Ys(),vr=Ke,It=_e,vn.transition=le}else m.current=B;if(yo&&(yo=!1,Qa=m,Sc=re),le=m.pendingLanes,le===0&&(Za=null),Da(B.stateNode),Wi(m,In()),P!==null)for(X=m.onRecoverableError,B=0;B<P.length;B++)re=P[B],X(re.value,{componentStack:re.stack,digest:re.digest});if(zn)throw zn=!1,m=Un,Un=null,m;return(Sc&1)!==0&&m.tag!==0&&Tl(),le=m.pendingLanes,(le&1)!==0?m===Su?Hn++:(Hn=0,Su=m):Hn=0,oi(),null}function Tl(){if(Qa!==null){var m=$s(Sc),P=vn.transition,B=It;try{if(vn.transition=null,It=16>m?16:m,Qa===null)var X=!1;else{if(m=Qa,Qa=null,Sc=0,(vr&6)!==0)throw Error(o(331));var re=vr;for(vr|=4,Ge=m.current;Ge!==null;){var le=Ge,_e=le.child;if((Ge.flags&16)!==0){var Ke=le.deletions;if(Ke!==null){for(var ut=0;ut<Ke.length;ut++){var Lt=Ke[ut];for(Ge=Lt;Ge!==null;){var Kt=Ge;switch(Kt.tag){case 0:case 11:case 15:ir(8,Kt,le)}var br=Kt.child;if(br!==null)br.return=Kt,Ge=br;else for(;Ge!==null;){Kt=Ge;var Ht=Kt.sibling,Tn=Kt.return;if(qr(Kt),Kt===Lt){Ge=null;break}if(Ht!==null){Ht.return=Tn,Ge=Ht;break}Ge=Tn}}}var mn=le.alternate;if(mn!==null){var to=mn.child;if(to!==null){mn.child=null;do{var ol=to.sibling;to.sibling=null,to=ol}while(to!==null)}}Ge=le}}if((le.subtreeFlags&2064)!==0&&_e!==null)_e.return=le,Ge=_e;else e:for(;Ge!==null;){if(le=Ge,(le.flags&2048)!==0)switch(le.tag){case 0:case 11:case 15:ir(9,le,le.return)}var ot=le.sibling;if(ot!==null){ot.return=le.return,Ge=ot;break e}Ge=le.return}}var Ze=m.current;for(Ge=Ze;Ge!==null;){_e=Ge;var dt=_e.child;if((_e.subtreeFlags&2064)!==0&&dt!==null)dt.return=_e,Ge=dt;else e:for(_e=Ze;Ge!==null;){if(Ke=Ge,(Ke.flags&2048)!==0)try{switch(Ke.tag){case 0:case 11:case 15:Mt(9,Ke)}}catch(ur){Vn(Ke,Ke.return,ur)}if(Ke===_e){Ge=null;break e}var Gt=Ke.sibling;if(Gt!==null){Gt.return=Ke.return,Ge=Gt;break e}Ge=Ke.return}}if(vr=re,oi(),ai&&typeof ai.onPostCommitFiberRoot=="function")try{ai.onPostCommitFiberRoot(uo,m)}catch{}X=!0}return X}finally{It=B,vn.transition=P}}return!1}function qh(m,P,B){P=Hi(B,P),P=Vi(m,P,1),m=Va(m,P,1),P=bn(),m!==null&&(gn(m,1,P),Wi(m,P))}function Vn(m,P,B){if(m.tag===3)qh(m,m,B);else for(;P!==null;){if(P.tag===3){qh(P,m,B);break}else if(P.tag===1){var X=P.stateNode;if(typeof P.type.getDerivedStateFromError=="function"||typeof X.componentDidCatch=="function"&&(Za===null||!Za.has(X))){m=Hi(B,m),m=pa(P,m,1),P=Va(P,m,1),m=bn(),P!==null&&(gn(P,1,m),Wi(P,m));break}}P=P.return}}function Np(m,P,B){var X=m.pingCache;X!==null&&X.delete(P),P=bn(),m.pingedLanes|=m.suspendedLanes&B,Jr===m&&(Nn&B)===B&&(fn===4||fn===3&&(Nn&130023424)===Nn&&500>In()-wu?zo(m,0):Ka|=B),Wi(m,P)}function Tp(m,P){P===0&&((m.mode&1)===0?P=1:(P=_s,_s<<=1,(_s&130023424)===0&&(_s=4194304)));var B=bn();m=ra(m,P),m!==null&&(gn(m,P,B),Wi(m,B))}function Rp(m){var P=m.memoizedState,B=0;P!==null&&(B=P.retryLane),Tp(m,B)}function d0(m,P){var B=0;switch(m.tag){case 13:var X=m.stateNode,re=m.memoizedState;re!==null&&(B=re.retryLane);break;case 19:X=m.stateNode;break;default:throw Error(o(314))}X!==null&&X.delete(P),Tp(m,B)}var Mp;Mp=function(m,P,B){if(m!==null)if(m.memoizedProps!==P.pendingProps||Ti.current)ui=!0;else{if((m.lanes&B)===0&&(P.flags&128)===0)return ui=!1,oe(m,P,B);ui=(m.flags&131072)!==0}else ui=!1,tn&&(P.flags&1048576)!==0&&lu(P,xa,P.index);switch(P.lanes=0,P.tag){case 2:var X=P.type;U(m,P),m=P.pendingProps;var re=ja(P,gi.current);Qo(P,B),re=Ro(null,P,X,m,re,B);var le=Mo();return P.flags|=1,typeof re=="object"&&re!==null&&typeof re.render=="function"&&re.$$typeof===void 0?(P.tag=1,P.memoizedState=null,P.updateQueue=null,ii(X)?(le=!0,Wo(P)):le=!1,P.memoizedState=re.state!==null&&re.state!==void 0?re.state:null,Js(P),re.updater=$u,P.stateNode=re,re._reactInternals=P,Ui(P,X,m,B),P=ia(null,P,X,!0,le,B)):(P.tag=0,tn&&le&&Os(P),wi(null,P,re,B),P=P.child),P;case 16:X=P.elementType;e:{switch(U(m,P),m=P.pendingProps,re=X._init,X=re(X._payload),P.type=X,re=P.tag=p0(X),m=$a(X,m),re){case 0:P=ns(null,P,X,m,B);break e;case 1:P=Pi(null,P,X,m,B);break e;case 11:P=_c(null,P,X,m,B);break e;case 14:P=rs(null,P,X,$a(X.type,m),B);break e}throw Error(o(306,X,""))}return P;case 0:return X=P.type,re=P.pendingProps,re=P.elementType===X?re:$a(X,re),ns(m,P,X,re,B);case 1:return X=P.type,re=P.pendingProps,re=P.elementType===X?re:$a(X,re),Pi(m,P,X,re,B);case 3:e:{if(il(P),m===null)throw Error(o(387));X=P.pendingProps,le=P.memoizedState,re=le.element,wl(m,P),co(P,X,null,B);var _e=P.memoizedState;if(X=_e.element,Oe&&le.isDehydrated)if(le={element:X,isDehydrated:!1,cache:_e.cache,pendingSuspenseBoundaries:_e.pendingSuspenseBoundaries,transitions:_e.transitions},P.updateQueue.baseState=le,P.memoizedState=le,P.flags&256){re=Hi(Error(o(423)),P),P=Al(m,P,X,B,re);break e}else if(X!==re){re=Hi(Error(o(424)),P),P=Al(m,P,X,B,re);break e}else for(Oe&&(vi=Nr(P.stateNode.containerInfo),$n=P,tn=!0,za=null,Zs=!1),B=Cn(P,null,X,B),P.child=B;B;)B.flags=B.flags&-3|4096,B=B.sibling;else{if(ke(),X===re){P=te(m,P,B);break e}wi(m,P,X,B)}P=P.child}return P;case 5:return qi(P),m===null&&Ko(P),X=P.type,re=P.pendingProps,le=m!==null?m.memoizedProps:null,_e=re.children,ne(X,re)?_e=null:le!==null&&ne(X,le)&&(P.flags|=32),an(m,P),wi(m,P,_e,B),P.child;case 6:return m===null&&Ko(P),null;case 13:return cf(m,P,B);case 4:return Jo(P,P.stateNode.containerInfo),X=P.pendingProps,m===null?P.child=Sr(P,null,X,B):wi(m,P,X,B),P.child;case 11:return X=P.type,re=P.pendingProps,re=P.elementType===X?re:$a(X,re),_c(m,P,X,re,B);case 7:return wi(m,P,P.pendingProps,B),P.child;case 8:return wi(m,P,P.pendingProps.children,B),P.child;case 12:return wi(m,P,P.pendingProps.children,B),P.child;case 10:e:{if(X=P.type._context,re=P.pendingProps,le=P.memoizedProps,_e=re.value,Ea(P,X,_e),le!==null)if(Mi(le.value,_e)){if(le.children===re.children&&!Ti.current){P=te(m,P,B);break e}}else for(le=P.child,le!==null&&(le.return=P);le!==null;){var Ke=le.dependencies;if(Ke!==null){_e=le.child;for(var ut=Ke.firstContext;ut!==null;){if(ut.context===X){if(le.tag===1){ut=Oa(-1,B&-B),ut.tag=2;var Lt=le.updateQueue;if(Lt!==null){Lt=Lt.shared;var Kt=Lt.pending;Kt===null?ut.next=ut:(ut.next=Kt.next,Kt.next=ut),Lt.pending=ut}}le.lanes|=B,ut=le.alternate,ut!==null&&(ut.lanes|=B),Zo(le.return,B,P),Ke.lanes|=B;break}ut=ut.next}}else if(le.tag===10)_e=le.type===P.type?null:le.child;else if(le.tag===18){if(_e=le.return,_e===null)throw Error(o(341));_e.lanes|=B,Ke=_e.alternate,Ke!==null&&(Ke.lanes|=B),Zo(_e,B,P),_e=le.sibling}else _e=le.child;if(_e!==null)_e.return=le;else for(_e=le;_e!==null;){if(_e===P){_e=null;break}if(le=_e.sibling,le!==null){le.return=_e.return,_e=le;break}_e=_e.return}le=_e}wi(m,P,re.children,B),P=P.child}return P;case 9:return re=P.type,X=P.pendingProps.children,Qo(P,B),re=Di(re),X=X(re),P.flags|=1,wi(m,P,X,B),P.child;case 14:return X=P.type,re=$a(X,P.pendingProps),re=$a(X.type,re),rs(m,P,X,re,B);case 15:return go(m,P,P.type,P.pendingProps,B);case 17:return X=P.type,re=P.pendingProps,re=P.elementType===X?re:$a(X,re),U(m,P),P.tag=1,ii(X)?(m=!0,Wo(P)):m=!1,Qo(P,B),Hf(P,X,re),Ui(P,X,re,B),ia(null,P,X,!0,m,B);case 19:return R(m,P,B);case 22:return Zr(m,P,B)}throw Error(o(156,P.tag))};function zh(m,P){return lo(m,P)}function Ip(m,P,B,X){this.tag=m,this.key=B,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=X,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Uo(m,P,B,X){return new Ip(m,P,B,X)}function Oc(m){return m=m.prototype,!(!m||!m.isReactComponent)}function p0(m){if(typeof m=="function")return Oc(m)?1:0;if(m!=null){if(m=m.$$typeof,m===E)return 11;if(m===g)return 14}return 2}function Eu(m,P){var B=m.alternate;return B===null?(B=Uo(m.tag,P,m.key,m.mode),B.elementType=m.elementType,B.type=m.type,B.stateNode=m.stateNode,B.alternate=m,m.alternate=B):(B.pendingProps=P,B.type=m.type,B.flags=0,B.subtreeFlags=0,B.deletions=null),B.flags=m.flags&14680064,B.childLanes=m.childLanes,B.lanes=m.lanes,B.child=m.child,B.memoizedProps=m.memoizedProps,B.memoizedState=m.memoizedState,B.updateQueue=m.updateQueue,P=m.dependencies,B.dependencies=P===null?null:{lanes:P.lanes,firstContext:P.firstContext},B.sibling=m.sibling,B.index=m.index,B.ref=m.ref,B}function Yf(m,P,B,X,re,le){var _e=2;if(X=m,typeof m=="function")Oc(m)&&(_e=1);else if(typeof m=="string")_e=5;else e:switch(m){case h:return ma(B.children,re,le,P);case p:_e=8,re|=8;break;case w:return m=Uo(12,B,P,re|2),m.elementType=w,m.lanes=le,m;case S:return m=Uo(13,B,P,re),m.elementType=S,m.lanes=le,m;case y:return m=Uo(19,B,P,re),m.elementType=y,m.lanes=le,m;case b:return Ac(B,re,le,P);default:if(typeof m=="object"&&m!==null)switch(m.$$typeof){case d:_e=10;break e;case _:_e=9;break e;case E:_e=11;break e;case g:_e=14;break e;case v:_e=16,X=null;break e}throw Error(o(130,m==null?m:typeof m,""))}return P=Uo(_e,B,P,re),P.elementType=m,P.type=X,P.lanes=le,P}function ma(m,P,B,X){return m=Uo(7,m,X,P),m.lanes=B,m}function Ac(m,P,B,X){return m=Uo(22,m,X,P),m.elementType=b,m.lanes=B,m.stateNode={isHidden:!1},m}function Cc(m,P,B){return m=Uo(6,m,null,P),m.lanes=B,m}function Xf(m,P,B){return P=Uo(4,m.children!==null?m.children:[],m.key,P),P.lanes=B,P.stateNode={containerInfo:m.containerInfo,pendingChildren:null,implementation:m.implementation},P}function jp(m,P,B,X,re){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=Es(0),this.expirationTimes=Es(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Es(0),this.identifierPrefix=X,this.onRecoverableError=re,Oe&&(this.mutableSourceEagerHydrationData=null)}function Uh(m,P,B,X,re,le,_e,Ke,ut){return m=new jp(m,P,B,Ke,ut),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:X,isDehydrated:B,cache:null,transitions:null,pendingSuspenseBoundaries:null},Js(le),m}function Kf(m){if(!m)return ln;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(ii(P.type)){P=P.stateNode.__reactInternalMemoizedMergedChildContext;break e}}P=P.return}while(P!==null);throw Error(o(171))}if(m.tag===1){var B=m.type;if(ii(B))return ha(m,B,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=L(P),m===null?null:m.stateNode}function Zf(m,P){if(m=m.memoizedState,m!==null&&m.dehydrated!==null){var B=m.retryLane;m.retryLane=B!==0&&B<P?B:P}}function kc(m,P){Zf(m,P),(m=m.alternate)&&Zf(m,P)}function g0(m){return m=L(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 B=bn();la(P,m,134217728,B)}kc(m,134217728)}},t.attemptDiscreteHydration=function(m){if(m.tag===13){var P=ra(m,1);if(P!==null){var B=bn();la(P,m,1,B)}kc(m,1)}},t.attemptHydrationAtCurrentPriority=function(m){if(m.tag===13){var P=hi(m),B=ra(m,P);if(B!==null){var X=bn();la(B,m,P,X)}kc(m,P)}},t.attemptSynchronousHydration=function(m){switch(m.tag){case 3:var P=m.stateNode;if(P.current.memoizedState.isDehydrated){var B=Gs(P.pendingLanes);B!==0&&(Fa(P,B|1),Wi(P,In()),(vr&6)===0&&(on(),oi()))}break;case 13:Nl(function(){var X=ra(m,1);if(X!==null){var re=bn();la(X,m,1,re)}}),kc(m,1)}},t.batchedUpdates=function(m,P){var B=vr;vr|=1;try{return m(P)}finally{vr=B,vr===0&&(on(),Ao&&oi())}},t.createComponentSelector=function(m){return{$$typeof:yn,value:m}},t.createContainer=function(m,P,B,X,re,le,_e){return Uh(m,P,!1,null,B,X,re,le,_e)},t.createHasPseudoClassSelector=function(m){return{$$typeof:qn,value:m}},t.createHydrationContainer=function(m,P,B,X,re,le,_e,Ke,ut){return m=Uh(B,X,!0,m,re,le,_e,Ke,ut),m.context=Kf(null),B=m.current,X=bn(),re=hi(B),le=Oa(X,re),le.callback=P??null,Va(B,le,re),m.current.lanes=re,gn(m,re,X),Wi(m,X),m},t.createPortal=function(m,P,B){var X=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:X==null?null:""+X,children:m,containerInfo:P,implementation:B}},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=It,B=vn.transition;try{return vn.transition=null,It=16,m()}finally{It=P,vn.transition=B}},t.discreteUpdates=function(m,P,B,X,re){var le=It,_e=vn.transition;try{return vn.transition=null,It=1,m(P,B,X,re)}finally{It=le,vn.transition=_e,vr===0&&on()}},t.findAllNodes=Aa,t.findBoundingRects=function(m,P){if(!Ee)throw Error(o(363));P=Aa(m,P),m=[];for(var B=0;B<P.length;B++)m.push(he(P[B]));for(P=m.length-1;0<P;P--){B=m[P];for(var X=B.x,re=X+B.width,le=B.y,_e=le+B.height,Ke=P-1;0<=Ke;Ke--)if(P!==Ke){var ut=m[Ke],Lt=ut.x,Kt=Lt+ut.width,br=ut.y,Ht=br+ut.height;if(X>=Lt&&le>=br&&re<=Kt&&_e<=Ht){m.splice(P,1);break}else if(X!==Lt||B.width!==ut.width||Ht<le||br>_e){if(!(le!==br||B.height!==ut.height||Kt<X||Lt>re)){Lt>X&&(ut.width+=Lt-X,ut.x=X),Kt<re&&(ut.width=re-Lt),m.splice(P,1);break}}else{br>le&&(ut.height+=br-le,ut.y=le),Ht<_e&&(ut.height=_e-br),m.splice(P,1);break}}}return m},t.findHostInstance=Qu,t.findHostInstanceWithNoPortals=function(m){return m=x(m),m=m!==null?N(m):null,m===null?null:m.stateNode},t.findHostInstanceWithWarning=function(m){return Qu(m)},t.flushControlled=function(m){var P=vr;vr|=1;var B=vn.transition,X=It;try{vn.transition=null,It=1,m()}finally{It=X,vn.transition=B,vr=P,vr===0&&(on(),oi())}},t.flushPassiveEffects=Tl,t.flushSync=Nl,t.focusWithin=function(m,P){if(!Ee)throw Error(o(363));for(m=mo(m),P=Xa(m,P),P=Array.from(P),m=0;m<P.length;){var B=P[m++];if(!Ce(B)){if(B.tag===5&&tt(B.stateNode))return!0;for(B=B.child;B!==null;)P.push(B),B=B.sibling}}return!1},t.getCurrentUpdatePriority=function(){return It},t.getFindAllNodesFailureDescription=function(m,P){if(!Ee)throw Error(o(363));var B=0,X=[];m=[mo(m),0];for(var re=0;re<m.length;){var le=m[re++],_e=m[re++],Ke=P[_e];if((le.tag!==5||!Ce(le))&&(yu(le,Ke)&&(X.push(Xu(Ke)),_e++,_e>B&&(B=_e)),_e<P.length))for(le=le.child;le!==null;)m.push(le,_e),le=le.sibling}if(B<P.length){for(m=[];B<P.length;B++)m.push(Xu(P[B]));return`findAllNodes was able to match part of the selector:
|
|
58
|
-
`+(X.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 W(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:l.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),ai=P}catch{}m=!!P.checkDCE}}return m},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(m,P,B,X){if(!Ee)throw Error(o(363));m=Aa(m,P);var re=vt(m,B,X).disconnect;return{disconnect:function(){re()}}},t.registerMutableSourceForHydration=function(m,P){var B=P._getVersion;B=B(P._source),m.mutableSourceEagerHydrationData==null?m.mutableSourceEagerHydrationData=[P,B]:m.mutableSourceEagerHydrationData.push(P,B)},t.runWithPriority=function(m,P){var B=It;try{return It=m,P()}finally{It=B}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(m,P,B,X){var re=P.current,le=bn(),_e=hi(re);return B=Kf(B),P.context===null?P.context=B:P.pendingContext=B,P=Oa(le,_e),P.payload={element:m},X=X===void 0?null:X,X!==null&&(P.callback=X),m=Va(re,P,_e),m!==null&&(la(m,re,_e,le),xi(m,re,_e)),_e},t}),sg}var V5;function wx(){return V5||(V5=1,og.exports=bx()),og.exports}var _x=wx();const Sx=mp(_x);var lg={exports:{}},Dc={};/**
|
|
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 G5;function xx(){return G5||(G5=1,Dc.ConcurrentRoot=1,Dc.ContinuousEventPriority=4,Dc.DefaultEventPriority=16,Dc.DiscreteEventPriority=1,Dc.IdleEventPriority=536870912,Dc.LegacyRoot=0),Dc}var W5;function Ex(){return W5||(W5=1,lg.exports=xx()),lg.exports}var P6=Ex(),Px=Mr();const $5={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let Y5=!1,X5=!1;const cm=".react-konva-event";let O6=!1;function Ox(e){O6=e}const Ax=`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
|
-
`,Cx=`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
|
-
`,kx={};function t0(e,r,t=kx){if(!Y5&&"zIndex"in r&&(console.warn(Cx),Y5=!0),!X5&&r.draggable){var n=r.x!==void 0||r.y!==void 0,a=r.onDragEnd||r.onDragMove;n&&!a&&(console.warn(Ax),X5=!0)}for(var i in t)if(!$5[i]){var o=i.slice(0,2)==="on",l=t[i]!==r[i];if(o&&l){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=O6||r._useStrictMode,p={},w=!1;const d={};for(var i in r)if(!$5[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]&&(d[u]=r[i])}!o&&(r[i]!==t[i]||h&&r[i]!==e.getAttr(i))&&(w=!0,p[i]=r[i])}w&&(e.setAttrs(p),ef(e));for(var u in d)e.on(u+cm,d[u])}function ef(e){if(!Px.Konva.autoDrawEnabled){var r=e.getLayer()||e.getStage();r&&r.batchDraw()}}var ug=D2();const A6={},Lx={};fp.Node.prototype._applyProps=t0;function Nx(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),ef(e)}function Tx(e,r,t){let n=fp[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=fp.Group);const a={},i={};for(var o in r){var l=o.slice(0,2)==="on";l?i[o]=r[o]:a[o]=r[o]}const u=new n(a);return t0(u,i),u}function Rx(e,r,t){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function Mx(e,r,t){return!1}function Ix(e){return e}function jx(){return null}function Fx(){return null}function Dx(e,r,t,n){return Lx}function Bx(){}function qx(e){}function zx(e,r){return!1}function Ux(){return A6}function Hx(){return A6}const Vx=setTimeout,Gx=clearTimeout,Wx=-1;function $x(e,r){return!1}const Yx=!1,Xx=!0,Kx=!0;function Zx(e,r){r.parent===e?r.moveToTop():e.add(r),ef(e)}function Qx(e,r){r.parent===e?r.moveToTop():e.add(r),ef(e)}function C6(e,r,t){r._remove(),e.add(r),r.setZIndex(t.getZIndex()),ef(e)}function Jx(e,r,t){C6(e,r,t)}function eE(e,r){r.destroy(),r.off(cm),ef(e)}function tE(e,r){r.destroy(),r.off(cm),ef(e)}function rE(e,r,t){console.error(`Text components are not yet supported in ReactKonva. You text is: "${t}"`)}function nE(e,r,t){}function iE(e,r,t,n,a){t0(e,a,n)}function aE(e){e.hide(),ef(e)}function oE(e){}function sE(e,r){(r.visible==null||r.visible)&&e.show()}function lE(e,r){}function uE(e){}function cE(){}const fE=()=>P6.DefaultEventPriority,hE=Object.freeze(Object.defineProperty({__proto__:null,appendChild:Zx,appendChildToContainer:Qx,appendInitialChild:Nx,cancelTimeout:Gx,clearContainer:uE,commitMount:nE,commitTextUpdate:rE,commitUpdate:iE,createInstance:Tx,createTextInstance:Rx,detachDeletedInstance:cE,finalizeInitialChildren:Mx,getChildHostContext:Hx,getCurrentEventPriority:fE,getPublicInstance:Ix,getRootHostContext:Ux,hideInstance:aE,hideTextInstance:oE,idlePriority:ug.unstable_IdlePriority,insertBefore:C6,insertInContainerBefore:Jx,isPrimaryRenderer:Yx,noTimeout:Wx,now:ug.unstable_now,prepareForCommit:jx,preparePortalMount:Fx,prepareUpdate:Dx,removeChild:eE,removeChildFromContainer:tE,resetAfterCommit:Bx,resetTextContent:qx,run:ug.unstable_runWithPriority,scheduleTimeout:Vx,shouldDeprioritizeSubtree:zx,shouldSetTextContent:$x,supportsMutation:Kx,unhideInstance:sE,unhideTextInstance:lE,warnsIfNotActing:Xx},Symbol.toStringTag,{value:"Module"}));var dE=Object.defineProperty,pE=Object.defineProperties,gE=Object.getOwnPropertyDescriptors,K5=Object.getOwnPropertySymbols,vE=Object.prototype.hasOwnProperty,mE=Object.prototype.propertyIsEnumerable,Z5=(e,r,t)=>r in e?dE(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Q5=(e,r)=>{for(var t in r||(r={}))vE.call(r,t)&&Z5(e,t,r[t]);if(K5)for(var t of K5(r))mE.call(r,t)&&Z5(e,t,r[t]);return e},yE=(e,r)=>pE(e,gE(r)),J5,eb;typeof window<"u"&&((J5=window.document)!=null&&J5.createElement||((eb=window.navigator)==null?void 0:eb.product)==="ReactNative")?ni.useLayoutEffect:ni.useEffect;function k6(e,r,t){if(!e)return;if(t(e)===!0)return e;let n=e.child;for(;n;){const a=k6(n,r,t);if(a)return a;n=n.sibling}}function L6(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const tb=console.error;console.error=function(){const e=[...arguments].join("");if(e!=null&&e.startsWith("Warning:")&&e.includes("useContext")){console.error=tb;return}return tb.apply(this,arguments)};const fm=L6(ni.createContext(null));class N6 extends ni.Component{render(){return ni.createElement(fm.Provider,{value:this._reactInternals},this.props.children)}}function bE(){const e=ni.useContext(fm);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const r=ni.useId();return ni.useMemo(()=>{for(const n of[e,e==null?void 0:e.alternate]){if(!n)continue;const a=k6(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 wE(){const e=bE(),[r]=ni.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!==fm&&!r.has(a)&&r.set(a,ni.useContext(L6(a)))}t=t.return}return r}function T6(){const e=wE();return ni.useMemo(()=>Array.from(e.keys()).reduce((r,t)=>n=>ni.createElement(r,null,ni.createElement(t.Provider,yE(Q5({},n),{value:e.get(t)}))),r=>ni.createElement(N6,Q5({},r))),[e])}function _E(e){const r=Gr.useRef({});return Gr.useLayoutEffect(()=>{r.current=e}),Gr.useLayoutEffect(()=>()=>{r.current={}},[]),r.current}const SE=e=>{const r=Gr.useRef(),t=Gr.useRef(),n=Gr.useRef(),a=_E(e),i=T6(),o=l=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(l):u.current=l)};return Gr.useLayoutEffect(()=>(t.current=new fp.Stage({width:e.width,height:e.height,container:r.current}),o(t.current),n.current=dh.createContainer(t.current,P6.LegacyRoot,!1,null),dh.updateContainer(Gr.createElement(i,{},e.children),n.current),()=>{fp.isBrowser&&(o(null),dh.updateContainer(null,n.current,null),t.current.destroy())}),[]),Gr.useLayoutEffect(()=>{o(t.current),t0(t.current,e,a),dh.updateContainer(Gr.createElement(i,{},e.children),n.current,null)}),Gr.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})},xE="Layer",EE="FastLayer",M1="Group",PE="Label",OE="Rect",AE="Circle",CE="Ellipse",kE="Wedge",LE="Line",NE="Sprite",TE="Image",RE="Text",ME="TextPath",IE="Star",jE="Ring",FE="Arc",DE="Tag",BE="Path",qE="RegularPolygon",zE="Arrow",UE="Shape",HE="Transformer",dh=Sx(hE);dh.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:Gr.version,rendererPackageName:"react-konva"});const VE=Gr.forwardRef((e,r)=>Gr.createElement(N6,{},Gr.createElement(SE,{...e,forwardedRef:r}))),GE=Ox,WE=Object.freeze(Object.defineProperty({__proto__:null,Arc:FE,Arrow:zE,Circle:AE,Ellipse:CE,FastLayer:EE,Group:M1,Image:TE,KonvaRenderer:dh,Label:PE,Layer:xE,Line:LE,Path:BE,Rect:OE,RegularPolygon:qE,Ring:jE,Shape:UE,Sprite:NE,Stage:VE,Star:IE,Tag:DE,Text:RE,TextPath:ME,Transformer:HE,Wedge:kE,useStrictMode:GE},Symbol.toStringTag,{value:"Module"})),Fu=Kc(WE);var cg,rb;function r0(){if(rb)return cg;rb=1;var e=di();return cg=function(t,n,a){const i=e.useRef("loading"),o=e.useRef(),[l,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 w=document.createElement("img");function d(){i.current="loaded",o.current=w,u(Math.random())}function _(){i.current="failed",o.current=void 0,u(Math.random())}return w.addEventListener("load",d),w.addEventListener("error",_),n&&(w.crossOrigin=n),a&&(w.referrerPolicy=a),w.src=t,function(){w.removeEventListener("load",d),w.removeEventListener("error",_)}},[t,n,a]),[o.current,i.current]},cg}var Fd={},Dd={},$E=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 YE=e=>{const r=window.getComputedStyle(e).position;return!(r==="absolute"||r==="relative")};function R6(e=()=>{}){const r=Gr.useRef(e);return r.current=e,Gr.useCallback((...t)=>r.current.apply(null,t),[])}const XE=({children:e,groupProps:r,divProps:t,transform:n,transformFunc:a,parentNodeFunc:i})=>{const o=T6(),l=Gr.useRef(null),[u]=Gr.useState(()=>document.createElement("div")),c=Gr.useMemo(()=>fw.createRoot(u),[u]),h=n??!0,p=R6(()=>{if(h&&l.current){let S=l.current.getAbsoluteTransform().decompose();a&&(S=a(S)),u.style.position="absolute",u.style.zIndex="10",u.style.top="0px",u.style.left="0px",u.style.transform=`translate(${S.x}px, ${S.y}px) rotate(${S.rotation}deg) scaleX(${S.scaleX}) scaleY(${S.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 w=t||{},{style:d}=w,_=$E(w,["style"]);Object.assign(u.style,d),Object.assign(u,_)});return Gr.useLayoutEffect(()=>{var w;const d=l.current;if(!d)return;const _=i?i({stage:d.getStage()}):(w=d.getStage())===null||w===void 0?void 0:w.container();if(_)return _.appendChild(u),h&&YE(_)&&(_.style.position="relative"),d.on("absoluteTransformChange",p),p(),()=>{var E;d.off("absoluteTransformChange",p),(E=u.parentNode)===null||E===void 0||E.removeChild(u)}},[h,i]),Gr.useLayoutEffect(()=>{p()},[t,a]),Gr.useLayoutEffect(()=>{c.render(Gr.createElement(o,null,e))}),Gr.useLayoutEffect(()=>()=>{setTimeout(()=>{c.unmount()})},[]),Gr.createElement(M1,Object.assign({ref:l},r))},KE=({selector:e,enabled:r,children:t})=>{const n=Gr.useRef(null),a=Gr.useRef(null),i=Gr.useRef(null),o=r??!0;return Gr.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]),Gr.useEffect(()=>()=>{var l;(l=i.current)===null||l===void 0||l.destroy()},[]),Gr.createElement(M1,{name:"_outer_portal",ref:n},Gr.createElement(M1,{name:"_inner_portal",ref:a},t))};var ZE=r0();const QE=mp(ZE),JE=Object.freeze(Object.defineProperty({__proto__:null,Html:XE,Portal:KE,useEvent:R6,useImage:QE},Symbol.toStringTag,{value:"Module"})),Mh=Kc(JE);function eP(e,r){return Object.keys(e.values).forEach(t=>e.values[t]=e.values[t]&&parseFloat(e.values[t].toFixed(r))),e}function M6(e,r,t){const n=r-1,a=t[j6(n,t.length)];return a.marker!=="Z"?a:M6(e,n,t)}function I6(e,r,t){const n=r+1,a=t[j6(n,t.length)];return a.marker==="Z"?I6(e,n,t):a}function tP(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,l){return o[l].marker==="M"?o[l]:a(o,l-1)},i=a(t,r);e.values.x=i.values.x,e.values.y=i.values.y}return e}function rP(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 j6(e,r){return(e%r+r)%r}function nP(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 x2(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,x2(e,r-1)),e[r].marker==="Z"&&x2(e,r-1)}function iP(e,r,t){const n=ib(e.values,t.values),a=ib(r.values,e.values);return Math.min(a,n)}function nb(e,r){return Math.atan2(r.x-e.x,r.y-e.y)}function ib(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 ab(e,r){return Math.sin(e)*r}function ob(e,r){return Math.cos(e)*r}function sb(e,r){const t=r/Math.tan(e);return t===1/0||t===-1/0||isNaN(t)?r:t}function aP(e,r){return r*Math.tan(e)}function oP(e,r){let t,n=0,a=e*(180/Math.PI);return a<0&&a>=-180||a>180&&a<360?t=sb(e/2,-r):(t=sb(e/2,r),n=1,t===1/0&&(t=r)),{offset:t,sweepFlag:n}}function sP(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 F6(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 rP(n.marker,i)}).map(tP)}function D6(e,r,t){let n=[],a=[];return t&&e.forEach(i=>eP(i,t)),e.forEach(i=>{i.marker==="M"&&n.push([]),n[n.length-1].push(i)}),n.forEach(i=>{i.map(nP),x2(i,i.length-1);const o=i[i.length-1].marker=="Z";i.filter(l=>!l.overlap).map((l,u,c)=>{const p=M6(l,u,c),w=I6(l,u,c),d=nb(l.values,p.values),_=nb(l.values,w.values),E=_-d,S=E*(180/Math.PI),y=iP(l,p,w),g=Math.abs(aP(E/2,y/2)),v=Math.min(r,g),b=oP(E,v),O=b.offset,j=b.sweepFlag,T=(u==0||u==c.length-1)&&!o;switch(l.marker){case"M":case"L":const M=[l.values.x+ab(d,O),l.values.y+ob(d,O)],F=[l.values.x+ab(_,O),l.values.y+ob(_,O)];T?a.push({marker:l.marker,values:l.values}):a.push({marker:l.marker,values:{x:parseFloat(M[0].toFixed(3)),y:parseFloat(M[1].toFixed(3))}}),!T&&(w.marker==="L"||w.marker==="M")&&a.push({marker:"A",radius:v,values:{radiusX:parseFloat(v.toFixed(3)),radiusY:parseFloat(v.toFixed(3)),rotation:S,largeArc:0,sweep:j,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:l.marker,values:l.values});break}})}),{path:sP(a),commands:a}}function lP(e,r,t){return D6([...F6(e)],r,t)}const uP=Object.freeze(Object.defineProperty({__proto__:null,parsePath:F6,roundCommands:D6,roundCorners:lP},Symbol.toStringTag,{value:"Module"})),cP=Kc(uP);var jl={},Bd={},l1={},lb;function fP(){if(lb)return l1;lb=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_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_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:function(t){if(!t)return"";var n="";if(t instanceof Array)return r.visit_array(t,n);if(t.type){var a=r["visit_"+t.type];if(a)return a(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)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function n($){var J=new Error(t+": "+$);throw J.source=t,J}function a(){var $=i();return t.length>0&&n("Invalid input not EOF"),$}function i(){return b(o)}function o(){return l("linear-gradient",r.linearGradient,c)||l("repeating-linear-gradient",r.repeatingLinearGradient,c)||l("radial-gradient",r.radialGradient,w)||l("repeating-radial-gradient",r.repeatingRadialGradient,w)}function l($,J,V){return u(J,function(H){var z=V();return z&&(W(r.comma)||n("Missing comma before color stops")),{type:$,orientation:z,colorStops:b(O)}})}function u($,J){var V=W($);if(V){W(r.startCall)||n("Missing (");var H=J(V);return W(r.endCall)||n("Missing )"),H}}function c(){return h()||p()}function h(){return I("directional",r.sideOrCorner,1)}function p(){return I("angular",r.angleValue,1)}function w(){var $,J=d(),V;return J&&($=[],$.push(J),V=t,W(r.comma)&&(J=d(),J?$.push(J):t=V)),$}function d(){var $=_()||E();if($)$.at=y();else{var J=S();if(J){$=J;var V=y();V&&($.at=V)}else{var H=g();H&&($={type:"default-radial",at:H})}}return $}function _(){var $=I("shape",/^(circle)/i,0);return $&&($.style=N()||S()),$}function E(){var $=I("shape",/^(ellipse)/i,0);return $&&($.style=L()||S()),$}function S(){return I("extent-keyword",r.extentKeywords,1)}function y(){if(I("position",/^at/,0)){var $=g();return $||n("Missing positioning value"),$}}function g(){var $=v();if($.x||$.y)return{type:"position",value:$}}function v(){return{x:L(),y:L()}}function b($){var J=$(),V=[];if(J)for(V.push(J);W(r.comma);)J=$(),J?V.push(J):n("One extra comma");return V}function O(){var $=j();return $||n("Expected color definition"),$.length=L(),$}function j(){return M()||C()||F()||T()}function T(){return I("literal",r.literalColor,0)}function M(){return I("hex",r.hexColor,1)}function F(){return u(r.rgbColor,function(){return{type:"rgb",value:b(x)}})}function C(){return u(r.rgbaColor,function(){return{type:"rgba",value:b(x)}})}function x(){return W(r.number)[1]}function L(){return I("%",r.percentageValue,1)||A()||N()}function A(){return I("position-keyword",r.positionKeywords,1)}function N(){return I("px",r.pixelValue,1)||I("em",r.emValue,1)}function I($,J,V){var H=W(J);if(H)return{type:$,value:H[V]}}function W($){var J,V;return V=/^[\n\r\t\s]+/.exec(t),V&&G(V[0].length),J=$.exec(t),J&&G(J[0].length),J}function G($){t=t.substr($)}return function($){return t=$.toString(),a()}}(),l1.parse=e.parse,l1.stringify=e.stringify,l1}var ub;function hm(){return ub||(ub=1,function(e){var r=Bd&&Bd.__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(fP());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,l)=>({color:n(o),offset:o.length?parseFloat(o.length.value)/100:l/(i.colorStops.length-1)}))}}}(Bd)),Bd}var cb;function Pp(){return cb||(cb=1,function(e){var r,t=jl&&jl.__createBinding||(Object.create?function(c,h,p,w){w===void 0&&(w=p);var d=Object.getOwnPropertyDescriptor(h,p);d&&!("get"in d?!h.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return h[p]}}),Object.defineProperty(c,w,d)}:function(c,h,p,w){w===void 0&&(w=p),c[w]=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 w in h)Object.prototype.hasOwnProperty.call(h,w)&&(p[p.length]=w);return p},r(c)},function(c){if(c&&c.__esModule)return c;var h={};if(c!=null)for(var p=r(c),w=0;w<p.length;w++)p[w]!=="default"&&t(h,c,p[w]);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(di()),l=a(hm()),u=i(Us());e.useColor=(c,h=c.fill,p="fill")=>o.default.useMemo(()=>{if(!l.isGradient(h))return{[p]:h};const{stops:w,rotation:d}=l.parseColor(h),_={x:c.a.width/2,y:c.a.height/2},E=Math.sqrt(Math.pow(_.x,2)+Math.pow(_.y,2)),S=u.default.Util.degToRad(d)-Math.PI/2,y=[];return w.forEach(({offset:g,color:v})=>{y.push(g,v)}),p==="fill"?{fillLinearGradientStartPointX:_.x-E*Math.cos(S),fillLinearGradientStartPointY:_.y-E*Math.sin(S),fillLinearGradientColorStops:y,fillLinearGradientEndPointX:_.x+E*Math.cos(S),fillLinearGradientEndPointY:_.y+E*Math.sin(S),fill:w[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:_.x-E*Math.cos(S),strokeLinearGradientStartPointY:_.y-E*Math.sin(S),strokeLinearGradientColorStops:y,strokeLinearGradientEndPointX:_.x+E*Math.cos(S),strokeLinearGradientEndPointY:_.y+E*Math.sin(S)}},[h,c.width,c.height])}(jl)),jl}var fg={},qd={},fb;function If(){return fb||(fb=1,function(e){var r=qd&&qd.__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 l=t.default.useRef();t.default.useLayoutEffect(()=>{l.current&&l.current.destroy()},[o]),t.default.useLayoutEffect(()=>{if(!a)return;const u=i.current.opacity();return u?(i.current.opacity(0),l.current=new n.default.Tween({node:i.current,opacity:u,onFinish:()=>{var c;(c=l.current)===null||c===void 0||c.destroy()}}),l.current.play(),()=>{var c;(c=l.current)===null||c===void 0||c.destroy()}):void 0},[])};const t=r(di()),n=r(Us());let a=!1;e.toggleFadeInAnimation=(i=!a)=>{a=i},e.isAnimationUsed=()=>a}(qd)),qd}var hb;function jf(){return hb||(hb=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;const p=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()=>{h||(clearTimeout(p),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){l.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 l=[];function u(c){l.forEach(h=>h(c))}}(fg)),fg}var rc={},db;function Op(){return db||(db=1,function(e){var r,t=rc&&rc.__createBinding||(Object.create?function(S,y,g,v){v===void 0&&(v=g);var b=Object.getOwnPropertyDescriptor(y,g);b&&!("get"in b?!y.__esModule:b.writable||b.configurable)||(b={enumerable:!0,get:function(){return y[g]}}),Object.defineProperty(S,v,b)}:function(S,y,g,v){v===void 0&&(v=g),S[v]=y[g]}),n=rc&&rc.__setModuleDefault||(Object.create?function(S,y){Object.defineProperty(S,"default",{enumerable:!0,value:y})}:function(S,y){S.default=y}),a=rc&&rc.__importStar||(r=function(S){return r=Object.getOwnPropertyNames||function(y){var g=[];for(var v in y)Object.prototype.hasOwnProperty.call(y,v)&&(g[g.length]=v);return g},r(S)},function(S){if(S&&S.__esModule)return S;var y={};if(S!=null)for(var g=r(S),v=0;v<g.length;v++)g[v]!=="default"&&t(y,S,g[v]);return n(y,S),y});Object.defineProperty(e,"__esModule",{value:!0}),e.isFontLoaded=e.globalFonts=void 0,e.isGoogleFontChanged=function(){return u.value},e.setGoogleFonts=function(S){S!=="default"?(u.value=!0,l.splice(0,l.length),l.push(...S)):u.value=!1},e.getFontsList=function(){return l},e.addGlobalFont=function(S){e.globalFonts.push(S)},e.removeGlobalFont=function(S){const y=e.globalFonts.findIndex(g=>g.fontFamily===S);y!==-1&&e.globalFonts.splice(y,1)},e.replaceGlobalFonts=function(S){e.globalFonts.replace(S)},e.loadFont=async function(S,y,g){var v;if(w[S])return;const b=!!(!((v=document.fonts)===null||v===void 0)&&v.load),O=p("Arial","Arial",y,g);if(b)try{if(await document.fonts.load(`16px '${S}', ${y} ${g}`),O!==p(S,"Arial",y,g))return void(w[S]=!0)}catch{}const j=p("Times","Times",y,g),T=p(S,"Arial",y,g),M=Math.min(6e3,(0,o.getFontLoadTimeout)())/60;for(let F=0;F<M;F++){const C=p(S,"Arial",y,g),x=p(S,"Times",y,g);if(C!==T||C!==O||x!==j)return void(w[S]=!0);await new Promise(L=>setTimeout(L,60))}console.warn(`Timeout for loading font "${S}". Looks like polotno can't load it. Is it a correct font family?`),(0,o.triggerLoadError)(`Timeout for loading font "${S}"`)},e.setGoogleFontsVariants=function(S){_=S},e.getGoogleFontsVariants=function(){return _},e.injectGoogleFont=function(S){if(d[S])return;const y=`https://fonts.googleapis.com/css?family=${S.replace(/ /g,"+")}:${_}`,g=document.createElement("link");g.type="text/css",g.href=y,g.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(g),d[S]=!0},e.injectCustomFont=function(S){const y=S.fontFamily;if(E[y]||!S.url&&!S.styles)return;const g=document.createElement("style");g.type="text/css";const v=S.styles||(S.url?[{src:`url("${S.url}")`}]:[]);let b="";v.forEach(O=>{b+=`
|
|
77
|
-
@font-face {
|
|
78
|
-
font-family: '${y}';
|
|
79
|
-
src: ${O.src};
|
|
80
|
-
font-style: ${O.fontStyle||"normal"};
|
|
81
|
-
font-weight: ${O.fontWeight||"normal"};
|
|
82
|
-
}
|
|
83
|
-
`}),g.innerHTML=b,document.getElementsByTagName("head")[0].appendChild(g),E[S.fontFamily]=!0};const i=a(fl),o=jf();let l=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(S,y="Arial",g="normal",v="normal"){var b=h.getContext("2d");return b.font=`${g} ${v} 40px '${S}', ${y}`,b.measureText(c).width}const w={Arial:!0};e.isFontLoaded=S=>!!w[S];const d={};let _="400,400italic,700,700italic";const E={}}(rc)),rc}var nc={},pb;function tf(){return pb||(pb=1,function(e){var r,t=nc&&nc.__createBinding||(Object.create?function(o,l,u,c){c===void 0&&(c=u);var h=Object.getOwnPropertyDescriptor(l,u);h&&!("get"in h?!l.__esModule:h.writable||h.configurable)||(h={enumerable:!0,get:function(){return l[u]}}),Object.defineProperty(o,c,h)}:function(o,l,u,c){c===void 0&&(c=u),o[c]=l[u]}),n=nc&&nc.__setModuleDefault||(Object.create?function(o,l){Object.defineProperty(o,"default",{enumerable:!0,value:l})}:function(o,l){o.default=l}),a=nc&&nc.__importStar||(r=function(o){return r=Object.getOwnPropertyNames||function(l){var u=[];for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&(u[u.length]=c);return u},r(o)},function(o){if(o&&o.__esModule)return o;var l={};if(o!=null)for(var u=r(o),c=0;c<u.length;c++)u[c]!=="default"&&t(l,o,u[c]);return n(l,o),l});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(fl);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={},gb;function B6(){return gb||(gb=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 zd={},vb;function Ap(){return vb||(vb=1,function(e){var r=zd&&zd.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.applyFilter=function(a,i){var o;const l={filters:[]},u={};i.brightnessEnabled&&(l.filters.push(t.default.Filters.Brighten),l.brightness=i.brightness),i.blurEnabled&&(l.filters.push(t.default.Filters.Blur),l.blurRadius=i.blurRadius,i.type==="text"&&i.lineHeight<1&&(u.offset=i.fontSize)),i.sepiaEnabled&&l.filters.push(t.default.Filters.Sepia),i.grayscaleEnabled&&l.filters.push(t.default.Filters.Grayscale),i.filters.forEach((c,h)=>{const p=n[h];p&&l.filters.push(p(c.intensity))}),a.setAttrs(l),l.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(Us()),n={warm:a=>i=>{const o=i.data;for(let l=0;l<o.length;l+=4)o[l]=Math.min(o[l]+30*a,255),o[l+1]=Math.min(o[l+1]+15*a,255);return i},cold:a=>i=>{const o=i.data;for(let l=0;l<o.length;l+=4)o[l]=Math.min(o[l]-15*a,255),o[l+1]=Math.min(o[l+1]-10*a,255),o[l+2]=Math.min(o[l+2]+15*a,255);return i},natural:a=>i=>{const o=i.data;a=Math.max(0,Math.min(a,1));for(let l=0;l<o.length;l+=4){o[l]=Math.min(o[l]*(1+.1*a),255),o[l+1]=Math.min(o[l+1]*(1+.1*a),255),o[l+2]=Math.min(o[l+2]*(1+.1*a),255);const u=(o[l]+o[l+1]+o[l+2])/3;o[l]=Math.min((o[l]-u)*(1+.2*a)+u,255),o[l+1]=Math.min((o[l+1]-u)*(1+.2*a)+u,255),o[l+2]=Math.min((o[l+2]-u)*(1+.2*a)+u,255)}return i}}}(zd)),zd}var Ud={},mb;function Ff(){return mb||(mb=1,function(e){var r=Ud&&Ud.__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(di()),n=zs,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)))}(Ud)),Ud}var Hd={},yb;function rf(){return yb||(yb=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(di());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 bb={},q6="warn";function z6(e){q6=e}function U6(){return q6}function hP(e){z6(e)}var wa;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(wa||(wa={}));var E2=function(e,r){return E2=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])},E2(e,r)};function Zn(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");E2(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 dP(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 H6(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:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(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 op(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(l){o={error:l}}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 rr(e).type}function pP(e,r){return rr(e).getChildType(r)}function V6(e,r){return rr(e).onPatch(r)}function gP(e,r){return rr(e).onSnapshot(r)}function Oh(e,r){rr(e).applyPatches(wm(r))}function vP(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=V6(e,function(o,l){r&&!r(o,l,vm())||(t.patches.push(o),t.inversePatches.push(l),n.patches=void 0,n.inversePatches=void 0,n.reversedInversePatches=void 0)}))},replay:function(o){Oh(o||e,t.patches)},undo:function(o){Oh(o||e,t.inversePatches.slice().reverse())}};return i.resume(),i}function mP(e){var r=rr(e);if(!r.isRoot)throw new Yt("`protect` can only be invoked on root nodes");r.isProtectionEnabled=!0}function yP(e){var r=rr(e);if(!r.isRoot)throw new Yt("`unprotect` can only be invoked on root nodes");r.isProtectionEnabled=!1}function bP(e){return rr(e).isProtected}function G6(e,r){return rr(e).applySnapshot(r)}function dm(e,r){r===void 0&&(r=!0);var t=rr(e);return r?t.snapshot:t.type.getSnapshot(t,!1)}function wP(e,r){r===void 0&&(r=1);for(var t=rr(e).parent;t;){if(--r===0)return!0;t=t.parent}return!1}function _P(e,r){r===void 0&&(r=1);for(var t=r,n=rr(e).parent;n;){if(--t===0)return n.storedValue;n=n.parent}throw new Yt("Failed to find the parent of ".concat(rr(e)," at depth ").concat(r))}function SP(e,r){for(var t=rr(e).parent;t;){if(r.is(t.storedValue))return!0;t=t.parent}return!1}function xP(e,r){for(var t=rr(e).parent;t;){if(r.is(t.storedValue))return t.storedValue;t=t.parent}throw new Yt("Failed to find the parent of ".concat(rr(e)," of a given type"))}function W6(e){return rr(e).root.storedValue}function $6(e){return rr(e).path}function EP(e){return Nh(rr(e).path)}function PP(e){return rr(e).isRoot}function OP(e,r){var t=f8(rr(e),r);return t?t.value:void 0}function AP(e,r,t){var n=rr(r).root.identifierCache.resolve(e,Ih(t));return n==null?void 0:n.value}function Y6(e){return rr(e).identifier}function CP(e,r){r===void 0&&(r=!0);try{var t=e();if(t==null)return;if(An(t))return r?pm(t)?t:void 0:t;throw new Yt("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof _m)return;throw n}}function kP(e,r){r===void 0&&(r=!0);try{var t=e();if(t==null)return!1;if(An(t))return r?pm(t):!0;throw new Yt("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof _m)return!1;throw n}}function X6(e,r){var t=f8(rr(e),r,!1);if(t!==void 0)try{return t.value}catch{return}}function LP(e,r){return c8(rr(e),rr(r))}function NP(e,r){r===void 0&&(r=!0);var t=rr(e);return t.type.create(t.snapshot,r===!0?t.root.environment:r===!1?void 0:r)}function TP(e){return rr(e).detach(),e}function RP(e){var r=rr(e);r.isRoot?r.die():r.parent.removeChild(r.subpath)}function pm(e){return rr(e).observableIsAlive}function MP(e,r){var t=rr(e);return t.addDisposer(r),r}function IP(e){var r=rr(e),t=r.root.environment;if(!t)throw new Yt("Failed to find the environment of ".concat(r," ").concat(r.path));return t}function jP(e){var r=rr(e),t=r.root.environment;return!!t}function K6(e,r){var t=rr(e);t.getChildren().forEach(function(n){An(n.storedValue)&&K6(n.storedValue,r)}),r(t.storedValue)}function Z6(e){var r;return An(e)?r=Cp(e):r=e,{name:r.name,properties:_a({},r.properties)}}function FP(e){var r=rr(e).type,t=_a(_a({},Z6(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){t6(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):n6(e,a)?t.volatile.push(a):t.views.push(a)}}),t}function DP(e){return e}function BP(e){return e}function qP(e){return e}function zP(e){return rr(e).nodeId}var Q6=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 v8),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=up("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?Gc(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=up("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}(),hp=function(e){Zn(r,e);function r(t,n,a,i,o){var l=e.call(this,t,n,a,i)||this;try{l.storedValue=t.createNewInstance(o)}catch(u){throw l.state=io.DEAD,u}return l.state=io.CREATED,l.finalizeCreation(),l}return Object.defineProperty(r.prototype,"root",{get:function(){if(!this.parent)throw new Yt("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}(Q6);hp.prototype.die=ca(hp.prototype.die);var UP=1,Vl;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(Vl||(Vl={}));var Is;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(Is||(Is={}));var HP={onError:function(e){throw e}},vs=function(e){Zn(r,e);function r(t,n,a,i,o){var l=e.call(this,t,n,a,i)||this;if(Object.defineProperty(l,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++UP}),Object.defineProperty(l,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(l,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(l,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:Vl.UNINITIALIZED}),Object.defineProperty(l,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),l._snapshotComputed=Tf(function(){return l.getSnapshot()}),l.unbox=l.unbox.bind(l),l._initialSnapshot=o,l.identifierAttribute=t.identifierAttribute,n||(l.identifierCache=new uO),l._childNodes=t.initializeChildNodes(l,l._initialSnapshot),l.identifier=null,l.unnormalizedIdentifier=null,l.identifierAttribute&&l._initialSnapshot){var u=l._initialSnapshot[l.identifierAttribute];if(u===void 0){var c=l._childNodes[l.identifierAttribute];c&&(u=c.value)}if(typeof u!="string"&&typeof u!="number")throw new Yt("Instance identifier '".concat(l.identifierAttribute,"' for type '").concat(l.type.name,"' must be a string or a number"));l.identifier=Ih(u),l.unnormalizedIdentifier=u}return n?n.root.identifierCache.addNodeToCache(l):l.identifierCache.addNodeToCache(l),l}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===Vl.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=Vl.CREATING;for(var l=[],u=this.parent;u&&u._observableInstanceState===Vl.UNINITIALIZED;)l.unshift(u),u=u.parent;try{for(var c=op(l),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 w=this.type;try{this.storedValue=w.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,w.finalizeNewInstance(this,this.storedValue)}catch(E){throw this.state=io.DEAD,E}finally{this._isRunningAction=!1}if(this._observableInstanceState=Vl.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=kh,this.state=io.CREATED,t){this.fireHook(wa.afterCreate),this.finalizeCreation();try{for(var d=op(l.reverse()),_=d.next();!_.done;_=d.next()){var p=_.value;p.fireHook(wa.afterCreate),p.finalizeCreation()}}catch(E){i={error:E}}finally{try{_&&!_.done&&(o=d.return)&&o.call(d)}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"&&(xh?xh(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===Vl.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=U6();if(!this.isAlive&&n!=="ignore"){var a=this._getAssertAliveError(t);switch(n){case"error":throw new Yt(a);case"warn":SO(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&&Gc(t.subpath)||"",i=t.actionContext||gm();i&&i.type!=="action"&&i.parentActionEvent&&(i=i.parentActionEvent);var o="";if(i&&i.name!=null){var l=i&&i.context&&$6(i.context)||n;o="".concat(l,".").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===Vl.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(kh),this._autoUnbox=!1;try{return this._observableInstanceState===Vl.CREATED?this.type.getChildren(this):d8(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 Yt("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=op(t.getChildren()),o=i.next();!o.done;o=i.next()){var l=o.value;l.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 Yt("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=dp(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(a){if(!a.path){t.type.applySnapshot(t,a.value);return}var i=Nh(a.path),o=h8(t,i.slice(0,-1));o.applyPatchLocally(i[i.length-1],a)})}),this._applySnapshot=dp(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",fO)}}),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!==Vl.UNINITIALIZED&&(this.getChildren().forEach(function(t){t.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(Is.Dispose),this._internalEventsClear(Is.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(Is.Snapshot,t)}}),Object.defineProperty(r.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._internalEventsEmit(Is.Snapshot,t)}}),Object.defineProperty(r.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._internalEventsRegister(Is.Patch,t)}}),Object.defineProperty(r.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this._internalEventsHasSubscribers(Is.Patch)){var a=n.path.substr(this.path.length)+(t.path?"/"+t.path:""),i=bO({},t,{path:a}),o=Iu(CO(i),2),l=o[0],u=o[1];this._internalEventsEmit(Is.Patch,l,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(Is.Dispose,t)}}),Object.defineProperty(r.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this.hasDisposer(t)){this._internalEventsRegister(Is.Dispose,t,!0);return}throw new Yt("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(Is.Dispose,t))throw new Yt("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(Is.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=$w(function(){return t.snapshot},function(a){return t.emitSnapshot(a)},HP);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 v8),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}(Q6);vs.prototype.createObservableInstance=ca(vs.prototype.createObservableInstance);vs.prototype.detach=ca(vs.prototype.detach);vs.prototype.die=ca(vs.prototype.die);var J6,Or;(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"})(Or||(Or={}));var e8="cannotDetermine",VP=Symbol("$type"),pc=function(){function e(r){Object.defineProperty(this,J6,{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 Yt("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=u8(r);if(n){var a=Cp(r);return this.isAssignableFrom(a)?ms():ys(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 Yt("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 Yt("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 Yt("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 Yt("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}();J6=VP;pc.prototype.create=ca(pc.prototype.create);var Ah=function(e){Zn(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===Ih(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||An(n)&&rr(n)===t?!0:t.type===this&&p8(n)&&!An(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(),An(n)&&this.isAssignableFrom(Cp(n))){var l=rr(n);return l.setParent(a,i),l}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);Ah.prototype.create=ca(Ah.prototype.create);var Df=function(e){Zn(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 GP(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 l=Ou.get(t.rootId);return l.async=!0,n(t)}case"flow_resume":case"flow_resume_error":{var l=Ou.get(t.rootId);e.onResume(t,l.context);try{return n(t)}finally{e.onSuspend(t,l.context)}}case"flow_throw":{var l=Ou.get(t.rootId);return Ou.delete(t.rootId),e.onFail(t,l.context,t.args[0]),n(t)}case"flow_return":{var l=Ou.get(t.rootId);return Ou.delete(t.rootId),e.onSuccess(t,l.context,t.args[0]),n(t)}}}}var WP=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 $P(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}),l=!e.filter||e.filter(o),u=l?e:void 0,c=new WP(u,o);r.set(n.id,c);var h=void 0;try{h=a(n)}catch(w){throw r.delete(n.id),c.finish(w),w}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 YP(e,r,t,n){if(n instanceof Date)return{$MST_DATE:n.getTime()};if(Lh(n))return n;if(An(n))return u1("[MSTNode: ".concat(Cp(n).name,"]"));if(typeof n=="function")return u1("[function]");if(typeof n=="object"&&!xf(n)&&!bm(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 XP(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 t8(e,r){xh(function(){wm(r).forEach(function(t){return KP(e,t)})})}function KP(e,r){var t=X6(e,r.path||"");if(!t)throw new Yt("Invalid action path: ".concat(r.path||""));var n=rr(t);if(r.name==="@APPLY_PATCHES")return Oh.call(null,t,r.args[0]);if(r.name==="@APPLY_SNAPSHOT")return G6.call(null,t,r.args[0]);if(typeof t[r.name]!="function")throw new Yt("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 XP(n,a)}):[])}function ZP(e,r){var t=[],n=function(o){var l=r?r(o,vm()):!0;l&&t.push(o)},a,i={actions:t,get recording(){return!!a},stop:function(){a&&(a(),a=void 0)},resume:function(){a||(a=r8(e,n))},replay:function(o){t8(o,t)}};return i.resume(),i}function r8(e,r,t){return t===void 0&&(t=!1),a8(e,function(a,i){if(a.type==="action"&&a.id===a.rootId){var o=rr(a.context),l={name:a.name,path:c8(rr(e),o),args:a.args.map(function(c,h){return YP(o,a.name,h,c)})};if(t){var u=i(a);return r(l),u}else return r(l),i(a)}else return i(a)})}var QP=1,sp;function gm(){return sp}function n8(){return QP++}function P2(e,r){var t=rr(e.context);e.type==="action"&&t.assertAlive({actionContext:e});var n=t._isRunningAction;t._isRunningAction=!0;var a=sp;sp=e;try{return tO(t,e,r)}finally{sp=a,t._isRunningAction=n}}function i8(e){if(e)return e.type==="action"?e:e.parentActionEvent}function dp(e,r,t){var n=function(){var a=n8(),i=sp,o=i8(i);return P2({type:"action",name:r,id:a,args:m8(arguments),context:e,tree:W6(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 a8(e,r,t){t===void 0&&(t=!0);var n=rr(e);return n.addMiddleWare(r,t)}function JP(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 eO=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 tO(e,r,t){var n=new eO(e,t);if(n.isEmpty)return ca(t).apply(null,r.args);var a=null;function i(o){var l=n.getNextMiddleware(),u=l&&l.handler;if(!u)return ca(t).apply(null,o.args);if(!l.includeHooks&&wa[o.name])return i(o);function c(p,w){a=i(p),w&&(a=w(a))}function h(p){a=p}return u(o,c,h),a}return i(r)}function vm(){for(var e=gm();e&&e.type!=="action";)e=e.parentActionEvent;return e}function o8(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 rO(e,r){return o8(e,r,!1)}function nO(e,r){return o8(e,r,!0)}function iO(e){try{return JSON.stringify(e)}catch(r){return"<Unserializable: ".concat(r,">")}}function s8(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):An(e)?"<".concat(e,">"):"`".concat(iO(e),"`")}function aO(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function oO(e){var r=e.value,t=e.context[e.context.length-1].type,n=e.context.map(function(l){var u=l.path;return u}).filter(function(l){return l.length>0}).join("/"),a=n.length>0?'at path "/'.concat(n,'" '):"",i=An(r)?"value of type ".concat(rr(r).type.name,":"):Lh(r)?"value":"snapshot",o=t&&An(r)&&t.is(rr(r).snapshot);return"".concat(a).concat(i," ").concat(s8(r)," is not assignable ").concat(t?"to type: `".concat(t.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(t?k8(t)||Lh(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 mm(e,r,t){return e.concat([{path:r,type:t}])}function ms(){return Ch}function ys(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){xO()&&l8(e,r)}function l8(e,r){var t=e.validate(r,[{path:"",type:e}]);if(t.length>0)throw new Yt(sO(e,r,t))}function sO(e,r,t){if(t.length!==0)return"Error while converting ".concat(aO(s8(r))," to `").concat(e.name,`\`:
|
|
93
|
-
|
|
94
|
-
`)+t.map(oO).join(`
|
|
95
|
-
`)}var lO=0,uO=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:lO++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:Rn.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:Rn.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,Rn.array([],i0));var a=this.cache.get(n);if(a.indexOf(r)!==-1)throw new Yt("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;X2(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 i6(this.cache).forEach(function(i){for(var o=Iu(i,2),l=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(l),c=!0)}c&&t.updateLastCacheModificationPerId(l)}),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 Yt("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 ym(e,r,t,n,a){var i=u8(a);if(i){if(i.parent)throw new Yt("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 vs(e,r,t,n,a)}function nf(e,r,t,n,a){return new hp(e,r,t,n,a)}function cO(e){return e instanceof hp||e instanceof vs}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 An(e){return!!(e&&e.$treenode)}function rr(e){if(!An(e))throw new Yt("Value ".concat(e," is no MST Node"));return e.$treenode}function u8(e){return e&&e.$treenode||null}function fO(){return rr(this).snapshot}var hO=function(e){return".."};function c8(e,r){if(e.root!==r.root)throw new Yt("Cannot calculate relative path: objects '".concat(e,"' and '").concat(r,"' are not part of the same object tree"));for(var t=Nh(e.path),n=Nh(r.path),a=0;a<t.length&&t[a]===n[a];a++);return t.slice(a).map(hO).join("/")+I1(n.slice(a))}function f8(e,r,t){return t===void 0&&(t=!0),h8(e,Nh(r),t)}function h8(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 hp){var o=n.value;An(o)&&(n=rr(o))}if(n instanceof vs){var l=n.getChildType(i);if(l&&(n=n.getChildNode(i),n))continue}}}throw new Yt("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 d8(e){if(!e)return Ch;var r=Object.keys(e);if(!r.length)return Ch;var t=new Array(r.length);return r.forEach(function(n,a){t[a]=e[n]}),t}function dO(e){return y8(e)}var pO=Object.toString(),Ch=Object.freeze([]),kh=Object.freeze({}),i0=Iw().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(i0);var Yt=function(e){Zn(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 gO(e){return e}var vO=Number.isInteger;function mO(e){return Number(e)===e&&e%1!==0}function yO(e){return Number.isFinite(e)}function bm(e){return Array.isArray(e)||Vo(e)}function wm(e){return e?bm(e)?e:[e]:Ch}function bO(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())===pO}function p8(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function Lh(e,r){return r===void 0&&(r=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||r&&e instanceof Date}function g8(e){return typeof e!="function"}function wO(e,r,t){Ra(e)?Z2(e,r,t):Object.defineProperty(e,r,t)}function Ef(e,r,t){wO(e,r,{enumerable:!1,writable:!1,configurable:!0,value:t})}var _O=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}(),v8=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 _O),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 m8(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 SO(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function xO(){return typeof process<"u"&&bb&&bb.ENABLE_TYPE_CHECK==="true"}function pg(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function y8(e){return AO(e.name,e)}function EO(e){return e}function PO(e){return function(){var r,t=[];for(r=0;r<arguments.length;r++)t[r]=arguments[r];return H6(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 OO(e){return H6(this,function(r){switch(r.label){case 0:return[4,e];case 1:return[2,r.sent()]}})}function AO(e,r){var t=function(){var a=n8(),i=gm();if(!i)throw new Yt("a mst flow must always have a parent context");var o=i8(i);if(!o)throw new Yt("a mst flow must always have a parent action context");var l={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,w){return h.$mst_middleware=t.$mst_middleware,P2(_a(_a({},l),{type:p,args:[w]}),h)}return new Promise(function(h,p){var w,d=function(){w=r.apply(null,arguments),_(void 0)};d.$mst_middleware=t.$mst_middleware,P2(_a(_a({},l),{type:"flow_spawn",args:m8(u)}),d);function _(y){var g;try{var v=c(function(b){g=w.next(b)},"flow_resume",y);v instanceof Error&&(g=w.throw(v))}catch(b){pg(function(){c(function(O){p(b)},"flow_throw",b)});return}S(g)}function E(y){var g;try{c(function(v){g=w.throw(v)},"flow_resume_error",y)}catch(v){pg(function(){c(function(b){p(v)},"flow_throw",v)});return}S(g)}function S(y){if(y.done){pg(function(){c(function(g){h(g)},"flow_return",y.value)});return}if(!y.value||typeof y.value.then!="function")throw new Yt("Only promises can be yielded to `async`, got: "+y);return y.value.then(_,E)}})};return t._isFlowAction=!0,t}function CO(e){if(!("oldValue"in e))throw new Yt("Patches without `oldValue` field cannot be inversed");return[kO(e),LO(e)]}function kO(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 LO(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 NO(e){return typeof e=="number"}function Gc(e){return NO(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function b8(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function I1(e){if(e.length===0)return"";var r=function(t){return t.map(Gc).join("/")};return e[0]==="."||e[0]===".."?r(e):"/"+r(e)}function Nh(e){var r=e.split("/").map(b8),t=e===""||e==="."||e===".."||dg(e,"/")||dg(e,"./")||dg(e,"../");if(!t)throw new Yt("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return r[0]===""&&r.shift(),r}var gg=Symbol("$preProcessorFailed"),TO=function(e){Zn(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|Or.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;RO(t.type,this,"create"),t instanceof vs&&(t.hasSnapshotPostProcessor=!!this._processors.postProcessor);var a=t.getSnapshot;t.getSnapshot=function(){return n.postProcessSnapshot(a.call(t),t)},N8(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=An(i)?i:this.preProcessSnapshot(i),l=this._subtype.instantiate(t,n,a,o);return this._fixNode(l),l}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=this._subtype.reconcile(t,An(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?ys(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:An(t)?dm(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 Ah))return!1;var a=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(t,a)}}),r}(pc);function RO(e,r){for(var t,n,a=[],i=2;i<arguments.length;i++)a[i-2]=arguments[i];try{for(var o=op(a),l=o.next();!l.done;l=o.next()){var u=l.value;e[u]=r[u].bind(r)}}catch(c){t={error:c}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}}function MO(e,r,t){return new TO(e,r,t)}var wb="Map.put can only be used to store complex values that have an identifier type attribute";function w8(e,r){var t,n,a=e.getSubTypes();if(a===e8)return!1;if(a){var i=wm(a);try{for(var o=op(i),l=o.next();!l.done;l=o.next()){var u=l.value;if(!w8(u,r))return!1}}catch(c){t={error:c}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}}return e instanceof pp&&r.push(e),!0}var zc;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(zc||(zc={}));var IO=function(e){Zn(r,e);function r(t,n){return e.call(this,t,Rn.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 Yt("Map.put cannot be used to set empty values");if(An(t)){var n=rr(t);if(n.identifier===null)throw new Yt(wb);return this.set(n.identifier,t),t}else if(p8(t)){var a=rr(this),i=a.type;if(i.identifierMode!==zc.YES)throw new Yt(wb);var o=i.mapIdentifierAttribute,l=t[o];if(!Sm(l)){var u=this.put(i.getChildType().create(t,a.environment));return this.put(dm(u))}var c=Ih(l);return this.set(c,t),this.get(c)}else throw new Yt("Map.put can only be used to store complex values")}}),r}(Q1),j1=function(e){Zn(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:zc.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:Or.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(),ym(this,t,n,a,i)}}),Object.defineProperty(r.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===zc.UNKNOWN){var t=[];if(w8(this._subType,t)){var n=t.reduce(function(a,i){if(!i.identifierAttribute)return a;if(a&&a!==i.identifierAttribute)throw new Yt("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=zc.YES,this.mapIdentifierAttribute=n):this.identifierMode=zc.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 IO(t,this.name)}}),Object.defineProperty(r.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){Y2(n,t.unbox);var a=t.type;a.hookInitializers.forEach(function(i){var o=i(n);Object.keys(o).forEach(function(l){var u=o[l],c=dp(n,l,u);Ef(n,l,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 X2(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 Yt("Not a child "+n);return a}}),Object.defineProperty(r.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=rr(t.object),a=t.name;n.assertWritable({subpath:a});var i=n.type,o=i._subType;switch(t.type){case"update":{var l=t.newValue,u=t.object.get(a);if(l===u)return null;hc(o,l),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===zc.YES&&n instanceof vs){var a=n.identifier;if(a!==t)throw new Yt("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=rr(t.object);switch(t.type){case"update":return void n.emitPatch({op:"replace",path:Gc(t.name),value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:Gc(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:Gc(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(l){i[l]=!1}),n)for(var o in n)a.set(o,n[o]),i[""+o]=!0;Object.keys(i).forEach(function(l){i[l]===!1&&a.delete(l)})}}),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],mm(n,i,a._subType))})):ys(n,t,"Value is not a plain object")}}),Object.defineProperty(r.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return kh}}),Object.defineProperty(r.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){t.storedValue.delete(n)}}),r}(Ah);j1.prototype.applySnapshot=ca(j1.prototype.applySnapshot);function jO(e){return new j1("Map<string, ".concat(e.name,">"),e)}function FO(e){return Sa(e)&&(e.flags&Or.Map)>0}var F1=function(e){Zn(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:Or.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 ym(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,l){var u=""+l;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 Rn.array(d8(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(l){var u=o[l],c=dp(n,l,u);Ef(n,l,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 Yt("Not a child: "+n)}}),Object.defineProperty(r.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=rr(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=_b(n,a,[i[t.index]],[t.newValue],[t.index]);if(!o)return null;t.newValue=o[0]}break;case"splice":{var l=t.index,u=t.removedCount,c=t.added,h=_b(n,a,i.slice(l,l+u),c,c.map(function(w,d){return l+d}));if(!h)return null;t.added=h;for(var p=l+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=rr(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 bm(t)?n0(t.map(function(i,o){return a._subType.validate(i,mm(n,""+o,a._subType))})):ys(n,t,"Value is not an array")}}),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.splice(Number(n),1)}}),r}(Ah);F1.prototype.applySnapshot=ca(F1.prototype.applySnapshot);function DO(e){return new F1("".concat(e.name,"[]"),e)}function _b(e,r,t,n,a){for(var i=!0,o=0;;o++){var l=o<=n.length-1,u=t[o],c=l?n[o]:void 0,h=""+a[o];if(cO(c)&&(c=c.storedValue),!u&&!l)break;if(!l)i=!1,t.splice(o,1),u instanceof vs&&u.createObservableInstanceIfNeeded(),u.die(),o--;else if(u)if(Sb(u,c))t[o]=vg(r,e,h,c,u);else{for(var w=void 0,d=o;d<t.length;d++)if(Sb(t[d],c)){w=t.splice(d,1)[0];break}i=!1;var p=vg(r,e,h,c,w);t.splice(o,0,p)}else{if(An(c)&&rr(c).parent===e)throw new Yt("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(rr(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(An(n)){var l=rr(n);if(l.assertAlive(kh),l.parent!==null&&l.parent===r)return l.setParent(r,t),l}return a?e.reconcile(a,n,r,t):e.instantiate(r,t,void 0,n)}var o=i();return a&&a!==o&&(a instanceof vs&&a.createObservableInstanceIfNeeded(),a.die()),o}function Sb(e,r){if(!e.isAlive)return!1;if(An(r)){var t=rr(r);return t.isAlive&&t===e}if(e.snapshot===r)return!0;if(!(e instanceof vs))return!1;var n=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&xf(r)&&n.is(r)&&n.isMatchingSnapshotId(e,r)}function BO(e){return Sa(e)&&(e.flags&Or.Array)>0}var xb="preProcessSnapshot",Eb="postProcessSnapshot";function qO(){return rr(this).toString()}var Pb={name:"AnonymousModel",properties:{},initializers:Ch};function zO(e){var r=Object.keys(e),t=new Set;return r.forEach(function(n){if(t.has(n))throw new Yt("".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 Yt("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 Yt("Getters are not supported as properties. Please use views instead");var o=i.value;if(o==null)throw new Yt("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(Lh(o))n[a]=Pf($O(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 Yt("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 pp=function(e){Zn(r,e);function r(t){var n=e.call(this,t.name||Pb.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Or.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,Pb,t),n.properties=zO(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&Or.Identifier){if(t)throw new Yt("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 Yt("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(a){if(a===xb)throw new Yt("Cannot define action '".concat(xb,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(a===Eb)throw new Yt("Cannot define action '".concat(Eb,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var i=n[a],o=t[a];if(a in wa&&o){var l=i;i=function(){o.apply(null,arguments),l.apply(null,arguments)}}var u=i.$mst_middleware,c=i.bind(n);c._isFlowAction=i._isFlowAction||!1,c.$mst_middleware=u;var h=dp(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 Yt("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 Yt("volatile state initializer should return a plain object containing state");K2(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),l=o.actions,u=o.views,c=o.state,h=dP(o,["actions","views","state"]);for(var p in h)throw new Yt("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),l&&n.instantiateActions(i,l),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 Yt("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)Z2(t,a,o),Q2(t,(i={},i[a]=Tf,i));else if(typeof o.value=="function")Ef(t,a,o.value);else throw new Yt("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=An(i)?i:this.applySnapshotPreProcessor(i);return ym(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,l){i[o]=l.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 Rn.object(t,kh,n)}}),Object.defineProperty(r.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){Ef(n,"toString",qO),this.forAllProps(function(a){Y2(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=rr(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=rr(n.object),i=a.type.properties[n.name];if(i){var o=n.oldValue?n.oldValue.snapshot:void 0;a.emitPatch({op:"replace",path:Gc(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 Yt("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 Yt("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,l){try{var u=Mu(t.storedValue,o);u.reportObserved()}catch{throw new Yt("".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 Yt("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],mm(n,o,a.properties[o]))})):ys(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 kh}}),Object.defineProperty(r.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){t.storedValue[n]=void 0}}),r}(Ah);pp.prototype.applySnapshot=ca(pp.prototype.applySnapshot);function UO(){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 pp({name:t,properties:n})}function HO(){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 _8(e){return Sa(e)&&(e.flags&Or.Object)>0}var gc=function(e){Zn(r,e);function r(t,n,a,i){i===void 0&&(i=gO);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(Lh(t)&&this.checker(t))return ms();var a=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return ys(n,t,"Value is not a ".concat(a))}}),r}(Df),S8=new gc("string",Or.String,function(e){return typeof e=="string"}),x8=new gc("number",Or.Number,function(e){return typeof e=="number"}),VO=new gc("integer",Or.Integer,function(e){return vO(e)}),GO=new gc("float",Or.Float,function(e){return mO(e)}),WO=new gc("finite",Or.Finite,function(e){return yO(e)}),E8=new gc("boolean",Or.Boolean,function(e){return typeof e=="boolean"}),P8=new gc("null",Or.Null,function(e){return e===null}),O8=new gc("undefined",Or.Undefined,function(e){return e===void 0}),A8=new gc("Date",Or.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});A8.getSnapshot=function(e){return e.storedValue.getTime()};var C8=A8;function $O(e){switch(typeof e){case"string":return S8;case"number":return x8;case"boolean":return E8;case"object":if(e instanceof Date)return C8}throw new Yt("Cannot determine primitive type from value "+e)}function k8(e){return Sa(e)&&(e.flags&(Or.String|Or.Number|Or.Integer|Or.Boolean|Or.Date))>0}var YO=function(e){Zn(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:Or.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 Lh(t)&&t===this.value?ms():ys(n,t,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),r}(Df);function L8(e){return new YO(e)}function XO(e){return Sa(e)&&(e.flags&Or.Literal)>0}var KO=function(e){Zn(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|Or.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=An(t)?rr(t).snapshot:t;return this._predicate(i)?ms():ys(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 ZO(){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 KO(t,n,a,i)}function QO(e){return Sa(e)&&(e.flags&Or.Refinement)>0}function JO(e,r){var t=typeof e=="string"?r:e,n=a0.apply(void 0,ju([],Iu(t.map(function(a){return L8(""+a)})),!1));return typeof e=="string"&&(n.name=e),n}var eA=function(e){Zn(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=Or.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 Yt("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 Yt("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 l=this._types[o],u=l.validate(t,n);if(u.length===0){if(this._eager)return ms();i++}else a.push(u)}return i===1?ms():ys(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 eA(i,a,n)}function N8(e){return Sa(e)&&(e.flags&Or.Union)>0}var tA=function(e){Zn(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|Or.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?ms():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 rA(e,r){if(typeof r!="function"&&An(r))throw new Yt("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function Pf(e,r,t){return rA(e,r),new tA(e,r,t||nA)}var nA=[void 0];function iA(e){return Sa(e)&&(e.flags&Or.Optional)>0}var aA=Pf(O8,void 0),oA=Pf(P8,null);function T8(e){return a0(e,aA)}function sA(e){return a0(e,oA)}var lA=function(e){Zn(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)|Or.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 Yt("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):ms()}}),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||e8}}),r}(pc);function uA(e,r){var t=typeof e=="string"?e:"late(".concat(e.toString(),")"),n=typeof e=="string"?r:e;return new lA(t,n)}function cA(e){return Sa(e)&&(e.flags&Or.Late)>0}function fA(e,r){return new hA(e,r)}var hA=function(e){Zn(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:Or.Lazy}),Object.defineProperty(a,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(a,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:Rn.array()}),w2(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 l=nf(this,t,n,a,i);return this.pendingNodeList.push(l),w2(function(){return!l.isAlive},function(){return o.pendingNodeList.splice(o.pendingNodeList.indexOf(l),1)}),l}}),Object.defineProperty(r.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this.loadedType?this.loadedType.validate(t,n):g8(t)?ms():ys(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}(Df),R8=function(e){Zn(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:Or.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 g8(t)?this.subType?this.subType.validate(t,n):ms():ys(n,t,"Value is not serializable and cannot be frozen")}}),r}(Df),Ob=new R8;function dA(e){return arguments.length===0?Ob:Sa(e)?new R8(e):Pf(Ob,e)}function pA(e){return Sa(e)&&(e.flags&Or.Frozen)>0}function gA(e){switch(e){case wa.beforeDestroy:return"destroy";case wa.beforeDetach:return"detach";default:return}}var vA=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}),Sm(r))this.identifier=r;else if(An(r)){var n=rr(r);if(!n.identifierAttribute)throw new Yt("Can only store references with a defined identifier attribute.");var a=n.unnormalizedIdentifier;if(a==null)throw new Yt("Can only store references to tree nodes with a defined identifier.");this.identifier=a}else throw new Yt("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=Ih(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 _m("[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}(),_m=function(e){Zn(r,e);function r(t){var n=e.call(this,t)||this;return Object.setPrototypeOf(n,r.prototype),n}return r}(Error),M8=function(e){Zn(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:Or.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 Sm(t)?ms():ys(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 l=o.storedValue;l&&this.onInvalidated({cause:t,parent:l,invalidTarget:i?i.storedValue:void 0,invalidId:a,replaceRef:function(u){Oh(n.root.storedValue,{op:"replace",value:u,path:n.path})},removeRef:function(){_8(o.type)?this.replaceRef(void 0):Oh(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=rr(i),l=function(h,p){var w=gA(p);w&&a.fireInvalidated(w,t,n,o)},u=o.registerHook(wa.beforeDetach,l),c=o.registerHook(wa.beforeDestroy,l);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 l=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,Ih(n)),p?o=i.addTargetNodeWatcher(t,n):u||i.fireInvalidated("invalidSnapshotReference",t,n,null)}};t.state===io.FINALIZED?l(!0):(t.isRoot||t.root.registerHook(wa.afterCreationFinalization,function(){t.parent&&t.parent.createObservableInstanceIfNeeded()}),t.registerHook(wa.afterAttach,function(){l(!1)}))}}}),r}(Df),mA=function(e){Zn(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=An(i)?Y6(i):i,l=new vA(i,this.targetType),u=nf(this,t,n,a,l);return l.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=An(n),l=t.storedValue;if(!o&&l.identifier===n||o&&l.resolvedValue===n)return t.setParent(a,i),t}var u=this.instantiate(a,i,void 0,n);return t.die(),u}}),r}(M8),yA=function(e){Zn(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=An(i)?this.options.set(i,t?t.storedValue:null):i,l=nf(this,t,n,a,o);return this.watchTargetNodeForInvalidations(l,o,this.options),l}}),Object.defineProperty(r.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,i){var o=An(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 l=this.instantiate(a,i,void 0,o);return t.die(),l}}),r}(M8);function I8(e,r){var t=r||void 0,n=r?r.onInvalidated:void 0;return t&&(t.get||t.set)?new yA(e,{get:t.get,set:t.set},n):new mA(e,n)}function bA(e){return Sa(e)&&(e.flags&Or.Reference)>0}function wA(e,r){var t=I8(e,_a(_a({},r),{onInvalidated:function(n){r&&r.onInvalidated&&r.onInvalidated(n),n.removeRef()}}));return r&&r.acceptsUndefined===!1?t:T8(t)}var j8=function(e){Zn(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:Or.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 pp))throw new Yt("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 Yt("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?ys(n,t,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):ms()}}),r}(Df),_A=function(e){Zn(r,e);function r(){var t=e.call(this,"identifier","string")||this;return Object.defineProperty(t,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Or.Identifier}),t}return Object.defineProperty(r.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),r}(j8),SA=function(e){Zn(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}(j8),xA=new _A,EA=new SA;function PA(e){return Sa(e)&&(e.flags&Or.Identifier)>0}function Ih(e){return""+e}function Sm(e){return typeof e=="string"||typeof e=="number"}function OA(e){return new AA(e)}var AA=function(e){Zn(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:Or.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 ms();var a=this.options.getValidationMessage(t);return a?ys(n,t,"Invalid value for type '".concat(this.name,"': ").concat(a)):ms()}}),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 l=t.type===this&&(o?n===t.snapshot:n===t.storedValue);if(l)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}(Df),Ab={enumeration:JO,model:UO,compose:HO,custom:OA,reference:I8,safeReference:wA,union:a0,optional:Pf,literal:L8,maybe:T8,maybeNull:sA,refinement:ZO,string:S8,boolean:E8,number:x8,integer:VO,float:GO,finite:WO,Date:C8,map:jO,array:DO,frozen:dA,identifier:xA,identifierNumber:EA,late:uA,lazy:fA,undefined:O8,null:P8,snapshotProcessor:MO};const CA=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:MP,addMiddleware:a8,applyAction:t8,applyPatch:Oh,applySnapshot:G6,cast:DP,castFlowReturn:EO,castToReferenceSnapshot:qP,castToSnapshot:BP,clone:NP,createActionTrackingMiddleware:GP,createActionTrackingMiddleware2:$P,decorate:JP,destroy:RP,detach:TP,escapeJsonPath:Gc,flow:y8,getChildType:pP,getEnv:IP,getIdentifier:Y6,getLivelinessChecking:U6,getMembers:FP,getNodeId:zP,getParent:_P,getParentOfType:xP,getPath:$6,getPathParts:EP,getPropertyMembers:Z6,getRelativePath:LP,getRoot:W6,getRunningActionContext:vm,getSnapshot:dm,getType:Cp,hasEnv:jP,hasParent:wP,hasParentOfType:SP,isActionContextChildOf:rO,isActionContextThisOrChildOf:nO,isAlive:pm,isArrayType:BO,isFrozenType:pA,isIdentifierType:PA,isLateType:cA,isLiteralType:XO,isMapType:FO,isModelType:_8,isOptionalType:iA,isPrimitiveType:k8,isProtected:bP,isReferenceType:bA,isRefinementType:QO,isRoot:PP,isStateTreeNode:An,isType:Sa,isUnionType:N8,isValidReference:kP,joinJsonPath:I1,onAction:r8,onPatch:V6,onSnapshot:gP,process:dO,protect:mP,recordActions:ZP,recordPatches:vP,resolveIdentifier:AP,resolvePath:OP,setLivelinessChecking:z6,setLivelynessChecking:hP,splitJsonPath:Nh,t:Ab,toGenerator:OO,toGeneratorFunction:PO,tryReference:CP,tryResolve:X6,typecheck:l8,types:Ab,unescapeJsonPath:b8,unprotect:yP,walk:K6},Symbol.toStringTag,{value:"Module"})),hl=Kc(CA);var mg={},Cb;function F8(){return Cb||(Cb=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 kb;function D8(){return kb||(kb=1,function(e){var r=Dd&&Dd.__importDefault||function(x){return x&&x.__esModule?x:{default:x}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=e.getLineHeight=e.useFontLoader=void 0,e.isRTLText=j,e.getDir=T,e.usePrevious=C;const t=r(di()),n=zs,a=Fu,i=Mh,o=fl,l=r(Us()),u=cP,c=Pp(),h=jf(),p=Op(),w=tf(),d=B6(),_=Ap(),E=If(),S=Ff(),y=rf(),g=hl,v=F8();l.default._fixTextRendering=!0;const b=document.createElement("style");b.type="text/css",document.head.appendChild(b);const O={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal"};function j(x){x=x.replace(/\s/g,"");let L=0;for(var A=0;A<x.length;A++)N=x[A],I="֑-߿יִ-﷽ﹰ-ﻼ",new RegExp("^[^"+I+"]*?["+I+"]").test(N)&&(L+=1);var N,I;return L>x.length/2}function T(x){return j(x)?"rtl":"ltr"}const M=(0,n.observer)(({textNodeRef:x,element:L,onBlur:A,selectAll:N,cursorPosition:I})=>{const[W,G]=t.default.useState(O),$=x.current;t.default.useLayoutEffect(()=>{const D={};D.width=$.width()-2*$.padding()+"px",D.height=$.height()-2*$.padding()+$.fontSize()*$.lineHeight()+"px",D.fontSize=$.fontSize()+"px",D.lineHeight=$.lineHeight()+.01,D.fontFamily=$.fontFamily(),D.textAlign=$.align(),D.color=$.fill(),D.fontWeight=L.fontWeight,D.fontStyle=L.fontStyle,D.letterSpacing=L.letterSpacing+"em";const K=`
|
|
96
|
-
.polotno-input::placeholder {
|
|
97
|
-
color: ${W.color};
|
|
98
|
-
opacity: 0.6;
|
|
99
|
-
}
|
|
100
|
-
`;b.innerHTML="",b.appendChild(document.createTextNode(K)),JSON.stringify(D)!==JSON.stringify(W)&&G(D)});const J=t.default.useRef(null);t.default.useLayoutEffect(()=>{var D;const K=J.current;if(!K)return;(D=J.current)===null||D===void 0||D.focus();const ne=I||K.value.length;K.selectionStart=K.selectionEnd=ne,N&&(K==null||K.select(),document.execCommand("selectAll",!1,null))},[]),t.default.useEffect(()=>{window.addEventListener("blur",A);const D=K=>{var ne;!((ne=J.current)===null||ne===void 0)&&ne.contains(K.target)||A()};return window.addEventListener("touchstart",D),()=>{window.removeEventListener("blur",A),window.removeEventListener("touchstart",D)}},[]);let V=0;const H=$.textArr.length*$.lineHeight()*$.fontSize();L.verticalAlign==="middle"&&(V=(L.a.height-H)/2),L.verticalAlign==="bottom"&&(V=L.a.height-H);const z=(0,d.removeTags)(L.text);return t.default.createElement("textarea",{className:"polotno-input",ref:J,dir:T(z),style:Object.assign(Object.assign(Object.assign({},O),W),{paddingTop:V+"px"}),value:z,onChange:D=>{const K=(0,v.getLimitedFontSize)({oldText:L.text,newText:D.target.value,element:L});L.set({text:D.target.value,fontSize:K})},placeholder:L.placeholder,onBlur:A})}),F=x=>t.default.createElement(i.Html,null,t.default.createElement(M,Object.assign({},x)));function C(x){const L=t.default.useRef(x),A=t.default.useRef(x);return t.default.useMemo(()=>{A.current=L.current,L.current=x},[x]),A.current}e.useFontLoader=(x,L)=>{const[A,N]=t.default.useReducer(W=>W+1,0),I=t.default.useRef((0,p.isFontLoaded)(L));return t.default.useLayoutEffect(()=>{if(I.current=(0,p.isFontLoaded)(L),I.current)return;let W=!0;return(async()=>{I.current=!1,N();const G=(0,h.incrementLoader)(`text ${L}`);await x.loadFont(L),setTimeout(G,100),W&&(I.current=!0,N())})(),()=>{W=!1}},[L]),[I.current]},e.getLineHeight=({fontLoaded:x,fontFamily:L,fontSize:A,lineHeight:N})=>t.default.useMemo(()=>{if(typeof N=="number")return N;const I=document.createElement("div");I.style.fontFamily=L,I.style.fontSize=A+"px",I.style.lineHeight=N,I.innerText="Test text",document.body.appendChild(I);const W=I.offsetHeight;return document.body.removeChild(I),W/A},[x,L,A,N]),e.TextElement=(0,n.observer)(({element:x,store:L})=>{const A=t.default.useRef(null),N=t.default.useRef(null),{editorEnabled:I,selectAll:W}=(Ee=>{const[Ne,he]=t.default.useState(!1),Le=t.default.useRef(!1);return t.default.useEffect(()=>{var Ce=!0;return setTimeout(()=>{Ce&&(Ee._editModeEnabled&&(Le.current=!0),he(!0),setTimeout(()=>{Le.current=!1},50))},50),()=>{Ce=!1}},[]),{editorEnabled:Ne&&Ee._editModeEnabled,selectAll:Le.current}})(x),[G,$]=t.default.useState(!1),[J,V]=t.default.useState(!1),H=t.default.useRef(x.a.height),z=L.selectedShapes.indexOf(x)>=0&&x.selectable,{textVerticalResizeEnabled:D}=w.flags,K=C(x.fontFamily),[ne,Z]=t.default.useState([]);t.default.useEffect(()=>{var Ee,Ne;const he=(Ne=(Ee=A.current)===null||Ee===void 0?void 0:Ee.textArr)!==null&&Ne!==void 0?Ne:[];JSON.stringify(he)!==JSON.stringify(ne)&&Z(he)}),t.default.useEffect(()=>{if(x.a.width)return;const Ee=A.current;Ee.width(600),x.set({width:1.4*Ee.getTextWidth()})},[]),t.default.useLayoutEffect(()=>(0,o.autorun)(()=>{const Ee=A.current;(0,_.applyFilter)(Ee,x)}));const[ee]=(0,e.useFontLoader)(L,x.fontFamily),ae=(0,d.removeTags)(x.text),se=()=>{const Ee=A.current.clone({height:void 0}),Ne=Math.ceil(Ee.fontSize()*Ee.lineHeight()*Ee.textArr.length+1);return Ee.destroy(),Ne};t.default.useLayoutEffect(()=>{if(!ee)return;const{textOverflow:Ee,textSplitAllowed:Ne}=w.flags;if(x.a.height){if(!L.isPlaying)if(Ee!=="change-font-size"||J){if(Ee==="resize"){const he=se();D&&x.a.height<he&&L.history.ignore(()=>{var Le;(0,g.isAlive)(x)&&x.set({height:he}),(Le=A.current)===null||Le===void 0||Le.height(he)},!1,!0),D||x.a.height===he||L.history.ignore(()=>{var Le;(0,g.isAlive)(x)&&x.set({height:he}),(Le=A.current)===null||Le===void 0||Le.height(he)},!1,!0)}}else{const he=function(Ce,De,tt=!1){const vt=Ce.fontSize(),mt=Ce.height(),Et=(0,d.removeTags)(De.text);let nt=De.a.fontSize;Ce.height(void 0);const at=Math.round(2*De.a.fontSize)-1;for(let qt=1;qt<at;qt++){const Ct=De.a.height&&Ce.height()>De.a.height;let or=Et.split(`
|
|
101
|
-
`).join(" ").split(/[\s-]+/).reduce((We,Nt)=>/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(Nt)?We.concat(Nt.split("")):We.concat(Nt),[]),Xt=Ce.textArr.map(We=>We.text).join(";");const qe=or.find(We=>!Xt.includes(We)||(Xt=Xt.replace(We,""),!1));if(!(Ct||qe&&!tt))break;nt-=.5,Ce.fontSize(nt)}return Ce.fontSize(vt),Ce.height(mt),nt}(A.current,x,Ne);if(he!==x.a.fontSize)return void L.history.ignore(()=>{x.set({fontSize:he})},!1,!0);const Le=se();x.a.height===Le||D||L.history.ignore(()=>{x.set({height:Le})},!1,!0)}}else{const he=se();L.history.ignore(()=>{x.set({height:he})},!1,!0)}}),t.default.useLayoutEffect(()=>{const Ee=A.current;Ee&&(Ee.width(Ee.width()+1e-8),Ee._setTextData(),(0,_.applyFilter)(Ee,x))},[ee]);const ce=t.default.useRef(null),me=t.default.useRef(0),xe=Ee=>{Ee.evt.preventDefault(),L.selectedShapes.find(he=>he===x)&&x.contentEditable&&(me.current=function(he){var Le;const Ce=he.target,De=function(at){var qt=at.getAbsoluteTransform().copy();qt.invert();var Ct=at.getStage().getPointerPosition();return qt.point(Ct)}(Ce),tt=Ce.textArr,vt=Math.floor(De.y/(Ce.fontSize()*Ce.lineHeight())),mt=tt.slice(0,vt).reduce((at,qt)=>at+qt.text.length,vt),Et=(Le=tt[vt])!==null&&Le!==void 0?Le:tt[0];let nt=0;return Ce.align()==="right"?nt=Ce.width()-Et.width:Ce.align()==="center"&&(nt=Ce.width()/2-Et.width/2),mt+Math.round((De.x-nt)/Et.width*Et.text.length)}(Ee),x.toggleEditMode())},Oe=!ae&&x.placeholder?.6:x.a.opacity;(0,E.useFadeIn)(A,Oe);const Re=(0,e.getLineHeight)({fontLoaded:ee,fontFamily:x.fontFamily,fontSize:x.a.fontSize,lineHeight:x.lineHeight}),Se=x.selectable||L.role==="admin",ve=(0,c.useColor)(x),He=t.default.useMemo(()=>x.backgroundEnabled?function({lines:Ee,lineHeight:Ne,width:he,align:Le="left",padding:Ce=0,cornerRadius:De=0}){var tt;Ee.forEach((nt,at)=>{nt.cx=he/2,Le==="right"?nt.cx=he-nt.width/2:Le==="left"&&(nt.cx=nt.width/2),Le!=="justify"||nt.lastInParagraph||(nt.width=he),Le==="justify"&&(nt.cx=nt.width/2)});let vt=`M ${(tt=Ee[0])===null||tt===void 0?void 0:tt.cx} ${-Ce}`;Ee.forEach((nt,at)=>{const{cx:qt}=nt,Ct=Ee[at-1];Ct&&Ct.width>nt.width?vt+=` L ${qt+nt.width/2+Ce} ${at*Ne+Ce}`:vt+=` L ${qt+nt.width/2+Ce} ${at*Ne-Ce}`;const or=Ee[at+1];or&&or.width>nt.width?vt+=` L ${qt+nt.width/2+Ce} ${(at+1)*Ne-Ce}`:vt+=` L ${qt+nt.width/2+Ce} ${(at+1)*Ne+Ce}`});for(var mt=Ee.length-1;mt>=0;mt--){const nt=Ee[mt],{cx:at}=nt,qt=Ee[mt+1];qt&&qt.width>nt.width?vt+=` L ${at-nt.width/2-Ce} ${(mt+1)*Ne-Ce}`:vt+=` L ${at-nt.width/2-Ce} ${(mt+1)*Ne+Ce}`;const Ct=Ee[mt-1];Ct&&Ct.width>nt.width?vt+=` L ${at-nt.width/2-Ce} ${mt*Ne+Ce}`:vt+=` L ${at-nt.width/2-Ce} ${mt*Ne-Ce}`}vt+=" Z";const Et=(0,u.parsePath)(vt);return(0,u.roundCommands)(Et,De).path}({lines:JSON.parse(JSON.stringify(ne)),cornerRadius:x.backgroundCornerRadius*(x.a.fontSize*Re*.5),lineHeight:Re*x.a.fontSize,padding:x.backgroundPadding*(x.a.fontSize*Re*.5),width:x.a.width,align:x.align}):"",[x.backgroundEnabled,x.backgroundCornerRadius,x.a.fontSize,Re,x.backgroundPadding,x.a.width,x.align,ne]),we=(0,y.isTouchDevice)();let Ae=0;return x.verticalAlign==="middle"?Ae=(x.a.height-ne.length*Re*x.a.fontSize)/2:x.verticalAlign==="bottom"&&(Ae=x.a.height-ne.length*Re*x.a.fontSize),t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Path,{ref:N,x:x.a.x,y:x.a.y,rotation:x.a.rotation,hideInExport:!x.showInExport,listening:!1,visible:x.backgroundEnabled,opacity:x.backgroundOpacity*Oe,data:He,fill:x.backgroundColor,offsetY:-Ae}),t.default.createElement(a.Text,Object.assign({ref:A,id:x.id,name:"element",hideInExport:!x.showInExport,editModeEnabled:x._editModeEnabled,x:x.a.x,y:x.a.y,rotation:x.a.rotation,width:x.a.width,height:x.a.height,text:ae||x.placeholder,direction:T(ae)},ve,{stroke:x.stroke,lineJoin:"round",strokeWidth:x.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:x.a.fontSize,fontFamily:`"${x.fontFamily}", "${K}"`,fontStyle:x.fontStyle+" "+x.fontWeight,textDecoration:x.textDecoration,align:x.align,verticalAlign:x.verticalAlign,draggable:we?x.draggable&&z:x.draggable,preventDefault:!we||z,opacity:Oe,visible:!x._editModeEnabled,ellipsis:w.flags.textOverflow==="ellipsis",shadowEnabled:x.shadowEnabled,shadowBlur:x.shadowBlur,shadowOffsetX:x.shadowOffsetX,shadowOffsetY:x.shadowOffsetY,shadowColor:x.shadowColor,shadowOpacity:x.shadowOpacity,lineHeight:Re,letterSpacing:x.letterSpacing*x.a.fontSize,listening:Se,onDragMove:Ee=>{x.set({x:Ee.target.x(),y:Ee.target.y()})},onDragEnd:Ee=>{x.set({x:Ee.target.x(),y:Ee.target.y()})},onMouseEnter:()=>{$(!0)},onMouseLeave:()=>{$(!1)},onClick:xe,onTap:xe,onTransformStart:()=>{V(!0),H.current=A.current.height()},onTransform:Ee=>{var Ne,he;const Le=Ee.target;(Ne=N.current)===null||Ne===void 0||Ne.setAttrs({x:Le.x(),y:Le.y(),rotation:Le.rotation(),scale:Le.scale()});const Ce=((he=Le.getStage())===null||he===void 0?void 0:he.findOne("Transformer")).getActiveAnchor();if(Ce==="middle-left"||Ce==="middle-right"){const De=Le.scaleX(),tt=Le.width()*De,vt=x.a.fontSize;let mt=tt;tt<vt&&(mt=vt,ce.current&&Le.position(ce.current)),Le.width(mt),Le.scaleX(1),Le.scaleY(1);const Et=se();if(w.flags.textOverflow!=="ellipsis"){const nt=Math.max(Et,H.current);Le.height(nt),x.set({height:Le.height()})}x.set({x:Le.x(),y:Le.y(),width:Le.width(),rotation:Le.rotation()}),(0,_.applyFilter)(Le,x)}if(Ce==="top-center"||Ce==="bottom-center"){let De=w.flags.textOverflow==="resize"?se():Re*x.a.fontSize;Ee.target.height(Math.max(De,Ee.target.height()*Ee.target.scaleY())),Ee.target.scaleY(1)}ce.current=Ee.target.position()},onTransformEnd:Ee=>{var Ne;const he=Ee.target.scaleX();Ee.target.scaleX(1),Ee.target.scaleY(1),x.set({fontSize:Math.round(x.a.fontSize*he),width:Math.ceil(Ee.target.width()*he),x:Ee.target.x(),y:Ee.target.y(),rotation:Ee.target.rotation(),height:Ee.target.height()*he,shadowBlur:x.shadowBlur*he,shadowOffsetX:x.shadowOffsetX*he,shadowOffsetY:x.shadowOffsetY*he,strokeWidth:x.strokeWidth*he}),(Ne=N.current)===null||Ne===void 0||Ne.setAttrs({scaleX:1,scaleY:1}),V(!1)}})),I&&t.default.createElement(a.Group,{x:x.a.x,y:x.a.y,rotation:x.a.rotation},t.default.createElement(F,{textNodeRef:A,element:x,selectAll:W,cursorPosition:me.current,onBlur:()=>{x.toggleEditMode(!1)}})),!J&&(G||z)&&t.default.createElement(S.Highlighter,{element:x}))})}(Dd)),Dd}var Fl={},Vd={},yg={exports:{}},bg={exports:{}},Lb;function xm(){return Lb||(Lb=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 Nb;function B8(){return Nb||(Nb=1,function(e,r){xm()("lex"),e.exports=t;function t(n){var a="",i,o=0,l=-1,u=0,c=1,h="before-selector",p=[h],w={},d=[],_=["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 M(),n[l]}function S(G){return G?p[p.length-1-G]:h}function y(G){var $=l+1;return G===n.slice($,$+G.length)}function g(G){var $=n.slice(l).indexOf(G);return $>0?$:!1}function v(G){return G===b(1)}function b(G){return n[l+(G||1)]}function O(){var G=p.pop();return h=p[p.length-1],G}function j(G){return h=G,p.push(h),p.length}function T(G){var $=h;return p[p.length-1]=h=G,$}function M(G){if((G||1)==1)n[l]==`
|
|
103
|
-
`?(c++,o=1):o++,l++;else{var $=n.slice(l,l+G).split(`
|
|
104
|
-
`);$.length>1&&(c+=$.length-1,o=1),o+=$[$.length-1].length,l=l+G}}function F(){w.end={line:c,col:o},d.push(w),a="",w={}}function C(G){w={type:G,start:{line:c,col:o}}}for(;i=E();)switch(i){case" ":switch(S()){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(S()){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
|
-
`&&(w.value=a.trim(),F(),O());break}break;case":":switch(S()){case"name":w.name=a.trim(),a="",T("before-value");break;case"before-selector":a+=i,C("selector"),j("selector");break;case"before-value":T("value"),a+=i;break;default:a+=i;break}break;case";":switch(S()){case"name":case"before-value":case"value":a.trim().length>0&&(w.value=a.trim(),F()),T("before-name");break;case"value-paren":a+=i;break;case"at-value":w.value=a.trim(),F(),O();break;case"before-name":break;default:a+=i;break}break;case"{":switch(S()){case"selector":if(b(-1)==="\\"){a+=i;break}w.text=a.trim(),F(),T("before-name"),u=u+1;break;case"at-group":switch(w.name=a.trim(),w.type){case"font-face":case"viewport":case"page":j("before-name");break;default:j("before-selector")}F(),u=u+1;break;case"name":case"at-rule":w.name=a.trim(),F(),j("before-name"),u=u+1;break;case"comment":case"double-string":case"single-string":a+=i;break;case"before-value":T("value"),a+=i;break}break;case"}":switch(S()){case"before-name":case"name":case"before-value":case"value":a&&(w.value=a.trim()),w.name&&w.value&&F(),C("end"),F(),O(),S()==="at-group"&&(C("at-group-end"),F(),O()),u>0&&(u=u-1);break;case"at-group":case"before-selector":case"selector":if(b(-1)==="\\"){a+=i;break}u>0&&S(1)==="at-group"&&(C("at-group-end"),F()),u>1&&O(),u>0&&(u=u-1);break;case"double-string":case"single-string":case"comment":a+=i;break}break;case'"':case"'":switch(S()){case"double-string":i==='"'&&b(-1)!=="\\"&&O();break;case"single-string":i==="'"&&b(-1)!=="\\"&&O();break;case"before-at-value":T("at-value"),j(i==='"'?"double-string":"single-string");break;case"before-value":T("value"),j(i==='"'?"double-string":"single-string");break;case"comment":break;default:b(-1)!=="\\"&&j(i==='"'?"double-string":"single-string")}a+=i;break;case"/":switch(S()){case"comment":case"double-string":case"single-string":a+=i;break;case"before-value":case"selector":case"name":case"value":if(v("*")){var x=g("*/");x&&M(x+1)}else S()=="before-value"&&T("value"),a+=i;break;default:v("*")?(C("comment"),j("comment"),M()):a+=i;break}break;case"*":switch(S()){case"comment":v("/")?(w.text=a,M(),F(),O()):a+=i;break;case"before-selector":a+=i,C("selector"),j("selector");break;case"before-value":T("value"),a+=i;break;default:a+=i}break;case"@":switch(S()){case"comment":case"double-string":case"single-string":a+=i;break;case"before-value":T("value"),a+=i;break;default:for(var L=!1,A,N,I=0,W=_.length;!L&&I<W;++I)N=_[I],A=N.name||N,y(A)&&(L=!0,C(A),j(N.state||"at-group"),M(A.length),N.prefix&&(w.prefix=N.prefix),N.type&&(w.type=N.type));L||(a+=i);break}break;case"(":switch(S()){case"value":j("value-paren");break;case"before-value":T("value");break}a+=i;break;case")":switch(S()){case"value-paren":O();break;case"before-value":T("value");break}a+=i;break;default:switch(S()){case"before-selector":C("selector"),j("selector");break;case"before-name":C("property"),T("name");break;case"before-value":T("value");break;case"before-at-value":T("at-value");break}a+=i;break}return d}}(yg)),yg.exports}var wg={exports:{}},Tb;function kA(){return Tb||(Tb=1,function(e,r){xm()("parse");var t=B8();e.exports=l;var n,a,i,o;function l(O,j){j||(j={}),n=!!j.comments,i=!!j.position,a=0,o=Array.isArray(O)?O.slice():t(O);for(var T,M=[],F;F=c();)T=y(F),T&&M.push(T);return{type:"stylesheet",stylesheet:{rules:M}}}function u(O,j){j||(j={});for(var T,M=["type","name","value"],F={},C=0;C<M.length;++C)T=M[C],O[T]&&(F[T]=j[T]||O[T]);for(M=Object.keys(j),C=0;C<M.length;++C)T=M[C],F[T]||(F[T]=j[T]);return i&&(F.position={start:O.start,end:O.end}),F}function c(){var O=o.shift();return O}function h(O){a=a+1;var j={};switch(O.type){case"font-face":case"viewport":j.declarations=v();break;case"page":j.prefix=O.prefix,j.declarations=v();break;default:j.prefix=O.prefix,j.rules=b()}return u(O,j)}function p(O){return u(O)}function w(O){return u(O)}function d(O){return u(O,{text:O.text})}function _(O){return u(O)}function E(O){return u(O)}function S(O){function j(T){return T.trim()}return u(O,{type:"rule",selectors:O.text.split(",").map(j),declarations:v()})}function y(O){switch(O.type){case"property":return E(O);case"selector":return S(O);case"at-group-end":a=a-1;return;case"media":case"keyframes":return h(O);case"comment":if(n)return d(O);break;case"charset":return w(O);case"import":return p(O);case"namespace":return _(O);case"font-face":case"supports":case"viewport":case"document":case"page":return h(O)}}function g(O){for(var j,T=[],M;(M=c())&&O&&O(M);)j=y(M),j&&T.push(j);return M&&M.type!=="end"&&o.unshift(M),T}function v(){return g(function(O){return O.type==="property"||O.type==="comment"})}function b(){return g(function(){return a})}}(wg)),wg.exports}var _g={exports:{}},Rb;function LA(){return Rb||(Rb=1,function(e,r){xm()("stringify");var t,n,a,i,o,l;e.exports=u;function u(b,O){O||(O={}),a=O.indentation||"",n=!!O.compress,t=!!O.comments,i=1,n?o=l="":(o=`
|
|
107
|
-
`,l=" ");var j=_(b.stylesheet.rules,g).join(`
|
|
108
|
-
`).trim();return j}function c(b){if(b){i+=b;return}return n?"":Array(i).join(a||"")}function h(b){return"@"+b.type+" "+b.value+";"+o}function p(b){var O="",j=b.prefix||"";b.name&&(O=" "+b.name);var T=b.type!=="page";return"@"+j+b.type+O+l+E(b,T)+o}function w(b){return t?"/*"+(b.text||"")+"*/"+o:""}function d(b){var O;return b.selectors?O=b.selectors.join(","+o):(O="@"+b.type,O+=b.name?" "+b.name:""),c()+O+l+E(b)+o}function _(b,O){return b.reduce(function(j,T){var M=T.type==="comment"?w(T):O(T);return M&&j.push(M),j},[])}function E(b,O){var j=b.declarations,T=y;return b.rules&&(j=b.rules,T=d),j=S(j,T),j&&(j=o+j+(O?"":o)),"{"+j+c()+"}"}function S(b,O){if(!b)return"";c(1);var j=_(b,O);return c(-1),j.length?j.join(o):""}function y(b){if(b.type==="property")return v(b)}function g(b){switch(b.type){case"rule":return d(b);case"media":case"keyframes":return p(b);case"comment":return w(b);case"import":case"charset":case"namespace":return h(b);case"font-face":case"supports":case"viewport":case"document":case"page":return p(b)}}function v(b){var O=b.name?b.name+":"+l:"";return c()+O+b.value+";"}}(_g)),_g.exports}var Sg,Mb;function NA(){return Mb||(Mb=1,Sg={lex:B8(),parse:kA(),stringify:LA()}),Sg}var Ib;function kp(){return Ib||(Ib=1,function(e){var r=Vd&&Vd.__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 d(await E.text())},e.urlToString=p,e.getColors=w,e.svgToURL=d,e.getSvgSize=async function(_){const E=await p(_),S=new DOMParser().parseFromString(E,"image/svg+xml").documentElement.getAttribute("viewBox"),[y,g,v,b]=(S==null?void 0:S.split(" "))||[];return{width:parseFloat(v),height:parseFloat(b)}},e.fixSize=function(_){var E=new DOMParser().parseFromString(_,"image/svg+xml");const S=E.documentElement.getAttribute("viewBox"),[y,g,v,b]=(S==null?void 0:S.split(" "))||[],O=E.documentElement.getAttribute("width");O||E.documentElement.setAttribute("width",v+"px");const j=E.documentElement.getAttribute("height");if((!j||j.indexOf("%")>=0)&&E.documentElement.setAttribute("height",b+"px"),O&&O.indexOf("%")>=0&&j&&j.indexOf("%")===-1){const T=parseFloat(j)/parseFloat(b);E.documentElement.setAttribute("width",T*parseFloat(v)+"px")}if(j&&j.indexOf("%")>=0&&O&&O.indexOf("%")===-1){const T=parseFloat(O)/parseFloat(v);E.documentElement.setAttribute("height",T*parseFloat(b)+"px")}return O==="100%"&&j==="100%"&&(E.documentElement.setAttribute("width",v+"px"),E.documentElement.setAttribute("height",b+"px")),new XMLSerializer().serializeToString(E)},e.replaceColors=function(_,E){var S=new DOMParser().parseFromString(_,"image/svg+xml");const y=h(S),g=Array.from(E.keys()),v=l(S);return y.forEach(b=>{const{fill:O,stroke:j}=u(b,v);[{prop:"fill",color:O},{prop:"stroke",color:j}].forEach(({prop:T,color:M})=>{const F=g.find(C=>(0,e.sameColors)(C,M));if(F){const C=E.get(F);if((0,a.isGradient)(C)){const{rotation:x,stops:L}=(0,a.parseColor)(C),A=L.map(I=>({offset:100*I.offset+"%","stop-color":I.color})),N="color"+Math.round(1e8*Math.random());(function(I,W,G,$){var J=I.namespaceURI,V=document.createElementNS(J,"linearGradient");const H=t.default.Util.degToRad(G+90),z=(Math.cos(H)+1)/2,D=(Math.sin(H)+1)/2,K=(Math.cos(H+Math.PI)+1)/2,ne=(Math.sin(H+Math.PI)+1)/2;V.setAttribute("x1",100*z+"%"),V.setAttribute("y1",100*D+"%"),V.setAttribute("x2",100*K+"%"),V.setAttribute("y2",100*ne+"%"),V.setAttribute("gradientUnits","userSpaceOnUse"),V.setAttribute("id",W);for(var Z=0;Z<$.length;Z++){var ee=$[Z],ae=document.createElementNS(J,"stop");for(var se in ee)ee.hasOwnProperty(se)&&ae.setAttribute(se,ee[se]);V.appendChild(ae)}(I.querySelector("defs")||I.insertBefore(document.createElementNS(J,"defs"),I.firstChild)).appendChild(V)})(S.children[0],N,x,A),b.style[T]=null,b.setAttribute(T,`url('#${N}')`)}else b.style[T]=E.get(F)}})}),d(new XMLSerializer().serializeToString(S))};const t=r(Us()),n=r(di()),a=hm(),i=r(NA());function o(_){for(;_.parentNode;){if(_.nodeName==="defs")return!0;_=_.parentNode}return!1}function l(_){const E={};return _.querySelectorAll("style").forEach(S=>{const y=i.default.parse(S.textContent).stylesheet.rules;for(let g of y)g.selectors&&g.selectors.forEach(v=>{const b=E[v]||{};g.declarations.forEach(O=>{b[O.name]=O.value}),E[v]=b})}),E}function u(_,E){var S;const y={fill:"",stroke:""},g=((S=_.getAttribute("class"))===null||S===void 0?void 0:S.split(" "))||[],v=_.getAttribute("id");let b={};if(v&&E[`#${v}`]?b=E[`#${v}`]:g.forEach(O=>{E[`.${O}`]&&(b=Object.assign(Object.assign({},b),E[`.${O}`]))}),E[_.nodeName]&&(b=Object.assign(Object.assign({},b),E[_.nodeName])),_.getAttribute("fill")&&_.getAttribute("fill")!=="none"?y.fill=_.getAttribute("fill"):b.fill&&b.fill!=="none"&&(y.fill=b.fill),_.getAttribute("stroke")&&_.getAttribute("stroke")!=="none"?y.stroke=_.getAttribute("stroke"):b.stroke&&b.stroke!=="none"&&(y.stroke=b.stroke),!y.fill&&_.style.fill&&_.style.fill!=="none"&&(y.fill=_.style.fill),!y.stroke&&_.style.stroke&&_.style.stroke!=="none"&&(y.stroke=_.style.stroke),!y.stroke&&!y.fill){const O=_.ownerSVGElement,j=O&&O!==_&&u(O,E);(j==null?void 0:j.fill)==="currentColor"||(j==null?void 0:j.stroke)==="currentColor"||(y.fill="black")}return y}const c=["path","rect","circle","line","polygon","polyline","ellipse","text"];function h(_){for(var E=[],S=_.getElementsByTagName("*"),y=0,g=S.length;y<g;y++){const v=S[y];o(v)||(v.getAttribute("fill")!==null&&E.push(v),(v.getAttribute("stroke")!==null||v.style&&v.style.fill||c.indexOf(v.nodeName)>=0)&&E.push(v))}return E}async function p(_){return await(await fetch(_,{mode:"cors"})).text()}function w(_){var E=new DOMParser().parseFromString(_,"image/svg+xml");const S=l(E),y=h(E),g=[];return y.forEach(v=>{const{fill:b,stroke:O}=u(v,S);[b,O].forEach(j=>{j&&(j==="currentColor"&&(j="black"),t.default.Util.colorToRGBA(j)&&g.indexOf(j)===-1&&g.push(j))})}),g}function d(_){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(_)))}e.sameColors=(_,E)=>{if(!_||!E)return!1;if(E==="currentColor"&&_==="black")return!0;const S=t.default.Util.colorToRGBA(_),y=t.default.Util.colorToRGBA(E);return S&&y?S.r===y.r&&S.g===y.g&&S.b===y.b&&S.a===y.a:void 0},e.useSvgColors=_=>{const[E,S]=n.default.useState([]);return n.default.useEffect(()=>{let y=!1;return(async()=>{S([]);const g=w(await p(_));y||S(g)})(),()=>{y=!0}},[_]),E}}(Vd)),Vd}var xg={},jb;function q8(){return jb||(jb=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 l=r.getContext("2d");if(!l)return;if(l.fillStyle="rgba(0,0,0,0.1)",l.fillRect(0,0,1,1),l.getImageData(0,0,1,1).data[3]!==0)return void l.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 Fb;function Em(){return Fb||(Fb=1,function(e){var r,t=Fl&&Fl.__createBinding||(Object.create?function(N,I,W,G){G===void 0&&(G=W);var $=Object.getOwnPropertyDescriptor(I,W);$&&!("get"in $?!I.__esModule:$.writable||$.configurable)||($={enumerable:!0,get:function(){return I[W]}}),Object.defineProperty(N,G,$)}:function(N,I,W,G){G===void 0&&(G=W),N[G]=I[W]}),n=Fl&&Fl.__setModuleDefault||(Object.create?function(N,I){Object.defineProperty(N,"default",{enumerable:!0,value:I})}:function(N,I){N.default=I}),a=Fl&&Fl.__importStar||(r=function(N){return r=Object.getOwnPropertyNames||function(I){var W=[];for(var G in I)Object.prototype.hasOwnProperty.call(I,G)&&(W[W.length]=G);return W},r(N)},function(N){if(N&&N.__esModule)return N;var I={};if(N!=null)for(var W=r(N),G=0;G<W.length;G++)W[G]!=="default"&&t(I,N,W[G]);return n(I,N),I}),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(di()),l=zs,u=fl,c=Fu,h=i(r0()),p=i(Us()),w=Mh,d=Ff(),_=jf(),E=a(kp()),S=tf(),y=q8(),g=Ap(),v=If(),b=rf();function O(){return document.createElement("canvas")}function j(N,I){return{x:(N.x+I.x)/2,y:(N.y+I.y)/2}}e.useSizeFixer=N=>{const[I,W]=o.default.useState(N);return o.default.useEffect(()=>{(async()=>{const G=await async function($){if(!($.indexOf("data:image/svg+xml")>=0||$.indexOf(".svg")>=0))return $;const J=await E.urlToString($),V=E.fixSize(J);return E.svgToURL(V)}(N);G!==I&&W(G)})()},[N]),I};const T={boundBoxFunc:(N,I)=>I.width<5||I.height<5?N:I,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 M={boundBoxFunc:(N,I)=>I.width<5||I.height<5?N:I,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(M,N)};const F=(N,I,W)=>Math.max(I,Math.min(W,N));e.useCornerRadiusAndCrop=(N,I,W,G,$=0,J=!1,V=!0)=>{const H=Math.floor(F(N.a.width*G,1,1e4)),z=Math.floor(F(N.a.height*G,1,1e4)),D=Math.min($*G,H/2,z/2),K=Math.max(N.a.width/W.width,N.a.height/W.height)*G,ne=N.page._exportingOrRendering&&S.flags.imageDownScalingEnabled&&K<1&&!J,Z=W.x===0&&W.y===0&&W.width===(I==null?void 0:I.width)&&W.height===(I==null?void 0:I.height),ee=o.default.useMemo(()=>{if(I&&I.width&&I.height)return Z&&D===0&&!ne?void 0:O()},[I,D,ne,Z]);return o.default.useLayoutEffect(()=>{if(!ee||!I)return;(0,y.trySetCanvasSize)(ee,H,z);const ae=ee.getContext("2d");if(!ae)return;D&&(ae.beginPath(),ae.moveTo(D,0),ae.lineTo(H-D,0),ae.arc(H-D,D,D,3*Math.PI/2,0,!1),ae.lineTo(H,z-D),ae.arc(H-D,z-D,D,0,Math.PI/2,!1),ae.lineTo(D,z),ae.arc(D,z-D,D,Math.PI/2,Math.PI,!1),ae.lineTo(0,D),ae.arc(D,D,D,Math.PI,3*Math.PI/2,!1),ae.clip());const se=ne?function(me,xe){var Oe,Re;const Se=O();Se.width=me.width,Se.height=me.height;const ve=Math.max(1,Math.floor(Se.width*xe)),He=Math.max(1,Math.floor(Se.height*xe));(Oe=Se.getContext("2d"))===null||Oe===void 0||Oe.drawImage(me,0,0,Se.width,Se.height);const we=function(Ae,Ee,Ne,he,Le,Ce,De){for(var tt=new ImageData(Ee,Ne),vt=new Int32Array(Ae.data.buffer),mt=Ae.width,Et=new Int32Array(tt.data.buffer),nt=tt.width,at=Ee/Ce,qt=Ne/De,Ct=Math.round(1/at),or=Math.round(1/qt),Xt=Ct*or,qe=0;qe<tt.height;qe++)for(var We=0;We<nt;We++){for(var Nt=0+Math.round(We/at)+(0+Math.round(qe/qt))*mt,ht=0,gt=0,wt=0,tr=0,Vt=0;Vt<or;Vt++)for(var _t=0;_t<Ct;_t++){var it=vt[Nt+_t+Vt*mt];ht+=it<<24>>>24,gt+=it<<16>>>24,wt+=it<<8>>>24,tr+=it>>>24}ht=Math.round(ht/Xt),gt=Math.round(gt/Xt),wt=Math.round(wt/Xt),tr=Math.round(tr/Xt),Et[We+qe*nt]=tr<<24|wt<<16|gt<<8|ht}return tt}(Se.getContext("2d").getImageData(0,0,Se.width,Se.height),ve,He,0,0,Se.width,Se.height);return Se.width=ve,Se.height=He,(Re=Se.getContext("2d"))===null||Re===void 0||Re.putImageData(we,0,0),Se}(I,K):I,ce=ne?{x:Math.floor(W.x*K),y:Math.floor(W.y*K),width:Math.floor(W.width*K),height:Math.floor(W.height*K)}:W;ae.drawImage(se,ce.x,ce.y,ce.width,ce.height,0,0,ee.width,ee.height)},[ee,N.a.width,N.a.height,W.x,W.y,W.width,W.height,$,G,J,N.page._exportingOrRendering,ne]),o.default.useEffect(()=>()=>{ee&&ee.nodeName==="CANVAS"&&p.default.Util.releaseCanvas(ee)},[ee]),ee||I};const C=O(),x=(0,l.observer)(({element:N})=>{const I=Math.min(30,N.a.width/4,N.a.height/4),W=o.default.useRef(null);return o.default.useEffect(()=>{const G=W.current;if(!G)return;const $=new p.default.Animation(J=>{G.rotate(((J==null?void 0:J.timeDiff)||0)/2)},G.getLayer());return $.start(),()=>{$.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(I),innerRadius:Math.max(1,I-5),angle:270}))}),L=(0,l.observer)(({element:N})=>{const I=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:I,width:N.a.width,height:N.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let A=h.default;e.setImageLoaderHook=N=>{A=N},e.useImageLoader=(N,I="",W="")=>{const G=o.default.useRef(),$=()=>{var J;(J=G.current)===null||J===void 0||J.call(G),G.current=void 0};o.default.useEffect(()=>$,[]),o.default.useLayoutEffect(()=>{const J=I.slice(0,200),V=`image with id ${W} url: ${J}`;N!=="loading"||G.current||(G.current=(0,_.incrementLoader)(V)),N!=="loading"&&$(),N==="failed"&&(0,_.triggerLoadError)(V)},[N])},e.ImageElement=(0,l.observer)(({element:N,store:I})=>{var W;const[G,$]=o.default.useState(!1),J=o.default.useRef(null),V=o.default.useRef(null),[H,z]=o.default.useState(!1),D=I.selectedShapes.indexOf(N)>=0&&N.selectable,[K,ne]=(Ve=>{const[Fe,bt]=o.default.useReducer(Ft=>Ft+1,0),Ue=o.default.useRef("loading"),St=o.default.useRef(Ve.src),kt=o.default.useRef(Ve.src);return kt.current!==Ve.src&&(kt.current=Ve.src,Ue.current="loading"),o.default.useEffect(()=>{if(Ve.type!=="svg"||!Ve.src)return;let Ft=!1;return(async()=>{Ue.current="loading",bt();const zt=await E.urlToString(Ve.src),Wt=E.fixSize(zt),_r=E.replaceColors(Wt,Ve.colorsReplace);Ft||(St.current=_r,Ue.current="loaded",bt())})(),()=>{Ft=!0}},[Ve.src,JSON.stringify(Ve.colorsReplace)]),Ve.type!=="svg"?[Ve.src,"loaded"]:[St.current,Ue.current]})(N),[Z,ee]=A(K,"anonymous"),ae=N.type!=="svg"||ne==="loaded"?ee:"loading";(0,e.useImageLoader)(ae,N.src,N.id);const se=N.page._exportingOrRendering?1:Math.max(1,I.scale),ce=I._elementsPixelRatio*se,me=(({image:Ve,status:Fe,type:bt})=>{const Ue=o.default.useRef();return o.default.useEffect(()=>{Ue.current=Ve||Ue.current},[Ve]),Fe!=="failed"||Fe!=="failed"&&bt==="svg"?Ue.current:void 0})({image:Z,status:ee,type:N.type}),xe=((Ve,Fe,bt)=>{const Ue=o.default.useMemo(()=>{var St,kt;const{flipX:Ft,flipY:zt}=Ve,Wt=Ve.type==="svg"||Ve.src.indexOf("data:image/svg+xml")>=0||Ve.src.indexOf(".svg")>=0,_r=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,kr=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||_r)&&Wt||Ve.maskSrc;if(!Ft&&!zt&&!kr)return Fe;if(!Fe||!Fe.width||!Fe.height)return null;const Lr=O();let Nr=1;Ve.type==="svg"&&(Nr=Math.max(Ve.a.width/Fe.width*bt,Ve.a.height/Fe.height*bt)),(0,y.trySetCanvasSize)(Lr,Math.max(Fe.width*Nr,1),Math.max(Fe.height*Nr,1));let Wn=Ft?-Lr.width:0,en=zt?-Lr.height:0;return(St=Lr.getContext("2d"))===null||St===void 0||St.scale(Ft?-1:1,zt?-1:1),(kt=Lr.getContext("2d"))===null||kt===void 0||kt.drawImage(Fe,Wn,en,Lr.width,Lr.height),Lr},[Ve.maskSrc,Ve.flipX,Ve.flipY,Fe,Ve.a.width,Ve.a.height,bt]);return o.default.useEffect(()=>()=>{Ue&&Ue.nodeName==="CANVAS"&&p.default.Util.releaseCanvas(Ue)},[Ue]),Ue})(N,Z||me,ce),Oe=((Ve,Fe)=>{const[bt,Ue]=A(Ve.maskSrc,"anonymous"),St=Ve.maskSrc?Ue:"loaded";return(0,e.useImageLoader)(St,Ve.maskSrc||"",Ve.id),o.default.useMemo(()=>{if(!bt||!Fe||!Fe.width||!Fe.height)return Fe;const kt=O();kt.width=Math.max(Fe.width,1),kt.height=Math.max(Fe.height,1);const Ft=kt.getContext("2d");if(!Ft)return Fe;Ft.drawImage(Fe,0,0),Ft.globalCompositeOperation="source-in";const zt=function(Wt,_r){const kr=_r.width/_r.height;let Lr,Nr;return kr>=Wt.width/Wt.height?(Lr=Wt.width,Nr=Wt.width/kr):(Lr=Wt.height*kr,Nr=Wt.height),{x:(Wt.width-Lr)/2,y:(Wt.height-Nr)/2,width:Lr,height:Nr}}(bt,Ve);return Ft.drawImage(bt,zt.x,zt.y,zt.width,zt.height,0,0,Fe.width,Fe.height),kt},[Fe,bt,Ve.a.width,Ve.a.height])})(N,xe)||C;let{cropX:Re,cropY:Se,cropWidth:ve,cropHeight:He}=N.a;ee!=="loaded"&&(Re=Se=0,ve=He=1);const we=Oe.width*ve,Ae=Oe.height*He,Ee=N.a.width/N.a.height;let Ne,he;const Le=we/Ae,Ce=N.type==="svg";Ce?(Ne=we,he=Ae):Ee>=Le?(Ne=we,he=we/Ee):(Ne=Ae*Ee,he=Ae);const De={x:Oe.width*Re,y:Oe.height*Se,width:Ne,height:he},tt=(W=N.cornerRadius)!==null&&W!==void 0?W:0,vt=N.page._exportingOrRendering?1:Math.min(2,I.scale),mt=I._elementsPixelRatio*vt;let Et=((Ve,Fe,bt,Ue)=>{const St=(0,e.useSizeFixer)(Ve.clipSrc||""),[kt,Ft]=A(St,"anonymous"),zt=Ve.clipSrc?Ft:"loaded";(0,e.useImageLoader)(zt,Ve.clipSrc,Ve.id);const Wt=o.default.useMemo(()=>{if(Fe&&kt)return O()},[Fe,kt]);return o.default.useLayoutEffect(()=>{var _r;if(!kt||!Fe||!Fe.width||!Fe.height||!kt||!kt.width||!kt.height||!Wt)return;const kr=O(),Lr=Math.max(Ve.a.width/kt.width*bt,Ve.a.height/kt.height*bt);kr.width=kt.width*Lr,kr.height=kt.height*Lr,(_r=kr.getContext("2d"))===null||_r===void 0||_r.drawImage(kt,0,0,kr.width,kr.height),Wt.width=Math.max(Fe.width,1),Wt.height=Math.max(Fe.height,1);const Nr=Wt.getContext("2d");Nr&&(Nr.save(),Nr.drawImage(kr,0,0,Fe.width,Fe.height),p.default.Util.releaseCanvas(kr),Nr.globalCompositeOperation="source-in",Nr.drawImage(Fe,0,0,Wt.width,Wt.height),Nr.restore())},[Wt,Fe,kt,Ve.a.width,Ve.a.height,bt,...Ue]),Ve.clipSrc&&kt?Wt:Fe})(N,(0,e.useCornerRadiusAndCrop)(N,Oe,De,mt,tt,G||N._cropModeEnabled||N.type==="svg",!0),mt,[De,tt,mt]);const nt=Math.max(N.a.width/Ne,N.a.height/he);o.default.useEffect(()=>{var Ve;if(!N._cropModeEnabled)return;const Fe=(Ve=J.current)===null||Ve===void 0?void 0:Ve.getStage();function bt(St){N._cropModeEnabled&&St.target!==V.current&&N.toggleCropMode(!1)}function Ue(St){N._cropModeEnabled&&St.target.parentNode!==Fe.content&&N.toggleCropMode(!1)}return document.body.addEventListener("click",Ue),Fe==null||Fe.on("click",bt),Fe==null||Fe.on("tap",bt),()=>{document.body.removeEventListener("click",Ue),document.body.removeEventListener("touchstart",Ue),Fe==null||Fe.off("click",bt),Fe==null||Fe.off("click",bt)}},[N._cropModeEnabled]),o.default.useLayoutEffect(()=>{if(!G&&!N._cropModeEnabled)return(0,g.applyFilter)(J.current,N),(0,u.autorun)(()=>{(0,g.applyFilter)(J.current,N)},{delay:100})},[Et,N.page._exportingOrRendering,G,ve,He,N._cropModeEnabled]),o.default.useLayoutEffect(()=>{var Ve;G||N._cropModeEnabled?(Ve=J.current)===null||Ve===void 0||Ve.clearCache():(0,g.applyFilter)(J.current,N)},[G,N.a.width,N.a.height,N._cropModeEnabled]),o.default.useEffect(()=>{(0,g.applyFilter)(J.current,N)},[N.shadowEnabled,N.shadowBlur,N.cornerRadius,N.shadowColor,N.shadowOffsetX,N.shadowOffsetY,N.shadowOpacity]);const at=o.default.useRef(null),qt=o.default.useRef(null),Ct=o.default.useRef(null);o.default.useLayoutEffect(()=>{N._cropModeEnabled&&(qt.current.nodes([at.current]),Ct.current.nodes([V.current]))},[N._cropModeEnabled]);var or=o.default.useRef(null),Xt=o.default.useRef(0),qe=o.default.useRef(!1);const We=Ve=>{var Fe;((Fe=Ve.evt.touches)===null||Fe===void 0?void 0:Fe.length)>2&&Ve.target.stopDrag(),Math.round(Ve.target.x())>0&&(Ve.target.x(0),Ve.target.scaleX(1)),Math.round(Ve.target.y())>0&&(Ve.target.y(0),Ve.target.scaleY(1));const bt=Ve.target.width()*Ve.target.scaleX(),Ue=Ve.target.height()*Ve.target.scaleY(),St=Math.min(1,Ne/bt),kt=Math.min(1,he/Ue),Ft=1-St,zt=Math.min(Ft,Math.max(0,Math.round(-Ve.target.x())/bt)),Wt=1-kt,_r=Math.min(Wt,Math.max(0,Math.round(-Ve.target.y())/Ue));Ve.target.setAttrs({x:-zt*Oe.width,y:-_r*Oe.height,scaleX:1,scaleY:1}),N.set({cropX:zt,cropY:_r,cropWidth:St,cropHeight:kt})},Nt=()=>{N.type!=="svg"&&N.contentEditable&&setTimeout(()=>{N.toggleCropMode(!0)})},ht=N.type==="svg"&&me,gt=ee==="loading"&&!ht,wt=ee==="failed",tr=!gt&&!wt,Vt=o.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),_t=tr?N.a.opacity:0;(0,v.useFadeIn)(J,_t);const it=N.selectable||I.role==="admin",Bt=(0,b.isTouchDevice)();return o.default.createElement(o.default.Fragment,null,gt&&o.default.createElement(x,{element:N}),wt&&o.default.createElement(L,{element:N}),o.default.createElement(c.Image,{ref:J,name:"element",id:N.id,image:Et,x:N.a.x,y:N.a.y,width:N.a.width||1,height:N.a.height||1,rotation:N.a.rotation,opacity:_t,shadowEnabled:N.shadowEnabled,shadowBlur:N.shadowBlur,shadowOffsetX:N.shadowOffsetX,shadowOffsetY:N.shadowOffsetY,shadowColor:N.shadowColor,shadowOpacity:N.shadowOpacity,customCrop:De,listening:it,draggable:Bt?N.draggable&&D:N.draggable,preventDefault:!Bt||D,hideInExport:!N.showInExport,onMouseEnter:()=>{z(!0)},onMouseLeave:()=>{z(!1)},onDragMove:Ve=>{N.set({x:Ve.target.x(),y:Ve.target.y()})},onDragEnd:Ve=>{N.set({x:Ve.target.x(),y:Ve.target.y()})},onDblClick:Nt,onDblTap:Nt,onTransformStart:()=>{$(!0),Vt.current={cropX:N.cropX,cropY:N.cropY,cropWidth:N.cropWidth,cropHeight:N.cropHeight}},onTransform:Ve=>{var Fe;const bt=Ve.currentTarget,Ue=Math.abs(bt.scaleX()-1)<1e-7?1:bt.scaleX(),St=Math.abs(bt.scaleY()-1)<1e-7?1:bt.scaleY();bt.scaleX(1),bt.scaleY(1);const kt=(Fe=Ve.target.getStage())===null||Fe===void 0?void 0:Fe.findOne("Transformer"),Ft=1-Ne/Oe.width,zt=Math.min(Ft,Math.max(0,N.cropX)),Wt=1-he/Oe.height,_r=Math.min(Wt,Math.max(0,N.cropY)),kr=kt.getActiveAnchor(),Lr=!(kr.indexOf("middle")>=0||kr.indexOf("center")>=0),Nr=!Lr&&Ue<1&&Vt.current.cropHeight>he/Oe.height;let Wn=Lr?N.cropWidth:N.cropWidth*Ue;Nr&&(Wn=N.cropWidth);const en=!Lr&&St<1&&Vt.current.cropWidth>Ne/Oe.width;let Qn=Lr?N.cropHeight:N.cropHeight*St;en&&(Qn=N.cropHeight),Ce&&(Wn=N.cropWidth,Qn=N.cropHeight),N.set({cropX:zt,cropY:_r,x:bt.x(),y:bt.y(),width:bt.width()*Ue,height:bt.height()*St,rotation:Ve.target.rotation(),cropWidth:Math.min(Wn,1-zt),cropHeight:Math.min(Qn,1-_r)})},onTransformEnd:Ve=>{const Fe=Ve.currentTarget;N.set({width:Fe.width(),height:Fe.height(),x:Fe.x(),y:Fe.y(),rotation:Ve.target.rotation(),cropWidth:Ne/Oe.width,cropHeight:he/Oe.height}),$(!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:_t,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,tt-N.borderSize),hideInExport:!N.showInExport}),N._cropModeEnabled&&o.default.createElement(w.Portal,{selector:".page-abs-container",enabled:!0},o.default.createElement(c.Rect,{x:-window.innerWidth/I.scale,y:-window.innerWidth/I.scale,width:window.innerWidth/I.scale*3,height:window.innerWidth/I.scale*3,fill:"rgba(0,0,0,0.3)"}),o.default.createElement(c.Image,{listening:!1,image:Et,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:nt,scaleY:nt},o.default.createElement(c.Image,{image:Oe,ref:V,opacity:.4,draggable:!0,x:-N.cropX*Oe.width,y:-N.cropY*Oe.height,onDragMove:We,onTransform:We,onTouchMove:Ve=>{Ve.evt.preventDefault();const Fe=Ve.target.getStage().getPointersPositions();var bt=Fe[0],Ue=Fe[1];const St=Ve.target;if(bt&&!Ue&&!St.isDragging()&&qe.current&&(St.startDrag(),qe.current=!1),bt&&Ue){p.default.hitOnDragEnabled=!0,St.isDragging()&&(qe.current=!0,St.stopDrag());const en=Ve.target.getAbsoluteTransform().copy();en.invert();var kt={x:bt.x,y:bt.y},Ft={x:Ue.x,y:Ue.y};if(!or.current)return void(or.current=j(kt,Ft));var zt=j(kt,Ft),Wt=function(Si,fa){return Math.sqrt(Math.pow(fa.x-Si.x,2)+Math.pow(fa.y-Si.y,2))}(kt,Ft);Xt.current||(Xt.current=Wt);const Qn=St.position();var _r={x:zt.x-Qn.x,y:zt.y-Qn.y},kr=Wt/Xt.current;St.scaleX(kr),St.scaleY(kr);const _i=en.point(zt),Ni=en.point(or.current);var Lr=_i.x-Ni.x,Nr=_i.y-Ni.y,Wn={x:Math.min(0,zt.x-_r.x*kr+Lr),y:Math.min(0,zt.y-_r.y*kr+Nr)};St.position(Wn),Xt.current=Wt,or.current=zt,We(Ve)}},onTouchEnd:Ve=>{Xt.current=0,or.current=null,p.default.hitOnDragEnabled=!1}}),o.default.createElement(c.Transformer,Object.assign({ref:Ct},M)),o.default.createElement(c.Rect,{width:Ne,height:he,ref:at,listening:!1,onTransform:Ve=>{Ve.target.x()<-N.cropX*Oe.width-1e-9&&(Ve.target.x(-N.cropX*Oe.width),Ve.target.scaleX(1)),Ve.target.y()<-N.cropY*Oe.height-1e-9&&(Ve.target.y(-N.cropY*Oe.height),Ve.target.scaleY(1));const Fe=Math.min(1,Math.max(0,N.cropX+Ve.target.x()/Oe.width)),bt=Math.min(1,Math.max(0,Ve.target.y()/Oe.height+N.cropY)),Ue=Ve.target.width()*Ve.target.scaleX(),St=Ve.target.height()*Ve.target.scaleY(),kt=Math.min(1-Fe,Ue/Oe.width),Ft=Math.min(1-bt,St/Oe.height),zt=Ve.target.getAbsolutePosition(Ve.target.getParent().getParent());Ve.target.scale({x:1,y:1}),Ve.target.position({x:0,y:0}),N.set({x:zt.x,y:zt.y,cropX:Fe,cropY:bt,cropWidth:kt,cropHeight:Ft,width:Math.min(Ue*nt,Oe.width*(1-Fe)*nt),height:Math.min(St*nt,Oe.height*(1-bt)*nt)})}}),o.default.createElement(c.Transformer,Object.assign({ref:qt},T,{visible:N.resizable})))),(H||D)&&o.default.createElement(d.Highlighter,{element:N}))})}(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 TA=y1.exports,Db;function RA(){return Db||(Db=1,function(e,r){(function(n,a){e.exports=a()})(typeof self<"u"?self:TA,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,l){a.o(i,o)||Object.defineProperty(i,o,{configurable:!1,enumerable:!0,get:l})},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),l=a(19),u=a(45),c=a(46),h=a(47),p=a(48),w=a(49),d=a(12),_=a(32),E=a(33),S=a(31),y=a(1),g={Scope:y.Scope,create:y.create,find:y.find,query:y.query,register:y.register,Container:i.default,Format:o.default,Leaf:l.default,Embed:p.default,Scroll:u.default,Block:h.default,Inline:c.default,Text:w.default,Attributor:{Attribute:d.default,Class:_.default,Style:E.default,Store:S.default}};n.default=g},function(t,n,a){var i=this&&this.__extends||function(){var S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,g){y.__proto__=g}||function(y,g){for(var v in g)g.hasOwnProperty(v)&&(y[v]=g[v])};return function(y,g){S(y,g);function v(){this.constructor=y}y.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=function(S){i(y,S);function y(g){var v=this;return g="[Parchment] "+g,v=S.call(this,g)||this,v.message=g,v.name=v.constructor.name,v}return y}(Error);n.ParchmentError=o;var l={},u={},c={},h={};n.DATA_KEY="__blot";var p;(function(S){S[S.TYPE=3]="TYPE",S[S.LEVEL=12]="LEVEL",S[S.ATTRIBUTE=13]="ATTRIBUTE",S[S.BLOT=14]="BLOT",S[S.INLINE=7]="INLINE",S[S.BLOCK=11]="BLOCK",S[S.BLOCK_BLOT=10]="BLOCK_BLOT",S[S.INLINE_BLOT=6]="INLINE_BLOT",S[S.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",S[S.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",S[S.ANY=15]="ANY"})(p=n.Scope||(n.Scope={}));function w(S,y){var g=_(S);if(g==null)throw new o("Unable to create "+S+" blot");var v=g,b=S instanceof Node||S.nodeType===Node.TEXT_NODE?S:v.create(y);return new v(b,y)}n.create=w;function d(S,y){return y===void 0&&(y=!1),S==null?null:S[n.DATA_KEY]!=null?S[n.DATA_KEY].blot:y?d(S.parentNode,y):null}n.find=d;function _(S,y){y===void 0&&(y=p.ANY);var g;if(typeof S=="string")g=h[S]||l[S];else if(S instanceof Text||S.nodeType===Node.TEXT_NODE)g=h.text;else if(typeof S=="number")S&p.LEVEL&p.BLOCK?g=h.block:S&p.LEVEL&p.INLINE&&(g=h.inline);else if(S instanceof HTMLElement){var v=(S.getAttribute("class")||"").split(/\s+/);for(var b in v)if(g=u[v[b]],g)break;g=g||c[S.tagName]}return g==null?null:y&p.LEVEL&g.scope&&y&p.TYPE&g.scope?g:null}n.query=_;function E(){for(var S=[],y=0;y<arguments.length;y++)S[y]=arguments[y];if(S.length>1)return S.map(function(b){return E(b)});var g=S[0];if(typeof g.blotName!="string"&&typeof g.attrName!="string")throw new o("Invalid definition");if(g.blotName==="abstract")throw new o("Cannot register abstract class");if(h[g.blotName||g.attrName]=g,typeof g.keyName=="string")l[g.keyName]=g;else if(g.className!=null&&(u[g.className]=g),g.tagName!=null){Array.isArray(g.tagName)?g.tagName=g.tagName.map(function(b){return b.toUpperCase()}):g.tagName=g.tagName.toUpperCase();var v=Array.isArray(g.tagName)?g.tagName:[g.tagName];v.forEach(function(b){(c[b]==null||g.className==null)&&(c[b]=g)})}return g}n.register=E},function(t,n,a){var i=a(51),o=a(11),l=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,w){var d={};return p.length===0?this:(d.insert=p,w!=null&&typeof w=="object"&&Object.keys(w).length>0&&(d.attributes=w),this.push(d))},h.prototype.delete=function(p){return p<=0?this:this.push({delete:p})},h.prototype.retain=function(p,w){if(p<=0)return this;var d={retain:p};return w!=null&&typeof w=="object"&&Object.keys(w).length>0&&(d.attributes=w),this.push(d)},h.prototype.push=function(p){var w=this.ops.length,d=this.ops[w-1];if(p=l(!0,{},p),typeof d=="object"){if(typeof p.delete=="number"&&typeof d.delete=="number")return this.ops[w-1]={delete:d.delete+p.delete},this;if(typeof d.delete=="number"&&p.insert!=null&&(w-=1,d=this.ops[w-1],typeof d!="object"))return this.ops.unshift(p),this;if(o(p.attributes,d.attributes)){if(typeof p.insert=="string"&&typeof d.insert=="string")return this.ops[w-1]={insert:d.insert+p.insert},typeof p.attributes=="object"&&(this.ops[w-1].attributes=p.attributes),this;if(typeof p.retain=="number"&&typeof d.retain=="number")return this.ops[w-1]={retain:d.retain+p.retain},typeof p.attributes=="object"&&(this.ops[w-1].attributes=p.attributes),this}}return w===this.ops.length?this.ops.push(p):this.ops.splice(w,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 w=[],d=[];return this.forEach(function(_){var E=p(_)?w:d;E.push(_)}),[w,d]},h.prototype.reduce=function(p,w){return this.ops.reduce(p,w)},h.prototype.changeLength=function(){return this.reduce(function(p,w){return w.insert?p+u.length(w):w.delete?p-w.delete:p},0)},h.prototype.length=function(){return this.reduce(function(p,w){return p+u.length(w)},0)},h.prototype.slice=function(p,w){p=p||0,typeof w!="number"&&(w=1/0);for(var d=[],_=u.iterator(this.ops),E=0;E<w&&_.hasNext();){var S;E<p?S=_.next(p-E):(S=_.next(w-E),d.push(S)),E+=u.length(S)}return new h(d)},h.prototype.compose=function(p){var w=u.iterator(this.ops),d=u.iterator(p.ops),_=[],E=d.peek();if(E!=null&&typeof E.retain=="number"&&E.attributes==null){for(var S=E.retain;w.peekType()==="insert"&&w.peekLength()<=S;)S-=w.peekLength(),_.push(w.next());E.retain-S>0&&d.next(E.retain-S)}for(var y=new h(_);w.hasNext()||d.hasNext();)if(d.peekType()==="insert")y.push(d.next());else if(w.peekType()==="delete")y.push(w.next());else{var g=Math.min(w.peekLength(),d.peekLength()),v=w.next(g),b=d.next(g);if(typeof b.retain=="number"){var O={};typeof v.retain=="number"?O.retain=g:O.insert=v.insert;var j=u.attributes.compose(v.attributes,b.attributes,typeof v.retain=="number");if(j&&(O.attributes=j),y.push(O),!d.hasNext()&&o(y.ops[y.ops.length-1],O)){var T=new h(w.rest());return y.concat(T).chop()}}else typeof b.delete=="number"&&typeof v.retain=="number"&&y.push(b)}return y.chop()},h.prototype.concat=function(p){var w=new h(this.ops.slice());return p.ops.length>0&&(w.push(p.ops[0]),w.ops=w.ops.concat(p.ops.slice(1))),w},h.prototype.diff=function(p,w){if(this.ops===p.ops)return new h;var d=[this,p].map(function(g){return g.map(function(v){if(v.insert!=null)return typeof v.insert=="string"?v.insert:c;var b=g===p?"on":"with";throw new Error("diff() called "+b+" non-document")}).join("")}),_=new h,E=i(d[0],d[1],w),S=u.iterator(this.ops),y=u.iterator(p.ops);return E.forEach(function(g){for(var v=g[1].length;v>0;){var b=0;switch(g[0]){case i.INSERT:b=Math.min(y.peekLength(),v),_.push(y.next(b));break;case i.DELETE:b=Math.min(v,S.peekLength()),S.next(b),_.delete(b);break;case i.EQUAL:b=Math.min(S.peekLength(),y.peekLength(),v);var O=S.next(b),j=y.next(b);o(O.insert,j.insert)?_.retain(b,u.attributes.diff(O.attributes,j.attributes)):_.push(j).delete(b);break}v-=b}}),_.chop()},h.prototype.eachLine=function(p,w){w=w||`
|
|
114
|
-
`;for(var d=u.iterator(this.ops),_=new h,E=0;d.hasNext();){if(d.peekType()!=="insert")return;var S=d.peek(),y=u.length(S)-d.peekLength(),g=typeof S.insert=="string"?S.insert.indexOf(w,y)-y:-1;if(g<0)_.push(d.next());else if(g>0)_.push(d.next(g));else{if(p(_,d.next(1).attributes||{},E)===!1)return;E+=1,_=new h}}_.length()>0&&p(_,{},E)},h.prototype.transform=function(p,w){if(w=!!w,typeof p=="number")return this.transformPosition(p,w);for(var d=u.iterator(this.ops),_=u.iterator(p.ops),E=new h;d.hasNext()||_.hasNext();)if(d.peekType()==="insert"&&(w||_.peekType()!=="insert"))E.retain(u.length(d.next()));else if(_.peekType()==="insert")E.push(_.next());else{var S=Math.min(d.peekLength(),_.peekLength()),y=d.next(S),g=_.next(S);if(y.delete)continue;g.delete?E.push(g):E.retain(S,u.attributes.transform(y.attributes,g.attributes,w))}return E.chop()},h.prototype.transformPosition=function(p,w){w=!!w;for(var d=u.iterator(this.ops),_=0;d.hasNext()&&_<=p;){var E=d.peekLength(),S=d.peekType();if(d.next(),S==="delete"){p-=Math.min(E,p-_);continue}else S==="insert"&&(_<p||!w)&&(p+=E);_+=E}return p},t.exports=h},function(t,n){var a=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(d){return typeof Array.isArray=="function"?Array.isArray(d):i.call(d)==="[object Array]"},c=function(d){if(!d||i.call(d)!=="[object Object]")return!1;var _=a.call(d,"constructor"),E=d.constructor&&d.constructor.prototype&&a.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!_&&!E)return!1;var S;for(S in d);return typeof S>"u"||a.call(d,S)},h=function(d,_){o&&_.name==="__proto__"?o(d,_.name,{enumerable:!0,configurable:!0,value:_.newValue,writable:!0}):d[_.name]=_.newValue},p=function(d,_){if(_==="__proto__")if(a.call(d,_)){if(l)return l(d,_).value}else return;return d[_]};t.exports=function w(){var d,_,E,S,y,g,v=arguments[0],b=1,O=arguments.length,j=!1;for(typeof v=="boolean"&&(j=v,v=arguments[1]||{},b=2),(v==null||typeof v!="object"&&typeof v!="function")&&(v={});b<O;++b)if(d=arguments[b],d!=null)for(_ in d)E=p(v,_),S=p(d,_),v!==S&&(j&&S&&(c(S)||(y=u(S)))?(y?(y=!1,g=E&&u(E)?E:[]):g=E&&c(E)?E:{},h(v,{name:_,newValue:w(j,g,S)})):typeof S<"u"&&h(v,{name:_,newValue:S}));return v}},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var i=function(){function x(L,A){for(var N=0;N<A.length;N++){var I=A[N];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(L,I.key,I)}}return function(L,A,N){return A&&x(L.prototype,A),N&&x(L,N),L}}(),o=function x(L,A,N){L===null&&(L=Function.prototype);var I=Object.getOwnPropertyDescriptor(L,A);if(I===void 0){var W=Object.getPrototypeOf(L);return W===null?void 0:x(W,A,N)}else{if("value"in I)return I.value;var G=I.get;return G===void 0?void 0:G.call(N)}},l=a(3),u=v(l),c=a(2),h=v(c),p=a(0),w=v(p),d=a(16),_=v(d),E=a(6),S=v(E),y=a(7),g=v(y);function v(x){return x&&x.__esModule?x:{default:x}}function b(x,L){if(!(x instanceof L))throw new TypeError("Cannot call a class as a function")}function O(x,L){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:x}function j(x,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);x.prototype=Object.create(L&&L.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(x,L):x.__proto__=L)}var T=1,M=function(x){j(L,x);function L(){return b(this,L),O(this,(L.__proto__||Object.getPrototypeOf(L)).apply(this,arguments))}return i(L,[{key:"attach",value:function(){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"attach",this).call(this),this.attributes=new w.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new h.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(N,I){var W=w.default.query(N,w.default.Scope.BLOCK_ATTRIBUTE);W!=null&&this.attributes.attribute(W,I)}},{key:"formatAt",value:function(N,I,W,G){this.format(W,G)}},{key:"insertAt",value:function(N,I,W){if(typeof I=="string"&&I.endsWith(`
|
|
115
|
-
`)){var G=w.default.create(F.blotName);this.parent.insertBefore(G,N===0?this:this.next),G.insertAt(0,I.slice(0,-1))}else o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,N,I,W)}}]),L}(w.default.Embed);M.scope=w.default.Scope.BLOCK_BLOT;var F=function(x){j(L,x);function L(A){b(this,L);var N=O(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,A));return N.cache={},N}return i(L,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(w.default.Leaf).reduce(function(N,I){return I.length()===0?N:N.insert(I.value(),C(I))},new h.default).insert(`
|
|
116
|
-
`,C(this))),this.cache.delta}},{key:"deleteAt",value:function(N,I){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"deleteAt",this).call(this,N,I),this.cache={}}},{key:"formatAt",value:function(N,I,W,G){I<=0||(w.default.query(W,w.default.Scope.BLOCK)?N+I===this.length()&&this.format(W,G):o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"formatAt",this).call(this,N,Math.min(I,this.length()-N-1),W,G),this.cache={})}},{key:"insertAt",value:function(N,I,W){if(W!=null)return o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,N,I,W);if(I.length!==0){var G=I.split(`
|
|
117
|
-
`),$=G.shift();$.length>0&&(N<this.length()-1||this.children.tail==null?o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,Math.min(N,this.length()-1),$):this.children.tail.insertAt(this.children.tail.length(),$),this.cache={});var J=this;G.reduce(function(V,H){return J=J.split(V,!0),J.insertAt(0,H),H.length},N+$.length)}}},{key:"insertBefore",value:function(N,I){var W=this.children.head;o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertBefore",this).call(this,N,I),W instanceof _.default&&W.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"length",this).call(this)+T),this.cache.length}},{key:"moveChildren",value:function(N,I){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"moveChildren",this).call(this,N,I),this.cache={}}},{key:"optimize",value:function(N){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"optimize",this).call(this,N),this.cache={}}},{key:"path",value:function(N){return o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"path",this).call(this,N,!0)}},{key:"removeChild",value:function(N){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"removeChild",this).call(this,N),this.cache={}}},{key:"split",value:function(N){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(I&&(N===0||N>=this.length()-T)){var W=this.clone();return N===0?(this.parent.insertBefore(W,this),this):(this.parent.insertBefore(W,this.next),W)}else{var G=o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"split",this).call(this,N,I);return this.cache={},G}}}]),L}(w.default.Block);F.blotName="block",F.tagName="P",F.defaultChild="break",F.allowedChildren=[S.default,w.default.Embed,g.default];function C(x){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return x==null||(typeof x.formats=="function"&&(L=(0,u.default)(L,x.formats())),x.parent==null||x.parent.blotName=="scroll"||x.parent.statics.scope!==x.statics.scope)?L:C(x.parent,L)}n.bubbleFormats=C,n.BlockEmbed=M,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(J){return typeof J}:function(J){return J&&typeof Symbol=="function"&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},o=function(){function J(V,H){var z=[],D=!0,K=!1,ne=void 0;try{for(var Z=V[Symbol.iterator](),ee;!(D=(ee=Z.next()).done)&&(z.push(ee.value),!(H&&z.length===H));D=!0);}catch(ae){K=!0,ne=ae}finally{try{!D&&Z.return&&Z.return()}finally{if(K)throw ne}}return z}return function(V,H){if(Array.isArray(V))return V;if(Symbol.iterator in Object(V))return J(V,H);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function J(V,H){for(var z=0;z<H.length;z++){var D=H[z];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(V,D.key,D)}}return function(V,H,z){return H&&J(V.prototype,H),z&&J(V,z),V}}();a(50);var u=a(2),c=C(u),h=a(14),p=C(h),w=a(8),d=C(w),_=a(9),E=C(_),S=a(0),y=C(S),g=a(15),v=C(g),b=a(3),O=C(b),j=a(10),T=C(j),M=a(34),F=C(M);function C(J){return J&&J.__esModule?J:{default:J}}function x(J,V,H){return V in J?Object.defineProperty(J,V,{value:H,enumerable:!0,configurable:!0,writable:!0}):J[V]=H,J}function L(J,V){if(!(J instanceof V))throw new TypeError("Cannot call a class as a function")}var A=(0,T.default)("quill"),N=function(){l(J,null,[{key:"debug",value:function(H){H===!0&&(H="log"),T.default.level(H)}},{key:"find",value:function(H){return H.__quill||y.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,z){var D=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof H!="string"){var ne=H.attrName||H.blotName;typeof ne=="string"?this.register("formats/"+ne,H,z):Object.keys(H).forEach(function(Z){D.register(Z,H[Z],z)})}else this.imports[H]!=null&&!K&&A.warn("Overwriting "+H+" with",z),this.imports[H]=z,(H.startsWith("blots/")||H.startsWith("formats/"))&&z.blotName!=="abstract"?y.default.register(z):H.startsWith("modules")&&typeof z.register=="function"&&z.register()}}]);function J(V){var H=this,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(L(this,J),this.options=I(V,z),this.container=this.options.container,this.container==null)return A.error("Invalid Quill container",V);this.options.debug&&J.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 d.default,this.scroll=y.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new p.default(this.scroll),this.selection=new v.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(d.default.events.EDITOR_CHANGE,function(ne){ne===d.default.events.TEXT_CHANGE&&H.root.classList.toggle("ql-blank",H.editor.isBlank())}),this.emitter.on(d.default.events.SCROLL_UPDATE,function(ne,Z){var ee=H.selection.lastRange,ae=ee&&ee.length===0?ee.index:void 0;W.call(H,function(){return H.editor.update(null,Z,ae)},ne)});var K=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+D+"<p><br></p></div>");this.setContents(K),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return l(J,[{key:"addContainer",value:function(H){var z=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,z),H}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(H,z,D){var K=this,ne=G(H,z,D),Z=o(ne,4);return H=Z[0],z=Z[1],D=Z[3],W.call(this,function(){return K.editor.deleteText(H,z)},D,H,-1*z)}},{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,z){var D=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:d.default.sources.API;return W.call(this,function(){var ne=D.getSelection(!0),Z=new c.default;if(ne==null)return Z;if(y.default.query(H,y.default.Scope.BLOCK))Z=D.editor.formatLine(ne.index,ne.length,x({},H,z));else{if(ne.length===0)return D.selection.format(H,z),Z;Z=D.editor.formatText(ne.index,ne.length,x({},H,z))}return D.setSelection(ne,d.default.sources.SILENT),Z},K)}},{key:"formatLine",value:function(H,z,D,K,ne){var Z=this,ee=void 0,ae=G(H,z,D,K,ne),se=o(ae,4);return H=se[0],z=se[1],ee=se[2],ne=se[3],W.call(this,function(){return Z.editor.formatLine(H,z,ee)},ne,H,0)}},{key:"formatText",value:function(H,z,D,K,ne){var Z=this,ee=void 0,ae=G(H,z,D,K,ne),se=o(ae,4);return H=se[0],z=se[1],ee=se[2],ne=se[3],W.call(this,function(){return Z.editor.formatText(H,z,ee)},ne,H,0)}},{key:"getBounds",value:function(H){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,D=void 0;typeof H=="number"?D=this.selection.getBounds(H,z):D=this.selection.getBounds(H.index,H.length);var K=this.container.getBoundingClientRect();return{bottom:D.bottom-K.top,height:D.height,left:D.left-K.left,right:D.right-K.left,top:D.top-K.top,width:D.width}}},{key:"getContents",value:function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-H,D=G(H,z),K=o(D,2);return H=K[0],z=K[1],this.editor.getContents(H,z)}},{key:"getFormat",value:function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof H=="number"?this.editor.getFormat(H,z):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,z=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,z)}},{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,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-H,D=G(H,z),K=o(D,2);return H=K[0],z=K[1],this.editor.getText(H,z)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(H,z,D){var K=this,ne=arguments.length>3&&arguments[3]!==void 0?arguments[3]:J.sources.API;return W.call(this,function(){return K.editor.insertEmbed(H,z,D)},ne,H)}},{key:"insertText",value:function(H,z,D,K,ne){var Z=this,ee=void 0,ae=G(H,0,D,K,ne),se=o(ae,4);return H=se[0],ee=se[2],ne=se[3],W.call(this,function(){return Z.editor.insertText(H,z,ee)},ne,H,z.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(H,z,D){this.clipboard.dangerouslyPasteHTML(H,z,D)}},{key:"removeFormat",value:function(H,z,D){var K=this,ne=G(H,z,D),Z=o(ne,4);return H=Z[0],z=Z[1],D=Z[3],W.call(this,function(){return K.editor.removeFormat(H,z)},D,H)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(H){var z=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API;return W.call(this,function(){H=new c.default(H);var K=z.getLength(),ne=z.editor.deleteText(0,K),Z=z.editor.applyDelta(H),ee=Z.ops[Z.ops.length-1];ee!=null&&typeof ee.insert=="string"&&ee.insert[ee.insert.length-1]===`
|
|
118
|
-
`&&(z.editor.deleteText(z.getLength()-1,1),Z.delete(1));var ae=ne.compose(Z);return ae},D)}},{key:"setSelection",value:function(H,z,D){if(H==null)this.selection.setRange(null,z||J.sources.API);else{var K=G(H,z,D),ne=o(K,4);H=ne[0],z=ne[1],D=ne[3],this.selection.setRange(new g.Range(H,z),D),D!==d.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(H){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API,D=new c.default().insert(H);return this.setContents(D,z)}},{key:"update",value:function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:d.default.sources.USER,z=this.scroll.update(H);return this.selection.update(H),z}},{key:"updateContents",value:function(H){var z=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API;return W.call(this,function(){return H=new c.default(H),z.editor.applyDelta(H,D)},D,!0)}}]),J}();N.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},N.events=d.default.events,N.sources=d.default.sources,N.version="1.3.7",N.imports={delta:c.default,parchment:y.default,"core/module":E.default,"core/theme":F.default};function I(J,V){if(V=(0,O.default)(!0,{container:J,modules:{clipboard:!0,keyboard:!0,history:!0}},V),!V.theme||V.theme===N.DEFAULTS.theme)V.theme=F.default;else if(V.theme=N.import("themes/"+V.theme),V.theme==null)throw new Error("Invalid theme "+V.theme+". Did you register it?");var H=(0,O.default)(!0,{},V.theme.DEFAULTS);[H,V].forEach(function(K){K.modules=K.modules||{},Object.keys(K.modules).forEach(function(ne){K.modules[ne]===!0&&(K.modules[ne]={})})});var z=Object.keys(H.modules).concat(Object.keys(V.modules)),D=z.reduce(function(K,ne){var Z=N.import("modules/"+ne);return Z==null?A.error("Cannot load "+ne+" module. Are you sure you registered it?"):K[ne]=Z.DEFAULTS||{},K},{});return V.modules!=null&&V.modules.toolbar&&V.modules.toolbar.constructor!==Object&&(V.modules.toolbar={container:V.modules.toolbar}),V=(0,O.default)(!0,{},N.DEFAULTS,{modules:D},H,V),["bounds","container","scrollingContainer"].forEach(function(K){typeof V[K]=="string"&&(V[K]=document.querySelector(V[K]))}),V.modules=Object.keys(V.modules).reduce(function(K,ne){return V.modules[ne]&&(K[ne]=V.modules[ne]),K},{}),V}function W(J,V,H,z){if(this.options.strict&&!this.isEnabled()&&V===d.default.sources.USER)return new c.default;var D=H==null?null:this.getSelection(),K=this.editor.delta,ne=J();if(D!=null&&(H===!0&&(H=D.index),z==null?D=$(D,ne,V):z!==0&&(D=$(D,H,z,V)),this.setSelection(D,d.default.sources.SILENT)),ne.length()>0){var Z,ee=[d.default.events.TEXT_CHANGE,ne,K,V];if((Z=this.emitter).emit.apply(Z,[d.default.events.EDITOR_CHANGE].concat(ee)),V!==d.default.sources.SILENT){var ae;(ae=this.emitter).emit.apply(ae,ee)}}return ne}function G(J,V,H,z,D){var K={};return typeof J.index=="number"&&typeof J.length=="number"?typeof V!="number"?(D=z,z=H,H=V,V=J.length,J=J.index):(V=J.length,J=J.index):typeof V!="number"&&(D=z,z=H,H=V,V=0),(typeof H>"u"?"undefined":i(H))==="object"?(K=H,D=z):typeof H=="string"&&(z!=null?K[H]=z:D=H),D=D||d.default.sources.API,[J,V,K,D]}function $(J,V,H,z){if(J==null)return null;var D=void 0,K=void 0;if(V instanceof c.default){var ne=[J.index,J.index+J.length].map(function(se){return V.transformPosition(se,z!==d.default.sources.USER)}),Z=o(ne,2);D=Z[0],K=Z[1]}else{var ee=[J.index,J.index+J.length].map(function(se){return se<V||se===V&&z===d.default.sources.USER?se:H>=0?se+H:Math.max(V,se+H)}),ae=o(ee,2);D=ae[0],K=ae[1]}return new g.Range(D,K-D)}n.expandConfig=I,n.overload=G,n.default=N},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function S(y,g){for(var v=0;v<g.length;v++){var b=g[v];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,g,v){return g&&S(y.prototype,g),v&&S(y,v),y}}(),o=function S(y,g,v){y===null&&(y=Function.prototype);var b=Object.getOwnPropertyDescriptor(y,g);if(b===void 0){var O=Object.getPrototypeOf(y);return O===null?void 0:S(O,g,v)}else{if("value"in b)return b.value;var j=b.get;return j===void 0?void 0:j.call(v)}},l=a(7),u=p(l),c=a(0),h=p(c);function p(S){return S&&S.__esModule?S:{default:S}}function w(S,y){if(!(S instanceof y))throw new TypeError("Cannot call a class as a function")}function d(S,y){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:S}function _(S,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);S.prototype=Object.create(y&&y.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(S,y):S.__proto__=y)}var E=function(S){_(y,S);function y(){return w(this,y),d(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return i(y,[{key:"formatAt",value:function(v,b,O,j){if(y.compare(this.statics.blotName,O)<0&&h.default.query(O,h.default.Scope.BLOT)){var T=this.isolate(v,b);j&&T.wrap(O,j)}else o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"formatAt",this).call(this,v,b,O,j)}},{key:"optimize",value:function(v){if(o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"optimize",this).call(this,v),this.parent instanceof y&&y.compare(this.statics.blotName,this.parent.statics.blotName)>0){var b=this.parent.isolate(this.offset(),this.length());this.moveChildren(b),b.wrap(this)}}}],[{key:"compare",value:function(v,b){var O=y.order.indexOf(v),j=y.order.indexOf(b);return O>=0||j>=0?O-j:v===b?0:v<b?-1:1}}]),y}(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=l(i);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,d){if(!(w instanceof d))throw new TypeError("Cannot call a class as a function")}function c(w,d){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:w}function h(w,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);w.prototype=Object.create(d&&d.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(w,d):w.__proto__=d)}var p=function(w){h(d,w);function d(){return u(this,d),c(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(o.default.Text);n.default=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function g(v,b){for(var O=0;O<b.length;O++){var j=b[O];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(v,j.key,j)}}return function(v,b,O){return b&&g(v.prototype,b),O&&g(v,O),v}}(),o=function g(v,b,O){v===null&&(v=Function.prototype);var j=Object.getOwnPropertyDescriptor(v,b);if(j===void 0){var T=Object.getPrototypeOf(v);return T===null?void 0:g(T,b,O)}else{if("value"in j)return j.value;var M=j.get;return M===void 0?void 0:M.call(O)}},l=a(54),u=p(l),c=a(10),h=p(c);function p(g){return g&&g.__esModule?g:{default:g}}function w(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")}function d(g,v){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:g}function _(g,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);g.prototype=Object.create(v&&v.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(g,v):g.__proto__=v)}var E=(0,h.default)("quill:events"),S=["selectionchange","mousedown","mouseup","click"];S.forEach(function(g){document.addEventListener(g,function(){for(var v=arguments.length,b=Array(v),O=0;O<v;O++)b[O]=arguments[O];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(j){if(j.__quill&&j.__quill.emitter){var T;(T=j.__quill.emitter).handleDOM.apply(T,b)}})})});var y=function(g){_(v,g);function v(){w(this,v);var b=d(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return b.listeners={},b.on("error",E.error),b}return i(v,[{key:"emit",value:function(){E.log.apply(E,arguments),o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(O){for(var j=arguments.length,T=Array(j>1?j-1:0),M=1;M<j;M++)T[M-1]=arguments[M];(this.listeners[O.type]||[]).forEach(function(F){var C=F.node,x=F.handler;(O.target===C||C.contains(O.target))&&x.apply(void 0,[O].concat(T))})}},{key:"listenDOM",value:function(O,j,T){this.listeners[O]||(this.listeners[O]=[]),this.listeners[O].push({node:j,handler:T})}}]),v}(u.default);y.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"},y.sources={API:"api",SILENT:"silent",USER:"user"},n.default=y},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});function i(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function l(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};i(this,l),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 l(c){if(i.indexOf(c)<=i.indexOf(o)){for(var h,p=arguments.length,w=Array(p>1?p-1:0),d=1;d<p;d++)w[d-1]=arguments[d];(h=console)[c].apply(h,w)}}function u(c){return i.reduce(function(h,p){return h[p]=l.bind(console,p,c),h},{})}l.level=u.level=function(c){o=c},n.default=u},function(t,n,a){var i=Array.prototype.slice,o=a(52),l=a(53),u=t.exports=function(w,d,_){return _||(_={}),w===d?!0:w instanceof Date&&d instanceof Date?w.getTime()===d.getTime():!w||!d||typeof w!="object"&&typeof d!="object"?_.strict?w===d:w==d:p(w,d,_)};function c(w){return w==null}function h(w){return!(!w||typeof w!="object"||typeof w.length!="number"||typeof w.copy!="function"||typeof w.slice!="function"||w.length>0&&typeof w[0]!="number")}function p(w,d,_){var E,S;if(c(w)||c(d)||w.prototype!==d.prototype)return!1;if(l(w))return l(d)?(w=i.call(w),d=i.call(d),u(w,d,_)):!1;if(h(w)){if(!h(d)||w.length!==d.length)return!1;for(E=0;E<w.length;E++)if(w[E]!==d[E])return!1;return!0}try{var y=o(w),g=o(d)}catch{return!1}if(y.length!=g.length)return!1;for(y.sort(),g.sort(),E=y.length-1;E>=0;E--)if(y[E]!=g[E])return!1;for(E=y.length-1;E>=0;E--)if(S=y[E],!u(w[S],d[S],_))return!1;return typeof w==typeof d}},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(1),o=function(){function l(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 l.keys=function(u){return[].map.call(u.attributes,function(c){return c.name})},l.prototype.add=function(u,c){return this.canAdd(u,c)?(u.setAttribute(this.keyName,c),!0):!1},l.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},l.prototype.remove=function(u){u.removeAttribute(this.keyName)},l.prototype.value=function(u){var c=u.getAttribute(this.keyName);return this.canAdd(u,c)&&c?c:""},l}();n.default=o},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var i=function(){function M(F,C){var x=[],L=!0,A=!1,N=void 0;try{for(var I=F[Symbol.iterator](),W;!(L=(W=I.next()).done)&&(x.push(W.value),!(C&&x.length===C));L=!0);}catch(G){A=!0,N=G}finally{try{!L&&I.return&&I.return()}finally{if(A)throw N}}return x}return function(F,C){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return M(F,C);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function M(F,C){for(var x=0;x<C.length;x++){var L=C[x];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(F,L.key,L)}}return function(F,C,x){return C&&M(F.prototype,C),x&&M(F,x),F}}(),l=function M(F,C,x){F===null&&(F=Function.prototype);var L=Object.getOwnPropertyDescriptor(F,C);if(L===void 0){var A=Object.getPrototypeOf(F);return A===null?void 0:M(A,C,x)}else{if("value"in L)return L.value;var N=L.get;return N===void 0?void 0:N.call(x)}},u=a(2),c=g(u),h=a(0),p=g(h),w=a(4),d=g(w),_=a(6),E=g(_),S=a(7),y=g(S);function g(M){return M&&M.__esModule?M:{default:M}}function v(M,F){if(!(M instanceof F))throw new TypeError("Cannot call a class as a function")}function b(M,F){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F&&(typeof F=="object"||typeof F=="function")?F:M}function O(M,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof F);M.prototype=Object.create(F&&F.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),F&&(Object.setPrototypeOf?Object.setPrototypeOf(M,F):M.__proto__=F)}var j=function(M){O(F,M);function F(){return v(this,F),b(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}return F}(E.default);j.blotName="code",j.tagName="CODE";var T=function(M){O(F,M);function F(){return v(this,F),b(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}return o(F,[{key:"delta",value:function(){var x=this,L=this.domNode.textContent;return L.endsWith(`
|
|
119
|
-
`)&&(L=L.slice(0,-1)),L.split(`
|
|
120
|
-
`).reduce(function(A,N){return A.insert(N).insert(`
|
|
121
|
-
`,x.formats())},new c.default)}},{key:"format",value:function(x,L){if(!(x===this.statics.blotName&&L)){var A=this.descendant(y.default,this.length()-1),N=i(A,1),I=N[0];I!=null&&I.deleteAt(I.length()-1,1),l(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"format",this).call(this,x,L)}}},{key:"formatAt",value:function(x,L,A,N){if(L!==0&&!(p.default.query(A,p.default.Scope.BLOCK)==null||A===this.statics.blotName&&N===this.statics.formats(this.domNode))){var I=this.newlineIndex(x);if(!(I<0||I>=x+L)){var W=this.newlineIndex(x,!0)+1,G=I-W+1,$=this.isolate(W,G),J=$.next;$.format(A,N),J instanceof F&&J.formatAt(0,x-W+L-G,A,N)}}}},{key:"insertAt",value:function(x,L,A){if(A==null){var N=this.descendant(y.default,x),I=i(N,2),W=I[0],G=I[1];W.insertAt(G,L)}}},{key:"length",value:function(){var x=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
|
|
122
|
-
`)?x:x+1}},{key:"newlineIndex",value:function(x){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(L)return this.domNode.textContent.slice(0,x).lastIndexOf(`
|
|
123
|
-
`);var A=this.domNode.textContent.slice(x).indexOf(`
|
|
124
|
-
`);return A>-1?x+A:-1}},{key:"optimize",value:function(x){this.domNode.textContent.endsWith(`
|
|
125
|
-
`)||this.appendChild(p.default.create("text",`
|
|
126
|
-
`)),l(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"optimize",this).call(this,x);var L=this.next;L!=null&&L.prev===this&&L.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===L.statics.formats(L.domNode)&&(L.optimize(x),L.moveChildren(this),L.remove())}},{key:"replace",value:function(x){l(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"replace",this).call(this,x),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(L){var A=p.default.find(L);A==null?L.parentNode.removeChild(L):A instanceof p.default.Embed?A.remove():A.unwrap()})}}],[{key:"create",value:function(x){var L=l(F.__proto__||Object.getPrototypeOf(F),"create",this).call(this,x);return L.setAttribute("spellcheck",!1),L}},{key:"formats",value:function(){return!0}}]),F}(d.default);T.blotName="code-block",T.tagName="PRE",T.TAB=" ",n.Code=j,n.default=T},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(J){return typeof J}:function(J){return J&&typeof Symbol=="function"&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},o=function(){function J(V,H){var z=[],D=!0,K=!1,ne=void 0;try{for(var Z=V[Symbol.iterator](),ee;!(D=(ee=Z.next()).done)&&(z.push(ee.value),!(H&&z.length===H));D=!0);}catch(ae){K=!0,ne=ae}finally{try{!D&&Z.return&&Z.return()}finally{if(K)throw ne}}return z}return function(V,H){if(Array.isArray(V))return V;if(Symbol.iterator in Object(V))return J(V,H);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function J(V,H){for(var z=0;z<H.length;z++){var D=H[z];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(V,D.key,D)}}return function(V,H,z){return H&&J(V.prototype,H),z&&J(V,z),V}}(),u=a(2),c=L(u),h=a(20),p=L(h),w=a(0),d=L(w),_=a(13),E=L(_),S=a(24),y=L(S),g=a(4),v=L(g),b=a(16),O=L(b),j=a(21),T=L(j),M=a(11),F=L(M),C=a(3),x=L(C);function L(J){return J&&J.__esModule?J:{default:J}}function A(J,V,H){return V in J?Object.defineProperty(J,V,{value:H,enumerable:!0,configurable:!0,writable:!0}):J[V]=H,J}function N(J,V){if(!(J instanceof V))throw new TypeError("Cannot call a class as a function")}var I=/^[ -~]*$/,W=function(){function J(V){N(this,J),this.scroll=V,this.delta=this.getDelta()}return l(J,[{key:"applyDelta",value:function(H){var z=this,D=!1;this.scroll.update();var K=this.scroll.length();return this.scroll.batchStart(),H=$(H),H.reduce(function(ne,Z){var ee=Z.retain||Z.delete||Z.insert.length||1,ae=Z.attributes||{};if(Z.insert!=null){if(typeof Z.insert=="string"){var se=Z.insert;se.endsWith(`
|
|
127
|
-
`)&&D&&(D=!1,se=se.slice(0,-1)),ne>=K&&!se.endsWith(`
|
|
128
|
-
`)&&(D=!0),z.scroll.insertAt(ne,se);var ce=z.scroll.line(ne),me=o(ce,2),xe=me[0],Oe=me[1],Re=(0,x.default)({},(0,g.bubbleFormats)(xe));if(xe instanceof v.default){var Se=xe.descendant(d.default.Leaf,Oe),ve=o(Se,1),He=ve[0];Re=(0,x.default)(Re,(0,g.bubbleFormats)(He))}ae=p.default.attributes.diff(Re,ae)||{}}else if(i(Z.insert)==="object"){var we=Object.keys(Z.insert)[0];if(we==null)return ne;z.scroll.insertAt(ne,we,Z.insert[we])}K+=ee}return Object.keys(ae).forEach(function(Ae){z.scroll.formatAt(ne,ee,Ae,ae[Ae])}),ne+ee},0),H.reduce(function(ne,Z){return typeof Z.delete=="number"?(z.scroll.deleteAt(ne,Z.delete),ne):ne+(Z.retain||Z.insert.length||1)},0),this.scroll.batchEnd(),this.update(H)}},{key:"deleteText",value:function(H,z){return this.scroll.deleteAt(H,z),this.update(new c.default().retain(H).delete(z))}},{key:"formatLine",value:function(H,z){var D=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(K).forEach(function(ne){if(!(D.scroll.whitelist!=null&&!D.scroll.whitelist[ne])){var Z=D.scroll.lines(H,Math.max(z,1)),ee=z;Z.forEach(function(ae){var se=ae.length();if(!(ae instanceof E.default))ae.format(ne,K[ne]);else{var ce=H-ae.offset(D.scroll),me=ae.newlineIndex(ce+ee)-ce+1;ae.formatAt(ce,me,ne,K[ne])}ee-=se})}}),this.scroll.optimize(),this.update(new c.default().retain(H).retain(z,(0,T.default)(K)))}},{key:"formatText",value:function(H,z){var D=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(K).forEach(function(ne){D.scroll.formatAt(H,z,ne,K[ne])}),this.update(new c.default().retain(H).retain(z,(0,T.default)(K)))}},{key:"getContents",value:function(H,z){return this.delta.slice(H,H+z)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(H,z){return H.concat(z.delta())},new c.default)}},{key:"getFormat",value:function(H){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,D=[],K=[];z===0?this.scroll.path(H).forEach(function(Z){var ee=o(Z,1),ae=ee[0];ae instanceof v.default?D.push(ae):ae instanceof d.default.Leaf&&K.push(ae)}):(D=this.scroll.lines(H,z),K=this.scroll.descendants(d.default.Leaf,H,z));var ne=[D,K].map(function(Z){if(Z.length===0)return{};for(var ee=(0,g.bubbleFormats)(Z.shift());Object.keys(ee).length>0;){var ae=Z.shift();if(ae==null)return ee;ee=G((0,g.bubbleFormats)(ae),ee)}return ee});return x.default.apply(x.default,ne)}},{key:"getText",value:function(H,z){return this.getContents(H,z).filter(function(D){return typeof D.insert=="string"}).map(function(D){return D.insert}).join("")}},{key:"insertEmbed",value:function(H,z,D){return this.scroll.insertAt(H,z,D),this.update(new c.default().retain(H).insert(A({},z,D)))}},{key:"insertText",value:function(H,z){var D=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return z=z.replace(/\r\n/g,`
|
|
129
|
-
`).replace(/\r/g,`
|
|
130
|
-
`),this.scroll.insertAt(H,z),Object.keys(K).forEach(function(ne){D.scroll.formatAt(H,z.length,ne,K[ne])}),this.update(new c.default().retain(H).insert(z,(0,T.default)(K)))}},{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!==v.default.blotName||H.children.length>1?!1:H.children.head instanceof O.default}},{key:"removeFormat",value:function(H,z){var D=this.getText(H,z),K=this.scroll.line(H+z),ne=o(K,2),Z=ne[0],ee=ne[1],ae=0,se=new c.default;Z!=null&&(Z instanceof E.default?ae=Z.newlineIndex(ee)-ee+1:ae=Z.length()-ee,se=Z.delta().slice(ee,ee+ae-1).insert(`
|
|
131
|
-
`));var ce=this.getContents(H,z+ae),me=ce.diff(new c.default().insert(D).concat(se)),xe=new c.default().retain(H).concat(me);return this.applyDelta(xe)}},{key:"update",value:function(H){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,K=this.delta;if(z.length===1&&z[0].type==="characterData"&&z[0].target.data.match(I)&&d.default.find(z[0].target)){var ne=d.default.find(z[0].target),Z=(0,g.bubbleFormats)(ne),ee=ne.offset(this.scroll),ae=z[0].oldValue.replace(y.default.CONTENTS,""),se=new c.default().insert(ae),ce=new c.default().insert(ne.value()),me=new c.default().retain(ee).concat(se.diff(ce,D));H=me.reduce(function(xe,Oe){return Oe.insert?xe.insert(Oe.insert,Z):xe.push(Oe)},new c.default),this.delta=K.compose(H)}else this.delta=this.getDelta(),(!H||!(0,F.default)(K.compose(H),this.delta))&&(H=K.diff(this.delta,D));return H}}]),J}();function G(J,V){return Object.keys(V).reduce(function(H,z){return J[z]==null||(V[z]===J[z]?H[z]=V[z]:Array.isArray(V[z])?V[z].indexOf(J[z])<0&&(H[z]=V[z].concat([J[z]])):H[z]=[V[z],J[z]]),H},{})}function $(J){return J.reduce(function(V,H){if(H.insert===1){var z=(0,T.default)(H.attributes);return delete z.image,V.insert({image:H.attributes.image},z)}if(H.attributes!=null&&(H.attributes.list===!0||H.attributes.bullet===!0)&&(H=(0,T.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=W},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var i=function(){function M(F,C){var x=[],L=!0,A=!1,N=void 0;try{for(var I=F[Symbol.iterator](),W;!(L=(W=I.next()).done)&&(x.push(W.value),!(C&&x.length===C));L=!0);}catch(G){A=!0,N=G}finally{try{!L&&I.return&&I.return()}finally{if(A)throw N}}return x}return function(F,C){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return M(F,C);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function M(F,C){for(var x=0;x<C.length;x++){var L=C[x];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(F,L.key,L)}}return function(F,C,x){return C&&M(F.prototype,C),x&&M(F,x),F}}(),l=a(0),u=y(l),c=a(21),h=y(c),p=a(11),w=y(p),d=a(8),_=y(d),E=a(10),S=y(E);function y(M){return M&&M.__esModule?M:{default:M}}function g(M){if(Array.isArray(M)){for(var F=0,C=Array(M.length);F<M.length;F++)C[F]=M[F];return C}else return Array.from(M)}function v(M,F){if(!(M instanceof F))throw new TypeError("Cannot call a class as a function")}var b=(0,S.default)("quill:selection"),O=function M(F){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;v(this,M),this.index=F,this.length=C},j=function(){function M(F,C){var x=this;v(this,M),this.emitter=C,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 O(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){x.mouseDown||setTimeout(x.update.bind(x,_.default.sources.USER),1)}),this.emitter.on(_.default.events.EDITOR_CHANGE,function(L,A){L===_.default.events.TEXT_CHANGE&&A.length()>0&&x.update(_.default.sources.SILENT)}),this.emitter.on(_.default.events.SCROLL_BEFORE_UPDATE,function(){if(x.hasFocus()){var L=x.getNativeRange();L!=null&&L.start.node!==x.cursor.textNode&&x.emitter.once(_.default.events.SCROLL_UPDATE,function(){try{x.setNativeRange(L.start.node,L.start.offset,L.end.node,L.end.offset)}catch{}})}}),this.emitter.on(_.default.events.SCROLL_OPTIMIZE,function(L,A){if(A.range){var N=A.range,I=N.startNode,W=N.startOffset,G=N.endNode,$=N.endOffset;x.setNativeRange(I,W,G,$)}}),this.update(_.default.sources.SILENT)}return o(M,[{key:"handleComposition",value:function(){var C=this;this.root.addEventListener("compositionstart",function(){C.composing=!0}),this.root.addEventListener("compositionend",function(){if(C.composing=!1,C.cursor.parent){var x=C.cursor.restore();if(!x)return;setTimeout(function(){C.setNativeRange(x.startNode,x.startOffset,x.endNode,x.endOffset)},1)}})}},{key:"handleDragging",value:function(){var C=this;this.emitter.listenDOM("mousedown",document.body,function(){C.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){C.mouseDown=!1,C.update(_.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(C,x){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[C])){this.scroll.update();var L=this.getNativeRange();if(!(L==null||!L.native.collapsed||u.default.query(C,u.default.Scope.BLOCK))){if(L.start.node!==this.cursor.textNode){var A=u.default.find(L.start.node,!1);if(A==null)return;if(A instanceof u.default.Leaf){var N=A.split(L.start.offset);A.parent.insertBefore(this.cursor,N)}else A.insertBefore(this.cursor,L.start.node);this.cursor.attach()}this.cursor.format(C,x),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(C){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=this.scroll.length();C=Math.min(C,L-1),x=Math.min(C+x,L-1)-C;var A=void 0,N=this.scroll.leaf(C),I=i(N,2),W=I[0],G=I[1];if(W==null)return null;var $=W.position(G,!0),J=i($,2);A=J[0],G=J[1];var V=document.createRange();if(x>0){V.setStart(A,G);var H=this.scroll.leaf(C+x),z=i(H,2);if(W=z[0],G=z[1],W==null)return null;var D=W.position(G,!0),K=i(D,2);return A=K[0],G=K[1],V.setEnd(A,G),V.getBoundingClientRect()}else{var ne="left",Z=void 0;return A instanceof Text?(G<A.data.length?(V.setStart(A,G),V.setEnd(A,G+1)):(V.setStart(A,G-1),V.setEnd(A,G),ne="right"),Z=V.getBoundingClientRect()):(Z=W.domNode.getBoundingClientRect(),G>0&&(ne="right")),{bottom:Z.top+Z.height,height:Z.height,left:Z[ne],right:Z[ne],top:Z.top,width:0}}}},{key:"getNativeRange",value:function(){var C=document.getSelection();if(C==null||C.rangeCount<=0)return null;var x=C.getRangeAt(0);if(x==null)return null;var L=this.normalizeNative(x);return b.info("getNativeRange",L),L}},{key:"getRange",value:function(){var C=this.getNativeRange();if(C==null)return[null,null];var x=this.normalizedToRange(C);return[x,C]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(C){var x=this,L=[[C.start.node,C.start.offset]];C.native.collapsed||L.push([C.end.node,C.end.offset]);var A=L.map(function(W){var G=i(W,2),$=G[0],J=G[1],V=u.default.find($,!0),H=V.offset(x.scroll);return J===0?H:V instanceof u.default.Container?H+V.length():H+V.index($,J)}),N=Math.min(Math.max.apply(Math,g(A)),this.scroll.length()-1),I=Math.min.apply(Math,[N].concat(g(A)));return new O(I,N-I)}},{key:"normalizeNative",value:function(C){if(!T(this.root,C.startContainer)||!C.collapsed&&!T(this.root,C.endContainer))return null;var x={start:{node:C.startContainer,offset:C.startOffset},end:{node:C.endContainer,offset:C.endOffset},native:C};return[x.start,x.end].forEach(function(L){for(var A=L.node,N=L.offset;!(A instanceof Text)&&A.childNodes.length>0;)if(A.childNodes.length>N)A=A.childNodes[N],N=0;else if(A.childNodes.length===N)A=A.lastChild,N=A instanceof Text?A.data.length:A.childNodes.length+1;else break;L.node=A,L.offset=N}),x}},{key:"rangeToNative",value:function(C){var x=this,L=C.collapsed?[C.index]:[C.index,C.index+C.length],A=[],N=this.scroll.length();return L.forEach(function(I,W){I=Math.min(N-1,I);var G=void 0,$=x.scroll.leaf(I),J=i($,2),V=J[0],H=J[1],z=V.position(H,W!==0),D=i(z,2);G=D[0],H=D[1],A.push(G,H)}),A.length<2&&(A=A.concat(A)),A}},{key:"scrollIntoView",value:function(C){var x=this.lastRange;if(x!=null){var L=this.getBounds(x.index,x.length);if(L!=null){var A=this.scroll.length()-1,N=this.scroll.line(Math.min(x.index,A)),I=i(N,1),W=I[0],G=W;if(x.length>0){var $=this.scroll.line(Math.min(x.index+x.length,A)),J=i($,1);G=J[0]}if(!(W==null||G==null)){var V=C.getBoundingClientRect();L.top<V.top?C.scrollTop-=V.top-L.top:L.bottom>V.bottom&&(C.scrollTop+=L.bottom-V.bottom)}}}}},{key:"setNativeRange",value:function(C,x){var L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:C,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:x,N=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(b.info("setNativeRange",C,x,L,A),!(C!=null&&(this.root.parentNode==null||C.parentNode==null||L.parentNode==null))){var I=document.getSelection();if(I!=null)if(C!=null){this.hasFocus()||this.root.focus();var W=(this.getNativeRange()||{}).native;if(W==null||N||C!==W.startContainer||x!==W.startOffset||L!==W.endContainer||A!==W.endOffset){C.tagName=="BR"&&(x=[].indexOf.call(C.parentNode.childNodes,C),C=C.parentNode),L.tagName=="BR"&&(A=[].indexOf.call(L.parentNode.childNodes,L),L=L.parentNode);var G=document.createRange();G.setStart(C,x),G.setEnd(L,A),I.removeAllRanges(),I.addRange(G)}}else I.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(C){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_.default.sources.API;if(typeof x=="string"&&(L=x,x=!1),b.info("setRange",C),C!=null){var A=this.rangeToNative(C);this.setNativeRange.apply(this,g(A).concat([x]))}else this.setNativeRange(null);this.update(L)}},{key:"update",value:function(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_.default.sources.USER,x=this.lastRange,L=this.getRange(),A=i(L,2),N=A[0],I=A[1];if(this.lastRange=N,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,w.default)(x,this.lastRange)){var W;!this.composing&&I!=null&&I.native.collapsed&&I.start.node!==this.cursor.textNode&&this.cursor.restore();var G=[_.default.events.SELECTION_CHANGE,(0,h.default)(this.lastRange),(0,h.default)(x),C];if((W=this.emitter).emit.apply(W,[_.default.events.EDITOR_CHANGE].concat(G)),C!==_.default.sources.SILENT){var $;($=this.emitter).emit.apply($,G)}}}}]),M}();function T(M,F){try{F.parentNode}catch{return!1}return F instanceof Text&&(F=F.parentNode),M.contains(F)}n.Range=O,n.default=j},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function _(E,S){for(var y=0;y<S.length;y++){var g=S[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(E,g.key,g)}}return function(E,S,y){return S&&_(E.prototype,S),y&&_(E,y),E}}(),o=function _(E,S,y){E===null&&(E=Function.prototype);var g=Object.getOwnPropertyDescriptor(E,S);if(g===void 0){var v=Object.getPrototypeOf(E);return v===null?void 0:_(v,S,y)}else{if("value"in g)return g.value;var b=g.get;return b===void 0?void 0:b.call(y)}},l=a(0),u=c(l);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 w(_,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 d=function(_){w(E,_);function E(){return h(this,E),p(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return i(E,[{key:"insertInto",value:function(y,g){y.children.length===0?o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"insertInto",this).call(this,y,g):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),E}(u.default.Embed);d.blotName="break",d.tagName="BR",n.default=d},function(t,n,a){var i=this&&this.__extends||function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,d){w.__proto__=d}||function(w,d){for(var _ in d)d.hasOwnProperty(_)&&(w[_]=d[_])};return function(w,d){p(w,d);function _(){this.constructor=w}w.prototype=d===null?Object.create(d):(_.prototype=d.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(44),l=a(30),u=a(1),c=function(p){i(w,p);function w(d){var _=p.call(this,d)||this;return _.build(),_}return w.prototype.appendChild=function(d){this.insertBefore(d)},w.prototype.attach=function(){p.prototype.attach.call(this),this.children.forEach(function(d){d.attach()})},w.prototype.build=function(){var d=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(_){try{var E=h(_);d.insertBefore(E,d.children.head||void 0)}catch(S){if(S instanceof u.ParchmentError)return;throw S}})},w.prototype.deleteAt=function(d,_){if(d===0&&_===this.length())return this.remove();this.children.forEachAt(d,_,function(E,S,y){E.deleteAt(S,y)})},w.prototype.descendant=function(d,_){var E=this.children.find(_),S=E[0],y=E[1];return d.blotName==null&&d(S)||d.blotName!=null&&S instanceof d?[S,y]:S instanceof w?S.descendant(d,y):[null,-1]},w.prototype.descendants=function(d,_,E){_===void 0&&(_=0),E===void 0&&(E=Number.MAX_VALUE);var S=[],y=E;return this.children.forEachAt(_,E,function(g,v,b){(d.blotName==null&&d(g)||d.blotName!=null&&g instanceof d)&&S.push(g),g instanceof w&&(S=S.concat(g.descendants(d,v,y))),y-=b}),S},w.prototype.detach=function(){this.children.forEach(function(d){d.detach()}),p.prototype.detach.call(this)},w.prototype.formatAt=function(d,_,E,S){this.children.forEachAt(d,_,function(y,g,v){y.formatAt(g,v,E,S)})},w.prototype.insertAt=function(d,_,E){var S=this.children.find(d),y=S[0],g=S[1];if(y)y.insertAt(g,_,E);else{var v=E==null?u.create("text",_):u.create(_,E);this.appendChild(v)}},w.prototype.insertBefore=function(d,_){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(E){return d instanceof E}))throw new u.ParchmentError("Cannot insert "+d.statics.blotName+" into "+this.statics.blotName);d.insertInto(this,_)},w.prototype.length=function(){return this.children.reduce(function(d,_){return d+_.length()},0)},w.prototype.moveChildren=function(d,_){this.children.forEach(function(E){d.insertBefore(E,_)})},w.prototype.optimize=function(d){if(p.prototype.optimize.call(this,d),this.children.length===0)if(this.statics.defaultChild!=null){var _=u.create(this.statics.defaultChild);this.appendChild(_),_.optimize(d)}else this.remove()},w.prototype.path=function(d,_){_===void 0&&(_=!1);var E=this.children.find(d,_),S=E[0],y=E[1],g=[[this,d]];return S instanceof w?g.concat(S.path(y,_)):(S!=null&&g.push([S,y]),g)},w.prototype.removeChild=function(d){this.children.remove(d)},w.prototype.replace=function(d){d instanceof w&&d.moveChildren(this),p.prototype.replace.call(this,d)},w.prototype.split=function(d,_){if(_===void 0&&(_=!1),!_){if(d===0)return this;if(d===this.length())return this.next}var E=this.clone();return this.parent.insertBefore(E,this.next),this.children.forEachAt(d,this.length(),function(S,y,g){S=S.split(y,_),E.appendChild(S)}),E},w.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},w.prototype.update=function(d,_){var E=this,S=[],y=[];d.forEach(function(g){g.target===E.domNode&&g.type==="childList"&&(S.push.apply(S,g.addedNodes),y.push.apply(y,g.removedNodes))}),y.forEach(function(g){if(!(g.parentNode!=null&&g.tagName!=="IFRAME"&&document.body.compareDocumentPosition(g)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var v=u.find(g);v!=null&&(v.domNode.parentNode==null||v.domNode.parentNode===E.domNode)&&v.detach()}}),S.filter(function(g){return g.parentNode==E.domNode}).sort(function(g,v){return g===v?0:g.compareDocumentPosition(v)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(g){var v=null;g.nextSibling!=null&&(v=u.find(g.nextSibling));var b=h(g);(b.next!=v||b.next==null)&&(b.parent!=null&&b.parent.removeChild(E),E.insertBefore(b,v||void 0))})},w}(l.default);function h(p){var w=u.find(p);if(w==null)try{w=u.create(p)}catch{w=u.create(u.Scope.INLINE),[].slice.call(p.childNodes).forEach(function(_){w.domNode.appendChild(_)}),p.parentNode&&p.parentNode.replaceChild(w.domNode,p),w.attach()}return w}n.default=c},function(t,n,a){var i=this&&this.__extends||function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,d){w.__proto__=d}||function(w,d){for(var _ in d)d.hasOwnProperty(_)&&(w[_]=d[_])};return function(w,d){p(w,d);function _(){this.constructor=w}w.prototype=d===null?Object.create(d):(_.prototype=d.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(12),l=a(31),u=a(17),c=a(1),h=function(p){i(w,p);function w(d){var _=p.call(this,d)||this;return _.attributes=new l.default(_.domNode),_}return w.formats=function(d){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return d.tagName.toLowerCase()},w.prototype.format=function(d,_){var E=c.query(d);E instanceof o.default?this.attributes.attribute(E,_):_&&E!=null&&(d!==this.statics.blotName||this.formats()[d]!==_)&&this.replaceWith(d,_)},w.prototype.formats=function(){var d=this.attributes.values(),_=this.statics.formats(this.domNode);return _!=null&&(d[this.statics.blotName]=_),d},w.prototype.replaceWith=function(d,_){var E=p.prototype.replaceWith.call(this,d,_);return this.attributes.copy(E),E},w.prototype.update=function(d,_){var E=this;p.prototype.update.call(this,d,_),d.some(function(S){return S.target===E.domNode&&S.type==="attributes"})&&this.attributes.build()},w.prototype.wrap=function(d,_){var E=p.prototype.wrap.call(this,d,_);return E instanceof w&&E.statics.scope===this.statics.scope&&this.attributes.move(E),E},w}(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 w in p)p.hasOwnProperty(w)&&(h[w]=p[w])};return function(h,p){c(h,p);function w(){this.constructor=h}h.prototype=p===null?Object.create(p):(w.prototype=p.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(30),l=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,w){return this.domNode===p||this.domNode.compareDocumentPosition(p)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(w,1):-1},h.prototype.position=function(p,w){var d=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return p>0&&(d+=1),[this.parent.domNode,d]},h.prototype.value=function(){var p;return p={},p[this.statics.blotName]=this.statics.value(this.domNode)||!0,p},h.scope=l.Scope.INLINE_BLOT,h}(o.default);n.default=u},function(t,n,a){var i=a(11),o=a(3),l={attributes:{compose:function(c,h,p){typeof c!="object"&&(c={}),typeof h!="object"&&(h={});var w=o(!0,{},h);p||(w=Object.keys(w).reduce(function(_,E){return w[E]!=null&&(_[E]=w[E]),_},{}));for(var d in c)c[d]!==void 0&&h[d]===void 0&&(w[d]=c[d]);return Object.keys(w).length>0?w: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(w,d){return i(c[d],h[d])||(w[d]=h[d]===void 0?null:h[d]),w},{});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 w=Object.keys(h).reduce(function(d,_){return c[_]===void 0&&(d[_]=h[_]),d},{});return Object.keys(w).length>0?w: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,w=l.length(h);if(c>=w-p?(c=w-p,this.index+=1,this.offset=0):this.offset+=c,typeof h.delete=="number")return{delete:c};var d={};return h.attributes&&(d.attributes=h.attributes),typeof h.retain=="number"?d.retain=c:typeof h.insert=="string"?d.insert=h.insert.substr(p,c):d.insert=h.insert,d}else return{retain:1/0}},u.prototype.peek=function(){return this.ops[this.index]},u.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},u.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},u.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var c=this.offset,h=this.index,p=this.next(),w=this.ops.slice(this.index);return this.offset=c,this.index=h,[p].concat(w)}else return[]},t.exports=l},function(t,n){var a=function(){function i(E,S){return S!=null&&E instanceof S}var o;try{o=Map}catch{o=function(){}}var l;try{l=Set}catch{l=function(){}}var u;try{u=Promise}catch{u=function(){}}function c(E,S,y,g,v){typeof S=="object"&&(y=S.depth,g=S.prototype,v=S.includeNonEnumerable,S=S.circular);var b=[],O=[],j=typeof Buffer<"u";typeof S>"u"&&(S=!0),typeof y>"u"&&(y=1/0);function T(M,F){if(M===null)return null;if(F===0)return M;var C,x;if(typeof M!="object")return M;if(i(M,o))C=new o;else if(i(M,l))C=new l;else if(i(M,u))C=new u(function(V,H){M.then(function(z){V(T(z,F-1))},function(z){H(T(z,F-1))})});else if(c.__isArray(M))C=[];else if(c.__isRegExp(M))C=new RegExp(M.source,_(M)),M.lastIndex&&(C.lastIndex=M.lastIndex);else if(c.__isDate(M))C=new Date(M.getTime());else{if(j&&Buffer.isBuffer(M))return Buffer.allocUnsafe?C=Buffer.allocUnsafe(M.length):C=new Buffer(M.length),M.copy(C),C;i(M,Error)?C=Object.create(M):typeof g>"u"?(x=Object.getPrototypeOf(M),C=Object.create(x)):(C=Object.create(g),x=g)}if(S){var L=b.indexOf(M);if(L!=-1)return O[L];b.push(M),O.push(C)}i(M,o)&&M.forEach(function(V,H){var z=T(H,F-1),D=T(V,F-1);C.set(z,D)}),i(M,l)&&M.forEach(function(V){var H=T(V,F-1);C.add(H)});for(var A in M){var N;x&&(N=Object.getOwnPropertyDescriptor(x,A)),!(N&&N.set==null)&&(C[A]=T(M[A],F-1))}if(Object.getOwnPropertySymbols)for(var I=Object.getOwnPropertySymbols(M),A=0;A<I.length;A++){var W=I[A],G=Object.getOwnPropertyDescriptor(M,W);G&&!G.enumerable&&!v||(C[W]=T(M[W],F-1),G.enumerable||Object.defineProperty(C,W,{enumerable:!1}))}if(v)for(var $=Object.getOwnPropertyNames(M),A=0;A<$.length;A++){var J=$[A],G=Object.getOwnPropertyDescriptor(M,J);G&&G.enumerable||(C[J]=T(M[J],F-1),Object.defineProperty(C,J,{enumerable:!1}))}return C}return T(E,y)}c.clonePrototype=function(S){if(S===null)return null;var y=function(){};return y.prototype=S,new y};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 w(E){return typeof E=="object"&&h(E)==="[object Array]"}c.__isArray=w;function d(E){return typeof E=="object"&&h(E)==="[object RegExp]"}c.__isRegExp=d;function _(E){var S="";return E.global&&(S+="g"),E.ignoreCase&&(S+="i"),E.multiline&&(S+="m"),S}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 C(x,L){var A=[],N=!0,I=!1,W=void 0;try{for(var G=x[Symbol.iterator](),$;!(N=($=G.next()).done)&&(A.push($.value),!(L&&A.length===L));N=!0);}catch(J){I=!0,W=J}finally{try{!N&&G.return&&G.return()}finally{if(I)throw W}}return A}return function(x,L){if(Array.isArray(x))return x;if(Symbol.iterator in Object(x))return C(x,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function C(x,L){for(var A=0;A<L.length;A++){var N=L[A];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,N.key,N)}}return function(x,L,A){return L&&C(x.prototype,L),A&&C(x,A),x}}(),l=function C(x,L,A){x===null&&(x=Function.prototype);var N=Object.getOwnPropertyDescriptor(x,L);if(N===void 0){var I=Object.getPrototypeOf(x);return I===null?void 0:C(I,L,A)}else{if("value"in N)return N.value;var W=N.get;return W===void 0?void 0:W.call(A)}},u=a(0),c=b(u),h=a(8),p=b(h),w=a(4),d=b(w),_=a(16),E=b(_),S=a(13),y=b(S),g=a(25),v=b(g);function b(C){return C&&C.__esModule?C:{default:C}}function O(C,x){if(!(C instanceof x))throw new TypeError("Cannot call a class as a function")}function j(C,x){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:C}function T(C,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);C.prototype=Object.create(x&&x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(C,x):C.__proto__=x)}function M(C){return C instanceof d.default||C instanceof w.BlockEmbed}var F=function(C){T(x,C);function x(L,A){O(this,x);var N=j(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,L));return N.emitter=A.emitter,Array.isArray(A.whitelist)&&(N.whitelist=A.whitelist.reduce(function(I,W){return I[W]=!0,I},{})),N.domNode.addEventListener("DOMNodeInserted",function(){}),N.optimize(),N.enable(),N}return o(x,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(A,N){var I=this.line(A),W=i(I,2),G=W[0],$=W[1],J=this.line(A+N),V=i(J,1),H=V[0];if(l(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"deleteAt",this).call(this,A,N),H!=null&&G!==H&&$>0){if(G instanceof w.BlockEmbed||H instanceof w.BlockEmbed){this.optimize();return}if(G instanceof y.default){var z=G.newlineIndex(G.length(),!0);if(z>-1&&(G=G.split(z+1),G===H)){this.optimize();return}}else if(H instanceof y.default){var D=H.newlineIndex(0);D>-1&&H.split(D+1)}var K=H.children.head instanceof E.default?null:H.children.head;G.moveChildren(H,K),G.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,N,I,W){this.whitelist!=null&&!this.whitelist[I]||(l(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"formatAt",this).call(this,A,N,I,W),this.optimize())}},{key:"insertAt",value:function(A,N,I){if(!(I!=null&&this.whitelist!=null&&!this.whitelist[N])){if(A>=this.length())if(I==null||c.default.query(N,c.default.Scope.BLOCK)==null){var W=c.default.create(this.statics.defaultChild);this.appendChild(W),I==null&&N.endsWith(`
|
|
134
|
-
`)&&(N=N.slice(0,-1)),W.insertAt(0,N,I)}else{var G=c.default.create(N,I);this.appendChild(G)}else l(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"insertAt",this).call(this,A,N,I);this.optimize()}}},{key:"insertBefore",value:function(A,N){if(A.statics.scope===c.default.Scope.INLINE_BLOT){var I=c.default.create(this.statics.defaultChild);I.appendChild(A),A=I}l(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"insertBefore",this).call(this,A,N)}},{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(M,A)}},{key:"lines",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,I=function W(G,$,J){var V=[],H=J;return G.children.forEachAt($,J,function(z,D,K){M(z)?V.push(z):z instanceof c.default.Container&&(V=V.concat(W(z,D,H))),H-=K}),V};return I(this,A,N)}},{key:"optimize",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(l(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"optimize",this).call(this,A,N),A.length>0&&this.emitter.emit(p.default.events.SCROLL_OPTIMIZE,A,N))}},{key:"path",value:function(A){return l(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"path",this).call(this,A).slice(1)}},{key:"update",value:function(A){if(this.batch!==!0){var N=p.default.sources.USER;typeof A=="string"&&(N=A),Array.isArray(A)||(A=this.observer.takeRecords()),A.length>0&&this.emitter.emit(p.default.events.SCROLL_BEFORE_UPDATE,N,A),l(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"update",this).call(this,A.concat([])),A.length>0&&this.emitter.emit(p.default.events.SCROLL_UPDATE,N,A)}}}]),x}(c.default.Scroll);F.blotName="scroll",F.className="ql-editor",F.tagName="DIV",F.defaultChild="block",F.allowedChildren=[d.default,w.BlockEmbed,v.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(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},o=function(){function Z(ee,ae){var se=[],ce=!0,me=!1,xe=void 0;try{for(var Oe=ee[Symbol.iterator](),Re;!(ce=(Re=Oe.next()).done)&&(se.push(Re.value),!(ae&&se.length===ae));ce=!0);}catch(Se){me=!0,xe=Se}finally{try{!ce&&Oe.return&&Oe.return()}finally{if(me)throw xe}}return se}return function(ee,ae){if(Array.isArray(ee))return ee;if(Symbol.iterator in Object(ee))return Z(ee,ae);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function Z(ee,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(ee,ce.key,ce)}}return function(ee,ae,se){return ae&&Z(ee.prototype,ae),se&&Z(ee,se),ee}}(),u=a(21),c=C(u),h=a(11),p=C(h),w=a(3),d=C(w),_=a(2),E=C(_),S=a(20),y=C(S),g=a(0),v=C(g),b=a(5),O=C(b),j=a(10),T=C(j),M=a(9),F=C(M);function C(Z){return Z&&Z.__esModule?Z:{default:Z}}function x(Z,ee,ae){return ee in Z?Object.defineProperty(Z,ee,{value:ae,enumerable:!0,configurable:!0,writable:!0}):Z[ee]=ae,Z}function L(Z,ee){if(!(Z instanceof ee))throw new TypeError("Cannot call a class as a function")}function A(Z,ee){if(!Z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ee&&(typeof ee=="object"||typeof ee=="function")?ee:Z}function N(Z,ee){if(typeof ee!="function"&&ee!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof ee);Z.prototype=Object.create(ee&&ee.prototype,{constructor:{value:Z,enumerable:!1,writable:!0,configurable:!0}}),ee&&(Object.setPrototypeOf?Object.setPrototypeOf(Z,ee):Z.__proto__=ee)}var I=(0,T.default)("quill:keyboard"),W=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",G=function(Z){N(ee,Z),l(ee,null,[{key:"match",value:function(se,ce){return ce=ne(ce),["altKey","ctrlKey","metaKey","shiftKey"].some(function(me){return!!ce[me]!==se[me]&&ce[me]!==null})?!1:ce.key===(se.which||se.keyCode)}}]);function ee(ae,se){L(this,ee);var ce=A(this,(ee.__proto__||Object.getPrototypeOf(ee)).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:ee.keys.ENTER,shiftKey:null},z),ce.addBinding({key:ee.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(ce.addBinding({key:ee.keys.BACKSPACE},{collapsed:!0},J),ce.addBinding({key:ee.keys.DELETE},{collapsed:!0},V)):(ce.addBinding({key:ee.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},J),ce.addBinding({key:ee.keys.DELETE},{collapsed:!0,suffix:/^.?$/},V)),ce.addBinding({key:ee.keys.BACKSPACE},{collapsed:!1},H),ce.addBinding({key:ee.keys.DELETE},{collapsed:!1},H),ce.addBinding({key:ee.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},J),ce.listen(),ce}return l(ee,[{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]:{},xe=ne(se);if(xe==null||xe.key==null)return I.warn("Attempted to add invalid keyboard binding",xe);typeof ce=="function"&&(ce={handler:ce}),typeof me=="function"&&(me={handler:me}),xe=(0,d.default)(xe,ce,me),this.bindings[xe.key]=this.bindings[xe.key]||[],this.bindings[xe.key].push(xe)}},{key:"listen",value:function(){var se=this;this.quill.root.addEventListener("keydown",function(ce){if(!ce.defaultPrevented){var me=ce.which||ce.keyCode,xe=(se.bindings[me]||[]).filter(function(nt){return ee.match(ce,nt)});if(xe.length!==0){var Oe=se.quill.getSelection();if(!(Oe==null||!se.quill.hasFocus())){var Re=se.quill.getLine(Oe.index),Se=o(Re,2),ve=Se[0],He=Se[1],we=se.quill.getLeaf(Oe.index),Ae=o(we,2),Ee=Ae[0],Ne=Ae[1],he=Oe.length===0?[Ee,Ne]:se.quill.getLeaf(Oe.index+Oe.length),Le=o(he,2),Ce=Le[0],De=Le[1],tt=Ee instanceof v.default.Text?Ee.value().slice(0,Ne):"",vt=Ce instanceof v.default.Text?Ce.value().slice(De):"",mt={collapsed:Oe.length===0,empty:Oe.length===0&&ve.length()<=1,format:se.quill.getFormat(Oe),offset:He,prefix:tt,suffix:vt},Et=xe.some(function(nt){if(nt.collapsed!=null&&nt.collapsed!==mt.collapsed||nt.empty!=null&&nt.empty!==mt.empty||nt.offset!=null&&nt.offset!==mt.offset)return!1;if(Array.isArray(nt.format)){if(nt.format.every(function(at){return mt.format[at]==null}))return!1}else if(i(nt.format)==="object"&&!Object.keys(nt.format).every(function(at){return nt.format[at]===!0?mt.format[at]!=null:nt.format[at]===!1?mt.format[at]==null:(0,p.default)(nt.format[at],mt.format[at])}))return!1;return nt.prefix!=null&&!nt.prefix.test(mt.prefix)||nt.suffix!=null&&!nt.suffix.test(mt.suffix)?!1:nt.handler.call(se,Oe,mt)!==!0});Et&&ce.preventDefault()}}}})}}]),ee}(F.default);G.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},G.DEFAULTS={bindings:{bold:K("bold"),italic:K("italic"),underline:K("underline"),indent:{key:G.keys.TAB,format:["blockquote","indent","list"],handler:function(ee,ae){if(ae.collapsed&&ae.offset!==0)return!0;this.quill.format("indent","+1",O.default.sources.USER)}},outdent:{key:G.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(ee,ae){if(ae.collapsed&&ae.offset!==0)return!0;this.quill.format("indent","-1",O.default.sources.USER)}},"outdent backspace":{key:G.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(ee,ae){ae.format.indent!=null?this.quill.format("indent","-1",O.default.sources.USER):ae.format.list!=null&&this.quill.format("list",!1,O.default.sources.USER)}},"indent code-block":D(!0),"outdent code-block":D(!1),"remove tab":{key:G.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(ee){this.quill.deleteText(ee.index-1,1,O.default.sources.USER)}},tab:{key:G.keys.TAB,handler:function(ee){this.quill.history.cutoff();var ae=new E.default().retain(ee.index).delete(ee.length).insert(" ");this.quill.updateContents(ae,O.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(ee.index+1,O.default.sources.SILENT)}},"list empty enter":{key:G.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(ee,ae){this.quill.format("list",!1,O.default.sources.USER),ae.format.indent&&this.quill.format("indent",!1,O.default.sources.USER)}},"checklist enter":{key:G.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(ee){var ae=this.quill.getLine(ee.index),se=o(ae,2),ce=se[0],me=se[1],xe=(0,d.default)({},ce.formats(),{list:"checked"}),Oe=new E.default().retain(ee.index).insert(`
|
|
135
|
-
`,xe).retain(ce.length()-me-1).retain(1,{list:"unchecked"});this.quill.updateContents(Oe,O.default.sources.USER),this.quill.setSelection(ee.index+1,O.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:G.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(ee,ae){var se=this.quill.getLine(ee.index),ce=o(se,2),me=ce[0],xe=ce[1],Oe=new E.default().retain(ee.index).insert(`
|
|
136
|
-
`,ae.format).retain(me.length()-xe-1).retain(1,{header:null});this.quill.updateContents(Oe,O.default.sources.USER),this.quill.setSelection(ee.index+1,O.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(ee,ae){var se=ae.prefix.length,ce=this.quill.getLine(ee.index),me=o(ce,2),xe=me[0],Oe=me[1];if(Oe>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(ee.index," ",O.default.sources.USER),this.quill.history.cutoff();var Se=new E.default().retain(ee.index-Oe).delete(se+1).retain(xe.length()-2-Oe).retain(1,{list:Re});this.quill.updateContents(Se,O.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(ee.index-se,O.default.sources.SILENT)}},"code exit":{key:G.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(ee){var ae=this.quill.getLine(ee.index),se=o(ae,2),ce=se[0],me=se[1],xe=new E.default().retain(ee.index+ce.length()-me-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(xe,O.default.sources.USER)}},"embed left":$(G.keys.LEFT,!1),"embed left shift":$(G.keys.LEFT,!0),"embed right":$(G.keys.RIGHT,!1),"embed right shift":$(G.keys.RIGHT,!0)}};function $(Z,ee){var ae,se=Z===G.keys.LEFT?"prefix":"suffix";return ae={key:Z,shiftKey:ee,altKey:null},x(ae,se,/^$/),x(ae,"handler",function(me){var xe=me.index;Z===G.keys.RIGHT&&(xe+=me.length+1);var Oe=this.quill.getLeaf(xe),Re=o(Oe,1),Se=Re[0];return Se instanceof v.default.Embed?(Z===G.keys.LEFT?ee?this.quill.setSelection(me.index-1,me.length+1,O.default.sources.USER):this.quill.setSelection(me.index-1,O.default.sources.USER):ee?this.quill.setSelection(me.index,me.length+1,O.default.sources.USER):this.quill.setSelection(me.index+me.length+1,O.default.sources.USER),!1):!0}),ae}function J(Z,ee){if(!(Z.index===0||this.quill.getLength()<=1)){var ae=this.quill.getLine(Z.index),se=o(ae,1),ce=se[0],me={};if(ee.offset===0){var xe=this.quill.getLine(Z.index-1),Oe=o(xe,1),Re=Oe[0];if(Re!=null&&Re.length()>1){var Se=ce.formats(),ve=this.quill.getFormat(Z.index-1,1);me=y.default.attributes.diff(Se,ve)||{}}}var He=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(ee.prefix)?2:1;this.quill.deleteText(Z.index-He,He,O.default.sources.USER),Object.keys(me).length>0&&this.quill.formatLine(Z.index-He,He,me,O.default.sources.USER),this.quill.focus()}}function V(Z,ee){var ae=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(ee.suffix)?2:1;if(!(Z.index>=this.quill.getLength()-ae)){var se={},ce=0,me=this.quill.getLine(Z.index),xe=o(me,1),Oe=xe[0];if(ee.offset>=Oe.length()-1){var Re=this.quill.getLine(Z.index+1),Se=o(Re,1),ve=Se[0];if(ve){var He=Oe.formats(),we=this.quill.getFormat(Z.index,1);se=y.default.attributes.diff(He,we)||{},ce=ve.length()}}this.quill.deleteText(Z.index,ae,O.default.sources.USER),Object.keys(se).length>0&&this.quill.formatLine(Z.index+ce-1,ae,se,O.default.sources.USER)}}function H(Z){var ee=this.quill.getLines(Z),ae={};if(ee.length>1){var se=ee[0].formats(),ce=ee[ee.length-1].formats();ae=y.default.attributes.diff(ce,se)||{}}this.quill.deleteText(Z,O.default.sources.USER),Object.keys(ae).length>0&&this.quill.formatLine(Z.index,1,ae,O.default.sources.USER),this.quill.setSelection(Z.index,O.default.sources.SILENT),this.quill.focus()}function z(Z,ee){var ae=this;Z.length>0&&this.quill.scroll.deleteAt(Z.index,Z.length);var se=Object.keys(ee.format).reduce(function(ce,me){return v.default.query(me,v.default.Scope.BLOCK)&&!Array.isArray(ee.format[me])&&(ce[me]=ee.format[me]),ce},{});this.quill.insertText(Z.index,`
|
|
137
|
-
`,se,O.default.sources.USER),this.quill.setSelection(Z.index+1,O.default.sources.SILENT),this.quill.focus(),Object.keys(ee.format).forEach(function(ce){se[ce]==null&&(Array.isArray(ee.format[ce])||ce!=="link"&&ae.quill.format(ce,ee.format[ce],O.default.sources.USER))})}function D(Z){return{key:G.keys.TAB,shiftKey:!Z,format:{"code-block":!0},handler:function(ae){var se=v.default.query("code-block"),ce=ae.index,me=ae.length,xe=this.quill.scroll.descendant(se,ce),Oe=o(xe,2),Re=Oe[0],Se=Oe[1];if(Re!=null){var ve=this.quill.getIndex(Re),He=Re.newlineIndex(Se,!0)+1,we=Re.newlineIndex(ve+Se+me),Ae=Re.domNode.textContent.slice(He,we).split(`
|
|
138
|
-
`);Se=0,Ae.forEach(function(Ee,Ne){Z?(Re.insertAt(He+Se,se.TAB),Se+=se.TAB.length,Ne===0?ce+=se.TAB.length:me+=se.TAB.length):Ee.startsWith(se.TAB)&&(Re.deleteAt(He+Se,se.TAB.length),Se-=se.TAB.length,Ne===0?ce-=se.TAB.length:me-=se.TAB.length),Se+=Ee.length+1}),this.quill.update(O.default.sources.USER),this.quill.setSelection(ce,me,O.default.sources.SILENT)}}}}function K(Z){return{key:Z[0].toUpperCase(),shortKey:!0,handler:function(ae,se){this.quill.format(Z,!se.format[Z],O.default.sources.USER)}}}function ne(Z){if(typeof Z=="string"||typeof Z=="number")return ne({key:Z});if((typeof Z>"u"?"undefined":i(Z))==="object"&&(Z=(0,c.default)(Z,!1)),typeof Z.key=="string")if(G.keys[Z.key.toUpperCase()]!=null)Z.key=G.keys[Z.key.toUpperCase()];else if(Z.key.length===1)Z.key=Z.key.toUpperCase().charCodeAt(0);else return null;return Z.shortKey&&(Z[W]=Z.shortKey,delete Z.shortKey),Z}n.default=G,n.SHORTKEY=W},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function y(g,v){var b=[],O=!0,j=!1,T=void 0;try{for(var M=g[Symbol.iterator](),F;!(O=(F=M.next()).done)&&(b.push(F.value),!(v&&b.length===v));O=!0);}catch(C){j=!0,T=C}finally{try{!O&&M.return&&M.return()}finally{if(j)throw T}}return b}return function(g,v){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return y(g,v);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function y(g,v,b){g===null&&(g=Function.prototype);var O=Object.getOwnPropertyDescriptor(g,v);if(O===void 0){var j=Object.getPrototypeOf(g);return j===null?void 0:y(j,v,b)}else{if("value"in O)return O.value;var T=O.get;return T===void 0?void 0:T.call(b)}},l=function(){function y(g,v){for(var b=0;b<v.length;b++){var O=v[b];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(g,O.key,O)}}return function(g,v,b){return v&&y(g.prototype,v),b&&y(g,b),g}}(),u=a(0),c=w(u),h=a(7),p=w(h);function w(y){return y&&y.__esModule?y:{default:y}}function d(y,g){if(!(y instanceof g))throw new TypeError("Cannot call a class as a function")}function _(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 E(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 S=function(y){E(g,y),l(g,null,[{key:"value",value:function(){}}]);function g(v,b){d(this,g);var O=_(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,v));return O.selection=b,O.textNode=document.createTextNode(g.CONTENTS),O.domNode.appendChild(O.textNode),O._length=0,O}return l(g,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(b,O){if(this._length!==0)return o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"format",this).call(this,b,O);for(var j=this,T=0;j!=null&&j.statics.scope!==c.default.Scope.BLOCK_BLOT;)T+=j.offset(j.parent),j=j.parent;j!=null&&(this._length=g.CONTENTS.length,j.optimize(),j.formatAt(T,g.CONTENTS.length,b,O),this._length=0)}},{key:"index",value:function(b,O){return b===this.textNode?0:o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"index",this).call(this,b,O)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var b=this.textNode,O=this.selection.getNativeRange(),j=void 0,T=void 0,M=void 0;if(O!=null&&O.start.node===b&&O.end.node===b){var F=[b,O.start.offset,O.end.offset];j=F[0],T=F[1],M=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!==g.CONTENTS){var C=this.textNode.data.split(g.CONTENTS).join("");this.next instanceof p.default?(j=this.next.domNode,this.next.insertAt(0,C),this.textNode.data=g.CONTENTS):(this.textNode.data=C,this.parent.insertBefore(c.default.create(this.textNode),this),this.textNode=document.createTextNode(g.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),T!=null){var x=[T,M].map(function(A){return Math.max(0,Math.min(j.data.length,A-1))}),L=i(x,2);return T=L[0],M=L[1],{startNode:j,startOffset:T,endNode:j,endOffset:M}}}}},{key:"update",value:function(b,O){var j=this;if(b.some(function(M){return M.type==="characterData"&&M.target===j.textNode})){var T=this.restore();T&&(O.range=T)}}},{key:"value",value:function(){return""}}]),g}(c.default.Embed);S.blotName="cursor",S.className="ql-cursor",S.tagName="span",S.CONTENTS="\uFEFF",n.default=S},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(0),o=c(i),l=a(4),u=c(l);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 w(_,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 d=function(_){w(E,_);function E(){return h(this,E),p(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return E}(o.default.Container);d.allowedChildren=[u.default,l.BlockEmbed,d],n.default=d},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var i=function(){function S(y,g){for(var v=0;v<g.length;v++){var b=g[v];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,g,v){return g&&S(y.prototype,g),v&&S(y,v),y}}(),o=function S(y,g,v){y===null&&(y=Function.prototype);var b=Object.getOwnPropertyDescriptor(y,g);if(b===void 0){var O=Object.getPrototypeOf(y);return O===null?void 0:S(O,g,v)}else{if("value"in b)return b.value;var j=b.get;return j===void 0?void 0:j.call(v)}},l=a(0),u=c(l);function c(S){return S&&S.__esModule?S:{default:S}}function h(S,y){if(!(S instanceof y))throw new TypeError("Cannot call a class as a function")}function p(S,y){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:S}function w(S,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);S.prototype=Object.create(y&&y.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(S,y):S.__proto__=y)}var d=function(S){w(y,S);function y(){return h(this,y),p(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return i(y,[{key:"value",value:function(v){var b=o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"value",this).call(this,v);return b.startsWith("rgb(")?(b=b.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+b.split(",").map(function(O){return("00"+parseInt(O).toString(16)).slice(-2)}).join("")):b}}]),y}(u.default.Attributor.Style),_=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),E=new d("color","color",{scope:u.default.Scope.INLINE});n.ColorAttributor=d,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(S,y){for(var g=0;g<y.length;g++){var v=y[g];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(S,v.key,v)}}return function(S,y,g){return y&&E(S.prototype,y),g&&E(S,g),S}}(),o=function E(S,y,g){S===null&&(S=Function.prototype);var v=Object.getOwnPropertyDescriptor(S,y);if(v===void 0){var b=Object.getPrototypeOf(S);return b===null?void 0:E(b,y,g)}else{if("value"in v)return v.value;var O=v.get;return O===void 0?void 0:O.call(g)}},l=a(6),u=c(l);function c(E){return E&&E.__esModule?E:{default:E}}function h(E,S){if(!(E instanceof S))throw new TypeError("Cannot call a class as a function")}function p(E,S){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:E}function w(E,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);E.prototype=Object.create(S&&S.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(E,S):E.__proto__=S)}var d=function(E){w(S,E);function S(){return h(this,S),p(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return i(S,[{key:"format",value:function(g,v){if(g!==this.statics.blotName||!v)return o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"format",this).call(this,g,v);v=this.constructor.sanitize(v),this.domNode.setAttribute("href",v)}}],[{key:"create",value:function(g){var v=o(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this,g);return g=this.sanitize(g),v.setAttribute("href",g),v.setAttribute("rel","noopener noreferrer"),v.setAttribute("target","_blank"),v}},{key:"formats",value:function(g){return g.getAttribute("href")}},{key:"sanitize",value:function(g){return _(g,this.PROTOCOL_WHITELIST)?g:this.SANITIZED_URL}}]),S}(u.default);d.blotName="link",d.tagName="A",d.SANITIZED_URL="about:blank",d.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function _(E,S){var y=document.createElement("a");y.href=E;var g=y.href.slice(0,y.href.indexOf(":"));return S.indexOf(g)>-1}n.default=d,n.sanitize=_},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(S){return typeof S}:function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},o=function(){function S(y,g){for(var v=0;v<g.length;v++){var b=g[v];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,g,v){return g&&S(y.prototype,g),v&&S(y,v),y}}(),l=a(23),u=p(l),c=a(107),h=p(c);function p(S){return S&&S.__esModule?S:{default:S}}function w(S,y){if(!(S instanceof y))throw new TypeError("Cannot call a class as a function")}var d=0;function _(S,y){S.setAttribute(y,S.getAttribute(y)!=="true")}var E=function(){function S(y){var g=this;w(this,S),this.select=y,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(){g.togglePicker()}),this.label.addEventListener("keydown",function(v){switch(v.keyCode){case u.default.keys.ENTER:g.togglePicker();break;case u.default.keys.ESCAPE:g.escape(),v.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(S,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),_(this.label,"aria-expanded"),_(this.options,"aria-hidden")}},{key:"buildItem",value:function(g){var v=this,b=document.createElement("span");return b.tabIndex="0",b.setAttribute("role","button"),b.classList.add("ql-picker-item"),g.hasAttribute("value")&&b.setAttribute("data-value",g.getAttribute("value")),g.textContent&&b.setAttribute("data-label",g.textContent),b.addEventListener("click",function(){v.selectItem(b,!0)}),b.addEventListener("keydown",function(O){switch(O.keyCode){case u.default.keys.ENTER:v.selectItem(b,!0),O.preventDefault();break;case u.default.keys.ESCAPE:v.escape(),O.preventDefault();break}}),b}},{key:"buildLabel",value:function(){var g=document.createElement("span");return g.classList.add("ql-picker-label"),g.innerHTML=h.default,g.tabIndex="0",g.setAttribute("role","button"),g.setAttribute("aria-expanded","false"),this.container.appendChild(g),g}},{key:"buildOptions",value:function(){var g=this,v=document.createElement("span");v.classList.add("ql-picker-options"),v.setAttribute("aria-hidden","true"),v.tabIndex="-1",v.id="ql-picker-options-"+d,d+=1,this.label.setAttribute("aria-controls",v.id),this.options=v,[].slice.call(this.select.options).forEach(function(b){var O=g.buildItem(b);v.appendChild(O),b.selected===!0&&g.selectItem(O)}),this.container.appendChild(v)}},{key:"buildPicker",value:function(){var g=this;[].slice.call(this.select.attributes).forEach(function(v){g.container.setAttribute(v.name,v.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var g=this;this.close(),setTimeout(function(){return g.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(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,b=this.container.querySelector(".ql-selected");if(g!==b&&(b!=null&&b.classList.remove("ql-selected"),g!=null&&(g.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(g.parentNode.children,g),g.hasAttribute("data-value")?this.label.setAttribute("data-value",g.getAttribute("data-value")):this.label.removeAttribute("data-value"),g.hasAttribute("data-label")?this.label.setAttribute("data-label",g.getAttribute("data-label")):this.label.removeAttribute("data-label"),v))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":i(Event))==="object"){var O=document.createEvent("Event");O.initEvent("change",!0,!0),this.select.dispatchEvent(O)}this.close()}}},{key:"update",value:function(){var g=void 0;if(this.select.selectedIndex>-1){var v=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];g=this.select.options[this.select.selectedIndex],this.selectItem(v)}else this.selectItem(null);var b=g!=null&&g!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",b)}}]),S}();n.default=E},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(0),o=I(i),l=a(5),u=I(l),c=a(4),h=I(c),p=a(16),w=I(p),d=a(25),_=I(d),E=a(24),S=I(E),y=a(35),g=I(y),v=a(6),b=I(v),O=a(22),j=I(O),T=a(7),M=I(T),F=a(55),C=I(F),x=a(42),L=I(x),A=a(23),N=I(A);function I(W){return W&&W.__esModule?W:{default:W}}u.default.register({"blots/block":h.default,"blots/block/embed":c.BlockEmbed,"blots/break":w.default,"blots/container":_.default,"blots/cursor":S.default,"blots/embed":g.default,"blots/inline":b.default,"blots/scroll":j.default,"blots/text":M.default,"modules/clipboard":C.default,"modules/history":L.default,"modules/keyboard":N.default}),o.default.register(h.default,w.default,S.default,b.default,j.default,M.default),n.default=u.default},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(1),o=function(){function l(u){this.domNode=u,this.domNode[i.DATA_KEY]={blot:this}}return Object.defineProperty(l.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),l.create=function(u){if(this.tagName==null)throw new 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},l.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},l.prototype.clone=function(){var u=this.domNode.cloneNode(!1);return i.create(u)},l.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[i.DATA_KEY]},l.prototype.deleteAt=function(u,c){var h=this.isolate(u,c);h.remove()},l.prototype.formatAt=function(u,c,h,p){var w=this.isolate(u,c);if(i.query(h,i.Scope.BLOT)!=null&&p)w.wrap(h,p);else if(i.query(h,i.Scope.ATTRIBUTE)!=null){var d=i.create(this.statics.scope);w.wrap(d),d.format(h,p)}},l.prototype.insertAt=function(u,c,h){var p=h==null?i.create("text",c):i.create(c,h),w=this.split(u);this.parent.insertBefore(p,w)},l.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()},l.prototype.isolate=function(u,c){var h=this.split(u);return h.split(c),h},l.prototype.length=function(){return 1},l.prototype.offset=function(u){return u===void 0&&(u=this.parent),this.parent==null||this==u?0:this.parent.children.offset(this)+this.parent.offset(u)},l.prototype.optimize=function(u){this.domNode[i.DATA_KEY]!=null&&delete this.domNode[i.DATA_KEY].mutations},l.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},l.prototype.replace=function(u){u.parent!=null&&(u.parent.insertBefore(this,u.next),u.remove())},l.prototype.replaceWith=function(u,c){var h=typeof u=="string"?i.create(u,c):u;return h.replace(this),h},l.prototype.split=function(u,c){return u===0?this:this.next},l.prototype.update=function(u,c){},l.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},l.blotName="abstract",l}();n.default=o},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(12),o=a(32),l=a(33),u=a(1),c=function(){function h(p){this.attributes={},this.domNode=p,this.build()}return h.prototype.attribute=function(p,w){w?p.add(this.domNode,w)&&(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 w=i.default.keys(this.domNode),d=o.default.keys(this.domNode),_=l.default.keys(this.domNode);w.concat(d).concat(_).forEach(function(E){var S=u.query(E,u.Scope.ATTRIBUTE);S instanceof i.default&&(p.attributes[S.attrName]=S)})},h.prototype.copy=function(p){var w=this;Object.keys(this.attributes).forEach(function(d){var _=w.attributes[d].value(w.domNode);p.format(d,_)})},h.prototype.move=function(p){var w=this;this.copy(p),Object.keys(this.attributes).forEach(function(d){w.attributes[d].remove(w.domNode)}),this.attributes={}},h.prototype.values=function(){var p=this;return Object.keys(this.attributes).reduce(function(w,d){return w[d]=p.attributes[d].value(p.domNode),w},{})},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 w in p)p.hasOwnProperty(w)&&(h[w]=p[w])};return function(h,p){c(h,p);function w(){this.constructor=h}h.prototype=p===null?Object.create(p):(w.prototype=p.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(12);function l(c,h){var p=c.getAttribute("class")||"";return p.split(/\s+/).filter(function(w){return w.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(w){return w.split("-").slice(0,-1).join("-")})},h.prototype.add=function(p,w){return this.canAdd(p,w)?(this.remove(p),p.classList.add(this.keyName+"-"+w),!0):!1},h.prototype.remove=function(p){var w=l(p,this.keyName);w.forEach(function(d){p.classList.remove(d)}),p.classList.length===0&&p.removeAttribute("class")},h.prototype.value=function(p){var w=l(p,this.keyName)[0]||"",d=w.slice(this.keyName.length+1);return this.canAdd(p,d)?d:""},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 w in p)p.hasOwnProperty(w)&&(h[w]=p[w])};return function(h,p){c(h,p);function w(){this.constructor=h}h.prototype=p===null?Object.create(p):(w.prototype=p.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(12);function l(c){var h=c.split("-"),p=h.slice(1).map(function(w){return w[0].toUpperCase()+w.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(w){var d=w.split(":");return d[0].trim()})},h.prototype.add=function(p,w){return this.canAdd(p,w)?(p.style[l(this.keyName)]=w,!0):!1},h.prototype.remove=function(p){p.style[l(this.keyName)]="",p.getAttribute("style")||p.removeAttribute("style")},h.prototype.value=function(p){var w=p.style[l(this.keyName)];return this.canAdd(p,w)?w:""},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 w=h[p];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(c,w.key,w)}}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 l=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}();l.DEFAULTS={modules:{}},l.themes={default:l},n.default=l},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function y(g,v){for(var b=0;b<v.length;b++){var O=v[b];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(g,O.key,O)}}return function(g,v,b){return v&&y(g.prototype,v),b&&y(g,b),g}}(),o=function y(g,v,b){g===null&&(g=Function.prototype);var O=Object.getOwnPropertyDescriptor(g,v);if(O===void 0){var j=Object.getPrototypeOf(g);return j===null?void 0:y(j,v,b)}else{if("value"in O)return O.value;var T=O.get;return T===void 0?void 0:T.call(b)}},l=a(0),u=p(l),c=a(7),h=p(c);function p(y){return y&&y.__esModule?y:{default:y}}function w(y,g){if(!(y instanceof g))throw new TypeError("Cannot call a class as a function")}function d(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="\uFEFF",S=function(y){_(g,y);function g(v){w(this,g);var b=d(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,v));return b.contentNode=document.createElement("span"),b.contentNode.setAttribute("contenteditable",!1),[].slice.call(b.domNode.childNodes).forEach(function(O){b.contentNode.appendChild(O)}),b.leftGuard=document.createTextNode(E),b.rightGuard=document.createTextNode(E),b.domNode.appendChild(b.leftGuard),b.domNode.appendChild(b.contentNode),b.domNode.appendChild(b.rightGuard),b}return i(g,[{key:"index",value:function(b,O){return b===this.leftGuard?0:b===this.rightGuard?1:o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"index",this).call(this,b,O)}},{key:"restore",value:function(b){var O=void 0,j=void 0,T=b.data.split(E).join("");if(b===this.leftGuard)if(this.prev instanceof h.default){var M=this.prev.length();this.prev.insertAt(M,T),O={startNode:this.prev.domNode,startOffset:M+T.length}}else j=document.createTextNode(T),this.parent.insertBefore(u.default.create(j),this),O={startNode:j,startOffset:T.length};else b===this.rightGuard&&(this.next instanceof h.default?(this.next.insertAt(0,T),O={startNode:this.next.domNode,startOffset:T.length}):(j=document.createTextNode(T),this.parent.insertBefore(u.default.create(j),this.next),O={startNode:j,startOffset:T.length}));return b.data=E,O}},{key:"update",value:function(b,O){var j=this;b.forEach(function(T){if(T.type==="characterData"&&(T.target===j.leftGuard||T.target===j.rightGuard)){var M=j.restore(T.target);M&&(O.range=M)}})}}]),g}(u.default.Embed);n.default=S},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var i=a(0),o=l(i);function l(w){return w&&w.__esModule?w:{default:w}}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),l=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 l.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=l(i);function l(w){return w&&w.__esModule?w:{default:w}}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 y(g,v){for(var b=0;b<v.length;b++){var O=v[b];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(g,O.key,O)}}return function(g,v,b){return v&&y(g.prototype,v),b&&y(g,b),g}}(),o=function y(g,v,b){g===null&&(g=Function.prototype);var O=Object.getOwnPropertyDescriptor(g,v);if(O===void 0){var j=Object.getPrototypeOf(g);return j===null?void 0:y(j,v,b)}else{if("value"in O)return O.value;var T=O.get;return T===void 0?void 0:T.call(b)}},l=a(0),u=c(l);function c(y){return y&&y.__esModule?y:{default:y}}function h(y,g){if(!(y instanceof g))throw new TypeError("Cannot call a class as a function")}function p(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 w(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 d={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},_=new u.default.Attributor.Class("font","ql-font",d),E=function(y){w(g,y);function g(){return h(this,g),p(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return i(g,[{key:"value",value:function(b){return o(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"value",this).call(this,b).replace(/["']/g,"")}}]),g}(u.default.Attributor.Style),S=new E("font","font-family",d);n.FontStyle=S,n.FontClass=_},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var i=a(0),o=l(i);function l(h){return h&&h.__esModule?h:{default:h}}var u=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),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 v(b,O){for(var j=0;j<O.length;j++){var T=O[j];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(b,T.key,T)}}return function(b,O,j){return O&&v(b.prototype,O),j&&v(b,j),b}}(),o=a(0),l=w(o),u=a(5),c=w(u),h=a(9),p=w(h);function w(v){return v&&v.__esModule?v:{default:v}}function d(v,b){if(!(v instanceof b))throw new TypeError("Cannot call a class as a function")}function _(v,b){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:v}function E(v,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);v.prototype=Object.create(b&&b.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(v,b):v.__proto__=b)}var S=function(v){E(b,v);function b(O,j){d(this,b);var T=_(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,O,j));return T.lastRecorded=0,T.ignoreChange=!1,T.clear(),T.quill.on(c.default.events.EDITOR_CHANGE,function(M,F,C,x){M!==c.default.events.TEXT_CHANGE||T.ignoreChange||(!T.options.userOnly||x===c.default.sources.USER?T.record(F,C):T.transform(F))}),T.quill.keyboard.addBinding({key:"Z",shortKey:!0},T.undo.bind(T)),T.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},T.redo.bind(T)),/Win/i.test(navigator.platform)&&T.quill.keyboard.addBinding({key:"Y",shortKey:!0},T.redo.bind(T)),T}return i(b,[{key:"change",value:function(j,T){if(this.stack[j].length!==0){var M=this.stack[j].pop();this.stack[T].push(M),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(M[j],c.default.sources.USER),this.ignoreChange=!1;var F=g(M[j]);this.quill.setSelection(F)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(j,T){if(j.ops.length!==0){this.stack.redo=[];var M=this.quill.getContents().diff(T),F=Date.now();if(this.lastRecorded+this.options.delay>F&&this.stack.undo.length>0){var C=this.stack.undo.pop();M=M.compose(C.undo),j=C.redo.compose(j)}else this.lastRecorded=F;this.stack.undo.push({redo:j,undo:M}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(j){this.stack.undo.forEach(function(T){T.undo=j.transform(T.undo,!0),T.redo=j.transform(T.redo,!0)}),this.stack.redo.forEach(function(T){T.undo=j.transform(T.undo,!0),T.redo=j.transform(T.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),b}(p.default);S.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function y(v){var b=v.ops[v.ops.length-1];return b==null?!1:b.insert!=null?typeof b.insert=="string"&&b.insert.endsWith(`
|
|
139
|
-
`):b.attributes!=null?Object.keys(b.attributes).some(function(O){return l.default.query(O,l.default.Scope.BLOCK)!=null}):!1}function g(v){var b=v.reduce(function(j,T){return j+=T.delete||0,j},0),O=v.length()-b;return y(v)&&(O-=1),O}n.default=S,n.getLastChangeIndex=g},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var i=function(){function z(D,K){for(var ne=0;ne<K.length;ne++){var Z=K[ne];Z.enumerable=Z.enumerable||!1,Z.configurable=!0,"value"in Z&&(Z.writable=!0),Object.defineProperty(D,Z.key,Z)}}return function(D,K,ne){return K&&z(D.prototype,K),ne&&z(D,ne),D}}(),o=function z(D,K,ne){D===null&&(D=Function.prototype);var Z=Object.getOwnPropertyDescriptor(D,K);if(Z===void 0){var ee=Object.getPrototypeOf(D);return ee===null?void 0:z(ee,K,ne)}else{if("value"in Z)return Z.value;var ae=Z.get;return ae===void 0?void 0:ae.call(ne)}},l=a(3),u=F(l),c=a(2),h=F(c),p=a(8),w=F(p),d=a(23),_=F(d),E=a(34),S=F(E),y=a(59),g=F(y),v=a(60),b=F(v),O=a(28),j=F(O),T=a(61),M=F(T);function F(z){return z&&z.__esModule?z:{default:z}}function C(z,D){if(!(z instanceof D))throw new TypeError("Cannot call a class as a function")}function x(z,D){if(!z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D&&(typeof D=="object"||typeof D=="function")?D:z}function L(z,D){if(typeof D!="function"&&D!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof D);z.prototype=Object.create(D&&D.prototype,{constructor:{value:z,enumerable:!1,writable:!0,configurable:!0}}),D&&(Object.setPrototypeOf?Object.setPrototypeOf(z,D):z.__proto__=D)}var A=[!1,"center","right","justify"],N=["#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"],I=[!1,"serif","monospace"],W=["1","2","3",!1],G=["small",!1,"large","huge"],$=function(z){L(D,z);function D(K,ne){C(this,D);var Z=x(this,(D.__proto__||Object.getPrototypeOf(D)).call(this,K,ne)),ee=function ae(se){if(!document.body.contains(K.root))return document.body.removeEventListener("click",ae);Z.tooltip!=null&&!Z.tooltip.root.contains(se.target)&&document.activeElement!==Z.tooltip.textbox&&!Z.quill.hasFocus()&&Z.tooltip.hide(),Z.pickers!=null&&Z.pickers.forEach(function(ce){ce.container.contains(se.target)||ce.close()})};return K.emitter.listenDOM("click",document.body,ee),Z}return i(D,[{key:"addModule",value:function(ne){var Z=o(D.prototype.__proto__||Object.getPrototypeOf(D.prototype),"addModule",this).call(this,ne);return ne==="toolbar"&&this.extendToolbar(Z),Z}},{key:"buildButtons",value:function(ne,Z){ne.forEach(function(ee){var ae=ee.getAttribute("class")||"";ae.split(/\s+/).forEach(function(se){if(se.startsWith("ql-")&&(se=se.slice(3),Z[se]!=null))if(se==="direction")ee.innerHTML=Z[se][""]+Z[se].rtl;else if(typeof Z[se]=="string")ee.innerHTML=Z[se];else{var ce=ee.value||"";ce!=null&&Z[se][ce]&&(ee.innerHTML=Z[se][ce])}})})}},{key:"buildPickers",value:function(ne,Z){var ee=this;this.pickers=ne.map(function(se){if(se.classList.contains("ql-align"))return se.querySelector("option")==null&&H(se,A),new b.default(se,Z.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,N,ce==="background"?"#ffffff":"#000000"),new g.default(se,Z[ce])}else return se.querySelector("option")==null&&(se.classList.contains("ql-font")?H(se,I):se.classList.contains("ql-header")?H(se,W):se.classList.contains("ql-size")&&H(se,G)),new j.default(se)});var ae=function(){ee.pickers.forEach(function(ce){ce.update()})};this.quill.on(w.default.events.EDITOR_CHANGE,ae)}}]),D}(S.default);$.DEFAULTS=(0,u.default)(!0,{},S.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var D=this,K=this.container.querySelector("input.ql-image[type=file]");K==null&&(K=document.createElement("input"),K.setAttribute("type","file"),K.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),K.classList.add("ql-image"),K.addEventListener("change",function(){if(K.files!=null&&K.files[0]!=null){var ne=new FileReader;ne.onload=function(Z){var ee=D.quill.getSelection(!0);D.quill.updateContents(new h.default().retain(ee.index).delete(ee.length).insert({image:Z.target.result}),w.default.sources.USER),D.quill.setSelection(ee.index+1,w.default.sources.SILENT),K.value=""},ne.readAsDataURL(K.files[0])}}),this.container.appendChild(K)),K.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var J=function(z){L(D,z);function D(K,ne){C(this,D);var Z=x(this,(D.__proto__||Object.getPrototypeOf(D)).call(this,K,ne));return Z.textbox=Z.root.querySelector('input[type="text"]'),Z.listen(),Z}return i(D,[{key:"listen",value:function(){var ne=this;this.textbox.addEventListener("keydown",function(Z){_.default.match(Z,"enter")?(ne.save(),Z.preventDefault()):_.default.match(Z,"escape")&&(ne.cancel(),Z.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),Z!=null?this.textbox.value=Z:ne!==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-"+ne)||""),this.root.setAttribute("data-mode",ne)}},{key:"restoreFocus",value:function(){var ne=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=ne}},{key:"save",value:function(){var ne=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var Z=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",ne,w.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",ne,w.default.sources.USER)),this.quill.root.scrollTop=Z;break}case"video":ne=V(ne);case"formula":{if(!ne)break;var ee=this.quill.getSelection(!0);if(ee!=null){var ae=ee.index+ee.length;this.quill.insertEmbed(ae,this.root.getAttribute("data-mode"),ne,w.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(ae+1," ",w.default.sources.USER),this.quill.setSelection(ae+2,w.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),D}(M.default);function V(z){var D=z.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||z.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return D?(D[1]||"https")+"://www.youtube.com/embed/"+D[2]+"?showinfo=0":(D=z.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(D[1]||"https")+"://player.vimeo.com/video/"+D[2]+"/":z}function H(z,D){var K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;D.forEach(function(ne){var Z=document.createElement("option");ne===K?Z.setAttribute("selected","selected"):Z.setAttribute("value",ne),z.appendChild(Z)})}n.BaseTooltip=J,n.default=$},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 l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];this.insertBefore(l[0],null),l.length>1&&this.append.apply(this,l.slice(1))},o.prototype.contains=function(l){for(var u,c=this.iterator();u=c();)if(u===l)return!0;return!1},o.prototype.insertBefore=function(l,u){l&&(l.next=u,u!=null?(l.prev=u.prev,u.prev!=null&&(u.prev.next=l),u.prev=l,u===this.head&&(this.head=l)):this.tail!=null?(this.tail.next=l,l.prev=this.tail,this.tail=l):(l.prev=null,this.head=this.tail=l),this.length+=1)},o.prototype.offset=function(l){for(var u=0,c=this.head;c!=null;){if(c===l)return u;u+=c.length(),c=c.next}return-1},o.prototype.remove=function(l){this.contains(l)&&(l.prev!=null&&(l.prev.next=l.next),l.next!=null&&(l.next.prev=l.prev),l===this.head&&(this.head=l.next),l===this.tail&&(this.tail=l.prev),this.length-=1)},o.prototype.iterator=function(l){return l===void 0&&(l=this.head),function(){var u=l;return l!=null&&(l=l.next),u}},o.prototype.find=function(l,u){u===void 0&&(u=!1);for(var c,h=this.iterator();c=h();){var p=c.length();if(l<p||u&&l===p&&(c.next==null||c.next.length()!==0))return[c,l];l-=p}return[null,0]},o.prototype.forEach=function(l){for(var u,c=this.iterator();u=c();)l(u)},o.prototype.forEachAt=function(l,u,c){if(!(u<=0))for(var h=this.find(l),p=h[0],w=h[1],d,_=l-w,E=this.iterator(p);(d=E())&&_<l+u;){var S=d.length();l>_?c(d,l-_,Math.min(u,_+S-l)):c(d,0,Math.min(S,l+u-_)),_+=S}},o.prototype.map=function(l){return this.reduce(function(u,c){return u.push(l(c)),u},[])},o.prototype.reduce=function(l,u){for(var c,h=this.iterator();c=h();)u=l(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(w,d){w.__proto__=d}||function(w,d){for(var _ in d)d.hasOwnProperty(_)&&(w[_]=d[_])};return function(w,d){p(w,d);function _(){this.constructor=w}w.prototype=d===null?Object.create(d):(_.prototype=d.prototype,new _)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(17),l=a(1),u={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},c=100,h=function(p){i(w,p);function w(d){var _=p.call(this,d)||this;return _.scroll=_,_.observer=new MutationObserver(function(E){_.update(E)}),_.observer.observe(_.domNode,u),_.attach(),_}return w.prototype.detach=function(){p.prototype.detach.call(this),this.observer.disconnect()},w.prototype.deleteAt=function(d,_){this.update(),d===0&&_===this.length()?this.children.forEach(function(E){E.remove()}):p.prototype.deleteAt.call(this,d,_)},w.prototype.formatAt=function(d,_,E,S){this.update(),p.prototype.formatAt.call(this,d,_,E,S)},w.prototype.insertAt=function(d,_,E){this.update(),p.prototype.insertAt.call(this,d,_,E)},w.prototype.optimize=function(d,_){var E=this;d===void 0&&(d=[]),_===void 0&&(_={}),p.prototype.optimize.call(this,_);for(var S=[].slice.call(this.observer.takeRecords());S.length>0;)d.push(S.pop());for(var y=function(O,j){j===void 0&&(j=!0),!(O==null||O===E)&&O.domNode.parentNode!=null&&(O.domNode[l.DATA_KEY].mutations==null&&(O.domNode[l.DATA_KEY].mutations=[]),j&&y(O.parent))},g=function(O){O.domNode[l.DATA_KEY]==null||O.domNode[l.DATA_KEY].mutations==null||(O instanceof o.default&&O.children.forEach(g),O.optimize(_))},v=d,b=0;v.length>0;b+=1){if(b>=c)throw new Error("[Parchment] Maximum optimize iterations reached");for(v.forEach(function(O){var j=l.find(O.target,!0);j!=null&&(j.domNode===O.target&&(O.type==="childList"?(y(l.find(O.previousSibling,!1)),[].forEach.call(O.addedNodes,function(T){var M=l.find(T,!1);y(M,!1),M instanceof o.default&&M.children.forEach(function(F){y(F,!1)})})):O.type==="attributes"&&y(j.prev)),y(j))}),this.children.forEach(g),v=[].slice.call(this.observer.takeRecords()),S=v.slice();S.length>0;)d.push(S.pop())}},w.prototype.update=function(d,_){var E=this;_===void 0&&(_={}),d=d||this.observer.takeRecords(),d.map(function(S){var y=l.find(S.target,!0);return y==null?null:y.domNode[l.DATA_KEY].mutations==null?(y.domNode[l.DATA_KEY].mutations=[S],y):(y.domNode[l.DATA_KEY].mutations.push(S),null)}).forEach(function(S){S==null||S===E||S.domNode[l.DATA_KEY]==null||S.update(S.domNode[l.DATA_KEY].mutations||[],_)}),this.domNode[l.DATA_KEY].mutations!=null&&p.prototype.update.call(this,this.domNode[l.DATA_KEY].mutations,_),this.optimize(d,_)},w.blotName="scroll",w.defaultChild="block",w.scope=l.Scope.BLOCK_BLOT,w.tagName="DIV",w}(o.default);n.default=h},function(t,n,a){var i=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,w){p.__proto__=w}||function(p,w){for(var d in w)w.hasOwnProperty(d)&&(p[d]=w[d])};return function(p,w){h(p,w);function d(){this.constructor=p}p.prototype=w===null?Object.create(w):(d.prototype=w.prototype,new d)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(18),l=a(1);function u(h,p){if(Object.keys(h).length!==Object.keys(p).length)return!1;for(var w in h)if(h[w]!==p[w])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(w){if(w.tagName!==p.tagName)return h.formats.call(this,w)},p.prototype.format=function(w,d){var _=this;w===this.statics.blotName&&!d?(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,w,d)},p.prototype.formatAt=function(w,d,_,E){if(this.formats()[_]!=null||l.query(_,l.Scope.ATTRIBUTE)){var S=this.isolate(w,d);S.format(_,E)}else h.prototype.formatAt.call(this,w,d,_,E)},p.prototype.optimize=function(w){h.prototype.optimize.call(this,w);var d=this.formats();if(Object.keys(d).length===0)return this.unwrap();var _=this.next;_ instanceof p&&_.prev===this&&u(d,_.formats())&&(_.moveChildren(this),_.remove())},p.blotName="inline",p.scope=l.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 w in p)p.hasOwnProperty(w)&&(h[w]=p[w])};return function(h,p){c(h,p);function w(){this.constructor=h}h.prototype=p===null?Object.create(p):(w.prototype=p.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(18),l=a(1),u=function(c){i(h,c);function h(){return c!==null&&c.apply(this,arguments)||this}return h.formats=function(p){var w=l.query(h.blotName).tagName;if(p.tagName!==w)return c.formats.call(this,p)},h.prototype.format=function(p,w){l.query(p,l.Scope.BLOCK)!=null&&(p===this.statics.blotName&&!w?this.replaceWith(h.blotName):c.prototype.format.call(this,p,w))},h.prototype.formatAt=function(p,w,d,_){l.query(d,l.Scope.BLOCK)!=null?this.format(d,_):c.prototype.formatAt.call(this,p,w,d,_)},h.prototype.insertAt=function(p,w,d){if(d==null||l.query(w,l.Scope.INLINE)!=null)c.prototype.insertAt.call(this,p,w,d);else{var _=this.split(p),E=l.create(w,d);_.parent.insertBefore(E,_)}},h.prototype.update=function(p,w){navigator.userAgent.match(/Trident/)?this.build():c.prototype.update.call(this,p,w)},h.blotName="block",h.scope=l.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),l=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,w,d){h===0&&p===this.length()?this.format(w,d):u.prototype.formatAt.call(this,h,p,w,d)},c.prototype.formats=function(){return this.statics.formats(this.domNode)},c}(o.default);n.default=l},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 w in p)p.hasOwnProperty(w)&&(h[w]=p[w])};return function(h,p){c(h,p);function w(){this.constructor=h}h.prototype=p===null?Object.create(p):(w.prototype=p.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=a(19),l=a(1),u=function(c){i(h,c);function h(p){var w=c.call(this,p)||this;return w.text=w.statics.value(w.domNode),w}return h.create=function(p){return document.createTextNode(p)},h.value=function(p){var w=p.data;return w.normalize&&(w=w.normalize()),w},h.prototype.deleteAt=function(p,w){this.domNode.data=this.text=this.text.slice(0,p)+this.text.slice(p+w)},h.prototype.index=function(p,w){return this.domNode===p?w:-1},h.prototype.insertAt=function(p,w,d){d==null?(this.text=this.text.slice(0,p)+w+this.text.slice(p),this.domNode.data=this.text):c.prototype.insertAt.call(this,p,w,d)},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,w){return[this.domNode,p]},h.prototype.split=function(p,w){if(w===void 0&&(w=!1),!w){if(p===0)return this;if(p===this.length())return this.next}var d=l.create(this.domNode.splitText(p));return this.parent.insertBefore(d,this.next),this.text=this.statics.value(this.domNode),d},h.prototype.update=function(p,w){var d=this;p.some(function(_){return _.type==="characterData"&&_.target===d.domNode})&&(this.text=this.statics.value(this.domNode))},h.prototype.value=function(){return this.text},h.blotName="text",h.scope=l.Scope.INLINE_BLOT,h}(o.default);n.default=u},function(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(l,u){return arguments.length>1&&!this.contains(l)==!u?u:o.call(this,l)}}String.prototype.startsWith||(String.prototype.startsWith=function(l,u){return u=u||0,this.substr(u,l.length)===l}),String.prototype.endsWith||(String.prototype.endsWith=function(l,u){var c=this.toString();(typeof u!="number"||!isFinite(u)||Math.floor(u)!==u||u>c.length)&&(u=c.length),u-=l.length;var h=c.indexOf(l,u);return h!==-1&&h===u}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(u){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof u!="function")throw new TypeError("predicate must be a function");for(var c=Object(this),h=c.length>>>0,p=arguments[1],w,d=0;d<h;d++)if(w=c[d],u.call(p,w,d,c))return w}}),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 l(b,O,j){if(b==O)return b?[[o,b]]:[];(j<0||b.length<j)&&(j=null);var T=p(b,O),M=b.substring(0,T);b=b.substring(T),O=O.substring(T),T=w(b,O);var F=b.substring(b.length-T);b=b.substring(0,b.length-T),O=O.substring(0,O.length-T);var C=u(b,O);return M&&C.unshift([o,M]),F&&C.push([o,F]),_(C),j!=null&&(C=y(C,j)),C=g(C),C}function u(b,O){var j;if(!b)return[[i,O]];if(!O)return[[a,b]];var T=b.length>O.length?b:O,M=b.length>O.length?O:b,F=T.indexOf(M);if(F!=-1)return j=[[i,T.substring(0,F)],[o,M],[i,T.substring(F+M.length)]],b.length>O.length&&(j[0][0]=j[2][0]=a),j;if(M.length==1)return[[a,b],[i,O]];var C=d(b,O);if(C){var x=C[0],L=C[1],A=C[2],N=C[3],I=C[4],W=l(x,A),G=l(L,N);return W.concat([[o,I]],G)}return c(b,O)}function c(b,O){for(var j=b.length,T=O.length,M=Math.ceil((j+T)/2),F=M,C=2*M,x=new Array(C),L=new Array(C),A=0;A<C;A++)x[A]=-1,L[A]=-1;x[F+1]=0,L[F+1]=0;for(var N=j-T,I=N%2!=0,W=0,G=0,$=0,J=0,V=0;V<M;V++){for(var H=-V+W;H<=V-G;H+=2){var z=F+H,D;H==-V||H!=V&&x[z-1]<x[z+1]?D=x[z+1]:D=x[z-1]+1;for(var K=D-H;D<j&&K<T&&b.charAt(D)==O.charAt(K);)D++,K++;if(x[z]=D,D>j)G+=2;else if(K>T)W+=2;else if(I){var ne=F+N-H;if(ne>=0&&ne<C&&L[ne]!=-1){var Z=j-L[ne];if(D>=Z)return h(b,O,D,K)}}}for(var ee=-V+$;ee<=V-J;ee+=2){var ne=F+ee,Z;ee==-V||ee!=V&&L[ne-1]<L[ne+1]?Z=L[ne+1]:Z=L[ne-1]+1;for(var ae=Z-ee;Z<j&&ae<T&&b.charAt(j-Z-1)==O.charAt(T-ae-1);)Z++,ae++;if(L[ne]=Z,Z>j)J+=2;else if(ae>T)$+=2;else if(!I){var z=F+N-ee;if(z>=0&&z<C&&x[z]!=-1){var D=x[z],K=F+D-z;if(Z=j-Z,D>=Z)return h(b,O,D,K)}}}}return[[a,b],[i,O]]}function h(b,O,j,T){var M=b.substring(0,j),F=O.substring(0,T),C=b.substring(j),x=O.substring(T),L=l(M,F),A=l(C,x);return L.concat(A)}function p(b,O){if(!b||!O||b.charAt(0)!=O.charAt(0))return 0;for(var j=0,T=Math.min(b.length,O.length),M=T,F=0;j<M;)b.substring(F,M)==O.substring(F,M)?(j=M,F=j):T=M,M=Math.floor((T-j)/2+j);return M}function w(b,O){if(!b||!O||b.charAt(b.length-1)!=O.charAt(O.length-1))return 0;for(var j=0,T=Math.min(b.length,O.length),M=T,F=0;j<M;)b.substring(b.length-M,b.length-F)==O.substring(O.length-M,O.length-F)?(j=M,F=j):T=M,M=Math.floor((T-j)/2+j);return M}function d(b,O){var j=b.length>O.length?b:O,T=b.length>O.length?O:b;if(j.length<4||T.length*2<j.length)return null;function M(G,$,J){for(var V=G.substring(J,J+Math.floor(G.length/4)),H=-1,z="",D,K,ne,Z;(H=$.indexOf(V,H+1))!=-1;){var ee=p(G.substring(J),$.substring(H)),ae=w(G.substring(0,J),$.substring(0,H));z.length<ae+ee&&(z=$.substring(H-ae,H)+$.substring(H,H+ee),D=G.substring(0,J-ae),K=G.substring(J+ee),ne=$.substring(0,H-ae),Z=$.substring(H+ee))}return z.length*2>=G.length?[D,K,ne,Z,z]:null}var F=M(j,T,Math.ceil(j.length/4)),C=M(j,T,Math.ceil(j.length/2)),x;if(!F&&!C)return null;C?F?x=F[4].length>C[4].length?F:C:x=C:x=F;var L,A,N,I;b.length>O.length?(L=x[0],A=x[1],N=x[2],I=x[3]):(N=x[0],I=x[1],L=x[2],A=x[3]);var W=x[4];return[L,A,N,I,W]}function _(b){b.push([o,""]);for(var O=0,j=0,T=0,M="",F="",C;O<b.length;)switch(b[O][0]){case i:T++,F+=b[O][1],O++;break;case a:j++,M+=b[O][1],O++;break;case o:j+T>1?(j!==0&&T!==0&&(C=p(F,M),C!==0&&(O-j-T>0&&b[O-j-T-1][0]==o?b[O-j-T-1][1]+=F.substring(0,C):(b.splice(0,0,[o,F.substring(0,C)]),O++),F=F.substring(C),M=M.substring(C)),C=w(F,M),C!==0&&(b[O][1]=F.substring(F.length-C)+b[O][1],F=F.substring(0,F.length-C),M=M.substring(0,M.length-C))),j===0?b.splice(O-T,j+T,[i,F]):T===0?b.splice(O-j,j+T,[a,M]):b.splice(O-j-T,j+T,[a,M],[i,F]),O=O-j-T+(j?1:0)+(T?1:0)+1):O!==0&&b[O-1][0]==o?(b[O-1][1]+=b[O][1],b.splice(O,1)):O++,T=0,j=0,M="",F="";break}b[b.length-1][1]===""&&b.pop();var x=!1;for(O=1;O<b.length-1;)b[O-1][0]==o&&b[O+1][0]==o&&(b[O][1].substring(b[O][1].length-b[O-1][1].length)==b[O-1][1]?(b[O][1]=b[O-1][1]+b[O][1].substring(0,b[O][1].length-b[O-1][1].length),b[O+1][1]=b[O-1][1]+b[O+1][1],b.splice(O-1,1),x=!0):b[O][1].substring(0,b[O+1][1].length)==b[O+1][1]&&(b[O-1][1]+=b[O+1][1],b[O][1]=b[O][1].substring(b[O+1][1].length)+b[O+1][1],b.splice(O+1,1),x=!0)),O++;x&&_(b)}var E=l;E.INSERT=i,E.DELETE=a,E.EQUAL=o,t.exports=E;function S(b,O){if(O===0)return[o,b];for(var j=0,T=0;T<b.length;T++){var M=b[T];if(M[0]===a||M[0]===o){var F=j+M[1].length;if(O===F)return[T+1,b];if(O<F){b=b.slice();var C=O-j,x=[M[0],M[1].slice(0,C)],L=[M[0],M[1].slice(C)];return b.splice(T,1,x,L),[T+1,b]}else j=F}}throw new Error("cursor_pos is out of bounds!")}function y(b,O){var j=S(b,O),T=j[1],M=j[0],F=T[M],C=T[M+1];if(F==null)return b;if(F[0]!==o)return b;if(C!=null&&F[1]+C[1]===C[1]+F[1])return T.splice(M,2,C,F),v(T,M,2);if(C!=null&&C[1].indexOf(F[1])===0){T.splice(M,2,[C[0],F[1]],[0,F[1]]);var x=C[1].slice(F[1].length);return x.length>0&&T.splice(M+2,0,[C[0],x]),v(T,M,3)}else return b}function g(b){for(var O=!1,j=function(C){return C.charCodeAt(0)>=56320&&C.charCodeAt(0)<=57343},T=function(C){return C.charCodeAt(C.length-1)>=55296&&C.charCodeAt(C.length-1)<=56319},M=2;M<b.length;M+=1)b[M-2][0]===o&&T(b[M-2][1])&&b[M-1][0]===a&&j(b[M-1][1])&&b[M][0]===i&&j(b[M][1])&&(O=!0,b[M-1][1]=b[M-2][1].slice(-1)+b[M-1][1],b[M][1]=b[M-2][1].slice(-1)+b[M][1],b[M-2][1]=b[M-2][1].slice(0,-1));if(!O)return b;for(var F=[],M=0;M<b.length;M+=1)b[M][1].length>0&&F.push(b[M]);return F}function v(b,O,j){for(var T=O+j-1;T>=0&&T>=O-1;T--)if(T+1<b.length){var M=b[T],F=b[T+1];M[0]===F[1]&&b.splice(T,2,[M[0],M[1]+F[1]])}return b}},function(t,n){n=t.exports=typeof Object.keys=="function"?Object.keys:a,n.shim=a;function a(i){var o=[];for(var l in i)o.push(l);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(l){return Object.prototype.toString.call(l)=="[object Arguments]"}n.unsupported=o;function o(l){return l&&typeof l=="object"&&typeof l.length=="number"&&Object.prototype.hasOwnProperty.call(l,"callee")&&!Object.prototype.propertyIsEnumerable.call(l,"callee")||!1}},function(t,n){var a=Object.prototype.hasOwnProperty,i="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(i=!1));function l(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,w;if(this._eventsCount===0)return h;for(w in p=this._events)a.call(p,w)&&h.push(i?w.slice(1):w);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(p)):h},u.prototype.listeners=function(h,p){var w=i?i+h:h,d=this._events[w];if(p)return!!d;if(!d)return[];if(d.fn)return[d.fn];for(var _=0,E=d.length,S=new Array(E);_<E;_++)S[_]=d[_].fn;return S},u.prototype.emit=function(h,p,w,d,_,E){var S=i?i+h:h;if(!this._events[S])return!1;var y=this._events[S],g=arguments.length,v,b;if(y.fn){switch(y.once&&this.removeListener(h,y.fn,void 0,!0),g){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,p),!0;case 3:return y.fn.call(y.context,p,w),!0;case 4:return y.fn.call(y.context,p,w,d),!0;case 5:return y.fn.call(y.context,p,w,d,_),!0;case 6:return y.fn.call(y.context,p,w,d,_,E),!0}for(b=1,v=new Array(g-1);b<g;b++)v[b-1]=arguments[b];y.fn.apply(y.context,v)}else{var O=y.length,j;for(b=0;b<O;b++)switch(y[b].once&&this.removeListener(h,y[b].fn,void 0,!0),g){case 1:y[b].fn.call(y[b].context);break;case 2:y[b].fn.call(y[b].context,p);break;case 3:y[b].fn.call(y[b].context,p,w);break;case 4:y[b].fn.call(y[b].context,p,w,d);break;default:if(!v)for(j=1,v=new Array(g-1);j<g;j++)v[j-1]=arguments[j];y[b].fn.apply(y[b].context,v)}}return!0},u.prototype.on=function(h,p,w){var d=new l(p,w||this),_=i?i+h:h;return this._events[_]?this._events[_].fn?this._events[_]=[this._events[_],d]:this._events[_].push(d):(this._events[_]=d,this._eventsCount++),this},u.prototype.once=function(h,p,w){var d=new l(p,w||this,!0),_=i?i+h:h;return this._events[_]?this._events[_].fn?this._events[_]=[this._events[_],d]:this._events[_].push(d):(this._events[_]=d,this._eventsCount++),this},u.prototype.removeListener=function(h,p,w,d){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&&(!d||E.once)&&(!w||E.context===w)&&(--this._eventsCount===0?this._events=new o:delete this._events[_]);else{for(var S=0,y=[],g=E.length;S<g;S++)(E[S].fn!==p||d&&!E[S].once||w&&E[S].context!==w)&&y.push(E[S]);y.length?this._events[_]=y.length===1?y[0]:y:--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(we){return typeof we}:function(we){return we&&typeof Symbol=="function"&&we.constructor===Symbol&&we!==Symbol.prototype?"symbol":typeof we},o=function(){function we(Ae,Ee){var Ne=[],he=!0,Le=!1,Ce=void 0;try{for(var De=Ae[Symbol.iterator](),tt;!(he=(tt=De.next()).done)&&(Ne.push(tt.value),!(Ee&&Ne.length===Ee));he=!0);}catch(vt){Le=!0,Ce=vt}finally{try{!he&&De.return&&De.return()}finally{if(Le)throw Ce}}return Ne}return function(Ae,Ee){if(Array.isArray(Ae))return Ae;if(Symbol.iterator in Object(Ae))return we(Ae,Ee);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function we(Ae,Ee){for(var Ne=0;Ne<Ee.length;Ne++){var he=Ee[Ne];he.enumerable=he.enumerable||!1,he.configurable=!0,"value"in he&&(he.writable=!0),Object.defineProperty(Ae,he.key,he)}}return function(Ae,Ee,Ne){return Ee&&we(Ae.prototype,Ee),Ne&&we(Ae,Ne),Ae}}(),u=a(3),c=L(u),h=a(2),p=L(h),w=a(0),d=L(w),_=a(5),E=L(_),S=a(10),y=L(S),g=a(9),v=L(g),b=a(36),O=a(37),j=a(13),T=L(j),M=a(26),F=a(38),C=a(39),x=a(40);function L(we){return we&&we.__esModule?we:{default:we}}function A(we,Ae,Ee){return Ae in we?Object.defineProperty(we,Ae,{value:Ee,enumerable:!0,configurable:!0,writable:!0}):we[Ae]=Ee,we}function N(we,Ae){if(!(we instanceof Ae))throw new TypeError("Cannot call a class as a function")}function I(we,Ae){if(!we)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Ae&&(typeof Ae=="object"||typeof Ae=="function")?Ae:we}function W(we,Ae){if(typeof Ae!="function"&&Ae!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Ae);we.prototype=Object.create(Ae&&Ae.prototype,{constructor:{value:we,enumerable:!1,writable:!0,configurable:!0}}),Ae&&(Object.setPrototypeOf?Object.setPrototypeOf(we,Ae):we.__proto__=Ae)}var G=(0,y.default)("quill:clipboard"),$="__ql-matcher",J=[[Node.TEXT_NODE,He],[Node.TEXT_NODE,Re],["br",me],[Node.ELEMENT_NODE,Re],[Node.ELEMENT_NODE,ce],[Node.ELEMENT_NODE,Se],[Node.ELEMENT_NODE,se],[Node.ELEMENT_NODE,ve],["li",Oe],["b",ae.bind(ae,"bold")],["i",ae.bind(ae,"italic")],["style",xe]],V=[b.AlignAttribute,F.DirectionAttribute].reduce(function(we,Ae){return we[Ae.keyName]=Ae,we},{}),H=[b.AlignStyle,O.BackgroundStyle,M.ColorStyle,F.DirectionStyle,C.FontStyle,x.SizeStyle].reduce(function(we,Ae){return we[Ae.keyName]=Ae,we},{}),z=function(we){W(Ae,we);function Ae(Ee,Ne){N(this,Ae);var he=I(this,(Ae.__proto__||Object.getPrototypeOf(Ae)).call(this,Ee,Ne));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=[],J.concat(he.options.matchers).forEach(function(Le){var Ce=o(Le,2),De=Ce[0],tt=Ce[1];!Ne.matchVisual&&tt===Se||he.addMatcher(De,tt)}),he}return l(Ae,[{key:"addMatcher",value:function(Ne,he){this.matchers.push([Ne,he])}},{key:"convert",value:function(Ne){if(typeof Ne=="string")return this.container.innerHTML=Ne.replace(/\>\r?\n +\</g,"><"),this.convert();var he=this.quill.getFormat(this.quill.selection.savedRange.index);if(he[T.default.blotName]){var Le=this.container.innerText;return this.container.innerHTML="",new p.default().insert(Le,A({},T.default.blotName,he[T.default.blotName]))}var Ce=this.prepareMatching(),De=o(Ce,2),tt=De[0],vt=De[1],mt=ee(this.container,tt,vt);return ne(mt,`
|
|
140
|
-
`)&&mt.ops[mt.ops.length-1].attributes==null&&(mt=mt.compose(new p.default().retain(mt.length()-1).delete(1))),G.log("convert",this.container.innerHTML,mt),this.container.innerHTML="",mt}},{key:"dangerouslyPasteHTML",value:function(Ne,he){var Le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:E.default.sources.API;if(typeof Ne=="string")this.quill.setContents(this.convert(Ne),he),this.quill.setSelection(0,E.default.sources.SILENT);else{var Ce=this.convert(he);this.quill.updateContents(new p.default().retain(Ne).concat(Ce),Le),this.quill.setSelection(Ne+Ce.length(),E.default.sources.SILENT)}}},{key:"onPaste",value:function(Ne){var he=this;if(!(Ne.defaultPrevented||!this.quill.isEnabled())){var Le=this.quill.getSelection(),Ce=new p.default().retain(Le.index),De=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(E.default.sources.SILENT),setTimeout(function(){Ce=Ce.concat(he.convert()).delete(Le.length),he.quill.updateContents(Ce,E.default.sources.USER),he.quill.setSelection(Ce.length()-Le.length,E.default.sources.SILENT),he.quill.scrollingContainer.scrollTop=De,he.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var Ne=this,he=[],Le=[];return this.matchers.forEach(function(Ce){var De=o(Ce,2),tt=De[0],vt=De[1];switch(tt){case Node.TEXT_NODE:Le.push(vt);break;case Node.ELEMENT_NODE:he.push(vt);break;default:[].forEach.call(Ne.container.querySelectorAll(tt),function(mt){mt[$]=mt[$]||[],mt[$].push(vt)});break}}),[he,Le]}}]),Ae}(v.default);z.DEFAULTS={matchers:[],matchVisual:!0};function D(we,Ae,Ee){return(typeof Ae>"u"?"undefined":i(Ae))==="object"?Object.keys(Ae).reduce(function(Ne,he){return D(Ne,he,Ae[he])},we):we.reduce(function(Ne,he){return he.attributes&&he.attributes[Ae]?Ne.push(he):Ne.insert(he.insert,(0,c.default)({},A({},Ae,Ee),he.attributes))},new p.default)}function K(we){if(we.nodeType!==Node.ELEMENT_NODE)return{};var Ae="__ql-computed-style";return we[Ae]||(we[Ae]=window.getComputedStyle(we))}function ne(we,Ae){for(var Ee="",Ne=we.ops.length-1;Ne>=0&&Ee.length<Ae.length;--Ne){var he=we.ops[Ne];if(typeof he.insert!="string")break;Ee=he.insert+Ee}return Ee.slice(-1*Ae.length)===Ae}function Z(we){if(we.childNodes.length===0)return!1;var Ae=K(we);return["block","list-item"].indexOf(Ae.display)>-1}function ee(we,Ae,Ee){return we.nodeType===we.TEXT_NODE?Ee.reduce(function(Ne,he){return he(we,Ne)},new p.default):we.nodeType===we.ELEMENT_NODE?[].reduce.call(we.childNodes||[],function(Ne,he){var Le=ee(he,Ae,Ee);return he.nodeType===we.ELEMENT_NODE&&(Le=Ae.reduce(function(Ce,De){return De(he,Ce)},Le),Le=(he[$]||[]).reduce(function(Ce,De){return De(he,Ce)},Le)),Ne.concat(Le)},new p.default):new p.default}function ae(we,Ae,Ee){return D(Ee,we,!0)}function se(we,Ae){var Ee=d.default.Attributor.Attribute.keys(we),Ne=d.default.Attributor.Class.keys(we),he=d.default.Attributor.Style.keys(we),Le={};return Ee.concat(Ne).concat(he).forEach(function(Ce){var De=d.default.query(Ce,d.default.Scope.ATTRIBUTE);De!=null&&(Le[De.attrName]=De.value(we),Le[De.attrName])||(De=V[Ce],De!=null&&(De.attrName===Ce||De.keyName===Ce)&&(Le[De.attrName]=De.value(we)||void 0),De=H[Ce],De!=null&&(De.attrName===Ce||De.keyName===Ce)&&(De=H[Ce],Le[De.attrName]=De.value(we)||void 0))}),Object.keys(Le).length>0&&(Ae=D(Ae,Le)),Ae}function ce(we,Ae){var Ee=d.default.query(we);if(Ee==null)return Ae;if(Ee.prototype instanceof d.default.Embed){var Ne={},he=Ee.value(we);he!=null&&(Ne[Ee.blotName]=he,Ae=new p.default().insert(Ne,Ee.formats(we)))}else typeof Ee.formats=="function"&&(Ae=D(Ae,Ee.blotName,Ee.formats(we)));return Ae}function me(we,Ae){return ne(Ae,`
|
|
141
|
-
`)||Ae.insert(`
|
|
142
|
-
`),Ae}function xe(){return new p.default}function Oe(we,Ae){var Ee=d.default.query(we);if(Ee==null||Ee.blotName!=="list-item"||!ne(Ae,`
|
|
143
|
-
`))return Ae;for(var Ne=-1,he=we.parentNode;!he.classList.contains("ql-clipboard");)(d.default.query(he)||{}).blotName==="list"&&(Ne+=1),he=he.parentNode;return Ne<=0?Ae:Ae.compose(new p.default().retain(Ae.length()-1).retain(1,{indent:Ne}))}function Re(we,Ae){return ne(Ae,`
|
|
144
|
-
`)||(Z(we)||Ae.length()>0&&we.nextSibling&&Z(we.nextSibling))&&Ae.insert(`
|
|
145
|
-
`),Ae}function Se(we,Ae){if(Z(we)&&we.nextElementSibling!=null&&!ne(Ae,`
|
|
146
|
-
|
|
147
|
-
`)){var Ee=we.offsetHeight+parseFloat(K(we).marginTop)+parseFloat(K(we).marginBottom);we.nextElementSibling.offsetTop>we.offsetTop+Ee*1.5&&Ae.insert(`
|
|
148
|
-
`)}return Ae}function ve(we,Ae){var Ee={},Ne=we.style||{};return Ne.fontStyle&&K(we).fontStyle==="italic"&&(Ee.italic=!0),Ne.fontWeight&&(K(we).fontWeight.startsWith("bold")||parseInt(K(we).fontWeight)>=700)&&(Ee.bold=!0),Object.keys(Ee).length>0&&(Ae=D(Ae,Ee)),parseFloat(Ne.textIndent||0)>0&&(Ae=new p.default().insert(" ").concat(Ae)),Ae}function He(we,Ae){var Ee=we.data;if(we.parentNode.tagName==="O:P")return Ae.insert(Ee.trim());if(Ee.trim().length===0&&we.parentNode.classList.contains("ql-clipboard"))return Ae;if(!K(we.parentNode).whiteSpace.startsWith("pre")){var Ne=function(Le,Ce){return Ce=Ce.replace(/[^\u00a0]/g,""),Ce.length<1&&Le?" ":Ce};Ee=Ee.replace(/\r\n/g," ").replace(/\n/g," "),Ee=Ee.replace(/\s\s+/g,Ne.bind(Ne,!0)),(we.previousSibling==null&&Z(we.parentNode)||we.previousSibling!=null&&Z(we.previousSibling))&&(Ee=Ee.replace(/^\s+/,Ne.bind(Ne,!1))),(we.nextSibling==null&&Z(we.parentNode)||we.nextSibling!=null&&Z(we.nextSibling))&&(Ee=Ee.replace(/\s+$/,Ne.bind(Ne,!1)))}return Ae.insert(Ee)}n.default=z,n.matchAttributor=se,n.matchBlot=ce,n.matchNewline=Re,n.matchSpacing=Se,n.matchText=He},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function _(E,S){for(var y=0;y<S.length;y++){var g=S[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(E,g.key,g)}}return function(E,S,y){return S&&_(E.prototype,S),y&&_(E,y),E}}(),o=function _(E,S,y){E===null&&(E=Function.prototype);var g=Object.getOwnPropertyDescriptor(E,S);if(g===void 0){var v=Object.getPrototypeOf(E);return v===null?void 0:_(v,S,y)}else{if("value"in g)return g.value;var b=g.get;return b===void 0?void 0:b.call(y)}},l=a(6),u=c(l);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 w(_,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 d=function(_){w(E,_);function E(){return h(this,E),p(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return i(E,[{key:"optimize",value:function(y){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"optimize",this).call(this,y),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);d.blotName="bold",d.tagName=["STRONG","B"],n.default=d},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var i=function(){function x(L,A){var N=[],I=!0,W=!1,G=void 0;try{for(var $=L[Symbol.iterator](),J;!(I=(J=$.next()).done)&&(N.push(J.value),!(A&&N.length===A));I=!0);}catch(V){W=!0,G=V}finally{try{!I&&$.return&&$.return()}finally{if(W)throw G}}return N}return function(L,A){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return x(L,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function x(L,A){for(var N=0;N<A.length;N++){var I=A[N];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(L,I.key,I)}}return function(L,A,N){return A&&x(L.prototype,A),N&&x(L,N),L}}(),l=a(2),u=y(l),c=a(0),h=y(c),p=a(5),w=y(p),d=a(10),_=y(d),E=a(9),S=y(E);function y(x){return x&&x.__esModule?x:{default:x}}function g(x,L,A){return L in x?Object.defineProperty(x,L,{value:A,enumerable:!0,configurable:!0,writable:!0}):x[L]=A,x}function v(x,L){if(!(x instanceof L))throw new TypeError("Cannot call a class as a function")}function b(x,L){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:x}function O(x,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);x.prototype=Object.create(L&&L.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(x,L):x.__proto__=L)}var j=(0,_.default)("quill:toolbar"),T=function(x){O(L,x);function L(A,N){v(this,L);var I=b(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,A,N));if(Array.isArray(I.options.container)){var W=document.createElement("div");F(W,I.options.container),A.container.parentNode.insertBefore(W,A.container),I.container=W}else typeof I.options.container=="string"?I.container=document.querySelector(I.options.container):I.container=I.options.container;if(!(I.container instanceof HTMLElement)){var G;return G=j.error("Container required for toolbar",I.options),b(I,G)}return I.container.classList.add("ql-toolbar"),I.controls=[],I.handlers={},Object.keys(I.options.handlers).forEach(function($){I.addHandler($,I.options.handlers[$])}),[].forEach.call(I.container.querySelectorAll("button, select"),function($){I.attach($)}),I.quill.on(w.default.events.EDITOR_CHANGE,function($,J){$===w.default.events.SELECTION_CHANGE&&I.update(J)}),I.quill.on(w.default.events.SCROLL_OPTIMIZE,function(){var $=I.quill.selection.getRange(),J=i($,1),V=J[0];I.update(V)}),I}return o(L,[{key:"addHandler",value:function(N,I){this.handlers[N]=I}},{key:"attach",value:function(N){var I=this,W=[].find.call(N.classList,function($){return $.indexOf("ql-")===0});if(W){if(W=W.slice(3),N.tagName==="BUTTON"&&N.setAttribute("type","button"),this.handlers[W]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[W]==null){j.warn("ignoring attaching to disabled format",W,N);return}if(h.default.query(W)==null){j.warn("ignoring attaching to nonexistent format",W,N);return}}var G=N.tagName==="SELECT"?"change":"click";N.addEventListener(G,function($){var J=void 0;if(N.tagName==="SELECT"){if(N.selectedIndex<0)return;var V=N.options[N.selectedIndex];V.hasAttribute("selected")?J=!1:J=V.value||!1}else N.classList.contains("ql-active")?J=!1:J=N.value||!N.hasAttribute("value"),$.preventDefault();I.quill.focus();var H=I.quill.selection.getRange(),z=i(H,1),D=z[0];if(I.handlers[W]!=null)I.handlers[W].call(I,J);else if(h.default.query(W).prototype instanceof h.default.Embed){if(J=prompt("Enter "+W),!J)return;I.quill.updateContents(new u.default().retain(D.index).delete(D.length).insert(g({},W,J)),w.default.sources.USER)}else I.quill.format(W,J,w.default.sources.USER);I.update(D)}),this.controls.push([W,N])}}},{key:"update",value:function(N){var I=N==null?{}:this.quill.getFormat(N);this.controls.forEach(function(W){var G=i(W,2),$=G[0],J=G[1];if(J.tagName==="SELECT"){var V=void 0;if(N==null)V=null;else if(I[$]==null)V=J.querySelector("option[selected]");else if(!Array.isArray(I[$])){var H=I[$];typeof H=="string"&&(H=H.replace(/\"/g,'\\"')),V=J.querySelector('option[value="'+H+'"]')}V==null?(J.value="",J.selectedIndex=-1):V.selected=!0}else if(N==null)J.classList.remove("ql-active");else if(J.hasAttribute("value")){var z=I[$]===J.getAttribute("value")||I[$]!=null&&I[$].toString()===J.getAttribute("value")||I[$]==null&&!J.getAttribute("value");J.classList.toggle("ql-active",z)}else J.classList.toggle("ql-active",I[$]!=null)})}}]),L}(S.default);T.DEFAULTS={};function M(x,L,A){var N=document.createElement("button");N.setAttribute("type","button"),N.classList.add("ql-"+L),A!=null&&(N.value=A),x.appendChild(N)}function F(x,L){Array.isArray(L[0])||(L=[L]),L.forEach(function(A){var N=document.createElement("span");N.classList.add("ql-formats"),A.forEach(function(I){if(typeof I=="string")M(N,I);else{var W=Object.keys(I)[0],G=I[W];Array.isArray(G)?C(N,W,G):M(N,W,G)}}),x.appendChild(N)})}function C(x,L,A){var N=document.createElement("select");N.classList.add("ql-"+L),A.forEach(function(I){var W=document.createElement("option");I!==!1?W.setAttribute("value",I):W.setAttribute("selected","selected"),N.appendChild(W)}),x.appendChild(N)}T.DEFAULTS={container:null,handlers:{clean:function(){var L=this,A=this.quill.getSelection();if(A!=null)if(A.length==0){var N=this.quill.getFormat();Object.keys(N).forEach(function(I){h.default.query(I,h.default.Scope.INLINE)!=null&&L.quill.format(I,!1)})}else this.quill.removeFormat(A,w.default.sources.USER)},direction:function(L){var A=this.quill.getFormat().align;L==="rtl"&&A==null?this.quill.format("align","right",w.default.sources.USER):!L&&A==="right"&&this.quill.format("align",!1,w.default.sources.USER),this.quill.format("direction",L,w.default.sources.USER)},indent:function(L){var A=this.quill.getSelection(),N=this.quill.getFormat(A),I=parseInt(N.indent||0);if(L==="+1"||L==="-1"){var W=L==="+1"?1:-1;N.direction==="rtl"&&(W*=-1),this.quill.format("indent",I+W,w.default.sources.USER)}},link:function(L){L===!0&&(L=prompt("Enter link URL:")),this.quill.format("link",L,w.default.sources.USER)},list:function(L){var A=this.quill.getSelection(),N=this.quill.getFormat(A);L==="check"?N.list==="checked"||N.list==="unchecked"?this.quill.format("list",!1,w.default.sources.USER):this.quill.format("list","unchecked",w.default.sources.USER):this.quill.format("list",L,w.default.sources.USER)}}},n.default=T,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,S){for(var y=0;y<S.length;y++){var g=S[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(E,g.key,g)}}return function(E,S,y){return S&&_(E.prototype,S),y&&_(E,y),E}}(),o=function _(E,S,y){E===null&&(E=Function.prototype);var g=Object.getOwnPropertyDescriptor(E,S);if(g===void 0){var v=Object.getPrototypeOf(E);return v===null?void 0:_(v,S,y)}else{if("value"in g)return g.value;var b=g.get;return b===void 0?void 0:b.call(y)}},l=a(28),u=c(l);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 w(_,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 d=function(_){w(E,_);function E(S,y){h(this,E);var g=p(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,S));return g.label.innerHTML=y,g.container.classList.add("ql-color-picker"),[].slice.call(g.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(v){v.classList.add("ql-primary")}),g}return i(E,[{key:"buildItem",value:function(y){var g=o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"buildItem",this).call(this,y);return g.style.backgroundColor=y.getAttribute("value")||"",g}},{key:"selectItem",value:function(y,g){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"selectItem",this).call(this,y,g);var v=this.label.querySelector(".ql-color-label"),b=y&&y.getAttribute("data-value")||"";v&&(v.tagName==="line"?v.style.stroke=b:v.style.fill=b)}}]),E}(u.default);n.default=d},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function _(E,S){for(var y=0;y<S.length;y++){var g=S[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(E,g.key,g)}}return function(E,S,y){return S&&_(E.prototype,S),y&&_(E,y),E}}(),o=function _(E,S,y){E===null&&(E=Function.prototype);var g=Object.getOwnPropertyDescriptor(E,S);if(g===void 0){var v=Object.getPrototypeOf(E);return v===null?void 0:_(v,S,y)}else{if("value"in g)return g.value;var b=g.get;return b===void 0?void 0:b.call(y)}},l=a(28),u=c(l);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 w(_,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 d=function(_){w(E,_);function E(S,y){h(this,E);var g=p(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,S));return g.container.classList.add("ql-icon-picker"),[].forEach.call(g.container.querySelectorAll(".ql-picker-item"),function(v){v.innerHTML=y[v.getAttribute("data-value")||""]}),g.defaultItem=g.container.querySelector(".ql-selected"),g.selectItem(g.defaultItem),g}return i(E,[{key:"selectItem",value:function(y,g){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"selectItem",this).call(this,y,g),y=y||this.defaultItem,this.label.innerHTML=y.innerHTML}}]),E}(u.default);n.default=d},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 w=h[p];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(c,w.key,w)}}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 l=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,w=h.bottom+this.quill.root.scrollTop;this.root.style.left=p+"px",this.root.style.top=w+"px",this.root.classList.remove("ql-flip");var d=this.boundsContainer.getBoundingClientRect(),_=this.root.getBoundingClientRect(),E=0;if(_.right>d.right&&(E=d.right-_.right,this.root.style.left=p+E+"px"),_.left<d.left&&(E=d.left-_.left,this.root.style.left=p+E+"px"),_.bottom>d.bottom){var S=_.bottom-_.top,y=h.bottom-h.top+S;this.root.style.top=w-y+"px",this.root.classList.add("ql-flip")}return E}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),u}();n.default=l},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function C(x,L){var A=[],N=!0,I=!1,W=void 0;try{for(var G=x[Symbol.iterator](),$;!(N=($=G.next()).done)&&(A.push($.value),!(L&&A.length===L));N=!0);}catch(J){I=!0,W=J}finally{try{!N&&G.return&&G.return()}finally{if(I)throw W}}return A}return function(x,L){if(Array.isArray(x))return x;if(Symbol.iterator in Object(x))return C(x,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function C(x,L,A){x===null&&(x=Function.prototype);var N=Object.getOwnPropertyDescriptor(x,L);if(N===void 0){var I=Object.getPrototypeOf(x);return I===null?void 0:C(I,L,A)}else{if("value"in N)return N.value;var W=N.get;return W===void 0?void 0:W.call(A)}},l=function(){function C(x,L){for(var A=0;A<L.length;A++){var N=L[A];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,N.key,N)}}return function(x,L,A){return L&&C(x.prototype,L),A&&C(x,A),x}}(),u=a(3),c=v(u),h=a(8),p=v(h),w=a(43),d=v(w),_=a(27),E=v(_),S=a(15),y=a(41),g=v(y);function v(C){return C&&C.__esModule?C:{default:C}}function b(C,x){if(!(C instanceof x))throw new TypeError("Cannot call a class as a function")}function O(C,x){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:C}function j(C,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);C.prototype=Object.create(x&&x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(C,x):C.__proto__=x)}var T=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],M=function(C){j(x,C);function x(L,A){b(this,x),A.modules.toolbar!=null&&A.modules.toolbar.container==null&&(A.modules.toolbar.container=T);var N=O(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,L,A));return N.quill.container.classList.add("ql-snow"),N}return l(x,[{key:"extendToolbar",value:function(A){A.container.classList.add("ql-snow"),this.buildButtons([].slice.call(A.container.querySelectorAll("button")),g.default),this.buildPickers([].slice.call(A.container.querySelectorAll("select")),g.default),this.tooltip=new F(this.quill,this.options.bounds),A.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(N,I){A.handlers.link.call(A,!I.format.link)})}}]),x}(d.default);M.DEFAULTS=(0,c.default)(!0,{},d.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(x){if(x){var L=this.quill.getSelection();if(L==null||L.length==0)return;var A=this.quill.getText(L);/^\S+@\S+\.\S+$/.test(A)&&A.indexOf("mailto:")!==0&&(A="mailto:"+A);var N=this.quill.theme.tooltip;N.edit("link",A)}else this.quill.format("link",!1)}}}}});var F=function(C){j(x,C);function x(L,A){b(this,x);var N=O(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,L,A));return N.preview=N.root.querySelector("a.ql-preview"),N}return l(x,[{key:"listen",value:function(){var A=this;o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(N){A.root.classList.contains("ql-editing")?A.save():A.edit("link",A.preview.textContent),N.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(N){if(A.linkRange!=null){var I=A.linkRange;A.restoreFocus(),A.quill.formatText(I,"link",!1,p.default.sources.USER),delete A.linkRange}N.preventDefault(),A.hide()}),this.quill.on(p.default.events.SELECTION_CHANGE,function(N,I,W){if(N!=null){if(N.length===0&&W===p.default.sources.USER){var G=A.quill.scroll.descendant(E.default,N.index),$=i(G,2),J=$[0],V=$[1];if(J!=null){A.linkRange=new S.Range(N.index-V,J.length());var H=E.default.formats(J.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(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),x}(w.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=M},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(29),o=he(i),l=a(36),u=a(38),c=a(64),h=a(65),p=he(h),w=a(66),d=he(w),_=a(67),E=he(_),S=a(37),y=a(26),g=a(39),v=a(40),b=a(56),O=he(b),j=a(68),T=he(j),M=a(27),F=he(M),C=a(69),x=he(C),L=a(70),A=he(L),N=a(71),I=he(N),W=a(72),G=he(W),$=a(73),J=he($),V=a(13),H=he(V),z=a(74),D=he(z),K=a(75),ne=he(K),Z=a(57),ee=he(Z),ae=a(41),se=he(ae),ce=a(28),me=he(ce),xe=a(59),Oe=he(xe),Re=a(60),Se=he(Re),ve=a(61),He=he(ve),we=a(108),Ae=he(we),Ee=a(62),Ne=he(Ee);function he(Le){return Le&&Le.__esModule?Le:{default:Le}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":S.BackgroundClass,"attributors/class/color":y.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":g.FontClass,"attributors/class/size":v.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":S.BackgroundStyle,"attributors/style/color":y.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":g.FontStyle,"attributors/style/size":v.SizeStyle},!0),o.default.register({"formats/align":l.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":c.IndentClass,"formats/background":S.BackgroundStyle,"formats/color":y.ColorStyle,"formats/font":g.FontClass,"formats/size":v.SizeClass,"formats/blockquote":p.default,"formats/code-block":H.default,"formats/header":d.default,"formats/list":E.default,"formats/bold":O.default,"formats/code":V.Code,"formats/italic":T.default,"formats/link":F.default,"formats/script":x.default,"formats/strike":A.default,"formats/underline":I.default,"formats/image":G.default,"formats/video":J.default,"formats/list/item":_.ListItem,"modules/formula":D.default,"modules/syntax":ne.default,"modules/toolbar":ee.default,"themes/bubble":Ae.default,"themes/snow":Ne.default,"ui/icons":se.default,"ui/picker":me.default,"ui/icon-picker":Se.default,"ui/color-picker":Oe.default,"ui/tooltip":He.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(S,y){for(var g=0;g<y.length;g++){var v=y[g];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(S,v.key,v)}}return function(S,y,g){return y&&E(S.prototype,y),g&&E(S,g),S}}(),o=function E(S,y,g){S===null&&(S=Function.prototype);var v=Object.getOwnPropertyDescriptor(S,y);if(v===void 0){var b=Object.getPrototypeOf(S);return b===null?void 0:E(b,y,g)}else{if("value"in v)return v.value;var O=v.get;return O===void 0?void 0:O.call(g)}},l=a(0),u=c(l);function c(E){return E&&E.__esModule?E:{default:E}}function h(E,S){if(!(E instanceof S))throw new TypeError("Cannot call a class as a function")}function p(E,S){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:E}function w(E,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);E.prototype=Object.create(S&&S.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(E,S):E.__proto__=S)}var d=function(E){w(S,E);function S(){return h(this,S),p(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return i(S,[{key:"add",value:function(g,v){if(v==="+1"||v==="-1"){var b=this.value(g)||0;v=v==="+1"?b+1:b-1}return v===0?(this.remove(g),!0):o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"add",this).call(this,g,v)}},{key:"canAdd",value:function(g,v){return o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"canAdd",this).call(this,g,v)||o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"canAdd",this).call(this,g,parseInt(v))}},{key:"value",value:function(g){return parseInt(o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"value",this).call(this,g))||void 0}}]),S}(u.default.Attributor.Class),_=new d("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=l(i);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,d){if(!(w instanceof d))throw new TypeError("Cannot call a class as a function")}function c(w,d){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:w}function h(w,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);w.prototype=Object.create(d&&d.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(w,d):w.__proto__=d)}var p=function(w){h(d,w);function d(){return u(this,d),c(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(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 d(_,E){for(var S=0;S<E.length;S++){var y=E[S];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(_,y.key,y)}}return function(_,E,S){return E&&d(_.prototype,E),S&&d(_,S),_}}(),o=a(4),l=u(o);function u(d){return d&&d.__esModule?d:{default:d}}function c(d,_){if(!(d instanceof _))throw new TypeError("Cannot call a class as a function")}function h(d,_){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:d}function p(d,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);d.prototype=Object.create(_&&_.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(d,_):d.__proto__=_)}var w=function(d){p(_,d);function _(){return c(this,_),h(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return i(_,null,[{key:"formats",value:function(S){return this.tagName.indexOf(S.tagName)+1}}]),_}(l.default);w.blotName="header",w.tagName=["H1","H2","H3","H4","H5","H6"],n.default=w},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var i=function(){function b(O,j){for(var T=0;T<j.length;T++){var M=j[T];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(O,M.key,M)}}return function(O,j,T){return j&&b(O.prototype,j),T&&b(O,T),O}}(),o=function b(O,j,T){O===null&&(O=Function.prototype);var M=Object.getOwnPropertyDescriptor(O,j);if(M===void 0){var F=Object.getPrototypeOf(O);return F===null?void 0:b(F,j,T)}else{if("value"in M)return M.value;var C=M.get;return C===void 0?void 0:C.call(T)}},l=a(0),u=d(l),c=a(4),h=d(c),p=a(25),w=d(p);function d(b){return b&&b.__esModule?b:{default:b}}function _(b,O,j){return O in b?Object.defineProperty(b,O,{value:j,enumerable:!0,configurable:!0,writable:!0}):b[O]=j,b}function E(b,O){if(!(b instanceof O))throw new TypeError("Cannot call a class as a function")}function S(b,O){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:b}function y(b,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);b.prototype=Object.create(O&&O.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(b,O):b.__proto__=O)}var g=function(b){y(O,b);function O(){return E(this,O),S(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return i(O,[{key:"format",value:function(T,M){T===v.blotName&&!M?this.replaceWith(u.default.create(this.statics.scope)):o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"format",this).call(this,T,M)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(T,M){return this.parent.isolate(this.offset(this.parent),this.length()),T===this.parent.statics.blotName?(this.parent.replaceWith(T,M),this):(this.parent.unwrap(),o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replaceWith",this).call(this,T,M))}}],[{key:"formats",value:function(T){return T.tagName===this.tagName?void 0:o(O.__proto__||Object.getPrototypeOf(O),"formats",this).call(this,T)}}]),O}(h.default);g.blotName="list-item",g.tagName="LI";var v=function(b){y(O,b),i(O,null,[{key:"create",value:function(T){var M=T==="ordered"?"OL":"UL",F=o(O.__proto__||Object.getPrototypeOf(O),"create",this).call(this,M);return(T==="checked"||T==="unchecked")&&F.setAttribute("data-checked",T==="checked"),F}},{key:"formats",value:function(T){if(T.tagName==="OL")return"ordered";if(T.tagName==="UL")return T.hasAttribute("data-checked")?T.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function O(j){E(this,O);var T=S(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,j)),M=function(C){if(C.target.parentNode===j){var x=T.statics.formats(j),L=u.default.find(C.target);x==="checked"?L.format("list","unchecked"):x==="unchecked"&&L.format("list","checked")}};return j.addEventListener("touchstart",M),j.addEventListener("mousedown",M),T}return i(O,[{key:"format",value:function(T,M){this.children.length>0&&this.children.tail.format(T,M)}},{key:"formats",value:function(){return _({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(T,M){if(T instanceof g)o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertBefore",this).call(this,T,M);else{var F=M==null?this.length():M.offset(this),C=this.split(F);C.parent.insertBefore(T,C)}}},{key:"optimize",value:function(T){o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,T);var M=this.next;M!=null&&M.prev===this&&M.statics.blotName===this.statics.blotName&&M.domNode.tagName===this.domNode.tagName&&M.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(M.moveChildren(this),M.remove())}},{key:"replace",value:function(T){if(T.statics.blotName!==this.statics.blotName){var M=u.default.create(this.statics.defaultChild);T.moveChildren(M),this.appendChild(M)}o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replace",this).call(this,T)}}]),O}(w.default);v.blotName="list",v.scope=u.default.Scope.BLOCK_BLOT,v.tagName=["OL","UL"],v.defaultChild="list-item",v.allowedChildren=[g],n.ListItem=g,n.default=v},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(56),o=l(i);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,d){if(!(w instanceof d))throw new TypeError("Cannot call a class as a function")}function c(w,d){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:w}function h(w,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);w.prototype=Object.create(d&&d.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(w,d):w.__proto__=d)}var p=function(w){h(d,w);function d(){return u(this,d),c(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(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,S){for(var y=0;y<S.length;y++){var g=S[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(E,g.key,g)}}return function(E,S,y){return S&&_(E.prototype,S),y&&_(E,y),E}}(),o=function _(E,S,y){E===null&&(E=Function.prototype);var g=Object.getOwnPropertyDescriptor(E,S);if(g===void 0){var v=Object.getPrototypeOf(E);return v===null?void 0:_(v,S,y)}else{if("value"in g)return g.value;var b=g.get;return b===void 0?void 0:b.call(y)}},l=a(6),u=c(l);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 w(_,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 d=function(_){w(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(y){return y==="super"?document.createElement("sup"):y==="sub"?document.createElement("sub"):o(E.__proto__||Object.getPrototypeOf(E),"create",this).call(this,y)}},{key:"formats",value:function(y){if(y.tagName==="SUB")return"sub";if(y.tagName==="SUP")return"super"}}]),E}(u.default);d.blotName="script",d.tagName=["SUB","SUP"],n.default=d},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var i=a(6),o=l(i);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,d){if(!(w instanceof d))throw new TypeError("Cannot call a class as a function")}function c(w,d){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:w}function h(w,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);w.prototype=Object.create(d&&d.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(w,d):w.__proto__=d)}var p=function(w){h(d,w);function d(){return u(this,d),c(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(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=l(i);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,d){if(!(w instanceof d))throw new TypeError("Cannot call a class as a function")}function c(w,d){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:w}function h(w,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);w.prototype=Object.create(d&&d.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(w,d):w.__proto__=d)}var p=function(w){h(d,w);function d(){return u(this,d),c(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d}(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 S(y,g){for(var v=0;v<g.length;v++){var b=g[v];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,g,v){return g&&S(y.prototype,g),v&&S(y,v),y}}(),o=function S(y,g,v){y===null&&(y=Function.prototype);var b=Object.getOwnPropertyDescriptor(y,g);if(b===void 0){var O=Object.getPrototypeOf(y);return O===null?void 0:S(O,g,v)}else{if("value"in b)return b.value;var j=b.get;return j===void 0?void 0:j.call(v)}},l=a(0),u=h(l),c=a(27);function h(S){return S&&S.__esModule?S:{default:S}}function p(S,y){if(!(S instanceof y))throw new TypeError("Cannot call a class as a function")}function w(S,y){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:S}function d(S,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);S.prototype=Object.create(y&&y.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(S,y):S.__proto__=y)}var _=["alt","height","width"],E=function(S){d(y,S);function y(){return p(this,y),w(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return i(y,[{key:"format",value:function(v,b){_.indexOf(v)>-1?b?this.domNode.setAttribute(v,b):this.domNode.removeAttribute(v):o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,v,b)}}],[{key:"create",value:function(v){var b=o(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,v);return typeof v=="string"&&b.setAttribute("src",this.sanitize(v)),b}},{key:"formats",value:function(v){return _.reduce(function(b,O){return v.hasAttribute(O)&&(b[O]=v.getAttribute(O)),b},{})}},{key:"match",value:function(v){return/\.(jpe?g|gif|png)$/.test(v)||/^data:image\/.+;base64/.test(v)}},{key:"sanitize",value:function(v){return(0,c.sanitize)(v,["http","https","data"])?v:"//:0"}},{key:"value",value:function(v){return v.getAttribute("src")}}]),y}(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 S(y,g){for(var v=0;v<g.length;v++){var b=g[v];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,g,v){return g&&S(y.prototype,g),v&&S(y,v),y}}(),o=function S(y,g,v){y===null&&(y=Function.prototype);var b=Object.getOwnPropertyDescriptor(y,g);if(b===void 0){var O=Object.getPrototypeOf(y);return O===null?void 0:S(O,g,v)}else{if("value"in b)return b.value;var j=b.get;return j===void 0?void 0:j.call(v)}},l=a(4),u=a(27),c=h(u);function h(S){return S&&S.__esModule?S:{default:S}}function p(S,y){if(!(S instanceof y))throw new TypeError("Cannot call a class as a function")}function w(S,y){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:S}function d(S,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);S.prototype=Object.create(y&&y.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(S,y):S.__proto__=y)}var _=["height","width"],E=function(S){d(y,S);function y(){return p(this,y),w(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return i(y,[{key:"format",value:function(v,b){_.indexOf(v)>-1?b?this.domNode.setAttribute(v,b):this.domNode.removeAttribute(v):o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,v,b)}}],[{key:"create",value:function(v){var b=o(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,v);return b.setAttribute("frameborder","0"),b.setAttribute("allowfullscreen",!0),b.setAttribute("src",this.sanitize(v)),b}},{key:"formats",value:function(v){return _.reduce(function(b,O){return v.hasAttribute(O)&&(b[O]=v.getAttribute(O)),b},{})}},{key:"sanitize",value:function(v){return c.default.sanitize(v)}},{key:"value",value:function(v){return v.getAttribute("src")}}]),y}(l.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 v(b,O){for(var j=0;j<O.length;j++){var T=O[j];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(b,T.key,T)}}return function(b,O,j){return O&&v(b.prototype,O),j&&v(b,j),b}}(),o=function v(b,O,j){b===null&&(b=Function.prototype);var T=Object.getOwnPropertyDescriptor(b,O);if(T===void 0){var M=Object.getPrototypeOf(b);return M===null?void 0:v(M,O,j)}else{if("value"in T)return T.value;var F=T.get;return F===void 0?void 0:F.call(j)}},l=a(35),u=d(l),c=a(5),h=d(c),p=a(9),w=d(p);function d(v){return v&&v.__esModule?v:{default:v}}function _(v,b){if(!(v instanceof b))throw new TypeError("Cannot call a class as a function")}function E(v,b){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:v}function S(v,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);v.prototype=Object.create(b&&b.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(v,b):v.__proto__=b)}var y=function(v){S(b,v);function b(){return _(this,b),E(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return i(b,null,[{key:"create",value:function(j){var T=o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,j);return typeof j=="string"&&(window.katex.render(j,T,{throwOnError:!1,errorColor:"#f00"}),T.setAttribute("data-value",j)),T}},{key:"value",value:function(j){return j.getAttribute("data-value")}}]),b}(u.default);y.blotName="formula",y.className="ql-formula",y.tagName="SPAN";var g=function(v){S(b,v),i(b,null,[{key:"register",value:function(){h.default.register(y,!0)}}]);function b(){_(this,b);var O=E(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return O}return b}(w.default);n.FormulaBlot=y,n.default=g},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var i=function(){function j(T,M){for(var F=0;F<M.length;F++){var C=M[F];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(T,C.key,C)}}return function(T,M,F){return M&&j(T.prototype,M),F&&j(T,F),T}}(),o=function j(T,M,F){T===null&&(T=Function.prototype);var C=Object.getOwnPropertyDescriptor(T,M);if(C===void 0){var x=Object.getPrototypeOf(T);return x===null?void 0:j(x,M,F)}else{if("value"in C)return C.value;var L=C.get;return L===void 0?void 0:L.call(F)}},l=a(0),u=E(l),c=a(5),h=E(c),p=a(9),w=E(p),d=a(13),_=E(d);function E(j){return j&&j.__esModule?j:{default:j}}function S(j,T){if(!(j instanceof T))throw new TypeError("Cannot call a class as a function")}function y(j,T){if(!j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:j}function g(j,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);j.prototype=Object.create(T&&T.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(j,T):j.__proto__=T)}var v=function(j){g(T,j);function T(){return S(this,T),y(this,(T.__proto__||Object.getPrototypeOf(T)).apply(this,arguments))}return i(T,[{key:"replaceWith",value:function(F){this.domNode.textContent=this.domNode.textContent,this.attach(),o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"replaceWith",this).call(this,F)}},{key:"highlight",value:function(F){var C=this.domNode.textContent;this.cachedText!==C&&((C.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=F(C),this.domNode.normalize(),this.attach()),this.cachedText=C)}}]),T}(_.default);v.className="ql-syntax";var b=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),O=function(j){g(T,j),i(T,null,[{key:"register",value:function(){h.default.register(b,!0),h.default.register(v,!0)}}]);function T(M,F){S(this,T);var C=y(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,M,F));if(typeof C.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var x=null;return C.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(x),x=setTimeout(function(){C.highlight(),x=null},C.options.interval)}),C.highlight(),C}return i(T,[{key:"highlight",value:function(){var F=this;if(!this.quill.selection.composing){this.quill.update(h.default.sources.USER);var C=this.quill.getSelection();this.quill.scroll.descendants(v).forEach(function(x){x.highlight(F.options.highlight)}),this.quill.update(h.default.sources.SILENT),C!=null&&this.quill.setSelection(C,h.default.sources.SILENT)}}}]),T}(w.default);O.DEFAULTS={highlight:function(){return window.hljs==null?null:function(j){var T=window.hljs.highlightAuto(j);return T.value}}(),interval:1e3},n.CodeBlock=v,n.CodeToken=b,n.default=O},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 T(M,F,C){M===null&&(M=Function.prototype);var x=Object.getOwnPropertyDescriptor(M,F);if(x===void 0){var L=Object.getPrototypeOf(M);return L===null?void 0:T(L,F,C)}else{if("value"in x)return x.value;var A=x.get;return A===void 0?void 0:A.call(C)}},o=function(){function T(M,F){for(var C=0;C<F.length;C++){var x=F[C];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(M,x.key,x)}}return function(M,F,C){return F&&T(M.prototype,F),C&&T(M,C),M}}(),l=a(3),u=S(l),c=a(8),h=S(c),p=a(43),w=S(p),d=a(15),_=a(41),E=S(_);function S(T){return T&&T.__esModule?T:{default:T}}function y(T,M){if(!(T instanceof M))throw new TypeError("Cannot call a class as a function")}function g(T,M){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:T}function v(T,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);T.prototype=Object.create(M&&M.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(T,M):T.__proto__=M)}var b=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],O=function(T){v(M,T);function M(F,C){y(this,M),C.modules.toolbar!=null&&C.modules.toolbar.container==null&&(C.modules.toolbar.container=b);var x=g(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,F,C));return x.quill.container.classList.add("ql-bubble"),x}return o(M,[{key:"extendToolbar",value:function(C){this.tooltip=new j(this.quill,this.options.bounds),this.tooltip.root.appendChild(C.container),this.buildButtons([].slice.call(C.container.querySelectorAll("button")),E.default),this.buildPickers([].slice.call(C.container.querySelectorAll("select")),E.default)}}]),M}(w.default);O.DEFAULTS=(0,u.default)(!0,{},w.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(M){M?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var j=function(T){v(M,T);function M(F,C){y(this,M);var x=g(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,F,C));return x.quill.on(h.default.events.EDITOR_CHANGE,function(L,A,N,I){if(L===h.default.events.SELECTION_CHANGE)if(A!=null&&A.length>0&&I===h.default.sources.USER){x.show(),x.root.style.left="0px",x.root.style.width="",x.root.style.width=x.root.offsetWidth+"px";var W=x.quill.getLines(A.index,A.length);if(W.length===1)x.position(x.quill.getBounds(A));else{var G=W[W.length-1],$=x.quill.getIndex(G),J=Math.min(G.length()-1,A.index+A.length-$),V=x.quill.getBounds(new d.Range($,J));x.position(V)}}else document.activeElement!==x.textbox&&x.quill.hasFocus()&&x.hide()}),x}return o(M,[{key:"listen",value:function(){var C=this;i(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){C.root.classList.remove("ql-editing")}),this.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!C.root.classList.contains("ql-hidden")){var x=C.quill.getSelection();x!=null&&C.position(C.quill.getBounds(x))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(C){var x=i(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"position",this).call(this,C),L=this.root.querySelector(".ql-tooltip-arrow");if(L.style.marginLeft="",x===0)return x;L.style.marginLeft=-1*x-L.offsetWidth/2+"px"}}]),M}(p.BaseTooltip);j.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=j,n.default=O},function(t,n,a){t.exports=a(63)}]).default})}(y1)),y1.exports}var ic={},b1={exports:{}},wf={},rp={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var MA=rp.exports,Bb;function IA(){return Bb||(Bb=1,function(e,r){(function(t){var n=r&&!r.nodeType&&r,a=e&&!e.nodeType&&e,i=typeof wh=="object"&&wh;(i.global===i||i.window===i||i.self===i)&&(t=i);var o,l=2147483647,u=36,c=1,h=26,p=38,w=700,d=72,_=128,E="-",S=/^xn--/,y=/[^\x20-\x7E]/,g=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=u-c,O=Math.floor,j=String.fromCharCode,T;function M(V){throw new RangeError(v[V])}function F(V,H){for(var z=V.length,D=[];z--;)D[z]=H(V[z]);return D}function C(V,H){var z=V.split("@"),D="";z.length>1&&(D=z[0]+"@",V=z[1]),V=V.replace(g,".");var K=V.split("."),ne=F(K,H).join(".");return D+ne}function x(V){for(var H=[],z=0,D=V.length,K,ne;z<D;)K=V.charCodeAt(z++),K>=55296&&K<=56319&&z<D?(ne=V.charCodeAt(z++),(ne&64512)==56320?H.push(((K&1023)<<10)+(ne&1023)+65536):(H.push(K),z--)):H.push(K);return H}function L(V){return F(V,function(H){var z="";return H>65535&&(H-=65536,z+=j(H>>>10&1023|55296),H=56320|H&1023),z+=j(H),z}).join("")}function A(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:u}function N(V,H){return V+22+75*(V<26)-((H!=0)<<5)}function I(V,H,z){var D=0;for(V=z?O(V/w):V>>1,V+=O(V/H);V>b*h>>1;D+=u)V=O(V/b);return O(D+(b+1)*V/(V+p))}function W(V){var H=[],z=V.length,D,K=0,ne=_,Z=d,ee,ae,se,ce,me,xe,Oe,Re,Se;for(ee=V.lastIndexOf(E),ee<0&&(ee=0),ae=0;ae<ee;++ae)V.charCodeAt(ae)>=128&&M("not-basic"),H.push(V.charCodeAt(ae));for(se=ee>0?ee+1:0;se<z;){for(ce=K,me=1,xe=u;se>=z&&M("invalid-input"),Oe=A(V.charCodeAt(se++)),(Oe>=u||Oe>O((l-K)/me))&&M("overflow"),K+=Oe*me,Re=xe<=Z?c:xe>=Z+h?h:xe-Z,!(Oe<Re);xe+=u)Se=u-Re,me>O(l/Se)&&M("overflow"),me*=Se;D=H.length+1,Z=I(K-ce,D,ce==0),O(K/D)>l-ne&&M("overflow"),ne+=O(K/D),K%=D,H.splice(K++,0,ne)}return L(H)}function G(V){var H,z,D,K,ne,Z,ee,ae,se,ce,me,xe=[],Oe,Re,Se,ve;for(V=x(V),Oe=V.length,H=_,z=0,ne=d,Z=0;Z<Oe;++Z)me=V[Z],me<128&&xe.push(j(me));for(D=K=xe.length,K&&xe.push(E);D<Oe;){for(ee=l,Z=0;Z<Oe;++Z)me=V[Z],me>=H&&me<ee&&(ee=me);for(Re=D+1,ee-H>O((l-z)/Re)&&M("overflow"),z+=(ee-H)*Re,H=ee,Z=0;Z<Oe;++Z)if(me=V[Z],me<H&&++z>l&&M("overflow"),me==H){for(ae=z,se=u;ce=se<=ne?c:se>=ne+h?h:se-ne,!(ae<ce);se+=u)ve=ae-ce,Se=u-ce,xe.push(j(N(ce+ve%Se,0))),ae=O(ve/Se);xe.push(j(N(ae,0))),ne=I(z,Re,D==K),z=0,++D}++z,++H}return xe.join("")}function $(V){return C(V,function(H){return S.test(H)?W(H.slice(4).toLowerCase()):H})}function J(V){return C(V,function(H){return y.test(H)?"xn--"+G(H):H})}if(o={version:"1.4.1",ucs2:{decode:x,encode:L},decode:W,encode:G,toASCII:J,toUnicode:$},n&&a)if(e.exports==n)a.exports=o;else for(T in o)o.hasOwnProperty(T)&&(n[T]=o[T]);else t.punycode=o})(MA)}(rp,rp.exports)),rp.exports}var Eg,qb;function jh(){return qb||(qb=1,Eg=TypeError),Eg}const jA={},FA=Object.freeze(Object.defineProperty({__proto__:null,default:jA},Symbol.toStringTag,{value:"Module"})),DA=Kc(FA);var Pg,zb;function o0(){if(zb)return Pg;zb=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,l=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,w=typeof WeakRef=="function"&&WeakRef.prototype,d=w?WeakRef.prototype.deref:null,_=Boolean.prototype.valueOf,E=Object.prototype.toString,S=Function.prototype.toString,y=String.prototype.match,g=String.prototype.slice,v=String.prototype.replace,b=String.prototype.toUpperCase,O=String.prototype.toLowerCase,j=RegExp.prototype.test,T=Array.prototype.concat,M=Array.prototype.join,F=Array.prototype.slice,C=Math.floor,x=typeof BigInt=="function"?BigInt.prototype.valueOf:null,L=Object.getOwnPropertySymbols,A=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,N=typeof Symbol=="function"&&typeof Symbol.iterator=="object",I=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===N||!0)?Symbol.toStringTag:null,W=Object.prototype.propertyIsEnumerable,G=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(qe){return qe.__proto__}:null);function $(qe,We){if(qe===1/0||qe===-1/0||qe!==qe||qe&&qe>-1e3&&qe<1e3||j.call(/e/,We))return We;var Nt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof qe=="number"){var ht=qe<0?-C(-qe):C(qe);if(ht!==qe){var gt=String(ht),wt=g.call(We,gt.length+1);return v.call(gt,Nt,"$&_")+"."+v.call(v.call(wt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(We,Nt,"$&_")}var J=DA,V=J.custom,H=Re(V)?V:null,z={__proto__:null,double:'"',single:"'"},D={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Pg=function qe(We,Nt,ht,gt){var wt=Nt||{};if(He(wt,"quoteStyle")&&!He(z,wt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(He(wt,"maxStringLength")&&(typeof wt.maxStringLength=="number"?wt.maxStringLength<0&&wt.maxStringLength!==1/0:wt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var tr=He(wt,"customInspect")?wt.customInspect:!0;if(typeof tr!="boolean"&&tr!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(He(wt,"indent")&&wt.indent!==null&&wt.indent!==" "&&!(parseInt(wt.indent,10)===wt.indent&&wt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(He(wt,"numericSeparator")&&typeof wt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Vt=wt.numericSeparator;if(typeof We>"u")return"undefined";if(We===null)return"null";if(typeof We=="boolean")return We?"true":"false";if(typeof We=="string")return vt(We,wt);if(typeof We=="number"){if(We===0)return 1/0/We>0?"0":"-0";var _t=String(We);return Vt?$(We,_t):_t}if(typeof We=="bigint"){var it=String(We)+"n";return Vt?$(We,it):it}var Bt=typeof wt.depth>"u"?5:wt.depth;if(typeof ht>"u"&&(ht=0),ht>=Bt&&Bt>0&&typeof We=="object")return ee(We)?"[Array]":"[Object]";var Ve=Ct(wt,ht);if(typeof gt>"u")gt=[];else if(Ee(gt,We)>=0)return"[Circular]";function Fe(Si,fa,ws){if(fa&&(gt=F.call(gt),gt.push(fa)),ws){var Go={depth:wt.depth};return He(wt,"quoteStyle")&&(Go.quoteStyle=wt.quoteStyle),qe(Si,Go,ht+1,gt)}return qe(Si,wt,ht+1,gt)}if(typeof We=="function"&&!se(We)){var bt=Ae(We),Ue=Xt(We,Fe);return"[Function"+(bt?": "+bt:" (anonymous)")+"]"+(Ue.length>0?" { "+M.call(Ue,", ")+" }":"")}if(Re(We)){var St=N?v.call(String(We),/^(Symbol\(.*\))_[^)]*$/,"$1"):A.call(We);return typeof We=="object"&&!N?Et(St):St}if(tt(We)){for(var kt="<"+O.call(String(We.nodeName)),Ft=We.attributes||[],zt=0;zt<Ft.length;zt++)kt+=" "+Ft[zt].name+"="+K(ne(Ft[zt].value),"double",wt);return kt+=">",We.childNodes&&We.childNodes.length&&(kt+="..."),kt+="</"+O.call(String(We.nodeName))+">",kt}if(ee(We)){if(We.length===0)return"[]";var Wt=Xt(We,Fe);return Ve&&!qt(Wt)?"["+or(Wt,Ve)+"]":"[ "+M.call(Wt,", ")+" ]"}if(ce(We)){var _r=Xt(We,Fe);return!("cause"in Error.prototype)&&"cause"in We&&!W.call(We,"cause")?"{ ["+String(We)+"] "+M.call(T.call("[cause]: "+Fe(We.cause),_r),", ")+" }":_r.length===0?"["+String(We)+"]":"{ ["+String(We)+"] "+M.call(_r,", ")+" }"}if(typeof We=="object"&&tr){if(H&&typeof We[H]=="function"&&J)return J(We,{depth:Bt-ht});if(tr!=="symbol"&&typeof We.inspect=="function")return We.inspect()}if(Ne(We)){var kr=[];return n&&n.call(We,function(Si,fa){kr.push(Fe(fa,We,!0)+" => "+Fe(Si,We))}),at("Map",t.call(We),kr,Ve)}if(Ce(We)){var Lr=[];return l&&l.call(We,function(Si){Lr.push(Fe(Si,We))}),at("Set",o.call(We),Lr,Ve)}if(he(We))return nt("WeakMap");if(De(We))return nt("WeakSet");if(Le(We))return nt("WeakRef");if(xe(We))return Et(Fe(Number(We)));if(Se(We))return Et(Fe(x.call(We)));if(Oe(We))return Et(_.call(We));if(me(We))return Et(Fe(String(We)));if(typeof window<"u"&&We===window)return"{ [object Window] }";if(typeof globalThis<"u"&&We===globalThis||typeof wh<"u"&&We===wh)return"{ [object globalThis] }";if(!ae(We)&&!se(We)){var Nr=Xt(We,Fe),Wn=G?G(We)===Object.prototype:We instanceof Object||We.constructor===Object,en=We instanceof Object?"":"null prototype",Qn=!Wn&&I&&Object(We)===We&&I in We?g.call(we(We),8,-1):en?"Object":"",_i=Wn||typeof We.constructor!="function"?"":We.constructor.name?We.constructor.name+" ":"",Ni=_i+(Qn||en?"["+M.call(T.call([],Qn||[],en||[]),": ")+"] ":"");return Nr.length===0?Ni+"{}":Ve?Ni+"{"+or(Nr,Ve)+"}":Ni+"{ "+M.call(Nr,", ")+" }"}return String(We)};function K(qe,We,Nt){var ht=Nt.quoteStyle||We,gt=z[ht];return gt+qe+gt}function ne(qe){return v.call(String(qe),/"/g,""")}function Z(qe){return!I||!(typeof qe=="object"&&(I in qe||typeof qe[I]<"u"))}function ee(qe){return we(qe)==="[object Array]"&&Z(qe)}function ae(qe){return we(qe)==="[object Date]"&&Z(qe)}function se(qe){return we(qe)==="[object RegExp]"&&Z(qe)}function ce(qe){return we(qe)==="[object Error]"&&Z(qe)}function me(qe){return we(qe)==="[object String]"&&Z(qe)}function xe(qe){return we(qe)==="[object Number]"&&Z(qe)}function Oe(qe){return we(qe)==="[object Boolean]"&&Z(qe)}function Re(qe){if(N)return qe&&typeof qe=="object"&&qe instanceof Symbol;if(typeof qe=="symbol")return!0;if(!qe||typeof qe!="object"||!A)return!1;try{return A.call(qe),!0}catch{}return!1}function Se(qe){if(!qe||typeof qe!="object"||!x)return!1;try{return x.call(qe),!0}catch{}return!1}var ve=Object.prototype.hasOwnProperty||function(qe){return qe in this};function He(qe,We){return ve.call(qe,We)}function we(qe){return E.call(qe)}function Ae(qe){if(qe.name)return qe.name;var We=y.call(S.call(qe),/^function\s*([\w$]+)/);return We?We[1]:null}function Ee(qe,We){if(qe.indexOf)return qe.indexOf(We);for(var Nt=0,ht=qe.length;Nt<ht;Nt++)if(qe[Nt]===We)return Nt;return-1}function Ne(qe){if(!t||!qe||typeof qe!="object")return!1;try{t.call(qe);try{o.call(qe)}catch{return!0}return qe instanceof Map}catch{}return!1}function he(qe){if(!c||!qe||typeof qe!="object")return!1;try{c.call(qe,c);try{p.call(qe,p)}catch{return!0}return qe instanceof WeakMap}catch{}return!1}function Le(qe){if(!d||!qe||typeof qe!="object")return!1;try{return d.call(qe),!0}catch{}return!1}function Ce(qe){if(!o||!qe||typeof qe!="object")return!1;try{o.call(qe);try{t.call(qe)}catch{return!0}return qe instanceof Set}catch{}return!1}function De(qe){if(!p||!qe||typeof qe!="object")return!1;try{p.call(qe,p);try{c.call(qe,c)}catch{return!0}return qe instanceof WeakSet}catch{}return!1}function tt(qe){return!qe||typeof qe!="object"?!1:typeof HTMLElement<"u"&&qe instanceof HTMLElement?!0:typeof qe.nodeName=="string"&&typeof qe.getAttribute=="function"}function vt(qe,We){if(qe.length>We.maxStringLength){var Nt=qe.length-We.maxStringLength,ht="... "+Nt+" more character"+(Nt>1?"s":"");return vt(g.call(qe,0,We.maxStringLength),We)+ht}var gt=D[We.quoteStyle||"single"];gt.lastIndex=0;var wt=v.call(v.call(qe,gt,"\\$1"),/[\x00-\x1f]/g,mt);return K(wt,"single",We)}function mt(qe){var We=qe.charCodeAt(0),Nt={8:"b",9:"t",10:"n",12:"f",13:"r"}[We];return Nt?"\\"+Nt:"\\x"+(We<16?"0":"")+b.call(We.toString(16))}function Et(qe){return"Object("+qe+")"}function nt(qe){return qe+" { ? }"}function at(qe,We,Nt,ht){var gt=ht?or(Nt,ht):M.call(Nt,", ");return qe+" ("+We+") {"+gt+"}"}function qt(qe){for(var We=0;We<qe.length;We++)if(Ee(qe[We],`
|
|
149
|
-
`)>=0)return!1;return!0}function Ct(qe,We){var Nt;if(qe.indent===" ")Nt=" ";else if(typeof qe.indent=="number"&&qe.indent>0)Nt=M.call(Array(qe.indent+1)," ");else return null;return{base:Nt,prev:M.call(Array(We+1),Nt)}}function or(qe,We){if(qe.length===0)return"";var Nt=`
|
|
150
|
-
`+We.prev+We.base;return Nt+M.call(qe,","+Nt)+`
|
|
151
|
-
`+We.prev}function Xt(qe,We){var Nt=ee(qe),ht=[];if(Nt){ht.length=qe.length;for(var gt=0;gt<qe.length;gt++)ht[gt]=He(qe,gt)?We(qe[gt],qe):""}var wt=typeof L=="function"?L(qe):[],tr;if(N){tr={};for(var Vt=0;Vt<wt.length;Vt++)tr["$"+wt[Vt]]=wt[Vt]}for(var _t in qe)He(qe,_t)&&(Nt&&String(Number(_t))===_t&&_t<qe.length||N&&tr["$"+_t]instanceof Symbol||(j.call(/[^\w$]/,_t)?ht.push(We(_t,qe)+": "+We(qe[_t],qe)):ht.push(_t+": "+We(qe[_t],qe))));if(typeof L=="function")for(var it=0;it<wt.length;it++)W.call(qe,wt[it])&&ht.push("["+We(wt[it])+"]: "+We(qe[wt[it]],qe));return ht}return Pg}var Og,Ub;function BA(){if(Ub)return Og;Ub=1;var e=o0(),r=jh(),t=function(l,u,c){for(var h=l,p;(p=h.next)!=null;h=p)if(p.key===u)return h.next=p.next,c||(p.next=l.next,l.next=p),p},n=function(l,u){if(l){var c=t(l,u);return c&&c.value}},a=function(l,u,c){var h=t(l,u);h?h.value=c:l.next={key:u,next:l.next,value:c}},i=function(l,u){return l?!!t(l,u):!1},o=function(l,u){if(l)return t(l,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,w=o(u,h);return w&&p&&p===w&&(u=void 0),!!w},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,Hb;function z8(){return Hb||(Hb=1,Ag=Object),Ag}var Cg,Vb;function qA(){return Vb||(Vb=1,Cg=Error),Cg}var kg,Gb;function zA(){return Gb||(Gb=1,kg=EvalError),kg}var Lg,Wb;function UA(){return Wb||(Wb=1,Lg=RangeError),Lg}var Ng,$b;function HA(){return $b||($b=1,Ng=ReferenceError),Ng}var Tg,Yb;function VA(){return Yb||(Yb=1,Tg=SyntaxError),Tg}var Rg,Xb;function GA(){return Xb||(Xb=1,Rg=URIError),Rg}var Mg,Kb;function WA(){return Kb||(Kb=1,Mg=Math.abs),Mg}var Ig,Zb;function $A(){return Zb||(Zb=1,Ig=Math.floor),Ig}var jg,Qb;function YA(){return Qb||(Qb=1,jg=Math.max),jg}var Fg,Jb;function XA(){return Jb||(Jb=1,Fg=Math.min),Fg}var Dg,e3;function KA(){return e3||(e3=1,Dg=Math.pow),Dg}var Bg,t3;function ZA(){return t3||(t3=1,Bg=Math.round),Bg}var qg,r3;function QA(){return r3||(r3=1,qg=Number.isNaN||function(r){return r!==r}),qg}var zg,n3;function JA(){if(n3)return zg;n3=1;var e=QA();return zg=function(t){return e(t)||t===0?t:t<0?-1:1},zg}var Ug,i3;function eC(){return i3||(i3=1,Ug=Object.getOwnPropertyDescriptor),Ug}var Hg,a3;function U8(){if(a3)return Hg;a3=1;var e=eC();if(e)try{e([],"length")}catch{e=null}return Hg=e,Hg}var Vg,o3;function tC(){if(o3)return Vg;o3=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Vg=e,Vg}var Gg,s3;function rC(){return s3||(s3=1,Gg=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 l=Object.getOwnPropertyDescriptor(r,t);if(l.value!==a||l.enumerable!==!0)return!1}return!0}),Gg}var Wg,l3;function nC(){if(l3)return Wg;l3=1;var e=typeof Symbol<"u"&&Symbol,r=rC();return Wg=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:r()},Wg}var $g,u3;function H8(){return u3||(u3=1,$g=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),$g}var Yg,c3;function V8(){if(c3)return Yg;c3=1;var e=z8();return Yg=e.getPrototypeOf||null,Yg}var Xg,f3;function iC(){if(f3)return Xg;f3=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 w=0;w<c.length;w+=1)h[w+u.length]=c[w];return h},i=function(u,c){for(var h=[],p=c,w=0;p<u.length;p+=1,w+=1)h[w]=u[p];return h},o=function(l,u){for(var c="",h=0;h<l.length;h+=1)c+=l[h],h+1<l.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,w=function(){if(this instanceof p){var y=c.apply(this,a(h,arguments));return Object(y)===y?y:this}return c.apply(u,a(h,arguments))},d=t(0,c.length-h.length),_=[],E=0;E<d;E++)_[E]="$"+E;if(p=Function("binder","return function ("+o(_,",")+"){ return binder.apply(this,arguments); }")(w),c.prototype){var S=function(){};S.prototype=c.prototype,p.prototype=new S,S.prototype=null}return p},Xg}var Kg,h3;function s0(){if(h3)return Kg;h3=1;var e=iC();return Kg=Function.prototype.bind||e,Kg}var Zg,d3;function Pm(){return d3||(d3=1,Zg=Function.prototype.call),Zg}var Qg,p3;function G8(){return p3||(p3=1,Qg=Function.prototype.apply),Qg}var Jg,g3;function aC(){return g3||(g3=1,Jg=typeof Reflect<"u"&&Reflect&&Reflect.apply),Jg}var ev,v3;function oC(){if(v3)return ev;v3=1;var e=s0(),r=G8(),t=Pm(),n=aC();return ev=n||e.call(t,r),ev}var tv,m3;function W8(){if(m3)return tv;m3=1;var e=s0(),r=jh(),t=Pm(),n=oC();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,y3;function sC(){if(y3)return rv;y3=1;var e=W8(),r=U8(),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(l){return i(l==null?l:a(l))}:!1,rv}var nv,b3;function lC(){if(b3)return nv;b3=1;var e=H8(),r=V8(),t=sC();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,w3;function uC(){if(w3)return iv;w3=1;var e=Function.prototype.call,r=Object.prototype.hasOwnProperty,t=s0();return iv=t.call(e,r),iv}var av,_3;function Om(){if(_3)return av;_3=1;var e,r=z8(),t=qA(),n=zA(),a=UA(),i=HA(),o=VA(),l=jh(),u=GA(),c=WA(),h=$A(),p=YA(),w=XA(),d=KA(),_=ZA(),E=JA(),S=Function,y=function(se){try{return S('"use strict"; return ('+se+").constructor;")()}catch{}},g=U8(),v=tC(),b=function(){throw new l},O=g?function(){try{return arguments.callee,b}catch{try{return g(arguments,"callee").get}catch{return b}}}():b,j=nC()(),T=lC(),M=V8(),F=H8(),C=G8(),x=Pm(),L={},A=typeof Uint8Array>"u"||!T?e:T(Uint8Array),N={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":j&&T?T([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":L,"%AsyncGenerator%":L,"%AsyncGeneratorFunction%":L,"%AsyncIteratorPrototype%":L,"%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%":S,"%GeneratorFunction%":L,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":j&&T?T(T([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!j||!T?e:T(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":g,"%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"||!j||!T?e:T(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":j&&T?T(""[Symbol.iterator]()):e,"%Symbol%":j?Symbol:e,"%SyntaxError%":o,"%ThrowTypeError%":O,"%TypedArray%":A,"%TypeError%":l,"%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%":x,"%Function.prototype.apply%":C,"%Object.defineProperty%":v,"%Object.getPrototypeOf%":M,"%Math.abs%":c,"%Math.floor%":h,"%Math.max%":p,"%Math.min%":w,"%Math.pow%":d,"%Math.round%":_,"%Math.sign%":E,"%Reflect.getPrototypeOf%":F};if(T)try{null.error}catch(se){var I=T(T(se));N["%Error.prototype%"]=I}var W=function se(ce){var me;if(ce==="%AsyncFunction%")me=y("async function () {}");else if(ce==="%GeneratorFunction%")me=y("function* () {}");else if(ce==="%AsyncGeneratorFunction%")me=y("async function* () {}");else if(ce==="%AsyncGenerator%"){var xe=se("%AsyncGeneratorFunction%");xe&&(me=xe.prototype)}else if(ce==="%AsyncIteratorPrototype%"){var Oe=se("%AsyncGenerator%");Oe&&T&&(me=T(Oe.prototype))}return N[ce]=me,me},G={__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"]},$=s0(),J=uC(),V=$.call(x,Array.prototype.concat),H=$.call(C,Array.prototype.splice),z=$.call(x,String.prototype.replace),D=$.call(x,String.prototype.slice),K=$.call(x,RegExp.prototype.exec),ne=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Z=/\\(\\)?/g,ee=function(ce){var me=D(ce,0,1),xe=D(ce,-1);if(me==="%"&&xe!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(xe==="%"&&me!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var Oe=[];return z(ce,ne,function(Re,Se,ve,He){Oe[Oe.length]=ve?z(He,Z,"$1"):Se||Re}),Oe},ae=function(ce,me){var xe=ce,Oe;if(J(G,xe)&&(Oe=G[xe],xe="%"+Oe[0]+"%"),J(N,xe)){var Re=N[xe];if(Re===L&&(Re=W(xe)),typeof Re>"u"&&!me)throw new l("intrinsic "+ce+" exists, but is not available. Please file an issue!");return{alias:Oe,name:xe,value:Re}}throw new o("intrinsic "+ce+" does not exist!")};return av=function(ce,me){if(typeof ce!="string"||ce.length===0)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof me!="boolean")throw new l('"allowMissing" argument must be a boolean');if(K(/^%?[^%]*%?$/,ce)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var xe=ee(ce),Oe=xe.length>0?xe[0]:"",Re=ae("%"+Oe+"%",me),Se=Re.name,ve=Re.value,He=!1,we=Re.alias;we&&(Oe=we[0],H(xe,V([0,1],we)));for(var Ae=1,Ee=!0;Ae<xe.length;Ae+=1){var Ne=xe[Ae],he=D(Ne,0,1),Le=D(Ne,-1);if((he==='"'||he==="'"||he==="`"||Le==='"'||Le==="'"||Le==="`")&&he!==Le)throw new o("property names with quotes must have matching quotes");if((Ne==="constructor"||!Ee)&&(He=!0),Oe+="."+Ne,Se="%"+Oe+"%",J(N,Se))ve=N[Se];else if(ve!=null){if(!(Ne in ve)){if(!me)throw new l("base intrinsic for "+ce+" exists, but the property is not available.");return}if(g&&Ae+1>=xe.length){var Ce=g(ve,Ne);Ee=!!Ce,Ee&&"get"in Ce&&!("originalValue"in Ce.get)?ve=Ce.get:ve=ve[Ne]}else Ee=J(ve,Ne),ve=ve[Ne];Ee&&!He&&(N[Se]=ve)}}return ve},av}var ov,S3;function $8(){if(S3)return ov;S3=1;var e=Om(),r=W8(),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,x3;function Y8(){if(x3)return sv;x3=1;var e=Om(),r=$8(),t=o0(),n=jh(),a=e("%Map%",!0),i=r("Map.prototype.get",!0),o=r("Map.prototype.set",!0),l=r("Map.prototype.has",!0),u=r("Map.prototype.delete",!0),c=r("Map.prototype.size",!0);return sv=!!a&&function(){var p,w={assert:function(d){if(!w.has(d))throw new n("Side channel does not contain "+t(d))},delete:function(d){if(p){var _=u(p,d);return c(p)===0&&(p=void 0),_}return!1},get:function(d){if(p)return i(p,d)},has:function(d){return p?l(p,d):!1},set:function(d,_){p||(p=new a),o(p,d,_)}};return w},sv}var lv,E3;function cC(){if(E3)return lv;E3=1;var e=Om(),r=$8(),t=o0(),n=Y8(),a=jh(),i=e("%WeakMap%",!0),o=r("WeakMap.prototype.get",!0),l=r("WeakMap.prototype.set",!0),u=r("WeakMap.prototype.has",!0),c=r("WeakMap.prototype.delete",!0);return lv=i?function(){var p,w,d={assert:function(_){if(!d.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&&w)return w.delete(_);return!1},get:function(_){return i&&_&&(typeof _=="object"||typeof _=="function")&&p?o(p,_):w&&w.get(_)},has:function(_){return i&&_&&(typeof _=="object"||typeof _=="function")&&p?u(p,_):!!w&&w.has(_)},set:function(_,E){i&&_&&(typeof _=="object"||typeof _=="function")?(p||(p=new i),l(p,_,E)):n&&(w||(w=n()),w.set(_,E))}};return d}:n,lv}var uv,P3;function fC(){if(P3)return uv;P3=1;var e=jh(),r=o0(),t=BA(),n=Y8(),a=cC(),i=a||n||t;return uv=function(){var l,u={assert:function(c){if(!u.has(c))throw new e("Side channel does not contain "+r(c))},delete:function(c){return!!l&&l.delete(c)},get:function(c){return l&&l.get(c)},has:function(c){return!!l&&l.has(c)},set:function(c,h){l||(l=i()),l.set(c,h)}};return u},uv}var cv,O3;function Am(){if(O3)return cv;O3=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,A3;function X8(){if(A3)return fv;A3=1;var e=Am(),r=Object.prototype.hasOwnProperty,t=Array.isArray,n=function(){for(var S=[],y=0;y<256;++y)S.push("%"+((y<16?"0":"")+y.toString(16)).toUpperCase());return S}(),a=function(y){for(;y.length>1;){var g=y.pop(),v=g.obj[g.prop];if(t(v)){for(var b=[],O=0;O<v.length;++O)typeof v[O]<"u"&&b.push(v[O]);g.obj[g.prop]=b}}},i=function(y,g){for(var v=g&&g.plainObjects?{__proto__:null}:{},b=0;b<y.length;++b)typeof y[b]<"u"&&(v[b]=y[b]);return v},o=function S(y,g,v){if(!g)return y;if(typeof g!="object"&&typeof g!="function"){if(t(y))y.push(g);else if(y&&typeof y=="object")(v&&(v.plainObjects||v.allowPrototypes)||!r.call(Object.prototype,g))&&(y[g]=!0);else return[y,g];return y}if(!y||typeof y!="object")return[y].concat(g);var b=y;return t(y)&&!t(g)&&(b=i(y,v)),t(y)&&t(g)?(g.forEach(function(O,j){if(r.call(y,j)){var T=y[j];T&&typeof T=="object"&&O&&typeof O=="object"?y[j]=S(T,O,v):y.push(O)}else y[j]=O}),y):Object.keys(g).reduce(function(O,j){var T=g[j];return r.call(O,j)?O[j]=S(O[j],T,v):O[j]=T,O},b)},l=function(y,g){return Object.keys(g).reduce(function(v,b){return v[b]=g[b],v},y)},u=function(S,y,g){var v=S.replace(/\+/g," ");if(g==="iso-8859-1")return v.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(v)}catch{return v}},c=1024,h=function(y,g,v,b,O){if(y.length===0)return y;var j=y;if(typeof y=="symbol"?j=Symbol.prototype.toString.call(y):typeof y!="string"&&(j=String(y)),v==="iso-8859-1")return escape(j).replace(/%u[0-9a-f]{4}/gi,function(A){return"%26%23"+parseInt(A.slice(2),16)+"%3B"});for(var T="",M=0;M<j.length;M+=c){for(var F=j.length>=c?j.slice(M,M+c):j,C=[],x=0;x<F.length;++x){var L=F.charCodeAt(x);if(L===45||L===46||L===95||L===126||L>=48&&L<=57||L>=65&&L<=90||L>=97&&L<=122||O===e.RFC1738&&(L===40||L===41)){C[C.length]=F.charAt(x);continue}if(L<128){C[C.length]=n[L];continue}if(L<2048){C[C.length]=n[192|L>>6]+n[128|L&63];continue}if(L<55296||L>=57344){C[C.length]=n[224|L>>12]+n[128|L>>6&63]+n[128|L&63];continue}x+=1,L=65536+((L&1023)<<10|F.charCodeAt(x)&1023),C[C.length]=n[240|L>>18]+n[128|L>>12&63]+n[128|L>>6&63]+n[128|L&63]}T+=C.join("")}return T},p=function(y){for(var g=[{obj:{o:y},prop:"o"}],v=[],b=0;b<g.length;++b)for(var O=g[b],j=O.obj[O.prop],T=Object.keys(j),M=0;M<T.length;++M){var F=T[M],C=j[F];typeof C=="object"&&C!==null&&v.indexOf(C)===-1&&(g.push({obj:j,prop:F}),v.push(C))}return a(g),y},w=function(y){return Object.prototype.toString.call(y)==="[object RegExp]"},d=function(y){return!y||typeof y!="object"?!1:!!(y.constructor&&y.constructor.isBuffer&&y.constructor.isBuffer(y))},_=function(y,g){return[].concat(y,g)},E=function(y,g){if(t(y)){for(var v=[],b=0;b<y.length;b+=1)v.push(g(y[b]));return v}return g(y)};return fv={arrayToObject:i,assign:l,combine:_,compact:p,decode:u,encode:h,isBuffer:d,isRegExp:w,maybeMap:E,merge:o},fv}var hv,C3;function hC(){if(C3)return hv;C3=1;var e=fC(),r=X8(),t=Am(),n=Object.prototype.hasOwnProperty,a={brackets:function(S){return S+"[]"},comma:"comma",indices:function(S,y){return S+"["+y+"]"},repeat:function(S){return S}},i=Array.isArray,o=Array.prototype.push,l=function(E,S){o.apply(E,i(S)?S:[S])},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(S){return u.call(S)},skipNulls:!1,strictNullHandling:!1},p=function(S){return typeof S=="string"||typeof S=="number"||typeof S=="boolean"||typeof S=="symbol"||typeof S=="bigint"},w={},d=function E(S,y,g,v,b,O,j,T,M,F,C,x,L,A,N,I,W,G){for(var $=S,J=G,V=0,H=!1;(J=J.get(w))!==void 0&&!H;){var z=J.get(S);if(V+=1,typeof z<"u"){if(z===V)throw new RangeError("Cyclic object value");H=!0}typeof J.get(w)>"u"&&(V=0)}if(typeof F=="function"?$=F(y,$):$ instanceof Date?$=L($):g==="comma"&&i($)&&($=r.maybeMap($,function(Se){return Se instanceof Date?L(Se):Se})),$===null){if(O)return M&&!I?M(y,h.encoder,W,"key",A):y;$=""}if(p($)||r.isBuffer($)){if(M){var D=I?y:M(y,h.encoder,W,"key",A);return[N(D)+"="+N(M($,h.encoder,W,"value",A))]}return[N(y)+"="+N(String($))]}var K=[];if(typeof $>"u")return K;var ne;if(g==="comma"&&i($))I&&M&&($=r.maybeMap($,M)),ne=[{value:$.length>0?$.join(",")||null:void 0}];else if(i(F))ne=F;else{var Z=Object.keys($);ne=C?Z.sort(C):Z}var ee=T?String(y).replace(/\./g,"%2E"):String(y),ae=v&&i($)&&$.length===1?ee+"[]":ee;if(b&&i($)&&$.length===0)return ae+"[]";for(var se=0;se<ne.length;++se){var ce=ne[se],me=typeof ce=="object"&&ce&&typeof ce.value<"u"?ce.value:$[ce];if(!(j&&me===null)){var xe=x&&T?String(ce).replace(/\./g,"%2E"):String(ce),Oe=i($)?typeof g=="function"?g(ae,xe):ae:ae+(x?"."+xe:"["+xe+"]");G.set(S,V);var Re=e();Re.set(w,G),l(K,E(me,Oe,g,v,b,O,j,T,g==="comma"&&I&&i($)?null:M,F,C,x,L,A,N,I,W,Re))}}return K},_=function(S){if(!S)return h;if(typeof S.allowEmptyArrays<"u"&&typeof S.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof S.encodeDotInKeys<"u"&&typeof S.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(S.encoder!==null&&typeof S.encoder<"u"&&typeof S.encoder!="function")throw new TypeError("Encoder has to be a function.");var y=S.charset||h.charset;if(typeof S.charset<"u"&&S.charset!=="utf-8"&&S.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var g=t.default;if(typeof S.format<"u"){if(!n.call(t.formatters,S.format))throw new TypeError("Unknown format option provided.");g=S.format}var v=t.formatters[g],b=h.filter;(typeof S.filter=="function"||i(S.filter))&&(b=S.filter);var O;if(S.arrayFormat in a?O=S.arrayFormat:"indices"in S?O=S.indices?"indices":"repeat":O=h.arrayFormat,"commaRoundTrip"in S&&typeof S.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var j=typeof S.allowDots>"u"?S.encodeDotInKeys===!0?!0:h.allowDots:!!S.allowDots;return{addQueryPrefix:typeof S.addQueryPrefix=="boolean"?S.addQueryPrefix:h.addQueryPrefix,allowDots:j,allowEmptyArrays:typeof S.allowEmptyArrays=="boolean"?!!S.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:O,charset:y,charsetSentinel:typeof S.charsetSentinel=="boolean"?S.charsetSentinel:h.charsetSentinel,commaRoundTrip:!!S.commaRoundTrip,delimiter:typeof S.delimiter>"u"?h.delimiter:S.delimiter,encode:typeof S.encode=="boolean"?S.encode:h.encode,encodeDotInKeys:typeof S.encodeDotInKeys=="boolean"?S.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof S.encoder=="function"?S.encoder:h.encoder,encodeValuesOnly:typeof S.encodeValuesOnly=="boolean"?S.encodeValuesOnly:h.encodeValuesOnly,filter:b,format:g,formatter:v,serializeDate:typeof S.serializeDate=="function"?S.serializeDate:h.serializeDate,skipNulls:typeof S.skipNulls=="boolean"?S.skipNulls:h.skipNulls,sort:typeof S.sort=="function"?S.sort:null,strictNullHandling:typeof S.strictNullHandling=="boolean"?S.strictNullHandling:h.strictNullHandling}};return hv=function(E,S){var y=E,g=_(S),v,b;typeof g.filter=="function"?(b=g.filter,y=b("",y)):i(g.filter)&&(b=g.filter,v=b);var O=[];if(typeof y!="object"||y===null)return"";var j=a[g.arrayFormat],T=j==="comma"&&g.commaRoundTrip;v||(v=Object.keys(y)),g.sort&&v.sort(g.sort);for(var M=e(),F=0;F<v.length;++F){var C=v[F],x=y[C];g.skipNulls&&x===null||l(O,d(x,C,j,T,g.allowEmptyArrays,g.strictNullHandling,g.skipNulls,g.encodeDotInKeys,g.encode?g.encoder:null,g.filter,g.sort,g.allowDots,g.serializeDate,g.format,g.formatter,g.encodeValuesOnly,g.charset,M))}var L=O.join(g.delimiter),A=g.addQueryPrefix===!0?"?":"";return g.charsetSentinel&&(g.charset==="iso-8859-1"?A+="utf8=%26%2310003%3B&":A+="utf8=%E2%9C%93&"),L.length>0?A+L:""},hv}var dv,k3;function dC(){if(k3)return dv;k3=1;var e=X8(),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(w){return w.replace(/&#(\d+);/g,function(d,_){return String.fromCharCode(parseInt(_,10))})},i=function(w,d,_){if(w&&typeof w=="string"&&d.comma&&w.indexOf(",")>-1)return w.split(",");if(d.throwOnLimitExceeded&&_>=d.arrayLimit)throw new RangeError("Array limit exceeded. Only "+d.arrayLimit+" element"+(d.arrayLimit===1?"":"s")+" allowed in an array.");return w},o="utf8=%26%2310003%3B",l="utf8=%E2%9C%93",u=function(d,_){var E={__proto__:null},S=_.ignoreQueryPrefix?d.replace(/^\?/,""):d;S=S.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var y=_.parameterLimit===1/0?void 0:_.parameterLimit,g=S.split(_.delimiter,_.throwOnLimitExceeded?y+1:y);if(_.throwOnLimitExceeded&&g.length>y)throw new RangeError("Parameter limit exceeded. Only "+y+" parameter"+(y===1?"":"s")+" allowed.");var v=-1,b,O=_.charset;if(_.charsetSentinel)for(b=0;b<g.length;++b)g[b].indexOf("utf8=")===0&&(g[b]===l?O="utf-8":g[b]===o&&(O="iso-8859-1"),v=b,b=g.length);for(b=0;b<g.length;++b)if(b!==v){var j=g[b],T=j.indexOf("]="),M=T===-1?j.indexOf("="):T+1,F,C;M===-1?(F=_.decoder(j,n.decoder,O,"key"),C=_.strictNullHandling?null:""):(F=_.decoder(j.slice(0,M),n.decoder,O,"key"),C=e.maybeMap(i(j.slice(M+1),_,t(E[F])?E[F].length:0),function(L){return _.decoder(L,n.decoder,O,"value")})),C&&_.interpretNumericEntities&&O==="iso-8859-1"&&(C=a(String(C))),j.indexOf("[]=")>-1&&(C=t(C)?[C]:C);var x=r.call(E,F);x&&_.duplicates==="combine"?E[F]=e.combine(E[F],C):(!x||_.duplicates==="last")&&(E[F]=C)}return E},c=function(w,d,_,E){var S=0;if(w.length>0&&w[w.length-1]==="[]"){var y=w.slice(0,-1).join("");S=Array.isArray(d)&&d[y]?d[y].length:0}for(var g=E?d:i(d,_,S),v=w.length-1;v>=0;--v){var b,O=w[v];if(O==="[]"&&_.parseArrays)b=_.allowEmptyArrays&&(g===""||_.strictNullHandling&&g===null)?[]:e.combine([],g);else{b=_.plainObjects?{__proto__:null}:{};var j=O.charAt(0)==="["&&O.charAt(O.length-1)==="]"?O.slice(1,-1):O,T=_.decodeDotInKeys?j.replace(/%2E/g,"."):j,M=parseInt(T,10);!_.parseArrays&&T===""?b={0:g}:!isNaN(M)&&O!==T&&String(M)===T&&M>=0&&_.parseArrays&&M<=_.arrayLimit?(b=[],b[M]=g):T!=="__proto__"&&(b[T]=g)}g=b}return g},h=function(d,_,E,S){if(d){var y=E.allowDots?d.replace(/\.([^.[]+)/g,"[$1]"):d,g=/(\[[^[\]]*])/,v=/(\[[^[\]]*])/g,b=E.depth>0&&g.exec(y),O=b?y.slice(0,b.index):y,j=[];if(O){if(!E.plainObjects&&r.call(Object.prototype,O)&&!E.allowPrototypes)return;j.push(O)}for(var T=0;E.depth>0&&(b=v.exec(y))!==null&&T<E.depth;){if(T+=1,!E.plainObjects&&r.call(Object.prototype,b[1].slice(1,-1))&&!E.allowPrototypes)return;j.push(b[1])}if(b){if(E.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+E.depth+" and strictDepth is true");j.push("["+y.slice(b.index)+"]")}return c(j,_,E,S)}},p=function(d){if(!d)return n;if(typeof d.allowEmptyArrays<"u"&&typeof d.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof d.decodeDotInKeys<"u"&&typeof d.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(d.decoder!==null&&typeof d.decoder<"u"&&typeof d.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof d.charset<"u"&&d.charset!=="utf-8"&&d.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof d.throwOnLimitExceeded<"u"&&typeof d.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var _=typeof d.charset>"u"?n.charset:d.charset,E=typeof d.duplicates>"u"?n.duplicates:d.duplicates;if(E!=="combine"&&E!=="first"&&E!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var S=typeof d.allowDots>"u"?d.decodeDotInKeys===!0?!0:n.allowDots:!!d.allowDots;return{allowDots:S,allowEmptyArrays:typeof d.allowEmptyArrays=="boolean"?!!d.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof d.allowPrototypes=="boolean"?d.allowPrototypes:n.allowPrototypes,allowSparse:typeof d.allowSparse=="boolean"?d.allowSparse:n.allowSparse,arrayLimit:typeof d.arrayLimit=="number"?d.arrayLimit:n.arrayLimit,charset:_,charsetSentinel:typeof d.charsetSentinel=="boolean"?d.charsetSentinel:n.charsetSentinel,comma:typeof d.comma=="boolean"?d.comma:n.comma,decodeDotInKeys:typeof d.decodeDotInKeys=="boolean"?d.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof d.decoder=="function"?d.decoder:n.decoder,delimiter:typeof d.delimiter=="string"||e.isRegExp(d.delimiter)?d.delimiter:n.delimiter,depth:typeof d.depth=="number"||d.depth===!1?+d.depth:n.depth,duplicates:E,ignoreQueryPrefix:d.ignoreQueryPrefix===!0,interpretNumericEntities:typeof d.interpretNumericEntities=="boolean"?d.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof d.parameterLimit=="number"?d.parameterLimit:n.parameterLimit,parseArrays:d.parseArrays!==!1,plainObjects:typeof d.plainObjects=="boolean"?d.plainObjects:n.plainObjects,strictDepth:typeof d.strictDepth=="boolean"?!!d.strictDepth:n.strictDepth,strictNullHandling:typeof d.strictNullHandling=="boolean"?d.strictNullHandling:n.strictNullHandling,throwOnLimitExceeded:typeof d.throwOnLimitExceeded=="boolean"?d.throwOnLimitExceeded:!1}};return dv=function(w,d){var _=p(d);if(w===""||w===null||typeof w>"u")return _.plainObjects?{__proto__:null}:{};for(var E=typeof w=="string"?u(w,_):w,S=_.plainObjects?{__proto__:null}:{},y=Object.keys(E),g=0;g<y.length;++g){var v=y[g],b=h(v,E[v],_,typeof w=="string");S=e.merge(S,b,_)}return _.allowSparse===!0?S:e.compact(S)},dv}var pv,L3;function pC(){if(L3)return pv;L3=1;var e=hC(),r=dC(),t=Am();return pv={formats:t,parse:r,stringify:e},pv}var N3;function K8(){if(N3)return wf;N3=1;var e=IA();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),l=["'"].concat(o),u=["%","/","?",";","#"].concat(l),c=["/","?","#"],h=255,p=/^[+a-z0-9A-Z_-]{0,63}$/,w=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,d={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},S=pC();function y(O,j,T){if(O&&typeof O=="object"&&O instanceof r)return O;var M=new r;return M.parse(O,j,T),M}r.prototype.parse=function(O,j,T){if(typeof O!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof O);var M=O.indexOf("?"),F=M!==-1&&M<O.indexOf("#")?"?":"#",C=O.split(F),x=/\\/g;C[0]=C[0].replace(x,"/"),O=C.join(F);var L=O;if(L=L.trim(),!T&&O.split("#").length===1){var A=a.exec(L);if(A)return this.path=L,this.href=L,this.pathname=A[1],A[2]?(this.search=A[2],j?this.query=S.parse(this.search.substr(1)):this.query=this.search.substr(1)):j&&(this.search="",this.query={}),this}var N=t.exec(L);if(N){N=N[0];var I=N.toLowerCase();this.protocol=I,L=L.substr(N.length)}if(T||N||L.match(/^\/\/[^@/]+@[^@/]+/)){var W=L.substr(0,2)==="//";W&&!(N&&_[N])&&(L=L.substr(2),this.slashes=!0)}if(!_[N]&&(W||N&&!E[N])){for(var G=-1,$=0;$<c.length;$++){var J=L.indexOf(c[$]);J!==-1&&(G===-1||J<G)&&(G=J)}var V,H;G===-1?H=L.lastIndexOf("@"):H=L.lastIndexOf("@",G),H!==-1&&(V=L.slice(0,H),L=L.slice(H+1),this.auth=decodeURIComponent(V)),G=-1;for(var $=0;$<u.length;$++){var J=L.indexOf(u[$]);J!==-1&&(G===-1||J<G)&&(G=J)}G===-1&&(G=L.length),this.host=L.slice(0,G),L=L.slice(G),this.parseHost(),this.hostname=this.hostname||"";var z=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!z)for(var D=this.hostname.split(/\./),$=0,K=D.length;$<K;$++){var ne=D[$];if(ne&&!ne.match(p)){for(var Z="",ee=0,ae=ne.length;ee<ae;ee++)ne.charCodeAt(ee)>127?Z+="x":Z+=ne[ee];if(!Z.match(p)){var se=D.slice(0,$),ce=D.slice($+1),me=ne.match(w);me&&(se.push(me[1]),ce.unshift(me[2])),ce.length&&(L="/"+ce.join(".")+L),this.hostname=se.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),z||(this.hostname=e.toASCII(this.hostname));var xe=this.port?":"+this.port:"",Oe=this.hostname||"";this.host=Oe+xe,this.href+=this.host,z&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),L[0]!=="/"&&(L="/"+L))}if(!d[I])for(var $=0,K=l.length;$<K;$++){var Re=l[$];if(L.indexOf(Re)!==-1){var Se=encodeURIComponent(Re);Se===Re&&(Se=escape(Re)),L=L.split(Re).join(Se)}}var ve=L.indexOf("#");ve!==-1&&(this.hash=L.substr(ve),L=L.slice(0,ve));var He=L.indexOf("?");if(He!==-1?(this.search=L.substr(He),this.query=L.substr(He+1),j&&(this.query=S.parse(this.query)),L=L.slice(0,He)):j&&(this.search="",this.query={}),L&&(this.pathname=L),E[I]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var xe=this.pathname||"",we=this.search||"";this.path=xe+we}return this.href=this.format(),this};function g(O){return typeof O=="string"&&(O=y(O)),O instanceof r?O.format():r.prototype.format.call(O)}r.prototype.format=function(){var O=this.auth||"";O&&(O=encodeURIComponent(O),O=O.replace(/%3A/i,":"),O+="@");var j=this.protocol||"",T=this.pathname||"",M=this.hash||"",F=!1,C="";this.host?F=O+this.host:this.hostname&&(F=O+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(F+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(C=S.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var x=this.search||C&&"?"+C||"";return j&&j.substr(-1)!==":"&&(j+=":"),this.slashes||(!j||E[j])&&F!==!1?(F="//"+(F||""),T&&T.charAt(0)!=="/"&&(T="/"+T)):F||(F=""),M&&M.charAt(0)!=="#"&&(M="#"+M),x&&x.charAt(0)!=="?"&&(x="?"+x),T=T.replace(/[?#]/g,function(L){return encodeURIComponent(L)}),x=x.replace("#","%23"),j+F+T+x+M};function v(O,j){return y(O,!1,!0).resolve(j)}r.prototype.resolve=function(O){return this.resolveObject(y(O,!1,!0)).format()};function b(O,j){return O?y(O,!1,!0).resolveObject(j):j}return r.prototype.resolveObject=function(O){if(typeof O=="string"){var j=new r;j.parse(O,!1,!0),O=j}for(var T=new r,M=Object.keys(this),F=0;F<M.length;F++){var C=M[F];T[C]=this[C]}if(T.hash=O.hash,O.href==="")return T.href=T.format(),T;if(O.slashes&&!O.protocol){for(var x=Object.keys(O),L=0;L<x.length;L++){var A=x[L];A!=="protocol"&&(T[A]=O[A])}return E[T.protocol]&&T.hostname&&!T.pathname&&(T.pathname="/",T.path=T.pathname),T.href=T.format(),T}if(O.protocol&&O.protocol!==T.protocol){if(!E[O.protocol]){for(var N=Object.keys(O),I=0;I<N.length;I++){var W=N[I];T[W]=O[W]}return T.href=T.format(),T}if(T.protocol=O.protocol,!O.host&&!_[O.protocol]){for(var K=(O.pathname||"").split("/");K.length&&!(O.host=K.shift()););O.host||(O.host=""),O.hostname||(O.hostname=""),K[0]!==""&&K.unshift(""),K.length<2&&K.unshift(""),T.pathname=K.join("/")}else T.pathname=O.pathname;if(T.search=O.search,T.query=O.query,T.host=O.host||"",T.auth=O.auth,T.hostname=O.hostname||O.host,T.port=O.port,T.pathname||T.search){var G=T.pathname||"",$=T.search||"";T.path=G+$}return T.slashes=T.slashes||O.slashes,T.href=T.format(),T}var J=T.pathname&&T.pathname.charAt(0)==="/",V=O.host||O.pathname&&O.pathname.charAt(0)==="/",H=V||J||T.host&&O.pathname,z=H,D=T.pathname&&T.pathname.split("/")||[],K=O.pathname&&O.pathname.split("/")||[],ne=T.protocol&&!E[T.protocol];if(ne&&(T.hostname="",T.port=null,T.host&&(D[0]===""?D[0]=T.host:D.unshift(T.host)),T.host="",O.protocol&&(O.hostname=null,O.port=null,O.host&&(K[0]===""?K[0]=O.host:K.unshift(O.host)),O.host=null),H=H&&(K[0]===""||D[0]==="")),V)T.host=O.host||O.host===""?O.host:T.host,T.hostname=O.hostname||O.hostname===""?O.hostname:T.hostname,T.search=O.search,T.query=O.query,D=K;else if(K.length)D||(D=[]),D.pop(),D=D.concat(K),T.search=O.search,T.query=O.query;else if(O.search!=null){if(ne){T.host=D.shift(),T.hostname=T.host;var Z=T.host&&T.host.indexOf("@")>0?T.host.split("@"):!1;Z&&(T.auth=Z.shift(),T.hostname=Z.shift(),T.host=T.hostname)}return T.search=O.search,T.query=O.query,(T.pathname!==null||T.search!==null)&&(T.path=(T.pathname?T.pathname:"")+(T.search?T.search:"")),T.href=T.format(),T}if(!D.length)return T.pathname=null,T.search?T.path="/"+T.search:T.path=null,T.href=T.format(),T;for(var ee=D.slice(-1)[0],ae=(T.host||O.host||D.length>1)&&(ee==="."||ee==="..")||ee==="",se=0,ce=D.length;ce>=0;ce--)ee=D[ce],ee==="."?D.splice(ce,1):ee===".."?(D.splice(ce,1),se++):se&&(D.splice(ce,1),se--);if(!H&&!z)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(ne){T.hostname=me?"":D.length?D.shift():"",T.host=T.hostname;var Z=T.host&&T.host.indexOf("@")>0?T.host.split("@"):!1;Z&&(T.auth=Z.shift(),T.hostname=Z.shift(),T.host=T.hostname)}return H=H||T.host&&D.length,H&&!me&&D.unshift(""),D.length>0?T.pathname=D.join("/"):(T.pathname=null,T.path=null),(T.pathname!==null||T.search!==null)&&(T.path=(T.pathname?T.pathname:"")+(T.search?T.search:"")),T.auth=O.auth||T.auth,T.slashes=T.slashes||O.slashes,T.href=T.format(),T},r.prototype.parseHost=function(){var O=this.host,j=n.exec(O);j&&(j=j[0],j!==":"&&(this.port=j.substr(1)),O=O.substr(0,O.length-j.length)),O&&(this.hostname=O)},wf.parse=y,wf.resolve=v,wf.resolveObject=b,wf.format=g,wf.Url=r,wf}var w1={exports:{}},gC=w1.exports,T3;function vC(){return T3||(T3=1,function(e){(function(r,t){e.exports?e.exports=t():r.xmlserializer=t()})(gC,function(){var r=function(d){return d.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},t=function(d){return d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},n=function(d){return d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},a=function(d){var _=d.value;return" "+d.name+'="'+t(_)+'"'},i=function(d){var _=d.tagName;return d.namespaceURI==="http://www.w3.org/1999/xhtml"&&(_=_.toLowerCase()),_},o=function(d,_){var E=Array.prototype.map.call(d.attributes||d.attrs,function(S){return S.name}).indexOf("xmlns")>=0;return!E&&(_||d.namespaceURI!==d.parentNode.namespaceURI)?' xmlns="'+d.namespaceURI+'"':""},l=function(d){return Array.prototype.map.call(d.childNodes,function(_){return w(_)}).join("")},u=function(d,_){var E="<"+i(d);return E+=o(d,_),Array.prototype.forEach.call(d.attributes||d.attrs,function(S){E+=a(S)}),d.childNodes.length>0?(E+=">",E+=l(d),E+="</"+i(d)+">"):E+="/>",E},c=function(d){var _=d.nodeValue||d.value||"";return n(_)},h=function(d){return"<!--"+d.data.replace(/-/g,"-")+"-->"},p=function(d){return"<![CDATA["+d.nodeValue+"]]>"},w=function(d,_){var E=_&&_.rootNode;if(d.nodeName==="#document"||d.nodeName==="#document-fragment")return l(d);if(d.tagName)return u(d,E);if(d.nodeName==="#text")return c(d);if(d.nodeName==="#comment")return h(d);if(d.nodeName==="#cdata-section")return p(d)};return{serializeToString:function(d){return r(w(d,{rootNode:!0}))}}})}(w1)),w1.exports}var gv={},R3;function mC(){if(R3)return gv;R3=1;var e=function(i){var o=new XMLSerializer;return Array.prototype.map.call(i.childNodes,function(l){return o.serializeToString(l)}).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),l,u;for(l=0;l<t.length;l++)if(u=t[l].exec(o),u)return u[1]},a=function(i){var o;if(i===null)throw new Error("Parse error");var l=r(i);if(l!==void 0)throw o=n(l)||"Parse error",new Error(o)};return gv.failOnParseError=function(i){return a(i),i},gv}var vv={},mv={},M3;function l0(){return M3||(M3=1,function(e){var r=K8();e.getDocumentBaseUrl=function(l){return l.baseURI!=="about:blank"?l.baseURI:null},e.clone=function(l){var u={},c;for(c in l)l.hasOwnProperty(c)&&(u[c]=l[c]);return u},e.cloneArray=function(l){return Array.prototype.slice.apply(l,[0])},e.joinUrl=function(l,u){return l?r.resolve(l,u):u},e.isDataUri=function(l){return/^data:/.test(l)},e.collectAndReportErrors=function(l){var u=[];return Promise.all(l.map(function(c){return c.catch(function(h){u.push(h)})})).then(function(){return u})};var t=null,n=function(l,u){return u===!1||u==="none"||u==="repeated"?((t===null||u!=="repeated")&&(t=Date.now()),l+"?_="+t):l};e.ajax=function(l,u){return new Promise(function(c,h){var p=new window.XMLHttpRequest,w=e.joinUrl(u.baseUrl,l),d,_=function(){h({msg:"Unable to load url",url:w})};d=n(w,u.cache),p.addEventListener("load",function(){p.status===200||p.status===0?c(p.response):_()},!1),p.addEventListener("error",_,!1);try{p.open("GET",d,!0),p.overrideMimeType(u.mimeType),p.send(null)}catch{_()}})},e.binaryAjax=function(l,u){var c=e.clone(u);return c.mimeType="text/plain; charset=x-user-defined",e.ajax(l,c).then(function(h){for(var p="",w=0;w<h.length;w++)p+=String.fromCharCode(h.charCodeAt(w)&255);return p})};var a=function(l){var u=function(c,h){return c.substring(0,h.length)===h};return u(l,"<?xml")||u(l,"<svg")?"image/svg+xml":"image/png"};e.getDataURIForImageURL=function(l,u){return e.binaryAjax(l,u).then(function(c){var h=btoa(c),p=a(c);return"data:"+p+";base64,"+h})};var i=[],o=function(l){return i.indexOf(l)<0&&i.push(l),i.indexOf(l)};e.memoize=function(l,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),w=o(l),d;return c[w]&&c[w][p]?c[w][p]:(d=l.apply(null,h),c[w]=c[w]||{},c[w][p]=d,d)}}}(mv)),mv}var yv={},I3;function yC(){if(I3)return yv;I3=1;var e=l0(),r=function(i,o){var l=null;i.hasAttribute("src")?l=i.getAttribute("src"):i.hasAttributeNS("http://www.w3.org/1999/xlink","href")?l=i.getAttributeNS("http://www.w3.org/1999/xlink","href"):i.hasAttribute("href")&&(l=i.getAttribute("href"));var u=e.getDocumentBaseUrl(i.ownerDocument),c=e.clone(o);return!c.baseUrl&&u&&(c.baseUrl=u),e.getDataURIForImageURL(l,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 l=null;return o.hasAttribute("src")?l=o.getAttribute("src"):o.hasAttributeNS("http://www.w3.org/1999/xlink","href")?l=o.getAttributeNS("http://www.w3.org/1999/xlink","href"):o.hasAttribute("href")&&(l=o.getAttribute("href")),l!==null&&!e.isDataUri(l)})},n=function(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 l=a(i.getElementsByTagName("img")),u=a(i.getElementsByTagName("image")),c=n(i.getElementsByTagName("input"));l=l.concat(u),l=l.concat(c);var h=t(l);return e.collectAndReportErrors(h.map(function(p){return r(p,o).then(function(w){p.attributes.src?p.attributes.src.value=w:p.attributes["xlink:href"]?p.attributes["xlink:href"].value=w:p.attributes.href&&(p.attributes.href.value=w)})}))},yv}var bv={},j3;function bC(){if(j3)return bv;j3=1;var e=l0(),r=function(i,o){var l=i.attributes.src.value,u=e.getDocumentBaseUrl(i.ownerDocument),c=e.clone(o);return!c.baseUrl&&u&&(c.baseUrl=u),e.ajax(l,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(l){return!!l.attributes.src})};return bv.inline=function(i,o){var l=a(i);return e.collectAndReportErrors(l.map(function(u){return r(u,o).then(function(c){n(u,c)})}))},bv}var wv={},_v={},F3;function Cm(){return F3||(F3=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={},D3;function wC(){return D3||(D3=1,function(e){var r=Cm(),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\(("[^"]+"|'[^']+'|[^\)]+)\)/,l;if(!o.test(i))throw new Error("Invalid url");return l=o.exec(i)[1],r.unquoteString(t(l))};var n=function(i){var o=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,l="(url\\("+o+"\\)|[^,\\s]+)",u="(?:\\s*"+l+")+",c="^\\s*("+u+")(?:\\s*,\\s*("+u+"))*\\s*$",h=new RegExp(u,"g"),p,w=[],d=function(_){var E=new RegExp(l,"g"),S=[],y;for(y=E.exec(_);y;)S.push(y[1]),y=E.exec(_);return S};if(i.match(new RegExp(c))){for(p=h.exec(i);p;)w.push(d(p[0])),p=h.exec(i);return w}return[]},a=function(i){var o,l;for(o=0;o<i.length;o++)try{return l=e.extractCssUrl(i[o]),{url:l,idx:o}}catch{}};e.parse=function(i){var o=n(i);return o.map(function(l){var u=a(l);return u?{preUrl:l.slice(0,u.idx),url:u.url,postUrl:l.slice(u.idx+1)}:{preUrl:l}})},e.serialize=function(i){var o=i.map(function(l){var u=[].concat(l.preUrl);return l.url&&u.push('url("'+l.url+'")'),l.postUrl&&(u=u.concat(l.postUrl)),u.join(" ")});return o.join(", ")}}(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:{}},B3;function _C(){return B3||(B3=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(l)return l(c,!0);var w=new Error("Cannot find module '"+c+"'");throw w.code="MODULE_NOT_FOUND",w}var d=a[c]={exports:{}};n[c][0].call(d.exports,function(_){var E=n[c][1][_];return o(E||_)},d,d.exports,t,n,a,i)}return a[c].exports}for(var l=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(y){return'"'+w(y.text)+'"'},class:function(y){var g="",v;for(v=0;v<y.parts.length;v++)g+=y.parts[v]instanceof Array?d(y.parts[v][0])+"-"+d(y.parts[v][1]):d(y.parts[v]);return"["+(y.inverted?"^":"")+g+"]"},any:function(y){return"any character"},end:function(y){return"end of input"},other:function(y){return y.description}};function p(y){return y.charCodeAt(0).toString(16).toUpperCase()}function w(y){return y.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(g){return"\\x0"+p(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+p(g)})}function d(y){return y.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(g){return"\\x0"+p(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+p(g)})}function _(y){return h[y.type](y)}function E(y){var g=new Array(y.length),v,b;for(v=0;v<y.length;v++)g[v]=_(y[v]);if(g.sort(),g.length>0){for(v=1,b=1;v<g.length;v++)g[v-1]!==g[v]&&(g[b]=g[v],b++);g.length=b}switch(g.length){case 1:return g[0];case 2:return g[0]+" or "+g[1];default:return g.slice(0,-1).join(", ")+", or "+g[g.length-1]}}function S(y){return y?'"'+w(y)+'"':"end of input"}return"Expected "+E(u)+" but "+S(c)+" found."};function l(u,c){c=c!==void 0?c:{};var h={},p={start:xe},w=xe,d="",_=function(){return[]},E=",",S=ne(",",!1),y=function(he,Le){return[he].concat(Le)},g=function(he){return[he]},v=function(he,Le){return{url:he,format:Le}},b=function(he){return{url:he}},O="url(",j=ne("url(",!1),T=")",M=ne(")",!1),F=function(he){return he},C="format(",x=ne("format(",!1),L="local(",A=ne("local(",!1),N=function(he){return{local:he}},I=/^[^)]/,W=Z([")"],!0,!1),G=function(he){return Ne.extractValue(he.join(""))},$=/^[ \t\r\n\f]/,J=Z([" "," ","\r",`
|
|
155
|
-
`,"\f"],!1,!1),V=0,H=[{line:1,column:1}],z=0,D=[],K;if("startRule"in c){if(!(c.startRule in p))throw new Error(`Can't start parsing from rule "`+c.startRule+'".');w=p[c.startRule]}function ne(he,Le){return{type:"literal",text:he,ignoreCase:Le}}function Z(he,Le,Ce){return{type:"class",parts:he,inverted:Le,ignoreCase:Ce}}function ee(){return{type:"end"}}function ae(he){var Le=H[he],Ce;if(Le)return Le;for(Ce=he-1;!H[Ce];)Ce--;for(Le=H[Ce],Le={line:Le.line,column:Le.column};Ce<he;)u.charCodeAt(Ce)===10?(Le.line++,Le.column=1):Le.column++,Ce++;return H[he]=Le,Le}function se(he,Le){var Ce=ae(he),De=ae(Le);return{start:{offset:he,line:Ce.line,column:Ce.column},end:{offset:Le,line:De.line,column:De.column}}}function ce(he){V<z||(V>z&&(z=V,D=[]),D.push(he))}function me(he,Le,Ce){return new o(o.buildMessage(he,Le),he,Le,Ce)}function xe(){var he,Le;return he=Oe(),he===h&&(he=V,Le=d,Le!==h&&(Le=_()),he=Le),he}function Oe(){var he,Le,Ce,De,tt,vt;if(he=V,Le=Re(),Le!==h){for(Ce=[],De=Ee();De!==h;)Ce.push(De),De=Ee();if(Ce!==h)if(u.charCodeAt(V)===44?(De=E,V++):(De=h,ce(S)),De!==h){for(tt=[],vt=Ee();vt!==h;)tt.push(vt),vt=Ee();tt!==h?(vt=Oe(),vt!==h?(Le=y(Le,vt),he=Le):(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,Le=Re(),Le!==h&&(Le=g(Le)),he=Le),he}function Re(){var he;return he=Se(),he===h&&(he=we()),he}function Se(){var he,Le,Ce,De;if(he=V,Le=ve(),Le!==h){if(Ce=[],De=Ee(),De!==h)for(;De!==h;)Ce.push(De),De=Ee();else Ce=h;Ce!==h?(De=He(),De!==h?(Le=v(Le,De),he=Le):(V=he,he=h)):(V=he,he=h)}else V=he,he=h;return he===h&&(he=V,Le=ve(),Le!==h&&(Le=b(Le)),he=Le),he}function ve(){var he,Le,Ce,De;return he=V,u.substr(V,4)===O?(Le=O,V+=4):(Le=h,ce(j)),Le!==h?(Ce=Ae(),Ce!==h?(u.charCodeAt(V)===41?(De=T,V++):(De=h,ce(M)),De!==h?(Le=F(Ce),he=Le):(V=he,he=h)):(V=he,he=h)):(V=he,he=h),he}function He(){var he,Le,Ce,De;return he=V,u.substr(V,7)===C?(Le=C,V+=7):(Le=h,ce(x)),Le!==h?(Ce=Ae(),Ce!==h?(u.charCodeAt(V)===41?(De=T,V++):(De=h,ce(M)),De!==h?(Le=F(Ce),he=Le):(V=he,he=h)):(V=he,he=h)):(V=he,he=h),he}function we(){var he,Le,Ce,De;return he=V,u.substr(V,6)===L?(Le=L,V+=6):(Le=h,ce(A)),Le!==h?(Ce=Ae(),Ce!==h?(u.charCodeAt(V)===41?(De=T,V++):(De=h,ce(M)),De!==h?(Le=N(Ce),he=Le):(V=he,he=h)):(V=he,he=h)):(V=he,he=h),he}function Ae(){var he,Le,Ce;if(he=V,Le=[],I.test(u.charAt(V))?(Ce=u.charAt(V),V++):(Ce=h,ce(W)),Ce!==h)for(;Ce!==h;)Le.push(Ce),I.test(u.charAt(V))?(Ce=u.charAt(V),V++):(Ce=h,ce(W));else Le=h;return Le!==h&&(Le=G(Le)),he=Le,he}function Ee(){var he;return $.test(u.charAt(V))?(he=u.charAt(V),V++):(he=h,ce(J)),he}var Ne=t("../util");if(K=w(),K!==h&&V===u.length)return K;throw K!==h&&V<u.length&&ce(ee()),me(D,z<u.length?u.charAt(z):null,z<u.length?se(z,z+1):se(z,z))}n.exports={SyntaxError:o,parse:l}},{"../util":3}],2:[function(t,n,a){var i=t("./grammar");a.SyntaxError=function(o,l){this.message=o,this.offset=l},a.parse=function(o){try{return i.parse(o)}catch(l){throw new a.SyntaxError(l.message,l.offset)}},a.serialize=function(o){return o.map(function(l){var u;return l.url?(u='url("'+l.url+'")',l.format&&(u+=' format("'+l.format+'")')):u='local("'+l.local+'")',u}).join(", ")}},{"./grammar":1}],3:[function(t,n,a){var i=function(l){var u=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return l.replace(u,"$1")},o=function(l){var u=/^"(.*)"$/,c=/^'(.*)'$/;return u.test(l)?l.replace(u,"$1"):c.test(l)?l.replace(c,"$1"):l};a.extractValue=function(l){return o(i(l))}},{}]},{},[2])(2)})}(xv)),xv.exports}var q3;function SC(){return q3||(q3=1,function(e){var r=l0(),t=Cm(),n=wC(),a=_C(),i=function(g,v,b){g.style.setProperty(v,b,g.style.getPropertyPriority(v))},o=function(g){return g.filter(function(v){return v.type===window.CSSRule.STYLE_RULE&&(v.style.getPropertyValue("background-image")||v.style.getPropertyValue("background"))})},l=function(g){var v=[];return g.forEach(function(b){b.style.getPropertyValue("background-image")?v.push({property:"background-image",value:b.style.getPropertyValue("background-image"),rule:b}):b.style.getPropertyValue("background")&&v.push({property:"background",value:b.style.getPropertyValue("background"),rule:b})}),v},u=function(g){return g.filter(function(v){return v.type===window.CSSRule.FONT_FACE_RULE&&v.style.getPropertyValue("src")})},c=function(g){return g.filter(function(v){return v.type===window.CSSRule.IMPORT_RULE&&v.href})},h=function(g){var v=[];return g.forEach(function(b,O){b.url&&!r.isDataUri(b.url)&&v.push(O)}),v},p=function(g){var v=[];return g.forEach(function(b,O){b.url&&!r.isDataUri(b.url)&&v.push(O)}),v};e.adjustPathsOfCssResources=function(g,v){var b=o(v),O=l(b),j=!1;return O.forEach(function(T){var M=n.parse(T.value),F=h(M),C;F.length>0&&(F.forEach(function(x){var L=M[x].url,A=r.joinUrl(g,L);M[x].url=A}),C=n.serialize(M),i(T.rule,T.property,C),j=!0)}),u(v).forEach(function(T){var M=T.style.getPropertyValue("src"),F,C;try{F=a.parse(M)}catch{return}C=p(F),C.length>0&&(C.forEach(function(x){var L=F[x].url,A=r.joinUrl(g,L);F[x].url=A}),t.changeFontFaceRuleSrc(v,T,a.serialize(F)),j=!0)}),c(v).forEach(function(T){var M=T.href,F=r.joinUrl(g,M);t.exchangeRule(v,T,"@import url("+F+");"),j=!0}),j};var w=function(g,v,b){var O=g.indexOf(v);g.splice(O,1),b.forEach(function(j,T){g.splice(O+T,0,j)})},d=function(g,v,b,O){var j=v.href,T;return j=t.unquoteString(j),T=r.joinUrl(O.baseUrl,j),b.indexOf(T)>=0?(w(g,v,[]),Promise.resolve([])):(b.push(T),r.ajax(j,O).then(function(M){var F=t.rulesForCssText(M);return e.loadCSSImportsForRules(F,b,O).then(function(C){return e.adjustPathsOfCssResources(j,F),w(g,v,F),C.errors})},function(M){throw{resourceType:"stylesheet",url:M.url,msg:"Unable to load stylesheet "+M.url}}))};e.loadCSSImportsForRules=function(g,v,b){var O=c(g),j=[],T=!1;return Promise.all(O.map(function(M){return d(g,M,v,b).then(function(F){j=j.concat(F),T=!0},function(F){j.push(F)})})).then(function(){return{hasChanges:T,errors:j}})};var _=function(g,v){var b=n.parse(g),O=h(b),j=!1;return r.collectAndReportErrors(O.map(function(T){var M=b[T].url;return r.getDataURIForImageURL(M,v).then(function(F){b[T].url=F,j=!0},function(F){throw{resourceType:"backgroundImage",url:F.url,msg:"Unable to load background-image "+F.url}})})).then(function(T){return{backgroundValue:n.serialize(b),hasChanges:j,errors:T}})},E=function(g,v){var b=o(g),O=l(b),j=[],T=!1;return Promise.all(O.map(function(M){return _(M.value,v).then(function(F){F.hasChanges&&(i(M.rule,M.property,F.backgroundValue),T=!0),j=j.concat(F.errors)})})).then(function(){return{hasChanges:T,errors:j}})},S=function(g,v){var b=!1,O,j;try{O=a.parse(g)}catch{O=[]}return j=p(O),r.collectAndReportErrors(j.map(function(T){var M=O[T],F=M.format||"woff";return r.binaryAjax(M.url,v).then(function(C){var x=btoa(C);M.url="data:font/"+F+";base64,"+x,b=!0},function(C){throw{resourceType:"fontFace",url:C.url,msg:"Unable to load font-face "+C.url}})})).then(function(T){return{srcDeclarationValue:a.serialize(O),hasChanges:b,errors:T}})},y=function(g,v){var b=u(g),O=[],j=!1;return Promise.all(b.map(function(T){var M=T.style.getPropertyValue("src");return S(M,v).then(function(F){F.hasChanges&&(t.changeFontFaceRuleSrc(g,T,F.srcDeclarationValue),j=!0),O=O.concat(F.errors)})})).then(function(){return{hasChanges:j,errors:O}})};e.loadAndInlineCSSResourcesForRules=function(g,v){var b=!1,O=[];return Promise.all([E,y].map(function(j){return j(g,v).then(function(T){b=b||T.hasChanges,O=O.concat(T.errors)})})).then(function(){return{hasChanges:b,errors:O}})}}(wv)),wv}var z3;function xC(){return z3||(z3=1,function(e){var r=l0(),t=yC(),n=bC(),a=SC(),i=Cm(),o=function(S){return r.joinUrl(S,".")},l=function(S){var y=S.map(function(g,v){return v===S.length-1&&(g={baseUrl:o(g.baseUrl)}),JSON.stringify(g)});return y},u=function(S,y){return y.cache!==!1&&y.cache!=="none"&&y.cacheBucket?r.memoize(S,l,y.cacheBucket):S},c=function(S,y,g){var v=i.rulesForCssText(S);return a.loadCSSImportsForRules(v,y,g).then(function(b){return a.loadAndInlineCSSResourcesForRules(v,g).then(function(O){var j=b.errors.concat(O.errors),T=b.hasChanges||O.hasChanges;return T&&(S=i.cssRulesToText(v)),{hasChanges:T,content:S,errors:j}})})},h=function(S,y,g){var v=S.textContent,b=u(c,y);return b(v,g,y).then(function(O){return O.hasChanges&&(S.childNodes[0].nodeValue=O.content),r.cloneArray(O.errors)})},p=function(S){var y=S.getElementsByTagName("style");return Array.prototype.filter.call(y,function(g){return!g.attributes.type||g.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(S,y){var g=p(S),v=[],b=[],O;return O=r.clone(y),O.baseUrl=O.baseUrl||r.getDocumentBaseUrl(S),Promise.all(g.map(function(j){return h(j,O,b).then(function(T){v=v.concat(T)})})).then(function(){return v})};var w=function(S,y){var g=S.parentNode,v;y=y.trim(),y&&(v=S.ownerDocument.createElement("style"),v.type="text/css",v.appendChild(S.ownerDocument.createTextNode(y)),g.insertBefore(v,S)),g.removeChild(S)},d=function(S,y){return r.ajax(S,y).then(function(g){var v=i.rulesForCssText(g);return{content:g,cssRules:v}}).then(function(g){var v=a.adjustPathsOfCssResources(S,g.cssRules);return{content:g.content,cssRules:g.cssRules,hasChanges:v}}).then(function(g){return a.loadCSSImportsForRules(g.cssRules,[],y).then(function(v){return{content:g.content,cssRules:g.cssRules,hasChanges:g.hasChanges||v.hasChanges,errors:v.errors}})}).then(function(g){return a.loadAndInlineCSSResourcesForRules(g.cssRules,y).then(function(v){return{content:g.content,cssRules:g.cssRules,hasChanges:g.hasChanges||v.hasChanges,errors:g.errors.concat(v.errors)}})}).then(function(g){var v=g.content;return g.hasChanges&&(v=i.cssRulesToText(g.cssRules)),{content:v,errors:g.errors}})},_=function(S,y){var g=S.attributes.href.value,v=r.getDocumentBaseUrl(S.ownerDocument),b=r.clone(y);!b.baseUrl&&v&&(b.baseUrl=v);var O=u(d,y);return O(g,b).then(function(j){return{content:j.content,errors:r.cloneArray(j.errors)}})},E=function(S){var y=S.getElementsByTagName("link");return Array.prototype.filter.call(y,function(g){return g.attributes.rel&&g.attributes.rel.value==="stylesheet"&&(!g.attributes.type||g.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(S,y){var g=E(S),v=[];return Promise.all(g.map(function(b){return _(b,y).then(function(O){w(b,O.content+`
|
|
156
|
-
`),v=v.concat(O.errors)},function(O){v.push({resourceType:"stylesheet",url:O.url,msg:"Unable to load stylesheet "+O.url})})})).then(function(){return v})},e.loadAndInlineImages=t.inline,e.loadAndInlineScript=n.inline,e.inlineReferences=function(S,y){var g=[],v=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return y.inlineScripts!==!1&&v.push(e.loadAndInlineScript),Promise.all(v.map(function(b){return b(S,y).then(function(O){g=g.concat(O)})})).then(function(){return g})}}(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 EC=b1.exports,U3;function PC(){return U3||(U3=1,function(e){(function(r,t){r===void 0&&window!==void 0&&(r=window),e.exports?e.exports=t(K8(),vC(),mC(),xC()):r.rasterizeHTML=t(r.url,r.xmlserializer,r.sanedomparsererror,r.inlineresources)})(EC,function(r,t,n,a){var i=function(_){var E={},S=[];E.joinUrl=function(v,b){return v?_.resolve(v,b):b},E.getConstantUniqueIdFor=function(v){return S.indexOf(v)<0&&S.push(v),S.indexOf(v)},E.clone=function(v){var b={},O;for(O in v)v.hasOwnProperty(O)&&(b[O]=v[O]);return b};var y=function(v){return typeof v=="object"&&v!==null},g=function(v){return y(v)&&Object.prototype.toString.apply(v).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return E.parseOptionalParameters=function(v){var b={canvas:null,options:{}};return v[0]==null||g(v[0])?(b.canvas=v[0]||null,b.options=E.clone(v[1])):b.options=E.clone(v[0]),b},E}(r),o=function(_){var E={},S=function(y,g,v){var b=y[g];return y[g]=function(){var O=Array.prototype.slice.call(arguments);return v.apply(this,[O,b])},b};return E.baseUrlRespectingXhr=function(y,g){var v=function(){var b=new y;return S(b,"open",function(O,j){var T=O.shift(),M=O.shift(),F=_.joinUrl(g,M);return j.apply(this,[T,F].concat(O))}),b};return v},E.finishNotifyingXhr=function(y){var g=0,v=0,b=!1,O,j=new Promise(function(M){O=function(){var F=g-v;F<=0&&b&&M({totalCount:g})}}),T=function(){var M=new y;return S(M,"send",function(F,C){return g+=1,C.apply(this,arguments)}),M.addEventListener("load",function(){v+=1,O()}),M};return T.waitForRequestsToFinish=function(){return b=!0,O(),j},T},E}(i),l=function(){var _={},E=function(T){return Array.prototype.slice.call(T)};_.addClassName=function(T,M){T.className+=" "+M},_.addClassNameRecursively=function(T,M){_.addClassName(T,M),T.parentNode!==T.ownerDocument&&_.addClassNameRecursively(T.parentNode,M)};var S=function(T,M){var F=T.parentStyleSheet,C=E(F.cssRules).indexOf(T);F.insertRule(M,C+1),F.deleteRule(C)},y=function(T,M){var F=T.cssText.replace(/^[^\{]+/,""),C=M+" "+F;S(T,C)},g=function(T){return E(T).reduce(function(M,F){return M+F.cssText},"")},v=function(T){T.textContent=g(T.sheet.cssRules)},b=function(T){var M=document.implementation.createHTMLDocument(""),F=document.createElement("style");F.textContent=T.textContent,M.body.appendChild(F),T.sheet=F.sheet},O=function(T){return"((?:^|[^.#:\\w])|(?=\\W))("+T.join("|")+")(?=\\W|$)"},j=function(T,M,F){var C=O(M);E(T.querySelectorAll("style")).forEach(function(x){typeof x.sheet>"u"&&b(x);var L=E(x.sheet.cssRules).filter(function(A){return A.selectorText&&new RegExp(C,"i").test(A.selectorText)});L.length&&(L.forEach(function(A){var N=A.selectorText.replace(new RegExp(C,"gi"),function(I,W,G){return W+F(G)});N!==A.selectorText&&y(A,N)}),v(x))})};return _.rewriteCssSelectorWith=function(T,M,F){j(T,[M],function(){return F})},_.lowercaseCssTypeSelectors=function(T,M){j(T,M,function(F){return F.toLowerCase()})},_.findHtmlOnlyNodeNames=function(T){var M=T.ownerDocument.createTreeWalker(T,NodeFilter.SHOW_ELEMENT),F={},C={},x;do x=M.currentNode.tagName.toLowerCase(),M.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?F[x]=!0:C[x]=!0;while(M.nextNode());return Object.keys(F).filter(function(L){return!C[L]})},_}(),u=function(_){var E={},S=function(g){return Array.prototype.slice.call(g)},y={active:!0,hover:!0,focus:!1,target:!1};return E.fakeUserAction=function(g,v,b){var O=g.querySelector(v),j=":"+b,T="rasterizehtml"+b;O&&(y[b]?_.addClassNameRecursively(O,T):_.addClassName(O,T),_.rewriteCssSelectorWith(g,j,"."+T))},E.persistInputValues=function(g){var v=g.querySelectorAll("input"),b=g.querySelectorAll("textarea"),O=function(j){return j.type==="checkbox"||j.type==="radio"};S(v).filter(O).forEach(function(j){j.checked?j.setAttribute("checked",""):j.removeAttribute("checked")}),S(v).filter(function(j){return!O(j)}).forEach(function(j){j.setAttribute("value",j.value)}),S(b).forEach(function(j){j.textContent=j.value})},E.rewriteTagNameSelectorsToLowerCase=function(g){_.lowercaseCssTypeSelectors(g,_.findHtmlOnlyNodeNames(g))},E}(l),c=function(_,E,S,y){var g={},v=function(G,$,J,V){var H=G.createElement($);return H.style.visibility="hidden",H.style.width=J+"px",H.style.height=V+"px",H.style.position="absolute",H.style.top=-1e4-V+"px",H.style.left=-1e4-J+"px",G.getElementsByTagName("body")[0].appendChild(H),H},b=function(G){return G>0?new Promise(function($){setTimeout($,G)}):Promise.resolve()};g.executeJavascript=function(G,$){return new Promise(function(J){var V=v(y.document,"iframe",$.width,$.height),H=G.outerHTML,z=[],D=$.executeJsTimeout||0,K=function(){y.document.getElementsByTagName("body")[0].removeChild(V)},ne=function(){var se=V.contentDocument;J({document:se,errors:z,cleanUp:K})},Z=V.contentWindow.XMLHttpRequest,ee=E.finishNotifyingXhr(Z),ae=E.baseUrlRespectingXhr(ee,$.baseUrl);V.onload=function(){b(D).then(ee.waitForRequestsToFinish).then(ne)},V.contentDocument.open(),V.contentWindow.XMLHttpRequest=ae,V.contentWindow.onerror=function(se){z.push({resourceType:"scriptExecution",msg:se})},V.contentDocument.write("<!DOCTYPE html>"),V.contentDocument.write(H),V.contentDocument.close()})};var O=function(G,$,J){var V=G.createElement("iframe");return V.style.width=$+"px",V.style.height=J+"px",V.style.visibility="hidden",V.style.position="absolute",V.style.top=-1e4-J+"px",V.style.left=-1e4-$+"px",V.style.borderWidth=0,V.sandbox="allow-same-origin",V.scrolling="no",V},j=function(G,$,J){var V=Math.floor(G/J),H=Math.floor($/J);return O(y.document,V,H)},T=function(G,$,J,V){return{width:Math.max(G.width*V,$),height:Math.max(G.height*V,J)}},M=function(G,$){var J=G.querySelector($);if(J)return J;if(G.ownerDocument.querySelector($)===G)return G;throw{message:"Clipping selector not found"}},F=function(G,$,J,V,H){var z=Math.max(G.scrollWidth,G.clientWidth),D=Math.max(G.scrollHeight,G.clientHeight),K,ne,Z,ee,ae,se,ce,me;return $?(se=M(G,$),ce=se.getBoundingClientRect(),K=ce.top,ne=ce.left,Z=ce.width,ee=ce.height):(K=0,ne=0,Z=z,ee=D),me=T({width:Z,height:ee},J,V,H),ae=y.getComputedStyle(G.ownerDocument.documentElement).fontSize,{left:ne,top:K,width:me.width,height:me.height,viewportWidth:z,viewportHeight:D,rootFontSize:ae}},C=function(G,$){var J=G.tagName;return $.querySelector(J)},x=function(G){var $=G.tagName.toLowerCase();return $==="html"||$==="body"?G.outerHTML:'<body style="margin: 0;">'+G.outerHTML+"</body>"};g.calculateDocumentContentSize=function(G,$){return new Promise(function(J,V){var H=$.zoom||1,z;z=j($.width,$.height,H),y.document.getElementsByTagName("body")[0].appendChild(z),z.onload=function(){var D=z.contentDocument,K;try{K=F(C(G,D),$.clip,$.width,$.height,H),J(K)}catch(ne){V(ne)}finally{y.document.getElementsByTagName("body")[0].removeChild(z)}},z.contentDocument.open(),z.contentDocument.write("<!DOCTYPE html>"),z.contentDocument.write(x(G)),z.contentDocument.close()})},g.parseHtmlFragment=function(G){var $=y.document.implementation.createHTMLDocument("");$.documentElement.innerHTML=G;var J=$.querySelector("body").firstChild;if(!J)throw"Invalid source";return J};var L=function(G,$){var J=/<html((?:\s+[^>]*)?)>/im.exec($),V=y.document.implementation.createHTMLDocument(""),H,z,D,K;if(J)for(H="<div"+J[1]+"></div>",V.documentElement.innerHTML=H,D=V.querySelector("div"),z=0;z<D.attributes.length;z++)K=D.attributes[z],G.documentElement.setAttribute(K.name,K.value)};g.parseHTML=function(G){var $=y.document.implementation.createHTMLDocument("");return $.documentElement.innerHTML=G,L($,G),$};var A=function(G){try{return S.failOnParseError(G)}catch($){throw{message:"Invalid source",originalError:$}}};g.validateXHTML=function(G){var $=new DOMParser,J=$.parseFromString(G,"application/xml");A(J)};var N=null,I=function(G,$){return $==="none"||$==="repeated"?((N===null||$!=="repeated")&&(N=Date.now()),G+"?_="+N):G},W=function(G,$){return new Promise(function(J,V){var H=new window.XMLHttpRequest,z=_.joinUrl($.baseUrl,G),D=I(z,$.cache),K=function(ne){V({message:"Unable to load page",originalError:ne})};H.addEventListener("load",function(){H.status===200||H.status===0?J(H.responseXML):K(H.statusText)},!1),H.addEventListener("error",function(ne){K(ne)},!1);try{H.open("GET",D,!0),H.responseType="document",H.send(null)}catch(ne){K(ne)}})};return g.loadDocument=function(G,$){return W(G,$).then(function(J){return A(J)})},g}(i,o,n,window),h=function(_){var E={},S=function(C,x){return x?URL.createObjectURL(new Blob([C],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(C)},y=function(C){C instanceof Blob&&URL.revokeObjectURL(C)},g='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',v=function(C){return new Promise(function(x,L){var A=document.createElement("canvas"),N=new Image;N.onload=function(){var I=A.getContext("2d");try{I.drawImage(N,0,0),A.toDataURL("image/png"),x(!0)}catch{x(!1)}},N.onerror=L,N.src=C})},b=function(){var C=S(g,!0);return v(C).then(function(x){return y(C),x?!1:v(S(g,!1)).then(function(L){return L})},function(){return!1})},O=function(){if(_.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},j=function(){return new Promise(function(C,x){O()&&_.URL?b().then(function(L){C(!L)},function(){x()}):C(!1)})},T,M=function(){return T===void 0&&(T=j()),T},F=function(C){return M().then(function(x){return S(C,x)})};return E.renderSvg=function(C){return new Promise(function(x,L){var A,N,I=function(){N.onload=null,N.onerror=null},W=function(){A&&y(A)};N=new Image,N.onload=function(){I(),W(),x(N)},N.onerror=function(){W(),L()},F(C).then(function(G){A=G,N.src=A},L)})},E}(window),p=function(_,E,S,y){var g={},v=function(C,x){var L=x||1,A={width:C.width,height:C.height,"font-size":C.rootFontSize};return L!==1&&(A.style="transform:scale("+L+"); transform-origin: 0 0;"),A},b=function(C){var x,L,A,N;x=Math.round(C.viewportWidth),L=Math.round(C.viewportHeight),A=-C.left,N=-C.top;var I={x:A,y:N,width:x,height:L};return I},O=function(C){var x=C.style||"";C.style=x+"float: left;"},j=function(C){C.externalResourcesRequired=!0},T=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},M=function(C){var x=Object.keys(C);return x.length?" "+x.map(function(L){return L+'="'+C[L]+'"'}).join(" "):""},F=function(C,x,L){var A=y.serializeToString(C);E.validateXHTML(A);var N=b(x);return O(N),j(N),'<svg xmlns="http://www.w3.org/2000/svg"'+M(v(x,L))+">"+T()+"<foreignObject"+M(N)+">"+A+"</foreignObject></svg>"};return g.getSvgForDocument=function(C,x,L){return S.rewriteTagNameSelectorsToLowerCase(C),F(C,x,L)},g.drawDocumentAsSvg=function(C,x){return["hover","active","focus","target"].forEach(function(L){x[L]&&S.fakeUserAction(C,x[L],L)}),E.calculateDocumentContentSize(C,x).then(function(L){return g.getSvgForDocument(C,L,x.zoom)})},g}(i,c,u,t),w=function(_,E,S,y,g,v){var b={},O=function(C){return{message:"Error rendering page",originalError:C}},j=function(C){return g.renderSvg(C).then(function(x){return{image:x,svg:C}},function(x){throw O(x)})},T=function(C,x){try{x.getContext("2d").drawImage(C,0,0)}catch(L){throw O(L)}},M=function(C,x,L){return y.drawDocumentAsSvg(C,L).then(j).then(function(A){return x&&T(A.image,x),A})},F=function(C,x){return E.executeJavascript(C,x).then(function(L){var A=L.document;return S.persistInputValues(A),{document:A,errors:L.errors,cleanUp:L.cleanUp}})};return b.rasterize=function(C,x,L){var A;return A=_.clone(L),A.inlineScripts=L.executeJs===!0,v.inlineReferences(C,A).then(function(N){return L.executeJs?F(C,L).then(function(I){return{element:I.document.documentElement,errors:N.concat(I.errors),cleanUp:I.cleanUp}}):{element:C,errors:N,cleanUp:function(){}}}).then(function(N){return M(N.element,x,L).then(function(I){return N.cleanUp(),{image:I.image,svg:I.svg,errors:N.errors}})})},b}(i,c,u,p,h,a),d=function(_,E,S){var y={},g=function(T,M){var F=300,C=200,x=T?T.width:F,L=T?T.height:C,A=M.width!==void 0?M.width:x,N=M.height!==void 0?M.height:L;return{width:A,height:N}},v=function(T){var M=g(T.canvas,T.options),F;return F=_.clone(T.options),F.width=M.width,F.height=M.height,F};y.drawDocument=function(){var T=arguments[0],M=Array.prototype.slice.call(arguments,1),F=_.parseOptionalParameters(M),C=T.documentElement?T.documentElement:T;return S.rasterize(C,F.canvas,v(F))};var b=function(T,M,F){var C=E.parseHTML(T);return y.drawDocument(C,M,F)};y.drawHTML=function(){var T=arguments[0],M=Array.prototype.slice.call(arguments,1),F=_.parseOptionalParameters(M);return b(T,F.canvas,F.options)};var O=function(T,M,F){var C=document.implementation.createHTMLDocument("");C.replaceChild(T.documentElement,C.documentElement);var x=F?_.clone(F):{};return F.baseUrl||(x.baseUrl=M),{document:C,options:x}},j=function(T,M,F){return E.loadDocument(T,F).then(function(C){var x=O(C,T,F);return y.drawDocument(x.document,M,x.options)})};return y.drawURL=function(){var T=arguments[0],M=Array.prototype.slice.call(arguments,1),F=_.parseOptionalParameters(M);return j(T,F.canvas,F.options)},y}(i,c,w);return d})}(b1)),b1.exports}var H3;function Z8(){return H3||(H3=1,function(e){var r,t=ic&&ic.__createBinding||(Object.create?function(S,y,g,v){v===void 0&&(v=g);var b=Object.getOwnPropertyDescriptor(y,g);b&&!("get"in b?!y.__esModule:b.writable||b.configurable)||(b={enumerable:!0,get:function(){return y[g]}}),Object.defineProperty(S,v,b)}:function(S,y,g,v){v===void 0&&(v=g),S[v]=y[g]}),n=ic&&ic.__setModuleDefault||(Object.create?function(S,y){Object.defineProperty(S,"default",{enumerable:!0,value:y})}:function(S,y){S.default=y}),a=ic&&ic.__importStar||(r=function(S){return r=Object.getOwnPropertyNames||function(y){var g=[];for(var v in y)Object.prototype.hasOwnProperty.call(y,v)&&(g[g.length]=v);return g},r(S)},function(S){if(S&&S.__esModule)return S;var y={};if(S!=null)for(var g=r(S),v=0;v<g.length;v++)g[v]!=="default"&&t(y,S,g[v]);return n(y,S),y});Object.defineProperty(e,"__esModule",{value:!0}),e.prerenderFont=e.resetStyleContent=void 0,e.isContentWrapping=function({html:S}){const y=document.createElement("div");y.innerHTML=S,y.style.display="inline-block",y.style.position="fixed",y.style.top="0px",y.style.left="0px",y.style.zIndex="1000",y.style.whiteSpace="nowrap",y.style.visibility="hidden";const g=h();g.appendChild(y);const v=y.textContent,b=y.childNodes[0],O=v.split(/\s+/);let j=!1;for(let T=0;T<O.length;T++){const M=O[T];if(b.textContent=M,j=b.scrollWidth>y.clientWidth,j)break}return g.removeChild(y),j},e.detectSize=function(S){S.indexOf("Avellino");const y=document.createElement("div");y.innerHTML=S,y.style.display="inline-block",y.style.position="fixed",y.style.top="0px",y.style.left="0px",y.style.zIndex="1000";const g=h();g.appendChild(y);const v=y.getBoundingClientRect();return g.removeChild(y),{width:v.width,height:v.height}},e.htmlToCanvas=async function({html:S,width:y,height:g,fontFamily:v,padding:b,font:O,pixelRatio:j}){if(v!=="Arial"&&!O){const C=(0,o.getGoogleFontsVariants)();S+=`<link type="text/css" href="https://fonts.googleapis.com/css?family=${v}:${C}" rel="stylesheet">`}if(O){const C=O.styles||(O.url?[{src:`url("${O.url}")`}]:E(v));S+="<style>",C.forEach(x=>{S+=`
|
|
159
|
-
@font-face {
|
|
160
|
-
font-family: '${v}';
|
|
161
|
-
src: ${x.src};
|
|
162
|
-
font-style: ${x.fontStyle||"normal"};
|
|
163
|
-
font-weight: ${x.fontWeight||"normal"};
|
|
164
|
-
}
|
|
165
|
-
`}),S+="</style>"}S+=u;const T=document.createElement("canvas"),M=await i.drawHTML(`<div style="padding: ${b}px;" dir="auto">${S}</div>`,T,{width:y+2*b,height:g+2*b,cacheBucket:d});(0,l.trySetCanvasSize)(T,(y+2*b)*j,(g+2*b)*j);const F=T.getContext("2d");return F==null||F.drawImage(M.image,0,0,T.width,T.height),T};const i=a(PC()),o=Op(),l=q8();e.resetStyleContent=`
|
|
166
|
-
p {
|
|
167
|
-
margin: 0;
|
|
168
|
-
padding: 0;
|
|
169
|
-
word-wrap: break-word; /* Required for Firefox */
|
|
170
|
-
/* a text may have several spaces, we need to preserve them */
|
|
171
|
-
white-space: pre-wrap;
|
|
172
|
-
}
|
|
173
|
-
ul, ol {
|
|
174
|
-
list-style-position: outside;
|
|
175
|
-
margin: 0;
|
|
176
|
-
padding: 0;
|
|
177
|
-
display: inline-block;
|
|
178
|
-
width: 100%;
|
|
179
|
-
text-decoration: inherit;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/*
|
|
183
|
-
* List item styles using CSS logical properties that automatically adapt to text direction
|
|
184
|
-
* - padding-inline-start/end: Padding at the start/end of text flow (left in LTR, right in RTL)
|
|
185
|
-
* - margin-inline-start/end: Margin at the start/end of text flow (left in LTR, right in RTL)
|
|
186
|
-
* These properties automatically flip based on the text direction (dir attribute)
|
|
187
|
-
* without requiring separate RTL/LTR selectors
|
|
188
|
-
*/
|
|
189
|
-
li {
|
|
190
|
-
padding-inline-start: 0.5em;
|
|
191
|
-
margin-inline-start: 1.7em;
|
|
192
|
-
margin-inline-end: 0;
|
|
193
|
-
padding-inline-end: 0;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/* Add resets */
|
|
197
|
-
ul {
|
|
198
|
-
list-style-type: disc;
|
|
199
|
-
}
|
|
200
|
-
ol {
|
|
201
|
-
list-style-type: decimal;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
`;const u=`
|
|
205
|
-
<style>
|
|
206
|
-
html, body {
|
|
207
|
-
padding: 0;
|
|
208
|
-
margin: 0;
|
|
209
|
-
}
|
|
210
|
-
${e.resetStyleContent}
|
|
211
|
-
</style>
|
|
212
|
-
`;let c;const h=()=>(c||(c=document.createElement("div"),c.id="polotno-hidden-do-not-touch",c.style.overflow="hidden",c.style.position="relative",document.body.appendChild(c),c.innerHTML=`<style>#polotno-hidden-do-not-touch {${e.resetStyleContent}}</style>`),c),p=new Map,w=navigator.userAgent.includes("Firefox");e.prerenderFont=async S=>{if(p.has(S))return p.get(S);const y=(async()=>{const g=`<div style="font-family: ${S}; font-size: 100px;">${S}<strong>${S}</strong></div>`,v=document.createElement("div");v.innerHTML=g,v.style.visibility="hidden",v.style.position="absolute";const b=h();b.appendChild(v);const O=w?180:50;await new Promise(j=>setTimeout(j,O)),b.removeChild(v)})();return p.set(S,y),y};const d={},_={},E=S=>{if(_[S])return _[S];const y=function(v){const b=[];for(const O of document.styleSheets)try{for(const j of O.cssRules)j instanceof CSSFontFaceRule&&j.style.fontFamily.replace(/['"]/g,"")===v&&b.push(j)}catch(j){console.warn(`Could not access stylesheet: ${O.href}`,j)}return b}(S),g=y.filter(v=>v.style.fontFamily.replace(/['"]/g,"")===S).map(v=>({src:v.style.src,fontStyle:v.style.fontStyle||"normal",fontWeight:v.style.fontWeight||"normal"}));return _[S]=g,g}}(ic)),ic}var ih={},Ev={},V3;function Q8(){return V3||(V3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.keyframes=e.glob=e.extractCss=void 0,e.css=h,e.setup=function(S,y,g,v){i.p=y,p=S,w=g,d=v},e.styled=function(S,y){let g=this||{};return function(){let v=arguments;function b(O,j){let T=Object.assign({},O),M=T.className||b.className;g.p=Object.assign({theme:w&&w()},T),g.o=/ *go\d+/.test(M),T.className=h.apply(g,v)+(M?" "+M:""),y&&(T.ref=j);let F=S;return S[0]&&(F=T.as||S,delete T.as),d&&F[0]&&d(T),p(F,T)}return y?y(b):b}};let r={data:""},t=S=>typeof window=="object"?((S?S.querySelector("#_goober"):window._goober)||Object.assign((S||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:S||r,n=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,i=(S,y)=>{let g="",v="",b="";for(let O in S){let j=S[O];O[0]=="@"?O[1]=="i"?g=O+" "+j+";":v+=O[1]=="f"?i(j,O):O+"{"+i(j,O[1]=="k"?"":y)+"}":typeof j=="object"?v+=i(j,y?y.replace(/([^,])+/g,T=>O.replace(/(^:.*)|([^,])+/g,M=>/&/.test(M)?M.replace(/&/g,T):T?T+" "+M:M)):O):j!=null&&(O=O.replace(/[A-Z]/g,"-$&").toLowerCase(),b+=i.p?i.p(O,j):O+":"+j+";")}return g+(y&&b?y+"{"+b+"}":b)+v},o={},l=S=>{if(typeof S=="object"){let y="";for(let g in S)y+=g+l(S[g]);return y}return S},u=(S,y,g,v,b)=>{let O=l(S),j=o[O]||(o[O]=(T=>{let M=0,F=11;for(;M<T.length;)F=101*F+T.charCodeAt(M++)>>>0;return"go"+F})(O));if(!o[j]){let T=O!==S?S:(M=>{let F,C=[{}];for(;F=n.exec(M.replace(a,""));)F[4]?C.shift():F[3]?C.unshift(C[0][F[3]]=C[0][F[3]]||{}):C[0][F[1]]=F[2];return C[0]})(S);o[j]=i(b?{["@keyframes "+j]:T}:T,g?"":"."+j)}return((T,M,F)=>{M.data.indexOf(T)==-1&&(M.data=F?T+M.data:M.data+T)})(o[j],y,v),j},c=(S,y,g)=>S.reduce((v,b,O)=>{let j=y[O];if(j&&j.call){let T=j(g),M=T&&T.props&&T.props.className||/^go/.test(T)&&T;j=M?"."+M:T&&typeof T=="object"?T.props?"":i(T,""):T===!1?"":T}return v+b+(j??"")},"");function h(S){let y=this||{},g=S.call?S(y.p):S;return u(g.unshift?g.raw?c(g,[].slice.call(arguments,1),y.p):g.reduce((v,b)=>Object.assign(v,b&&b.call?b(y.p):b),{}):g,t(y.target),y.g,y.o,y.k)}e.extractCss=S=>{let y=t(S),g=y.data;return y.data="",g};let p,w,d,_=h.bind({g:1}),E=h.bind({k:1});e.glob=_,e.keyframes=E}(Ev)),Ev}var G3;function OC(){if(G3)return ih;G3=1;var e=ih&&ih.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ih,"__esModule",{value:!0});const r=e(di()),t=Q8();return(0,t.setup)(r.default.createElement),ih.default=t.styled,ih}var W3;function AC(){return W3||(W3=1,function(e){var r,t=Dl&&Dl.__createBinding||(Object.create?function(I,W,G,$){$===void 0&&($=G);var J=Object.getOwnPropertyDescriptor(W,G);J&&!("get"in J?!W.__esModule:J.writable||J.configurable)||(J={enumerable:!0,get:function(){return W[G]}}),Object.defineProperty(I,$,J)}:function(I,W,G,$){$===void 0&&($=G),I[$]=W[G]}),n=Dl&&Dl.__setModuleDefault||(Object.create?function(I,W){Object.defineProperty(I,"default",{enumerable:!0,value:W})}:function(I,W){I.default=W}),a=Dl&&Dl.__importStar||(r=function(I){return r=Object.getOwnPropertyNames||function(W){var G=[];for(var $ in W)Object.prototype.hasOwnProperty.call(W,$)&&(G[G.length]=$);return G},r(I)},function(I){if(I&&I.__esModule)return I;var W={};if(I!=null)for(var G=r(I),$=0;$<G.length;$++)G[$]!=="default"&&t(W,I,G[$]);return n(W,I),W}),i=Dl&&Dl.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLElement=e.setQuillContent=e.createQuill=e.setQuillFormats=e.quillRef=void 0;const o=i(di()),l=zs,u=Fu,c=i(RA()),h=i(Us()),p=a(fl),w=tf(),d=Ap(),_=D8(),E=Pp(),S=Z8(),y=If(),g=Ff(),v=Mh,b=i(OC()),O=jf(),j=B6(),T=a(Op()),M=rf(),F=F8();e.quillRef=p.observable({enabled:!1,currentFormat:{},editor:p.observable.object({instance:null},{},{deep:!1})});const C=(0,b.default)("div",o.default.forwardRef)`
|
|
213
|
-
.ql-editor {
|
|
214
|
-
outline: none;
|
|
215
|
-
}
|
|
216
|
-
.ql-clipboard {
|
|
217
|
-
pointer-events: none;
|
|
218
|
-
}
|
|
219
|
-
${S.resetStyleContent}
|
|
220
|
-
strong {
|
|
221
|
-
font-weight: 700;
|
|
222
|
-
}
|
|
223
|
-
.ql-direction-rtl {
|
|
224
|
-
direction: rtl;
|
|
225
|
-
}
|
|
226
|
-
`;let x=["bold","color","font","italic","size","strike","underline","indent","list","direction"];e.setQuillFormats=I=>{x=I},e.createQuill=I=>new c.default(I,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:x}),e.setQuillContent=(I,W)=>{var G=I.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+W+"<p><br></p></div>");I.setContents(G),I.history.clear()};const L=({html:I,onBlur:W,onChange:G,element:$})=>{const J=o.default.useRef(null);o.default.useEffect(()=>{if(!J.current)return;const H=(0,e.createQuill)(J.current);return p.runInAction(()=>{e.quillRef.editor.instance=H}),window.__polotnoQuill=H,H.on("text-change",()=>{H.getSelection()&&p.runInAction(()=>{e.quillRef.currentFormat=H.getFormat()}),setTimeout(()=>{var z;const D=(z=J.current)===null||z===void 0?void 0:z.childNodes[0];G(D.innerHTML)},10)}),H.setSelection(0,0,"api"),H.on("selection-change",(z,D,K)=>{z&&p.runInAction(()=>{e.quillRef.currentFormat=H.getFormat()})}),J.current.childNodes[0].addEventListener("blur",z=>{var D;if(!((D=z.relatedTarget)===null||D===void 0)&&D.classList.contains("ql-clipboard"))return;(function(ne){return!!ne&&!!ne.closest(".sketch-picker")})(z.relatedTarget)||W()}),()=>{p.runInAction(()=>{e.quillRef.editor.instance=null,e.quillRef.currentFormat={}}),delete window.__polotnoQuill}},[]),o.default.useEffect(()=>{var H;const z=e.quillRef.editor.instance;if(!z)return;const D=z.getSelection();((H=J.current)===null||H===void 0?void 0:H.childNodes[0].innerHTML)===$.text||((0,e.setQuillContent)(z,I),D&&(z.setSelection(D.index,D.length),p.runInAction(()=>{e.quillRef.currentFormat=z.getFormat()})))},[$.text]);const V={color:$.fill};return $.fill.indexOf("gradient")>=0&&(V.backgroundColor=$.fill,V.backgroundImage=$.fill,V.backgroundSize="100% 100%",V.backgroundRepeat="repeat",V.webkitBackgroundClip="text",V.MozBackgroundClip="text",V.WebkitTextFillColor="transparent",V.MozTextFillColor="transparent"),o.default.createElement(C,{ref:J,style:Object.assign(Object.assign({},V),{fontSize:$.fontSize,fontWeight:$.fontWeight,width:$.a.width,fontFamily:$.fontFamily,lineHeight:$.lineHeight,letterSpacing:$.letterSpacing+"rem",textAlign:$.align}),dir:(0,_.getDir)((0,j.removeTags)($.text))})};function A(I,{fontFamily:W="",color:G="black"}={}){let $=`color: ${G||I.fill}`;return I.fill.indexOf("gradient")>=0&&($=`
|
|
227
|
-
background-color: ${G};
|
|
228
|
-
background-image: ${I.fill};
|
|
229
|
-
background-size: 100% 100%;
|
|
230
|
-
background-repeat: repeat;
|
|
231
|
-
-webkit-background-clip: text;
|
|
232
|
-
-moz-background-clip: text;
|
|
233
|
-
-webkit-text-fill-color: transparent;
|
|
234
|
-
-moz-text-fill-color: transparent;
|
|
235
|
-
`),`<div style="${["white-space: pre-wrap",`width: ${Math.round(I.width||100)}px`,$,`font-size: ${I.fontSize}px`,`font-family: '${W}'`,`text-align: ${I.align}`,I.textDecoration?`text-decoration: ${I.textDecoration}; text-decoration-color: ${G||I.fill}; text-decoration-layer: over`:"",I.lineHeight?`line-height: ${I.lineHeight}`:"",I.letterSpacing?`letter-spacing: ${I.letterSpacing}rem`:"",I.fontStyle?`font-style: ${I.fontStyle}`:"",I.fontWeight?`font-weight: ${I.fontWeight}`:"",I.strokeWidth?`-webkit-text-stroke: ${I.strokeWidth}px ${I.stroke}`:"",I.strokeWidth?"paint-order: stroke fill":""].filter(Boolean).join("; ")}" contentEditable dir="${(0,_.getDir)((0,j.removeTags)(I.text))}">${(0,j.sanitizeHtml)(I.text).replace(/\n/g,"</br>")}</div>`}const N=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);e.HTMLElement=(0,l.observer)(({element:I,store:W})=>{const G=o.default.useRef(null),[$,J]=o.default.useState(),[V,H]=o.default.useState(!1),[z,D]=o.default.useState(!0),[K,ne]=o.default.useState(!1),Z=o.default.useRef(I.height),ee=W.selectedShapes.indexOf(I)>=0&&I.selectable,ae=I.fontSize/3,{textVerticalResizeEnabled:se}=w.flags,ce=(0,_.usePrevious)(I.fontFamily),[me]=(0,_.useFontLoader)(W,I.fontFamily),xe=I._editModeEnabled;(0,y.useFadeIn)(G);const Oe=me?I.fontFamily:ce!==I.fontFamily?ce:"Arial",Re=(0,E.useColor)(I).fill,Se=A(I,{fontFamily:Oe,color:Re}),{width:ve,height:He}=function(Ce,De,tt){return o.default.useMemo(()=>(0,S.detectSize)(Ce),[Ce,De.width,tt])}(Se,I,me);o.default.useEffect(()=>{if(!me)return;if(!I.height)return void I.set({height:He});const{textOverflow:Ce}=w.flags;if(Ce!=="change-font-size"||V)Ce==="resize"&&(se&&I.height<He&&W.history.ignore(()=>{I.set({height:He})}),se||I.height===He||W.history.ignore(()=>{I.set({height:He})}));else{const De=(tt=>{let vt=tt.fontSize;for(let mt=1;mt<50;mt++){const Et=A(Object.assign(Object.assign({},tt.toJSON()),{fontSize:vt}),{fontFamily:tt.fontFamily}),{height:nt}=(0,S.detectSize)(Et),at=tt.height&&nt>tt.height,qt=(0,S.isContentWrapping)({html:Et});if(!at&&!qt)break;vt-=.5}return vt})(I);De!==I.fontSize?W.history.ignore(()=>{I.set({fontSize:De})}):I.height!==He&&(se&&I.height<He?W.history.ignore(()=>{I.set({height:He})}):se||W.history.ignore(()=>{I.set({height:He})}))}});const we=o.default.useRef(0),Ae=o.default.useMemo(()=>{const Ce={lastArgs:null,lastResult:null};return async function(De){return Ce.lastArgs&&Ce.lastResult&&(tt=Ce.lastArgs,vt=De,JSON.stringify(tt)===JSON.stringify(vt))||(Ce.lastResult=await(0,S.htmlToCanvas)(De),Ce.lastArgs=Object.assign({},De)),Ce.lastResult;var tt,vt}},[]);o.default.useEffect(()=>{V||xe||(async()=>{we.current++;const Ce=we.current,De=(0,O.incrementLoader)(`text ${I.id}`);D(!0);let tt=null;const vt=N?5:1;for(let mt=0;mt<vt;mt++){const Et=mt>0?Ae:S.htmlToCanvas;try{if(tt=await Et({skipCache:mt>0,html:Se,width:I.width||1,height:I.height||He||1,fontFamily:Oe,padding:ae,pixelRatio:W._elementsPixelRatio,font:W.fonts.find(nt=>nt.fontFamily===Oe)||T.globalFonts.find(nt=>nt.fontFamily===Oe)}),Ce!==we.current)return void De();if(!function(nt){const at=nt.getContext("2d").getImageData(0,0,nt.width,nt.height).data;for(let qt=0;qt<at.length;qt+=4)if(at[qt+3]!==0)return!0;return!1}(tt)&&N){await new Promise(nt=>setTimeout(nt,50*(mt+1)));continue}}catch{(0,O.triggerLoadError)(`Error rendering rich text with id ${I.id}`);break}}tt?(J(tt),D(!1),h.default.Util.requestAnimFrame(De)):De()})()},[Se,V,He,xe,Oe,I.height,W._elementsPixelRatio,me]);const Ee=V||z;o.default.useEffect(()=>p.autorun(()=>{const Ce=G.current;(0,d.applyFilter)(Ce,I)}),[$,Ee,I.shadowColor,I.shadowOffsetX,I.shadowOffsetY,I.shadowOpacity]);let Ne=0;I.verticalAlign==="middle"&&(Ne=(I.height-He)/2),I.verticalAlign==="bottom"&&(Ne=I.height-He);const he=(0,_.getLineHeight)({fontLoaded:me,fontFamily:I.fontFamily,fontSize:I.fontSize,lineHeight:I.lineHeight}),Le=(0,M.isTouchDevice)();return o.default.createElement(o.default.Fragment,null,o.default.createElement(u.Rect,{x:I.a.x,y:I.a.y,offsetX:I.backgroundPadding*(I.fontSize*he*.5),offsetY:I.backgroundPadding*(I.fontSize*he*.5),rotation:I.a.rotation,hideInExport:!I.showInExport,listening:!1,visible:I.backgroundEnabled,opacity:I.backgroundOpacity*I.a.opacity,fill:I.backgroundColor,width:I.a.width+I.backgroundPadding*(I.fontSize*he),height:I.a.height+I.backgroundPadding*(I.fontSize*he),cornerRadius:I.backgroundCornerRadius*(I.fontSize*he*.5)}),o.default.createElement(u.Rect,{ref:G,name:"element",x:I.a.x,y:I.a.y,listening:I.selectable,rotation:I.a.rotation,width:I.a.width,height:I.a.height,visible:!Ee,draggable:Le?I.draggable&&ee:I.draggable,preventDefault:!Le||ee,opacity:xe?0:I.a.opacity,hideInExport:!I.showInExport,onMouseEnter:()=>{ne(!0)},onMouseLeave:()=>{ne(!1)},onDragMove:Ce=>{I.set({x:Ce.target.x(),y:Ce.target.y()})},onDragEnd:Ce=>{I.set({x:Ce.target.x(),y:Ce.target.y()})},id:I.id,onDblClick:()=>{I.contentEditable&&I.toggleEditMode(!0)},onDblTap:()=>{I.contentEditable&&I.toggleEditMode(!0)},onTransformStart:Ce=>{H(!0),Z.current=I.height},onTransform:Ce=>{var De;const tt=Ce.target,vt=((De=tt.getStage())===null||De===void 0?void 0:De.findOne("Transformer")).getActiveAnchor(),mt=vt==="middle-left"||vt==="middle-right",Et=vt==="top-center"||vt==="bottom-center",nt=tt.scaleX();if(mt){const at=tt.scaleX(),qt=Math.max(tt.width()*at,I.fontSize);if(tt.width(qt),tt.scaleX(1),w.flags.textVerticalResizeEnabled){const Ct=Math.max(He,Z.current);I.set({height:Ct})}I.set({width:qt,x:tt.x(),y:tt.y()})}else if(Et){let at=w.flags.textOverflow==="resize"?He:I.lineHeight*I.fontSize;const qt=Math.max(at,Ce.target.height()*Ce.target.scaleY());tt.scaleY(1),I.set({x:tt.x(),y:tt.y(),height:qt,rotation:tt.rotation()})}else tt.scaleX(1),tt.scaleY(1),I.set({fontSize:I.fontSize*nt,width:tt.width()*nt,x:tt.x(),y:tt.y(),rotation:tt.rotation(),height:tt.height()*nt})},onTransformEnd:Ce=>{H(!1),D(!0);const De=Ce.target.scaleX();Ce.target.scaleX(1),Ce.target.scaleY(1),I.set({fontSize:I.fontSize*De,width:Ce.target.width()*De,x:Ce.target.x(),y:Ce.target.y(),rotation:Ce.target.rotation(),shadowBlur:I.shadowBlur*De,shadowOffsetX:I.shadowOffsetX*De,shadowOffsetY:I.shadowOffsetY*De,strokeWidth:I.strokeWidth*De})}}),o.default.createElement(u.Image,{ref:G,image:$,x:I.a.x,y:I.a.y,offsetX:ae,offsetY:ae-Ne,listening:!1,rotation:I.rotation,width:I.a.width+2*ae,height:I.a.height+2*ae,visible:!Ee,opacity:xe?0:I.a.opacity,shadowEnabled:I.shadowEnabled,shadowBlur:I.shadowBlur,shadowOffsetX:I.shadowOffsetX,shadowOffsetY:I.shadowOffsetY,shadowColor:I.shadowColor,shadowOpacity:I.shadowOpacity,hideInExport:!I.showInExport}),Ee&&o.default.createElement(u.Group,{x:I.a.x,y:I.a.y,rotation:I.rotation,offsetY:-Ne},o.default.createElement(v.Html,{divProps:{style:{pointerEvents:"none"}}},o.default.createElement(C,{dangerouslySetInnerHTML:{__html:Se},style:{pointerEvents:"none",display:"inline-block"}}))),xe&&o.default.createElement(u.Group,{x:I.a.x,y:I.a.y,rotation:I.rotation,offsetY:-Ne},o.default.createElement(v.Html,null,o.default.createElement(L,{html:Se,element:I,onChange:Ce=>{const De=(0,F.getLimitedFontSize)({oldText:(0,j.removeTags)(I.text),newText:(0,j.removeTags)(Ce),element:I});I.set({text:Ce,fontSize:De})},onBlur:Ce=>{I.toggleEditMode(!1)}}))),(ee||K)&&o.default.createElement(g.Highlighter,{element:I}))})}(Dl)),Dl}var Gd={},Wd={},Pv={},$3;function Fh(){return $3||($3=1,function(e){function r(o){return o/180*Math.PI}function t(o,l,u,c,h){const p=Math.sqrt(u*u+c*c);return h+=Math.atan2(c,u),{x:o+p*Math.cos(h),y:l+p*Math.sin(h)}}function n(o){const{x:l,y:u,width:c,height:h}=o,p=r(o.rotation),w=t(l,u,0,0,p),d=t(l,u,c,0,p),_=t(l,u,c,h,p),E=t(l,u,0,h,p),S=Math.min(w.x,d.x,_.x,E.x),y=Math.min(w.y,d.y,_.y,E.y),g=Math.max(w.x,d.x,_.x,E.x),v=Math.max(w.y,d.y,_.y,E.y);return{x:S,y,width:g-S,height:v-y,minX:S,minY:y,maxX:g,maxY:v}}function a(o){const l=r(o.rotation||0);return{x:o.x+o.width/2*Math.cos(l)+o.height/2*Math.sin(-l),y:o.y+o.height/2*Math.cos(l)+o.width/2*Math.sin(l)}}function i(o,l,u){const c=r(l),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+l,x:h,y:p})}Object.defineProperty(e,"__esModule",{value:!0}),e.degToRad=r,e.getClientRect=n,e.getTotalClientRect=function(o){const l=o.map(w=>n(w)),u=Math.min(...l.map(w=>w.minX)),c=Math.min(...l.map(w=>w.minY)),h=Math.max(...l.map(w=>w.maxX)),p=Math.max(...l.map(w=>w.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,l){return i(o,l,a(o))}}(Pv)),Pv}var Y3;function J8(){return Y3||(Y3=1,function(e){var r=Wd&&Wd.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.setSnapFilterFunc=void 0,e.useSnap=function(c,h){const p=t.default.useRef(null),w=g=>g.hasName("element")||g.hasName("page-background")||!p.current&&g.hasName("elements-area");function d(g){var v;const b=(v=c.current)===null||v===void 0?void 0:v.getStage(),O=[],j=[];return b.find(w).forEach(T=>{if(!(g.indexOf(T)>=0)){var M=T.getClientRect({skipShadow:!0,skipStroke:!0});O.push({offset:M.x,node:T,snap:"start"},{offset:M.x+M.width,node:T,snap:"end"},{offset:M.x+M.width/2,node:T,snap:"center"}),j.push({offset:M.y,node:T,snap:"start"},{offset:M.y+M.height,node:T,snap:"end"},{offset:M.y+M.height/2,node:T,snap:"center"})}}),{vertical:O,horizontal:j}}function _(g){var v;const b=(v=c.current)===null||v===void 0?void 0:v.getLayer(),O=b==null?void 0:b.children.find(j=>j.name()==="line-guides");g.forEach(j=>{if(j.orientation==="H"){var T=new n.default.Line({x:-b.getStage().x(),y:-b.getStage().y(),points:[-6e3,j.lineGuide,6e3,j.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});O==null||O.add(T),b.batchDraw()}else j.orientation==="V"&&(T=new n.default.Line({x:-b.getStage().x(),y:-b.getStage().y(),points:[j.lineGuide,-6e3,j.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),O==null||O.add(T))})}const E=g=>{const v=g.target.getLayer().children.find(x=>x.name()==="line-guides");v==null||v.destroyChildren();var b=d(g.target.nodes()),O=function(x){const L=x.__getNodeRect(),A=(0,a.getClientRect)(Object.assign(Object.assign({},L),{rotation:n.default.Util.radToDeg(L.rotation)})),N=x.getAbsolutePosition();return{vertical:[{guide:A.x,offset:N.x-A.x,snap:"start",nodes:x.nodes()},{guide:A.x+A.width/2,offset:N.x-A.x-A.width/2,snap:"center",nodes:x.nodes()},{guide:A.x+A.width,offset:N.x-A.x-A.width,snap:"end",nodes:x.nodes()}],horizontal:[{guide:A.y,offset:N.y-A.y,snap:"start",nodes:x.nodes()},{guide:A.y+A.height/2,offset:N.y-A.y-A.height/2,snap:"center",nodes:x.nodes()},{guide:A.y+A.height,offset:N.y-A.y-A.height,snap:"end",nodes:x.nodes()}]}}(g.target),j=o(b,O);if(!j.length)return;_(j);const T=g.target.getAbsolutePosition(),M=(g.target.nodes().map(x=>x.getAbsolutePosition()),Object.assign({},T));j.forEach(x=>{switch(x.snap){case"start":case"center":case"end":switch(x.orientation){case"V":M.x=x.lineGuide+x.offset;break;case"H":M.y=x.lineGuide+x.offset}}});const F=M.x-T.x,C=M.y-T.y;g.evt.ctrlKey||g.evt.metaKey||g.target.nodes().forEach(x=>{const L=x.getAbsolutePosition();x.setAbsolutePosition({x:L.x+F,y:L.y+C})})},S=(g,v,b)=>{var O;const j=c.current,T=j.getLayer().children.find(W=>W.name()==="line-guides");if(T==null||T.destroyChildren(),j.getActiveAnchor()==="rotater")return v;const M=j.getActiveAnchor(),F=u[M],C=(O=j.findOne(`.${F}`))===null||O===void 0?void 0:O.getAbsolutePosition();if(!C)return v;const x={x:g.x-C.x,y:g.y-C.y},L=function(W,G){const $=l(W,G)/l(G,G);return{x:$*G.x,y:$*G.y}}({x:v.x-g.x,y:v.y-g.y},x),A={x:g.x+L.x,y:g.y+L.y};var N=o(d(j.nodes()),{vertical:[{guide:A.x,offset:0,snap:"start",nodes:j.nodes()}],horizontal:[{guide:A.y,offset:0,snap:"start",nodes:j.nodes()}]});if(!N.length||(_(N),b.ctrlKey||b.metaKey))return v;const I=[];if(N.forEach(W=>{const G=function($,J,V){if(V.orientation==="V"){const H=V.lineGuide;if(Math.abs(J.x-$.x)<1e-4)return null;const z=(J.y-$.y)/(J.x-$.x);return{x:H,y:z*H+($.y-z*$.x)}}{const H=V.lineGuide;if(Math.abs(J.y-$.y)<1e-4)return null;const z=(J.y-$.y)/(J.x-$.x);return{x:(H-$.y)/z+$.x,y:H}}}(A,C,{orientation:W.orientation,lineGuide:W.lineGuide});G&&I.push(G)}),I.length>0){let W=I[0],G=Math.sqrt(Math.pow(A.x-W.x,2)+Math.pow(A.y-W.y,2));if(I.forEach($=>{const J=Math.sqrt(Math.pow(A.x-$.x,2)+Math.pow(A.y-$.y,2));J<G&&(G=J,W=$)}),G<10)return W}return A},y=g=>{if(!g.target)return;const v=g.target.getLayer(),b=v.children.find(O=>O.name()==="line-guides");b==null||b.destroyChildren(),v.batchDraw()};t.default.useEffect(()=>{c.current&&(c.current.anchorDragBoundFunc(S),c.current.on("dragstart",g=>{setTimeout(()=>{if(n.default.DD._dragElements.size===0)return;const v=[...n.default.DD._dragElements.entries()],b=v.find(([O,j])=>j.node instanceof n.default.Transformer);b&&(v.splice(v.indexOf(b),1),v.unshift(b),n.default.DD._dragElements.clear(),v.forEach(([O,j])=>{n.default.DD._dragElements.set(O,j)}))})}),c.current.on("dragmove",E),c.current.on("dragend",y),c.current.on("transformend",y),c.current.on("transform",g=>{var v,b;g.evt.ctrlKey||g.evt.metaKey?(v=c.current)===null||v===void 0||v.rotationSnapTolerance(0):(b=c.current)===null||b===void 0||b.rotationSnapTolerance(5)}))},[])},e.useAnchorSnap=function(c,h,p){const w=E=>E.hasName("element")||E.hasName("line-anchor")||E.hasName("page-background")||E.hasName("elements-area"),d=E=>{const S=E.target.getLayer().children.find(T=>T.name()==="line-guides");S==null||S.destroyChildren();var y,g=o(function(T){var M;const F=(M=c.current)===null||M===void 0?void 0:M.getStage();var C=[],x=[];return F.find(w).forEach(L=>{if(!(T.indexOf(L)>=0)){var A=L.getClientRect({skipShadow:!0,skipStroke:!0});L.hasName("line-anchor")&&(A={x:L.absolutePosition().x,y:L.absolutePosition().y,width:0,height:0}),C.push({offset:A.x,node:L,snap:"start"},{offset:A.x+A.width,node:L,snap:"end"},{offset:A.x+A.width/2,node:L,snap:"center"}),x.push({offset:A.y,node:L,snap:"start"},{offset:A.y+A.height,node:L,snap:"end"},{offset:A.y+A.height/2,node:L,snap:"center"})}}),{vertical:C,horizontal:x}}([E.target,...h.map(T=>T.current)]),{vertical:[{guide:(y=E.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 M;const F=(M=c.current)===null||M===void 0?void 0:M.getLayer(),C=F==null?void 0:F.children.find(x=>x.name()==="line-guides");T.forEach(x=>{if(x.orientation==="H"){var L=new n.default.Line({points:[-6e3,x.lineGuide,6e3,x.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});C==null||C.add(L),F.batchDraw()}else x.orientation==="V"&&(L=new n.default.Line({points:[x.lineGuide,-6e3,x.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),C==null||C.add(L))})})(g);const v=E.target.getAbsolutePosition(),b=Object.assign({},v);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 O=b.x-v.x,j=b.y-v.y;if(!E.evt.ctrlKey&&!E.evt.metaKey){const T=E.target.getAbsolutePosition();E.target.absolutePosition({x:T.x+O,y:T.y+j})}},_=E=>{if(!E.target)return;const S=E.target.getLayer(),y=S.children.find(g=>g.name()==="line-guides");y==null||y.destroyChildren(),S.batchDraw()};t.default.useEffect(()=>{c.current&&(c.current.on("dragmove",d),c.current.on("dragend",_))},p)};const t=r(di()),n=r(Us()),a=Fh();let i=({targetKonvaNodes:c,guideKonvaNode:h,distance:p,snapDirection:w})=>p<5;function o(c,h){var p=[],w=[];c.vertical.forEach(g=>{h.vertical.forEach(v=>{var b=Math.abs(g.offset-v.guide);i({targetKonvaNodes:v.nodes,guideKonvaNode:g.node,distance:b,snapDirection:g.snap})&&p.push({lineGuide:g.offset,diff:b,snap:v.snap,offset:v.offset})})}),c.horizontal.forEach(g=>{h.horizontal.forEach(v=>{var b=Math.abs(g.offset-v.guide);i({targetKonvaNodes:v.nodes,guideKonvaNode:g.node,distance:b,snapDirection:g.snap})&&w.push({lineGuide:g.offset,diff:b,snap:v.snap,offset:v.offset})})});var d=[];const _=p.sort((g,v)=>g.diff-v.diff),E=w.sort((g,v)=>g.diff-v.diff);var S=_[0],y=E[0];return S&&_.filter(g=>Math.abs(g.diff-S.diff)<.1).forEach(g=>{d.push(Object.assign({orientation:"V"},g))}),y&&E.filter(g=>Math.abs(g.diff-y.diff)<.1).forEach(g=>{d.push(Object.assign({orientation:"H"},g))}),d}function l(c,h){return c.x*h.x+c.y*h.y}e.setSnapFilterFunc=c=>{i=c};const u={"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"}}(Wd)),Wd}var X3;function CC(){return X3||(X3=1,function(e){var r=Gd&&Gd.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0,e.getMiddlePoints=h,e.getLinePositionFromMiddlePoints=p;const t=r(di()),n=zs,a=Fu,i=Pp(),o=Mh,l=Ff(),u=J8(),c=rf();function h(_){const{x:E,y:S,width:y,height:g,rotation:v}=_.a,b=v*Math.PI/180,O={x:E+g/2*Math.cos(b+Math.PI/2),y:S+g/2*Math.sin(b+Math.PI/2)};return{middleLeft:O,middleRight:{x:O.x+y*Math.cos(b),y:O.y+y*Math.sin(b)}}}function p(_,E,S){const y=Math.sqrt(Math.pow(E.x-_.x,2)+Math.pow(E.y-_.y,2)),g=Math.atan2(E.y-_.y,E.x-_.x),v=180*g/Math.PI;return{x:_.x+Math.cos(g-Math.PI/2)*S/2,y:_.y+Math.sin(g-Math.PI/2)*S/2,width:y,height:S,rotation:v}}const w=(_,E)=>({offsetX:5/_,offsetY:5/_,width:10/_,height:10/_,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:S=>{S.target.getStage().container().style.cursor="crosshair"},onMouseLeave:S=>{S.target.getStage().container().style.cursor=""},onDragStart:S=>{E.history.startTransaction()},onDragEnd:S=>{E.history.endTransaction()}}),d=(0,n.observer)(({element:_,type:E})=>{const S=(0,i.useColor)(_,_.a.color,"fill"),y=(0,i.useColor)(_,_.a.color,"stroke"),g=Object.assign(Object.assign(Object.assign({strokeWidth:_.height,lineCap:"round",lineJoin:"round"},y),S),{opacity:_.a.opacity,hideInExport:!_.showInExport});return t.default.createElement(t.default.Fragment,null,E==="arrow"&&t.default.createElement(a.Line,Object.assign({points:[3*_.height,2*-_.height,0,0,3*_.height,2*_.height]},g)),E==="triangle"&&t.default.createElement(a.Line,Object.assign({points:[3*_.height,2*-_.height,0,0,3*_.height,2*_.height],closed:!0},g)),E==="bar"&&t.default.createElement(a.Line,Object.assign({points:[0,2*-_.height,0,2*_.height],closed:!0},g)),E==="square"&&t.default.createElement(a.Line,Object.assign({points:[0,2*-_.height,4*_.height,2*-_.height,4*_.height,2*_.height,0,2*_.height],closed:!0},g)),E==="circle"&&t.default.createElement(a.Circle,Object.assign({x:2*_.height,y:0,radius:2*_.height},g)))});e.LineElement=(0,n.observer)(({element:_,store:E})=>{const S=t.default.useRef(null),y=t.default.useRef(null),g=t.default.useRef(null),v=_.selectable||E.role==="admin",b=(0,c.isTouchDevice)(),[O,j]=t.default.useState(!1),T=E.selectedElements.indexOf(_)>=0&&E.selectedElements.length===1,M=E.selectedShapes.indexOf(_)>=0&&_.selectable,{middleLeft:F,middleRight:C}=h(_);(0,u.useAnchorSnap)(y,[S],[T]),(0,u.useAnchorSnap)(g,[S],[T]);const x=(0,i.useColor)(_,_.a.color,"stroke");return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Line,Object.assign({ref:S,name:"element",id:_.id,x:_.a.x,y:_.a.y,points:[0,0,_.a.width,0],offsetY:-_.a.height/2,strokeWidth:_.a.height,hitStrokeWidth:Math.max(_.a.height,20),dash:_.dash.map(L=>L*_.a.height)},x,{rotation:_.a.rotation,opacity:_.animated("opacity"),shadowEnabled:_.shadowEnabled,shadowBlur:_.shadowBlur,shadowOffsetX:_.shadowOffsetX,shadowOffsetY:_.shadowOffsetY,shadowColor:_.shadowColor,shadowOpacity:_.shadowOpacity,listening:v,draggable:b?_.draggable&&M:_.draggable,preventDefault:!b||M,hideInExport:!_.showInExport,onMouseEnter:()=>{j(!0)},onMouseLeave:()=>{j(!1)},onDragMove:L=>{_.set({x:L.target.x(),y:L.target.y()})},onDragEnd:L=>{_.set({x:L.target.x(),y:L.target.y()})},onTransform:L=>{const A=L.target.scaleX();L.target.scaleX(1),L.target.scaleY(1),_.set({height:_.height*A,width:_.width*A,x:L.target.x(),y:L.target.y(),rotation:L.target.rotation()})}})),t.default.createElement(a.Group,{x:F.x,y:F.y,rotation:_.rotation,hideInExport:!_.showInExport},t.default.createElement(d,{element:_,type:_.startHead})),t.default.createElement(a.Group,{x:C.x,y:C.y,rotation:_.rotation+180},t.default.createElement(d,{element:_,type:_.endHead})),(O||M&&!T)&&t.default.createElement(l.Highlighter,{element:_}),T&&_.resizable&&t.default.createElement(o.Portal,{selector:".page-abs-container",enabled:!0},t.default.createElement(a.Group,{visible:T},t.default.createElement(a.Rect,Object.assign({x:F.x,y:F.y,ref:y,name:"line-anchor"},w(E.scale,E),{onDragMove:L=>{const A=p(L.target.position(),C,_.height);_.set({x:A.x,y:A.y,width:A.width,rotation:A.rotation})}})),t.default.createElement(a.Rect,Object.assign({x:C.x,y:C.y,ref:g,name:"line-anchor"},w(E.scale,E),{onDragMove:L=>{const A=p(F,L.target.position(),_.height);_.set({x:A.x,y:A.y,width:A.width,rotation:A.rotation})}})))))})}(Gd)),Gd}var Bl={},K3;function e_(){return K3||(K3=1,function(e){var r,t=Bl&&Bl.__createBinding||(Object.create?function(x,L,A,N){N===void 0&&(N=A);var I=Object.getOwnPropertyDescriptor(L,A);I&&!("get"in I?!L.__esModule:I.writable||I.configurable)||(I={enumerable:!0,get:function(){return L[A]}}),Object.defineProperty(x,N,I)}:function(x,L,A,N){N===void 0&&(N=A),x[N]=L[A]}),n=Bl&&Bl.__setModuleDefault||(Object.create?function(x,L){Object.defineProperty(x,"default",{enumerable:!0,value:L})}:function(x,L){x.default=L}),a=Bl&&Bl.__importStar||(r=function(x){return r=Object.getOwnPropertyNames||function(L){var A=[];for(var N in L)Object.prototype.hasOwnProperty.call(L,N)&&(A[A.length]=N);return A},r(x)},function(x){if(x&&x.__esModule)return x;var L={};if(x!=null)for(var A=r(x),N=0;N<A.length;N++)A[N]!=="default"&&t(L,x,A[N]);return n(L,x),L}),i=Bl&&Bl.__importDefault||function(x){return x&&x.__esModule?x:{default:x}};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=e.useLoader=e.setVideoLoaderHook=e.useCornerRadiusAndCrop=void 0;const o=i(di()),l=zs,u=fl,c=Fu,h=i(r0()),p=i(Us()),w=Mh,d=Ff(),_=jf(),E=a(kp()),S=tf(),y=Ap(),g=If(),v=rf();function b(){return document.createElement("canvas")}const O=new window.Image;O.src=E.svgToURL(`
|
|
236
|
-
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
237
|
-
<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"/>
|
|
238
|
-
<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"/>
|
|
239
|
-
</svg>
|
|
240
|
-
`);const j=new window.Image;j.src=E.svgToURL(`
|
|
241
|
-
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
242
|
-
<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"/>
|
|
243
|
-
<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"/>
|
|
244
|
-
<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"/>
|
|
245
|
-
<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"/>
|
|
246
|
-
</svg>
|
|
247
|
-
`),e.useCornerRadiusAndCrop=(x,L,A,N,I=0,W=!1)=>{const G=Math.floor(Math.max(x.width*N,1)),$=Math.floor(Math.max(x.height*N,1)),J=Math.min(I*N,G/2,$/2),V=Math.max(x.width/A.width,x.height/A.height)*N,H=x.page._exportingOrRendering&&S.flags.imageDownScalingEnabled&&V<1&&!W,z=A.x===0&&A.y===0&&A.width===(L==null?void 0:L.width)&&A.height===(L==null?void 0:L.height),D=o.default.useMemo(()=>{if(L&&L.width&&L.height)return z&&J===0&&!H?void 0:b()},[L,J,H,z]),K=()=>{if(!D||!L)return;D.width=G,D.height=$;const ne=D.getContext("2d");if(!ne)return;J&&(ne.beginPath(),ne.moveTo(J,0),ne.lineTo(G-J,0),ne.arc(G-J,J,J,3*Math.PI/2,0,!1),ne.lineTo(G,$-J),ne.arc(G-J,$-J,J,0,Math.PI/2,!1),ne.lineTo(J,$),ne.arc(J,$-J,J,Math.PI/2,Math.PI,!1),ne.lineTo(0,J),ne.arc(J,J,J,Math.PI,3*Math.PI/2,!1),ne.clip());const Z=H?function(ae,se){var ce,me;const xe=b();xe.width=ae.width,xe.height=ae.height,(ce=xe.getContext("2d"))===null||ce===void 0||ce.drawImage(ae,0,0,xe.width,xe.height);const Oe=function(Re,Se,ve,He,we,Ae,Ee){for(var Ne=new ImageData(Se,ve),he=new Int32Array(Re.data.buffer),Le=Re.width,Ce=new Int32Array(Ne.data.buffer),De=Ne.width,tt=Se/Ae,vt=ve/Ee,mt=Math.round(1/tt),Et=Math.round(1/vt),nt=mt*Et,at=0;at<Ne.height;at++)for(var qt=0;qt<De;qt++){for(var Ct=0+Math.round(qt/tt)+(0+Math.round(at/vt))*Le,or=0,Xt=0,qe=0,We=0,Nt=0;Nt<Et;Nt++)for(var ht=0;ht<mt;ht++){var gt=he[Ct+ht+Nt*Le];or+=gt<<24>>>24,Xt+=gt<<16>>>24,qe+=gt<<8>>>24,We+=gt>>>24}or=Math.round(or/nt),Xt=Math.round(Xt/nt),qe=Math.round(qe/nt),We=Math.round(We/nt),Ce[qt+at*De]=We<<24|qe<<16|Xt<<8|or}return Ne}(xe.getContext("2d").getImageData(0,0,xe.width,xe.height),Math.floor(xe.width*se),Math.floor(xe.height*se),0,0,xe.width,xe.height);return xe.width=Math.floor(xe.width*se),xe.height=Math.floor(xe.height*se),(me=xe.getContext("2d"))===null||me===void 0||me.putImageData(Oe,0,0),xe}(L,V):L,ee=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;ne.drawImage(Z,ee.x,ee.y,ee.width,ee.height,0,0,D.width,D.height)};return o.default.useLayoutEffect(()=>{K()},[D,x.width,x.height,A.x,A.y,A.width,A.height,I,N,W,x.page._exportingOrRendering,H]),o.default.useEffect(()=>()=>{D&&D.nodeName==="CANVAS"&&p.default.Util.releaseCanvas(D)},[D]),[D||L,K]};const T=b(),M=(0,l.observer)(({element:x})=>{const L=Math.min(30,x.width/4,x.height/4),A=o.default.useRef(null);return o.default.useEffect(()=>{const N=A.current;if(!N)return;const I=new p.default.Animation(W=>{N.rotate(((W==null?void 0:W.timeDiff)||0)/2)},N.getLayer());return I.start(),()=>{I.stop()}}),o.default.createElement(c.Group,{x:x.a.x,y:x.a.y,rotation:x.a.rotation,listening:!1,opacity:x.a.opacity,hideInExport:!x.showInExport},o.default.createElement(c.Rect,{width:x.width,height:x.height,fill:"rgba(124, 173, 212, 0.8)"}),o.default.createElement(c.Arc,{ref:A,x:x.width/2,y:x.height/2,fill:"white",outerRadius:Math.abs(L),innerRadius:Math.max(1,L-5),angle:270}))}),F=(0,l.observer)(({element:x})=>{const L=Math.max(10,Math.min(30,x.width/25));return o.default.createElement(c.Group,{x:x.a.x,y:x.a.y,rotation:x.a.rotation,listening:!1,opacity:x.a.opacity,hideInExport:!x.showInExport},o.default.createElement(c.Rect,{width:x.width,height:x.height,fill:"rgba(223, 102, 102, 0.8)"}),o.default.createElement(c.Text,{text:"Can not load the video...",fontSize:L,width:x.width,height:x.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let C=function(x,L,A){const N=o.default.useRef("loading"),I=o.default.useRef(null),[W,G]=o.default.useState(0),$=o.default.useRef(),J=o.default.useRef(),V=o.default.useRef();return $.current===x&&J.current===L&&V.current===A||(N.current="loading",I.current=void 0,$.current=x,J.current=L,V.current=A),o.default.useLayoutEffect(function(){if(x){var H=document.createElement("video");return H.addEventListener("canplay",z),H.addEventListener("error",D),L&&(H.crossOrigin=L),A&&(H.referrerpolicy=A),H.src=x,H.load(),function(){H.removeEventListener("canplay",z),H.removeEventListener("error",D)}}function z(){N.current="loaded",I.current=H,I.current.currentTime=0,G(Math.random()),I.current.removeEventListener("canplay",z)}function D(K){const ne=H.readyState===4,Z=H.buffered&&H.buffered.length>0&&H.buffered.end(H.buffered.length-1)/H.duration*100>=100;ne&&Z||(N.current="failed",I.current=void 0,G(Math.random()))}},[x,L,A]),[I.current,N.current]};e.setVideoLoaderHook=x=>{C=x},e.useLoader=(x,L,A)=>{const N=o.default.useRef(),I=()=>{var W;(W=N.current)===null||W===void 0||W.call(N),N.current=void 0};o.default.useEffect(()=>I,[]),o.default.useLayoutEffect(()=>{const W=L.slice(0,200),G=`video with id ${A} url: ${W}`;x!=="loading"||N.current||(N.current=(0,_.incrementLoader)(G)),x!=="loading"&&I(),x==="failed"&&(0,_.triggerLoadError)(G)},[x])},e.VideoElement=(0,l.observer)(({element:x,store:L})=>{var A;const[N,I]=o.default.useState(!1),W=o.default.useRef(null),G=o.default.useRef(null),[$,J]=o.default.useState(!1),V=L.selectedShapes.indexOf(x)>=0&&x.selectable,[H,z]=o.default.useState(!1),[D,K]=C(x.src,"anonymous"),ne=L.activePage===x.page;(0,e.useLoader)(K,x.src,x.id),D&&(D.width=D.videoWidth,D.height=D.videoHeight,D.playsInline=!0);const Z=D||T;o.default.useEffect(()=>{D&&L.history.ignore(()=>{x.set({duration:1e3*D.duration})})},[D]),o.default.useEffect(()=>{var ht;if(!D)return;const gt=L.animatedElementsIds,wt=(!gt.length||gt.includes(x.id))&&L.isPlaying,tr=ne&&(wt||H);if(!tr)return void D.pause();tr&&(D.currentTime=x.startTime*D.duration,D.play());const Vt=new p.default.Animation(()=>{De()},(ht=W.current)===null||ht===void 0?void 0:ht.getLayer());Vt.start();const _t=()=>{z(!1),D.currentTime=x.startTime*D.duration},it=()=>{D.currentTime>=x.endTime*D.duration&&(D.pause(),D.currentTime=x.startTime*D.duration,z(!1))};return D.addEventListener("ended",_t),D.addEventListener("timeupdate",it),()=>{D.pause(),Vt.stop(),D.removeEventListener("ended",_t),D.removeEventListener("timeupdate",it)}},[D,H,L.isPlaying,ne]),o.default.useEffect(()=>{D&&(D.volume=x.volume)},[D,x.volume]);const ee=o.default.useRef();o.default.useEffect(()=>{const ht=(0,u.autorun)(()=>{var gt,wt;if(D){const tr=L.animatedElementsIds;if(tr.length&&!tr.includes(x.id))return;const Vt=(L.currentTime-x.page.startTime)%x.duration;if(Math.abs(1e3*D.currentTime-Vt)>500||!L.isPlaying){const _t=Vt/1e3;_t!==D.currentTime&&(D.currentTime=_t),D.readyState!==4&&!L.isPlaying&&!ee.current&&(ee.current=(0,_.incrementLoader)(`video ${x.id}`))}De(),(wt=(gt=W.current)===null||gt===void 0?void 0:gt.getLayer())===null||wt===void 0||wt.batchDraw()}});return()=>{ht(),ee.current&&(ee.current(),ee.current=null)}},[L,D]),o.default.useEffect(()=>{if(!D)return;const ht=()=>{var wt,tr;D.readyState!==4&&x.page._exportingOrRendering||ee.current&&(De(),(tr=(wt=W.current)===null||wt===void 0?void 0:wt.getLayer())===null||tr===void 0||tr.batchDraw(),ee.current(),ee.current=null)};let gt;return x.page._exportingOrRendering&&(gt=setInterval(ht,50)),D.addEventListener("timeupdate",ht),D.addEventListener("canplay",ht),()=>{clearInterval(gt),D.removeEventListener("timeupdate",ht),D.removeEventListener("canplay",ht)}},[x.page._exportingOrRendering,D,x.id,_.incrementLoader]);let{cropX:ae,cropY:se,cropWidth:ce,cropHeight:me}=x;K!=="loaded"&&(ae=se=0,ce=me=1);const xe=Z.width*ce,Oe=Z.height*me,Re=x.width/x.height;let Se,ve;const He=xe/Oe,we=x.type==="svg";we?(Se=xe,ve=Oe):Re>=He?(Se=xe,ve=xe/Re):(Se=Oe*Re,ve=Oe);const Ae={x:Z.width*ae,y:Z.height*se,width:Se,height:ve},Ee=(A=x.cornerRadius)!==null&&A!==void 0?A:0,[Ne,he]=(0,e.useCornerRadiusAndCrop)(x,Z,Ae,L._elementsPixelRatio,Ee,N||x._cropModeEnabled||x.type==="svg");let[Le,Ce]=((ht,gt,wt,tr)=>{const Vt=(bt=>{const[Ue,St]=o.default.useState(bt);return o.default.useEffect(()=>{(async()=>{const kt=await async function(Ft){if(!(Ft.indexOf("data:image/svg+xml")>=0||Ft.indexOf(".svg")>=0))return Ft;const zt=await E.urlToString(Ft),Wt=E.fixSize(zt);return E.svgToURL(Wt)}(bt);kt!==Ue&&St(kt)})()},[bt]),Ue})(ht.clipSrc||""),[_t,it]=(0,h.default)(Vt,"anonymous"),Bt=ht.clipSrc?it:"loaded";(0,e.useLoader)(Bt,ht.clipSrc,ht.id);const Ve=o.default.useMemo(()=>{if(gt&&_t)return b()},[gt,_t]);function Fe(){var bt;if(!_t||!gt||!gt.width||!gt.height||!_t||!_t.width||!_t.height||!Ve)return;const Ue=b(),St=Math.max(ht.width/_t.width*wt,ht.height/_t.height*wt);Ue.width=_t.width*St,Ue.height=_t.height*St,(bt=Ue.getContext("2d"))===null||bt===void 0||bt.drawImage(_t,0,0,Ue.width,Ue.height),Ve.width=Math.max(gt.width,1),Ve.height=Math.max(gt.height,1);const kt=Ve.getContext("2d");kt&&(kt.save(),kt.drawImage(Ue,0,0,gt.width,gt.height),p.default.Util.releaseCanvas(Ue),kt.globalCompositeOperation="source-in",kt.drawImage(gt,0,0,Ve.width,Ve.height),kt.restore())}return o.default.useLayoutEffect(()=>{Fe()},[Ve,gt,_t,ht.width,ht.height,wt,...tr]),[ht.clipSrc&&_t?Ve:gt,Fe]})(x,Ne,L._elementsPixelRatio,[Ae,Ee,L._elementsPixelRatio]);function De(){he(),Ce()}const tt=Math.max(x.width/Se,x.height/ve);o.default.useEffect(()=>{var ht;if(!x._cropModeEnabled)return;const gt=(ht=W.current)===null||ht===void 0?void 0:ht.getStage();function wt(Vt){x._cropModeEnabled&&Vt.target!==G.current&&x.toggleCropMode(!1)}function tr(Vt){x._cropModeEnabled&&Vt.target.parentNode!==gt.content&&x.toggleCropMode(!1)}return document.body.addEventListener("click",tr),gt==null||gt.on("click",wt),gt==null||gt.on("tap",wt),()=>{document.body.removeEventListener("click",tr),document.body.removeEventListener("touchstart",tr),gt==null||gt.off("click",wt),gt==null||gt.off("click",wt)}},[x._cropModeEnabled]),o.default.useLayoutEffect(()=>{if(!N&&!x._cropModeEnabled)return(0,y.applyFilter)(W.current,x),(0,u.autorun)(()=>{(0,y.applyFilter)(W.current,x)},{delay:100})},[Z,N,ce,me,x._cropModeEnabled]),o.default.useLayoutEffect(()=>{var ht;N||x._cropModeEnabled?(ht=W.current)===null||ht===void 0||ht.clearCache():(0,y.applyFilter)(W.current,x)},[N,x.width,x.height,x._cropModeEnabled]),o.default.useEffect(()=>{(0,y.applyFilter)(W.current,x)},[x.shadowEnabled,x.shadowBlur,x.cornerRadius,x.shadowColor,x.shadowOffsetX,x.shadowOffsetY,x.shadowOpacity]);const vt=o.default.useRef(null),mt=o.default.useRef(null),Et=o.default.useRef(null);o.default.useLayoutEffect(()=>{x._cropModeEnabled&&(mt.current.nodes([vt.current]),Et.current.nodes([G.current]))},[x._cropModeEnabled]);const nt=ht=>{Math.round(ht.target.x())>0&&(ht.target.x(0),ht.target.scaleX(1)),Math.round(ht.target.y())>0&&(ht.target.y(0),ht.target.scaleY(1));const gt=ht.target.width()*ht.target.scaleX(),wt=ht.target.height()*ht.target.scaleY(),tr=Math.min(1,Se/gt),Vt=Math.min(1,ve/wt),_t=1-tr,it=Math.min(_t,Math.max(0,Math.round(-ht.target.x())/gt)),Bt=1-Vt,Ve=Math.min(Bt,Math.max(0,Math.round(-ht.target.y())/wt));ht.target.setAttrs({x:-it*Z.width,y:-Ve*Z.height,scaleX:1,scaleY:1}),x.set({cropX:it,cropY:Ve,cropWidth:tr,cropHeight:Vt})},at=()=>{x.type!=="svg"&&x.contentEditable&&setTimeout(()=>{x.toggleCropMode(!0)})},qt=K==="loading",Ct=K==="failed",or=!qt&&!Ct,Xt=o.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),qe=or?x.a.opacity:0;(0,g.useFadeIn)(W,qe);const We=x.selectable||L.role==="admin",Nt=(0,v.isTouchDevice)();return o.default.createElement(o.default.Fragment,null,qt&&o.default.createElement(M,{element:x}),Ct&&o.default.createElement(F,{element:x}),o.default.createElement(c.Image,{ref:W,name:"element",id:x.id,image:Le,x:x.a.x,y:x.a.y,width:x.a.width||1,height:x.a.height||1,rotation:x.a.rotation,opacity:qe,shadowEnabled:x.shadowEnabled,shadowBlur:x.shadowBlur,shadowOffsetX:x.shadowOffsetX,shadowOffsetY:x.shadowOffsetY,shadowColor:x.shadowColor,shadowOpacity:x.shadowOpacity,customCrop:Ae,listening:We,draggable:Nt?x.draggable&&V:x.draggable,preventDefault:!Nt||V,hideInExport:!x.showInExport,onMouseEnter:()=>{J(!0)},onMouseLeave:()=>{J(!1)},onDragMove:ht=>{x.set({x:ht.target.x(),y:ht.target.y()})},onDragEnd:ht=>{x.set({x:ht.target.x(),y:ht.target.y()})},onDblClick:at,onDblTap:at,onTransformStart:()=>{I(!0),Xt.current={cropX:x.cropX,cropY:x.cropY,cropWidth:x.cropWidth,cropHeight:x.cropHeight}},onTransform:ht=>{var gt;const wt=ht.currentTarget,tr=Math.abs(wt.scaleX()-1)<1e-7?1:wt.scaleX(),Vt=Math.abs(wt.scaleY()-1)<1e-7?1:wt.scaleY();wt.scaleX(1),wt.scaleY(1);const _t=(gt=ht.target.getStage())===null||gt===void 0?void 0:gt.findOne("Transformer"),it=1-Se/Z.width,Bt=Math.min(it,Math.max(0,x.cropX)),Ve=1-ve/Z.height,Fe=Math.min(Ve,Math.max(0,x.cropY)),bt=_t.getActiveAnchor(),Ue=!(bt.indexOf("middle")>=0||bt.indexOf("center")>=0),St=!Ue&&tr<1&&Xt.current.cropHeight>ve/Z.height;let kt=Ue?x.cropWidth:x.cropWidth*tr;St&&(kt=x.cropWidth);const Ft=!Ue&&Vt<1&&Xt.current.cropWidth>Se/Z.width;let zt=Ue?x.cropHeight:x.cropHeight*Vt;Ft&&(zt=x.cropHeight),we&&(kt=x.cropWidth,zt=x.cropHeight),x.set({cropX:Bt,cropY:Fe,x:wt.x(),y:wt.y(),width:wt.width()*tr,height:wt.height()*Vt,rotation:ht.target.rotation(),cropWidth:Math.min(kt,1-Bt),cropHeight:Math.min(zt,1-Fe)})},onTransformEnd:ht=>{const gt=ht.currentTarget;x.set({width:gt.width(),height:gt.height(),x:gt.x(),y:gt.y(),rotation:ht.target.rotation(),cropWidth:Se/Z.width,cropHeight:ve/Z.height}),I(!1)}}),o.default.createElement(c.Rect,{x:x.a.x,y:x.a.y,width:Math.max(x.a.width-x.borderSize,0),height:Math.max(x.a.height-x.borderSize,0),opacity:qe,offsetX:-x.borderSize/2,offsetY:-x.borderSize/2,stroke:x.borderColor,strokeWidth:x.borderSize,listening:!1,visible:!!x.borderSize,rotation:x.rotation,cornerRadius:Math.max(0,Ee-x.borderSize),hideInExport:!x.showInExport}),!L.isPlaying&&o.default.createElement(c.Image,{image:H?j:O,x:x.a.x,y:x.a.y,offsetX:-x.a.width/2+15/L.scale,offsetY:-x.a.height/2+15/L.scale,rotation:x.a.rotation,width:30/L.scale,height:30/L.scale,hideInExport:!0,onClick:()=>z(!H),onTap:()=>z(!H)}),x._cropModeEnabled&&o.default.createElement(w.Portal,{selector:".page-abs-container",enabled:!0},o.default.createElement(c.Rect,{x:-window.innerWidth/L.scale,y:-window.innerWidth/L.scale,width:window.innerWidth/L.scale*3,height:window.innerWidth/L.scale*3,fill:"rgba(0,0,0,0.3)"}),o.default.createElement(c.Image,{listening:!1,image:Le,x:x.a.x,y:x.a.y,width:x.a.width,height:x.a.height,rotation:x.a.rotation,shadowEnabled:x.shadowEnabled,shadowBlur:x.shadowBlur}),o.default.createElement(c.Group,{x:x.a.x,y:x.a.y,rotation:x.a.rotation,scaleX:tt,scaleY:tt},o.default.createElement(c.Image,{image:Z,ref:G,opacity:.4,draggable:!0,x:-x.cropX*Z.width,y:-x.cropY*Z.height,onDragMove:nt,onTransform:nt}),o.default.createElement(c.Transformer,{ref:Et,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(ht,gt)=>gt.width<5||gt.height<5?ht:gt,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),o.default.createElement(c.Rect,{width:Se,height:ve,ref:vt,listening:!1,onTransform:ht=>{ht.target.x()<-x.cropX*Z.width-1e-9&&(ht.target.x(-x.cropX*Z.width),ht.target.scaleX(1)),ht.target.y()<-x.cropY*Z.height-1e-9&&(ht.target.y(-x.cropY*Z.height),ht.target.scaleY(1));const gt=Math.min(1,Math.max(0,x.cropX+ht.target.x()/Z.width)),wt=Math.min(1,Math.max(0,ht.target.y()/Z.height+x.cropY)),tr=ht.target.width()*ht.target.scaleX(),Vt=ht.target.height()*ht.target.scaleY(),_t=Math.min(1-gt,tr/Z.width),it=Math.min(1-wt,Vt/Z.height),Bt=ht.target.getAbsolutePosition(ht.target.getParent().getParent());ht.target.scale({x:1,y:1}),ht.target.position({x:0,y:0}),x.set({x:Bt.x,y:Bt.y,cropX:gt,cropY:wt,cropWidth:_t,cropHeight:it,width:Math.min(tr*tt,Z.width*(1-gt)*tt),height:Math.min(Vt*tt,Z.height*(1-wt)*tt)})}}),o.default.createElement(c.Transformer,{ref:mt,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(ht,gt)=>gt.width<5||gt.height<5?ht:gt,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2,visible:x.resizable}))),($||V)&&o.default.createElement(d.Highlighter,{element:x}))})}(Bl)),Bl}var $d={},Ov={},Z3;function km(){return Z3||(Z3=1,function(e){function r({width:c,height:h}){const p=c/2,w=h/2,d=c/2,_=h/2,E=d/2,S=_/2;let y="",g=Math.PI/5;for(let v=0;v<10;v++){const b=v%2==0?_:S,O=p+(v%2==0?d:E)*Math.sin(v*g),j=w-b*Math.cos(v*g);v===0?y=`M ${O} ${j}`:y+=` L ${O} ${j}`}return y+" Z"}function t({width:c,height:h}){const p=c/2,w=h/2;return`M ${p} 0 L ${c} ${w} L ${p} ${h} L 0 ${w} Z`}function n({width:c,height:h}){const p=c/2,w=h/2,d=c/2,_=h/2;let E="",S=2*Math.PI/5;for(let y=0;y<5;y++){const g=_,v=p+d*Math.sin(y*S),b=w-g*Math.cos(y*S);y===0?E=`M ${v} ${b}`:E+=` L ${v} ${b}`}return E+" Z"}function a({width:c,height:h}){const p=c/2,w=h/2,d=c/2,_=h/2;let E="",S=2*Math.PI/6;for(let y=0;y<6;y++){const g=_,v=p+d*Math.sin(y*S),b=w-g*Math.cos(y*S);y===0?E=`M ${v} ${b}`:E+=` L ${v} ${b}`}return E+" Z"}function i({path:c,aspectRatio:h,width:p,height:w}){return{path:c,scaleX:p/h.width,scaleY:w/h.height}}function o({width:c,height:h}){const p=.1*Math.min(c,h),w=.2*c,d=.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-d),E+=` A ${p},${p} 0 0 1 ${c-p},${h-d}`,E+=` H ${_+w/2}`,E+=` L ${_},${h}`,E+=` L ${_-w/2},${h-d}`,E+=` H ${p}`,E+=` A ${p},${p} 0 0 1 0,${h-p-d}`,E+=` V ${p}`,E+=` A ${p},${p} 0 0 1 ${p},0`,E+=" Z",E}function l({width:c,height:h}){const p=.3*c,w=.3*h,d=c/2,_=h/2,E=d-p/2,S=d+p/2,y=_-w/2,g=_+w/2;let v=`M ${E},0 `;return v+=`H ${S} `,v+=`V ${y} `,v+=`H ${c} `,v+=`V ${g} `,v+=`H ${S} `,v+=`V ${h} `,v+=`H ${E} `,v+=`V ${g} `,v+="H 0 ",v+=`V ${y} `,v+=`H ${E} `,v+="V 0 ",v+="Z",v}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=l,e.subTypeToPathDataFunc=u,e.figureToSvg=function(c){const{subType:h}=c,p=u(h);return p?function(w,d){const{width:_,height:E,fill:S,stroke:y,strokeWidth:g,dash:v}=w,b=(v||[]).map(F=>F*g);let O=d(w),j=1,T=1;typeof O!="string"&&(j=O.scaleX,T=O.scaleY,O=O.path);const M=`clip-${w.id||Math.random()}`;return`
|
|
248
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${_}" height="${E}">
|
|
249
|
-
<defs>
|
|
250
|
-
<clipPath id="${M}">
|
|
251
|
-
<path d="${O}" />
|
|
252
|
-
</clipPath>
|
|
253
|
-
</defs>
|
|
254
|
-
|
|
255
|
-
<!-- Path for the fill -->
|
|
256
|
-
<path d="${O}" fill="${S}" transform="scale(${j}, ${T})"/>
|
|
257
|
-
|
|
258
|
-
<!-- Path for the stroke, clipped by the star path -->
|
|
259
|
-
<path d="${O}" fill="none" stroke="${y}" stroke-width="${2*g}" clip-path="url(#${M})" transform="scale(${j}, ${T})" stroke-dasharray="${b.join(" ")}"/>
|
|
260
|
-
</svg>
|
|
261
|
-
`}(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 w=Math.min(p,c/2,h/2);return`M 0 ${w} A ${w} ${w} 0 0 1 ${w} 0 L ${c-w} 0 A ${w} ${w} 0 0 1 ${c} ${w} L ${c} ${h-w} A ${w} ${w} 0 0 1 ${c-w} ${h} L ${w} ${h} A ${w} ${w} 0 0 1 0 ${h-w} 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:l,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})}}(Ov)),Ov}var Q3;function kC(){return Q3||(Q3=1,function(e){var r=$d&&$d.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const t=r(di()),n=zs,a=Fu,i=km(),o=Ff(),l=rf(),u=Pp(),c={};e.FigureElement=(0,n.observer)(({element:h,store:p})=>{const w=h.selectable||p.role==="admin",d=(0,l.isTouchDevice)(),[_,E]=t.default.useState(!1),S=p.selectedShapes.indexOf(h)>=0&&h.selectable,y=Math.min(h.strokeWidth,h.width/2,h.height/2),g=Math.max(0,Math.min(h.width/2,h.height/2,h.cornerRadius)),v=(0,u.useColor)(h,h.a.fill,"fill"),b=Object.assign(Object.assign({width:h.a.width,height:h.a.height},v),{cornerRadius:g,opacity:h.animated("opacity"),shadowEnabled:h.shadowEnabled,shadowBlur:h.shadowBlur,shadowOffsetX:h.shadowOffsetX,shadowOffsetY:h.shadowOffsetY,shadowColor:h.shadowColor,shadowOpacity:h.shadowOpacity,preventDefault:!d||S,hideInExport:!h.showInExport}),O=(0,u.useColor)(h,h.stroke,"stroke"),j=Object.assign(Object.assign({visible:y>0,x:y/2,y:y/2,width:h.a.width-y,height:h.a.height-y},O),{strokeWidth:y,cornerRadius:Math.max(0,g-y),dash:h.dash.map(C=>C*y),opacity:h.animated("opacity"),hideInExport:!h.showInExport,listening:!1}),T=(M=h.subType,c[M]||(c[M]=(F=(0,i.subTypeToPathDataFunc)(M),(0,n.observer)(({element:C,fillProps:x,strokeProps:L})=>{let A=F({width:C.a.width,height:C.a.height,cornerRadius:C.cornerRadius}),N=1,I=1;typeof A!="string"&&(N=A.scaleX,I=A.scaleY,A=A.path);const W=t.default.useRef(null);return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Rect,{width:C.width,height:C.height,fill:"transparent"}),t.default.createElement(a.Path,Object.assign({},x,{ref:W,data:A,scaleX:N,scaleY:I})),t.default.createElement(a.Group,{clipFunc:G=>{const $=W.current;if($){var J=$.dataArray;G.beginPath();for(var V=0;V<J.length;V++){var H=J[V].command,z=J[V].points;switch(H){case"L":G.lineTo(z[0],z[1]);break;case"M":G.moveTo(z[0],z[1]);break;case"C":G.bezierCurveTo(z[0],z[1],z[2],z[3],z[4],z[5]);break;case"Q":G.quadraticCurveTo(z[0],z[1],z[2],z[3]);break;case"A":var D=z[0],K=z[1],ne=z[2],Z=z[3],ee=z[4],ae=z[5],se=z[6],ce=z[7],me=ne>Z?ne:Z,xe=ne>Z?1:ne/Z,Oe=ne>Z?Z/ne:1;G.translate(D,K),G.rotate(se),G.scale(xe,Oe),G.arc(0,0,me,ee,ee+ae,1-ce),G.scale(1/xe,1/Oe),G.rotate(-se),G.translate(-D,-K);break;case"z":G.closePath()}}}},scaleX:N,scaleY:I},t.default.createElement(a.Path,Object.assign({},L,{x:0,y:0,data:A,strokeWidth:2*L.strokeWidth,dash:L.dash.map(G=>G)}))))}))),c[M]||a.Group);var M,F;return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Group,{id:h.id,x:h.a.x,y:h.a.y,rotation:h.a.rotation,opacity:h.a.opacity,listening:w,draggable:d?h.draggable&&S:h.draggable,name:"element",onMouseEnter:()=>{E(!0)},onMouseLeave:()=>{E(!1)},onDragMove:C=>{h.set({x:C.target.x(),y:C.target.y()})},onDragEnd:C=>{h.set({x:C.target.x(),y:C.target.y()})},onTransform:C=>{const x=C.target.scale();C.target.scaleX(1),C.target.scaleY(1),h.set({width:h.width*x.x,height:h.height*x.y,x:C.target.x(),y:C.target.y(),rotation:C.target.rotation()})}},t.default.createElement(T,{element:h,fillProps:b,strokeProps:j})),(_||S)&&t.default.createElement(o.Highlighter,{element:h}))})}($d)),$d}var Yd={},ac={},Av={},oc={},J3;function t_(){if(J3)return oc;J3=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]:{},l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:o;if(Array.isArray(i))i.forEach(function(c){return n(a,c,o,l)});else if(typeof i=="function")i(a,o,l,n);else{var u=Object.keys(i)[0];Array.isArray(i[u])?(l[u]={},n(a,i[u],o,l[u])):l[u]=i[u](a,o,l,n)}return o};oc.parse=e;var r=function(a,i){return function(o,l,u,c){i(o,l,u)&&c(o,a,l,u)}};oc.conditional=r;var t=function(a,i){return function(o,l,u,c){for(var h=[],p=o.pos;i(o,l,u);){var w={};if(c(o,a,l,w),o.pos===p)break;p=o.pos,h.push(w)}return h}};return oc.loop=t,oc}var Xi={},e4;function r_(){if(e4)return Xi;e4=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(w){return w.data[w.pos+p]}};Xi.peekByte=t;var n=function(p){return function(w){return w.data.subarray(w.pos,w.pos+=p)}};Xi.readBytes=n;var a=function(p){return function(w){return w.data.subarray(w.pos,w.pos+p)}};Xi.peekBytes=a;var i=function(p){return function(w){return Array.from(n(p)(w)).map(function(d){return String.fromCharCode(d)}).join("")}};Xi.readString=i;var o=function(p){return function(w){var d=n(2)(w);return p?(d[1]<<8)+d[0]:(d[0]<<8)+d[1]}};Xi.readUnsigned=o;var l=function(p,w){return function(d,_,E){for(var S=typeof w=="function"?w(d,_,E):w,y=n(p),g=new Array(S),v=0;v<S;v++)g[v]=y(d);return g}};Xi.readArray=l;var u=function(p,w,d){for(var _=0,E=0;E<d;E++)_+=p[w+E]&&Math.pow(2,d-E-1);return _},c=function(p){return function(w){for(var d=r()(w),_=new Array(8),E=0;E<8;E++)_[7-E]=!!(d&1<<E);return Object.keys(p).reduce(function(S,y){var g=p[y];return g.length?S[y]=u(_,g.index,g.length):S[y]=_[g.index],S},{})}};return Xi.readBits=c,Xi}var t4;function LC(){return t4||(t4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=t_(),t=r_(),n={blocks:function(w){for(var d=0,_=[],E=w.data.length,S=0,y=(0,t.readByte)()(w);y!==d&&y;y=(0,t.readByte)()(w)){if(w.pos+y>=E){var g=E-w.pos;_.push((0,t.readBytes)(g)(w)),S+=g;break}_.push((0,t.readBytes)(y)(w)),S+=y}for(var v=new Uint8Array(S),b=0,O=0;O<_.length;O++)v.set(_[O],b),b+=_[O].length;return v}},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 w=(0,t.peekBytes)(2)(p);return w[0]===33&&w[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,w,d){return Math.pow(2,d.descriptor.lct.size+1)})},function(p,w,d){return d.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(w,d,_){return(0,t.readBytes)(_.text.blockSize)(w)}},n]},function(p){var w=(0,t.peekBytes)(2)(p);return w[0]===33&&w[1]===1}),l=(0,r.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(w,d,_){return(0,t.readString)(_.blockSize)(w)}},n]},function(p){var w=(0,t.peekBytes)(2)(p);return w[0]===33&&w[1]===255}),u=(0,r.conditional)({comment:[{codes:(0,t.readBytes)(2)},n]},function(p){var w=(0,t.peekBytes)(2)(p);return w[0]===33&&w[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,w){return Math.pow(2,w.lsd.gct.size+1)})},function(p,w){return w.lsd.gct.exists}),{frames:(0,r.loop)([a,l,u,i,o],function(p){var w=(0,t.peekByte)()(p);return w===33||w===44})}],h=c;e.default=h}(Av)),Av}var Xd={},r4;function NC(){if(r4)return Xd;r4=1,Object.defineProperty(Xd,"__esModule",{value:!0}),Xd.deinterlace=void 0;var e=function(t,n){for(var a=new Array(t.length),i=t.length/n,o=function(d,_){var E=t.slice(_*n,(_+1)*n);a.splice.apply(a,[d*n,n].concat(E))},l=[0,4,2,1],u=[8,8,4,2],c=0,h=0;h<4;h++)for(var p=l[h];p<i;p+=u[h])o(p,c),c++;return a};return Xd.deinterlace=e,Xd}var Kd={},n4;function TC(){if(n4)return Kd;n4=1,Object.defineProperty(Kd,"__esModule",{value:!0}),Kd.lzw=void 0;var e=function(t,n,a){var i=4096,o=-1,l=a,u,c,h,p,w,d,_,T,E,S,j,y,M,F,x,C,g=new Array(a),v=new Array(i),b=new Array(i),O=new Array(i+1);for(y=t,c=1<<y,w=c+1,u=c+2,_=o,p=y+1,h=(1<<p)-1,E=0;E<c;E++)v[E]=0,b[E]=E;var j,T,M,F,C,x;for(j=T=M=F=C=x=0,S=0;S<l;){if(F===0){if(T<p){j+=n[x]<<T,T+=8,x++;continue}if(E=j&h,j>>=p,T-=p,E>u||E==w)break;if(E==c){p=y+1,h=(1<<p)-1,u=c+2,_=o;continue}if(_==o){O[F++]=b[E],_=E,M=E;continue}for(d=E,E==u&&(O[F++]=M,E=_);E>c;)O[F++]=b[E],E=v[E];M=b[E]&255,O[F++]=M,u<i&&(v[u]=_,b[u]=M,u++,(u&h)===0&&u<i&&(p++,h+=u)),_=d}F--,g[C++]=O[F],S++}for(S=C;S<l;S++)g[S]=0;return g};return Kd.lzw=e,Kd}var i4;function RC(){if(i4)return ac;i4=1,Object.defineProperty(ac,"__esModule",{value:!0}),ac.decompressFrames=ac.decompressFrame=ac.parseGIF=void 0;var e=i(LC()),r=t_(),t=r_(),n=NC(),a=TC();function i(h){return h&&h.__esModule?h:{default:h}}var o=function(p){var w=new Uint8Array(p);return(0,r.parse)((0,t.buildStream)(w),e.default)};ac.parseGIF=o;var l=function(p){for(var w=p.pixels.length,d=new Uint8ClampedArray(w*4),_=0;_<w;_++){var E=_*4,S=p.pixels[_],y=p.colorTable[S]||[0,0,0];d[E]=y[0],d[E+1]=y[1],d[E+2]=y[2],d[E+3]=S!==p.transparentIndex?255:0}return d},u=function(p,w,d){if(!p.image){console.warn("gif frame does not have associated image.");return}var _=p.image,E=_.descriptor.width*_.descriptor.height,S=(0,a.lzw)(_.data.minCodeSize,_.data.blocks,E);_.descriptor.lct.interlaced&&(S=(0,n.deinterlace)(S,_.descriptor.width));var y={pixels:S,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?y.colorTable=_.lct:y.colorTable=w,p.gce&&(y.delay=(p.gce.delay||10)*10,y.disposalType=p.gce.extras.disposal,p.gce.extras.transparentColorGiven&&(y.transparentIndex=p.gce.transparentColorIndex)),d&&(y.patch=l(y)),y};ac.decompressFrame=u;var c=function(p,w){return p.frames.filter(function(d){return d.image}).map(function(d){return u(d,p.gct,w)})};return ac.decompressFrames=c,ac}var a4;function MC(){return a4||(a4=1,function(e){var r=Yd&&Yd.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0}),e.GifElement=void 0;const t=r(di()),n=zs,a=fl,i=Fu,o=r(Us()),l=RC(),u=Ff(),c=e_(),h=Em(),p=Ap(),w=If(),d=rf();function _(y,g,v){const b=g.getContext("2d"),O=v.getContext("2d");if(!b||!O)return;y.disposalType===2&&b.clearRect(0,0,g.width,g.height),v.width=y.width,v.height=y.height;const j=O.createImageData(y.width,y.height);j.data.set(y.patch),O.putImageData(j,0,0),b.drawImage(v,y.left,y.top)}const E=(0,n.observer)(({element:y})=>{const g=Math.min(30,y.width/4,y.height/4),v=t.default.useRef(null);return t.default.useEffect(()=>{const b=v.current;if(!b)return;const O=new o.default.Animation(j=>{b.rotate(((j==null?void 0:j.timeDiff)||0)/2)},b.getLayer());return O.start(),()=>{O.stop()}},[]),t.default.createElement(i.Group,{x:y.a.x,y:y.a.y,rotation:y.a.rotation,listening:!1,opacity:y.a.opacity,hideInExport:!y.showInExport},t.default.createElement(i.Rect,{width:y.width,height:y.height,fill:"rgba(124, 173, 212, 0.8)"}),t.default.createElement(i.Arc,{ref:v,x:y.width/2,y:y.height/2,fill:"white",outerRadius:Math.abs(g),innerRadius:Math.max(1,g-5),angle:270}))}),S=(0,n.observer)(({element:y})=>{const g=Math.max(10,Math.min(30,y.width/22));return t.default.createElement(i.Group,{x:y.a.x,y:y.a.y,rotation:y.a.rotation,listening:!1,opacity:y.a.opacity,hideInExport:!y.showInExport},t.default.createElement(i.Rect,{width:y.width,height:y.height,fill:"rgba(223, 102, 102, 0.8)"}),t.default.createElement(i.Text,{text:"Cannot load the GIF...",fontSize:g,width:y.width,height:y.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});e.GifElement=(0,n.observer)(({element:y,store:g})=>{var v;const[b,O]=t.default.useState(!1),[j,T]=t.default.useState(!1),M=g.selectedShapes.indexOf(y)>=0&&y.selectable,F=t.default.useRef(null),C=t.default.useRef(),[x,L,A,N]=function(ae){const[se,ce]=t.default.useState([]),[me,xe]=t.default.useState(0),[Oe,Re]=t.default.useState("loading"),[Se,ve]=t.default.useState({width:0,height:0});return t.default.useEffect(()=>{(async()=>{try{const He=await fetch(ae),we=await He.arrayBuffer(),Ae=(0,l.parseGIF)(we),Ee=(0,l.decompressFrames)(Ae,!0),Ne=Ae.lsd.width,he=Ae.lsd.height;ve({width:Ne,height:he});const Le=Ee.map(De=>({patch:new Uint8ClampedArray(De.patch),delay:De.delay,width:De.dims.width,height:De.dims.height,left:De.dims.left,top:De.dims.top,disposalType:De.disposalType})),Ce=Le.reduce((De,tt)=>De+tt.delay,0);ce(Le),xe(Ce),Re("loaded")}catch(He){console.error("Failed to load GIF:",He),Re("failed")}})()},[ae]),[se,me,Se,Oe]}(y.src);(0,h.useImageLoader)(N,y.src,y.id),t.default.useEffect(()=>(C.current=document.createElement("canvas"),()=>{C.current&&o.default.Util.releaseCanvas(C.current)}),[]),t.default.useEffect(()=>{if(N==="loaded"&&C.current&&(C.current.width=A.width,C.current.height=A.height,x.length>0)){const ae=C.current.getContext("2d");if(ae){ae.clearRect(0,0,A.width,A.height);const se=document.createElement("canvas");_(x[0],C.current,se)}}},[A,N,x]),t.default.useEffect(()=>{if(!x.length||!C.current)return;const ae=C.current;ae.width=A.width,ae.height=A.height;const se=document.createElement("canvas"),ce=ae.getContext("2d");ce&&ce.clearRect(0,0,ae.width,ae.height);let me=-1;_(x[0],ae,se),z(),me=0;const xe=Oe=>{const Re=(Se=>{const ve=Se%L;let He=0;for(let we=0;we<x.length;we++)if(He+=x[we].delay,He>ve)return we;return 0})(Oe);Re!==me&&(_(x[Re],ae,se),z(),F.current.getLayer().draw(),me=Re)};if(g.isPlaying||y.page._exportingOrRendering)return(0,a.autorun)(()=>{xe(g.currentTime-y.page.startTime)});{const Oe=window.setInterval(()=>{xe(g.currentTime||performance.now())},16);return()=>{clearInterval(Oe)}}},[g.isPlaying,x,L,y.page._exportingOrRendering]),t.default.useEffect(()=>{L&&g.history.ignore(()=>{y.set({duration:L})})},[L]);let{cropX:I,cropY:W,cropWidth:G,cropHeight:$}=y;N!=="loaded"&&(I=W=0,G=$=1);const J={x:A.width*I,y:A.height*W,width:A.width*G,height:A.height*$},V=(v=y.cornerRadius)!==null&&v!==void 0?v:0,[H,z]=(0,c.useCornerRadiusAndCrop)(y,C.current,J,g._elementsPixelRatio,V,b||y._cropModeEnabled);t.default.useLayoutEffect(()=>{if(!b&&!y._cropModeEnabled&&F.current)return(0,p.applyFilter)(F.current,y),(0,a.autorun)(()=>{(0,p.applyFilter)(F.current,y)},{delay:100})},[C.current,b,G,$,y._cropModeEnabled,A.width,A.height]);const D=N==="loading",K=N==="failed",ne=D||K?0:y.a.opacity;(0,w.useFadeIn)(F,ne);const Z=y.selectable||g.role==="admin",ee=(0,d.isTouchDevice)();return t.default.createElement(t.default.Fragment,null,D&&t.default.createElement(E,{element:y}),K&&t.default.createElement(S,{element:y}),t.default.createElement(i.Image,{ref:F,name:"element",id:y.id,image:H,x:y.a.x,y:y.a.y,width:y.a.width||1,height:y.a.height||1,rotation:y.a.rotation,opacity:ne,shadowEnabled:y.shadowEnabled,shadowBlur:y.shadowBlur,shadowOffsetX:y.shadowOffsetX,shadowOffsetY:y.shadowOffsetY,shadowColor:y.shadowColor,shadowOpacity:y.shadowOpacity,customCrop:J,listening:Z,draggable:ee?y.draggable&&M:y.draggable,preventDefault:!ee||M,hideInExport:!y.showInExport,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),onDragMove:ae=>{y.set({x:ae.target.x(),y:ae.target.y()})},onDragEnd:ae=>{y.set({x:ae.target.x(),y:ae.target.y()})},onTransformStart:()=>O(!0),onTransform:ae=>{const se=ae.currentTarget,ce=Math.abs(se.scaleX()-1)<1e-7?1:se.scaleX(),me=Math.abs(se.scaleY()-1)<1e-7?1:se.scaleY();se.scaleX(1),se.scaleY(1),y.set({x:se.x(),y:se.y(),width:se.width()*ce,height:se.height()*me,rotation:se.rotation()})},onTransformEnd:()=>O(!1)}),t.default.createElement(i.Rect,{x:y.a.x,y:y.a.y,width:Math.max(y.a.width-y.borderSize,0),height:Math.max(y.a.height-y.borderSize,0),opacity:ne,offsetX:-y.borderSize/2,offsetY:-y.borderSize/2,stroke:y.borderColor,strokeWidth:y.borderSize,listening:!1,visible:!!y.borderSize,rotation:y.rotation,cornerRadius:Math.max(0,V-y.borderSize),hideInExport:!y.showInExport}),(j||M)&&t.default.createElement(u.Highlighter,{element:y}))})}(Yd)),Yd}var o4;function IC(){return o4||(o4=1,function(e){var r=Fd&&Fd.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeComponent=function(S,y){_[S]=y};const t=r(di()),n=zs,a=D8(),i=Em(),o=AC(),l=CC(),u=e_(),c=kC(),h=MC(),p=Fu,w=tf(),d=(0,n.observer)(S=>{const{element:y,store:g}=S,{children:v}=y,b=y.selectable||g.role==="admin";return t.default.createElement(p.Group,{opacity:y.opacity,listening:b,hideInExport:!y.showInExport},v.map(O=>t.default.createElement(E,Object.assign({},S,{key:O.id,store:g,element:O}))))}),_={text:a.TextElement,image:i.ImageElement,svg:i.ImageElement,line:l.LineElement,video:u.VideoElement,figure:c.FigureElement,group:d,gif:h.GifElement},E=(0,n.observer)(S=>{let y=_[S.element.type];return S.element.type==="text"&&w.flags.htmlRenderEnabled&&(y=o.HTMLElement),S.element.visible?y?t.default.createElement(y,Object.assign({},S)):(console.error("Can not find component for "+S.element.type),null):null});e.default=E}(Fd)),Fd}var Cv={},s4;function jC(){return s4||(s4=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 l=0,u=0;return n==="left-top"?(l=0,u=0):n==="left-middle"?(l=0,u=(r.height-o)/2):n==="left-bottom"?(l=0,u=r.height-o):n==="center-top"?(l=(r.width-i)/2,u=0):n==="center-middle"?(l=(r.width-i)/2,u=(r.height-o)/2):n==="center-bottom"?(l=(r.width-i)/2,u=r.height-o):n==="right-top"?(l=r.width-i,u=0):n==="right-middle"?(l=r.width-i,u=(r.height-o)/2):n==="right-bottom"?(l=r.width-i,u=r.height-o):n==="scale"?(l=0,u=0,i=r.width,o=r.height):console.error(new Error("Unknown clip position property - "+n)),{cropX:l,cropY:u,cropWidth:i,cropHeight:o}}}(Cv)),Cv}var sc={},kv={},l4;function FC(){return l4||(l4=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=Lm();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.
|
|
262
|
-
For production usage you have to use your own API endpoint.
|
|
263
|
-
https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
|
|
264
|
-
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:l})=>`${(0,e.getAPI)()}/get-templates?${l}&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}}(kv)),kv}var u4;function Lm(){return u4||(u4=1,function(e){var r,t=sc&&sc.__createBinding||(Object.create?function(M,F,C,x){x===void 0&&(x=C);var L=Object.getOwnPropertyDescriptor(F,C);L&&!("get"in L?!F.__esModule:L.writable||L.configurable)||(L={enumerable:!0,get:function(){return F[C]}}),Object.defineProperty(M,x,L)}:function(M,F,C,x){x===void 0&&(x=C),M[x]=F[C]}),n=sc&&sc.__setModuleDefault||(Object.create?function(M,F){Object.defineProperty(M,"default",{enumerable:!0,value:F})}:function(M,F){M.default=F}),a=sc&&sc.__importStar||(r=function(M){return r=Object.getOwnPropertyNames||function(F){var C=[];for(var x in F)Object.prototype.hasOwnProperty.call(F,x)&&(C[C.length]=x);return C},r(M)},function(M){if(M&&M.__esModule)return M;var F={};if(M!=null)for(var C=r(M),x=0;x<C.length;x++)C[x]!=="default"&&t(F,M,C[x]);return n(F,M),F});Object.defineProperty(e,"__esModule",{value:!0}),e.__=e.getKey=e.isCreditVisible=e.___=void 0,e.isKeyPaid=T,e.validateKey=async function(M,F){p=M,await T(M)&&!F||h()};const i=a(fl),o=FC(),l=tf(),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 w=5,d=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",S="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",y="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let g=window.location.origin;const v=navigator.userAgent.indexOf("Headless")>-1,b=navigator.userAgent.indexOf("Electron")>-1;g==="file://"&&v&&(g="headless"),g==="file://"&&b&&(g="electron");const O=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${g}" here: https://polotno.com/cabinet`;let j=fetch;async function T(M){for(let F=0;F<w;F++)try{const C=await j((0,o.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:M,site:location.host,skdVersion:"2.21.8"})});if(c.value=C.headers.get("x-api-version"),!M)return console.warn(_),!1;if(C.status!==200){await new Promise(L=>setTimeout(L,d));continue}const x=await C.json();return x.is_valid||console.warn(E),x.is_paid||console.log(y,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),x.is_domain_valid||console.log(O,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,l.useRemoveBackground)(x.remove_background_enabled),x.is_paid||!1}catch{await new Promise(x=>setTimeout(x,d))}return console.error(S),!0}e.__=M=>{j=M}}(sc)),sc}var Lv={},c4;function Nm(){return c4||(c4=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`}}}(Lv)),Lv}var f4;function DC(){return f4||(f4=1,function(e){var r=yf&&yf.__rest||function(D,K){var ne={};for(var Z in D)Object.prototype.hasOwnProperty.call(D,Z)&&K.indexOf(Z)<0&&(ne[Z]=D[Z]);if(D!=null&&typeof Object.getOwnPropertySymbols=="function"){var ee=0;for(Z=Object.getOwnPropertySymbols(D);ee<Z.length;ee++)K.indexOf(Z[ee])<0&&Object.prototype.propertyIsEnumerable.call(D,Z[ee])&&(ne[Z[ee]]=D[Z[ee]])}return ne},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,K){C[D]=C[D]||K,Object.assign(C[D],K)};const n=t(di()),a=zs,i=fl,o=Fu,l=t(r0()),u=t(Us()),c=t(IC()),h=J8(),p=Em(),w=jC(),d=Lm(),_=Fh(),E=Nm(),S=tf(),y=rf(),g=Pp(),v=hm(),b=Mh,O=u.default.DD._drag;window.removeEventListener("mousemove",O),u.default.DD._drag=function(D){(0,i.runInAction)(()=>{O.call(this,D)})},window.addEventListener("mousemove",u.default.DD._drag);const j=new u.default.Group,T=20;j.add(new u.default.Rect({width:T,height:T,fill:"white"})),j.add(new u.default.Path({scaleX:T/24,scaleY:T/24,data:"M4.98313549,11.0001422 C5.49589839,10.9914935 5.92501998,11.3703506 5.99116425,11.8666444 L5.99985778,11.9831355 L6.00348884,12.2068855 C6.11245031,15.4321748 8.76323537,17.9999971 11.9999971,17.9999971 C12.1869612,17.9999971 12.3726725,17.9914753 12.5567465,17.9745765 L12.2928932,17.7071068 C11.9023689,17.3165825 11.9023689,16.6834175 12.2928932,16.2928932 C12.6834175,15.9023689 13.3165825,15.9023689 13.7071068,16.2928932 L15.7071068,18.2928932 C16.0976311,18.6834175 16.0976311,19.3165825 15.7071068,19.7071068 L13.7071068,21.7071068 C13.3165825,22.0976311 12.6834175,22.0976311 12.2928932,21.7071068 C11.9023689,21.3165825 11.9023689,20.6834175 12.2928932,20.2928932 L12.6111505,19.9769552 C12.4086045,19.9922816 12.2047796,19.9999971 11.9999971,19.9999971 C7.7687005,19.9999971 4.28886152,16.7094374 4.01666425,12.5105203 L4.00420123,12.2575143 L4.00014222,12.0168645 C3.9908282,11.4646583 4.43092928,11.0094562 4.98313549,11.0001422 Z M11.7071068,2.29289322 C12.0675907,2.65337718 12.0953203,3.22060824 11.7902954,3.61289944 L11.7071068,3.70710678 L11.3891629,4.0230186 C11.5916051,4.00770767 11.7953244,4 12,4 C16.418278,4 20,7.581722 20,12 C20,12.5522847 19.5522847,13 19,13 C18.4477153,13 18,12.5522847 18,12 C18,8.6862915 15.3137085,6 12,6 C11.8129339,6 11.6271216,6.00853145 11.4429483,6.02544919 L11.7071068,6.29289322 C12.0976311,6.68341751 12.0976311,7.31658249 11.7071068,7.70710678 C11.3466228,8.06759074 10.7793918,8.09532028 10.3871006,7.79029539 L10.2928932,7.70710678 L8.29289322,5.70710678 C7.93240926,5.34662282 7.90467972,4.77939176 8.20970461,4.38710056 L8.29289322,4.29289322 L10.2928932,2.29289322 C10.6834175,1.90236893 11.3165825,1.90236893 11.7071068,2.29289322 Z",fill:"black"}));const M=j.toCanvas({pixelRatio:2,width:T,height:T}),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:M,fillPatternScaleX:20/T/2,fillPatternScaleY:20/T/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}};e.setTransformerStyle=D=>{Object.assign(F,D)};const C={text:{enabledAnchors:["top-left","top-right","middle-left","bottom-left","bottom-right","middle-right"]},svg:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},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"]}},x=D=>n.default.createElement(o.Rect,Object.assign({},D,{preventDefault:!1})),L=D=>{var{url:K}=D,ne=r(D,["url"]);const[Z,ee]=(0,l.default)(K,"anonymous"),ae=Z?(0,w.getCrop)(Z,{width:ne.width,height:ne.height},"center-middle"):{};return(0,p.useImageLoader)(ee,K,"page background"),n.default.createElement(o.Image,Object.assign({image:Z},ne,ae))},A=D=>{const K=(0,g.useColor)({fill:D.fill,a:{width:D.width,height:D.height}});return n.default.createElement(o.Rect,Object.assign({},D,K))},N=D=>{const{background:K,scale:ne,borderColor:Z}=D,ee=r(D,["background","scale","borderColor"]),ae=n.default.useMemo(()=>!!u.default.Util.colorToRGBA(K)||(0,v.isGradient)(K),[K]),se=n.default.useMemo(()=>{const ce=document.createElement("canvas"),me=30;ce.width=60,ce.height=60;const xe=ce.getContext("2d");return xe&&(xe.fillStyle="black",xe.fillRect(me,0,me,me),xe.fillRect(0,me,me,me)),ce},[]);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Rect,Object.assign({fillPatternImage:se},ee,{opacity:.1,hideInExport:!0})),ae?n.default.createElement(A,Object.assign({fill:K},ee)):n.default.createElement(L,Object.assign({url:K},ee)))},I=(0,a.observer)(({selection:D})=>D.visible?n.default.createElement(o.Rect,{name:"selection",x:Math.min(D.x1,D.x2),y:Math.min(D.y1,D.y2),width:Math.abs(D.x1-D.x2),height:Math.abs(D.y1-D.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),W=(0,a.observer)(({x:D,y:K,width:ne,height:Z,rotation:ee,anchor:ae,store:se})=>{const ce=(0,_.getClientRect)({x:D,y:K,width:ne,height:Z,rotation:u.default.Util.radToDeg(ee)});if(ae===void 0)return null;const me=(Z/2+70)*Math.cos(ee-Math.PI/2),xe=(Z/2+70)*Math.sin(ee-Math.PI/2),Oe=(0,E.pxToUnitRounded)({unit:se.unit,dpi:se.dpi,px:ne/se.scale,precious:se.unit==="px"?0:1})+" x "+(0,E.pxToUnitRounded)({unit:se.unit,dpi:se.dpi,px:Z/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:(ce.minX+ce.maxX)/2+me,y:(ce.minY+ce.maxY)/2+xe,offsetX:14,offsetY:14,visible:ae==="rotater"},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)"}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Math.round(u.default.Util.radToDeg(ee)).toString()+"°"})),n.default.createElement(o.Label,{x:(ce.minX+ce.maxX)/2,y:ce.maxY+20,visible:ae!=="rotater"},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Oe})))}),G=(0,a.observer)(({elements:D,store:K})=>{const ne=D.filter(ee=>ee.alwaysOnTop),Z=D.filter(ee=>!ee.alwaysOnTop).concat(ne);return n.default.createElement(n.default.Fragment,null,Z.map(ee=>n.default.createElement(c.default,{key:ee.id,store:K,element:ee,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});e.useContextMenu=({store:D})=>{const[K,ne]=n.default.useState(!1),[Z,ee]=n.default.useState({x:0,y:0});return{open:n.default.useCallback(se=>{ne(!0),ee(se)},[]),close:n.default.useCallback(()=>{ne(!1)},[]),props:{isOpen:K,offset:Z,setIsOpen:ne}}};let $=null;e.registerNextDomDrop=D=>{$=D};const J=atob("UG9sb3RubyBmcmVlIGxpY2Vuc2UgbGltaXRhdGlvbiBleGNlZWRlZCAtIFBsZWFzZSB1cGdyYWRlIHlvdXIgYWNjb3VudC4="),V=atob("cmVk"),H=atob("djAuOS4y"),z=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:J,height:void 0,padding:10,fontSize:20}))));e.default=(0,a.observer)(({store:D,page:K,width:ne,height:Z,pageControlsEnabled:ee,backColor:ae,pageBorderColor:se,activePageBorderColor:ce,components:me,bleedColor:xe,altCloneEnabled:Oe,viewportSize:Re})=>{const Se=D.bleedVisible?K.bleed:0,ve=K.computedWidth+2*Se,He=K.computedHeight+2*Se,we=(ne-ve*D.scale)/2,Ae=(Z-He*D.scale)/2,Ee=n.default.useRef(null),Ne=n.default.useRef(null),he=n.default.useRef(null),Le=ee==null||ee,[Ce,De]=n.default.useState(null),[tt,vt]=n.default.useState({}),mt=(0,e.useContextMenu)({store:D}),Et=D.selectedElements.find(it=>it._cropModeEnabled),nt=D.selectedShapes.filter(it=>!it.resizable).length>0,at=D.selectedShapes.filter(it=>!it.draggable).length>0,qt=D.selectedElements.filter(it=>!it.visible).length>0;n.default.useLayoutEffect(()=>{var it,Bt,Ve;if(!Ee.current)return;const Fe=Ee.current.getStage(),bt=D.selectedShapes.map(St=>St._cropModeEnabled?null:Fe.findOne("#"+St.id)).filter(St=>St),Ue=D.selectedElements.length===1&&((it=D.selectedElements[0])===null||it===void 0?void 0:it.type)||"many";C[Ue]?(Ee.current.setAttrs(Object.assign(Object.assign({},F),C[Ue])),Ue!=="svg"&&Ue!=="image"&&Ue!=="gif"||D.selectedElements[0].keepRatio||Ee.current.setAttrs({enabledAnchors:F.enabledAnchors}),Ue==="text"&&S.flags.textVerticalResizeEnabled&&Ee.current.setAttrs({enabledAnchors:(Bt=C.text.enabledAnchors)===null||Bt===void 0?void 0:Bt.concat(["bottom-center"])})):Ee.current.setAttrs(F),nt&&Ee.current.enabledAnchors([]),at&&Ee.current.rotateEnabled(!1),bt.find(St=>St==null?void 0:St.isDragging())&&bt.forEach(St=>{St.isDragging()||St==null||St.startDrag()}),Ee.current.nodes(bt),(Ve=Ee.current.getLayer())===null||Ve===void 0||Ve.batchDraw()},[D.selectedShapes,Et,nt,qt,at]);const Ct=(0,a.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),or=n.default.useRef(!1),Xt=(0,y.isTouchDevice)(),qe=(0,i.action)(it=>{var Bt,Ve,Fe,bt;if(Xt)return;or.current=!1;const Ue=it.target.findAncestor(".elements-container"),St=it.target.findAncestor("Transformer"),kt=it.target.findAncestor(".page-abs-container");if(Ue||St||kt)return;const Ft=(Bt=it.target.getStage())===null||Bt===void 0?void 0:Bt.getPointerPosition();Ft.x-=(Ve=it.target.getStage())===null||Ve===void 0?void 0:Ve.x(),Ft.y-=(Fe=it.target.getStage())===null||Fe===void 0?void 0:Fe.y(),Ft&&(Ct.visible=!0,Ct.x1=Ft.x,Ct.y1=Ft.y,Ct.x2=Ft.x,Ct.y2=Ft.y,((bt=it.target.getStage())===null||bt===void 0?void 0:bt.getPointersPositions().length)>=2&&(Ct.visible=!1))});(({stageRef:it,containerRef:Bt,viewportSize:Ve})=>{n.default.useEffect(()=>{var Fe;const bt=(Fe=Bt.current)===null||Fe===void 0?void 0:Fe.closest(".polotno-workspace-inner");function Ue(){var St;if(!it.current)return;const kt=(St=Bt.current)===null||St===void 0?void 0:St.getBoundingClientRect(),Ft=bt==null?void 0:bt.getBoundingClientRect(),zt=Math.max(0,Ft.left-kt.left-100),Wt=Math.max(0,Ft.top-kt.top-100);it.current.position({x:-zt,y:-Wt}),it.current.container().style.transform=`translate(${zt}px, ${Wt}px)`}return Ue(),bt.addEventListener("scroll",Ue),()=>{bt.removeEventListener("scroll",Ue)}},[Ve.width,Ve.height])})({stageRef:Ne,containerRef:he,viewportSize:Re}),n.default.useEffect(()=>{const it=(0,i.action)(Ve=>{var Fe,bt,Ue,St;if(!Ct.visible)return;(Fe=Ne.current)===null||Fe===void 0||Fe.setPointersPositions(Ve);let kt=(bt=Ne.current)===null||bt===void 0?void 0:bt.getPointerPosition();kt?(kt.x-=(Ue=Ne.current)===null||Ue===void 0?void 0:Ue.x(),kt.y-=(St=Ne.current)===null||St===void 0?void 0:St.y()):kt={x:Ct.x2,y:Ct.y2},Ct.x2=kt.x,Ct.y2=kt.y}),Bt=(0,i.action)(()=>{if(!Ct.visible||!Ne.current)return;const Ve=Ne.current.findOne(".selection"),Fe=Ve?Ve.getClientRect():{width:0,height:0,x:0,y:0};if(Fe.width&&Fe.height){const bt=[];Ne.current.find(".element").forEach(St=>{const kt=St.getClientRect(),Ft=D.getElementById(St.id()),zt=Ft==null?void 0:Ft.draggable,Wt=Ft==null?void 0:Ft.selectable;u.default.Util.haveIntersection(Fe,kt)&&zt&&Wt&&bt.push(Ft.top.id)});const Ue=[...new Set(bt)];D.selectElements(Ue)}Ct.visible=!1,or.current=!0});return window.addEventListener("mousemove",it),window.addEventListener("touchmove",it),window.addEventListener("mouseup",Bt),window.addEventListener("touchend",Bt),()=>{window.removeEventListener("mousemove",it),window.removeEventListener("touchmove",it),window.removeEventListener("mouseup",Bt),window.removeEventListener("touchend",Bt)}},[]);const We=n.default.useRef(!1);n.default.useEffect(()=>{var it;let Bt;const Ve=(it=he.current)===null||it===void 0?void 0:it.closest(".polotno-workspace-inner"),Fe=()=>{We.current=!0,clearTimeout(Bt),Bt=setTimeout(()=>{We.current=!1},300)};return Ve.addEventListener("scroll",Fe),()=>{clearTimeout(Bt),Ve.removeEventListener("scroll",Fe)}},[]);const Nt=it=>{if(D.activePage!==K&&K.select(),We.current||or.current)return;const Bt=it.evt.ctrlKey||it.evt.metaKey||it.evt.shiftKey,Ve=it.target.findAncestor(".elements-container"),Fe=it.target.findAncestor(".page-abs-container"),bt=it.target.findAncestor("Transformer");if(!(Bt||Ve||bt||Fe))return void D.selectElements([]);const Ue=it.target.findAncestor(".element",!0),St=D.getElementById(Ue==null?void 0:Ue.id()),kt=St==null?void 0:St.top,Ft=kt==null?void 0:kt.id,zt=D.selectedElementsIds.indexOf(Ft)>=0;Ft&&Bt&&!zt?D.selectElements(D.selectedElementsIds.concat([Ft])):Ft&&Bt&&zt?D.selectElements(D.selectedElementsIds.filter(Wt=>Wt!==Ft)):!Ft||Bt||zt||D.selectElements([Ft])};(0,h.useSnap)(Ee,D);const ht=D.activePage===K,gt=me==null?void 0:me.PageControls,wt=me==null?void 0:me.Tooltip,tr=me==null?void 0:me.ContextMenu,Vt=1/D.scale,_t=0/D.scale;return n.default.createElement("div",{ref:he,onDragOver:it=>it.preventDefault(),onDrop:it=>{if(it.preventDefault(),!Ne.current)return;Ne.current.setPointersPositions(it);const Bt=Ne.current.findOne(".elements-container").getRelativePointerPosition(),Ve=Ne.current.getPointerPosition(),Fe=Ne.current.getAllIntersections(Ve).map(St=>St.findAncestor(".element",!0)).filter(Boolean),bt=[...new Set(Fe.reverse())].map(St=>D.getElementById(St.id())),Ue=bt[0];$&&($(Bt,Ue,{elements:bt,page:K}),$=null)},style:{position:"relative",width:ne+"px",height:Z+"px",overflow:"hidden"},className:"polotno-page-container"+(ht?" active-page":"")},n.default.createElement(o.Stage,{ref:Ne,width:Math.min(ne,Re.width+200),height:Math.min(Re.height+200,Z),onClick:Nt,onTap:Nt,onContextMenu:it=>{it.evt.preventDefault();const Bt=it.target.findAncestor(".element",!0),Ve=D.getElementById(Bt==null?void 0:Bt.id()),Fe=Ve==null?void 0:Ve.top,bt=Fe==null?void 0:Fe.id;bt?D.selectedElementsIds.indexOf(bt)>=0||D.selectElements([bt]):D.selectElements([]),mt.open({x:it.evt.clientX,y:it.evt.clientY})},onMouseDown:qe,onMouseMove:it=>{if(!it.evt.altKey&&Ce)return void De(null);if(!it.evt.altKey)return;const Bt=it.target.findAncestor(".element",!0),Ve=Bt==null?void 0:Bt.id();if(!D.selectedElements[0]||D.selectedElementsIds.includes(Ve))return;const Fe=(0,_.getTotalClientRect)(D.selectedShapes),bt=Ve?D.getElementById(Ve):{x:0,y:0,width:K.computedWidth,height:K.computedHeight,rotation:0},Ue=(0,_.getClientRect)(bt),St=[];Fe.minX>Ue.maxX&&St.push({distance:Fe.minX-Ue.maxX,box1:Fe,box2:Ue,points:[{x:Fe.minX,y:Fe.minY+Fe.height/2},{x:Ue.maxX,y:Fe.minY+Fe.height/2},{x:Ue.maxX,y:Ue.minY+Ue.height/2}]}),Fe.maxX<Ue.minX&&St.push({distance:Ue.minX-Fe.maxX,box1:Fe,box2:Ue,points:[{x:Fe.maxX,y:Fe.minY+Fe.height/2},{x:Ue.minX,y:Fe.minY+Fe.height/2},{x:Ue.minX,y:Ue.minY+Ue.height/2}]}),Fe.minY>Ue.maxY&&St.push({box1:Fe,box2:Ue,distance:Fe.minY-Ue.maxY,points:[{x:Fe.minX+Fe.width/2,y:Fe.minY},{x:Fe.minX+Fe.width/2,y:Ue.maxY},{x:Ue.minX+Ue.width/2,y:Ue.maxY}]}),Fe.maxY<Ue.minY&&St.push({box1:Fe,box2:Ue,distance:Ue.minY-Fe.maxY,points:[{x:Fe.minX+Fe.width/2,y:Fe.maxY},{x:Fe.minX+Fe.width/2,y:Ue.minY},{x:Ue.minX+Ue.width/2,y:Ue.minY}]}),Fe.minX>=Ue.minX&&Fe.maxX<=Ue.maxX&&Fe.minY>=Ue.minY&&Fe.maxY<=Ue.maxY&&(St.push({distance:Fe.minX-Ue.minX,box1:Fe,box2:Ue,points:[{x:Fe.minX,y:Fe.minY+Fe.height/2},{x:Ue.minX,y:Fe.minY+Fe.height/2},{x:Ue.minX,y:Ue.minY+Ue.height/2}]}),St.push({distance:Ue.maxX-Fe.maxX,box1:Fe,box2:Ue,points:[{x:Fe.maxX,y:Fe.minY+Fe.height/2},{x:Ue.maxX,y:Fe.minY+Fe.height/2},{x:Ue.maxX,y:Ue.minY+Ue.height/2}]}),St.push({box1:Fe,box2:Ue,distance:Fe.minY-Ue.minY,points:[{x:Fe.minX+Fe.width/2,y:Fe.minY},{x:Fe.minX+Fe.width/2,y:Ue.minY},{x:Ue.minX+Ue.width/2,y:Ue.minY}]}),St.push({box1:Fe,box2:Ue,distance:Ue.maxY-Fe.maxY,points:[{x:Fe.minX+Fe.width/2,y:Fe.maxY},{x:Fe.minX+Fe.width/2,y:Ue.maxY},{x:Ue.minX+Ue.width/2,y:Ue.maxY}]})),JSON.stringify(Ce)!==JSON.stringify(St)&&De(St)},onDragStart:it=>{var Bt;const Ve=it.target.findAncestor(".element",!0);if(Ve){const Fe=D.getElementById(Ve==null?void 0:Ve.id()),bt=Fe==null?void 0:Fe.top,Ue=bt==null?void 0:bt.id;!(D.selectedElementsIds.indexOf(Ue)>=0)&&Ue&&(D.selectElements([Ue]),it.target.stopDrag(),it.target.startDrag(it),(Bt=Ee.current)===null||Bt===void 0||Bt.startDrag(it))}Ce&&De(null)},pageId:K.id,style:{position:"absolute",overflow:"hidden",top:0,left:0}},n.default.createElement(o.Layer,null,n.default.createElement(x,{width:ne,height:Z,fill:ae}),n.default.createElement(o.Group,{x:we,y:Ae,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:Se,y:Se},n.default.createElement(N,{x:-K.bleed,y:-K.bleed,width:K.computedWidth+2*K.bleed,height:K.computedHeight+2*K.bleed,background:K.background,name:"page-background",preventDefault:!1,scale:D.scale})),n.default.createElement(o.Group,{x:Se,y:Se,name:"elements-container",listening:!D.isPlaying},n.default.createElement(o.Rect,{name:"elements-area",width:K.computedWidth,height:K.computedHeight,listening:!1}),n.default.createElement(G,{elements:K.children,store:D})),n.default.createElement(o.Rect,{stroke:xe,name:"bleed",strokeWidth:K.bleed,x:K.bleed/2,y:K.bleed/2,width:K.computedWidth+K.bleed,height:K.computedHeight+K.bleed,listening:!1,visible:K.bleed>0&&D.bleedVisible,hideInExport:!0}),(0,d.___)()===H&&n.default.createElement(z,{name:"hit-detection",x:-Vt/2-_t,y:-Vt/2-_t,width:ve+Vt+2*_t,height:He+Vt+2*_t}))),n.default.createElement(o.Line,{name:"workspace-background",points:[0,0,ne,0,ne,Z,0,Z,0,0,we,Ae,we,Z-Ae,ne-we,Z-Ae,ne-we,Ae,we,Ae],listening:!1,closed:!0,fill:ae}),n.default.createElement(o.Group,{x:we,y:Ae,scaleX:D.scale,scaleY:D.scale},n.default.createElement(o.Rect,{name:"page-highlight",hideInExport:!0,x:-Vt/2-_t,y:-Vt/2-_t,width:ve+Vt+2*_t,height:He+Vt+2*_t,stroke:ht&&D.pages.length>1?ce:se,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),n.default.createElement(o.Group,{x:we+Se*D.scale,y:Ae+Se*D.scale,scaleX:D.scale,scaleY:D.scale,name:"page-abs-container"},n.default.createElement(o.Transformer,{ref:Ee,onDragStart:it=>{var Bt;!((Bt=it.evt)===null||Bt===void 0)&&Bt.altKey&&Oe&&D.selectedElements.forEach(Ve=>{const Fe=Ve.clone({},{skipSelect:!0}),bt=K.children.indexOf(Ve);K.setElementZIndex(Fe.id,bt)}),D.history.startTransaction()},onDragEnd:()=>{D.history.endTransaction()},onTransformStart:()=>{D.history.startTransaction()},boundBoxFunc:(it,Bt)=>{const Ve=Math.abs(Bt.width)<1||Math.abs(Bt.height)<1,Fe=Math.abs(it.width)<1||Math.abs(it.height)<1;return Ve&&!Fe?it:Bt},onTransform:it=>{var Bt,Ve;const Fe=Ee.current.nodes(),bt=Fe[Fe.length-1];if(it.target!==bt)return;const Ue=(Bt=Ee.current)===null||Bt===void 0?void 0:Bt.__getNodeRect(),St=(Ve=Ee.current)===null||Ve===void 0?void 0:Ve.getActiveAnchor();vt({anchor:St,x:Ue.x,y:Ue.y,rotation:Ue.rotation,width:Ue.width,height:Ue.height})},onTransformEnd:it=>{vt({}),D.history.endTransaction()},visible:!D.isPlaying}),Ce&&Ce.map(({points:it,distance:Bt,box1:Ve,box2:Fe},bt)=>n.default.createElement(o.Group,{name:"distances-container",hideInExport:!0,key:bt,listening:!1},n.default.createElement(o.Rect,Object.assign({},Ve,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Rect,Object.assign({},Fe,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Line,{points:[it[0].x,it[0].y,it[1].x,it[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Line,{points:[it[1].x,it[1].y,it[2].x,it[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Label,{x:(it[0].x+it[1].x)/2,y:(it[0].y+it[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:Bt})})))),K._rendering&&n.default.createElement(o.Group,null,n.default.createElement(o.Rect,{width:ve,height:He,fill:"rgba(255,255,255,0.9)"}),n.default.createElement(o.Text,{text:"Rendering...",fontSize:60,width:ve,height:He,align:"center",verticalAlign:"middle"})),wt&&n.default.createElement(wt,{components:me,store:D,page:K,stageRef:Ne}),tr&&n.default.createElement(b.Html,null,n.default.createElement(tr,Object.assign({components:me,store:D},mt.props)))),n.default.createElement(W,Object.assign({},tt,{store:D})),n.default.createElement(I,{selection:Ct}),(0,d.isCreditVisible)()&&n.default.createElement(o.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:ne-170,y:Z-18,onMouseEnter:it=>{it.target.getStage().container().style.cursor="pointer"},onMouseLeave:it=>{it.target.getStage().container().style.cursor=""},onTouchStart:it=>{it.cancelBubble=!0},onMouseDown:it=>{it.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),n.default.createElement(o.Group,{name:"line-guides"}))),Le&>&&n.default.createElement(gt,{store:D,page:K,xPadding:we,yPadding:Ae}))})}(yf)),yf}var Zd={},h4;function BC(){return h4||(h4=1,function(e){var r=Zd&&Zd.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};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(di()),n=Fh(),a=Nm(),i=zs,o=Q8(),l=(0,o.styled)("div",t.default.forwardRef)`
|
|
265
|
-
position: absolute;
|
|
266
|
-
top: 0;
|
|
267
|
-
left: 0;
|
|
268
|
-
pointer-events: none;
|
|
269
|
-
`,u=(0,o.styled)("div",t.default.forwardRef)`
|
|
270
|
-
height: 14px;
|
|
271
|
-
position: sticky;
|
|
272
|
-
font-size: 8px;
|
|
273
|
-
line-height: 14px;
|
|
274
|
-
top: 0;
|
|
275
|
-
left: 0;
|
|
276
|
-
color: grey;
|
|
277
|
-
border-bottom: 1px solid grey;
|
|
278
|
-
background-color: #e8e8e8;
|
|
279
|
-
overflow: hidden;
|
|
280
|
-
`,c=(0,o.styled)("div",t.default.forwardRef)`
|
|
281
|
-
left: 0;
|
|
282
|
-
width: 14px;
|
|
283
|
-
position: sticky;
|
|
284
|
-
font-size: 8px;
|
|
285
|
-
line-height: 14px;
|
|
286
|
-
color: grey;
|
|
287
|
-
border-right: 1px solid grey;
|
|
288
|
-
background-color: #e8e8e8;
|
|
289
|
-
overflow: hidden;
|
|
290
|
-
`,h=(0,o.styled)("div",t.default.forwardRef)`
|
|
291
|
-
position: absolute;
|
|
292
|
-
border-left: 1px solid grey;
|
|
293
|
-
padding-left: 2px;
|
|
294
|
-
`,p=(0,o.styled)("div",t.default.forwardRef)`
|
|
295
|
-
position: absolute;
|
|
296
|
-
left: 14px;
|
|
297
|
-
border-left: 1px solid grey;
|
|
298
|
-
padding-left: 2px;
|
|
299
|
-
transform: rotate(90deg);
|
|
300
|
-
transform-origin: left top;
|
|
301
|
-
overflow: hidden;
|
|
302
|
-
`,w=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4];e.TopRules=(0,i.observer)(({store:d,width:_,height:E})=>{const S=t.default.useRef(null);if(!d.activePage)return null;const y=d.activePage,g=(d.bleedVisible&&y.bleed,y.computedWidth*d.scale),v=y.computedHeight*d.scale,b=(_-g)/2,O=(j=x=>(0,a.unitToPx)({unitVal:x,dpi:d.dpi,unit:d.unit})*d.scale,w.find(x=>j(x)>30)||1e4);var j;const T=(0,a.unitToPx)({unitVal:O,dpi:d.dpi,unit:d.unit})*d.scale,M=Math.round(g/T)+1,F=Math.round(v/T)+1,C=(0,n.getTotalClientRect)(d.selectedShapes);return t.default.createElement(l,{ref:S,className:"polotno-rulers"},t.default.createElement(u,{style:{width:_+"px"},className:"polotno-x-ruler"},[...Array(M)].map((x,L)=>t.default.createElement(h,{key:L,style:{left:b+L*T+"px",width:T+"px"}},d.unit==="px"||O>=1?Math.round(O*L):(O*L).toFixed(1))),!!d.selectedShapes.length&&t.default.createElement("div",{style:{position:"absolute",left:b+C.x*d.scale+"px",height:"14px",width:C.width*d.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),d.pages.map((x,L)=>{var A;const N=x.computedHeight*d.scale,I=(E-N)/2;return t.default.createElement(c,{key:x.id,style:{height:E+"px"},className:"polotno-y-ruler"},[...Array(F)].map((W,G)=>t.default.createElement(p,{key:G,style:{top:I+G*T-14+"px",width:T+"px"}},d.unit==="px"||O>=1?Math.round(O*G):(O*G).toFixed(1))),((A=d.selectedShapes[0])===null||A===void 0?void 0:A.page)===x&&t.default.createElement("div",{style:{position:"absolute",top:I+C.y*d.scale-14+"px",width:"14px",height:C.height*d.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))})}(Zd)),Zd}var Qd={},d4;function qC(){return d4||(d4=1,function(e){var r=Qd&&Qd.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.AudioElement=void 0;const t=r(di()),n=zs,a=fl;e.AudioElement=(0,n.observer)(({audio:i,store:o})=>{const[l,u]=function(c){const[h,p]=t.default.useState(null),[w,d]=t.default.useState("loading");return t.default.useEffect(()=>{const _=new Audio(c),E=()=>{d("loaded"),p(_)},S=()=>{d("failed"),p(null)};return _.addEventListener("canplay",E),_.addEventListener("error",S),()=>{_.removeEventListener("canplay",E),_.removeEventListener("error",S)}},[c]),[h,w]}(i.src);return t.default.useEffect(()=>{l&&o.history.ignore(()=>{i.set({duration:1e3*l.duration})})},[l,i,o.history]),t.default.useEffect(()=>{if(!l)return;const c=()=>{l.currentTime=i.startTime*i.duration/1e3},h=()=>{const w=i.endTime*i.duration/1e3;l.currentTime>=w&&(l.pause(),l.currentTime=i.startTime*i.duration/1e3)};l.addEventListener("ended",c),l.addEventListener("timeupdate",h);const p=(0,a.autorun)(()=>{const w=o.animatedElementsIds;if(w.length&&!w.includes(i.id))return;const d=o.currentTime-i.delay,_=i.duration*(i.endTime-i.startTime),E=d>=0&&d<_;if(!o.isPlaying||o.animatedElementsIds.length!==0||!E)return void l.pause();l.volume=i.volume,l.paused&&l.play();const S=d%_/1e3+i.startTime*i.duration/1e3,y=l.currentTime;Math.abs(y-S)>.5&&S!==y&&(l.currentTime=S)});return()=>{l.pause(),l.removeEventListener("ended",c),l.removeEventListener("timeupdate",h),p()}},[o.isPlaying,i.startTime,i.endTime,i.volume,l]),null})}(Qd)),Qd}var Nv={},Tv={},Jd={};let zC="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",n_=e=>crypto.getRandomValues(new Uint8Array(e)),i_=(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 l=t(a),u=a;for(;u--;)if(o+=e[l[u]&n]||"",o.length===i)return o}}},UC=(e,r=21)=>i_(e,r,n_),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 VC=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:UC,customRandom:i_,nanoid:HC,random:n_,urlAlphabet:zC},Symbol.toStringTag,{value:"Module"})),u0=Kc(VC);var Rv={},Ms={},Mv={},Iv={},p4;function a_(){return p4||(p4=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}}(Iv)),Iv}var g4;function GC(){return g4||(g4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UndoManager=void 0;const r=hl,t=a_();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,l=null,u=0,c=0;const h=()=>c>0;function p(){const d=(0,r.getSnapshot)(a);return{pages:d.pages,width:d.width,height:d.height,custom:d.custom}}function w(d){const _=a.pages.map(g=>g.id),E=d.pages.map(g=>g.id),S=!(0,t.deepEqual)(_,E),y=!(0,t.deepEqual)(a.custom,d.custom);S?(0,r.applySnapshot)(a.pages,d.pages):a.pages.forEach((g,v)=>{(0,r.applySnapshot)(g,d.pages[v])}),y&&a.set({custom:d.custom}),a.setSize(d.width,d.height)}return{startTransaction(){c++},endTransaction(d){c--,d||this.requestAddState(p())},async ignore(d,_=!1,E=!1){E&&await new Promise(b=>setTimeout(b,10)),u&&n.addUndoState();let S=h();n.startTransaction();let y=c;try{await d()}catch(b){setTimeout(()=>{throw b})}const g=y!==c,v=!g;n.endTransaction(v),_||S||n.replaceState(),g||(clearTimeout(u),u=0)},async transaction(d){await n.ignore(d,!0),this.addUndoState()},requestAddState(d){l=d,u||h()||(o?o=!1:u=setTimeout(()=>{u=0,clearTimeout(u),h()||this.addUndoState()},100))},addUndoState(){if(o)return void(o=!1);const d=n.history[n.undoIdx];!(0,t.deepEqual)(l,d)&&(clearTimeout(u),u=0,n.history.splice(n.undoIdx+1),n.history.push(l),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,w(n.history[n.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){u&&this.addUndoState(),n.canRedo?(n.undoIdx++,o=!0,w(n.history[n.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){n.history[n.undoIdx]=p()}}}),e.default=e.UndoManager}(Mv)),Mv}var jv={},v4;function WC(){return v4||(v4=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)}}(jv)),jv}var Fv={},m4;function $C(){return m4||(m4=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}(Fv)),Fv}var Dv={},y4;function YC(){return y4||(y4=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)})}}(Dv)),Dv}var Bv={},b4;function XC(){return b4||(b4=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))}}}(Bv)),Bv}var ql={},qv={},w4;function D1(){return w4||(w4=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 l=document.createElement("canvas");l.width=a.width,l.height=a.height;const u=l.getContext("2d");let{cropX:c,cropY:h}=a;const p=o.width*a.cropWidth,w=o.height*a.cropHeight,d=a.width/a.height;let _,E;const S=p/w;return a.type==="svg"?(_=p,E=w):d>=S?(_=p,E=p/d):(_=w*d,E=w),u.drawImage(o,c*o.width,h*o.height,_,E,0,0,l.width,l.height),l.toDataURL("image/png")},e.getCrop=function(n,a){const{width:i,height:o}=n,l=i/o;let u,c;l>=a.width/a.height?(u=a.width,c=a.width/l):(u=a.height*l,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=l=>{i(l)},o.crossOrigin="anonymous",o.src=n})}}(qv)),qv}var zv={},_4;function o_(){return _4||(_4=1,function(e){var r;Object.defineProperty(e,"__esModule",{value:!0}),e.Effects=void 0,e.shapeFilterToCSS=function(t){let n={filter:"",html:void 0};switch(t){case r.warm:return n.filter="sepia(0.5) saturate(1.5) brightness(1.1) contrast(1.1)",n;case r.cold:return n.filter="url(#blue-boost)",n.html=`
|
|
305
|
-
<svg style="display: none">
|
|
306
|
-
<filter id="blue-boost">
|
|
307
|
-
<feColorMatrix
|
|
308
|
-
type="matrix"
|
|
309
|
-
values="
|
|
310
|
-
0.85 0 0 0 0
|
|
311
|
-
0 0.9 0 0 0
|
|
312
|
-
0 0 1.15 0 0
|
|
313
|
-
0 0 0 1 0"
|
|
314
|
-
/>
|
|
315
|
-
</filter>
|
|
316
|
-
</svg>`,n;case"natural":return n.filter="saturate(1.3) brightness(1.1) contrast(1.2)",n;default:return null}},function(t){t.sepia="sepia",t.grayscale="grayscale",t.natural="natural",t.warm="warm",t.cold="cold"}(r||(e.Effects=r={}))}(zv)),zv}var Uv={},S4;function KC(){return S4||(S4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getVideoSize=async function(r){return new Promise(t=>{const n=document.createElement("video");n.crossOrigin="anonymous",n.src=r,n.addEventListener("loadedmetadata",()=>{const{videoWidth:a,videoHeight:i}=n;t({width:a,height:i})})})},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 l=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(){l.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"),l=()=>{try{o.drawImage(r,0,0,t.width,t.height);const u=t.toDataURL();a(u),r.removeEventListener("seeked",l)}catch(u){i(u),r.removeEventListener("seeked",l)}};r.addEventListener("seeked",l),r.currentTime=n})}}(Uv)),Uv}var x4;function ZC(){return x4||(x4=1,function(e){var r,t=ql&&ql.__createBinding||(Object.create?function(b,O,j,T){T===void 0&&(T=j);var M=Object.getOwnPropertyDescriptor(O,j);M&&!("get"in M?!O.__esModule:M.writable||M.configurable)||(M={enumerable:!0,get:function(){return O[j]}}),Object.defineProperty(b,T,M)}:function(b,O,j,T){T===void 0&&(T=j),b[T]=O[j]}),n=ql&&ql.__setModuleDefault||(Object.create?function(b,O){Object.defineProperty(b,"default",{enumerable:!0,value:O})}:function(b,O){b.default=O}),a=ql&&ql.__importStar||(r=function(b){return r=Object.getOwnPropertyNames||function(O){var j=[];for(var T in O)Object.prototype.hasOwnProperty.call(O,T)&&(j[j.length]=T);return j},r(b)},function(b){if(b&&b.__esModule)return b;var O={};if(b!=null)for(var j=r(b),T=0;T<j.length;T++)j[T]!=="default"&&t(O,b,j[T]);return n(O,b),O}),i=ql&&ql.__rest||function(b,O){var j={};for(var T in b)Object.prototype.hasOwnProperty.call(b,T)&&O.indexOf(T)<0&&(j[T]=b[T]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function"){var M=0;for(T=Object.getOwnPropertySymbols(b);M<T.length;M++)O.indexOf(T[M])<0&&Object.prototype.propertyIsEnumerable.call(b,T[M])&&(j[T[M]]=b[T[M]])}return j};Object.defineProperty(e,"__esModule",{value:!0}),e.fixRatio=function(b){var O=new DOMParser().parseFromString(b,"image/svg+xml");return O.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(O)},e.jsonToDOM=g,e.jsonToHTML=async function({json:b,elementHook:O}){const j=await g({json:b,elementHook:O});return v({dom:j})};const o=D1(),l=a(kp()),u=D1(),c=km(),h=Z8(),p=o_(),w=KC(),d=(b,O,...j)=>({type:b,props:O,children:j||[]}),_=async({element:b,page:O,store:j})=>{let{src:T}=b;if(b.type==="svg"&&Object.keys(b.colorsReplace).length){const K=await l.urlToString(T);T=l.replaceColors(K,new Map(Object.entries(b.colorsReplace)))}let M="";b.flipX&&(M+="scaleX(-1)"),b.flipY&&(M+="scaleY(-1)"),M||(M="none");const F={};if(b.clipSrc){const K=await l.urlToBase64(b.clipSrc);F["clip-path"]=`url(${K})`}const C=await(0,u.loadImage)(T),x=C.width*b.cropWidth,L=C.height*b.cropHeight,A=b.width/b.height;let N,I;const W=x/L;b.type==="svg"?(N=x,I=L):A>=W?(N=x,I=x/A):(N=L*A,I=L);const G=N/C.width,$=I/C.height,J=N/I>b.width/b.height?b.height/I:b.width/N,V=N*J/G,H=I*J/$,z=b.cropX*J*C.width,D=b.cropY*J*C.height;return d("div",{style:Object.assign(Object.assign({},F),{width:"100%",height:"100%","border-radius":b.cornerRadius+"px",border:b.borderSize?`${b.borderSize}px solid ${b.borderColor}`:"none",background:`url(${T})`,transform:M,"background-size":`${Math.round(V)}px ${Math.round(H)}px`,"background-position-x":-Math.round(z)+"px","background-position-y":-Math.round(D)+"px"})})},E=({element:b,type:O})=>{const j={"stroke-width":b.height,stroke:b.color,"line-cap":"round","stroke-linejoin":"round",opacity:b.opacity};return O==="arrow"||O==="triangle"?d("polyline",Object.assign({points:`${3*b.height},${2*-b.height} 0,0 ${3*b.height},${2*b.height}`},j)):O==="bar"?d("polyline",Object.assign({points:`0,${2*-b.height} 0,${2*b.height}`},j)):O==="circle"?d("circle",Object.assign({r:b.height},j)):O==="square"?d("polyline",Object.assign({points:`${-b.height},${-b.height} ${-b.height},${b.height} ${b.height},${b.height} ${b.height},${-b.height}`},j)):null},S={image:_,svg:_,text:async({element:b,page:O,store:j})=>{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 M=b.backgroundPadding*(b.fontSize*b.lineHeight),F=d("div",{style:{position:"absolute",top:-M/2+"px",left:-M/2+"px",display:b.backgroundEnabled?"block":"none",width:b.width+M+"px",height:b.height+M+"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 C=/<[a-z][\s\S]*>/i.test(b.text),x=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}`}),L="el-"+b.id,A=C?{id:L}:{},N=`<style>#${L} {${h.resetStyleContent}}</style>`,I=d("div",Object.assign(Object.assign({style:x},A),{innerHTML:C?`${N}${b.text}`:b.text.split(`
|
|
317
|
-
`).join("<br />")}));return d("div",{style:{position:"relative",width:"100%",height:"100%"}},F,I)},line:async({element:b,page:O,store:j})=>d("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},d("rect",{x:0,y:0,width:b.width,height:b.height,fill:b.color}),d("g",{transform:`translate(0 ${b.height/2})`},E({element:b,type:b.startHead})),d("g",{transform:`translate(${b.width} ${b.height/2}) rotate(180)`},E({element:b,type:b.endHead}))),figure:async({element:b,page:O,store:j,elementHook:T})=>{const M=(0,c.figureToSvg)(b),F=d("div",{innerHTML:M});return T&&T({dom:F,element:b})||F},group:async({element:b,page:O,store:j,elementHook:T})=>{const M=await Promise.all(b.children.map(C=>y({element:C,page:O,store:j,elementHook:T}))),F=d("div",{style:{"transform-origin":"top left",opacity:b.opacity}},...M);return T&&T({dom:F,element:b})||F},video:async({element:b,page:O,store:j,elementHook:T})=>{const{cropX:M,cropY:F,cropWidth:C,cropHeight:x}=b,L=await(0,w.getVideoSize)(b.src),A=L.width*C,N=L.height*x,I=b.width/b.height;let W,G;I>=A/N?(W=A,G=A/I):(W=N*I,G=N);const $=W/C,J=G/x,V=M*L.width,H=F*L.height,z=Math.max(b.width/L.width,b.height/L.height),D={position:"absolute",width:`${Math.round($*z)}px`,height:`${Math.round(J*z)}px`,left:-Math.round(V*z)+"px",top:-Math.round(H*z)+"px","object-fit":"fill"},K=`video-${b.id}`,ne=d("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"}},d("video",{id:K,src:b.src,style:D,controls:!0,playsInline:!0,muted:!0,volume:b.volume}));return T&&T({dom:ne,element:b})||ne},gif:_};async function y({element:b,page:O,store:j,elementHook:T}){let M=await S[b.type];M||(M=()=>d("div",{}),console.error(`HTML export does not support ${b.type} type...`));const F=await M({element:b,page:O,store:j}),C=[],x=[];if(b.blurEnabled&&C.push(`blur(${b.blurRadius/2}px)`),b.brightnessEnabled&&C.push(`brightness(${100*b.brightness+100}%)`),b.sepiaEnabled&&C.push("sepia()"),b.grayscaleEnabled&&C.push("grayscale()"),b.filters)for(const A of Object.keys(b.filters)){const N=(0,p.shapeFilterToCSS)(p.Effects[A]);N&&(C.push(N.filter),N.html&&x.push(N.html))}b.shadowEnabled&&C.push(`drop-shadow(${b.shadowOffsetX}px ${b.shadowOffsetY}px ${b.shadowBlur}px ${b.shadowColor})`);const L=d("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:C.join(" ")||"none"}},F,...x);return T&&T({dom:L,element:b})||L}async function g({json:b,elementHook:O}){const j=await Promise.all(b.pages.map(F=>async function({page:C,store:x,elementHook:L}){const A=await Promise.all(C.children.map(G=>y({element:G,page:C,store:x,elementHook:L}))),N=C.width==="auto"?x.width:C.width,I=C.height==="auto"?x.height:C.height;let W={};if(C.background.indexOf("url")>=0||C.background.indexOf("http")>=0||C.background.indexOf(".jpg")>=0||C.background.indexOf(".png")>=0||C.background.indexOf(".jpeg")>=0){const{width:G,height:$}=await(0,u.loadImage)(C.background),J=await _({element:Object.assign({x:0,y:0,width:G,height:$,src:C.background,cornerRadius:0},(0,o.getCrop)({width:G,height:$},{width:G,height:$})),page:C,store:x});A.unshift(J)}else W=Object.assign(Object.assign({},W),{"background-color":C.background});return d("div",{className:"page",id:C.id,style:Object.assign(Object.assign({},W),{width:N+"px",height:I+"px",overflow:"hidden",position:"relative"})},...A)}({page:F,store:b,elementHook:O}))),T=[];b.pages.forEach(F=>{F.children.forEach(C=>{C.type==="text"&&T.indexOf(C.fontFamily)===-1&&T.push(C.fontFamily)})});const M=T.map(F=>b.fonts.find(C=>C.fontFamily===F)?d("style",{},""):d("link",{href:`https://fonts.googleapis.com/css?family=${F}`,rel:"stylesheet"}));return d("div",{className:"design"},...M,...j)}const v=({dom:b})=>{if(typeof b=="string")return b;if(!b)return"";const O=b.props,{innerHTML:j}=O,T=i(O,["innerHTML"]);return`<${b.type} ${Object.keys(T).map(M=>((F,C)=>typeof C=="object"?`${F}="${Object.keys(C).map(x=>`${x}:${C[x]};`).join(" ")}"`:`${F}="${C}"`)(M,b.props[M])).join(" ")}>${j||b.children.map(M=>v({dom:M})).join("")}</${b.type}>`}}(ql)),ql}var zl={},E4;function QC(){return E4||(E4=1,function(e){var r,t=zl&&zl.__createBinding||(Object.create?function(v,b,O,j){j===void 0&&(j=O);var T=Object.getOwnPropertyDescriptor(b,O);T&&!("get"in T?!b.__esModule:T.writable||T.configurable)||(T={enumerable:!0,get:function(){return b[O]}}),Object.defineProperty(v,j,T)}:function(v,b,O,j){j===void 0&&(j=O),v[j]=b[O]}),n=zl&&zl.__setModuleDefault||(Object.create?function(v,b){Object.defineProperty(v,"default",{enumerable:!0,value:b})}:function(v,b){v.default=b}),a=zl&&zl.__importStar||(r=function(v){return r=Object.getOwnPropertyNames||function(b){var O=[];for(var j in b)Object.prototype.hasOwnProperty.call(b,j)&&(O[O.length]=j);return O},r(v)},function(v){if(v&&v.__esModule)return v;var b={};if(v!=null)for(var O=r(v),j=0;j<O.length;j++)O[j]!=="default"&&t(b,v,O[j]);return n(b,v),b}),i=zl&&zl.__rest||function(v,b){var O={};for(var j in v)Object.prototype.hasOwnProperty.call(v,j)&&b.indexOf(j)<0&&(O[j]=v[j]);if(v!=null&&typeof Object.getOwnPropertySymbols=="function"){var T=0;for(j=Object.getOwnPropertySymbols(v);T<j.length;T++)b.indexOf(j[T])<0&&Object.prototype.propertyIsEnumerable.call(v,j[T])&&(O[j[T]]=v[j[T]])}return O};Object.defineProperty(e,"__esModule",{value:!0}),e.forEveryChild=void 0,e.fixRatio=function(v){var b=new DOMParser().parseFromString(v,"image/svg+xml");return b.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(b)},e.jsonToDOM=y,e.jsonToSVG=async function({json:v,elementHook:b}){const O=await y({json:v,elementHook:b});return g({dom:O})};const o=D1(),l=a(kp()),u=D1(),c=km(),h=o_();e.forEveryChild=(v,b)=>{if(v.children)for(const O of v.children){if(b(O)===!0)break;(0,e.forEveryChild)(O,b)}};const p=(v,b,...O)=>({type:v,props:b,children:O||[]}),w=async({element:v,page:b,store:O})=>{let{src:j}=v;if(v.type==="svg"){const K=await l.urlToString(j);j=l.replaceColors(K,new Map(Object.entries(v.colorsReplace)))}else j=await(async K=>{try{const ne=await fetch(K);if(typeof Buffer<"u"){const Z=await ne.arrayBuffer(),ee=Buffer.from(Z).toString("base64");return`data:${ne.headers.get("content-type")||"image/png"};base64,${ee}`}{const Z=await ne.blob();return new Promise((ee,ae)=>{const se=new FileReader;se.onloadend=()=>ee(se.result),se.onerror=ae,se.readAsDataURL(Z)})}}catch(ne){return console.error("Error converting URL to data URL:",ne),K}})(j);let T="";v.flipX&&(T+="scaleX(-1)"),v.flipY&&(T+="scaleY(-1)"),v.clipSrc&&await l.urlToBase64(v.clipSrc);const M=await(0,u.loadImage)(j),F=M.width*v.cropWidth,C=M.height*v.cropHeight,x=v.width/v.height;let L,A;const N=F/C;v.type==="svg"?(L=F,A=C):x>=N?(L=F,A=F/x):(L=C*x,A=C);const I=L/M.width,W=A/M.height,G=L/A>v.width/v.height?v.height/A:v.width/L,$=L*G/I,J=A*G/W,V=v.cropX*M.width*G,H=v.cropY*M.height*G,z=`clip-${v.id}`,D=j.replace(/&/g,"&");return p("g",{style:{transform:T}},p("defs",{},p("clipPath",{id:z},p("rect",{x:0,y:0,width:v.width,height:v.height}))),p("image",{href:D,x:-V,y:-H,width:$,height:J,preserveAspectRatio:"none","clip-path":`url(#${z})`}))},d=({element:v,type:b})=>{const O={"stroke-width":v.height,stroke:v.color,"line-cap":"round","stroke-linejoin":"round",opacity:v.opacity};return b==="arrow"||b==="triangle"?p("polyline",Object.assign({points:`${3*v.height},${2*-v.height} 0,0 ${3*v.height},${2*v.height}`},O)):b==="bar"?p("polyline",Object.assign({points:`0,${2*-v.height} 0,${2*v.height}`},O)):b==="circle"?p("circle",Object.assign({r:v.height},O)):b==="square"?p("polyline",Object.assign({points:`${-v.height},${-v.height} ${-v.height},${v.height} ${v.height},${v.height} ${v.height},${-v.height}`},O)):null},_={image:w,svg:w,text:async({element:v,page:b,store:O})=>{const j=(x,L,A,N,I)=>{const W=document.createElement("canvas").getContext("2d");return W.font=`${I} ${N} ${L}px ${A}`,W.measureText(x).width},T=((x,L,A,N,I,W)=>{const G=[];return x.split(`
|
|
318
|
-
`).forEach($=>{const J=$.split(" ");let V="";for(let H=0;H<J.length;H++){const z=V+J[H]+" ";j(z,A,N,I,W)>L+.5&&H>0?(G.push(V.trim()),V=J[H]+" "):V=z}G.push(V.trim())}),G})(v.text,v.width,v.fontSize,v.fontFamily,v.fontWeight,v.fontStyle),M=v.fontSize*v.lineHeight,F=v.align==="center"?"middle":v.align==="right"?"end":"start",C=T.map((x,L)=>p("tspan",{x:v.align==="center"?v.width/2:v.align==="right"?v.width:0,dy:L===0?0:M,innerHTML:x}));return p("g",{},p("text",{fill:v.fill,y:v.fontSize,"font-size":v.fontSize+"px","text-anchor":F,"font-family":v.fontFamily,"font-style":v.fontStyle,"font-weight":v.fontWeight,"text-decoration":v.textDecoration,"line-height":v.lineHeight,"letter-spacing":v.letterSpacing+"em","stroke-width":v.strokeWidth,stroke:v.stroke},...C))},line:async({element:v,page:b,store:O})=>p("g",{},p("line",{x1:0,y1:v.height/2,x2:v.width,y2:v.height/2,stroke:v.color,"stroke-width":v.height}),p("g",{transform:`translate(0 ${v.height/2})`},d({element:v,type:v.startHead})),p("g",{transform:`translate(${v.width} ${v.height/2}) rotate(180)`},d({element:v,type:v.endHead}))),figure:async({element:v,page:b,store:O,elementHook:j})=>{const T=function(F){let C=F.replace(/<svg[^>]*>/,"");return C=C.replace(/<\/svg>/,""),C}((0,c.figureToSvg)(v)),M=p("g",{innerHTML:T});return j&&j({dom:M,element:v})||M},group:async({element:v,page:b,store:O,elementHook:j})=>{const T=await Promise.all(v.children.map(F=>E({element:F,page:b,store:O,elementHook:j}))),M=p("g",{opacity:v.opacity,style:{"transform-origin":"top left"}},...T);return j&&j({dom:M,element:v})||M},gif:w};async function E({element:v,page:b,store:O,elementHook:j}){let T=await _[v.type];T||(T=()=>p("g",{}),console.error(`SVG export does not support ${v.type} type...`));const M=await T({element:v,page:b,store:O}),F=[],C=[];if(v.blurEnabled&&F.push(`blur(${v.blurRadius/2}px)`),v.brightnessEnabled&&F.push(`brightness(${100*v.brightness+100}%)`),v.sepiaEnabled&&F.push("sepia()"),v.grayscaleEnabled&&F.push("grayscale()"),v.shadowEnabled&&F.push(`drop-shadow(${v.shadowOffsetX}px ${v.shadowOffsetY}px ${v.shadowBlur}px ${v.shadowColor})`),v.filters)for(const L of Object.keys(v.filters)){const A=(0,h.shapeFilterToCSS)(h.Effects[L]);if(A&&(F.push(A.filter),A.html)){const N=A.html.replace(/<svg([^>]*)>/,"<g$1>").replace(/<\/svg>/,"</g>");C.push(N)}}const x=p("g",{className:"element",id:v.id,transform:v.type!=="group"?`translate(${v.x}, ${v.y}) rotate(${v.rotation})`:void 0,display:v.visible?void 0:"none",style:{"transform-origin":"top left",filter:F.join(" ")}},M,...C);return j&&j({dom:x,element:v})||x}async function S(v){try{const b=await fetch(v),O=await b.blob();return new Promise((j,T)=>{const M=new FileReader;M.onloadend=()=>j(M.result),M.onerror=T,M.readAsDataURL(O)})}catch(b){return console.error("Error embedding font:",b),v}}async function y({json:v,elementHook:b}){const O=await Promise.all(v.pages.map(M=>async function({page:F,store:C,elementHook:x}){const L=await Promise.all(F.children.map(I=>E({element:I,page:F,store:C,elementHook:x}))),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 N;if(A){const I=await(0,u.loadImage)(F.background);N=await(0,u.cropImage)(F.background,Object.assign({width:C.width,height:C.height,x:0,y:0},(0,o.getCrop)({width:C.width,height:C.height},{width:I.width,height:I.height})))}return p("g",{className:"page",style:{}},A?p("image",{"xlink:href":N,x:0,y:0,width:C.width,height:C.height,preserveAspectRatio:"none"}):p("rect",{x:0,y:0,width:C.width,height:C.height,fill:A?void 0:F.background}),...L)}({page:M,store:v,elementHook:b}))),j=[];(0,e.forEveryChild)({children:v.pages},M=>{M.type==="text"&&j.indexOf(M.fontFamily)===-1&&j.push(M.fontFamily)});const T=await async function(M,F){return await Promise.all(M.map(async C=>{var x,L;const A=F.find(N=>N.fontFamily===C);if(A){const N=await S(A.url);return p("style",{},`@font-face { font-family: ${C}; src: url(${N}); }`)}{const N=`https://fonts.googleapis.com/css?family=${C}:bi,normal,i,b`;try{const I=await fetch(N),W=await I.text(),G=(L=(x=W.match(/url\((.*?)\)/g))===null||x===void 0?void 0:x.map(J=>J.replace(/url\((.*?)\)/,"$1")))===null||L===void 0?void 0:L.filter(J=>J.startsWith("https"));if(!(G!=null&&G.length))throw new Error("No font URLs found");const $=await Promise.all(G.map(async J=>{const V=await S(J),H=W.match(/font-style:\s*(.*?);/),z=W.match(/font-weight:\s*(.*?);/),D=H?H[1]:"normal",K=z?z[1]:"normal";return`@font-face {
|
|
319
|
-
font-family: ${C};
|
|
320
|
-
font-style: ${D};
|
|
321
|
-
font-weight: ${K};
|
|
322
|
-
src: url(${V});
|
|
323
|
-
}`}));return p("style",{},$.join(`
|
|
324
|
-
`))}catch(I){return console.error("Error embedding Google Font:",I),p("defs",{},p("style",{type:"text/css",innerHTML:`@import url('${N}');`.replace(/&/g,"&")}))}}}))}(j,v.fonts);return p("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${v.width} ${v.height}`,width:v.width,height:v.height},...T,...O)}const g=({dom:v,nestLevel:b=0})=>{if(typeof v=="string")return v;if(!v)return"";const O=v.props,{innerHTML:j}=O,T=i(O,["innerHTML"]),M=" ".repeat(b);return`${M}<${v.type} ${Object.keys(T).map(F=>((C,x)=>typeof x=="object"?`${C}="${Object.keys(x).map(L=>`${L}:${x[L]};`).join(" ")}"`:x==null||x===""?"":`${C}="${x}"`)(F,T[F])).join(" ")}>${j||`
|
|
325
|
-
`+v.children.map(F=>g({dom:F,nestLevel:b+1})).join("")}${M}</${v.type}>
|
|
326
|
-
`}}(zl)),zl}var Hv={},P4;function s_(){return P4||(P4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;const r=hl,t=u0,n=gp(),a=Tm(),i=gp(),o=Fh();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(l=>{const u=Object.assign({},l),c={};for(var h in u)h[0]!=="_"&&(c[h]=l[h]);return c}).views(l=>({get store(){return(0,r.getParentOfType)(l,a.Store)}})).views(l=>({get startTime(){let u=0;for(const c of l.store.pages){if(c.id===l.id)return u;u+=c.duration}return u},get _exportingOrRendering(){return l._exporting||l._rendering}})).views(l=>({get computedWidth(){return l.width==="auto"?l.store.width:l.width},get computedHeight(){return l.height==="auto"?l.store.height:l.height}})).actions(l=>({toJSON:()=>JSON.parse(JSON.stringify((0,r.getSnapshot)(l))),_forEachElementUp(u,c){const h=u.map(p=>({id:p,index:l.children.findIndex(w=>w.id===p)}));h.sort((p,w)=>w.index-p.index);for(const{index:p}of h){if(p==-1)continue;const w=p<l.children.length-1&&l.children[p+1],d=u.indexOf(w==null?void 0:w.id)>=0;p===l.children.length-1||d||c(p)}},_forEachElementDown(u,c){const h=u.map(p=>({id:p,index:l.children.findIndex(w=>w.id===p)}));h.sort((p,w)=>p.index-w.index);for(const{index:p}of h){if(p==-1)continue;const w=p>0&&l.children[p-1],d=u.indexOf(w==null?void 0:w.id)>=0;p===0||d||c(p)}return!1}})).actions(l=>({clone(u={}){const c=l.toJSON();c.children.forEach(d=>{d.id=(0,t.nanoid)(10),(0,i.forEveryChild)(d,_=>{_.id=(0,t.nanoid)(10)})});const h=Object.assign(Object.assign(Object.assign({},c),{id:(0,t.nanoid)(10)}),u),p=l.store.addPage(h),w=l.store.pages.indexOf(l);p.setZIndex(w+1),p.select()},setZIndex(u){l.store.setPageZIndex(l.id,u)},set(u){Object.assign(l,u)},select(){l.store.selectPage(l.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)&&u.children.forEach(w=>{w.id=(0,t.nanoid)(10)});const p=h.create(Object.assign({id:(0,t.nanoid)(10)},u));return l.children.push(p),p.selectable&&!c&&l.store.selectElements([p.id]),p},canMoveElementsUp(u){let c=!1;return l._forEachElementUp(u,()=>{c=c||!0}),c},moveElementsUp(u){l._forEachElementUp(u,c=>{const h=l.children[c];(0,r.detach)(h),l.children.splice(c+1,0,h)})},canMoveElementsTop(u){return this.canMoveElementsUp(u)},moveElementsTop(u){const c=[],h=[];l.children.forEach(p=>{u.indexOf(p.id)>=0?c.push(p):h.push(p)}),l.children.replace(h.concat(c))},canMoveElementsDown(u){let c=!1;return l._forEachElementDown(u,()=>{c=c||!0}),c},moveElementsDown(u){l._forEachElementDown(u,c=>{const h=l.children[c];(0,r.detach)(h),l.children.splice(c-1,0,h)})},canMoveElementsBottom(u){return this.canMoveElementsDown(u)},moveElementsBottom(u){const c=[],h=[];l.children.forEach(p=>{u.indexOf(p.id)>=0?c.push(p):h.push(p)}),l.children.replace(c.concat(h))},setElementZIndex(u,c){const h=l.children.find(p=>p.id===u);h&&((0,r.detach)(h),l.children.remove(h),l.children.splice(c,0,h))},setSize({width:u,height:c,useMagic:h,softChange:p}){if(h){const w=[],d=A=>A.type==="image"&&A.x<1&&A.y<1&&A.width>=l.computedWidth-2&&A.height>=l.computedHeight-2;(0,i.forEveryChild)(l,A=>{A.type!=="group"&&(d(A)||w.push(A))});const _=w.length?(0,o.getTotalClientRect)(w):{x:0,y:0,width:l.computedWidth,height:l.computedHeight},E=1/4,S=Math.max(0,Math.min(_.x,l.computedWidth-_.x-_.width)),y=l.computedWidth*E,g=Math.max(0,S-y),v=Math.max(0,Math.min(_.y,l.computedHeight-_.y-_.height)),b=l.computedHeight*E,O=Math.max(0,v-b),j=l.computedWidth-2*g,T=l.computedHeight-2*O,M=u/j,F=c/T,C=Math.min(M,F),x=(u-j*C)/2-g*C,L=(c-T*C)/2-O*C;(0,i.forEveryChild)(l,A=>{A.type!=="group"&&(d(A)?A.set({x:A.x*C,y:A.y*C,width:A.width*M,height:A.height*F,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(A.set({x:x+A.x*C,y:L+A.y*C,width:A.width*C,height:A.height*C}),A.type==="text"?A.set({fontSize:A.fontSize*C}):A.type==="figure"&&A.set({strokeWidth:A.strokeWidth*C})))})}p||(l.width=u),p||(l.height=c)}})).actions(l=>({moveElementUp(u){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),l.moveElementsUp([u])},moveElementDown(u){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),l.moveElementsDown([u])},moveElementTop(u){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),l.moveElementsTop([u])},moveElementBottom(u){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),l.moveElementsBottom([u])},play(){l.store.play({startTime:l.startTime,endTime:l.startTime+l.duration})}}))}(Hv)),Hv}var Vv={},O4;function JC(){return O4||(O4=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)}}))}(Vv)),Vv}var A4;function Tm(){return A4||(A4=1,function(e){var r,t=Ms&&Ms.__createBinding||(Object.create?function(C,x,L,A){A===void 0&&(A=L);var N=Object.getOwnPropertyDescriptor(x,L);N&&!("get"in N?!x.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return x[L]}}),Object.defineProperty(C,A,N)}:function(C,x,L,A){A===void 0&&(A=L),C[A]=x[L]}),n=Ms&&Ms.__setModuleDefault||(Object.create?function(C,x){Object.defineProperty(C,"default",{enumerable:!0,value:x})}:function(C,x){C.default=x}),a=Ms&&Ms.__importStar||(r=function(C){return r=Object.getOwnPropertyNames||function(x){var L=[];for(var A in x)Object.prototype.hasOwnProperty.call(x,A)&&(L[L.length]=A);return L},r(C)},function(C){if(C&&C.__esModule)return C;var x={};if(C!=null)for(var L=r(C),A=0;A<L.length;A++)L[A]!=="default"&&t(x,C,L[A]);return n(x,C),x}),i=Ms&&Ms.__rest||function(C,x){var L={};for(var A in C)Object.prototype.hasOwnProperty.call(C,A)&&x.indexOf(A)<0&&(L[A]=C[A]);if(C!=null&&typeof Object.getOwnPropertySymbols=="function"){var N=0;for(A=Object.getOwnPropertySymbols(C);N<A.length;N++)x.indexOf(A[N])<0&&Object.prototype.propertyIsEnumerable.call(C,A[N])&&(L[A[N]]=C[A[N]])}return L},o=Ms&&Ms.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(e,"__esModule",{value:!0}),e.Store=e.Font=void 0,e.createStore=F;const l=hl,u=GC(),c=u0,h=o(Us()),p=WC(),w=$C(),d=YC(),_=Lm(),E=a(Op()),S=jf(),y=Nm(),g=a_(),v=XC(),b=ZC(),O=QC(),j=s_(),T=gp(),M=JC();function F({key:C,showCredit:x}={key:"",showCredit:!1}){return e.Store.create({_forceShowCredit:x,_key:C})}(0,l.setLivelinessChecking)("ignore"),e.Font=l.types.model("Font",{fontFamily:l.types.string,url:l.types.optional(l.types.string,""),styles:l.types.frozen()}).preProcessSnapshot(C=>Object.assign(Object.assign({},C),{fontFamily:C.fontFamily||C.name})),e.Store=l.types.model("Store",{role:"",pages:l.types.array(j.Page),fonts:l.types.array(e.Font),audios:l.types.array(M.Audio),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:l.types.frozen(),selectedElementsIds:l.types.array(l.types.string),animatedElementsIds:l.types.array(l.types.string),history:l.types.optional(u.UndoManager,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,window.devicePixelRatio||1),_activePageId:"",_forceShowCredit:!1,_key:"",_validated:!1}).views(C=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),C.bleedVisible},get selectedElements(){return C.selectedElementsIds.map(x=>{for(const L of C.pages)for(const A of L.children)if(A.id===x)return A}).filter(x=>!!x)},get children(){return C.pages},get selectedShapes(){const x=[];return(0,T.forEveryChild)({children:C.selectedElements},L=>{L.type!=="group"&&x.push(L)}),x},get activePage(){return C.pages.slice().find(x=>x.id===C._activePageId)||(C.pages.length?C.pages[0]:null)},get duration(){let x=0;return C.pages.forEach(L=>{x+=L.duration}),x},get _hasCroppedImages(){return C.find(x=>x.type==="image"&&x._cropModeEnabled)},find(x){let L;return(0,T.forEveryChild)({children:C.pages},A=>{if(!L&&x(A))return L=A,!0}),L},getElementById:x=>C.find(L=>L.id===x)})).actions(C=>{let x=0,L=null,A=!1;return{afterCreate(){C.history.canUndo},setCurrentTime(N){C.currentTime=N},_togglePlaying(N=!C.isPlaying){C.isPlaying=N},play({animatedElementsIds:N=[],startTime:I=0,currentTime:W=0,endTime:G=C.duration,repeat:$=!1}={}){W&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),I=W),C.animatedElementsIds=(0,l.cast)(N),C.currentTime=I,C.isPlaying=!0,x=Date.now(),L=G,A=$,requestAnimationFrame(C.seek)},checkActivePage(){let N=0;for(const I of C.pages){if(C.currentTime>=I.startTime&&C.currentTime<I.startTime+I.duration){C.selectPage(I.id);break}N+=I.duration}},seek(){if(!C.isPlaying)return;const N=Date.now(),I=N-x;x=N,C.currentTime+=I,C.checkActivePage();const W=L||C.duration;C.isPlaying&&C.currentTime<W?requestAnimationFrame(C.seek):C.isPlaying&&A?(C.currentTime=0,requestAnimationFrame(C.seek)):C.stop()},stop(){C.isPlaying=!1,C.currentTime=0,C.animatedElementsIds=(0,l.cast)([]),C.checkActivePage()}}}).actions(C=>({__(){C._validated||((0,_.validateKey)(C._key,C._forceShowCredit),C._validated=!0)},set(x){Object.assign(C,x)},setUnit({unit:x,dpi:L}){C.unit=x||C.unit,C.dpi=L||C.dpi},setRole(x){C.role=x},addPage(x){const L=j.Page.create(Object.assign({id:(0,c.nanoid)(10)},x));return C.pages.push(L),C._activePageId=L.id,L},selectPage(x){C._activePageId=x},selectElements(x){const L=x.map(A=>C.getElementById(A)).sort((A,N)=>A.page.children.indexOf(A)-A.page.children.indexOf(N)).filter(A=>!!A).map(A=>A.id);C.selectedElementsIds=(0,l.cast)(L)},toggleBleed(x){C.bleedVisible=x??!C.bleedVisible},toggleRulers(x){C.rulesVisible=x??!C.rulesVisible},openSidePanel(x){C.openedSidePanel!==x&&(C.previousOpenedSidePanel=C.openedSidePanel,C.openedSidePanel=x)},setScale(x){C.scale=x},_setScaleToFit(x){C.scaleToFit=x},setElementsPixelRatio(x){C._elementsPixelRatio=x},setSize(x,L,A){C.pages.forEach(N=>{N.setSize({width:x,height:L,useMagic:A,softChange:!0})}),C.width=x,C.height=L},setPageZIndex(x,L){const A=C.pages.find(N=>N.id===x);A&&((0,l.detach)(A),C.pages.remove(A),C.pages.splice(L,0,A))},deletePages(x){const L=C.pages.indexOf(C.activePage);x.forEach(I=>{const W=C.pages.find(G=>G.id===I);(0,l.destroy)(W)});const A=Math.min(C.pages.length-1,L),N=C.pages[A];N&&(C._activePageId=N.id),C.selectedElementsIds=(0,l.cast)(C.selectedElementsIds.filter(I=>C.getElementById(I)))},groupElements(x){const L=x.map(I=>C.getElementById(I));L.forEach(I=>{I&&(0,l.detach)(I)});const A=C.activePage,N={id:(0,c.nanoid)(10),children:L,type:"group"};return A.children.push(N),C.selectedElementsIds=(0,l.cast)([N.id]),A.children.find(I=>I.id===N.id)},ungroupElements(x){const L=x.map(N=>C.getElementById(N)),A=[];L.forEach(N=>{if(N&&N.type==="group"){const I=N.page,W=I.children.indexOf(N);N.children.forEach(G=>{A.push(G.id)}),N.children.forEach(G=>{(0,l.detach)(G),I.children.push(G)}),I.children.splice(W,1)}}),C.selectedElementsIds=(0,l.cast)(A)},deleteElements(x){const L=[];C.find(A=>(x.includes(A.id)&&L.push(A),!1)),L.forEach(A=>{(0,l.destroy)(A)}),C.selectedElementsIds=(0,l.cast)(C.selectedElementsIds.filter(A=>C.getElementById(A)))},on(x,L){if(x==="change"){let A=C.toJSON();return(0,l.onSnapshot)(C,N=>{const I=C.toJSON();!(0,g.deepEqual)(A,I)&&(A=I,L(I))})}},async _toCanvas({pixelRatio:x,ignoreBackground:L,pageId:A,mimeType:N,includeBleed:I,_skipTimeout:W,quickMode:G=!1}={}){var $;const J=x||1;A=A||(($=C.pages[0])===null||$===void 0?void 0:$.id);const V=C.pages.find(we=>we.id===A);if(!V)throw new Error(`No page for export with id ${A}`);G?V==null||V.set({_forceMount:!0}):V==null||V.set({_exporting:!0});const H=await(0,v.waitTillAvailable)(()=>h.default.stages.find(we=>we.getAttr("pageId")===A));if(!H)throw V==null||V.set({_forceMount:!1,_exporting:!1}),new Error(`Export is failed. Can not find stage for page ${A}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const z=!!H.findOne(".page-container"),D=C._elementsPixelRatio;J>C._elementsPixelRatio&&C.setElementsPixelRatio(J),await C.waitLoading({_skipTimeout:W});const K=H.findOne(".page-container");if(!K)throw C.setElementsPixelRatio(D),V==null||V.set({_forceMount:!1,_exporting:!1}),new Error(`Export is failed. Can't find page container. ${z}`);const ne=H.position();H.position({x:0,y:0}),H.find("Transformer").forEach(we=>{we.setAttr("oldVisible",we.visible()),we.visible(!1)}),K.find(".page-background").forEach(we=>we.shadowEnabled(!1)),K.find(".page-background").forEach(we=>we.strokeEnabled(!1)),K.find(".highlighter").forEach(we=>we.visible(!1));const Z=K.findOne(".page-background-group"),ee=Z.clip();Z.clip({x:null,y:null,width:null,height:null});const ae=K.findOne(".elements-container"),se=ae.clip();ae.clip({x:null,y:null,width:null,height:null});const ce=K.find(we=>we.getAttr("hideInExport"));ce.forEach(we=>{we.setAttr("oldVisible",we.visible()),we.hide()});const me=K.find(we=>!we.visible()&&we.getAttr("editModeEnabled"));me.forEach(we=>{we.setAttr("oldVisible",we.visible()),we.show()}),L&&K.find(".page-background").forEach(we=>we.hide());const xe=I?V.bleed:0;let Oe=xe;!C.bleedVisible&&I||(C.bleedVisible||I?C.bleedVisible&&I?Oe=0:C.bleedVisible&&!I&&(Oe=-V.bleed):Oe=0);const Re=document.createElement("canvas");Re.width=Math.round((V.computedWidth+2*xe)*J),Re.height=Math.round((V.computedHeight+2*xe)*J);const Se=Re.getContext("2d");N==="image/jpeg"&&(Se.fillStyle="white",Se.fillRect(0,0,Re.width,Re.height));const ve=K.scale();K.scale({x:1,y:1});const He=K.toCanvas({x:K.x()-Oe,y:K.y()-Oe,width:V.computedWidth+2*xe,height:V.computedHeight+2*xe,pixelRatio:J});return K.scale(ve),Se.drawImage(He,0,0,Re.width,Re.height),h.default.Util.releaseCanvas(He),L&&K.find(".page-background").forEach(we=>we.show()),ce.forEach(we=>{we.visible(we.getAttr("oldVisible"))}),me.forEach(we=>{we.visible(we.getAttr("oldVisible"))}),K.find(".page-background").forEach(we=>we.shadowEnabled(!0)),K.find(".page-background").forEach(we=>we.strokeEnabled(!0)),H.find("Transformer").forEach(we=>{we.visible(we.getAttr("oldVisible"))}),K.find(".highlighter").forEach(we=>we.visible(!0)),Z.clip(ee),ae.clip(se),H.position(ne),C.setElementsPixelRatio(D),V==null||V.set({_exporting:!1,_forceMount:!1}),Re},async toDataURL(x={}){var{mimeType:L,quality:A}=x,N=i(x,["mimeType","quality"]);const I=await C._toCanvas(Object.assign({mimeType:L},N)),W=I.toDataURL(L,A);return h.default.Util.releaseCanvas(I),W},async toBlob(x={}){var{mimeType:L,quality:A}=x,N=i(x,["mimeType","quality"]);const I=await C._toCanvas(Object.assign({mimeType:L},N)),W=await new Promise(G=>{I.toBlob(G,L,A)});return h.default.Util.releaseCanvas(I),W},async saveAsImage(x={}){var{fileName:L}=x,A=i(x,["fileName"]);const N=A.mimeType||"image/png",I=N.split("/")[1];(0,p.downloadFile)(await C.toDataURL(A),L||"polotno."+I,N)},async _toPDF(x){const L=x.dpi||C.dpi,A=x.parallel||1,N=x.unit||(C.unit==="px"?"mm":C.unit),I=x.pixelRatio||1,W=x.pageIds||C.pages.map(se=>se.id),G=C.pages.filter(se=>W.includes(se.id)),$=await(0,w.getJsPDF)(),J=se=>(0,y.pxToUnit)({px:se,unit:N,dpi:L}),V=x.cropMarkSize||0,H=J(V),z=G[0]||{},D=x.includeBleed?z.bleed:0,K=J(z.computedWidth+2*D+2*H),ne=J(z.computedHeight+2*D+2*H);var Z=new $({unit:N,orientation:K>ne?"landscape":"portrait",format:[K,ne],compress:!0,putOnlyUsedFonts:!0});Z.deletePage(1);const ee=((se,ce)=>{for(var me=[],xe=0;xe<se.length;xe+=ce)me.push(se.slice(xe,xe+ce));return me})(G,A);let ae=0;for(const se of ee){const ce=se.map(async me=>{const xe=x.includeBleed?me.bleed:0,Oe=me.computedWidth+2*xe+2*V,Re=me.computedHeight+2*xe+2*V,Se=J(Oe),ve=J(Re);let He=0,we=I;for(;He<10;){He+=1,He===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const Ae=await C.toDataURL(Object.assign(Object.assign({},x),{pageId:me.id,pixelRatio:we}));if(Ae.length>20)return x.onProgress&&x.onProgress(++ae/W.length*.9),{url:Ae,width:Se,height:ve,widthPx:Oe,heightPx:Re};we*=.8}});(await Promise.all(ce)).forEach(({url:me,width:xe,height:Oe,widthPx:Re,heightPx:Se})=>{Z.addPage([xe,Oe],xe>Oe?"landscape":"portrait");const ve=Z.getCurrentPageInfo();var He;switch(N){case"pt":He=1;break;case"mm":He=72/25.4;break;case"cm":He=72/2.54;break;case"in":He=72;break;case"px":He=.75;break;case"pc":case"em":He=12;break;case"ex":He=6;break;default:throw"Invalid unit: "+N}if(ve.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:xe*He,topRightY:Oe*He},ve.pageContext.artBox={bottomLeftX:J(V+D)*He,bottomLeftY:J(V+D)*He,topRightX:J(Re-V-D)*He,topRightY:J(Se-V-D)*He},ve.pageContext.bleedBox={bottomLeftX:J(V+D)*He,bottomLeftY:J(V+D)*He,topRightX:J(Re-V-D)*He,topRightY:J(Se-V-D)*He},H){Z.setLineWidth(J(1));const we=H+J(D);Z.line(we,0,we,H),Z.line(0,we,H,we),Z.line(xe-we,0,xe-we,H),Z.line(xe,we,xe-H,we),Z.line(0,Oe-we,H,Oe-we),Z.line(we,Oe,we,Oe-H),Z.line(xe,Oe-we,xe-H,Oe-we),Z.line(xe-we,Oe,xe-we,Oe-H)}Z.addImage(me,H,H,xe-2*H,Oe-2*H,void 0,"FAST")})}return Z},toPDFDataURL:async x=>(await C._toPDF(Object.assign({mimeType:"image/jpeg"},x))).output("datauristring"),async toGIFDataURL(x={}){const L=x.pixelRatio||1,A=await(0,d.createGIF)({width:C.width*L,height:C.height*L}),N=1e3/(x.fps||10),I=C.duration/N;for(let W=0;W<I-1;W++){const G=W*N||1;C.setCurrentTime(G);let $=0,J="";for(const H of C.pages)if($+=H.duration,H.set({_rendering:$>G}),$>G){J=H.id;break}const V=await C._toCanvas({pixelRatio:L,pageId:J,_skipTimeout:!0});A.addFrame(V.getContext("2d"),{delay:N,copy:!0})}for(const W of C.pages)W.set({_rendering:!1});return C.stop(),A.render(),new Promise(W=>{A.on("finished",function(G){(function($,J){var V=new FileReader;V.onload=function(H){J(H.target.result)},V.readAsDataURL($)})(G,W)})})},async saveAsGIF(x={}){var{fileName:L}=x,A=i(x,["fileName"]);const N=await C.toGIFDataURL(A);(0,p.downloadFile)(N,L||"polotno.gif")},async toHTML({elementHook:x}={elementHook:void 0}){const L=C.toJSON();return(0,b.jsonToHTML)({json:L,elementHook:x})},async saveAsHTML({fileName:x}={}){const L=await C.toHTML(),A="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(L)));(0,p.downloadFile)(A,x||"polotno.html")},async toSVG({elementHook:x,pageId:L}={elementHook:void 0,pageId:void 0}){var A;const N=C.toJSON();L=L||((A=N.pages[0])===null||A===void 0?void 0:A.id);const I=N.pages.find(W=>W.id===L);return(0,O.jsonToSVG)({json:Object.assign(Object.assign({},N),{pages:I?[I]:[]}),elementHook:x})},async saveAsSVG({fileName:x,elementHook:L,pageId:A}={}){const N=await C.toSVG({elementHook:L,pageId:A}),I="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(N)));(0,p.downloadFile)(I,x||"polotno.svg")},async saveAsPDF(x={}){var{fileName:L}=x,A=i(x,["fileName"]);(await C._toPDF(Object.assign({mimeType:"image/jpeg"},A))).save(L||"polotno.pdf")},async waitLoading({_skipTimeout:x=!1}={}){x||await new Promise(L=>setTimeout(L,50)),await(0,S.whenLoaded)()},toJSON:()=>({width:C.width,height:C.height,fonts:(0,l.getSnapshot)(C.fonts),pages:(0,l.getSnapshot)(C.pages),audios:(0,l.getSnapshot)(C.audios),unit:C.unit,dpi:C.dpi,custom:C.custom}),loadJSON(x,L=!1){var A;const N=Object.assign({},x),I=C.pages.indexOf(C.activePage);let W=(A=N.pages[I]||N.pages[0])===null||A===void 0?void 0:A.id;N._activePageId=W;const G=Object.assign({},(0,l.getSnapshot)(C));Object.assign(G,N),G.history=L?C.history.toJSON():{history:[],undoIdx:-1},(0,l.applySnapshot)(C,G)},clear({keepHistory:x=!1}={}){const L=C.pages.map(A=>A.id);C.deletePages(L),C.custom=null,x||C.history.clear()},addFont(x){C.removeFont(x.fontFamily),C.fonts.push(x),C.loadFont(x.fontFamily)},removeFont(x){C.fonts.filter(L=>L.fontFamily===x).forEach(L=>(0,l.destroy)(L))},addAudio(x){const L=M.Audio.create(Object.assign({id:(0,c.nanoid)(10)},x));C.audios.push(L)},removeAudio(x){const L=C.audios.find(A=>A.id===x);L&&C.audios.remove(L)},async loadFont(x){const L=C.fonts.find(N=>N.fontFamily===x)||E.globalFonts.find(N=>N.fontFamily===x);let A=[{fontStyle:"normal",fontWeight:"normal"}];return L?(L.styles&&(A=L.styles.map(N=>({fontStyle:N.fontStyle||"normal",fontWeight:N.fontWeight||"normal"}))),E.injectCustomFont(L)):E.injectGoogleFont(x),Promise.all(A.map(N=>E.loadFont(x,N.fontStyle,N.fontWeight)))},validate:x=>e.Store.validate(x,[{path:"",type:e.Store}]).map(L=>({path:"store"+L.context.map(A=>A.path).join("."),message:L.message}))})),e.default=F}(Ms)),Ms}var C4;function l_(){return C4||(C4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;const r=hl,t=u0,n=Tm(),a=s_(),i=gp();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 l in o)o[l]===null&&(o[l]=void 0);return o}).postProcessSnapshot(o=>{const l=Object.assign({},o),u={};for(var c in l)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 l=o;for(;;){if(!(0,r.hasParentOfType)(l,i.GroupElement))return l;l=(0,r.getParentOfType)(l,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(l={},{skipSelect:u=!1}={}){const c=JSON.parse(JSON.stringify(o.toJSON()));return l.id=l.id||(0,t.nanoid)(10),(0,i.forEveryChild)(c,h=>{h.id=(0,t.nanoid)(10)}),Object.assign(c,l),o.page.addElement(c,{skipSelect:u})},set(l){Object.assign(o,l)},moveUp(){o.page.moveElementsUp([o.id])},moveTop(){o.page.moveElementsTop([o.id])},moveDown(){o.page.moveElementsDown([o.id])},moveBottom(){o.page.moveElementsBottom([o.id])},setZIndex(l){o.parent.setElementZIndex(o.id,l)},beforeDestroy(){}}))}(Rv)),Rv}var Gv={},Wv={},k4;function ek(){return k4||(k4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registerAnimation=e.animate=e.animations=void 0;const r=Fh(),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 l=a/o.duration;return o.type==="enter"?{opacity:l*i.opacity}:{opacity:(1-l)*i.opacity}},rotate:({dTime:a,element:i,animation:o})=>{const l=a/o.duration*360;return(0,r.rotateAroundCenter)({x:i.x,y:i.y,width:i.width,height:i.height,rotation:i.rotation},l)},blink:({dTime:a,element:i,animation:o})=>{const l=o.duration,u=a%l/(l/2),c=u<=1?u:2-u;return{opacity:i.opacity*c}},bounce:({dTime:a,element:i,animation:o})=>{var l;const u=o.duration,c=u/2,h=(l=o.data.strength)!==null&&l!==void 0?l:1,p={},w={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},d={x:i.x,y:i.y,width:i.width,height:i.height,fontSize:i.fontSize},_=a%u/c,E=_<=1?_:2-_;for(let S in w){const y=w[S],g=d[S]-y;p[S]=y+E*g}return p},move:({dTime:a,element:i,animation:o})=>{var l;const u=t[o.data.direction]||t.right,c=(l=o.data.strength)!==null&&l!==void 0?l:1,h={};for(var p in u.from){let w=u.from[p],d=u.to[p];o.type==="exit"&&(w=u.to[p],d=-u.from[p]),w*=c,d*=c;const _=i[p]+w,E=i[p]+d-_;h[p]=_+a/o.duration*E}return h},zoom:({dTime:a,element:i,animation:o})=>{var l;const u={},c=1+(((o.data.direction||"in")==="in"?.75:1.25)-1)*((l=o.data.strength)!==null&&l!==void 0?l:1),h=i.rotation*Math.PI/180,p=Math.cos(h),w=Math.sin(h),d=i.width*(1-c),_=i.height*(1-c),E=(d*p-_*w)/2,S=(d*w+_*p)/2,y={x:i.x+E,y:i.y+S,width:i.width*c,height:i.height*c,fontSize:i.fontSize*c},g={x:i.x,y:i.y,width:i.width,height:i.height,fontSize:i.fontSize};for(var v in y){let b=y[v],O=g[v];if(o.type==="exit"){const T=b;b=O,O=T}const j=O-b;u[v]=b+a/o.duration*j}return u},cameraZoom:({dTime:a,element:i,animation:o})=>{var l,u,c;const h={},p=o.data.direction||"right",w=n[p]||n.right,d=(l=o.data.movementStrength)!==null&&l!==void 0?l:.1,_=(u=o.data.shakeStrength)!==null&&u!==void 0?u:.015;c=o.data.zoomStrength;const E=a/o.duration,S=_*(1-E),y=Math.sin(12*E)*S*.7+Math.sin(8*E)*S*.3;o.type==="exit"&&Math.max(i.cropWidth||1,i.cropHeight||1),o.type;const g=1-Math.pow(1-E,2),v=i.cropX||0,b=i.cropY||0,O=i.cropWidth||1,j=i.cropHeight||1,T=O,M=j;let F,C,x=0,L=0;if(w.cropX){const A=w.cropX>0?1-(v+O):v;x=Math.min(A,Math.abs(d))*w.cropX}if(w.cropY){const A=w.cropY>0?1-(b+j):b;L=Math.min(A,Math.abs(d))*w.cropY}return o.type==="enter"?(F=w.cropX?v+x*(1-g):v,C=w.cropY?b+L*(1-g):b):(F=w.cropX?v+x*g:v,C=w.cropY?b+L*g:b),h.cropX=Math.max(0,Math.min(1-T,F+y*T)),h.cropY=Math.max(0,Math.min(1-M,C+y*M)),h.cropWidth=T,h.cropHeight=M,h}},e.animate=({element:a,dTime:i,animation:o})=>{const l=e.animations[o.name];return l?l({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}}(Wv)),Wv}var L4;function Dh(){return L4||(L4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.ShapeFilter=e.getDiff=e.Animation=void 0;const r=hl,t=ek(),n=fl,a=l_();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 l={};for(const u in o)if(typeof i[u]=="number"&&typeof o[u]=="number"){const c=o[u]-i[u];c!==0&&(l[u]=c)}return l},e.ShapeFilter=r.types.model("ShapeFilter",{intensity:1}),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}),l=(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(l({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 w=i.animations.find(y=>y.type==="enter"),d=(w==null?void 0:w.enabled)&&h<w.delay;d&&l({opacity:0});const _=(w==null?void 0:w.enabled)&&h>=w.delay&&h<=w.delay+w.duration;if(_){const y=h-w.delay,g=(0,t.animate)({element:i,animation:w,dTime:y}),v=(0,e.getDiff)(i,g);u(v)}const E=i.animations.find(y=>y.type==="exit");if(!d&&!_&&(E!=null&&E.enabled)&&h>=i.page.duration-E.duration-E.delay&&h<=i.page.duration-E.delay){const y=h-(i.page.duration-E.duration-E.delay),g=(0,t.animate)({element:i,animation:E,dTime:y}),v=(0,e.getDiff)(i,g);u(v)}E!=null&&E.enabled&&h>=i.page.duration-E.delay&&l({opacity:0});const S=i.animations.find(y=>y.type==="loop");if(S!=null&&S.enabled){const y=h,g=(0,t.animate)({element:i,animation:S,dTime:y}),v=(0,e.getDiff)(i,g);u(v)}return o},animated:c=>i.a[c]}}).actions(i=>({setAnimation(o,l){const u=i.animations.find(c=>c.type===o);u?Object.assign(u,l):i.animations.push(Object.assign({type:o},l))},setFilter(o,l){i.filters.clear(),l!==0&&i.filters.set(o,{intensity:l})}}))}(Gv)),Gv}var $v={},N4;function tk(){return N4||(N4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=void 0;const r=hl,t=Dh();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()}}))}($v)),$v}var Yv={},T4;function Rm(){return T4||(T4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=void 0;const r=Dh();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,_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()}}))}(Yv)),Yv}var Xv={},R4;function rk(){return R4||(R4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=void 0;const r=Rm();e.VideoElement=r.ImageElement.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1})}(Xv)),Xv}var Kv={},M4;function nk(){return M4||(M4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;const r=hl,t=Dh();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=>({}))}(Kv)),Kv}var Zv={},I4;function ik(){return I4||(I4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGElement=void 0;const r=hl,t=Dh();e.SVGElement=t.Shape.named("SVG").props({type:"svg",src:"",maskSrc:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,keepRatio:!0,flipX:!1,flipY:!1,width:100,height:100,borderColor:"black",borderSize:0,cornerRadius:0,colorsReplace: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)}}))}(Zv)),Zv}var Qv={},j4;function ak(){return j4||(j4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const r=hl,t=Dh();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})}(Qv)),Qv}var Jv={},F4;function ok(){return F4||(F4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GifElement=void 0;const r=Rm();e.GifElement=r.ImageElement.named("Gif").props({type:"gif",duration:0,keepRatio:!0})}(Jv)),Jv}var D4;function gp(){return D4||(D4=1,function(e){var r=Jd&&Jd.__rest||function(E,S){var y={};for(var g in E)Object.prototype.hasOwnProperty.call(E,g)&&S.indexOf(g)<0&&(y[g]=E[g]);if(E!=null&&typeof Object.getOwnPropertySymbols=="function"){var v=0;for(g=Object.getOwnPropertySymbols(E);v<g.length;v++)S.indexOf(g[v])<0&&Object.prototype.propertyIsEnumerable.call(E,g[v])&&(y[g[v]]=E[g[v]])}return y};Object.defineProperty(e,"__esModule",{value:!0}),e.TYPES_MAP=e.GroupElement=e.ElementTypes=e.forEveryChild=void 0,e.registerShapeModel=function(E,S){const y=E.type;if(!y)throw new Error('You must pass "type" attribute to custom model.');let g=i.Shape.named(y).props(E);S&&(g=S(g)),e.TYPES_MAP[y]=g,_.push(g)};const t=hl,n=u0,a=l_(),i=Dh(),o=tk(),l=Rm(),u=rk(),c=nk(),h=ik(),p=ak(),w=ok();e.forEveryChild=(E,S)=>{if(E.children)for(const y of E.children){if(S(y)===!0)break;(0,e.forEveryChild)(y,S)}};const d=[...new Array(20)].map((E,S)=>t.types.late(()=>_[S]));e.ElementTypes=t.types.union({dispatcher:E=>{const S=e.TYPES_MAP[E.type];if(!S)throw new Error(`Unknown element type: "${E.type}"`);return S}},h.SVGElement,o.TextElement,l.ImageElement,c.LineElement,u.VideoElement,p.FigureElement,w.GifElement,t.types.late(()=>e.GroupElement),...d),e.GroupElement=a.Node.named("Group").props({type:"group",children:t.types.array(e.ElementTypes)}).views(E=>({get draggable(){let S=!0;return(0,e.forEveryChild)(E,y=>{y.draggable||(S=!1)}),S},get resizable(){let S=!0;return(0,e.forEveryChild)(E,y=>{y.resizable||(S=!1)}),S},get contentEditable(){let S=!0;return(0,e.forEveryChild)(E,y=>{y.contentEditable||(S=!1)}),S},get styleEditable(){let S=!0;return(0,e.forEveryChild)(E,y=>{y.styleEditable||(S=!1)}),S},get locked(){let S=!0;return(0,e.forEveryChild)(E,y=>{y.locked||(S=!1)}),S}})).actions(E=>({set(S){var{draggable:y,contentEditable:g,styleEditable:v,resizable:b}=S,O=r(S,["draggable","contentEditable","styleEditable","resizable"]);y!==void 0&&(0,e.forEveryChild)(E,j=>{j.set({draggable:y})}),g!==void 0&&(0,e.forEveryChild)(E,j=>{j.set({contentEditable:g})}),v!==void 0&&(0,e.forEveryChild)(E,j=>{j.set({styleEditable:v})}),b!==void 0&&(0,e.forEveryChild)(E,j=>{j.set({resizable:b})}),Object.assign(E,O)},addElement(S,{skipSelect:y=!1}={}){const g=e.TYPES_MAP[S.type];if(!g)return void console.error("Can not find model with type "+S.type);S.children&&S.children.forEach(b=>{b.id=(0,n.nanoid)(10)});const v=g.create(Object.assign({id:(0,n.nanoid)(10)},S));return E.children.push(v),v.selectable&&!y&&E.store.selectElements([v.id]),v},setElementZIndex(S,y){const g=E.children.find(v=>v.id===S);g&&((0,t.detach)(g),E.children.remove(g),E.children.splice(y,0,g))}}));const _=[];e.TYPES_MAP={svg:h.SVGElement,text:o.TextElement,image:l.ImageElement,group:e.GroupElement,line:c.LineElement,video:u.VideoElement,figure:p.FigureElement,gif:w.GifElement}}(Jd)),Jd}var B4;function sk(){return B4||(B4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isClipboardEmpty=e.paste=e.cut=e.copy=void 0;const r=gp(),t=Fh();let n={data:[],pageId:""};const a="polotno_clipboard",i=(l,u)=>{n={data:JSON.parse(JSON.stringify(l)),pageId:u};try{localStorage.setItem(a,JSON.stringify(l)),localStorage.setItem(a+"_page",u)}catch{}},o=()=>{try{const l=localStorage.getItem(a),u=localStorage.getItem(a+"_page");if(l)return{data:JSON.parse(l),pageId:u}}catch{}return n};e.copy=l=>{var u;l.selectedElements.length!==0&&i(l.selectedElements.map(c=>c.toJSON()),(u=l.activePage)===null||u===void 0?void 0:u.id)},e.cut=l=>{var u;i(l.selectedElements.map(h=>h.toJSON()),(u=l.activePage)===null||u===void 0?void 0:u.id);let c=l.selectedElements.filter(h=>h.removable).map(h=>h.id);l.deleteElements(c)},e.paste=l=>{l.history.transaction(()=>{var u,c;let h=0,p=0;const{data:w,pageId:d}=o();if(d===((u=l.activePage)===null||u===void 0?void 0:u.id))h=l.width/20,p=l.height/20;else{const E=[];(0,r.forEveryChild)({children:w},y=>{y.type!=="group"&&E.push(y)});const S=(0,t.getTotalClientRect)(E);S.maxX>l.width&&(h=-S.minX),S.maxY>l.height&&(p=-S.minY)}const _=[];(0,r.forEveryChild)({children:w},E=>{delete E.id,E.type!=="group"&&(E.x+=h,E.y+=p)}),w.forEach(E=>{var S;const y=(S=l.activePage)===null||S===void 0?void 0:S.addElement(E);y&&_.push(y.id)}),i(w,(c=l.activePage)===null||c===void 0?void 0:c.id),l.selectElements(_)})},e.isClipboardEmpty=()=>o().data.length===0}(Tv)),Tv}var q4;function lk(){return q4||(q4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.handleHotkey=function(t,n){var a,i,o,l;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=(l=n.activePage)===null||l===void 0?void 0:l.children.filter(d=>d.selectable),w=(p==null?void 0:p.map(d=>d.id))||[];n.selectElements(w)}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.selectedElements.forEach(p=>{p.draggable&&p.set({y:p.y+1})})),t.code==="ArrowUp"&&(t.preventDefault(),n.selectedElements.forEach(p=>{p.draggable&&p.set({y:p.y-1})})),t.code==="ArrowLeft"&&(t.preventDefault(),n.selectedElements.forEach(p=>{p.draggable&&p.set({x:p.x-1})})),t.code==="ArrowRight"&&(t.preventDefault(),n.selectedElements.forEach(p=>{p.draggable&&p.set({x:p.x+1})}))};const r=sk()}(Nv)),Nv}var e2={},z4;function uk(){return z4||(z4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t=e.getTranslations=e.setTranslations=void 0;const r=fl,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"},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=l=>l&&typeof l=="object";function a(l,u){Object.keys(u).forEach(c=>{const h=l[c],p=u[c];n(p)&&n(h)?a(h,p):l[c]=p})}function i(l,u,c=""){Object.keys(u).forEach(h=>{const p=u[h],w=c?`${c}.${h}`:h;n(p)?n(l[h])?i(l[h],p,w):console.warn(`Missing nested translation object at '${w}'`):l[h]===void 0&&console.warn(`Missing translation '${w}'`)})}e.setTranslations=(0,r.action)((l,{validate:u=!1}={})=>{u&&i(l,t),a(t,l)}),e.getTranslations=()=>(0,r.toJS)(t);const o={};e.t=l=>{const u=function(p,w){var d,_=w.split("."),E=p;for(d=0;d<_.length;++d){if(E[_[d]]==null)return;E=E[_[d]]}return E}(t,l);if(u!==void 0)return u;o[l]||(o[l]=!0,console.warn(`Missing translation '${l}'`));const c=l.split("."),h=c[c.length-1]||" ";return h.charAt(0).toUpperCase()+h.slice(1)}}(e2)),e2}var U4;function ck(){return U4||(U4=1,function(e){var r=Xh&&Xh.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceCanvas=void 0;const t=r(di()),n=zs,a=r(DC()),i=BC(),o=qC(),l=lk(),u=uk(),c=({store:p})=>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:()=>{p.addPage()}},(0,u.t)("workspace.addPage"))),h=({width:p,height:w,xPadding:d,yPadding:_,backgroundColor:E})=>t.default.createElement("div",{style:{width:p+"px",height:w+"px",backgroundColor:E,paddingLeft:d+"px",paddingRight:d+"px",paddingTop:_+"px",paddingBottom:_+"px"}},t.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));e.WorkspaceCanvas=(0,n.observer)(({store:p,pageControlsEnabled:w,backgroundColor:d,pageBorderColor:_,activePageBorderColor:E,bleedColor:S,components:y,onKeyDown:g,paddingX:v,paddingY:b,altCloneEnabled:O=!0,visiblePagesOffset:j,renderOnlyActivePage:T})=>{var M;const F=v??20,C=b??55,[x,L]=t.default.useState({width:100,height:100}),A=t.default.useRef(x),N=t.default.useRef(null),I=t.default.useRef(null),W=p.bleedVisible?Math.max(0,...p.pages.map(Re=>Re.bleed)):0,G=Math.max(...p.pages.map(Re=>Re.computedWidth)),$=Math.max(...p.pages.map(Re=>Re.computedHeight)),J=((M=p.activePage)===null||M===void 0?void 0:M.computedHeight)||0,V=G+2*W,H=(T?J:$)+2*W,z=async({skipTimeout:Re}={skipTimeout:!1})=>{if(Re||await new Promise(he=>setTimeout(he,50)),N.current===null)return;const Se=N.current.getBoundingClientRect();Se.width!==0&&Se.height!==0||(console.warn(`Polotno warning: <Workspace /> component can not automatically detect its size.
|
|
327
|
-
Width or height of parent elements is equal 0.
|
|
328
|
-
Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
|
|
329
|
-
For simpler debugging here is the log of the parent element:`),console.log(N.current));const ve=I.current.clientWidth||Se.width,He={width:ve,height:Se.height};(A.current.width!==He.width||A.current.height!==He.height)&&(L(He),A.current=He);const we=(ve-2*F)/V,Ae=p.pages.length>1?3.1:2,Ee=(Se.height-C*Ae)/H,Ne=Math.max(Math.min(we,Ee),.01);p.scaleToFit!==Ne&&(p.setScale(Ne),p._setScaleToFit(Ne))};t.default.useLayoutEffect(()=>{z({skipTimeout:!0})},[]),t.default.useEffect(()=>{z()},[V,H]),t.default.useEffect(()=>{p.__()},[]),t.default.useEffect(()=>{const Re=N.current;if(window.ResizeObserver){const Se=new ResizeObserver(()=>{z({skipTimeout:!0})});return Se.observe(Re),()=>Se.unobserve(Re)}{const Se=setInterval(()=>{z({skipTimeout:!0})},100);return()=>clearInterval(Se)}},[V,H]);const D=Math.max(F,(x.width-V*p.scale)/2),K=T?1:p.pages.length,ne=H*p.scale*K,Z=Math.max(C,(x.height-ne)/K/2);t.default.useEffect(()=>{const Re=Se=>{(g||l.handleHotkey)(Se,p)};return window.addEventListener("keydown",Re),()=>window.removeEventListener("keydown",Re)},[]),t.default.useEffect(()=>{var Re;const Se=ve=>{if(ve.ctrlKey||ve.metaKey){ve.preventDefault();const Ee=Math.max(5,p.scaleToFit),Ne=Math.min(.1,p.scaleToFit),he=.03,Le=(He=ve.deltaY<0?p.scale*(1+he):p.scale/(1+he),we=Ne,Ae=Ee,Math.max(we,Math.min(Ae,He)));p.setScale(Le)}else var He,we,Ae};return(Re=I.current)===null||Re===void 0||Re.addEventListener("wheel",Se),()=>{var ve;return(ve=I.current)===null||ve===void 0?void 0:ve.removeEventListener("wheel",Se)}},[]);const ee=t.default.useRef(!1);((Re,Se,ve,He,we,Ae)=>{const Ee=t.default.useRef({width:Se,height:ve}),Ne=t.default.useRef({top:0,left:0}),he=t.default.useRef(!1),Le=t.default.useRef(we.pages.length);he.current=Le.current!==we.pages.length,Le.current=we.pages.length,t.default.useEffect(()=>{const Ce=Re.current,De=tt=>{Ne.current={top:Ce.scrollTop,left:Ce.scrollLeft}};return Ce.addEventListener("scroll",De),()=>{Ce.removeEventListener("scroll",De)}},[]),t.default.useLayoutEffect(()=>{if(!Re.current||he.current)return;const Ce=Re.current,De=(Ne.current.left+Ce.offsetWidth/2)/Ee.current.width,tt=(Ne.current.top+Ce.offsetHeight/2)/Ee.current.height;Ae.current=!0,Ce.scrollLeft=De*Se-Ce.offsetWidth/2,Ce.scrollTop=tt*ve-Ce.offsetHeight/2,Ee.current={width:Se,height:ve}},[He,Se,ve])})(I,V*p.scale+2*D,H*p.scale+2*Z,p.scale,p,ee);const{handleScroll:ae}=((Re,Se,ve,He,we,Ae)=>{const Ee=t.default.useRef(!1),Ne=t.default.useRef(null),he=t.default.useRef(!1);t.default.useEffect(()=>{const Ce=Re.current,De=()=>{we.current};return Ce.addEventListener("scroll",De),()=>{Ce.removeEventListener("scroll",De)}},[]);const Le=ve.pages.indexOf(ve.activePage);return t.default.useLayoutEffect(()=>{if(!ve.activePage||!Re.current||Ee.current)return;const Ce=Re.current,De=ve.pages.indexOf(ve.activePage)*Se;let tt=()=>{};return(Math.abs(De-Ce.scrollTop)>.5*Se||he.current)&&(he.current=!0,tt=(({element:vt,scrollTop:mt=0,duration:Et=300,onFinish:nt=()=>{}})=>{const at=vt.scrollTop,qt=mt-at;let Ct=0,or=!1;if(Et===0)return vt.scrollTop=mt,()=>{};const Xt=()=>{if(or)return;Ct+=20;const We=qe(Ct,at,qt,Et);vt.scrollTop=We,Ct<Et?setTimeout(Xt,20):nt()},qe=(We,Nt,ht,gt)=>(We/=gt/2)<1?ht/2*We*We+Nt:-ht/2*(--We*(We-2)-1)+Nt;return Xt(),()=>{or=!0}})({element:Ce,scrollTop:De,onFinish:()=>{he.current=!1},duration:ve.isPlaying?0:300})),tt},[ve.activePage,Le,ve.isPlaying]),{handleScroll:Ce=>{if(Ae||he.current)return;Ee.current=!0,clearTimeout(Ne.current),Ne.current=setTimeout(()=>{Ee.current=!1},300);const De=Ce.currentTarget.childNodes[0].offsetHeight,tt=Ce.currentTarget.scrollTop,vt=Math.floor((tt+He.height/3)/De),mt=ve.pages[vt];mt&&ve.activePage!==mt&&mt.select()}}})(I,H*p.scale+2*Z,p,x,ee,T),se=x.width>=V*p.scale+2*D,ce=d||"rgba(232, 232, 232, 0.9)",me=p.pages.indexOf(p.activePage),xe=(y==null?void 0:y.NoPages)||c,Oe=j??Math.min(3,Math.max(1,Math.ceil(x.height/2/(H*p.scale))));return t.default.createElement("div",{ref:N,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:ce,overflow:"hidden"},tabIndex:0,className:"polotno-workspace-container"},t.default.createElement("div",{ref:I,onScroll:ae,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:se?"hidden":"auto"},className:"polotno-workspace-inner"},p.pages.map((Re,Se)=>{const ve=Re===p.activePage;if(T&&!ve&&!Re._exportingOrRendering&&!Re._forceMount)return null;if(!(Math.abs(Se-me)<=Oe||Re._exportingOrRendering||Re._forceMount))return t.default.createElement(h,{key:Re.id,width:V*p.scale+2*D,height:H*p.scale+2*Z,backgroundColor:ce,xPadding:D,yPadding:Z});const He=t.default.createElement(a.default,{key:Re.id,page:Re,xPadding:D,yPadding:Z,width:V*p.scale+2*D,height:H*p.scale+2*Z,store:p,pageControlsEnabled:w,backColor:ce,pageBorderColor:_||"lightgrey",activePageBorderColor:E||"rgb(0, 161, 255)",altCloneEnabled:O,bleedColor:S||"rgba(255, 0, 0, 0.1)",components:y,viewportSize:x});return(Re._exportingOrRendering||Re._forceMount)&&!ve&&T?t.default.createElement("div",{style:{display:"none"},key:Re.id},He):He}),p.rulesVisible&&t.default.createElement(i.TopRules,{store:p,xPadding:D,yPadding:Z,width:V*p.scale+2*D,height:H*p.scale+2*Z}),p.pages.length===0&&t.default.createElement(xe,{store:p}),p.audios.map(Re=>t.default.createElement(o.AudioElement,{key:Re.id,audio:Re,store:p}))))}),e.default=e.WorkspaceCanvas}(Xh)),Xh}var fk=ck(),hk=Tm(),dk=If(),np=tf(),t2=jf(),pk=Op();const gk="modulepreload",vk=function(e,r){return new URL(e,r).href},H4={},O2=function(r,t,n){let a=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));a=Promise.allSettled(t.map(c=>{if(c=vk(c,n),c in H4)return;H4[c]=!0;const h=c.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(!!n)for(let _=o.length-1;_>=0;_--){const E=o[_];if(E.href===c&&(!h||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${p}`))return;const d=document.createElement("link");if(d.rel=h?"stylesheet":gk,h||(d.as="script"),d.crossOrigin="",d.href=c,u&&d.setAttribute("nonce",u),document.head.appendChild(d),h)return new Promise((_,E)=>{d.addEventListener("load",_),d.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return a.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return r().catch(i)})};function On(e){"@babel/helpers - typeof";return On=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},On(e)}var Po=Uint8Array,Ds=Uint16Array,Mm=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]),A2=new Po([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),u_=function(e,r){for(var t=new Ds(31),n=0;n<31;++n)t[n]=r+=1<<e[n-1];for(var a=new Mm(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}},c_=u_(c0,2),f_=c_.b,C2=c_.r;f_[28]=258,C2[258]=28;var h_=u_(f0,0),mk=h_.b,V4=h_.r,k2=new Ds(32768);for(var ri=0;ri<32768;++ri){var Bc=(ri&43690)>>1|(ri&21845)<<1;Bc=(Bc&52428)>>2|(Bc&13107)<<2,Bc=(Bc&61680)>>4|(Bc&3855)<<4,k2[ri]=((Bc&65280)>>8|(Bc&255)<<8)>>1}var Ru=function(e,r,t){for(var n=e.length,a=0,i=new Ds(r);a<n;++a)e[a]&&++i[e[a]-1];var o=new Ds(r);for(a=1;a<r;++a)o[a]=o[a-1]+i[a-1]<<1;var l;if(t){l=new Ds(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,w=p|(1<<h)-1;p<=w;++p)l[k2[p]>>u]=c}else for(l=new Ds(n),a=0;a<n;++a)e[a]&&(l[a]=k2[o[e[a]-1]++]>>15-e[a]);return l},Yc=new Po(288);for(var ri=0;ri<144;++ri)Yc[ri]=8;for(var ri=144;ri<256;++ri)Yc[ri]=9;for(var ri=256;ri<280;++ri)Yc[ri]=7;for(var ri=280;ri<288;++ri)Yc[ri]=8;var vp=new Po(32);for(var ri=0;ri<32;++ri)vp[ri]=5;var yk=Ru(Yc,9,0),bk=Ru(Yc,9,1),wk=Ru(vp,5,0),_k=Ru(vp,5,1),r2=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},n2=function(e,r){var t=r/8|0;return(e[t]|e[t+1]<<8|e[t+2]<<16)>>(r&7)},Im=function(e){return(e+7)/8|0},d_=function(e,r,t){return(t==null||t>e.length)&&(t=e.length),new Po(e.subarray(r,t))},Sk=["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"],Gl=function(e,r,t){var n=new Error(r||Sk[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,Gl),!t)throw n;return n},xk=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,l=o||r.i!=2,u=r.i;o&&(t=new Po(a*3));var c=function(me){var xe=t.length;if(me>xe){var Oe=new Po(Math.max(xe*2,me));Oe.set(t),t=Oe}},h=r.f||0,p=r.p||0,w=r.b||0,d=r.l,_=r.d,E=r.m,S=r.n,y=a*8;do{if(!d){h=Ul(e,p,1);var g=Ul(e,p+1,3);if(p+=3,g)if(g==1)d=bk,_=_k,E=9,S=5;else if(g==2){var j=Ul(e,p,31)+257,T=Ul(e,p+10,15)+4,M=j+Ul(e,p+5,31)+1;p+=14;for(var F=new Po(M),C=new Po(19),x=0;x<T;++x)C[A2[x]]=Ul(e,p+x*3,7);p+=T*3;for(var L=r2(C),A=(1<<L)-1,N=Ru(C,L,1),x=0;x<M;){var I=N[Ul(e,p,A)];p+=I&15;var v=I>>4;if(v<16)F[x++]=v;else{var W=0,G=0;for(v==16?(G=3+Ul(e,p,3),p+=2,W=F[x-1]):v==17?(G=3+Ul(e,p,7),p+=3):v==18&&(G=11+Ul(e,p,127),p+=7);G--;)F[x++]=W}}var $=F.subarray(0,j),J=F.subarray(j);E=r2($),S=r2(J),d=Ru($,E,1),_=Ru(J,S,1)}else Gl(1);else{var v=Im(p)+4,b=e[v-4]|e[v-3]<<8,O=v+b;if(O>a){u&&Gl(0);break}l&&c(w+b),t.set(e.subarray(v,O),w),r.b=w+=b,r.p=p=O*8,r.f=h;continue}if(p>y){u&&Gl(0);break}}l&&c(w+131072);for(var V=(1<<E)-1,H=(1<<S)-1,z=p;;z=p){var W=d[n2(e,p)&V],D=W>>4;if(p+=W&15,p>y){u&&Gl(0);break}if(W||Gl(2),D<256)t[w++]=D;else if(D==256){z=p,d=null;break}else{var K=D-254;if(D>264){var x=D-257,ne=c0[x];K=Ul(e,p,(1<<ne)-1)+f_[x],p+=ne}var Z=_[n2(e,p)&H],ee=Z>>4;Z||Gl(3),p+=Z&15;var J=mk[ee];if(ee>3){var ne=f0[ee];J+=n2(e,p)&(1<<ne)-1,p+=ne}if(p>y){u&&Gl(0);break}l&&c(w+131072);var ae=w+K;if(w<J){var se=i-J,ce=Math.min(J,ae);for(se+w<0&&Gl(3);w<ce;++w)t[w]=n[se+w]}for(;w<ae;++w)t[w]=t[w-J]}}r.l=d,r.p=z,r.b=w,r.f=h,d&&(h=1,r.m=E,r.d=_,r.n=S)}while(!h);return w!=t.length&&o?d_(t,0,w):t.subarray(0,w)},lc=function(e,r,t){t<<=r&7;var n=r/8|0;e[n]|=t,e[n+1]|=t>>8},ep=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},i2=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:g_,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(O,j){return O.f-j.f}),t.push({s:-1,f:25001});var l=t[0],u=t[1],c=0,h=1,p=2;for(t[0]={s:-1,f:l.f+u.f,l,r:u};h!=a-1;)l=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:l.f+u.f,l,r:u};for(var w=i[0].s,n=1;n<a;++n)i[n].s>w&&(w=i[n].s);var d=new Ds(w+1),_=L2(t[h-1],d,0);if(_>r){var n=0,E=0,S=_-r,y=1<<S;for(i.sort(function(j,T){return d[T.s]-d[j.s]||j.f-T.f});n<a;++n){var g=i[n].s;if(d[g]>r)E+=y-(1<<_-d[g]),d[g]=r;else break}for(E>>=S;E>0;){var v=i[n].s;d[v]<r?E-=1<<r-d[v]++-1:++n}for(;n>=0&&E;--n){var b=i[n].s;d[b]==r&&(--d[b],++E)}_=r}return{t:new Po(d),l:_}},L2=function(e,r,t){return e.s==-1?Math.max(L2(e.l,r,t+1),L2(e.r,r,t+1)):r[e.s]=t},G4=function(e){for(var r=e.length;r&&!e[--r];);for(var t=new Ds(++r),n=0,a=e[0],i=1,o=function(u){t[n++]=u},l=1;l<=r;++l)if(e[l]==a&&l!=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[l]}return{c:t.subarray(0,n),n:r}},tp=function(e,r){for(var t=0,n=0;n<r.length;++n)t+=e[n]*r[n];return t},p_=function(e,r,t){var n=t.length,a=Im(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},W4=function(e,r,t,n,a,i,o,l,u,c,h){lc(r,h++,t),++a[256];for(var p=i2(a,15),w=p.t,d=p.l,_=i2(i,15),E=_.t,S=_.l,y=G4(w),g=y.c,v=y.n,b=G4(E),O=b.c,j=b.n,T=new Ds(19),M=0;M<g.length;++M)++T[g[M]&31];for(var M=0;M<O.length;++M)++T[O[M]&31];for(var F=i2(T,7),C=F.t,x=F.l,L=19;L>4&&!C[A2[L-1]];--L);var A=c+5<<3,N=tp(a,Yc)+tp(i,vp)+o,I=tp(a,w)+tp(i,E)+o+14+3*L+tp(T,C)+2*T[16]+3*T[17]+7*T[18];if(u>=0&&A<=N&&A<=I)return p_(r,h,e.subarray(u,u+c));var W,G,$,J;if(lc(r,h,1+(I<N)),h+=2,I<N){W=Ru(w,d,0),G=w,$=Ru(E,S,0),J=E;var V=Ru(C,x,0);lc(r,h,v-257),lc(r,h+5,j-1),lc(r,h+10,L-4),h+=14;for(var M=0;M<L;++M)lc(r,h+3*M,C[A2[M]]);h+=3*L;for(var H=[g,O],z=0;z<2;++z)for(var D=H[z],M=0;M<D.length;++M){var K=D[M]&31;lc(r,h,V[K]),h+=C[K],K>15&&(lc(r,h,D[M]>>5&127),h+=D[M]>>12)}}else W=yk,G=Yc,$=wk,J=vp;for(var M=0;M<l;++M){var ne=n[M];if(ne>255){var K=ne>>18&31;ep(r,h,W[K+257]),h+=G[K+257],K>7&&(lc(r,h,ne>>23&31),h+=c0[K]);var Z=ne&31;ep(r,h,$[Z]),h+=J[Z],Z>3&&(ep(r,h,ne>>5&8191),h+=f0[Z])}else ep(r,h,W[ne]),h+=G[ne]}return ep(r,h,W[256]),h+G[256]},Ek=new Mm([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),g_=new Po(0),Pk=function(e,r,t,n,a,i){var o=i.z||e.length,l=new Po(n+o+5*(1+Math.ceil(o/7e3))+a),u=l.subarray(n,l.length-a),c=i.l,h=(i.r||0)&7;if(r){h&&(u[0]=i.r>>3);for(var p=Ek[r-1],w=p>>13,d=p&8191,_=(1<<t)-1,E=i.p||new Ds(32768),S=i.h||new Ds(_+1),y=Math.ceil(t/3),g=2*y,v=function(Re){return(e[Re]^e[Re+1]<<y^e[Re+2]<<g)&_},b=new Mm(25e3),O=new Ds(288),j=new Ds(32),T=0,M=0,F=i.i||0,C=0,x=i.w||0,L=0;F+2<o;++F){var A=v(F),N=F&32767,I=S[A];if(E[N]=I,S[A]=N,x<=F){var W=o-F;if((T>7e3||C>24576)&&(W>423||!c)){h=W4(e,u,0,b,O,j,M,C,L,F-L,h),C=T=M=0,L=F;for(var G=0;G<286;++G)O[G]=0;for(var G=0;G<30;++G)j[G]=0}var $=2,J=0,V=d,H=N-I&32767;if(W>2&&A==v(F-H))for(var z=Math.min(w,W)-1,D=Math.min(32767,F),K=Math.min(258,W);H<=D&&--V&&N!=I;){if(e[F+$]==e[F+$-H]){for(var ne=0;ne<K&&e[F+ne]==e[F+ne-H];++ne);if(ne>$){if($=ne,J=H,ne>z)break;for(var Z=Math.min(H,ne-2),ee=0,G=0;G<Z;++G){var ae=F-H+G&32767,se=E[ae],ce=ae-se&32767;ce>ee&&(ee=ce,I=ae)}}}N=I,I=E[N],H+=N-I&32767}if(J){b[C++]=268435456|C2[$]<<18|V4[J];var me=C2[$]&31,xe=V4[J]&31;M+=c0[me]+f0[xe],++O[257+me],++j[xe],x=F+$,++T}else b[C++]=e[F],++O[e[F]]}}for(F=Math.max(F,x);F<o;++F)b[C++]=e[F],++O[e[F]];h=W4(e,u,c,b,O,j,M,C,L,F-L,h),c||(i.r=h&7|u[h/8|0]<<3,h-=7,i.h=S,i.p=E,i.i=F,i.w=x)}else{for(var F=i.w||0;F<o+c;F+=65535){var Oe=F+65535;Oe>=o&&(u[h/8|0]=c,Oe=o),h=p_(u,h+1,e.subarray(F,Oe))}i.i=o}return d_(l,0,n+Im(h)+a)},v_=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 l=Math.min(o+2655,i);o<l;++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}}},Ok=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 Pk(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)},m_=function(e,r,t){for(;t;++r)e[r]=t,t>>>=8},Ak=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=v_();a.p(r.dictionary),m_(e,2,a.d())}},Ck=function(e,r){return((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&Gl(6,"invalid zlib data"),(e[1]>>5&1)==1&&Gl(6,"invalid zlib data: "+(e[1]&32?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};function N2(e,r){r||(r={});var t=v_();t.p(e);var n=Ok(e,r,r.dictionary?6:2,4);return Ak(n,r),m_(n,n.length-4,t.d()),n}function kk(e,r){return xk(e.subarray(Ck(e),-4),{i:2},r,r)}var Lk=typeof TextDecoder<"u"&&new TextDecoder,Nk=0;try{Lk.decode(g_,{stream:!0}),Nk=1}catch{}var pr=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function a2(){pr.console&&typeof pr.console.log=="function"&&pr.console.log.apply(pr.console,arguments)}var Gn={log:a2,warn:function(e){pr.console&&(typeof pr.console.warn=="function"?pr.console.warn.apply(pr.console,arguments):a2.call(null,arguments))},error:function(e){pr.console&&(typeof pr.console.error=="function"?pr.console.error.apply(pr.console,arguments):a2(e))}};function o2(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(){Gn.error("could not download file")},n.send()}function $4(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 lp,T2,_f=pr.saveAs||((typeof window>"u"?"undefined":On(window))!=="object"||window!==pr?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(e,r,t){var n=pr.URL||pr.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?$4(a.href)?o2(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($4(e))o2(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}:On(i)!=="object"&&(Gn.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 o2(e,r,t);var a=e.type==="application/octet-stream",i=/constructor/i.test(pr.HTMLElement)||pr.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||a&&i)&&(typeof FileReader>"u"?"undefined":On(FileReader))==="object"){var l=new FileReader;l.onloadend=function(){var h=l.result;h=o?h:h.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=h:location=h,n=null},l.readAsDataURL(e)}else{var u=pr.URL||pr.webkitURL,c=u.createObjectURL(e);n?n.location=c:location.href=c,n=null,setTimeout(function(){u.revokeObjectURL(c)},4e4)}});/**
|
|
330
|
-
* A class to parse color values
|
|
331
|
-
* @author Stoyan Stefanov <sstoo@gmail.com>
|
|
332
|
-
* {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
|
|
333
|
-
* @license Use it if you like it
|
|
334
|
-
*/function y_(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(l){return[parseInt(l[1]),parseInt(l[2]),parseInt(l[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(l){return[parseInt(l[1],16),parseInt(l[2],16),parseInt(l[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(l){return[parseInt(l[1]+l[1],16),parseInt(l[2]+l[2],16),parseInt(l[3]+l[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 l=this.r.toString(16),u=this.g.toString(16),c=this.b.toString(16);return l.length==1&&(l="0"+l),u.length==1&&(u="0"+u),c.length==1&&(c="0"+c),"#"+l+u+c}}/**
|
|
335
|
-
* @license
|
|
336
|
-
* Joseph Myers does not specify a particular license for his work.
|
|
337
|
-
*
|
|
338
|
-
* Author: Joseph Myers
|
|
339
|
-
* Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
|
|
340
|
-
*
|
|
341
|
-
* Modified by: Owen Leong
|
|
342
|
-
*/function s2(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]=Hc(t,e[0]),e[1]=Hc(n,e[1]),e[2]=Hc(a,e[2]),e[3]=Hc(i,e[3])}function h0(e,r,t,n,a,i){return r=Hc(Hc(r,e),Hc(n,i)),Hc(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 b_(e){var r,t=e.length,n=[1732584193,-271733879,-1732584194,271733878];for(r=64;r<=e.length;r+=64)s2(n,Tk(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(s2(n,a),r=0;r<16;r++)a[r]=0;return a[14]=8*t,s2(n,a),n}function Tk(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}lp=pr.atob.bind(pr),T2=pr.btoa.bind(pr);var Y4="0123456789abcdef".split("");function Rk(e){for(var r="",t=0;t<4;t++)r+=Y4[e>>8*t+4&15]+Y4[e>>8*t&15];return r}function Mk(e){return String.fromCharCode((255&e)>>0,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function R2(e){return b_(e).map(Mk).join("")}var Ik=function(e){for(var r=0;r<e.length;r++)e[r]=Rk(e[r]);return e.join("")}(b_("hello"))!="5d41402abc4b2a76b9719d911017c592";function Hc(e,r){if(Ik){var t=(65535&e)+(65535&r);return(e>>16)+(r>>16)+(t>>16)<<16|65535&t}return e+r&4294967295}/**
|
|
343
|
-
* @license
|
|
344
|
-
* FPDF is released under a permissive license: there is no usage restriction.
|
|
345
|
-
* You may embed it freely in your application (commercial or not), with or
|
|
346
|
-
* without modifications.
|
|
347
|
-
*
|
|
348
|
-
* Reference: http://www.fpdf.org/en/script/script37.php
|
|
349
|
-
*/function M2(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)),l=[],u=0;u<256;u++)l[u]=u;var c=0;for(u=0;u<256;u++){var h=l[u];c=(c+h+o.charCodeAt(u))%256,l[u]=l[c],l[c]=h}t=e,n=l}else l=n;var p=r.length,w=0,d=0,_="";for(u=0;u<p;u++)d=(d+(h=l[w=(w+1)%256]))%256,l[w]=l[d],l[d]=h,o=l[(l[w]+l[d])%256],_+=String.fromCharCode(r.charCodeAt(u)^o);return _}/**
|
|
350
|
-
* @license
|
|
351
|
-
* Licensed under the MIT License.
|
|
352
|
-
* http://opensource.org/licenses/mit-license
|
|
353
|
-
* Author: Owen Leong (@owenl131)
|
|
354
|
-
* Date: 15 Oct 2020
|
|
355
|
-
* References:
|
|
356
|
-
* https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
|
|
357
|
-
* https://github.com/foliojs/pdfkit/blob/master/lib/security.js
|
|
358
|
-
* http://www.fpdf.org/en/script/script37.php
|
|
359
|
-
*/var X4={print:4,modify:8,copy:16,"annot-forms":32};function uh(e,r,t,n){this.v=1,this.r=2;var a=192;e.forEach(function(l){if(X4.perm!==void 0)throw new Error("Invalid permission: "+l);a+=X4[l]}),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=R2(i+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(n)).substr(0,5),this.U=M2(this.encryptionKey,this.padding)}function ch(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 K4(e){if(On(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(l){pr.console&&Gn.error("jsPDF PubSub Error",l.message,l)}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 w_(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,w_.call(this,n,a)}function ph(e,r,t,n,a){if(!(this instanceof ph))return new ph(e,r,t,n,a);this.boundingBox=e,this.xStep=r,this.yStep=t,this.stream="",this.cloneIndex=0,w_.call(this,n,a)}function hr(e){var r,t=typeof arguments[0]=="string"?arguments[0]:"p",n=arguments[1],a=arguments[2],i=arguments[3],o=[],l=1,u=16,c="S",h=null;On(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||[]),l=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,w={},d={internal:{},__private__:{}};d.__private__.PubSub=K4;var _="1.3",E=d.__private__.getPdfVersion=function(){return _};d.__private__.setPdfVersion=function(Y){_=Y};var S={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]};d.__private__.getPageFormats=function(){return S};var y=d.__private__.getPageFormat=function(Y){return S[Y]};a=a||"a4";var g={COMPAT:"compat",ADVANCED:"advanced"},v=g.COMPAT;function b(){this.saveGraphicsState(),ve(new Ue(at,0,0,-at,0,Ko()*at).toString()+" cm"),this.setFontSize(this.getFontSize()/at),c="n",v=g.ADVANCED}function O(){this.restoreGraphicsState(),c="S",v=g.COMPAT}var j=d.__private__.combineFontStyleAndFontWeight=function(Y,fe){if(Y=="bold"&&fe=="normal"||Y=="bold"&&fe==400||Y=="normal"&&fe=="italic"||Y=="bold"&&fe=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return fe&&(Y=fe==400||fe==="normal"?Y==="italic"?"italic":"normal":fe!=700&&fe!=="bold"||Y!=="normal"?(fe==700?"bold":fe)+""+Y:"bold"),Y};d.advancedAPI=function(Y){var fe=v===g.COMPAT;return fe&&b.call(this),typeof Y!="function"||(Y(this),fe&&O.call(this)),this},d.compatAPI=function(Y){var fe=v===g.ADVANCED;return fe&&O.call(this),typeof Y!="function"||(Y(this),fe&&b.call(this)),this},d.isAdvancedAPI=function(){return v===g.ADVANCED};var T,M=function(Y){if(v!==g.ADVANCED)throw new Error(Y+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},F=d.roundToPrecision=d.__private__.roundToPrecision=function(Y,fe){var ke=r||fe;if(isNaN(Y)||isNaN(ke))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return Y.toFixed(ke).replace(/0+$/,"")};T=d.hpf=d.__private__.hpf=typeof u=="number"?function(Y){if(isNaN(Y))throw new Error("Invalid argument passed to jsPDF.hpf");return F(Y,u)}:u==="smart"?function(Y){if(isNaN(Y))throw new Error("Invalid argument passed to jsPDF.hpf");return F(Y,Y>-1&&Y<1?16:5)}:function(Y){if(isNaN(Y))throw new Error("Invalid argument passed to jsPDF.hpf");return F(Y,16)};var C=d.f2=d.__private__.f2=function(Y){if(isNaN(Y))throw new Error("Invalid argument passed to jsPDF.f2");return F(Y,2)},x=d.__private__.f3=function(Y){if(isNaN(Y))throw new Error("Invalid argument passed to jsPDF.f3");return F(Y,3)},L=d.scale=d.__private__.scale=function(Y){if(isNaN(Y))throw new Error("Invalid argument passed to jsPDF.scale");return v===g.COMPAT?Y*at:v===g.ADVANCED?Y:void 0},A=function(Y){return v===g.COMPAT?Ko()-Y:v===g.ADVANCED?Y:void 0},N=function(Y){return L(A(Y))};d.__private__.setPrecision=d.setPrecision=function(Y){typeof parseInt(Y,10)=="number"&&(r=parseInt(Y,10))};var I,W="00000000000000000000000000000000",G=d.__private__.getFileId=function(){return W},$=d.__private__.setFileId=function(Y){return W=Y!==void 0&&/^[a-fA-F0-9]{32}$/.test(Y)?Y.toUpperCase():W.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),h!==null&&(gn=new uh(h.userPermissions,h.userPassword,h.ownerPassword,W)),W};d.setFileId=function(Y){return $(Y),this},d.getFileId=function(){return G()};var J=d.__private__.convertDateToPDFDate=function(Y){var fe=Y.getTimezoneOffset(),ke=fe<0?"+":"-",Ie=Math.floor(Math.abs(fe/60)),Je=Math.abs(fe%60),ft=[ke,K(Ie),"'",K(Je),"'"].join("");return["D:",Y.getFullYear(),K(Y.getMonth()+1),K(Y.getDate()),K(Y.getHours()),K(Y.getMinutes()),K(Y.getSeconds()),ft].join("")},V=d.__private__.convertPDFDateToDate=function(Y){var fe=parseInt(Y.substr(2,4),10),ke=parseInt(Y.substr(6,2),10)-1,Ie=parseInt(Y.substr(8,2),10),Je=parseInt(Y.substr(10,2),10),ft=parseInt(Y.substr(12,2),10),xt=parseInt(Y.substr(14,2),10);return new Date(fe,ke,Ie,Je,ft,xt,0)},H=d.__private__.setCreationDate=function(Y){var fe;if(Y===void 0&&(Y=new Date),Y instanceof Date)fe=J(Y);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(Y))throw new Error("Invalid argument passed to jsPDF.setCreationDate");fe=Y}return I=fe},z=d.__private__.getCreationDate=function(Y){var fe=I;return Y==="jsDate"&&(fe=V(I)),fe};d.setCreationDate=function(Y){return H(Y),this},d.getCreationDate=function(Y){return z(Y)};var D,K=d.__private__.padd2=function(Y){return("0"+parseInt(Y)).slice(-2)},ne=d.__private__.padd2Hex=function(Y){return("00"+(Y=Y.toString())).substr(Y.length)},Z=0,ee=[],ae=[],se=0,ce=[],me=[],xe=!1,Oe=ae,Re=function(){Z=0,se=0,ae=[],ee=[],ce=[],Lr=Wt(),Nr=Wt()};d.__private__.setCustomOutputDestination=function(Y){xe=!0,Oe=Y};var Se=function(Y){xe||(Oe=Y)};d.__private__.resetCustomOutputDestination=function(){xe=!1,Oe=ae};var ve=d.__private__.out=function(Y){return Y=Y.toString(),se+=Y.length+1,Oe.push(Y),Oe},He=d.__private__.write=function(Y){return ve(arguments.length===1?Y.toString():Array.prototype.join.call(arguments," "))},we=d.__private__.getArrayBuffer=function(Y){for(var fe=Y.length,ke=new ArrayBuffer(fe),Ie=new Uint8Array(ke);fe--;)Ie[fe]=Y.charCodeAt(fe);return ke},Ae=[["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]];d.__private__.getStandardFonts=function(){return Ae};var Ee=e.fontSize||16;d.__private__.setFontSize=d.setFontSize=function(Y){return Ee=v===g.ADVANCED?Y/at:Y,this};var Ne,he=d.__private__.getFontSize=d.getFontSize=function(){return v===g.COMPAT?Ee:Ee*at},Le=e.R2L||!1;d.__private__.setR2L=d.setR2L=function(Y){return Le=Y,this},d.__private__.getR2L=d.getR2L=function(){return Le};var Ce,De=d.__private__.setZoomMode=function(Y){var fe=[void 0,null,"fullwidth","fullheight","fullpage","original"];if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(Y))Ne=Y;else if(isNaN(Y)){if(fe.indexOf(Y)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+Y+'" is not recognized.');Ne=Y}else Ne=parseInt(Y,10)};d.__private__.getZoomMode=function(){return Ne};var tt,vt=d.__private__.setPageMode=function(Y){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(Y)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+Y+'" is not recognized.');Ce=Y};d.__private__.getPageMode=function(){return Ce};var mt=d.__private__.setLayoutMode=function(Y){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(Y)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+Y+'" is not recognized.');tt=Y};d.__private__.getLayoutMode=function(){return tt},d.__private__.setDisplayMode=d.setDisplayMode=function(Y,fe,ke){return De(Y),mt(fe),vt(ke),this};var Et={title:"",subject:"",author:"",keywords:"",creator:""};d.__private__.getDocumentProperty=function(Y){if(Object.keys(Et).indexOf(Y)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return Et[Y]},d.__private__.getDocumentProperties=function(){return Et},d.__private__.setDocumentProperties=d.setProperties=d.setDocumentProperties=function(Y){for(var fe in Et)Et.hasOwnProperty(fe)&&Y[fe]&&(Et[fe]=Y[fe]);return this},d.__private__.setDocumentProperty=function(Y,fe){if(Object.keys(Et).indexOf(Y)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return Et[Y]=fe};var nt,at,qt,Ct,or,Xt={},qe={},We=[],Nt={},ht={},gt={},wt={},tr=null,Vt=0,_t=[],it=new K4(d),Bt=e.hotfixes||[],Ve={},Fe={},bt=[],Ue=function Y(fe,ke,Ie,Je,ft,xt){if(!(this instanceof Y))return new Y(fe,ke,Ie,Je,ft,xt);isNaN(fe)&&(fe=1),isNaN(ke)&&(ke=0),isNaN(Ie)&&(Ie=0),isNaN(Je)&&(Je=1),isNaN(ft)&&(ft=0),isNaN(xt)&&(xt=0),this._matrix=[fe,ke,Ie,Je,ft,xt]};Object.defineProperty(Ue.prototype,"sx",{get:function(){return this._matrix[0]},set:function(Y){this._matrix[0]=Y}}),Object.defineProperty(Ue.prototype,"shy",{get:function(){return this._matrix[1]},set:function(Y){this._matrix[1]=Y}}),Object.defineProperty(Ue.prototype,"shx",{get:function(){return this._matrix[2]},set:function(Y){this._matrix[2]=Y}}),Object.defineProperty(Ue.prototype,"sy",{get:function(){return this._matrix[3]},set:function(Y){this._matrix[3]=Y}}),Object.defineProperty(Ue.prototype,"tx",{get:function(){return this._matrix[4]},set:function(Y){this._matrix[4]=Y}}),Object.defineProperty(Ue.prototype,"ty",{get:function(){return this._matrix[5]},set:function(Y){this._matrix[5]=Y}}),Object.defineProperty(Ue.prototype,"a",{get:function(){return this._matrix[0]},set:function(Y){this._matrix[0]=Y}}),Object.defineProperty(Ue.prototype,"b",{get:function(){return this._matrix[1]},set:function(Y){this._matrix[1]=Y}}),Object.defineProperty(Ue.prototype,"c",{get:function(){return this._matrix[2]},set:function(Y){this._matrix[2]=Y}}),Object.defineProperty(Ue.prototype,"d",{get:function(){return this._matrix[3]},set:function(Y){this._matrix[3]=Y}}),Object.defineProperty(Ue.prototype,"e",{get:function(){return this._matrix[4]},set:function(Y){this._matrix[4]=Y}}),Object.defineProperty(Ue.prototype,"f",{get:function(){return this._matrix[5]},set:function(Y){this._matrix[5]=Y}}),Object.defineProperty(Ue.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Ue.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Ue.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Ue.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),Ue.prototype.join=function(Y){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(T).join(Y)},Ue.prototype.multiply=function(Y){var fe=Y.sx*this.sx+Y.shy*this.shx,ke=Y.sx*this.shy+Y.shy*this.sy,Ie=Y.shx*this.sx+Y.sy*this.shx,Je=Y.shx*this.shy+Y.sy*this.sy,ft=Y.tx*this.sx+Y.ty*this.shx+this.tx,xt=Y.tx*this.shy+Y.ty*this.sy+this.ty;return new Ue(fe,ke,Ie,Je,ft,xt)},Ue.prototype.decompose=function(){var Y=this.sx,fe=this.shy,ke=this.shx,Ie=this.sy,Je=this.tx,ft=this.ty,xt=Math.sqrt(Y*Y+fe*fe),Dt=(Y/=xt)*ke+(fe/=xt)*Ie;ke-=Y*Dt,Ie-=fe*Dt;var nr=Math.sqrt(ke*ke+Ie*Ie);return Dt/=nr,Y*(Ie/=nr)<fe*(ke/=nr)&&(Y=-Y,fe=-fe,Dt=-Dt,xt=-xt),{scale:new Ue(xt,0,0,nr,0,0),translate:new Ue(1,0,0,1,Je,ft),rotate:new Ue(Y,fe,-fe,Y,0,0),skew:new Ue(1,0,Dt,1,0,0)}},Ue.prototype.toString=function(Y){return this.join(" ")},Ue.prototype.inversed=function(){var Y=this.sx,fe=this.shy,ke=this.shx,Ie=this.sy,Je=this.tx,ft=this.ty,xt=1/(Y*Ie-fe*ke),Dt=Ie*xt,nr=-fe*xt,gr=-ke*xt,dr=Y*xt;return new Ue(Dt,nr,gr,dr,-Dt*Je-gr*ft,-nr*Je-dr*ft)},Ue.prototype.applyToPoint=function(Y){var fe=Y.x*this.sx+Y.y*this.shx+this.tx,ke=Y.x*this.shy+Y.y*this.sy+this.ty;return new $n(fe,ke)},Ue.prototype.applyToRectangle=function(Y){var fe=this.applyToPoint(Y),ke=this.applyToPoint(new $n(Y.x+Y.w,Y.y+Y.h));return new vi(fe.x,fe.y,ke.x-fe.x,ke.y-fe.y)},Ue.prototype.clone=function(){var Y=this.sx,fe=this.shy,ke=this.shx,Ie=this.sy,Je=this.tx,ft=this.ty;return new Ue(Y,fe,ke,Ie,Je,ft)},d.Matrix=Ue;var St=d.matrixMult=function(Y,fe){return fe.multiply(Y)},kt=new Ue(1,0,0,1,0,0);d.unitMatrix=d.identityMatrix=kt;var Ft=function(Y,fe){if(!ht[Y]){var ke=(fe instanceof Sf?"Sh":"P")+(Object.keys(Nt).length+1).toString(10);fe.id=ke,ht[Y]=ke,Nt[ke]=fe,it.publish("addPattern",fe)}};d.ShadingPattern=Sf,d.TilingPattern=ph,d.addShadingPattern=function(Y,fe){return M("addShadingPattern()"),Ft(Y,fe),this},d.beginTilingPattern=function(Y){M("beginTilingPattern()"),Zs(Y.boundingBox[0],Y.boundingBox[1],Y.boundingBox[2]-Y.boundingBox[0],Y.boundingBox[3]-Y.boundingBox[1],Y.matrix)},d.endTilingPattern=function(Y,fe){M("endTilingPattern()"),fe.stream=me[D].join(`
|
|
360
|
-
`),Ft(Y,fe),it.publish("endTilingPattern",fe),bt.pop().restore()};var zt=d.__private__.newObject=function(){var Y=Wt();return _r(Y,!0),Y},Wt=d.__private__.newObjectDeferred=function(){return Z++,ee[Z]=function(){return se},Z},_r=function(Y,fe){return fe=typeof fe=="boolean"&&fe,ee[Y]=se,fe&&ve(Y+" 0 obj"),Y},kr=d.__private__.newAdditionalObject=function(){var Y={objId:Wt(),content:""};return ce.push(Y),Y},Lr=Wt(),Nr=Wt(),Wn=d.__private__.decodeColorString=function(Y){var fe=Y.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 ke=parseFloat(fe[0]);fe=[ke,ke,ke,"r"]}for(var Ie="#",Je=0;Je<3;Je++)Ie+=("0"+Math.floor(255*parseFloat(fe[Je])).toString(16)).slice(-2);return Ie},en=d.__private__.encodeColorString=function(Y){var fe;typeof Y=="string"&&(Y={ch1:Y});var ke=Y.ch1,Ie=Y.ch2,Je=Y.ch3,ft=Y.ch4,xt=Y.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof ke=="string"&&ke.charAt(0)!=="#"){var Dt=new y_(ke);if(Dt.ok)ke=Dt.toHex();else if(!/^\d*\.?\d*$/.test(ke))throw new Error('Invalid color "'+ke+'" passed to jsPDF.encodeColorString.')}if(typeof ke=="string"&&/^#[0-9A-Fa-f]{3}$/.test(ke)&&(ke="#"+ke[1]+ke[1]+ke[2]+ke[2]+ke[3]+ke[3]),typeof ke=="string"&&/^#[0-9A-Fa-f]{6}$/.test(ke)){var nr=parseInt(ke.substr(1),16);ke=nr>>16&255,Ie=nr>>8&255,Je=255&nr}if(Ie===void 0||ft===void 0&&ke===Ie&&Ie===Je)if(typeof ke=="string")fe=ke+" "+xt[0];else switch(Y.precision){case 2:fe=C(ke/255)+" "+xt[0];break;case 3:default:fe=x(ke/255)+" "+xt[0]}else if(ft===void 0||On(ft)==="object"){if(ft&&!isNaN(ft.a)&&ft.a===0)return fe=["1.","1.","1.",xt[1]].join(" ");if(typeof ke=="string")fe=[ke,Ie,Je,xt[1]].join(" ");else switch(Y.precision){case 2:fe=[C(ke/255),C(Ie/255),C(Je/255),xt[1]].join(" ");break;default:case 3:fe=[x(ke/255),x(Ie/255),x(Je/255),xt[1]].join(" ")}}else if(typeof ke=="string")fe=[ke,Ie,Je,ft,xt[2]].join(" ");else switch(Y.precision){case 2:fe=[C(ke),C(Ie),C(Je),C(ft),xt[2]].join(" ");break;case 3:default:fe=[x(ke),x(Ie),x(Je),x(ft),xt[2]].join(" ")}return fe},Qn=d.__private__.getFilters=function(){return o},_i=d.__private__.putStream=function(Y){var fe=(Y=Y||{}).data||"",ke=Y.filters||Qn(),Ie=Y.alreadyAppliedFilters||[],Je=Y.addLength1||!1,ft=fe.length,xt=Y.objectId,Dt=function(Jn){return Jn};if(h!==null&&xt===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");h!==null&&(Dt=gn.encryptor(xt,0));var nr={};ke===!0&&(ke=["FlateEncode"]);var gr=Y.additionalKeyValues||[],dr=(nr=hr.API.processDataByFilters!==void 0?hr.API.processDataByFilters(fe,ke):{data:fe,reverseChain:[]}).reverseChain+(Array.isArray(Ie)?Ie.join(" "):Ie.toString());if(nr.data.length!==0&&(gr.push({key:"Length",value:nr.data.length}),Je===!0&&gr.push({key:"Length1",value:ft})),dr.length!=0)if(dr.split("/").length-1==1)gr.push({key:"Filter",value:dr});else{gr.push({key:"Filter",value:"["+dr+"]"});for(var Sr=0;Sr<gr.length;Sr+=1)if(gr[Sr].key==="DecodeParms"){for(var Cn=[],Sn=0;Sn<nr.reverseChain.split("/").length-1;Sn+=1)Cn.push("null");Cn.push(gr[Sr].value),gr[Sr].value="["+Cn.join(" ")+"]"}}ve("<<");for(var jn=0;jn<gr.length;jn++)ve("/"+gr[jn].key+" "+gr[jn].value);ve(">>"),nr.data.length!==0&&(ve("stream"),ve(Dt(nr.data)),ve("endstream"))},Ni=d.__private__.putPage=function(Y){var fe=Y.number,ke=Y.data,Ie=Y.objId,Je=Y.contentsObjId;_r(Ie,!0),ve("<</Type /Page"),ve("/Parent "+Y.rootDictionaryObjId+" 0 R"),ve("/Resources "+Y.resourceDictionaryObjId+" 0 R"),ve("/MediaBox ["+parseFloat(T(Y.mediaBox.bottomLeftX))+" "+parseFloat(T(Y.mediaBox.bottomLeftY))+" "+T(Y.mediaBox.topRightX)+" "+T(Y.mediaBox.topRightY)+"]"),Y.cropBox!==null&&ve("/CropBox ["+T(Y.cropBox.bottomLeftX)+" "+T(Y.cropBox.bottomLeftY)+" "+T(Y.cropBox.topRightX)+" "+T(Y.cropBox.topRightY)+"]"),Y.bleedBox!==null&&ve("/BleedBox ["+T(Y.bleedBox.bottomLeftX)+" "+T(Y.bleedBox.bottomLeftY)+" "+T(Y.bleedBox.topRightX)+" "+T(Y.bleedBox.topRightY)+"]"),Y.trimBox!==null&&ve("/TrimBox ["+T(Y.trimBox.bottomLeftX)+" "+T(Y.trimBox.bottomLeftY)+" "+T(Y.trimBox.topRightX)+" "+T(Y.trimBox.topRightY)+"]"),Y.artBox!==null&&ve("/ArtBox ["+T(Y.artBox.bottomLeftX)+" "+T(Y.artBox.bottomLeftY)+" "+T(Y.artBox.topRightX)+" "+T(Y.artBox.topRightY)+"]"),typeof Y.userUnit=="number"&&Y.userUnit!==1&&ve("/UserUnit "+Y.userUnit),it.publish("putPage",{objId:Ie,pageContext:_t[fe],pageNumber:fe,page:ke}),ve("/Contents "+Je+" 0 R"),ve(">>"),ve("endobj");var ft=ke.join(`
|
|
361
|
-
`);return v===g.ADVANCED&&(ft+=`
|
|
362
|
-
Q`),_r(Je,!0),_i({data:ft,filters:Qn(),objectId:Je}),ve("endobj"),Ie},Si=d.__private__.putPages=function(){var Y,fe,ke=[];for(Y=1;Y<=Vt;Y++)_t[Y].objId=Wt(),_t[Y].contentsObjId=Wt();for(Y=1;Y<=Vt;Y++)ke.push(Ni({number:Y,data:me[Y],objId:_t[Y].objId,contentsObjId:_t[Y].contentsObjId,mediaBox:_t[Y].mediaBox,cropBox:_t[Y].cropBox,bleedBox:_t[Y].bleedBox,trimBox:_t[Y].trimBox,artBox:_t[Y].artBox,userUnit:_t[Y].userUnit,rootDictionaryObjId:Lr,resourceDictionaryObjId:Nr}));_r(Lr,!0),ve("<</Type /Pages");var Ie="/Kids [";for(fe=0;fe<Vt;fe++)Ie+=ke[fe]+" 0 R ";ve(Ie+"]"),ve("/Count "+Vt),ve(">>"),ve("endobj"),it.publish("postPutPages")},fa=function(Y){it.publish("putFont",{font:Y,out:ve,newObject:zt,putStream:_i}),Y.isAlreadyPutted!==!0&&(Y.objectNumber=zt(),ve("<<"),ve("/Type /Font"),ve("/BaseFont /"+ch(Y.postScriptName)),ve("/Subtype /Type1"),typeof Y.encoding=="string"&&ve("/Encoding /"+Y.encoding),ve("/FirstChar 32"),ve("/LastChar 255"),ve(">>"),ve("endobj"))},ws=function(){for(var Y in Xt)Xt.hasOwnProperty(Y)&&(p===!1||p===!0&&w.hasOwnProperty(Y))&&fa(Xt[Y])},Go=function(Y){Y.objectNumber=zt();var fe=[];fe.push({key:"Type",value:"/XObject"}),fe.push({key:"Subtype",value:"/Form"}),fe.push({key:"BBox",value:"["+[T(Y.x),T(Y.y),T(Y.x+Y.width),T(Y.y+Y.height)].join(" ")+"]"}),fe.push({key:"Matrix",value:"["+Y.matrix.toString()+"]"});var ke=Y.pages[1].join(`
|
|
363
|
-
`);_i({data:ke,additionalKeyValues:fe,objectId:Y.objectNumber}),ve("endobj")},tu=function(){for(var Y in Ve)Ve.hasOwnProperty(Y)&&Go(Ve[Y])},vc=function(Y,fe){var ke,Ie=[],Je=1/(fe-1);for(ke=0;ke<1;ke+=Je)Ie.push(ke);if(Ie.push(1),Y[0].offset!=0){var ft={offset:0,color:Y[0].color};Y.unshift(ft)}if(Y[Y.length-1].offset!=1){var xt={offset:1,color:Y[Y.length-1].color};Y.push(xt)}for(var Dt="",nr=0,gr=0;gr<Ie.length;gr++){for(ke=Ie[gr];ke>Y[nr+1].offset;)nr++;var dr=Y[nr].offset,Sr=(ke-dr)/(Y[nr+1].offset-dr),Cn=Y[nr].color,Sn=Y[nr+1].color;Dt+=ne(Math.round((1-Sr)*Cn[0]+Sr*Sn[0]).toString(16))+ne(Math.round((1-Sr)*Cn[1]+Sr*Sn[1]).toString(16))+ne(Math.round((1-Sr)*Cn[2]+Sr*Sn[2]).toString(16))}return Dt.trim()},Mn=function(Y,fe){fe||(fe=21);var ke=zt(),Ie=vc(Y.colors,fe),Je=[];Je.push({key:"FunctionType",value:"0"}),Je.push({key:"Domain",value:"[0.0 1.0]"}),Je.push({key:"Size",value:"["+fe+"]"}),Je.push({key:"BitsPerSample",value:"8"}),Je.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Je.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),_i({data:Ie,additionalKeyValues:Je,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:ke}),ve("endobj"),Y.objectNumber=zt(),ve("<< /ShadingType "+Y.type),ve("/ColorSpace /DeviceRGB");var ft="/Coords ["+T(parseFloat(Y.coords[0]))+" "+T(parseFloat(Y.coords[1]))+" ";Y.type===2?ft+=T(parseFloat(Y.coords[2]))+" "+T(parseFloat(Y.coords[3])):ft+=T(parseFloat(Y.coords[2]))+" "+T(parseFloat(Y.coords[3]))+" "+T(parseFloat(Y.coords[4]))+" "+T(parseFloat(Y.coords[5])),ve(ft+="]"),Y.matrix&&ve("/Matrix ["+Y.matrix.toString()+"]"),ve("/Function "+ke+" 0 R"),ve("/Extend [true true]"),ve(">>"),ve("endobj")},Bu=function(Y,fe){var ke=Wt(),Ie=zt();fe.push({resourcesOid:ke,objectOid:Ie}),Y.objectNumber=Ie;var Je=[];Je.push({key:"Type",value:"/Pattern"}),Je.push({key:"PatternType",value:"1"}),Je.push({key:"PaintType",value:"1"}),Je.push({key:"TilingType",value:"1"}),Je.push({key:"BBox",value:"["+Y.boundingBox.map(T).join(" ")+"]"}),Je.push({key:"XStep",value:T(Y.xStep)}),Je.push({key:"YStep",value:T(Y.yStep)}),Je.push({key:"Resources",value:ke+" 0 R"}),Y.matrix&&Je.push({key:"Matrix",value:"["+Y.matrix.toString()+"]"}),_i({data:Y.stream,additionalKeyValues:Je,objectId:Y.objectNumber}),ve("endobj")},oo=function(Y){var fe;for(fe in Nt)Nt.hasOwnProperty(fe)&&(Nt[fe]instanceof Sf?Mn(Nt[fe]):Nt[fe]instanceof ph&&Bu(Nt[fe],Y))},dl=function(Y){for(var fe in Y.objectNumber=zt(),ve("<<"),Y)switch(fe){case"opacity":ve("/ca "+C(Y[fe]));break;case"stroke-opacity":ve("/CA "+C(Y[fe]))}ve(">>"),ve("endobj")},Hs=function(){var Y;for(Y in gt)gt.hasOwnProperty(Y)&&dl(gt[Y])},qu=function(){for(var Y in ve("/XObject <<"),Ve)Ve.hasOwnProperty(Y)&&Ve[Y].objectNumber>=0&&ve("/"+Y+" "+Ve[Y].objectNumber+" 0 R");it.publish("putXobjectDict"),ve(">>")},ru=function(){gn.oid=zt(),ve("<<"),ve("/Filter /Standard"),ve("/V "+gn.v),ve("/R "+gn.r),ve("/U <"+gn.toHexString(gn.U)+">"),ve("/O <"+gn.toHexString(gn.O)+">"),ve("/P "+gn.P),ve(">>"),ve("endobj")},so=function(){for(var Y in ve("/Font <<"),Xt)Xt.hasOwnProperty(Y)&&(p===!1||p===!0&&w.hasOwnProperty(Y))&&ve("/"+Y+" "+Xt[Y].objectNumber+" 0 R");ve(">>")},pi=function(){if(Object.keys(Nt).length>0){for(var Y in ve("/Shading <<"),Nt)Nt.hasOwnProperty(Y)&&Nt[Y]instanceof Sf&&Nt[Y].objectNumber>=0&&ve("/"+Y+" "+Nt[Y].objectNumber+" 0 R");it.publish("putShadingPatternDict"),ve(">>")}},Kr=function(Y){if(Object.keys(Nt).length>0){for(var fe in ve("/Pattern <<"),Nt)Nt.hasOwnProperty(fe)&&Nt[fe]instanceof d.TilingPattern&&Nt[fe].objectNumber>=0&&Nt[fe].objectNumber<Y&&ve("/"+fe+" "+Nt[fe].objectNumber+" 0 R");it.publish("putTilingPatternDict"),ve(">>")}},Ar=function(){if(Object.keys(gt).length>0){var Y;for(Y in ve("/ExtGState <<"),gt)gt.hasOwnProperty(Y)&>[Y].objectNumber>=0&&ve("/"+Y+" "+gt[Y].objectNumber+" 0 R");it.publish("putGStateDict"),ve(">>")}},ln=function(Y){_r(Y.resourcesOid,!0),ve("<<"),ve("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),so(),pi(),Kr(Y.objectOid),Ar(),qu(),ve(">>"),ve("endobj")},gi=function(){var Y=[];ws(),Hs(),tu(),oo(Y),it.publish("putResources"),Y.forEach(ln),ln({resourcesOid:Nr,objectOid:Number.MAX_SAFE_INTEGER}),it.publish("postPutResources")},Ti=function(){it.publish("putAdditionalObjects");for(var Y=0;Y<ce.length;Y++){var fe=ce[Y];_r(fe.objId,!0),ve(fe.content),ve("endobj")}it.publish("postPutAdditionalObjects")},Ia=function(Y){qe[Y.fontName]=qe[Y.fontName]||{},qe[Y.fontName][Y.fontStyle]=Y.id},ja=function(Y,fe,ke,Ie,Je){var ft={id:"F"+(Object.keys(Xt).length+1).toString(10),postScriptName:Y,fontName:fe,fontStyle:ke,encoding:Ie,isStandardFont:Je||!1,metadata:{}};return it.publish("addFont",{font:ft,instance:this}),Xt[ft.id]=ft,Ia(ft),ft.id},ii=function(Y){for(var fe=0,ke=Ae.length;fe<ke;fe++){var Ie=ja.call(this,Y[fe][0],Y[fe][1],Y[fe][2],Ae[fe][3],!0);p===!1&&(w[Ie]=!0);var Je=Y[fe][0].split("-");Ia({id:Ie,fontName:Je[0],fontStyle:Je[1]||""})}it.publish("addFonts",{fonts:Xt,dictionary:qe})},Ri=function(Y){return Y.foo=function(){try{return Y.apply(this,arguments)}catch(Ie){var fe=Ie.stack||"";~fe.indexOf(" at ")&&(fe=fe.split(" at ")[1]);var ke="Error in function "+fe.split(`
|
|
364
|
-
`)[0].split("<")[0]+": "+Ie.message;if(!pr.console)throw new Error(ke);pr.console.error(ke,Ie),pr.alert&&alert(ke)}},Y.foo.bar=Y,Y.foo},pl=function(Y,fe){var ke,Ie,Je,ft,xt,Dt,nr,gr,dr;if(Je=(fe=fe||{}).sourceEncoding||"Unicode",xt=fe.outputEncoding,(fe.autoencode||xt)&&Xt[nt].metadata&&Xt[nt].metadata[Je]&&Xt[nt].metadata[Je].encoding&&(ft=Xt[nt].metadata[Je].encoding,!xt&&Xt[nt].encoding&&(xt=Xt[nt].encoding),!xt&&ft.codePages&&(xt=ft.codePages[0]),typeof xt=="string"&&(xt=ft[xt]),xt)){for(nr=!1,Dt=[],ke=0,Ie=Y.length;ke<Ie;ke++)(gr=xt[Y.charCodeAt(ke)])?Dt.push(String.fromCharCode(gr)):Dt.push(Y[ke]),Dt[ke].charCodeAt(0)>>8&&(nr=!0);Y=Dt.join("")}for(ke=Y.length;nr===void 0&&ke!==0;)Y.charCodeAt(ke-1)>>8&&(nr=!0),ke--;if(!nr)return Y;for(Dt=fe.noBOM?[]:[254,255],ke=0,Ie=Y.length;ke<Ie;ke++){if((dr=(gr=Y.charCodeAt(ke))>>8)>>8)throw new Error("Character at position "+ke+" of string '"+Y+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");Dt.push(dr),Dt.push(gr-(dr<<8))}return String.fromCharCode.apply(void 0,Dt)},ha=d.__private__.pdfEscape=d.pdfEscape=function(Y,fe){return pl(Y,fe).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Wo=d.__private__.beginPage=function(Y){me[++Vt]=[],_t[Vt]={objId:0,contentsObjId:0,userUnit:Number(l),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(Y[0]),topRightY:Number(Y[1])}},Vs(Vt),Se(me[D])},nu=function(Y,fe){var ke,Ie,Je;switch(t=fe||t,typeof Y=="string"&&(ke=y(Y.toLowerCase()),Array.isArray(ke)&&(Ie=ke[0],Je=ke[1])),Array.isArray(Y)&&(Ie=Y[0]*at,Je=Y[1]*at),isNaN(Ie)&&(Ie=a[0],Je=a[1]),(Ie>14400||Je>14400)&&(Gn.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),Ie=Math.min(14400,Ie),Je=Math.min(14400,Je)),a=[Ie,Je],t.substr(0,1)){case"l":Je>Ie&&(a=[Je,Ie]);break;case"p":Ie>Je&&(a=[Je,Ie])}Wo(a),Ps(Ba),ve(wn),lu!==0&&ve(lu+" J"),Os!==0&&ve(Os+" j"),it.publish("addPage",{pageNumber:Vt})},da=function(Y){Y>0&&Y<=Vt&&(me.splice(Y,1),_t.splice(Y,1),Vt--,D>Vt&&(D=Vt),this.setPage(D))},Vs=function(Y){Y>0&&Y<=Vt&&(D=Y)},af=d.__private__.getNumberOfPages=d.getNumberOfPages=function(){return me.length-1},iu=function(Y,fe,ke){var Ie,Je=void 0;return ke=ke||{},Y=Y!==void 0?Y:Xt[nt].fontName,fe=fe!==void 0?fe:Xt[nt].fontStyle,Ie=Y.toLowerCase(),qe[Ie]!==void 0&&qe[Ie][fe]!==void 0?Je=qe[Ie][fe]:qe[Y]!==void 0&&qe[Y][fe]!==void 0?Je=qe[Y][fe]:ke.disableWarning===!1&&Gn.warn("Unable to look up font label for font '"+Y+"', '"+fe+"'. Refer to getFontList() for available fonts."),Je||ke.noFallback||(Je=qe.times[fe])==null&&(Je=qe.times.normal),Je},Ir=d.__private__.putInfo=function(){var Y=zt(),fe=function(Ie){return Ie};for(var ke in h!==null&&(fe=gn.encryptor(Y,0)),ve("<<"),ve("/Producer ("+ha(fe("jsPDF "+hr.version))+")"),Et)Et.hasOwnProperty(ke)&&Et[ke]&&ve("/"+ke.substr(0,1).toUpperCase()+ke.substr(1)+" ("+ha(fe(Et[ke]))+")");ve("/CreationDate ("+ha(fe(I))+")"),ve(">>"),ve("endobj")},_s=d.__private__.putCatalog=function(Y){var fe=(Y=Y||{}).rootDictionaryObjId||Lr;switch(zt(),ve("<<"),ve("/Type /Catalog"),ve("/Pages "+fe+" 0 R"),Ne||(Ne="fullwidth"),Ne){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 ke=""+Ne;ke.substr(ke.length-1)==="%"&&(Ne=parseInt(Ne)/100),typeof Ne=="number"&&ve("/OpenAction [3 0 R /XYZ null null "+C(Ne)+"]")}switch(tt||(tt="continuous"),tt){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")}Ce&&ve("/PageMode /"+Ce),it.publish("putCatalog"),ve(">>"),ve("endobj")},Gs=d.__private__.putTrailer=function(){ve("trailer"),ve("<<"),ve("/Size "+(Z+1)),ve("/Root "+Z+" 0 R"),ve("/Info "+(Z-1)+" 0 R"),h!==null&&ve("/Encrypt "+gn.oid+" 0 R"),ve("/ID [ <"+W+"> <"+W+"> ]"),ve(">>")},Ws=d.__private__.putHeader=function(){ve("%PDF-"+_),ve("%ºß¬à")},mc=d.__private__.putXRef=function(){var Y="0000000000";ve("xref"),ve("0 "+(Z+1)),ve("0000000000 65535 f ");for(var fe=1;fe<=Z;fe++)typeof ee[fe]=="function"?ve((Y+ee[fe]()).slice(-10)+" 00000 n "):ee[fe]!==void 0?ve((Y+ee[fe]).slice(-10)+" 00000 n "):ve("0000000000 00000 n ")},$o=d.__private__.buildDocument=function(){Re(),Se(ae),it.publish("buildDocument"),Ws(),Si(),Ti(),gi(),h!==null&&ru(),Ir(),_s();var Y=se;return mc(),Gs(),ve("startxref"),ve(""+Y),ve("%%EOF"),Se(me[D]),ae.join(`
|
|
365
|
-
`)},Ss=d.__private__.getBlob=function(Y){return new Blob([we(Y)],{type:"application/pdf"})},xs=d.output=d.__private__.output=Ri(function(Y,fe){switch(typeof(fe=fe||{})=="string"?fe={filename:fe}:fe.filename=fe.filename||"generated.pdf",Y){case void 0:return $o();case"save":d.save(fe.filename);break;case"arraybuffer":return we($o());case"blob":return Ss($o());case"bloburi":case"bloburl":if(pr.URL!==void 0&&typeof pr.URL.createObjectURL=="function")return pr.URL&&pr.URL.createObjectURL(Ss($o()))||void 0;Gn.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var ke="",Ie=$o();try{ke=T2(Ie)}catch{ke=T2(unescape(encodeURIComponent(Ie)))}return"data:application/pdf;filename="+fe.filename+";base64,"+ke;case"pdfobjectnewwindow":if(Object.prototype.toString.call(pr)==="[object Window]"){var Je="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",ft=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';fe.pdfObjectUrl&&(Je=fe.pdfObjectUrl,ft="");var xt='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+Je+'"'+ft+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(fe)+");<\/script></body></html>",Dt=pr.open();return Dt!==null&&Dt.document.write(xt),Dt}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(pr)==="[object Window]"){var nr='<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>',gr=pr.open();if(gr!==null){gr.document.write(nr);var dr=this;gr.document.documentElement.querySelector("#pdfViewer").onload=function(){gr.document.title=fe.filename,gr.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(dr.output("bloburl"))}}return gr}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(pr)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var Sr='<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>',Cn=pr.open();if(Cn!==null&&(Cn.document.write(Sr),Cn.document.title=fe.filename),Cn||typeof safari>"u")return Cn;break;case"datauri":case"dataurl":return pr.document.location.href=this.output("datauristring",fe);default:return null}}),Es=function(Y){return Array.isArray(Bt)===!0&&Bt.indexOf(Y)>-1};switch(n){case"pt":at=1;break;case"mm":at=72/25.4;break;case"cm":at=72/2.54;break;case"in":at=72;break;case"px":at=Es("px_scaling")==1?.75:96/72;break;case"pc":case"em":at=12;break;case"ex":at=6;break;default:if(typeof n!="number")throw new Error("Invalid unit: "+n);at=n}var gn=null;H(),$();var Yo=function(Y){return h!==null?gn.encryptor(Y,0):function(fe){return fe}},Fa=d.__private__.getPageInfo=d.getPageInfo=function(Y){if(isNaN(Y)||Y%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:_t[Y].objId,pageNumber:Y,pageContext:_t[Y]}},It=d.__private__.getPageInfoByObjId=function(Y){if(isNaN(Y)||Y%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var fe in _t)if(_t[fe].objId===Y)break;return Fa(fe)},$s=d.__private__.getCurrentPageInfo=d.getCurrentPageInfo=function(){return{objId:_t[D].objId,pageNumber:D,pageContext:_t[D]}};d.addPage=function(){return nu.apply(this,arguments),this},d.setPage=function(){return Vs.apply(this,arguments),Se.call(this,me[D]),this},d.insertPage=function(Y){return this.addPage(),this.movePage(D,Y),this},d.movePage=function(Y,fe){var ke,Ie;if(Y>fe){ke=me[Y],Ie=_t[Y];for(var Je=Y;Je>fe;Je--)me[Je]=me[Je-1],_t[Je]=_t[Je-1];me[fe]=ke,_t[fe]=Ie,this.setPage(fe)}else if(Y<fe){ke=me[Y],Ie=_t[Y];for(var ft=Y;ft<fe;ft++)me[ft]=me[ft+1],_t[ft]=_t[ft+1];me[fe]=ke,_t[fe]=Ie,this.setPage(fe)}return this},d.deletePage=function(){return da.apply(this,arguments),this},d.__private__.text=d.text=function(Y,fe,ke,Ie,Je){var ft,xt,Dt,nr,gr,dr,Sr,Cn,Sn,jn=(Ie=Ie||{}).scope||this;if(typeof Y=="number"&&typeof fe=="number"&&(typeof ke=="string"||Array.isArray(ke))){var Jn=ke;ke=fe,fe=Y,Y=Jn}if(arguments[3]instanceof Ue?(M("The transform parameter of text() with a Matrix value"),Sn=Je):(Dt=arguments[4],nr=arguments[5],On(Sr=arguments[3])==="object"&&Sr!==null||(typeof Dt=="string"&&(nr=Dt,Dt=null),typeof Sr=="string"&&(nr=Sr,Sr=null),typeof Sr=="number"&&(Dt=Sr,Sr=null),Ie={flags:Sr,angle:Dt,align:nr})),isNaN(fe)||isNaN(ke)||Y==null)throw new Error("Invalid arguments passed to jsPDF.text");if(Y.length===0)return jn;var si="",Ua=!1,Ea=typeof Ie.lineHeightFactor=="number"?Ie.lineHeightFactor:Mi,Pa=jn.internal.scaleFactor;function Zo(nn){return nn=nn.split(" ").join(Array(Ie.TabLen||9).join(" ")),ha(nn,Sr)}function Qo(nn){for(var Yr,Fn=nn.concat(),ei=[],Io=Fn.length;Io--;)typeof(Yr=Fn.shift())=="string"?ei.push(Yr):Array.isArray(nn)&&(Yr.length===1||Yr[1]===void 0&&Yr[2]===void 0)?ei.push(Yr[0]):ei.push([Yr[0],Yr[1],Yr[2]]);return ei}function Di(nn,Yr){var Fn;if(typeof nn=="string")Fn=Yr(nn)[0];else if(Array.isArray(nn)){for(var ei,Io,_l=nn.concat(),rl=[],cu=_l.length;cu--;)typeof(ei=_l.shift())=="string"?rl.push(Yr(ei)[0]):Array.isArray(ei)&&typeof ei[0]=="string"&&(Io=Yr(ei[0],ei[1],ei[2]),rl.push([Io[0],Io[1],Io[2]]));Fn=rl}return Fn}var Ha=!1,Qs=!0;if(typeof Y=="string")Ha=!0;else if(Array.isArray(Y)){var bl=Y.concat();xt=[];for(var ra,rn=bl.length;rn--;)(typeof(ra=bl.shift())!="string"||Array.isArray(ra)&&typeof ra[0]!="string")&&(Qs=!1);Ha=Qs}if(Ha===!1)throw new Error('Type of text must be string or Array. "'+Y+'" is not recognized.');typeof Y=="string"&&(Y=Y.match(/[\r?\n]/)?Y.split(/\r\n|\r|\n/g):[Y]);var Js=Ee/jn.internal.scaleFactor,wl=Js*(Ea-1);switch(Ie.baseline){case"bottom":ke-=wl;break;case"top":ke+=Js-wl;break;case"hanging":ke+=Js-2*wl;break;case"middle":ke+=Js/2-wl}if((dr=Ie.maxWidth||0)>0&&(typeof Y=="string"?Y=jn.splitTextToSize(Y,dr):Object.prototype.toString.call(Y)==="[object Array]"&&(Y=Y.reduce(function(nn,Yr){return nn.concat(jn.splitTextToSize(Yr,dr))},[]))),ft={text:Y,x:fe,y:ke,options:Ie,mutex:{pdfEscape:ha,activeFontKey:nt,fonts:Xt,activeFontSize:Ee}},it.publish("preProcessText",ft),Y=ft.text,Dt=(Ie=ft.options).angle,!(Sn instanceof Ue)&&Dt&&typeof Dt=="number"){Dt*=Math.PI/180,Ie.rotationDirection===0&&(Dt=-Dt),v===g.ADVANCED&&(Dt=-Dt);var Oa=Math.cos(Dt),Va=Math.sin(Dt);Sn=new Ue(Oa,Va,-Va,Oa,0,0)}else Dt&&Dt instanceof Ue&&(Sn=Dt);v!==g.ADVANCED||Sn||(Sn=kt),(gr=Ie.charSpace||ta)!==void 0&&(si+=T(L(gr))+` Tc
|
|
366
|
-
`,this.setCharSpace(this.getCharSpace()||0)),(Cn=Ie.horizontalScale)!==void 0&&(si+=T(100*Cn)+` Tz
|
|
367
|
-
`),Ie.lang;var xi=-1,el=Ie.renderingMode!==void 0?Ie.renderingMode:Ie.stroke,co=jn.internal.getCurrentPageInfo().pageContext;switch(el){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?si+=xi+` Tr
|
|
368
|
-
`:Hu!==-1&&(si+=`0 Tr
|
|
369
|
-
`),xi!==-1&&(co.usedRenderingMode=xi),nr=Ie.align||"left";var mi,Bi=Ee*Ea,As=jn.internal.pageSize.getWidth(),Co=Xt[nt];gr=Ie.charSpace||ta,dr=Ie.maxWidth||0,Sr=Object.assign({autoencode:!0,noBOM:!0},Ie.flags);var yi=[],Jo=function(nn){return jn.getStringUnitWidth(nn,{font:Co,charSpace:gr,fontSize:Ee,doKerning:!1})*Ee/Pa};if(Object.prototype.toString.call(Y)==="[object Array]"){var li;xt=Qo(Y),nr!=="left"&&(mi=xt.map(Jo));var qi,es=0;if(nr==="right"){fe-=mi[0],Y=[],rn=xt.length;for(var $r=0;$r<rn;$r++)$r===0?(qi=Ii(fe),li=ji(ke)):(qi=L(es-mi[$r]),li=-Bi),Y.push([xt[$r],qi,li]),es=mi[$r]}else if(nr==="center"){fe-=mi[0]/2,Y=[],rn=xt.length;for(var fo=0;fo<rn;fo++)fo===0?(qi=Ii(fe),li=ji(ke)):(qi=L((es-mi[fo])/2),li=-Bi),Y.push([xt[fo],qi,li]),es=mi[fo]}else if(nr==="left"){Y=[],rn=xt.length;for(var tl=0;tl<rn;tl++)Y.push(xt[tl])}else if(nr==="justify"&&Co.encoding==="Identity-H"){Y=[],rn=xt.length,dr=dr!==0?dr:As;for(var ko=0,jr=0;jr<rn;jr++)if(li=jr===0?ji(ke):-Bi,qi=jr===0?Ii(fe):ko,jr<rn-1){var Lo=L((dr-mi[jr])/(xt[jr].split(" ").length-1)),Yn=xt[jr].split(" ");Y.push([Yn[0]+" ",qi,li]),ko=0;for(var Tr=1;Tr<Yn.length;Tr++){var xn=(Jo(Yn[Tr-1]+" "+Yn[Tr])-Jo(Yn[Tr]))*Pa+Lo;Tr==Yn.length-1?Y.push([Yn[Tr],xn,0]):Y.push([Yn[Tr]+" ",xn,0]),ko-=xn}}else Y.push([xt[jr],qi,li]);Y.push(["",ko,0])}else{if(nr!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(Y=[],rn=xt.length,dr=dr!==0?dr:As,jr=0;jr<rn;jr++)li=jr===0?ji(ke):-Bi,qi=jr===0?Ii(fe):0,jr<rn-1?yi.push(T(L((dr-mi[jr])/(xt[jr].split(" ").length-1)))):yi.push(0),Y.push([xt[jr],qi,li])}}var Xn=typeof Ie.R2L=="boolean"?Ie.R2L:Le;Xn===!0&&(Y=Di(Y,function(nn,Yr,Fn){return[nn.split("").reverse().join(""),Yr,Fn]})),ft={text:Y,x:fe,y:ke,options:Ie,mutex:{pdfEscape:ha,activeFontKey:nt,fonts:Xt,activeFontSize:Ee}},it.publish("postProcessText",ft),Y=ft.text,Ua=ft.mutex.isHex||!1;var ts=Xt[nt].encoding;ts!=="WinAnsiEncoding"&&ts!=="StandardEncoding"||(Y=Di(Y,function(nn,Yr,Fn){return[Zo(nn),Yr,Fn]})),xt=Qo(Y),Y=[];for(var No,To,Ga,kn=0,ho=1,Ro=Array.isArray(xt[0])?ho:kn,Mo="",zi=function(nn,Yr,Fn){var ei="";return Fn instanceof Ue?(Fn=typeof Ie.angle=="number"?St(Fn,new Ue(1,0,0,1,nn,Yr)):St(new Ue(1,0,0,1,nn,Yr),Fn),v===g.ADVANCED&&(Fn=St(new Ue(1,0,0,-1,0,0),Fn)),ei=Fn.join(" ")+` Tm
|
|
370
|
-
`):ei=T(nn)+" "+T(Yr)+` Td
|
|
371
|
-
`,ei},un=0;un<xt.length;un++){switch(Mo="",Ro){case ho:Ga=(Ua?"<":"(")+xt[un][0]+(Ua?">":")"),No=parseFloat(xt[un][1]),To=parseFloat(xt[un][2]);break;case kn:Ga=(Ua?"<":"(")+xt[un]+(Ua?">":")"),No=Ii(fe),To=ji(ke)}yi!==void 0&&yi[un]!==void 0&&(Mo=yi[un]+` Tw
|
|
372
|
-
`),un===0?Y.push(Mo+zi(No,To,Sn)+Ga):Ro===kn?Y.push(Mo+Ga):Ro===ho&&Y.push(Mo+zi(No,To,Sn)+Ga)}Y=Ro===kn?Y.join(` Tj
|
|
373
|
-
T* `):Y.join(` Tj
|
|
374
|
-
`),Y+=` Tj
|
|
375
|
-
`;var Ei=`BT
|
|
376
|
-
/`;return Ei+=nt+" "+Ee+` Tf
|
|
377
|
-
`,Ei+=T(Ee*Ea)+` TL
|
|
378
|
-
`,Ei+=_n+`
|
|
379
|
-
`,Ei+=si,Ei+=Y,ve(Ei+="ET"),w[nt]=!0,jn};var lo=d.__private__.clip=d.clip=function(Y){return ve(Y==="evenodd"?"W*":"W"),this};d.clipEvenOdd=function(){return lo("evenodd")},d.__private__.discardPath=d.discardPath=function(){return ve("n"),this};var Oo=d.__private__.isValidStyle=function(Y){var fe=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(Y)!==-1&&(fe=!0),fe};d.__private__.setDefaultPathOperation=d.setDefaultPathOperation=function(Y){return Oo(Y)&&(c=Y),this};var zu=d.__private__.getStyle=d.getStyle=function(Y){var fe=c;switch(Y){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=Y}return fe},Ys=d.close=function(){return ve("h"),this};d.stroke=function(){return ve("S"),this},d.fill=function(Y){return In("f",Y),this},d.fillEvenOdd=function(Y){return In("f*",Y),this},d.fillStroke=function(Y){return In("B",Y),this},d.fillStrokeEvenOdd=function(Y){return In("B*",Y),this};var In=function(Y,fe){On(fe)==="object"?ou(fe,Y):ve(Y)},Xs=function(Y){Y===null||v===g.ADVANCED&&Y===void 0||(Y=zu(Y),ve(Y))};function au(Y,fe,ke,Ie,Je){var ft=new ph(fe||this.boundingBox,ke||this.xStep,Ie||this.yStep,this.gState,Je||this.matrix);ft.stream=this.stream;var xt=Y+"$$"+this.cloneIndex+++"$$";return Ft(xt,ft),ft}var ou=function(Y,fe){var ke=ht[Y.key],Ie=Nt[ke];if(Ie instanceof Sf)ve("q"),ve(of(fe)),Ie.gState&&d.setGState(Ie.gState),ve(Y.matrix.toString()+" cm"),ve("/"+ke+" sh"),ve("Q");else if(Ie instanceof ph){var Je=new Ue(1,0,0,-1,0,Ko());Y.matrix&&(Je=Je.multiply(Y.matrix||kt),ke=au.call(Ie,Y.key,Y.boundingBox,Y.xStep,Y.yStep,Je).id),ve("q"),ve("/Pattern cs"),ve("/"+ke+" scn"),Ie.gState&&d.setGState(Ie.gState),ve(fe),ve("Q")}},of=function(Y){switch(Y){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=d.moveTo=function(Y,fe){return ve(T(L(Y))+" "+T(N(fe))+" m"),this},ai=d.lineTo=function(Y,fe){return ve(T(L(Y))+" "+T(N(fe))+" l"),this},Da=d.curveTo=function(Y,fe,ke,Ie,Je,ft){return ve([T(L(Y)),T(N(fe)),T(L(ke)),T(N(Ie)),T(L(Je)),T(N(ft)),"c"].join(" ")),this};d.__private__.line=d.line=function(Y,fe,ke,Ie,Je){if(isNaN(Y)||isNaN(fe)||isNaN(ke)||isNaN(Ie)||!Oo(Je))throw new Error("Invalid arguments passed to jsPDF.line");return v===g.COMPAT?this.lines([[ke-Y,Ie-fe]],Y,fe,[1,1],Je||"S"):this.lines([[ke-Y,Ie-fe]],Y,fe,[1,1]).stroke()},d.__private__.lines=d.lines=function(Y,fe,ke,Ie,Je,ft){var xt,Dt,nr,gr,dr,Sr,Cn,Sn,jn,Jn,si,Ua;if(typeof Y=="number"&&(Ua=ke,ke=fe,fe=Y,Y=Ua),Ie=Ie||[1,1],ft=ft||!1,isNaN(fe)||isNaN(ke)||!Array.isArray(Y)||!Array.isArray(Ie)||!Oo(Je)||typeof ft!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(uo(fe,ke),xt=Ie[0],Dt=Ie[1],gr=Y.length,Jn=fe,si=ke,nr=0;nr<gr;nr++)(dr=Y[nr]).length===2?(Jn=dr[0]*xt+Jn,si=dr[1]*Dt+si,ai(Jn,si)):(Sr=dr[0]*xt+Jn,Cn=dr[1]*Dt+si,Sn=dr[2]*xt+Jn,jn=dr[3]*Dt+si,Jn=dr[4]*xt+Jn,si=dr[5]*Dt+si,Da(Sr,Cn,Sn,jn,Jn,si));return ft&&Ys(),Xs(Je),this},d.path=function(Y){for(var fe=0;fe<Y.length;fe++){var ke=Y[fe],Ie=ke.c;switch(ke.op){case"m":uo(Ie[0],Ie[1]);break;case"l":ai(Ie[0],Ie[1]);break;case"c":Da.apply(this,Ie);break;case"h":Ys()}}return this},d.__private__.rect=d.rect=function(Y,fe,ke,Ie,Je){if(isNaN(Y)||isNaN(fe)||isNaN(ke)||isNaN(Ie)||!Oo(Je))throw new Error("Invalid arguments passed to jsPDF.rect");return v===g.COMPAT&&(Ie=-Ie),ve([T(L(Y)),T(N(fe)),T(L(ke)),T(L(Ie)),"re"].join(" ")),Xs(Je),this},d.__private__.triangle=d.triangle=function(Y,fe,ke,Ie,Je,ft,xt){if(isNaN(Y)||isNaN(fe)||isNaN(ke)||isNaN(Ie)||isNaN(Je)||isNaN(ft)||!Oo(xt))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[ke-Y,Ie-fe],[Je-ke,ft-Ie],[Y-Je,fe-ft]],Y,fe,[1,1],xt,!0),this},d.__private__.roundedRect=d.roundedRect=function(Y,fe,ke,Ie,Je,ft,xt){if(isNaN(Y)||isNaN(fe)||isNaN(ke)||isNaN(Ie)||isNaN(Je)||isNaN(ft)||!Oo(xt))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var Dt=4/3*(Math.SQRT2-1);return Je=Math.min(Je,.5*ke),ft=Math.min(ft,.5*Ie),this.lines([[ke-2*Je,0],[Je*Dt,0,Je,ft-ft*Dt,Je,ft],[0,Ie-2*ft],[0,ft*Dt,-Je*Dt,ft,-Je,ft],[2*Je-ke,0],[-Je*Dt,0,-Je,-ft*Dt,-Je,-ft],[0,2*ft-Ie],[0,-ft*Dt,Je*Dt,-ft,Je,-ft]],Y+Je,fe,[1,1],xt,!0),this},d.__private__.ellipse=d.ellipse=function(Y,fe,ke,Ie,Je){if(isNaN(Y)||isNaN(fe)||isNaN(ke)||isNaN(Ie)||!Oo(Je))throw new Error("Invalid arguments passed to jsPDF.ellipse");var ft=4/3*(Math.SQRT2-1)*ke,xt=4/3*(Math.SQRT2-1)*Ie;return uo(Y+ke,fe),Da(Y+ke,fe-xt,Y+ft,fe-Ie,Y,fe-Ie),Da(Y-ft,fe-Ie,Y-ke,fe-xt,Y-ke,fe),Da(Y-ke,fe+xt,Y-ft,fe+Ie,Y,fe+Ie),Da(Y+ft,fe+Ie,Y+ke,fe+xt,Y+ke,fe),Xs(Je),this},d.__private__.circle=d.circle=function(Y,fe,ke,Ie){if(isNaN(Y)||isNaN(fe)||isNaN(ke)||!Oo(Ie))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(Y,fe,ke,ke,Ie)},d.setFont=function(Y,fe,ke){return ke&&(fe=j(fe,ke)),nt=iu(Y,fe,{disableWarning:!1}),this};var su=d.__private__.getFont=d.getFont=function(){return Xt[iu.apply(d,arguments)]};d.__private__.getFontList=d.getFontList=function(){var Y,fe,ke={};for(Y in qe)if(qe.hasOwnProperty(Y))for(fe in ke[Y]=[],qe[Y])qe[Y].hasOwnProperty(fe)&&ke[Y].push(fe);return ke},d.addFont=function(Y,fe,ke,Ie,Je){var ft=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&ft.indexOf(arguments[3])!==-1?Je=arguments[3]:arguments[3]&&ft.indexOf(arguments[3])==-1&&(ke=j(ke,Ie)),Je=Je||"Identity-H",ja.call(this,Y,fe,ke,Je)};var Mi,Ba=e.lineWidth||.200025,Ao=d.__private__.getLineWidth=d.getLineWidth=function(){return Ba},Ps=d.__private__.setLineWidth=d.setLineWidth=function(Y){return Ba=Y,ve(T(L(Y))+" w"),this};d.__private__.setLineDash=hr.API.setLineDash=hr.API.setLineDashPattern=function(Y,fe){if(Y=Y||[],fe=fe||0,isNaN(fe)||!Array.isArray(Y))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return Y=Y.map(function(ke){return T(L(ke))}).join(" "),fe=T(L(fe)),ve("["+Y+"] "+fe+" d"),this};var gl=d.__private__.getLineHeight=d.getLineHeight=function(){return Ee*Mi};d.__private__.getLineHeight=d.getLineHeight=function(){return Ee*Mi};var Uu=d.__private__.setLineHeightFactor=d.setLineHeightFactor=function(Y){return typeof(Y=Y||1.15)=="number"&&(Mi=Y),this},oi=d.__private__.getLineHeightFactor=d.getLineHeightFactor=function(){return Mi};Uu(e.lineHeight);var Ii=d.__private__.getHorizontalCoordinate=function(Y){return L(Y)},ji=d.__private__.getVerticalCoordinate=function(Y){return v===g.ADVANCED?Y:_t[D].mediaBox.topRightY-_t[D].mediaBox.bottomLeftY-L(Y)},vl=d.__private__.getHorizontalCoordinateString=d.getHorizontalCoordinateString=function(Y){return T(Ii(Y))},xa=d.__private__.getVerticalCoordinateString=d.getVerticalCoordinateString=function(Y){return T(ji(Y))},wn=e.strokeColor||"0 G";d.__private__.getStrokeColor=d.getDrawColor=function(){return Wn(wn)},d.__private__.setStrokeColor=d.setDrawColor=function(Y,fe,ke,Ie){return wn=en({ch1:Y,ch2:fe,ch3:ke,ch4:Ie,pdfColorType:"draw",precision:2}),ve(wn),this};var Fi=e.fillColor||"0 g";d.__private__.getFillColor=d.getFillColor=function(){return Wn(Fi)},d.__private__.setFillColor=d.setFillColor=function(Y,fe,ke,Ie){return Fi=en({ch1:Y,ch2:fe,ch3:ke,ch4:Ie,pdfColorType:"fill",precision:2}),ve(Fi),this};var _n=e.textColor||"0 g",ea=d.__private__.getTextColor=d.getTextColor=function(){return Wn(_n)};d.__private__.setTextColor=d.setTextColor=function(Y,fe,ke,Ie){return _n=en({ch1:Y,ch2:fe,ch3:ke,ch4:Ie,pdfColorType:"text",precision:3}),this};var ta=e.charSpace,qa=d.__private__.getCharSpace=d.getCharSpace=function(){return parseFloat(ta||0)};d.__private__.setCharSpace=d.setCharSpace=function(Y){if(isNaN(Y))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return ta=Y,this};var lu=0;d.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},d.__private__.setLineCap=d.setLineCap=function(Y){var fe=d.CapJoinStyles[Y];if(fe===void 0)throw new Error("Line cap style of '"+Y+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return lu=fe,ve(fe+" J"),this};var Os=0;d.__private__.setLineJoin=d.setLineJoin=function(Y){var fe=d.CapJoinStyles[Y];if(fe===void 0)throw new Error("Line join style of '"+Y+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Os=fe,ve(fe+" j"),this},d.__private__.setLineMiterLimit=d.__private__.setMiterLimit=d.setLineMiterLimit=d.setMiterLimit=function(Y){if(Y=Y||0,isNaN(Y))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return ve(T(L(Y))+" M"),this},d.GState=B1,d.setGState=function(Y){(Y=typeof Y=="string"?gt[wt[Y]]:Ks(null,Y)).equals(tr)||(ve("/"+Y.id+" gs"),tr=Y)};var Ks=function(Y,fe){if(!Y||!wt[Y]){var ke=!1;for(var Ie in gt)if(gt.hasOwnProperty(Ie)&>[Ie].equals(fe)){ke=!0;break}if(ke)fe=gt[Ie];else{var Je="GS"+(Object.keys(gt).length+1).toString(10);gt[Je]=fe,fe.id=Je}return Y&&(wt[Y]=fe.id),it.publish("addGState",fe),fe}};d.addGState=function(Y,fe){return Ks(Y,fe),this},d.saveGraphicsState=function(){return ve("q"),We.push({key:nt,size:Ee,color:_n}),this},d.restoreGraphicsState=function(){ve("Q");var Y=We.pop();return nt=Y.key,Ee=Y.size,_n=Y.color,tr=null,this},d.setCurrentTransformationMatrix=function(Y){return ve(Y.toString()+" cm"),this},d.comment=function(Y){return ve("#"+Y),this};var $n=function(Y,fe){var ke=Y||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return ke},set:function(ft){isNaN(ft)||(ke=parseFloat(ft))}});var Ie=fe||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return Ie},set:function(ft){isNaN(ft)||(Ie=parseFloat(ft))}});var Je="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return Je},set:function(ft){Je=ft.toString()}}),this},vi=function(Y,fe,ke,Ie){$n.call(this,Y,fe),this.type="rect";var Je=ke||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return Je},set:function(xt){isNaN(xt)||(Je=parseFloat(xt))}});var ft=Ie||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return ft},set:function(xt){isNaN(xt)||(ft=parseFloat(xt))}}),this},tn=function(){this.page=Vt,this.currentPage=D,this.pages=me.slice(0),this.pagesContext=_t.slice(0),this.x=qt,this.y=Ct,this.matrix=or,this.width=Xo(D),this.height=Ko(D),this.outputDestination=Oe,this.id="",this.objectNumber=-1};tn.prototype.restore=function(){Vt=this.page,D=this.currentPage,_t=this.pagesContext,me=this.pages,qt=this.x,Ct=this.y,or=this.matrix,yl(D,this.width),uu(D,this.height),Oe=this.outputDestination};var Zs=function(Y,fe,ke,Ie,Je){bt.push(new tn),Vt=D=0,me=[],qt=Y,Ct=fe,or=Je,Wo([ke,Ie])},za=function(Y){if(Fe[Y])bt.pop().restore();else{var fe=new tn,ke="Xo"+(Object.keys(Ve).length+1).toString(10);fe.id=ke,Fe[Y]=ke,Ve[ke]=fe,it.publish("addFormObject",fe),bt.pop().restore()}};for(var ml in d.beginFormObject=function(Y,fe,ke,Ie,Je){return Zs(Y,fe,ke,Ie,Je),this},d.endFormObject=function(Y){return za(Y),this},d.doFormObject=function(Y,fe){var ke=Ve[Fe[Y]];return ve("q"),ve(fe.toString()+" cm"),ve("/"+ke.id+" Do"),ve("Q"),this},d.getFormObject=function(Y){var fe=Ve[Fe[Y]];return{x:fe.x,y:fe.y,width:fe.width,height:fe.height,matrix:fe.matrix}},d.save=function(Y,fe){return Y=Y||"generated.pdf",(fe=fe||{}).returnPromise=fe.returnPromise||!1,fe.returnPromise===!1?(_f(Ss($o()),Y),typeof _f.unload=="function"&&pr.setTimeout&&setTimeout(_f.unload,911),this):new Promise(function(ke,Ie){try{var Je=_f(Ss($o()),Y);typeof _f.unload=="function"&&pr.setTimeout&&setTimeout(_f.unload,911),ke(Je)}catch(ft){Ie(ft.message)}})},hr.API)hr.API.hasOwnProperty(ml)&&(ml==="events"&&hr.API.events.length?function(Y,fe){var ke,Ie,Je;for(Je=fe.length-1;Je!==-1;Je--)ke=fe[Je][0],Ie=fe[Je][1],Y.subscribe.apply(Y,[ke].concat(typeof Ie=="function"?[Ie]:Ie))}(it,hr.API.events):d[ml]=hr.API[ml]);var Xo=d.getPageWidth=function(Y){return(_t[Y=Y||D].mediaBox.topRightX-_t[Y].mediaBox.bottomLeftX)/at},yl=d.setPageWidth=function(Y,fe){_t[Y].mediaBox.topRightX=fe*at+_t[Y].mediaBox.bottomLeftX},Ko=d.getPageHeight=function(Y){return(_t[Y=Y||D].mediaBox.topRightY-_t[Y].mediaBox.bottomLeftY)/at},uu=d.setPageHeight=function(Y,fe){_t[Y].mediaBox.topRightY=fe*at+_t[Y].mediaBox.bottomLeftY};return d.internal={pdfEscape:ha,getStyle:zu,getFont:su,getFontSize:he,getCharSpace:qa,getTextColor:ea,getLineHeight:gl,getLineHeightFactor:oi,getLineWidth:Ao,write:He,getHorizontalCoordinate:Ii,getVerticalCoordinate:ji,getCoordinateString:vl,getVerticalCoordinateString:xa,collections:{},newObject:zt,newAdditionalObject:kr,newObjectDeferred:Wt,newObjectDeferredBegin:_r,getFilters:Qn,putStream:_i,events:it,scaleFactor:at,pageSize:{getWidth:function(){return Xo(D)},setWidth:function(Y){yl(D,Y)},getHeight:function(){return Ko(D)},setHeight:function(Y){uu(D,Y)}},encryptionOptions:h,encryption:gn,getEncryptor:Yo,output:xs,getNumberOfPages:af,pages:me,out:ve,f2:C,f3:x,getPageInfo:Fa,getPageInfoByObjId:It,getCurrentPageInfo:$s,getPDFVersion:E,Point:$n,Rectangle:vi,Matrix:Ue,hasHotfix:Es},Object.defineProperty(d.internal.pageSize,"width",{get:function(){return Xo(D)},set:function(Y){yl(D,Y)},enumerable:!0,configurable:!0}),Object.defineProperty(d.internal.pageSize,"height",{get:function(){return Ko(D)},set:function(Y){uu(D,Y)},enumerable:!0,configurable:!0}),ii.call(d,Ae),nt="F1",nu(a,t),it.publish("initialized"),d}uh.prototype.lsbFirstWord=function(e){return String.fromCharCode(e>>0&255,e>>8&255,e>>16&255,e>>24&255)},uh.prototype.toHexString=function(e){return e.split("").map(function(r){return("0"+(255&r.charCodeAt(0)).toString(16)).slice(-2)}).join("")},uh.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("")},uh.prototype.processOwnerPassword=function(e,r){return M2(R2(r).substr(0,5),e)},uh.prototype.encryptor=function(e,r){var t=R2(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&r,r>>8&255)).substr(0,10);return function(n){return M2(t,n)}},B1.prototype.equals=function(e){var r,t="id,objectNumber,equals";if(!e||On(e)!==On(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},hr.API={events:[]},hr.version="3.0.1";var ki=hr.API,jm=1,Bf=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},ah=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Er=function(e){return e.toFixed(2)},qc=function(e){return e.toFixed(5)};ki.__acroform__={};var bs=function(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e},Z4=function(e){return e*jm},Au=function(e){var r=new S_,t=er.internal.getHeight(e)||0,n=er.internal.getWidth(e)||0;return r.BBox=[0,0,Number(Er(n)),Number(Er(t))],r},jk=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},Fk=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)},Dk=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 Dk(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 jk(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 Fk(e,r-1)},Bk=ki.__acroform__.calculateCoordinates=function(e,r){var t=r.internal.getHorizontalCoordinate,n=r.internal.getVerticalCoordinate,a=e[0],i=e[1],o=e[2],l=e[3],u={};return u.lowerLeft_X=t(a)||0,u.lowerLeft_Y=n(i+l)||0,u.upperRight_X=t(a+o)||0,u.upperRight_Y=n(i)||0,[Number(Er(u.lowerLeft_X)),Number(Er(u.lowerLeft_Y)),Number(Er(u.upperRight_X)),Number(Er(u.upperRight_Y))]},qk=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var r=[],t=e._V||e.DV,n=I2(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+" "+Er(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(`
|
|
380
|
-
`),i}},I2=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(x){return x.split(`
|
|
381
|
-
`)}):a.map(function(x){return[x]});var i=t,o=er.internal.getHeight(e)||0;o=o<0?-o:o;var l=er.internal.getWidth(e)||0;l=l<0?-l:l;var u=function(x,L,A){if(x+1<a.length){var N=L+" "+a[x+1][0];return h1(N,e,A).width<=l-4}return!1};i++;e:for(;i>0;){r="",i--;var c,h,p=h1("3",e,i).height,w=e.multiline?o-i:(o-p)/2,d=w+=2,_=0,E=0,S=0;if(i<=0){r=`(...) Tj
|
|
382
|
-
`,r+="% Width of Text: "+h1(r,e,i=12).width+", FieldWidth:"+l+`
|
|
383
|
-
`;break}for(var y="",g=0,v=0;v<a.length;v++)if(a.hasOwnProperty(v)){var b=!1;if(a[v].length!==1&&S!==a[v].length-1){if((p+2)*(g+2)+2>o)continue e;y+=a[v][S],b=!0,E=v,v--}else{y=(y+=a[v][S]+" ").substr(y.length-1)==" "?y.substr(0,y.length-1):y;var O=parseInt(v),j=u(O,y,i),T=v>=a.length-1;if(j&&!T){y+=" ",S=0;continue}if(j||T){if(T)E=O;else if(e.multiline&&(p+2)*(g+2)+2>o)continue e}else{if(!e.multiline||(p+2)*(g+2)+2>o)continue e;E=O}}for(var M="",F=_;F<=E;F++){var C=a[F];if(e.multiline){if(F===E){M+=C[S]+" ",S=(S+1)%C.length;continue}if(F===_){M+=C[C.length-1]+" ";continue}}M+=C[0]+" "}switch(M=M.substr(M.length-1)==" "?M.substr(0,M.length-1):M,h=h1(M,e,i).width,e.textAlign){case"right":c=l-h-2;break;case"center":c=(l-h)/2;break;case"left":default:c=2}r+=Er(c)+" "+Er(d)+` Td
|
|
384
|
-
`,r+="("+Bf(M)+`) Tj
|
|
385
|
-
`,r+=-Er(c)+` 0 Td
|
|
386
|
-
`,d=-(i+2),h=0,_=b?E:E+1,g++,y=""}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}},zk={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},Uk=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)},Hk=function(e,r){for(var t in e)if(e.hasOwnProperty(t)){var n=t,a=e[t];r.internal.newObjectDeferredBegin(a.objId,!0),On(a)==="object"&&typeof a.putStream=="function"&&a.putStream(),delete e[n]}},Vk=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(zk)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");jm=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new x_,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&&Uk(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 l=n[o],u=[],c=l.Rect;if(l.Rect&&(l.Rect=Bk(l.Rect,a)),a.internal.newObjectDeferredBegin(l.objId,!0),l.DA=er.createDefaultAppearanceStream(l),On(l)==="object"&&typeof l.getKeyValueListForStream=="function"&&(u=l.getKeyValueListForStream()),l.Rect=c,l.hasAppearanceStream&&!l.appearanceStreamContent){var h=qk(l);u.push({key:"AP",value:"<</N "+h+">>"}),a.internal.acroformPlugin.xForms.push(h)}if(l.appearanceStreamContent){var p="";for(var w in l.appearanceStreamContent)if(l.appearanceStreamContent.hasOwnProperty(w)){var d=l.appearanceStreamContent[w];if(p+="/"+w+" ",p+="<<",Object.keys(d).length>=1||Array.isArray(d)){for(var o in d)if(d.hasOwnProperty(o)){var _=d[o];typeof _=="function"&&(_=_.call(a,l)),p+="/"+o+" "+_+" ",a.internal.acroformPlugin.xForms.indexOf(_)>=0||a.internal.acroformPlugin.xForms.push(_)}}else typeof(_=d)=="function"&&(_=_.call(a,l)),p+="/"+o+" "+_,a.internal.acroformPlugin.xForms.indexOf(_)>=0||a.internal.acroformPlugin.xForms.push(_);p+=">>"}u.push({key:"AP",value:`<<
|
|
387
|
-
`+p+">>"})}a.internal.putStream({additionalKeyValues:u,objectId:l.objId}),a.internal.out("endobj")}i&&Hk(a.internal.acroformPlugin.xForms,a)})(t,e)}),e.internal.acroformPlugin.isInitialized=!0}},__=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+=" "),On(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+="("+Bf(n(e[i].toString()))+")"):a+=e[i].toString()}return a+="]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},l2=function(e,r,t){var n=function(a){return a};return r!==void 0&&t&&(n=t.internal.getEncryptor(r)),(e=e||"").toString(),e="("+Bf(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:__(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 S_=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}})};bs(S_,Lu);var x_=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)),"("+Bf(t(e))+")"}},set:function(t){e=t}})};bs(x_,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(y){if(isNaN(y))throw new Error('Invalid value "'+y+'" for attribute F supplied.');r=y}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!Ki(r,3)},set:function(y){y?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(y){if(isNaN(y))throw new Error('Invalid value "'+y+'" for attribute Ff supplied.');t=y}});var n=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(n.length!==0)return n},set:function(y){n=y!==void 0?y:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[0])?0:n[0]},set:function(y){n[0]=y}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[1])?0:n[1]},set:function(y){n[1]=y}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[2])?0:n[2]},set:function(y){n[2]=y}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[3])?0:n[3]},set:function(y){n[3]=y}});var a="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return a},set:function(y){switch(y){case"/Btn":case"/Tx":case"/Ch":case"/Sig":a=y;break;default:throw new Error('Invalid value "'+y+'" 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 y=function(g){return g};return this.scope&&(y=this.scope.internal.getEncryptor(this.objId)),"("+Bf(y(i))+")"},set:function(y){i=y.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return i},set:function(y){i=y}});var o="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return o},set:function(y){o=y}});var l="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return l},set:function(y){l=y}});var u=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return u},set:function(y){u=y}});var c=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return c===void 0?50/jm:c},set:function(y){c=y}});var h="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return h},set:function(y){h=y}});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 l2(p,this.objId,this.scope)},set:function(y){y=y.toString(),p=y}});var w=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(w)return this instanceof Ta?w:l2(w,this.objId,this.scope)},set:function(y){y=y.toString(),w=this instanceof Ta?y:y.substr(0,1)==="("?ah(y.substr(1,y.length-2)):ah(y)}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ta?ah(w.substr(1,w.length-1)):w},set:function(y){y=y.toString(),w=this instanceof Ta?"/"+y:y}});var d=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(d)return d},set:function(y){this.V=y}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(d)return this instanceof Ta?d:l2(d,this.objId,this.scope)},set:function(y){y=y.toString(),d=this instanceof Ta?y:y.substr(0,1)==="("?ah(y.substr(1,y.length-2)):ah(y)}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ta?ah(d.substr(1,d.length-1)):d},set:function(y){y=y.toString(),d=this instanceof Ta?"/"+y:y}}),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(y){y=!!y,E=y}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(_)return _},set:function(y){_=y}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!Ki(this.Ff,1)},set:function(y){y?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(y){y?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(y){y?this.Ff=Zi(this.Ff,3):this.Ff=Qi(this.Ff,3)}});var S=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(S!==null)return S},set:function(y){if([0,1,2].indexOf(y)===-1)throw new Error('Invalid value "'+y+'" for attribute Q supplied.');S=y}}),Object.defineProperty(this,"textAlign",{get:function(){var y;switch(S){case 0:default:y="left";break;case 1:y="center";break;case 2:y="right"}return y},configurable:!0,enumerable:!0,set:function(y){switch(y){case"right":case 2:S=2;break;case"center":case 1:S=1;break;case"left":case 0:default:S=0}}})};bs(Jl,Lu);var vh=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 __(r,this.objId,this.scope)},set:function(t){var n,a;a=[],typeof(n=t)=="string"&&(a=function(i,o,l){l||(l=1);for(var u,c=[];u=o.exec(i);)c.push(u[l]);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};bs(vh,Jl);var mh=function(){vh.call(this),this.fontName="helvetica",this.combo=!1};bs(mh,vh);var yh=function(){mh.call(this),this.combo=!0};bs(yh,mh);var _1=function(){yh.call(this),this.edit=!0};bs(_1,yh);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+" ("+Bf(t(r[n]))+")");return a.push(">>"),a.join(`
|
|
388
|
-
`)}},set:function(t){On(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}})};bs(Ta,Jl);var S1=function(){Ta.call(this),this.pushButton=!0};bs(S1,Ta);var bh=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:[]}})};bs(bh,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(l){return l};this.scope&&(a=this.scope.internal.getEncryptor(this.objId));var i,o=[];for(i in o.push("<<"),n)o.push("/"+i+" ("+Bf(a(n[i]))+")");return o.push(">>"),o.join(`
|
|
389
|
-
`)},set:function(a){On(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=er.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};bs(q1,Jl),bh.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()}},bh.prototype.createOption=function(e){var r=new q1;return r.Parent=this,r.optionName=e,this.Kids.push(r),Gk.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=er.CheckBox.createAppearanceStream()};bs(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}})};bs(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};bs(E1,Of);var er={CheckBox:{createAppearanceStream:function(){return{N:{On:er.CheckBox.YesNormal},D:{On:er.CheckBox.YesPushDown,Off:er.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=I2(e,e.caption);return t.push("0.749023 g"),t.push("0 0 "+Er(er.internal.getWidth(e))+" "+Er(er.internal.getHeight(e))+" re"),t.push("f"),t.push("BMC"),t.push("q"),t.push("0 0 1 rg"),t.push("/"+n+" "+Er(i.fontSize)+" Tf "+a),t.push("BT"),t.push(i.text),t.push("ET"),t.push("Q"),t.push("EMC"),r.stream=t.join(`
|
|
390
|
-
`),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=er.internal.getHeight(e),o=er.internal.getWidth(e),l=I2(e,e.caption);return a.push("1 g"),a.push("0 0 "+Er(o)+" "+Er(i)+" re"),a.push("f"),a.push("q"),a.push("0 0 1 rg"),a.push("0 0 "+Er(o-1)+" "+Er(i-1)+" re"),a.push("W"),a.push("n"),a.push("0 g"),a.push("BT"),a.push("/"+t+" "+Er(l.fontSize)+" Tf "+n),a.push(l.text),a.push("ET"),a.push("Q"),r.stream=a.join(`
|
|
391
|
-
`),r},OffPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=[];return t.push("0.749023 g"),t.push("0 0 "+Er(er.internal.getWidth(e))+" "+Er(er.internal.getHeight(e))+" re"),t.push("f"),r.stream=t.join(`
|
|
392
|
-
`),r}},RadioButton:{Circle:{createAppearanceStream:function(e){var r={D:{Off:er.RadioButton.Circle.OffPushDown},N:{}};return r.N[e]=er.RadioButton.Circle.YesNormal,r.D[e]=er.RadioButton.Circle.YesPushDown,r},getCA:function(){return"l"},YesNormal:function(e){var r=Au(e);r.scope=e.scope;var t=[],n=er.internal.getWidth(e)<=er.internal.getHeight(e)?er.internal.getWidth(e)/4:er.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var a=er.internal.Bezier_C,i=Number((n*a).toFixed(5));return t.push("q"),t.push("1 0 0 1 "+qc(er.internal.getWidth(e)/2)+" "+qc(er.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(`
|
|
393
|
-
`),r},YesPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=[],n=er.internal.getWidth(e)<=er.internal.getHeight(e)?er.internal.getWidth(e)/4:er.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var a=Number((2*n).toFixed(5)),i=Number((a*er.internal.Bezier_C).toFixed(5)),o=Number((n*er.internal.Bezier_C).toFixed(5));return t.push("0.749023 g"),t.push("q"),t.push("1 0 0 1 "+qc(er.internal.getWidth(e)/2)+" "+qc(er.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 "+qc(er.internal.getWidth(e)/2)+" "+qc(er.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(`
|
|
394
|
-
`),r},OffPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=[],n=er.internal.getWidth(e)<=er.internal.getHeight(e)?er.internal.getWidth(e)/4:er.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var a=Number((2*n).toFixed(5)),i=Number((a*er.internal.Bezier_C).toFixed(5));return t.push("0.749023 g"),t.push("q"),t.push("1 0 0 1 "+qc(er.internal.getWidth(e)/2)+" "+qc(er.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(`
|
|
395
|
-
`),r}},Cross:{createAppearanceStream:function(e){var r={D:{Off:er.RadioButton.Cross.OffPushDown},N:{}};return r.N[e]=er.RadioButton.Cross.YesNormal,r.D[e]=er.RadioButton.Cross.YesPushDown,r},getCA:function(){return"8"},YesNormal:function(e){var r=Au(e);r.scope=e.scope;var t=[],n=er.internal.calculateCross(e);return t.push("q"),t.push("1 1 "+Er(er.internal.getWidth(e)-2)+" "+Er(er.internal.getHeight(e)-2)+" re"),t.push("W"),t.push("n"),t.push(Er(n.x1.x)+" "+Er(n.x1.y)+" m"),t.push(Er(n.x2.x)+" "+Er(n.x2.y)+" l"),t.push(Er(n.x4.x)+" "+Er(n.x4.y)+" m"),t.push(Er(n.x3.x)+" "+Er(n.x3.y)+" l"),t.push("s"),t.push("Q"),r.stream=t.join(`
|
|
396
|
-
`),r},YesPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=er.internal.calculateCross(e),n=[];return n.push("0.749023 g"),n.push("0 0 "+Er(er.internal.getWidth(e))+" "+Er(er.internal.getHeight(e))+" re"),n.push("f"),n.push("q"),n.push("1 1 "+Er(er.internal.getWidth(e)-2)+" "+Er(er.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(Er(t.x1.x)+" "+Er(t.x1.y)+" m"),n.push(Er(t.x2.x)+" "+Er(t.x2.y)+" l"),n.push(Er(t.x4.x)+" "+Er(t.x4.y)+" m"),n.push(Er(t.x3.x)+" "+Er(t.x3.y)+" l"),n.push("s"),n.push("Q"),r.stream=n.join(`
|
|
397
|
-
`),r},OffPushDown:function(e){var r=Au(e);r.scope=e.scope;var t=[];return t.push("0.749023 g"),t.push("0 0 "+Er(er.internal.getWidth(e))+" "+Er(er.internal.getHeight(e))+" re"),t.push("f"),r.stream=t.join(`
|
|
398
|
-
`),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}};er.internal={Bezier_C:.551915024494,calculateCross:function(e){var r=er.internal.getWidth(e),t=er.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}}}},er.internal.getWidth=function(e){var r=0;return On(e)==="object"&&(r=Z4(e.Rect[2])),r},er.internal.getHeight=function(e){var r=0;return On(e)==="object"&&(r=Z4(e.Rect[3])),r};var Gk=ki.addField=function(e){if(Vk(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=vh,ki.AcroFormListBox=mh,ki.AcroFormComboBox=yh,ki.AcroFormEditBox=_1,ki.AcroFormButton=Ta,ki.AcroFormPushButton=S1,ki.AcroFormRadioButton=bh,ki.AcroFormCheckBox=x1,ki.AcroFormTextField=Of,ki.AcroFormPasswordField=E1,ki.AcroFormAppearance=er,ki.AcroForm={ChoiceField:vh,ListBox:mh,ComboBox:yh,EditBox:_1,Button:Ta,PushButton:S1,RadioButton:bh,CheckBox:x1,TextField:Of,PasswordField:E1,Appearance:er},hr.AcroForm={ChoiceField:vh,ListBox:mh,ComboBox:yh,EditBox:_1,Button:Ta,PushButton:S1,RadioButton:bh,CheckBox:x1,TextField:Of,PasswordField:E1,Appearance:er};hr.AcroForm;function E_(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(x,L){var A,N,I,W,G,$=r;if((L=L||r)==="RGBA"||x.data!==void 0&&x.data instanceof Uint8ClampedArray&&"height"in x&&"width"in x)return"RGBA";if(j(x))for(G in t)for(I=t[G],A=0;A<I.length;A+=1){for(W=!0,N=0;N<I[A].length;N+=1)if(I[A][N]!==void 0&&I[A][N]!==x[N]){W=!1;break}if(W===!0){$=G;break}}else for(G in t)for(I=t[G],A=0;A<I.length;A+=1){for(W=!0,N=0;N<I[A].length;N+=1)if(I[A][N]!==void 0&&I[A][N]!==x.charCodeAt(N)){W=!1;break}if(W===!0){$=G;break}}return $===r&&L!==r&&($=L),$},a=function x(L){for(var A=this.internal.write,N=this.internal.putStream,I=(0,this.internal.getFilters)();I.indexOf("FlateEncode")!==-1;)I.splice(I.indexOf("FlateEncode"),1);L.objectId=this.internal.newObject();var W=[];if(W.push({key:"Type",value:"/XObject"}),W.push({key:"Subtype",value:"/Image"}),W.push({key:"Width",value:L.width}),W.push({key:"Height",value:L.height}),L.colorSpace===S.INDEXED?W.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(L.palette.length/3-1)+" "+("sMask"in L&&L.sMask!==void 0?L.objectId+2:L.objectId+1)+" 0 R]"}):(W.push({key:"ColorSpace",value:"/"+L.colorSpace}),L.colorSpace===S.DEVICE_CMYK&&W.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),W.push({key:"BitsPerComponent",value:L.bitsPerComponent}),"decodeParameters"in L&&L.decodeParameters!==void 0&&W.push({key:"DecodeParms",value:"<<"+L.decodeParameters+">>"}),"transparency"in L&&Array.isArray(L.transparency)){for(var G="",$=0,J=L.transparency.length;$<J;$++)G+=L.transparency[$]+" "+L.transparency[$]+" ";W.push({key:"Mask",value:"["+G+"]"})}L.sMask!==void 0&&W.push({key:"SMask",value:L.objectId+1+" 0 R"});var V=L.filter!==void 0?["/"+L.filter]:void 0;if(N({data:L.data,additionalKeyValues:W,alreadyAppliedFilters:V,objectId:L.objectId}),A("endobj"),"sMask"in L&&L.sMask!==void 0){var H="/Predictor "+L.predictor+" /Colors 1 /BitsPerComponent "+L.bitsPerComponent+" /Columns "+L.width,z={width:L.width,height:L.height,colorSpace:"DeviceGray",bitsPerComponent:L.bitsPerComponent,decodeParameters:H,data:L.sMask};"filter"in L&&(z.filter=L.filter),x.call(this,z)}if(L.colorSpace===S.INDEXED){var D=this.internal.newObject();N({data:M(new Uint8Array(L.palette)),objectId:D}),A("endobj")}},i=function(){var x=this.internal.collections.addImage_images;for(var L in x)a.call(this,x[L])},o=function(){var x,L=this.internal.collections.addImage_images,A=this.internal.write;for(var N in L)A("/I"+(x=L[N]).index,x.objectId,"0","R")},l=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 x=this.internal.collections.addImage_images;return l.call(this),x},c=function(){return Object.keys(this.internal.collections.addImage_images).length},h=function(x){return typeof e["process"+x.toUpperCase()]=="function"},p=function(x){return On(x)==="object"&&x.nodeType===1},w=function(x,L){if(x.nodeName==="IMG"&&x.hasAttribute("src")){var A=""+x.getAttribute("src");if(A.indexOf("data:image/")===0)return lp(unescape(A).split("base64,").pop());var N=e.loadFile(A,!0);if(N!==void 0)return N}if(x.nodeName==="CANVAS"){if(x.width===0||x.height===0)throw new Error("Given canvas must have data. Canvas width: "+x.width+", height: "+x.height);var I;switch(L){case"PNG":I="image/png";break;case"WEBP":I="image/webp";break;case"JPEG":case"JPG":default:I="image/jpeg"}return lp(x.toDataURL(I,1).split("base64,").pop())}},d=function(x){var L=this.internal.collections.addImage_images;if(L){for(var A in L)if(x===L[A].alias)return L[A]}},_=function(x,L,A){return x||L||(x=-96,L=-96),x<0&&(x=-1*A.width*72/x/this.internal.scaleFactor),L<0&&(L=-1*A.height*72/L/this.internal.scaleFactor),x===0&&(x=L*A.width/A.height),L===0&&(L=x*A.height/A.width),[x,L]},E=function(x,L,A,N,I,W){var G=_.call(this,A,N,I),$=this.internal.getCoordinateString,J=this.internal.getVerticalCoordinateString,V=u.call(this);if(A=G[0],N=G[1],V[I.index]=I,W){W*=Math.PI/180;var H=Math.cos(W),z=Math.sin(W),D=function(ne){return ne.toFixed(4)},K=[D(H),D(z),D(-1*z),D(H),0,0,"cm"]}this.internal.write("q"),W?(this.internal.write([1,"0","0",1,$(x),J(L+N),"cm"].join(" ")),this.internal.write(K.join(" ")),this.internal.write([$(A),"0","0",$(N),"0","0","cm"].join(" "))):this.internal.write([$(A),"0","0",$(N),$(x),J(L+N),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+I.index+" Do"),this.internal.write("Q")},S=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 y=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},g=e.__addimage__.sHashCode=function(x){var L,A,N=0;if(typeof x=="string")for(A=x.length,L=0;L<A;L++)N=(N<<5)-N+x.charCodeAt(L),N|=0;else if(j(x))for(A=x.byteLength/2,L=0;L<A;L++)N=(N<<5)-N+x[L],N|=0;return N},v=e.__addimage__.validateStringAsBase64=function(x){(x=x||"").toString().trim();var L=!0;return x.length===0&&(L=!1),x.length%4!=0&&(L=!1),/^[A-Za-z0-9+/]+$/.test(x.substr(0,x.length-2))===!1&&(L=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(x.substr(-2))===!1&&(L=!1),L},b=e.__addimage__.extractImageFromDataUrl=function(x){if(x==null||!(x=x.trim()).startsWith("data:"))return null;var L=x.indexOf(",");return L<0?null:x.substring(0,L).trim().endsWith("base64")?x.substring(L+1):null},O=e.__addimage__.supportsArrayBuffer=function(){return typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"};e.__addimage__.isArrayBuffer=function(x){return O()&&x instanceof ArrayBuffer};var j=e.__addimage__.isArrayBufferView=function(x){return O()&&typeof Uint32Array<"u"&&(x instanceof Int8Array||x instanceof Uint8Array||typeof Uint8ClampedArray<"u"&&x instanceof Uint8ClampedArray||x instanceof Int16Array||x instanceof Uint16Array||x instanceof Int32Array||x instanceof Uint32Array||x instanceof Float32Array||x instanceof Float64Array)},T=e.__addimage__.binaryStringToUint8Array=function(x){for(var L=x.length,A=new Uint8Array(L),N=0;N<L;N++)A[N]=x.charCodeAt(N);return A},M=e.__addimage__.arrayBufferToBinaryString=function(x){for(var L="",A=j(x)?x:new Uint8Array(x),N=0;N<A.length;N+=8192)L+=String.fromCharCode.apply(null,A.subarray(N,N+8192));return L};e.addImage=function(){var x,L,A,N,I,W,G,$,J;if(typeof arguments[1]=="number"?(L=r,A=arguments[1],N=arguments[2],I=arguments[3],W=arguments[4],G=arguments[5],$=arguments[6],J=arguments[7]):(L=arguments[1],A=arguments[2],N=arguments[3],I=arguments[4],W=arguments[5],G=arguments[6],$=arguments[7],J=arguments[8]),On(x=arguments[0])==="object"&&!p(x)&&"imageData"in x){var V=x;x=V.imageData,L=V.format||L||r,A=V.x||A||0,N=V.y||N||0,I=V.w||V.width||I,W=V.h||V.height||W,G=V.alias||G,$=V.compression||$,J=V.rotation||V.angle||J}var H=this.internal.getFilters();if($===void 0&&H.indexOf("FlateEncode")!==-1&&($="SLOW"),isNaN(A)||isNaN(N))throw new Error("Invalid coordinates passed to jsPDF.addImage");l.call(this);var z=F.call(this,x,L,G,$);return E.call(this,A,N,I,W,z,J),this};var F=function(x,L,A,N){var I,W,G;if(typeof x=="string"&&n(x)===r){x=unescape(x);var $=C(x,!1);($!==""||($=e.loadFile(x,!0))!==void 0)&&(x=$)}if(p(x)&&(x=w(x,L)),L=n(x,L),!h(L))throw new Error("addImage does not support files of type '"+L+"', please ensure that a plugin for '"+L+"' support is added.");if(((G=A)==null||G.length===0)&&(A=function(J){return typeof J=="string"||j(J)?g(J):j(J.data)?g(J.data):null}(x)),(I=d.call(this,A))||(O()&&(x instanceof Uint8Array||L==="RGBA"||(W=x,x=T(x))),I=this["process"+L.toUpperCase()](x,c.call(this),A,function(J){return J&&typeof J=="string"&&(J=J.toUpperCase()),J in e.image_compression?J:y.NONE}(N),W)),!I)throw new Error("An unknown error occurred whilst processing the image.");return I},C=e.__addimage__.convertBase64ToBinaryString=function(x,L){L=typeof L!="boolean"||L;var A,N="";if(typeof x=="string"){var I;A=(I=b(x))!==null&&I!==void 0?I:x;try{N=lp(A)}catch(W){if(L)throw v(A)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+W.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return N};e.getImageProperties=function(x){var L,A,N="";if(p(x)&&(x=w(x)),typeof x=="string"&&n(x)===r&&((N=C(x,!1))===""&&(N=e.loadFile(x)||""),x=N),A=n(x),!h(A))throw new Error("addImage does not support files of type '"+A+"', please ensure that a plugin for '"+A+"' support is added.");if(!O()||x instanceof Uint8Array||(x=T(x)),!(L=this["process"+A.toUpperCase()](x)))throw new Error("An unknown error occurred whilst processing the image");return L.fileType=A,L}})(hr.API),function(e){var r=function(t){if(t!==void 0&&t!="")return!0};hr.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,l=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 w=0;w<c.length;w++){n=c[w];var d=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(),S=this.internal.newAdditionalObject(),y=this.internal.getEncryptor(E.objId),g=n.title||"Note";i="<</Type /Annot /Subtype /Text "+(a="/Rect ["+o(n.bounds.x)+" "+l(n.bounds.y+n.bounds.h)+" "+o(n.bounds.x+n.bounds.w)+" "+l(n.bounds.y)+"] ")+"/Contents ("+d(y(n.contents))+")",i+=" /Popup "+S.objId+" 0 R",i+=" /P "+u.objId+" 0 R",i+=" /T ("+d(y(g))+") >>",E.content=i;var v=E.objId+" 0 R";i="<</Type /Annot /Subtype /Popup "+(a="/Rect ["+o(n.bounds.x+30)+" "+l(n.bounds.y+n.bounds.h)+" "+o(n.bounds.x+n.bounds.w+30)+" "+l(n.bounds.y)+"] ")+" /Parent "+v,n.open&&(i+=" /Open true"),i+=" >>",S.content=i,this.internal.write(E.objId,"0 R",S.objId,"0 R");break;case"freetext":a="/Rect ["+o(n.bounds.x)+" "+l(n.bounds.y)+" "+o(n.bounds.x+n.bounds.w)+" "+l(n.bounds.y+n.bounds.h)+"] ";var b=n.color||"#000000";i="<</Type /Annot /Subtype /FreeText "+a+"/Contents ("+d(_(n.contents))+")",i+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+b+")",i+=" /Border [0 0 0]",i+=" >>",this.internal.write(i);break;case"link":if(n.options.name){var O=this.annotations._nameMap[n.options.name];n.options.pageNumber=O.page,n.options.top=O.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 ("+d(_(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 j=l(n.options.top);n.options.left=n.options.left||0,n.options.zoom===void 0&&(n.options.zoom=0),i+=" /XYZ "+n.options.left+" "+j+" "+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 l=this.internal.getCurrentPageInfo(),u=this.internal.getCoordinateString,c=this.internal.getVerticalCoordinateString;l.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,l,u=this.getTextWidth(t),c=this.internal.getLineHeight()/this.internal.scaleFactor;if(i.maxWidth!==void 0){l=i.maxWidth;var h=this.splitTextToSize(t,l).length;o=Math.ceil(c*h)}else l=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,l,o,i),u},e.getTextWidth=function(t){var n=this.internal.getFontSize();return this.getStringUnitWidth(t)*n/this.internal.scaleFactor}}(hr.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)},l=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 S=0,y=t,g="",v=0;for(S=0;S<E.length;S+=1)y[E.charCodeAt(S)]!==void 0?(v++,typeof(y=y[E.charCodeAt(S)])=="number"&&(g+=String.fromCharCode(y),y=t,v=0),S===E.length-1&&(y=t,g+=E.charAt(S-(v-1)),S-=v-1,v=0)):(y=t,g+=E.charAt(S-v),S-=v,v=0);return g};e.__arabicParser__.isArabicDiacritic=function(E){return E!==void 0&&n[E.charCodeAt(0)]!==void 0};var w=e.__arabicParser__.getCorrectForm=function(E,S,y){return o(E)?i(E)===!1?-1:!c(E)||!o(S)&&!o(y)||!o(y)&&l(S)||l(E)&&!o(S)||l(E)&&u(S)||l(E)&&l(S)?0:h(E)&&o(S)&&!l(S)&&o(y)&&c(y)?3:l(E)||!o(y)?1:2:-1},d=function(E){var S=0,y=0,g=0,v="",b="",O="",j=(E=E||"").split("\\s+"),T=[];for(S=0;S<j.length;S+=1){for(T.push(""),y=0;y<j[S].length;y+=1)v=j[S][y],b=j[S][y-1],O=j[S][y+1],o(v)?(g=w(v,b,O),T[S]+=g!==-1?String.fromCharCode(r[v.charCodeAt(0)][g]):v):T[S]+=v;T[S]=p(T[S])}return T.join(" ")},_=e.__arabicParser__.processArabic=e.processArabic=function(){var E,S=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,y=[];if(Array.isArray(S)){var g=0;for(y=[],g=0;g<S.length;g+=1)Array.isArray(S[g])?y.push([d(S[g][0]),S[g][1],S[g][2]]):y.push([d(S[g])]);E=y}else E=d(S);return typeof arguments[0]=="string"?E:(arguments[0].text=E,arguments[0])};e.events.push(["preProcessText",_])}(hr.API),hr.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(l){t=l}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(l){n=isNaN(l)||Number.isInteger(l)===!1||l<0?150:l,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var a=300;Object.defineProperty(this,"height",{get:function(){return a},set:function(l){a=isNaN(l)||Number.isInteger(l)===!1||l<0?300:l,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=a+1)}});var i=[];Object.defineProperty(this,"childNodes",{get:function(){return i},set:function(l){i=l}});var o={};Object.defineProperty(this,"style",{get:function(){return o},set:function(l){o=l}}),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}])}(hr.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 w=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return w},set:function(E){w=E}});var d=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return d},set:function(E){d=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(),w=c.scaleFactor||this.internal.scaleFactor,d=0,_=0,E=0,S=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 y=c.maxWidth;y>0?typeof u=="string"?u=this.splitTextToSize(u,y):Object.prototype.toString.call(u)==="[object Array]"&&(u=u.reduce(function(v,b){return v.concat(S.splitTextToSize(b,y))},[])):u=Array.isArray(u)?u:[u];for(var g=0;g<u.length;g++)d<(E=this.getStringUnitWidth(u[g],{font:p})*h)&&(d=E);return d!==0&&(_=u.length),{w:d/=w,h:Math.max((_*h*this.getLineHeightFactor()-h*(this.getLineHeightFactor()-1))/w,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,w=this.internal.__cell__.tableHeaderRow,d=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,d&&w&&(this.printHeaderRow(u.lineNumber,!0),u.y+=w[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,w){if(n.call(this),!h)throw new Error("No data for PDF table.");var d,_,E,S,y=[],g=[],v=[],b={},O={},j=[],T=[],M=(w=w||{}).autoSize||!1,F=w.printHeaders!==!1,C=w.css&&w.css["font-size"]!==void 0?16*w.css["font-size"]:w.fontSize||12,x=w.margins||Object.assign({width:this.getPageWidth()},r),L=typeof w.padding=="number"?w.padding:3,A=w.headerBackgroundColor||"#c8c8c8",N=w.headerTextColor||"#000";if(a.call(this),this.internal.__cell__.printHeaders=F,this.internal.__cell__.margins=x,this.internal.__cell__.table_font_size=C,this.internal.__cell__.padding=L,this.internal.__cell__.headerBackgroundColor=A,this.internal.__cell__.headerTextColor=N,this.setFontSize(C),p==null)g=y=Object.keys(h[0]),v=y.map(function(){return"left"});else if(Array.isArray(p)&&On(p[0])==="object")for(y=p.map(function(V){return V.name}),g=p.map(function(V){return V.prompt||V.name||""}),v=p.map(function(V){return V.align||"left"}),d=0;d<p.length;d+=1)O[p[d].name]=p[d].width*(19.049976/25.4);else Array.isArray(p)&&typeof p[0]=="string"&&(g=y=p,v=y.map(function(){return"left"}));if(M||Array.isArray(p)&&typeof p[0]=="string")for(d=0;d<y.length;d+=1){for(b[S=y[d]]=h.map(function(V){return V[S]}),this.setFont(void 0,"bold"),j.push(this.getTextDimensions(g[d],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),_=b[S],this.setFont(void 0,"normal"),E=0;E<_.length;E+=1)j.push(this.getTextDimensions(_[E],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);O[S]=Math.max.apply(null,j)+L+L,j=[]}if(F){var I={};for(d=0;d<y.length;d+=1)I[y[d]]={},I[y[d]].text=g[d],I[y[d]].align=v[d];var W=l.call(this,I,O);T=y.map(function(V){return new i(u,c,O[V],W,I[V].text,void 0,I[V].align)}),this.setTableHeaderRow(T),this.printHeaderRow(1,!1)}var G=p.reduce(function(V,H){return V[H.name]=H.align,V},{});for(d=0;d<h.length;d+=1){"rowStart"in w&&w.rowStart instanceof Function&&w.rowStart({row:d,data:h[d]},this);var $=l.call(this,h[d],O);for(E=0;E<y.length;E+=1){var J=h[d][y[E]];"cellStart"in w&&w.cellStart instanceof Function&&w.cellStart({row:d,col:E,data:J},this),o.call(this,new i(u,c,O[y[E]],$,J,d+2,G[y[E]]))}}return this.internal.__cell__.table_x=u,this.internal.__cell__.table_y=c,this};var l=function(u,c){var h=this.internal.__cell__.padding,p=this.internal.__cell__.table_font_size,w=this.internal.scaleFactor;return Object.keys(u).map(function(d){var _=u[d];return this.splitTextToSize(_.hasOwnProperty("text")?_.text:_,c[d]-h-h)},this).map(function(d){return this.getLineHeightFactor()*d.length*p/w+h+h},this).reduce(function(d,_){return Math.max(d,_)},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 w=[],d=0;d<this.internal.__cell__.tableHeaderRow.length;d+=1){h=this.internal.__cell__.tableHeaderRow[d].clone(),c&&(h.y=this.internal.__cell__.margins.top||0,w.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(_)}w.length>0&&this.setTableHeaderRow(w),this.setFont(void 0,"normal"),t=!1}}(hr.API);var P_={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},O_=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],j2=E_(O_),A_=[100,200,300,400,500,600,700,800,900],Wk=E_(A_);function F2(e){var r=e.family.replace(/"|'/g,"").toLowerCase(),t=function(i){return P_[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 j2[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 Q4(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 $k={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},J4={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function ew(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function Yk(e,r,t){for(var n=(t=t||{}).defaultFontFamily||"times",a=Object.assign({},$k,t.genericFontFamilies||{}),i=null,o=null,l=0;l<r.length;++l)if(a[(i=F2(r[l])).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 '"+ew(i)+"' and default family '"+n+"'.");if(o=function(u,c){if(c[u])return c[u];var h=j2[u],p=h<=j2.normal?-1:1,w=Q4(c,O_,h,p);if(!w)throw new Error("Could not find a matching font-stretch value for "+u);return w}(i.stretch,o),o=function(u,c){if(c[u])return c[u];for(var h=P_[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=Wk[u],p=Q4(c,A_,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 '"+ew(i)+"'.");return o}function tw(e){return e.trimLeft()}function Xk(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 Kk(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,rw,nw,u2=["times"];(function(e){var r,t,n,a,i,o,l,u,c,h=function(z){return z=z||{},this.isStrokeTransparent=z.isStrokeTransparent||!1,this.strokeOpacity=z.strokeOpacity||1,this.strokeStyle=z.strokeStyle||"#000000",this.fillStyle=z.fillStyle||"#000000",this.isFillTransparent=z.isFillTransparent||!1,this.fillOpacity=z.fillOpacity||1,this.font=z.font||"10px sans-serif",this.textBaseline=z.textBaseline||"alphabetic",this.textAlign=z.textAlign||"left",this.lineWidth=z.lineWidth||1,this.lineJoin=z.lineJoin||"miter",this.lineCap=z.lineCap||"butt",this.path=z.path||[],this.transform=z.transform!==void 0?z.transform.clone():new u,this.globalCompositeOperation=z.globalCompositeOperation||"normal",this.globalAlpha=z.globalAlpha||1,this.clip_path=z.clip_path||[],this.currentPoint=z.currentPoint||new o,this.miterLimit=z.miterLimit||10,this.lastPoint=z.lastPoint||new o,this.lineDashOffset=z.lineDashOffset||0,this.lineDash=z.lineDash||[],this.margin=z.margin||[0,0,0,0],this.prevPageLastElemOffset=z.prevPageLastElemOffset||0,this.ignoreClearRect=typeof z.ignoreClearRect!="boolean"||z.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,l=this.internal.Rectangle,u=this.internal.Matrix,c=new h}]);var p=function(z){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var D=z;Object.defineProperty(this,"pdf",{get:function(){return D}});var K=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return K},set:function(Se){K=!!Se}});var ne=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return ne},set:function(Se){ne=!!Se}});var Z=0;Object.defineProperty(this,"posX",{get:function(){return Z},set:function(Se){isNaN(Se)||(Z=Se)}});var ee=0;Object.defineProperty(this,"posY",{get:function(){return ee},set:function(Se){isNaN(Se)||(ee=Se)}}),Object.defineProperty(this,"margin",{get:function(){return c.margin},set:function(Se){var ve;typeof Se=="number"?ve=[Se,Se,Se,Se]:((ve=new Array(4))[0]=Se[0],ve[1]=Se.length>=2?Se[1]:ve[0],ve[2]=Se.length>=3?Se[2]:ve[0],ve[3]=Se.length>=4?Se[3]:ve[1]),c.margin=ve}});var ae=!1;Object.defineProperty(this,"autoPaging",{get:function(){return ae},set:function(Se){ae=Se}});var se=0;Object.defineProperty(this,"lastBreak",{get:function(){return se},set:function(Se){se=Se}});var ce=[];Object.defineProperty(this,"pageBreaks",{get:function(){return ce},set:function(Se){ce=Se}}),Object.defineProperty(this,"ctx",{get:function(){return c},set:function(Se){Se instanceof h&&(c=Se)}}),Object.defineProperty(this,"path",{get:function(){return c.path},set:function(Se){c.path=Se}});var me=[];Object.defineProperty(this,"ctxStack",{get:function(){return me},set:function(Se){me=Se}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(Se){var ve;ve=w(Se),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(Se){var ve=w(Se);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(Se){["butt","round","square"].indexOf(Se)!==-1&&(this.ctx.lineCap=Se,this.pdf.setLineCap(Se))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(Se){isNaN(Se)||(this.ctx.lineWidth=Se,this.pdf.setLineWidth(Se))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(Se){["bevel","round","miter"].indexOf(Se)!==-1&&(this.ctx.lineJoin=Se,this.pdf.setLineJoin(Se))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(Se){isNaN(Se)||(this.ctx.miterLimit=Se,this.pdf.setMiterLimit(Se))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(Se){this.ctx.textBaseline=Se}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(Se){["right","end","center","left","start"].indexOf(Se)!==-1&&(this.ctx.textAlign=Se)}});var xe=null;function Oe(Se,ve){if(xe===null){var He=function(we){var Ae=[];return Object.keys(we).forEach(function(Ee){we[Ee].forEach(function(Ne){var he=null;switch(Ne){case"bold":he={family:Ee,weight:"bold"};break;case"italic":he={family:Ee,style:"italic"};break;case"bolditalic":he={family:Ee,weight:"bold",style:"italic"};break;case"":case"normal":he={family:Ee}}he!==null&&(he.ref={name:Ee,style:Ne},Ae.push(he))})}),Ae}(Se.getFontList());xe=function(we){for(var Ae={},Ee=0;Ee<we.length;++Ee){var Ne=F2(we[Ee]),he=Ne.family,Le=Ne.stretch,Ce=Ne.style,De=Ne.weight;Ae[he]=Ae[he]||{},Ae[he][Le]=Ae[he][Le]||{},Ae[he][Le][Ce]=Ae[he][Le][Ce]||{},Ae[he][Le][Ce][De]=Ne}return Ae}(He.concat(ve))}return xe}var Re=null;Object.defineProperty(this,"fontFaces",{get:function(){return Re},set:function(Se){xe=null,Re=Se}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(Se){var ve;if(this.ctx.font=Se,(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(Se))!==null){var He=ve[1];ve[2];var we=ve[3],Ae=ve[4];ve[5];var Ee=ve[6],Ne=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Ae)[2];Ae=Math.floor(Ne==="px"?parseFloat(Ae)*this.pdf.internal.scaleFactor:Ne==="em"?parseFloat(Ae)*this.pdf.getFontSize():parseFloat(Ae)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Ae);var he=function(Et){var nt,at,qt=[],Ct=Et.trim();if(Ct==="")return u2;if(Ct in J4)return[J4[Ct]];for(;Ct!=="";){switch(at=null,nt=(Ct=tw(Ct)).charAt(0)){case'"':case"'":at=Xk(Ct.substring(1),nt);break;default:at=Kk(Ct)}if(at===null||(qt.push(at[0]),(Ct=tw(at[1]))!==""&&Ct.charAt(0)!==","))return u2;Ct=Ct.replace(/^,/,"")}return qt}(Ee);if(this.fontFaces){var Le=Yk(Oe(this.pdf,this.fontFaces),he.map(function(Et){return{family:Et,stretch:"normal",weight:we,style:He}}));this.pdf.setFont(Le.ref.name,Le.ref.style)}else{var Ce="";(we==="bold"||parseInt(we,10)>=700||He==="bold")&&(Ce="bold"),He==="italic"&&(Ce+="italic"),Ce.length===0&&(Ce="normal");for(var De="",tt={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"},vt=0;vt<he.length;vt++){if(this.pdf.internal.getFont(he[vt],Ce,{noFallback:!0,disableWarning:!0})!==void 0){De=he[vt];break}if(Ce==="bolditalic"&&this.pdf.internal.getFont(he[vt],"bold",{noFallback:!0,disableWarning:!0})!==void 0)De=he[vt],Ce="bold";else if(this.pdf.internal.getFont(he[vt],"normal",{noFallback:!0,disableWarning:!0})!==void 0){De=he[vt],Ce="normal";break}}if(De===""){for(var mt=0;mt<he.length;mt++)if(tt[he[mt]]){De=tt[he[mt]];break}}De=De===""?"Times":De,this.pdf.setFont(De,Ce)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(Se){this.ctx.globalCompositeOperation=Se}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(Se){this.ctx.globalAlpha=Se}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(Se){this.ctx.lineDashOffset=Se,H.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(Se){this.ctx.lineDash=Se,H.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(Se){this.ctx.ignoreClearRect=!!Se}})};p.prototype.setLineDash=function(z){this.lineDash=z},p.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},p.prototype.fill=function(){b.call(this,"fill",!1)},p.prototype.stroke=function(){b.call(this,"stroke",!1)},p.prototype.beginPath=function(){this.path=[{type:"begin"}]},p.prototype.moveTo=function(z,D){if(isNaN(z)||isNaN(D))throw Gn.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var K=this.ctx.transform.applyToPoint(new o(z,D));this.path.push({type:"mt",x:K.x,y:K.y}),this.ctx.lastPoint=new o(z,D)},p.prototype.closePath=function(){var z=new o(0,0),D=0;for(D=this.path.length-1;D!==-1;D--)if(this.path[D].type==="begin"&&On(this.path[D+1])==="object"&&typeof this.path[D+1].x=="number"){z=new o(this.path[D+1].x,this.path[D+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new o(z.x,z.y)},p.prototype.lineTo=function(z,D){if(isNaN(z)||isNaN(D))throw Gn.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var K=this.ctx.transform.applyToPoint(new o(z,D));this.path.push({type:"lt",x:K.x,y:K.y}),this.ctx.lastPoint=new o(K.x,K.y)},p.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),b.call(this,null,!0)},p.prototype.quadraticCurveTo=function(z,D,K,ne){if(isNaN(K)||isNaN(ne)||isNaN(z)||isNaN(D))throw Gn.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var Z=this.ctx.transform.applyToPoint(new o(K,ne)),ee=this.ctx.transform.applyToPoint(new o(z,D));this.path.push({type:"qct",x1:ee.x,y1:ee.y,x:Z.x,y:Z.y}),this.ctx.lastPoint=new o(Z.x,Z.y)},p.prototype.bezierCurveTo=function(z,D,K,ne,Z,ee){if(isNaN(Z)||isNaN(ee)||isNaN(z)||isNaN(D)||isNaN(K)||isNaN(ne))throw Gn.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var ae=this.ctx.transform.applyToPoint(new o(Z,ee)),se=this.ctx.transform.applyToPoint(new o(z,D)),ce=this.ctx.transform.applyToPoint(new o(K,ne));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(z,D,K,ne,Z,ee){if(isNaN(z)||isNaN(D)||isNaN(K)||isNaN(ne)||isNaN(Z))throw Gn.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(ee=!!ee,!this.ctx.transform.isIdentity){var ae=this.ctx.transform.applyToPoint(new o(z,D));z=ae.x,D=ae.y;var se=this.ctx.transform.applyToPoint(new o(0,K)),ce=this.ctx.transform.applyToPoint(new o(0,0));K=Math.sqrt(Math.pow(se.x-ce.x,2)+Math.pow(se.y-ce.y,2))}Math.abs(Z-ne)>=2*Math.PI&&(ne=0,Z=2*Math.PI),this.path.push({type:"arc",x:z,y:D,radius:K,startAngle:ne,endAngle:Z,counterclockwise:ee})},p.prototype.arcTo=function(z,D,K,ne,Z){throw new Error("arcTo not implemented.")},p.prototype.rect=function(z,D,K,ne){if(isNaN(z)||isNaN(D)||isNaN(K)||isNaN(ne))throw Gn.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(z,D),this.lineTo(z+K,D),this.lineTo(z+K,D+ne),this.lineTo(z,D+ne),this.lineTo(z,D),this.lineTo(z+K,D),this.lineTo(z,D)},p.prototype.fillRect=function(z,D,K,ne){if(isNaN(z)||isNaN(D)||isNaN(K)||isNaN(ne))throw Gn.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!d.call(this)){var Z={};this.lineCap!=="butt"&&(Z.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(Z.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(z,D,K,ne),this.fill(),Z.hasOwnProperty("lineCap")&&(this.lineCap=Z.lineCap),Z.hasOwnProperty("lineJoin")&&(this.lineJoin=Z.lineJoin)}},p.prototype.strokeRect=function(z,D,K,ne){if(isNaN(z)||isNaN(D)||isNaN(K)||isNaN(ne))throw Gn.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");_.call(this)||(this.beginPath(),this.rect(z,D,K,ne),this.stroke())},p.prototype.clearRect=function(z,D,K,ne){if(isNaN(z)||isNaN(D)||isNaN(K)||isNaN(ne))throw Gn.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(z,D,K,ne))},p.prototype.save=function(z){z=typeof z!="boolean"||z;for(var D=this.pdf.internal.getCurrentPageInfo().pageNumber,K=0;K<this.pdf.internal.getNumberOfPages();K++)this.pdf.setPage(K+1),this.pdf.internal.out("q");if(this.pdf.setPage(D),z){this.ctx.fontSize=this.pdf.internal.getFontSize();var ne=new h(this.ctx);this.ctxStack.push(this.ctx),this.ctx=ne}},p.prototype.restore=function(z){z=typeof z!="boolean"||z;for(var D=this.pdf.internal.getCurrentPageInfo().pageNumber,K=0;K<this.pdf.internal.getNumberOfPages();K++)this.pdf.setPage(K+1),this.pdf.internal.out("Q");this.pdf.setPage(D),z&&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 w=function(z){var D,K,ne,Z;if(z.isCanvasGradient===!0&&(z=z.getColor()),!z)return{r:0,g:0,b:0,a:0,style:z};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(z))D=0,K=0,ne=0,Z=0;else{var ee=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(z);if(ee!==null)D=parseInt(ee[1]),K=parseInt(ee[2]),ne=parseInt(ee[3]),Z=1;else if((ee=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(z))!==null)D=parseInt(ee[1]),K=parseInt(ee[2]),ne=parseInt(ee[3]),Z=parseFloat(ee[4]);else{if(Z=1,typeof z=="string"&&z.charAt(0)!=="#"){var ae=new y_(z);z=ae.ok?ae.toHex():"#000000"}z.length===4?(D=z.substring(1,2),D+=D,K=z.substring(2,3),K+=K,ne=z.substring(3,4),ne+=ne):(D=z.substring(1,3),K=z.substring(3,5),ne=z.substring(5,7)),D=parseInt(D,16),K=parseInt(K,16),ne=parseInt(ne,16)}}return{r:D,g:K,b:ne,a:Z,style:z}},d=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},_=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};p.prototype.fillText=function(z,D,K,ne){if(isNaN(D)||isNaN(K)||typeof z!="string")throw Gn.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(ne=isNaN(ne)?void 0:ne,!d.call(this)){var Z=$(this.ctx.transform.rotation),ee=this.ctx.transform.scaleX;L.call(this,{text:z,x:D,y:K,scale:ee,angle:Z,align:this.textAlign,maxWidth:ne})}},p.prototype.strokeText=function(z,D,K,ne){if(isNaN(D)||isNaN(K)||typeof z!="string")throw Gn.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!_.call(this)){ne=isNaN(ne)?void 0:ne;var Z=$(this.ctx.transform.rotation),ee=this.ctx.transform.scaleX;L.call(this,{text:z,x:D,y:K,scale:ee,renderingMode:"stroke",angle:Z,align:this.textAlign,maxWidth:ne})}},p.prototype.measureText=function(z){if(typeof z!="string")throw Gn.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var D=this.pdf,K=this.pdf.internal.scaleFactor,ne=D.internal.getFontSize(),Z=D.getStringUnitWidth(z)*ne/D.internal.scaleFactor,ee=function(ae){var se=(ae=ae||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return se}}),this};return new ee({width:Z*=Math.round(96*K/72*1e4)/1e4})},p.prototype.scale=function(z,D){if(isNaN(z)||isNaN(D))throw Gn.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var K=new u(z,0,0,D,0,0);this.ctx.transform=this.ctx.transform.multiply(K)},p.prototype.rotate=function(z){if(isNaN(z))throw Gn.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var D=new u(Math.cos(z),Math.sin(z),-Math.sin(z),Math.cos(z),0,0);this.ctx.transform=this.ctx.transform.multiply(D)},p.prototype.translate=function(z,D){if(isNaN(z)||isNaN(D))throw Gn.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var K=new u(1,0,0,1,z,D);this.ctx.transform=this.ctx.transform.multiply(K)},p.prototype.transform=function(z,D,K,ne,Z,ee){if(isNaN(z)||isNaN(D)||isNaN(K)||isNaN(ne)||isNaN(Z)||isNaN(ee))throw Gn.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var ae=new u(z,D,K,ne,Z,ee);this.ctx.transform=this.ctx.transform.multiply(ae)},p.prototype.setTransform=function(z,D,K,ne,Z,ee){z=isNaN(z)?1:z,D=isNaN(D)?0:D,K=isNaN(K)?0:K,ne=isNaN(ne)?1:ne,Z=isNaN(Z)?0:Z,ee=isNaN(ee)?0:ee,this.ctx.transform=new u(z,D,K,ne,Z,ee)};var E=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};p.prototype.drawImage=function(z,D,K,ne,Z,ee,ae,se,ce){var me=this.pdf.getImageProperties(z),xe=1,Oe=1,Re=1,Se=1;ne!==void 0&&se!==void 0&&(Re=se/ne,Se=ce/Z,xe=me.width/ne*se/ne,Oe=me.height/Z*ce/Z),ee===void 0&&(ee=D,ae=K,D=0,K=0),ne!==void 0&&se===void 0&&(se=ne,ce=Z),ne===void 0&&se===void 0&&(se=me.width,ce=me.height);for(var ve,He=this.ctx.transform.decompose(),we=$(He.rotate.shx),Ae=new u,Ee=(Ae=(Ae=(Ae=Ae.multiply(He.translate)).multiply(He.skew)).multiply(He.scale)).applyToRectangle(new l(ee-D*Re,ae-K*Se,ne*xe,Z*Oe)),Ne=S.call(this,Ee),he=[],Le=0;Le<Ne.length;Le+=1)he.indexOf(Ne[Le])===-1&&he.push(Ne[Le]);if(v(he),this.autoPaging)for(var Ce=he[0],De=he[he.length-1],tt=Ce;tt<De+1;tt++){this.pdf.setPage(tt);var vt=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],mt=tt===1?this.posY+this.margin[0]:this.margin[0],Et=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],nt=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],at=tt===1?0:Et+(tt-2)*nt;if(this.ctx.clip_path.length!==0){var qt=this.path;ve=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=g(ve,this.posX+this.margin[3],-at+mt+this.ctx.prevPageLastElemOffset),O.call(this,"fill",!0),this.path=qt}var Ct=JSON.parse(JSON.stringify(Ee));Ct=g([Ct],this.posX+this.margin[3],-at+mt+this.ctx.prevPageLastElemOffset)[0];var or=(tt>Ce||tt<De)&&E.call(this);or&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],vt,nt,null).clip().discardPath()),this.pdf.addImage(z,"JPEG",Ct.x,Ct.y,Ct.w,Ct.h,null,null,we),or&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(z,"JPEG",Ee.x,Ee.y,Ee.w,Ee.h,null,null,we)};var S=function(z,D,K){var ne=[];D=D||this.pdf.internal.pageSize.width,K=K||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var Z=this.posY+this.ctx.prevPageLastElemOffset;switch(z.type){default:case"mt":case"lt":ne.push(Math.floor((z.y+Z)/K)+1);break;case"arc":ne.push(Math.floor((z.y+Z-z.radius)/K)+1),ne.push(Math.floor((z.y+Z+z.radius)/K)+1);break;case"qct":var ee=J(this.ctx.lastPoint.x,this.ctx.lastPoint.y,z.x1,z.y1,z.x,z.y);ne.push(Math.floor((ee.y+Z)/K)+1),ne.push(Math.floor((ee.y+ee.h+Z)/K)+1);break;case"bct":var ae=V(this.ctx.lastPoint.x,this.ctx.lastPoint.y,z.x1,z.y1,z.x2,z.y2,z.x,z.y);ne.push(Math.floor((ae.y+Z)/K)+1),ne.push(Math.floor((ae.y+ae.h+Z)/K)+1);break;case"rect":ne.push(Math.floor((z.y+Z)/K)+1),ne.push(Math.floor((z.y+z.h+Z)/K)+1)}for(var se=0;se<ne.length;se+=1)for(;this.pdf.internal.getNumberOfPages()<ne[se];)y.call(this);return ne},y=function(){var z=this.fillStyle,D=this.strokeStyle,K=this.font,ne=this.lineCap,Z=this.lineWidth,ee=this.lineJoin;this.pdf.addPage(),this.fillStyle=z,this.strokeStyle=D,this.font=K,this.lineCap=ne,this.lineWidth=Z,this.lineJoin=ee},g=function(z,D,K){for(var ne=0;ne<z.length;ne++)switch(z[ne].type){case"bct":z[ne].x2+=D,z[ne].y2+=K;case"qct":z[ne].x1+=D,z[ne].y1+=K;case"mt":case"lt":case"arc":default:z[ne].x+=D,z[ne].y+=K}return z},v=function(z){return z.sort(function(D,K){return D-K})},b=function(z,D){for(var K,ne,Z=this.fillStyle,ee=this.strokeStyle,ae=this.lineCap,se=this.lineWidth,ce=Math.abs(se*this.ctx.transform.scaleX),me=this.lineJoin,xe=JSON.parse(JSON.stringify(this.path)),Oe=JSON.parse(JSON.stringify(this.path)),Re=[],Se=0;Se<Oe.length;Se++)if(Oe[Se].x!==void 0)for(var ve=S.call(this,Oe[Se]),He=0;He<ve.length;He+=1)Re.indexOf(ve[He])===-1&&Re.push(ve[He]);for(var we=0;we<Re.length;we++)for(;this.pdf.internal.getNumberOfPages()<Re[we];)y.call(this);if(v(Re),this.autoPaging)for(var Ae=Re[0],Ee=Re[Re.length-1],Ne=Ae;Ne<Ee+1;Ne++){this.pdf.setPage(Ne),this.fillStyle=Z,this.strokeStyle=ee,this.lineCap=ae,this.lineWidth=ce,this.lineJoin=me;var he=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Le=Ne===1?this.posY+this.margin[0]:this.margin[0],Ce=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],De=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],tt=Ne===1?0:Ce+(Ne-2)*De;if(this.ctx.clip_path.length!==0){var vt=this.path;K=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=g(K,this.posX+this.margin[3],-tt+Le+this.ctx.prevPageLastElemOffset),O.call(this,z,!0),this.path=vt}if(ne=JSON.parse(JSON.stringify(xe)),this.path=g(ne,this.posX+this.margin[3],-tt+Le+this.ctx.prevPageLastElemOffset),D===!1||Ne===0){var mt=(Ne>Ae||Ne<Ee)&&E.call(this);mt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],he,De,null).clip().discardPath()),O.call(this,z,D),mt&&this.pdf.restoreGraphicsState()}this.lineWidth=se}else this.lineWidth=ce,O.call(this,z,D),this.lineWidth=se;this.path=xe},O=function(z,D){if((z!=="stroke"||D||!_.call(this))&&(z==="stroke"||D||!d.call(this))){for(var K,ne,Z=[],ee=this.path,ae=0;ae<ee.length;ae++){var se=ee[ae];switch(se.type){case"begin":Z.push({begin:!0});break;case"close":Z.push({close:!0});break;case"mt":Z.push({start:se,deltas:[],abs:[]});break;case"lt":var ce=Z.length;if(ee[ae-1]&&!isNaN(ee[ae-1].x)&&(K=[se.x-ee[ae-1].x,se.y-ee[ae-1].y],ce>0)){for(;ce>=0;ce--)if(Z[ce-1].close!==!0&&Z[ce-1].begin!==!0){Z[ce-1].deltas.push(K),Z[ce-1].abs.push(se);break}}break;case"bct":K=[se.x1-ee[ae-1].x,se.y1-ee[ae-1].y,se.x2-ee[ae-1].x,se.y2-ee[ae-1].y,se.x-ee[ae-1].x,se.y-ee[ae-1].y],Z[Z.length-1].deltas.push(K);break;case"qct":var me=ee[ae-1].x+2/3*(se.x1-ee[ae-1].x),xe=ee[ae-1].y+2/3*(se.y1-ee[ae-1].y),Oe=se.x+2/3*(se.x1-se.x),Re=se.y+2/3*(se.y1-se.y),Se=se.x,ve=se.y;K=[me-ee[ae-1].x,xe-ee[ae-1].y,Oe-ee[ae-1].x,Re-ee[ae-1].y,Se-ee[ae-1].x,ve-ee[ae-1].y],Z[Z.length-1].deltas.push(K);break;case"arc":Z.push({deltas:[],abs:[],arc:!0}),Array.isArray(Z[Z.length-1].abs)&&Z[Z.length-1].abs.push(se)}}ne=D?null:z==="stroke"?"stroke":"fill";for(var He=!1,we=0;we<Z.length;we++)if(Z[we].arc)for(var Ae=Z[we].abs,Ee=0;Ee<Ae.length;Ee++){var Ne=Ae[Ee];Ne.type==="arc"?M.call(this,Ne.x,Ne.y,Ne.radius,Ne.startAngle,Ne.endAngle,Ne.counterclockwise,void 0,D,!He):A.call(this,Ne.x,Ne.y),He=!0}else if(Z[we].close===!0)this.pdf.internal.out("h"),He=!1;else if(Z[we].begin!==!0){var he=Z[we].start.x,Le=Z[we].start.y;N.call(this,Z[we].deltas,he,Le),He=!0}ne&&F.call(this,ne),D&&C.call(this)}},j=function(z){var D=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,K=D*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return z-K;case"top":return z+D-K;case"hanging":return z+D-2*K;case"middle":return z+D/2-K;case"ideographic":return z;case"alphabetic":default:return z}},T=function(z){return z+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};p.prototype.createLinearGradient=function(){var z=function(){};return z.colorStops=[],z.addColorStop=function(D,K){this.colorStops.push([D,K])},z.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},z.isCanvasGradient=!0,z},p.prototype.createPattern=function(){return this.createLinearGradient()},p.prototype.createRadialGradient=function(){return this.createLinearGradient()};var M=function(z,D,K,ne,Z,ee,ae,se,ce){for(var me=W.call(this,K,ne,Z,ee),xe=0;xe<me.length;xe++){var Oe=me[xe];xe===0&&(ce?x.call(this,Oe.x1+z,Oe.y1+D):A.call(this,Oe.x1+z,Oe.y1+D)),I.call(this,z,D,Oe.x2,Oe.y2,Oe.x3,Oe.y3,Oe.x4,Oe.y4)}se?C.call(this):F.call(this,ae)},F=function(z){switch(z){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},C=function(){this.pdf.clip(),this.pdf.discardPath()},x=function(z,D){this.pdf.internal.out(t(z)+" "+n(D)+" m")},L=function(z){var D;switch(z.align){case"right":case"end":D="right";break;case"center":D="center";break;case"left":case"start":default:D="left"}var K=this.pdf.getTextDimensions(z.text),ne=j.call(this,z.y),Z=T.call(this,ne)-K.h,ee=this.ctx.transform.applyToPoint(new o(z.x,ne)),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,xe,Oe=this.ctx.transform.applyToRectangle(new l(z.x,ne,K.w,K.h)),Re=se.applyToRectangle(new l(z.x,Z,K.w,K.h)),Se=S.call(this,Re),ve=[],He=0;He<Se.length;He+=1)ve.indexOf(Se[He])===-1&&ve.push(Se[He]);if(v(ve),this.autoPaging)for(var we=ve[0],Ae=ve[ve.length-1],Ee=we;Ee<Ae+1;Ee++){this.pdf.setPage(Ee);var Ne=Ee===1?this.posY+this.margin[0]:this.margin[0],he=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Le=this.pdf.internal.pageSize.height-this.margin[2],Ce=Le-this.margin[0],De=this.pdf.internal.pageSize.width-this.margin[1],tt=De-this.margin[3],vt=Ee===1?0:he+(Ee-2)*Ce;if(this.ctx.clip_path.length!==0){var mt=this.path;ce=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=g(ce,this.posX+this.margin[3],-1*vt+Ne),O.call(this,"fill",!0),this.path=mt}var Et=g([JSON.parse(JSON.stringify(Re))],this.posX+this.margin[3],-vt+Ne+this.ctx.prevPageLastElemOffset)[0];z.scale>=.01&&(me=this.pdf.internal.getFontSize(),this.pdf.setFontSize(me*z.scale),xe=this.lineWidth,this.lineWidth=xe*z.scale);var nt=this.autoPaging!=="text";if(nt||Et.y+Et.h<=Le){if(nt||Et.y>=Ne&&Et.x<=De){var at=nt?z.text:this.pdf.splitTextToSize(z.text,z.maxWidth||De-Et.x)[0],qt=g([JSON.parse(JSON.stringify(Oe))],this.posX+this.margin[3],-vt+Ne+this.ctx.prevPageLastElemOffset)[0],Ct=nt&&(Ee>we||Ee<Ae)&&E.call(this);Ct&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],tt,Ce,null).clip().discardPath()),this.pdf.text(at,qt.x,qt.y,{angle:z.angle,align:D,renderingMode:z.renderingMode}),Ct&&this.pdf.restoreGraphicsState()}}else Et.y<Le&&(this.ctx.prevPageLastElemOffset+=Le-Et.y);z.scale>=.01&&(this.pdf.setFontSize(me),this.lineWidth=xe)}else z.scale>=.01&&(me=this.pdf.internal.getFontSize(),this.pdf.setFontSize(me*z.scale),xe=this.lineWidth,this.lineWidth=xe*z.scale),this.pdf.text(z.text,ee.x+this.posX,ee.y+this.posY,{angle:z.angle,align:D,renderingMode:z.renderingMode,maxWidth:z.maxWidth}),z.scale>=.01&&(this.pdf.setFontSize(me),this.lineWidth=xe)},A=function(z,D,K,ne){K=K||0,ne=ne||0,this.pdf.internal.out(t(z+K)+" "+n(D+ne)+" l")},N=function(z,D,K){return this.pdf.lines(z,D,K,null,null)},I=function(z,D,K,ne,Z,ee,ae,se){this.pdf.internal.out([r(a(K+z)),r(i(ne+D)),r(a(Z+z)),r(i(ee+D)),r(a(ae+z)),r(i(se+D)),"c"].join(" "))},W=function(z,D,K,ne){for(var Z=2*Math.PI,ee=Math.PI/2;D>K;)D-=Z;var ae=Math.abs(K-D);ae<Z&&ne&&(ae=Z-ae);for(var se=[],ce=ne?-1:1,me=D;ae>1e-5;){var xe=me+ce*Math.min(ae,ee);se.push(G.call(this,z,me,xe)),ae-=Math.abs(xe-me),me=xe}return se},G=function(z,D,K){var ne=(K-D)/2,Z=z*Math.cos(ne),ee=z*Math.sin(ne),ae=Z,se=-ee,ce=ae*ae+se*se,me=ce+ae*Z+se*ee,xe=4/3*(Math.sqrt(2*ce*me)-me)/(ae*ee-se*Z),Oe=ae-xe*se,Re=se+xe*ae,Se=Oe,ve=-Re,He=ne+D,we=Math.cos(He),Ae=Math.sin(He);return{x1:z*Math.cos(D),y1:z*Math.sin(D),x2:Oe*we-Re*Ae,y2:Oe*Ae+Re*we,x3:Se*we-ve*Ae,y3:Se*Ae+ve*we,x4:z*Math.cos(K),y4:z*Math.sin(K)}},$=function(z){return 180*z/Math.PI},J=function(z,D,K,ne,Z,ee){var ae=z+.5*(K-z),se=D+.5*(ne-D),ce=Z+.5*(K-Z),me=ee+.5*(ne-ee),xe=Math.min(z,Z,ae,ce),Oe=Math.max(z,Z,ae,ce),Re=Math.min(D,ee,se,me),Se=Math.max(D,ee,se,me);return new l(xe,Re,Oe-xe,Se-Re)},V=function(z,D,K,ne,Z,ee,ae,se){var ce,me,xe,Oe,Re,Se,ve,He,we,Ae,Ee,Ne,he,Le,Ce=K-z,De=ne-D,tt=Z-K,vt=ee-ne,mt=ae-Z,Et=se-ee;for(me=0;me<41;me++)we=(ve=(xe=z+(ce=me/40)*Ce)+ce*((Re=K+ce*tt)-xe))+ce*(Re+ce*(Z+ce*mt-Re)-ve),Ae=(He=(Oe=D+ce*De)+ce*((Se=ne+ce*vt)-Oe))+ce*(Se+ce*(ee+ce*Et-Se)-He),me==0?(Ee=we,Ne=Ae,he=we,Le=Ae):(Ee=Math.min(Ee,we),Ne=Math.min(Ne,Ae),he=Math.max(he,we),Le=Math.max(Le,Ae));return new l(Math.round(Ee),Math.round(Ne),Math.round(he-Ee),Math.round(Le-Ne))},H=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var z,D,K=(z=this.ctx.lineDash,D=this.ctx.lineDashOffset,JSON.stringify({lineDash:z,lineDashOffset:D}));this.prevLineDash!==K&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=K)}}})(hr.API),function(e){var r=function(i){var o,l,u,c,h,p,w,d,_,E;for(l=[],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)-(d=h%85))/85)-(w=h%85))/85)%85,l.push(p+33,w+33,d+33,_+33,E+33)):l.push(122);return function(S,y){for(var g=y;g>0;g--)S.pop()}(l,o.length),String.fromCharCode.apply(String,l)+"~>"},t=function(i){var o,l,u,c,h,p=String,w="length",d=255,_="charCodeAt",E="slice",S="replace";for(i[E](-2),i=i[E](0,-2)[S](/\s/g,"")[S]("z","!!!!!"),u=[],c=0,h=(i+=o="uuuuu"[E](i[w]%5||5))[w];h>c;c+=5)l=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(d&l>>24,d&l>>16,d&l>>8,d&l);return function(y,g){for(var v=g;v>0;v--)y.pop()}(u,o[w]),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 l="",u=0;u<i.length;u+=2)l+=String.fromCharCode("0x"+(i[u]+i[u+1]));return l},a=function(i){for(var o=new Uint8Array(i.length),l=i.length;l--;)o[l]=i.charCodeAt(l);return i=(o=N2(o)).reduce(function(u,c){return u+String.fromCharCode(c)},"")};e.processDataByFilters=function(i,o){var l=0,u=i||"",c=[];for(typeof(o=o||[])=="string"&&(o=[o]),l=0;l<o.length;l+=1)switch(o[l]){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[l]+'" is not implemented')}return{data:u,reverseChain:c.reverse().join(" ")}}}(hr.API),function(e){e.loadFile=function(r,t,n){return function(a,i,o){i=i!==!1,o=typeof o=="function"?o:function(){};var l=void 0;try{l=function(u,c,h){var p=new XMLHttpRequest,w=0,d=function(_){var E=_.length,S=[],y=String.fromCharCode;for(w=0;w<E;w+=1)S.push(y(255&_.charCodeAt(w)));return S.join("")};if(p.open("GET",u,!c),p.overrideMimeType("text/plain; charset=x-user-defined"),c===!1&&(p.onload=function(){p.status===200?h(d(this.responseText)):h(void 0)}),p.send(null),c&&p.status===200)return d(p.responseText)}(a,i,o)}catch{}return l}(r,t,n)},e.loadImageFile=e.loadFile}(hr.API),function(e){function r(){return(pr.html2canvas?Promise.resolve(pr.html2canvas):O2(()=>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(pr.DOMPurify?Promise.resolve(pr.DOMPurify):O2(()=>import("./purify.es-Ci5xwkH_.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 l=On(o);return l==="undefined"?"undefined":l==="string"||o instanceof String?"string":l==="number"||o instanceof Number?"number":l==="function"||o instanceof Function?"function":o&&o.constructor===Array?"array":o&&o.nodeType===1?"element":l==="object"?"object":"unknown"},a=function(o,l){var u=document.createElement(o);for(var c in l.className&&(u.className=l.className),l.innerHTML&&l.dompurify&&(u.innerHTML=l.dompurify.sanitize(l.innerHTML)),l.style)u.style[c]=l.style[c];return u},i=function o(l){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(l)};(i.prototype=Object.create(Promise.prototype)).constructor=i,i.convert=function(o,l){return o.__proto__=l||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,l){return this.then(function(){switch(l=l||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},l=function u(c,h){for(var p=c.nodeType===3?document.createTextNode(c.nodeValue):c.cloneNode(!1),w=c.firstChild;w;w=w.nextSibling)h!==!0&&w.nodeType===1&&w.nodeName==="SCRIPT"||p.appendChild(u(w,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);l.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(l),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(l){var u=Object.assign({},this.opt.html2canvas);return delete u.onrendered,l(this.prop.container,u)}).then(function(l){(this.opt.html2canvas.onrendered||function(){})(l),this.prop.canvas=l,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(l){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 w=0;w<c.length;++w){var d=c[w],_=d.src.find(function(E){return E.format==="truetype"});_&&u.addFont(_.url,d.ref.name,d.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),l(this.prop.container,p)}).then(function(l){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(l),this.prop.canvas=l,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,l,u){return(u=u||"pdf").toLowerCase()==="img"||u.toLowerCase()==="image"?this.outputImg(o,l):this.outputPdf(o,l)},i.prototype.outputPdf=function(o,l){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(o,l)})},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 l=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(l)})},i.prototype.get=function(o,l){return this.then(function(){var u=o in i.template.prop?this.prop[o]:this.opt[o];return l?l(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 l(u,c){return Math.floor(u*c/72*96)}return this.then(function(){(o=o||hr.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:l(o.inner.width,o.k),height:l(o.inner.height,o.k)},o.inner.ratio=o.inner.height/o.inner.width),this.prop.pageSize=o})},i.prototype.setProgress=function(o,l,u,c){return o!=null&&(this.progress.val=o),l!=null&&(this.progress.state=l),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,l,u,c){return this.setProgress(o?this.progress.val+o:null,l||null,u?this.progress.n+u:null,c?this.progress.stack.concat(c):null)},i.prototype.then=function(o,l){var u=this;return this.thenCore(o,l,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,l,u){u=u||Promise.prototype.then,o&&(o=o.bind(this)),l&&(l=l.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,l);return i.convert(h,this.__proto__)},i.prototype.thenExternal=function(o,l){return Promise.prototype.then.call(this,o,l)},i.prototype.thenList=function(o){var l=this;return o.forEach(function(u){l=l.thenCore(u)}),l},i.prototype.catch=function(o){o&&(o=o.bind(this));var l=Promise.prototype.catch.call(this,o);return i.convert(l,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,hr.getPageSize=function(o,l,u){if(On(o)==="object"){var c=o;o=c.orientation,l=c.unit||l,u=c.format||u}l=l||"mm",u=u||"a4",o=(""+(o||"P")).toLowerCase();var h,p=(""+u).toLowerCase(),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]};switch(l){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: "+l}var d,_=0,E=0;if(w.hasOwnProperty(p))_=w[p][1]/h,E=w[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>_&&(d=E,E=_,_=d);else{if(o!=="l"&&o!=="landscape")throw"Invalid orientation: "+o;o="l",_>E&&(d=E,E=_,_=d)}return{width:E,height:_,unit:l,k:h,orientation:o}},e.html=function(o,l){(l=l||{}).callback=l.callback||function(){},l.html2canvas=l.html2canvas||{},l.html2canvas.canvas=l.html2canvas.canvas||this.canvas,l.jsPDF=l.jsPDF||this,l.fontFaces=l.fontFaces?l.fontFaces.map(F2):null;var u=new i(l);return l.worker?u:u.from(o).doCallback()}}(hr.API),hr.API.addJS=function(e){return nw=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"),rw=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+nw+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){d1!==void 0&&rw!==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],l=n.exec(o);if(l!=null){var u=l[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 w=t.internal.getPageInfo(i+1);t.internal.write("<< /D["+w.objId+" 0 R /XYZ null null null]>> endobj")}var d=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 "+d+" 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 l=this.count=this.count_r({count:0},o);if(l>0&&this.line("/Count "+l),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
|
|
399
|
-
`},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
|
|
400
|
-
`+n.id+` 0 obj\r
|
|
401
|
-
<<\r
|
|
402
|
-
`},t.outline.objEnd=function(){this.ctx.val+=`>> \r
|
|
403
|
-
endobj\r
|
|
404
|
-
`},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}}])}(hr.API),function(e){var r=[192,193,194,195,196,197,198,199];e.processJPEG=function(t,n,a,i,o,l){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 w,d=256*p.charCodeAt(4)+p.charCodeAt(5),_=p.length,E={width:0,height:0,numcomponents:1},S=4;S<_;S+=2){if(S+=d,r.indexOf(p.charCodeAt(S+1))!==-1){w=256*p.charCodeAt(S+5)+p.charCodeAt(S+6),E={width:256*p.charCodeAt(S+7)+p.charCodeAt(S+8),height:w,numcomponents:p.charCodeAt(S+9)};break}d=256*p.charCodeAt(S+2)+p.charCodeAt(S+3)}return E}(t=this.__addimage__.isArrayBufferView(t)?this.__addimage__.arrayBufferToBinaryString(t):t)).numcomponents){case 1:l=this.color_spaces.DEVICE_GRAY;break;case 4:l=this.color_spaces.DEVICE_CMYK;break;case 3:l=this.color_spaces.DEVICE_RGB}h={data:t,width:u.width,height:u.height,colorSpace:l,bitsPerComponent:8,filter:c,index:n,alias:a}}return h}}(hr.API);var oh,p1,iw,aw,ow,Zk=function(){var e,r,t;function n(i){var o,l,u,c,h,p,w,d,_,E,S,y,g,v;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 b,O;for(O=[],b=0;b<4;++b)O.push(String.fromCharCode(this.data[this.pos++]));return O}).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,y=0;0<=o?y<o:y>o;0<=o?++y:--y)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(g=0;0<=E?g<E:g>E;0<=E?++g:--g)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":w=(S=this.read(o)).indexOf(0),d=String.fromCharCode.apply(String,S.slice(0,w)),this.text[d]=String.fromCharCode.apply(String,S.slice(w+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=(v=this.colorType)===4||v===6,l=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*l,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,l;for(l=[],o=0;0<=i?o<i:o>i;0<=i?++o:--o)l.push(this.data[this.pos++]);return l},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,l=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,w,d,_){var E,S,y,g,v,b,O,j,T,M,F,C,x,L,A,N,I,W,G,$,J,V=Math.ceil((c.width-p)/d),H=Math.ceil((c.height-w)/_),z=c.width==V&&c.height==H;for(L=o*V,C=z?l:new Uint8Array(L*H),b=i.length,x=0,S=0;x<H&&u<b;){switch(i[u++]){case 0:for(g=I=0;I<L;g=I+=1)C[S++]=i[u++];break;case 1:for(g=W=0;W<L;g=W+=1)E=i[u++],v=g<o?0:C[S-o],C[S++]=(E+v)%256;break;case 2:for(g=G=0;G<L;g=G+=1)E=i[u++],y=(g-g%o)/o,A=x&&C[(x-1)*L+y*o+g%o],C[S++]=(A+E)%256;break;case 3:for(g=$=0;$<L;g=$+=1)E=i[u++],y=(g-g%o)/o,v=g<o?0:C[S-o],A=x&&C[(x-1)*L+y*o+g%o],C[S++]=(E+Math.floor((v+A)/2))%256;break;case 4:for(g=J=0;J<L;g=J+=1)E=i[u++],y=(g-g%o)/o,v=g<o?0:C[S-o],x===0?A=N=0:(A=C[(x-1)*L+y*o+g%o],N=y&&C[(x-1)*L+(y-1)*o+g%o]),O=v+A-N,j=Math.abs(O-v),M=Math.abs(O-A),F=Math.abs(O-N),T=j<=M&&j<=F?v:M<=F?A:N,C[S++]=(E+T)%256;break;default:throw new Error("Invalid filter algorithm: "+i[u-1])}if(!z){var D=((w+x*_)*c.width+p)*o,K=x*L;for(g=0;g<V;g+=1){for(var ne=0;ne<o;ne+=1)l[D++]=C[K++];D+=(d-1)*o}}x++}}return i=kk(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),l},n.prototype.decodePalette=function(){var i,o,l,u,c,h,p,w,d;for(l=this.palette,h=this.transparency.indexed||[],c=new Uint8Array((h.length||0)+l.length),u=0,i=0,o=p=0,w=l.length;p<w;o=p+=3)c[u++]=l[o],c[u++]=l[o+1],c[u++]=l[o+2],c[u++]=(d=h[i++])!=null?d:255;return c},n.prototype.copyToImageData=function(i,o){var l,u,c,h,p,w,d,_,E,S,y;if(u=this.colors,E=null,l=this.hasAlphaChannel,this.palette.length&&(E=(y=this._decodedPalette)!=null?y:this._decodedPalette=this.decodePalette(),u=4,l=!0),_=(c=i.data||i).length,p=E||o,h=w=0,u===1)for(;h<_;)d=E?4*o[h/4]:w,S=p[d++],c[h++]=S,c[h++]=S,c[h++]=S,c[h++]=l?p[d++]:255,w=d;else for(;h<_;)d=E?4*o[h/4]:w,c[h++]=p[d++],c[h++]=p[d++],c[h++]=p[d++],c[h++]=l?p[d++]:255,w=d},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(pr)==="[object Window]"){try{r=pr.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,l,u,c,h,p,w,d;if(this.animation){for(d=[],l=h=0,p=(w=this.animation.frames).length;h<p;l=++h)o=w[l],u=i.createImageData(o.width,o.height),c=this.decodePixels(new Uint8Array(o.data)),this.copyToImageData(u,c),o.imageData=u,d.push(o.image=e(u));return d}},n.prototype.renderFrame=function(i,o){var l,u,c;return l=(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),l.blendOp===0&&i.clearRect(l.xOffset,l.yOffset,l.width,l.height),i.drawImage(l.image,l.xOffset,l.yOffset)},n.prototype.animate=function(i){var o,l,u,c,h,p,w=this;return l=0,p=this.animation,c=p.numFrames,u=p.frames,h=p.numPlays,(o=function(){var d,_;if(d=l++%c,_=u[d],w.renderFrame(i,d),c>1&&l/c<h)return w.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,l;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)):(l=o.createImageData(this.width,this.height),this.copyToImageData(l,this.decodePixels()),o.putImageData(l,0,0))},n}();/**
|
|
405
|
-
* @license
|
|
406
|
-
*
|
|
407
|
-
* Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
|
|
408
|
-
*
|
|
409
|
-
* Permission is hereby granted, free of charge, to any person obtaining
|
|
410
|
-
* a copy of this software and associated documentation files (the
|
|
411
|
-
* "Software"), to deal in the Software without restriction, including
|
|
412
|
-
* without limitation the rights to use, copy, modify, merge, publish,
|
|
413
|
-
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
414
|
-
* permit persons to whom the Software is furnished to do so, subject to
|
|
415
|
-
* the following conditions:
|
|
416
|
-
*
|
|
417
|
-
* The above copyright notice and this permission notice shall be
|
|
418
|
-
* included in all copies or substantial portions of the Software.
|
|
419
|
-
*
|
|
420
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
421
|
-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
422
|
-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
423
|
-
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
424
|
-
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
425
|
-
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
426
|
-
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
427
|
-
* ====================================================================
|
|
428
|
-
*//**
|
|
429
|
-
* @license
|
|
430
|
-
* (c) Dean McNamee <dean@gmail.com>, 2013.
|
|
431
|
-
*
|
|
432
|
-
* https://github.com/deanm/omggif
|
|
433
|
-
*
|
|
434
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
435
|
-
* of this software and associated documentation files (the "Software"), to
|
|
436
|
-
* deal in the Software without restriction, including without limitation the
|
|
437
|
-
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
438
|
-
* sell copies of the Software, and to permit persons to whom the Software is
|
|
439
|
-
* furnished to do so, subject to the following conditions:
|
|
440
|
-
*
|
|
441
|
-
* The above copyright notice and this permission notice shall be included in
|
|
442
|
-
* all copies or substantial portions of the Software.
|
|
443
|
-
*
|
|
444
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
445
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
446
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
447
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
448
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
449
|
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
450
|
-
* IN THE SOFTWARE.
|
|
451
|
-
*
|
|
452
|
-
* omggif is a JavaScript implementation of a GIF 89a encoder and decoder,
|
|
453
|
-
* including animation and compression. It does not rely on any specific
|
|
454
|
-
* underlying system, so should run in the browser, Node, or Plask.
|
|
455
|
-
*/function Qk(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 l=null,u=null;i&&(l=r,u=o,r+=3*o);var c=!0,h=[],p=0,w=null,d=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(!((x=e[r++])>=0))throw Error("Invalid block size");if(x===0)break;r+=x}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,w=e[r++],(1&E)==0&&(w=null),d=E>>2&7,r++;break;case 254:for(;;){if(!((x=e[r++])>=0))throw Error("Invalid block size");if(x===0)break;r+=x}break;default:throw new Error("Unknown graphic control label: 0x"+e[r-1].toString(16))}break;case 44:var S=e[r++]|e[r++]<<8,y=e[r++]|e[r++]<<8,g=e[r++]|e[r++]<<8,v=e[r++]|e[r++]<<8,b=e[r++],O=b>>6&1,j=1<<(7&b)+1,T=l,M=u,F=!1;b>>7&&(F=!0,T=r,M=j,r+=3*j);var C=r;for(r++;;){var x;if(!((x=e[r++])>=0))throw Error("Invalid block size");if(x===0)break;r+=x}h.push({x:S,y,width:g,height:v,has_local_palette:F,palette_offset:T,palette_size:M,data_offset:C,data_length:r-C,transparent_index:w,interlaced:!!O,delay:p,disposal:d});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(L){if(L<0||L>=h.length)throw new Error("Frame index out of range.");return h[L]},this.decodeAndBlitFrameBGRA=function(L,A){var N=this.frameInfo(L),I=N.width*N.height,W=new Uint8Array(I);sw(e,N.data_offset,W,I);var G=N.palette_offset,$=N.transparent_index;$===null&&($=256);var J=N.width,V=t-J,H=J,z=4*(N.y*t+N.x),D=4*((N.y+N.height)*t+N.x),K=z,ne=4*V;N.interlaced===!0&&(ne+=4*t*7);for(var Z=8,ee=0,ae=W.length;ee<ae;++ee){var se=W[ee];if(H===0&&(H=J,(K+=ne)>=D&&(ne=4*V+4*t*(Z-1),K=z+(J+V)*(Z<<1),Z>>=1)),se===$)K+=4;else{var ce=e[G+3*se],me=e[G+3*se+1],xe=e[G+3*se+2];A[K++]=xe,A[K++]=me,A[K++]=ce,A[K++]=255}--H}},this.decodeAndBlitFrameRGBA=function(L,A){var N=this.frameInfo(L),I=N.width*N.height,W=new Uint8Array(I);sw(e,N.data_offset,W,I);var G=N.palette_offset,$=N.transparent_index;$===null&&($=256);var J=N.width,V=t-J,H=J,z=4*(N.y*t+N.x),D=4*((N.y+N.height)*t+N.x),K=z,ne=4*V;N.interlaced===!0&&(ne+=4*t*7);for(var Z=8,ee=0,ae=W.length;ee<ae;++ee){var se=W[ee];if(H===0&&(H=J,(K+=ne)>=D&&(ne=4*V+4*t*(Z-1),K=z+(J+V)*(Z<<1),Z>>=1)),se===$)K+=4;else{var ce=e[G+3*se],me=e[G+3*se+1],xe=e[G+3*se+2];A[K++]=ce,A[K++]=me,A[K++]=xe,A[K++]=255}--H}}}function sw(e,r,t,n){for(var a=e[r++],i=1<<a,o=i+1,l=o+1,u=a+1,c=(1<<u)-1,h=0,p=0,w=0,d=e[r++],_=new Int32Array(4096),E=null;;){for(;h<16&&d!==0;)p|=e[r++]<<h,h+=8,d===1?d=e[r++]:--d;if(h<u)break;var S=p&c;if(p>>=u,h-=u,S!==i){if(S===o)break;for(var y=S<l?S:E,g=0,v=y;v>i;)v=_[v]>>8,++g;var b=v;if(w+g+(y!==S?1:0)>n)return void Gn.log("Warning, gif stream longer than expected.");t[w++]=b;var O=w+=g;for(y!==S&&(t[w++]=b),v=y;g--;)v=_[v],t[--O]=255&v,v>>=8;E!==null&&l<4096&&(_[l++]=E<<8|b,l>=c+1&&u<12&&(++u,c=c<<1|1)),E=S}else l=o+1,c=(1<<(u=a+1))-1,E=null}return w!==n&&Gn.log("Warning, gif stream shorter than expected."),t}/**
|
|
456
|
-
* @license
|
|
457
|
-
Copyright (c) 2008, Adobe Systems Incorporated
|
|
458
|
-
All rights reserved.
|
|
459
|
-
|
|
460
|
-
Redistribution and use in source and binary forms, with or without
|
|
461
|
-
modification, are permitted provided that the following conditions are
|
|
462
|
-
met:
|
|
463
|
-
|
|
464
|
-
* Redistributions of source code must retain the above copyright notice,
|
|
465
|
-
this list of conditions and the following disclaimer.
|
|
466
|
-
|
|
467
|
-
* Redistributions in binary form must reproduce the above copyright
|
|
468
|
-
notice, this list of conditions and the following disclaimer in the
|
|
469
|
-
documentation and/or other materials provided with the distribution.
|
|
470
|
-
|
|
471
|
-
* Neither the name of Adobe Systems Incorporated nor the names of its
|
|
472
|
-
contributors may be used to endorse or promote products derived from
|
|
473
|
-
this software without specific prior written permission.
|
|
474
|
-
|
|
475
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
|
476
|
-
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
477
|
-
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
478
|
-
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
479
|
-
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
480
|
-
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
481
|
-
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
482
|
-
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
483
|
-
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
484
|
-
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
485
|
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
486
|
-
*/function c2(e){var r,t,n,a,i,o=Math.floor,l=new Array(64),u=new Array(64),c=new Array(64),h=new Array(64),p=new Array(65535),w=new Array(65535),d=new Array(64),_=new Array(64),E=[],S=0,y=7,g=new Array(64),v=new Array(64),b=new Array(64),O=new Array(256),j=new Array(2048),T=[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],M=[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],C=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],x=[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],L=[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],N=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],I=[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 W(z,D){for(var K=0,ne=0,Z=new Array,ee=1;ee<=16;ee++){for(var ae=1;ae<=z[ee];ae++)Z[D[ne]]=[],Z[D[ne]][0]=K,Z[D[ne]][1]=ee,ne++,K++;K*=2}return Z}function G(z){for(var D=z[0],K=z[1]-1;K>=0;)D&1<<K&&(S|=1<<y),K--,--y<0&&(S==255?($(255),$(0)):$(S),y=7,S=0)}function $(z){E.push(z)}function J(z){$(z>>8&255),$(255&z)}function V(z,D,K,ne,Z){for(var ee,ae=Z[0],se=Z[240],ce=function(Ae,Ee){var Ne,he,Le,Ce,De,tt,vt,mt,Et,nt,at=0;for(Et=0;Et<8;++Et){Ne=Ae[at],he=Ae[at+1],Le=Ae[at+2],Ce=Ae[at+3],De=Ae[at+4],tt=Ae[at+5],vt=Ae[at+6];var qt=Ne+(mt=Ae[at+7]),Ct=Ne-mt,or=he+vt,Xt=he-vt,qe=Le+tt,We=Le-tt,Nt=Ce+De,ht=Ce-De,gt=qt+Nt,wt=qt-Nt,tr=or+qe,Vt=or-qe;Ae[at]=gt+tr,Ae[at+4]=gt-tr;var _t=.707106781*(Vt+wt);Ae[at+2]=wt+_t,Ae[at+6]=wt-_t;var it=.382683433*((gt=ht+We)-(Vt=Xt+Ct)),Bt=.5411961*gt+it,Ve=1.306562965*Vt+it,Fe=.707106781*(tr=We+Xt),bt=Ct+Fe,Ue=Ct-Fe;Ae[at+5]=Ue+Bt,Ae[at+3]=Ue-Bt,Ae[at+1]=bt+Ve,Ae[at+7]=bt-Ve,at+=8}for(at=0,Et=0;Et<8;++Et){Ne=Ae[at],he=Ae[at+8],Le=Ae[at+16],Ce=Ae[at+24],De=Ae[at+32],tt=Ae[at+40],vt=Ae[at+48];var St=Ne+(mt=Ae[at+56]),kt=Ne-mt,Ft=he+vt,zt=he-vt,Wt=Le+tt,_r=Le-tt,kr=Ce+De,Lr=Ce-De,Nr=St+kr,Wn=St-kr,en=Ft+Wt,Qn=Ft-Wt;Ae[at]=Nr+en,Ae[at+32]=Nr-en;var _i=.707106781*(Qn+Wn);Ae[at+16]=Wn+_i,Ae[at+48]=Wn-_i;var Ni=.382683433*((Nr=Lr+_r)-(Qn=zt+kt)),Si=.5411961*Nr+Ni,fa=1.306562965*Qn+Ni,ws=.707106781*(en=_r+zt),Go=kt+ws,tu=kt-ws;Ae[at+40]=tu+Si,Ae[at+24]=tu-Si,Ae[at+8]=Go+fa,Ae[at+56]=Go-fa,at++}for(Et=0;Et<64;++Et)nt=Ae[Et]*Ee[Et],d[Et]=nt>0?nt+.5|0:nt-.5|0;return d}(z,D),me=0;me<64;++me)_[T[me]]=ce[me];var xe=_[0]-K;K=_[0],xe==0?G(ne[0]):(G(ne[w[ee=32767+xe]]),G(p[ee]));for(var Oe=63;Oe>0&&_[Oe]==0;)Oe--;if(Oe==0)return G(ae),K;for(var Re,Se=1;Se<=Oe;){for(var ve=Se;_[Se]==0&&Se<=Oe;)++Se;var He=Se-ve;if(He>=16){Re=He>>4;for(var we=1;we<=Re;++we)G(se);He&=15}ee=32767+_[Se],G(Z[(He<<4)+w[ee]]),G(p[ee]),Se++}return Oe!=63&&G(ae),K}function H(z){z=Math.min(Math.max(z,1),100),i!=z&&(function(D){for(var K=[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],ne=0;ne<64;ne++){var Z=o((K[ne]*D+50)/100);Z=Math.min(Math.max(Z,1),255),l[T[ne]]=Z}for(var ee=[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((ee[ae]*D+50)/100);se=Math.min(Math.max(se,1),255),u[T[ae]]=se}for(var ce=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],me=0,xe=0;xe<8;xe++)for(var Oe=0;Oe<8;Oe++)c[me]=1/(l[T[me]]*ce[xe]*ce[Oe]*8),h[me]=1/(u[T[me]]*ce[xe]*ce[Oe]*8),me++}(z<50?Math.floor(5e3/z):Math.floor(200-2*z)),i=z)}this.encode=function(z,D){D&&H(D),E=new Array,S=0,y=7,J(65496),J(65504),J(16),$(74),$(70),$(73),$(70),$(0),$(1),$(1),$(0),J(1),J(1),$(0),$(0),function(){J(65499),J(132),$(0);for(var he=0;he<64;he++)$(l[he]);$(1);for(var Le=0;Le<64;Le++)$(u[Le])}(),function(he,Le){J(65472),J(17),$(8),J(Le),J(he),$(3),$(1),$(17),$(0),$(2),$(17),$(1),$(3),$(17),$(1)}(z.width,z.height),function(){J(65476),J(418),$(0);for(var he=0;he<16;he++)$(M[he+1]);for(var Le=0;Le<=11;Le++)$(F[Le]);$(16);for(var Ce=0;Ce<16;Ce++)$(C[Ce+1]);for(var De=0;De<=161;De++)$(x[De]);$(1);for(var tt=0;tt<16;tt++)$(L[tt+1]);for(var vt=0;vt<=11;vt++)$(A[vt]);$(17);for(var mt=0;mt<16;mt++)$(N[mt+1]);for(var Et=0;Et<=161;Et++)$(I[Et])}(),J(65498),J(12),$(3),$(1),$(0),$(2),$(17),$(3),$(17),$(0),$(63),$(0);var K=0,ne=0,Z=0;S=0,y=7,this.encode.displayName="_encode_";for(var ee,ae,se,ce,me,xe,Oe,Re,Se,ve=z.data,He=z.width,we=z.height,Ae=4*He,Ee=0;Ee<we;){for(ee=0;ee<Ae;){for(me=Ae*Ee+ee,Oe=-1,Re=0,Se=0;Se<64;Se++)xe=me+(Re=Se>>3)*Ae+(Oe=4*(7&Se)),Ee+Re>=we&&(xe-=Ae*(Ee+1+Re-we)),ee+Oe>=Ae&&(xe-=ee+Oe-Ae+4),ae=ve[xe++],se=ve[xe++],ce=ve[xe++],g[Se]=(j[ae]+j[se+256>>0]+j[ce+512>>0]>>16)-128,v[Se]=(j[ae+768>>0]+j[se+1024>>0]+j[ce+1280>>0]>>16)-128,b[Se]=(j[ae+1280>>0]+j[se+1536>>0]+j[ce+1792>>0]>>16)-128;K=V(g,c,K,r,n),ne=V(v,h,ne,t,a),Z=V(b,h,Z,t,a),ee+=32}Ee+=8}if(y>=0){var Ne=[];Ne[1]=y+1,Ne[0]=(1<<y+1)-1,G(Ne)}return J(65497),new Uint8Array(E)},e=e||50,function(){for(var z=String.fromCharCode,D=0;D<256;D++)O[D]=z(D)}(),r=W(M,F),t=W(L,A),n=W(C,x),a=W(N,I),function(){for(var z=1,D=2,K=1;K<=15;K++){for(var ne=z;ne<D;ne++)w[32767+ne]=K,p[32767+ne]=[],p[32767+ne][1]=K,p[32767+ne][0]=ne;for(var Z=-(D-1);Z<=-z;Z++)w[32767+Z]=K,p[32767+Z]=[],p[32767+Z][1]=K,p[32767+Z][0]=D-1+Z;z<<=1,D<<=1}}(),function(){for(var z=0;z<256;z++)j[z]=19595*z,j[z+256>>0]=38470*z,j[z+512>>0]=7471*z+32768,j[z+768>>0]=-11059*z,j[z+1024>>0]=-21709*z,j[z+1280>>0]=32768*z+8421375,j[z+1536>>0]=-27439*z,j[z+1792>>0]=-5329*z}(),H(e)}/**
|
|
487
|
-
* @license
|
|
488
|
-
* Copyright (c) 2017 Aras Abbasi
|
|
489
|
-
*
|
|
490
|
-
* Licensed under the MIT License.
|
|
491
|
-
* http://opensource.org/licenses/mit-license
|
|
492
|
-
*/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 lw(e){function r(M){if(!M)throw Error("assert :P")}function t(M,F,C){for(var x=0;4>x;x++)if(M[F+x]!=C.charCodeAt(x))return!0;return!1}function n(M,F,C,x,L){for(var A=0;A<L;A++)M[F+A]=C[x+A]}function a(M,F,C,x){for(var L=0;L<x;L++)M[F+L]=C}function i(M){return new Int32Array(M)}function o(M,F){for(var C=[],x=0;x<M;x++)C.push(new F);return C}function l(M,F){var C=[];return function x(L,A,N){for(var I=N[A],W=0;W<I&&(L.push(N.length>A+1?[]:new F),!(N.length<A+1));W++)x(L[W],A+1,N)}(C,0,M),C}var u=function(){var M=this;function F(R,U){for(var te=1<<U-1>>>0;R&te;)te>>>=1;return te?(R&te-1)+te:R}function C(R,U,te,oe,ue){r(!(oe%te));do R[U+(oe-=te)]=ue;while(0<oe)}function x(R,U,te,oe,ue){if(r(2328>=ue),512>=ue)var de=i(512);else if((de=i(ue))==null)return 0;return function(ge,ye,be,Pe,je,Qe){var Xe,Ye,yt=ye,lt=1<<be,Me=i(16),ze=i(16);for(r(je!=0),r(Pe!=null),r(ge!=null),r(0<be),Ye=0;Ye<je;++Ye){if(15<Pe[Ye])return 0;++Me[Pe[Ye]]}if(Me[0]==je)return 0;for(ze[1]=0,Xe=1;15>Xe;++Xe){if(Me[Xe]>1<<Xe)return 0;ze[Xe+1]=ze[Xe]+Me[Xe]}for(Ye=0;Ye<je;++Ye)Xe=Pe[Ye],0<Pe[Ye]&&(Qe[ze[Xe]++]=Ye);if(ze[15]==1)return(Pe=new L).g=0,Pe.value=Qe[0],C(ge,yt,1,lt,Pe),lt;var Ge,ct=-1,pt=lt-1,Ut=0,jt=1,ir=1,Mt=1<<be;for(Ye=0,Xe=1,je=2;Xe<=be;++Xe,je<<=1){if(jt+=ir<<=1,0>(ir-=Me[Xe]))return 0;for(;0<Me[Xe];--Me[Xe])(Pe=new L).g=Xe,Pe.value=Qe[Ye++],C(ge,yt+Ut,je,Mt,Pe),Ut=F(Ut,Xe)}for(Xe=be+1,je=2;15>=Xe;++Xe,je<<=1){if(jt+=ir<<=1,0>(ir-=Me[Xe]))return 0;for(;0<Me[Xe];--Me[Xe]){if(Pe=new L,(Ut&pt)!=ct){for(yt+=Mt,Ge=1<<(ct=Xe)-be;15>ct&&!(0>=(Ge-=Me[ct]));)++ct,Ge<<=1;lt+=Mt=1<<(Ge=ct-be),ge[ye+(ct=Ut&pt)].g=Ge+be,ge[ye+ct].value=yt-ye-ct}Pe.g=Xe-be,Pe.value=Qe[Ye++],C(ge,yt+(Ut>>be),je,Mt,Pe),Ut=F(Ut,Xe)}}return jt!=2*ze[15]-1?0:lt}(R,U,te,oe,ue,de)}function L(){this.value=this.g=0}function A(){this.value=this.g=0}function N(){this.G=o(5,L),this.H=i(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(rn,A)}function I(R,U,te,oe){r(R!=null),r(U!=null),r(2147483648>oe),R.Ca=254,R.I=0,R.b=-8,R.Ka=0,R.oa=U,R.pa=te,R.Jd=U,R.Yc=te+oe,R.Zc=4<=oe?te+oe-4+1:te,ee(R)}function W(R,U){for(var te=0;0<U--;)te|=se(R,128)<<U;return te}function G(R,U){var te=W(R,U);return ae(R)?-te:te}function $(R,U,te,oe){var ue,de=0;for(r(R!=null),r(U!=null),r(4294967288>oe),R.Sb=oe,R.Ra=0,R.u=0,R.h=0,4<oe&&(oe=4),ue=0;ue<oe;++ue)de+=U[te+ue]<<8*ue;R.Ra=de,R.bb=oe,R.oa=U,R.pa=te}function J(R){for(;8<=R.u&&R.bb<R.Sb;)R.Ra>>>=8,R.Ra+=R.oa[R.pa+R.bb]<<Oa-8>>>0,++R.bb,R.u-=8;K(R)&&(R.h=1,R.u=0)}function V(R,U){if(r(0<=U),!R.h&&U<=wl){var te=D(R)&Js[U];return R.u+=U,J(R),te}return R.h=1,R.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 z(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function D(R){return R.Ra>>>(R.u&Oa-1)>>>0}function K(R){return r(R.bb<=R.Sb),R.h||R.bb==R.Sb&&R.u>Oa}function ne(R,U){R.u=U,R.h=K(R)}function Z(R){R.u>=Va&&(r(R.u>=Va),J(R))}function ee(R){r(R!=null&&R.oa!=null),R.pa<R.Zc?(R.I=(R.oa[R.pa++]|R.I<<8)>>>0,R.b+=8):(r(R!=null&&R.oa!=null),R.pa<R.Yc?(R.b+=8,R.I=R.oa[R.pa++]|R.I<<8):R.Ka?R.b=0:(R.I<<=8,R.b+=8,R.Ka=1))}function ae(R){return W(R,1)}function se(R,U){var te=R.Ca;0>R.b&&ee(R);var oe=R.b,ue=te*U>>>8,de=(R.I>>>oe>ue)+0;for(de?(te-=ue,R.I-=ue+1<<oe>>>0):te=ue+1,oe=te,ue=0;256<=oe;)ue+=8,oe>>=8;return oe=7^ue+xi[oe],R.b-=oe,R.Ca=(te<<oe)-1,de}function ce(R,U,te){R[U+0]=te>>24&255,R[U+1]=te>>16&255,R[U+2]=te>>8&255,R[U+3]=te>>0&255}function me(R,U){return R[U+0]<<0|R[U+1]<<8}function xe(R,U){return me(R,U)|R[U+2]<<16}function Oe(R,U){return me(R,U)|me(R,U+2)<<16}function Re(R,U){var te=1<<U;return r(R!=null),r(0<U),R.X=i(te),R.X==null?0:(R.Mb=32-U,R.Xa=U,1)}function Se(R,U){r(R!=null),r(U!=null),r(R.Xa==U.Xa),n(U.X,0,R.X,0,1<<U.Xa)}function ve(){this.X=[],this.Xa=this.Mb=0}function He(R,U,te,oe){r(te!=null),r(oe!=null);var ue=te[0],de=oe[0];return ue==0&&(ue=(R*de+U/2)/U),de==0&&(de=(U*ue+R/2)/R),0>=ue||0>=de?0:(te[0]=ue,oe[0]=de,1)}function we(R,U){return R+(1<<U)-1>>>U}function Ae(R,U){return((4278255360&R)+(4278255360&U)>>>0&4278255360)+((16711935&R)+(16711935&U)>>>0&16711935)>>>0}function Ee(R,U){M[U]=function(te,oe,ue,de,ge,ye,be){var Pe;for(Pe=0;Pe<ge;++Pe){var je=M[R](ye[be+Pe-1],ue,de+Pe);ye[be+Pe]=Ae(te[oe+Pe],je)}}}function Ne(){this.ud=this.hd=this.jd=0}function he(R,U){return((4278124286&(R^U))>>>1)+(R&U)>>>0}function Le(R){return 0<=R&&256>R?R:0>R?0:255<R?255:void 0}function Ce(R,U){return Le(R+(R-U+.5>>1))}function De(R,U,te){return Math.abs(U-te)-Math.abs(R-te)}function tt(R,U,te,oe,ue,de,ge){for(oe=de[ge-1],te=0;te<ue;++te)de[ge+te]=oe=Ae(R[U+te],oe)}function vt(R,U,te,oe,ue){var de;for(de=0;de<te;++de){var ge=R[U+de],ye=ge>>8&255,be=16711935&(be=(be=16711935&ge)+((ye<<16)+ye));oe[ue+de]=(4278255360&ge)+be>>>0}}function mt(R,U){U.jd=R>>0&255,U.hd=R>>8&255,U.ud=R>>16&255}function Et(R,U,te,oe,ue,de){var ge;for(ge=0;ge<oe;++ge){var ye=U[te+ge],be=ye>>>8,Pe=ye,je=255&(je=(je=ye>>>16)+((R.jd<<24>>24)*(be<<24>>24)>>>5));Pe=255&(Pe=(Pe=Pe+((R.hd<<24>>24)*(be<<24>>24)>>>5))+((R.ud<<24>>24)*(je<<24>>24)>>>5)),ue[de+ge]=(4278255360&ye)+(je<<16)+Pe}}function nt(R,U,te,oe,ue){M[U]=function(de,ge,ye,be,Pe,je,Qe,Xe,Ye){for(be=Qe;be<Xe;++be)for(Qe=0;Qe<Ye;++Qe)Pe[je++]=ue(ye[oe(de[ge++])])},M[R]=function(de,ge,ye,be,Pe,je,Qe){var Xe=8>>de.b,Ye=de.Ea,yt=de.K[0],lt=de.w;if(8>Xe)for(de=(1<<de.b)-1,lt=(1<<Xe)-1;ge<ye;++ge){var Me,ze=0;for(Me=0;Me<Ye;++Me)Me&de||(ze=oe(be[Pe++])),je[Qe++]=ue(yt[ze<]),ze>>=Xe}else M["VP8LMapColor"+te](be,Pe,yt,lt,je,Qe,ge,ye,Ye)}}function at(R,U,te,oe,ue){for(te=U+te;U<te;){var de=R[U++];oe[ue++]=de>>16&255,oe[ue++]=de>>8&255,oe[ue++]=de>>0&255}}function qt(R,U,te,oe,ue){for(te=U+te;U<te;){var de=R[U++];oe[ue++]=de>>16&255,oe[ue++]=de>>8&255,oe[ue++]=de>>0&255,oe[ue++]=de>>24&255}}function Ct(R,U,te,oe,ue){for(te=U+te;U<te;){var de=(ge=R[U++])>>16&240|ge>>12&15,ge=ge>>0&240|ge>>28&15;oe[ue++]=de,oe[ue++]=ge}}function or(R,U,te,oe,ue){for(te=U+te;U<te;){var de=(ge=R[U++])>>16&248|ge>>13&7,ge=ge>>5&224|ge>>3&31;oe[ue++]=de,oe[ue++]=ge}}function Xt(R,U,te,oe,ue){for(te=U+te;U<te;){var de=R[U++];oe[ue++]=de>>0&255,oe[ue++]=de>>8&255,oe[ue++]=de>>16&255}}function qe(R,U,te,oe,ue,de){if(de==0)for(te=U+te;U<te;)ce(oe,((de=R[U++])[0]>>24|de[1]>>8&65280|de[2]<<8&16711680|de[3]<<24)>>>0),ue+=32;else n(oe,ue,R,U,te)}function We(R,U){M[U][0]=M[R+"0"],M[U][1]=M[R+"1"],M[U][2]=M[R+"2"],M[U][3]=M[R+"3"],M[U][4]=M[R+"4"],M[U][5]=M[R+"5"],M[U][6]=M[R+"6"],M[U][7]=M[R+"7"],M[U][8]=M[R+"8"],M[U][9]=M[R+"9"],M[U][10]=M[R+"10"],M[U][11]=M[R+"11"],M[U][12]=M[R+"12"],M[U][13]=M[R+"13"],M[U][14]=M[R+"0"],M[U][15]=M[R+"0"]}function Nt(R){return R==Pl||R==Cs||R==hu||R==du}function ht(){this.eb=[],this.size=this.A=this.fb=0}function gt(){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 wt(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new ht,this.f.kb=new gt,this.sd=null}function tr(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function Vt(){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 _t(R){return alert("todo:WebPSamplerProcessPlane"),R.T}function it(R,U){var te=R.T,oe=U.ba.f.RGBA,ue=oe.eb,de=oe.fb+R.ka*oe.A,ge=pa[U.ba.S],ye=R.y,be=R.O,Pe=R.f,je=R.N,Qe=R.ea,Xe=R.W,Ye=U.cc,yt=U.dc,lt=U.Mc,Me=U.Nc,ze=R.ka,Ge=R.ka+R.T,ct=R.U,pt=ct+1>>1;for(ze==0?ge(ye,be,null,null,Pe,je,Qe,Xe,Pe,je,Qe,Xe,ue,de,null,null,ct):(ge(U.ec,U.fc,ye,be,Ye,yt,lt,Me,Pe,je,Qe,Xe,ue,de-oe.A,ue,de,ct),++te);ze+2<Ge;ze+=2)Ye=Pe,yt=je,lt=Qe,Me=Xe,je+=R.Rc,Xe+=R.Rc,de+=2*oe.A,ge(ye,(be+=2*R.fa)-R.fa,ye,be,Ye,yt,lt,Me,Pe,je,Qe,Xe,ue,de-oe.A,ue,de,ct);return be+=R.fa,R.j+Ge<R.o?(n(U.ec,U.fc,ye,be,ct),n(U.cc,U.dc,Pe,je,pt),n(U.Mc,U.Nc,Qe,Xe,pt),te--):1&Ge||ge(ye,be,null,null,Pe,je,Qe,Xe,Pe,je,Qe,Xe,ue,de+oe.A,null,null,ct),te}function Bt(R,U,te){var oe=R.F,ue=[R.J];if(oe!=null){var de=R.U,ge=U.ba.S,ye=ge==fu||ge==hu;U=U.ba.f.RGBA;var be=[0],Pe=R.ka;be[0]=R.T,R.Kb&&(Pe==0?--be[0]:(--Pe,ue[0]-=R.width),R.j+R.ka+R.T==R.o&&(be[0]=R.o-R.j-Pe));var je=U.eb;Pe=U.fb+Pe*U.A,R=Yr(oe,ue[0],R.width,de,be,je,Pe+(ye?0:3),U.A),r(te==be),R&&Nt(ge)&&Ei(je,Pe,ye,de,be,U.A)}return 0}function Ve(R){var U=R.ma,te=U.ba.S,oe=11>te,ue=te==Fo||te==El||te==fu||te==cn||te==12||Nt(te);if(U.memory=null,U.Ib=null,U.Jb=null,U.Nd=null,!Qs(U.Oa,R,ue?11:12))return 0;if(ue&&Nt(te)&&xt(),R.da)alert("todo:use_scaling");else{if(oe){if(U.Ib=_t,R.Kb){if(te=R.U+1>>1,U.memory=i(R.U+2*te),U.memory==null)return 0;U.ec=U.memory,U.fc=0,U.cc=U.ec,U.dc=U.fc+R.U,U.Mc=U.cc,U.Nc=U.dc+te,U.Ib=it,xt()}}else alert("todo:EmitYUV");ue&&(U.Jb=Bt,oe&&Je())}if(oe&&!Pi){for(R=0;256>R;++R)ia[R]=89858*(R-128)+go>>rs,aa[R]=-22014*(R-128)+go,Al[R]=-45773*(R-128),il[R]=113618*(R-128)+go>>rs;for(R=Zr;R<an;++R)U=76283*(R-16)+go>>rs,mu[R-Zr]=Ea(U,255),cf[R-Zr]=Ea(U+8>>4,15);Pi=1}return 1}function Fe(R){var U=R.ma,te=R.U,oe=R.T;return r(!(1&R.ka)),0>=te||0>=oe?0:(te=U.Ib(R,U),U.Jb!=null&&U.Jb(R,U,te),U.Dc+=te,1)}function bt(R){R.ma.memory=null}function Ue(R,U,te,oe){return V(R,8)!=47?0:(U[0]=V(R,14)+1,te[0]=V(R,14)+1,oe[0]=V(R,1),V(R,3)!=0?0:!R.h)}function St(R,U){if(4>R)return R+1;var te=R-2>>1;return(2+(1&R)<<te)+V(U,te)+1}function kt(R,U){return 120<U?U-120:1<=(te=((te=zf[U-1])>>4)*R+(8-(15&te)))?te:1;var te}function Ft(R,U,te){var oe=D(te),ue=R[U+=255&oe].g-8;return 0<ue&&(ne(te,te.u+8),oe=D(te),U+=R[U].value,U+=oe&(1<<ue)-1),ne(te,te.u+R[U].g),R[U].value}function zt(R,U,te){return te.g+=R.g,te.value+=R.value<<U>>>0,r(8>=te.g),R.g}function Wt(R,U,te){var oe=R.xc;return r((U=oe==0?0:R.vc[R.md*(te>>oe)+(U>>oe)])<R.Wb),R.Ya[U]}function _r(R,U,te,oe){var ue=R.ab,de=R.c*U,ge=R.C;U=ge+U;var ye=te,be=oe;for(oe=R.Ta,te=R.Ua;0<ue--;){var Pe=R.gc[ue],je=ge,Qe=U,Xe=ye,Ye=be,yt=(be=oe,ye=te,Pe.Ea);switch(r(je<Qe),r(Qe<=Pe.nc),Pe.hc){case 2:Hu(Xe,Ye,(Qe-je)*yt,be,ye);break;case 0:var lt=je,Me=Qe,ze=be,Ge=ye,ct=(Mt=Pe).Ea;lt==0&&(el(Xe,Ye,null,null,1,ze,Ge),tt(Xe,Ye+1,0,0,ct-1,ze,Ge+1),Ye+=ct,Ge+=ct,++lt);for(var pt=1<<Mt.b,Ut=pt-1,jt=we(ct,Mt.b),ir=Mt.K,Mt=Mt.w+(lt>>Mt.b)*jt;lt<Me;){var Fr=ir,qr=Mt,Rr=1;for(co(Xe,Ye,ze,Ge-ct,1,ze,Ge);Rr<ct;){var yr=(Rr&~Ut)+pt;yr>ct&&(yr=ct),(0,yi[Fr[qr++]>>8&15])(Xe,Ye+ +Rr,ze,Ge+Rr-ct,yr-Rr,ze,Ge+Rr),Rr=yr}Ye+=ct,Ge+=ct,++lt&Ut||(Mt+=jt)}Qe!=Pe.nc&&n(be,ye-yt,be,ye+(Qe-je-1)*yt,yt);break;case 1:for(yt=Xe,Me=Ye,ct=(Xe=Pe.Ea)-(Ge=Xe&~(ze=(Ye=1<<Pe.b)-1)),lt=we(Xe,Pe.b),pt=Pe.K,Pe=Pe.w+(je>>Pe.b)*lt;je<Qe;){for(Ut=pt,jt=Pe,ir=new Ne,Mt=Me+Ge,Fr=Me+Xe;Me<Mt;)mt(Ut[jt++],ir),Jo(ir,yt,Me,Ye,be,ye),Me+=Ye,ye+=Ye;Me<Fr&&(mt(Ut[jt++],ir),Jo(ir,yt,Me,ct,be,ye),Me+=ct,ye+=ct),++je&ze||(Pe+=lt)}break;case 3:if(Xe==be&&Ye==ye&&0<Pe.b){for(Me=be,Xe=yt=ye+(Qe-je)*yt-(Ge=(Qe-je)*we(Pe.Ea,Pe.b)),Ye=be,ze=ye,lt=[],Ge=(ct=Ge)-1;0<=Ge;--Ge)lt[Ge]=Ye[ze+Ge];for(Ge=ct-1;0<=Ge;--Ge)Me[Xe+Ge]=lt[Ge];mi(Pe,je,Qe,be,yt,be,ye)}else mi(Pe,je,Qe,Xe,Ye,be,ye)}ye=oe,be=te}be!=te&&n(oe,te,ye,be,de)}function kr(R,U){var te=R.V,oe=R.Ba+R.c*R.C,ue=U-R.C;if(r(U<=R.l.o),r(16>=ue),0<ue){var de=R.l,ge=R.Ta,ye=R.Ua,be=de.width;if(_r(R,ue,te,oe),ue=ye=[ye],r((te=R.C)<(oe=U)),r(de.v<de.va),oe>de.o&&(oe=de.o),te<de.j){var Pe=de.j-te;te=de.j,ue[0]+=Pe*be}if(te>=oe?te=0:(ue[0]+=4*de.v,de.ka=te-de.j,de.U=de.va-de.v,de.T=oe-te,te=1),te){if(ye=ye[0],11>(te=R.ca).S){var je=te.f.RGBA,Qe=(oe=te.S,ue=de.U,de=de.T,Pe=je.eb,je.A),Xe=de;for(je=je.fb+R.Ma*je.A;0<Xe--;){var Ye=ge,yt=ye,lt=ue,Me=Pe,ze=je;switch(oe){case xl:li(Ye,yt,lt,Me,ze);break;case Fo:qi(Ye,yt,lt,Me,ze);break;case Pl:qi(Ye,yt,lt,Me,ze),Ei(Me,ze,0,lt,1,0);break;case sf:fo(Ye,yt,lt,Me,ze);break;case El:qe(Ye,yt,lt,Me,ze,1);break;case Cs:qe(Ye,yt,lt,Me,ze,1),Ei(Me,ze,0,lt,1,0);break;case fu:qe(Ye,yt,lt,Me,ze,0);break;case hu:qe(Ye,yt,lt,Me,ze,0),Ei(Me,ze,1,lt,1,0);break;case cn:es(Ye,yt,lt,Me,ze);break;case du:es(Ye,yt,lt,Me,ze),nn(Me,ze,lt,1,0);break;case Vu:$r(Ye,yt,lt,Me,ze);break;default:r(0)}ye+=be,je+=Qe}R.Ma+=de}else alert("todo:EmitRescaledRowsYUVA");r(R.Ma<=te.height)}}R.C=U,r(R.C<=R.i)}function Lr(R){var U;if(0<R.ua)return 0;for(U=0;U<R.Wb;++U){var te=R.Ya[U].G,oe=R.Ya[U].H;if(0<te[1][oe[1]+0].g||0<te[2][oe[2]+0].g||0<te[3][oe[3]+0].g)return 0}return 1}function Nr(R,U,te,oe,ue,de){if(R.Z!=0){var ge=R.qd,ye=R.rd;for(r(Vi[R.Z]!=null);U<te;++U)Vi[R.Z](ge,ye,oe,ue,oe,ue,de),ge=oe,ye=ue,ue+=de;R.qd=ge,R.rd=ye}}function Wn(R,U){var te=R.l.ma,oe=te.Z==0||te.Z==1?R.l.j:R.C;if(oe=R.C<oe?oe:R.C,r(U<=R.l.o),U>oe){var ue=R.l.width,de=te.ca,ge=te.tb+ue*oe,ye=R.V,be=R.Ba+R.c*oe,Pe=R.gc;r(R.ab==1),r(Pe[0].hc==3),As(Pe[0],oe,U,ye,be,de,ge),Nr(te,oe,U,de,ge,ue)}R.C=R.Ma=U}function en(R,U,te,oe,ue,de,ge){var ye=R.$/oe,be=R.$%oe,Pe=R.m,je=R.s,Qe=te+R.$,Xe=Qe;ue=te+oe*ue;var Ye=te+oe*de,yt=280+je.ua,lt=R.Pb?ye:16777216,Me=0<je.ua?je.Wa:null,ze=je.wc,Ge=Qe<Ye?Wt(je,be,ye):null;r(R.C<de),r(Ye<=ue);var ct=!1;e:for(;;){for(;ct||Qe<Ye;){var pt=0;if(ye>=lt){var Ut=Qe-te;r((lt=R).Pb),lt.wd=lt.m,lt.xd=Ut,0<lt.s.ua&&Se(lt.s.Wa,lt.s.vb),lt=ye+Gu}if(be&ze||(Ge=Wt(je,be,ye)),r(Ge!=null),Ge.Qb&&(U[Qe]=Ge.qb,ct=!0),!ct)if(Z(Pe),Ge.jc){pt=Pe,Ut=U;var jt=Qe,ir=Ge.pd[D(pt)&rn-1];r(Ge.jc),256>ir.g?(ne(pt,pt.u+ir.g),Ut[jt]=ir.value,pt=0):(ne(pt,pt.u+ir.g-256),r(256<=ir.value),pt=ir.value),pt==0&&(ct=!0)}else pt=Ft(Ge.G[0],Ge.H[0],Pe);if(Pe.h)break;if(ct||256>pt){if(!ct)if(Ge.nd)U[Qe]=(Ge.qb|pt<<8)>>>0;else{if(Z(Pe),ct=Ft(Ge.G[1],Ge.H[1],Pe),Z(Pe),Ut=Ft(Ge.G[2],Ge.H[2],Pe),jt=Ft(Ge.G[3],Ge.H[3],Pe),Pe.h)break;U[Qe]=(jt<<24|ct<<16|pt<<8|Ut)>>>0}if(ct=!1,++Qe,++be>=oe&&(be=0,++ye,ge!=null&&ye<=de&&!(ye%16)&&ge(R,ye),Me!=null))for(;Xe<Qe;)pt=U[Xe++],Me.X[(506832829*pt&4294967295)>>>Me.Mb]=pt}else if(280>pt){if(pt=St(pt-256,Pe),Ut=Ft(Ge.G[4],Ge.H[4],Pe),Z(Pe),Ut=kt(oe,Ut=St(Ut,Pe)),Pe.h)break;if(Qe-te<Ut||ue-Qe<pt)break e;for(jt=0;jt<pt;++jt)U[Qe+jt]=U[Qe+jt-Ut];for(Qe+=pt,be+=pt;be>=oe;)be-=oe,++ye,ge!=null&&ye<=de&&!(ye%16)&&ge(R,ye);if(r(Qe<=ue),be&ze&&(Ge=Wt(je,be,ye)),Me!=null)for(;Xe<Qe;)pt=U[Xe++],Me.X[(506832829*pt&4294967295)>>>Me.Mb]=pt}else{if(!(pt<yt))break e;for(ct=pt-280,r(Me!=null);Xe<Qe;)pt=U[Xe++],Me.X[(506832829*pt&4294967295)>>>Me.Mb]=pt;pt=Qe,r(!(ct>>>(Ut=Me).Xa)),U[pt]=Ut.X[ct],ct=!0}ct||r(Pe.h==K(Pe))}if(R.Pb&&Pe.h&&Qe<ue)r(R.m.h),R.a=5,R.m=R.wd,R.$=R.xd,0<R.s.ua&&Se(R.s.vb,R.s.Wa);else{if(Pe.h)break e;ge!=null&&ge(R,ye>de?de:ye),R.a=0,R.$=Qe-te}return 1}return R.a=3,0}function Qn(R){r(R!=null),R.vc=null,R.yc=null,R.Ya=null;var U=R.Wa;U!=null&&(U.X=null),R.vb=null,r(R!=null)}function _i(){var R=new za;return R==null?null:(R.a=0,R.xb=gu,We("Predictor","VP8LPredictors"),We("Predictor","VP8LPredictors_C"),We("PredictorAdd","VP8LPredictorsAdd"),We("PredictorAdd","VP8LPredictorsAdd_C"),Hu=vt,Jo=Et,li=at,qi=qt,es=Ct,$r=or,fo=Xt,M.VP8LMapColor32b=Bi,M.VP8LMapColor8b=Co,R)}function Ni(R,U,te,oe,ue){var de=1,ge=[R],ye=[U],be=oe.m,Pe=oe.s,je=null,Qe=0;e:for(;;){if(te)for(;de&&V(be,1);){var Xe=ge,Ye=ye,yt=oe,lt=1,Me=yt.m,ze=yt.gc[yt.ab],Ge=V(Me,2);if(yt.Oc&1<<Ge)de=0;else{switch(yt.Oc|=1<<Ge,ze.hc=Ge,ze.Ea=Xe[0],ze.nc=Ye[0],ze.K=[null],++yt.ab,r(4>=yt.ab),Ge){case 0:case 1:ze.b=V(Me,3)+2,lt=Ni(we(ze.Ea,ze.b),we(ze.nc,ze.b),0,yt,ze.K),ze.K=ze.K[0];break;case 3:var ct,pt=V(Me,8)+1,Ut=16<pt?0:4<pt?1:2<pt?2:3;if(Xe[0]=we(ze.Ea,Ut),ze.b=Ut,ct=lt=Ni(pt,1,0,yt,ze.K)){var jt,ir=pt,Mt=ze,Fr=1<<(8>>Mt.b),qr=i(Fr);if(qr==null)ct=0;else{var Rr=Mt.K[0],yr=Mt.w;for(qr[0]=Mt.K[0][0],jt=1;jt<1*ir;++jt)qr[jt]=Ae(Rr[yr+jt],qr[jt-1]);for(;jt<4*Fr;++jt)qr[jt]=0;Mt.K[0]=null,Mt.K[0]=qr,ct=1}}lt=ct;break;case 2:break;default:r(0)}de=lt}}if(ge=ge[0],ye=ye[0],de&&V(be,1)&&!(de=1<=(Qe=V(be,4))&&11>=Qe)){oe.a=3;break e}var Xr;if(Xr=de)t:{var Qr,Zt,zr,Ln=oe,Dn=ge,ci=ye,xr=Qe,Gi=te,En=Ln.m,Bn=Ln.s,fi=[null],Oi=1,ga=0,Ya=lf[xr];r:for(;;){if(Gi&&V(En,1)){var yn=V(En,3)+2,qn=we(Dn,yn),oa=we(ci,yn),Do=qn*oa;if(!Ni(qn,oa,0,Ln,fi))break r;for(fi=fi[0],Bn.xc=yn,Qr=0;Qr<Do;++Qr){var vo=fi[Qr]>>8&65535;fi[Qr]=vo,vo>=Oi&&(Oi=vo+1)}}if(En.h)break r;for(Zt=0;5>Zt;++Zt){var Dr=nl[Zt];!Zt&&0<xr&&(Dr+=1<<xr),ga<Dr&&(ga=Dr)}var mo=o(Oi*Ya,L),yu=Oi,Xu=o(yu,N);if(Xu==null)var Xa=null;else r(65536>=yu),Xa=Xu;var Aa=i(ga);if(Xa==null||Aa==null||mo==null){Ln.a=1;break r}var kl=mo;for(Qr=zr=0;Qr<Oi;++Qr){var va=Xa[Qr],Bo=va.G,vn=va.H,vr=0,Jr=1,Pn=0;for(Zt=0;5>Zt;++Zt){Dr=nl[Zt],Bo[Zt]=kl,vn[Zt]=zr,!Zt&&0<xr&&(Dr+=1<<xr);i:{var Nn,ti=Dr,qo=Ln,fn=Aa,bu=kl,Ns=zr,hn=0,Ka=qo.m,Ll=V(Ka,1);if(a(fn,0,0,ti),Ll){var sa=V(Ka,1)+1,wu=V(Ka,1),_u=V(Ka,wu==0?1:8);fn[_u]=1,sa==2&&(fn[_u=V(Ka,8)]=1);var Ai=1}else{var on=i(19),zn=V(Ka,4)+4;if(19<zn){qo.a=3;var Un=0;break i}for(Nn=0;Nn<zn;++Nn)on[Bh[Nn]]=V(Ka,3);var Za=void 0,yo=void 0,Qa=qo,Sc=on,Hn=ti,Su=fn,al=0,Ja=Qa.m,bn=8,hi=o(128,L);n:for(;x(hi,0,7,Sc,19);){if(V(Ja,1)){var la=2+2*V(Ja,3);if((Za=2+V(Ja,la))>Hn)break n}else Za=Hn;for(yo=0;yo<Hn&&Za--;){Z(Ja);var Wi=hi[0+(127&D(Ja))];ne(Ja,Ja.u+Wi.g);var Ts=Wi.value;if(16>Ts)Su[yo++]=Ts,Ts!=0&&(bn=Ts);else{var xc=Ts==16,Ku=Ts-16,$f=yc[Ku],os=V(Ja,pu[Ku])+$f;if(yo+os>Hn)break n;for(var ff=xc?bn:0;0<os--;)Su[yo++]=ff}}al=1;break n}al||(Qa.a=3),Ai=al}(Ai=Ai&&!Ka.h)&&(hn=x(bu,Ns,8,fn,ti)),Ai&&hn!=0?Un=hn:(qo.a=3,Un=0)}if(Un==0)break r;if(Jr&&qf[Zt]==1&&(Jr=kl[zr].g==0),vr+=kl[zr].g,zr+=Un,3>=Zt){var Nl,xu=Aa[0];for(Nl=1;Nl<Dr;++Nl)Aa[Nl]>xu&&(xu=Aa[Nl]);Pn+=xu}}if(va.nd=Jr,va.Qb=0,Jr&&(va.qb=(Bo[3][vn[3]+0].value<<24|Bo[1][vn[1]+0].value<<16|Bo[2][vn[2]+0].value)>>>0,vr==0&&256>Bo[0][vn[0]+0].value&&(va.Qb=1,va.qb+=Bo[0][vn[0]+0].value<<8)),va.jc=!va.Qb&&6>Pn,va.jc){var zo,Ca=va;for(zo=0;zo<rn;++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>>=zt(ls,8,eo),ss>>=zt(Ca.G[1][Ca.H[1]+ss],16,eo),ss>>=zt(Ca.G[2][Ca.H[2]+ss],0,eo),zt(Ca.G[3][Ca.H[3]+ss],24,eo))}}}Bn.vc=fi,Bn.Wb=Oi,Bn.Ya=Xa,Bn.yc=mo,Xr=1;break t}Xr=0}if(!(de=Xr)){oe.a=3;break e}if(0<Qe){if(Pe.ua=1<<Qe,!Re(Pe.Wa,Qe)){oe.a=1,de=0;break e}}else Pe.ua=0;var Ec=oe,Pc=ge,hf=ye,Zu=Ec.s,us=Zu.xc;if(Ec.c=Pc,Ec.i=hf,Zu.md=we(Pc,us),Zu.wc=us==0?-1:(1<<us)-1,te){oe.xb=po;break e}if((je=i(ge*ye))==null){oe.a=1,de=0;break e}de=(de=en(oe,je,0,ge,ye,ye,null))&&!be.h;break e}return de?(ue!=null?ue[0]=je:(r(je==null),r(te)),oe.$=0,te||Qn(Pe)):Qn(Pe),de}function Si(R,U){var te=R.c*R.i,oe=te+U+16*U;return r(R.c<=U),R.V=i(oe),R.V==null?(R.Ta=null,R.Ua=0,R.a=1,0):(R.Ta=R.V,R.Ua=R.Ba+te+U,1)}function fa(R,U){var te=R.C,oe=U-te,ue=R.V,de=R.Ba+R.c*te;for(r(U<=R.l.o);0<oe;){var ge=16<oe?16:oe,ye=R.l.ma,be=R.l.width,Pe=be*ge,je=ye.ca,Qe=ye.tb+be*te,Xe=R.Ta,Ye=R.Ua;_r(R,ge,ue,de),Fn(Xe,Ye,je,Qe,Pe),Nr(ye,te,te+ge,je,Qe,be),oe-=ge,ue+=ge*R.c,te+=ge}r(te==U),R.C=R.Ma=U}function ws(){this.ub=this.yd=this.td=this.Rb=0}function Go(){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 vc(){this.Yb=function(){var R=[];return function U(te,oe,ue){for(var de=ue[oe],ge=0;ge<de&&(te.push(ue.length>oe+1?[]:0),!(ue.length<oe+1));ge++)U(te[ge],oe+1,ue)}(R,0,[3,11]),R}()}function Mn(){this.jb=i(3),this.Wc=l([4,8],vc),this.Xc=l([4,17],vc)}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 Hs(){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 Kr}function so(){this.y=i(16),this.f=i(8),this.ea=i(8)}function pi(){this.cb=this.a=0,this.sc="",this.m=new H,this.Od=new ws,this.Kc=new Go,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,Hs),this.Pa=new Mn,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=l([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 Kr(){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 Ar(){var R=new pi;return R!=null&&(R.a=0,R.sc="OK",R.cb=0,R.Xb=0,Ol||(Ol=Ia)),R}function ln(R,U,te){return R.a==0&&(R.a=U,R.sc=te,R.cb=0),0}function gi(R,U,te){return 3<=te&&R[U+0]==157&&R[U+1]==1&&R[U+2]==42}function Ti(R,U){if(R==null)return 0;if(R.a=0,R.sc="OK",U==null)return ln(R,2,"null VP8Io passed to VP8GetHeaders()");var te=U.data,oe=U.w,ue=U.ha;if(4>ue)return ln(R,7,"Truncated header.");var de=te[oe+0]|te[oe+1]<<8|te[oe+2]<<16,ge=R.Od;if(ge.Rb=!(1&de),ge.td=de>>1&7,ge.yd=de>>4&1,ge.ub=de>>5,3<ge.td)return ln(R,3,"Incorrect keyframe parameters.");if(!ge.yd)return ln(R,4,"Frame not displayable.");oe+=3,ue-=3;var ye=R.Kc;if(ge.Rb){if(7>ue)return ln(R,7,"cannot parse picture header");if(!gi(te,oe,ue))return ln(R,3,"Bad code word");ye.c=16383&(te[oe+4]<<8|te[oe+3]),ye.Td=te[oe+4]>>6,ye.i=16383&(te[oe+6]<<8|te[oe+5]),ye.Ud=te[oe+6]>>6,oe+=7,ue-=7,R.za=ye.c+15>>4,R.Ub=ye.i+15>>4,U.width=ye.c,U.height=ye.i,U.Da=0,U.j=0,U.v=0,U.va=U.width,U.o=U.height,U.da=0,U.ib=U.width,U.hb=U.height,U.U=U.width,U.T=U.height,a((de=R.Pa).jb,0,255,de.jb.length),r((de=R.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 ln(R,7,"bad partition length");I(de=R.m,te,oe,ge.ub),oe+=ge.ub,ue-=ge.ub,ge.Rb&&(ye.Ld=ae(de),ye.Kd=ae(de)),ye=R.Qa;var be,Pe=R.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),be=0;4>be;++be)ye.Zb[be]=ae(de)?G(de,7):0;for(be=0;4>be;++be)ye.Lb[be]=ae(de)?G(de,6):0}if(ye.Bb)for(be=0;3>be;++be)Pe.jb[be]=ae(de)?W(de,8):255}else ye.Bb=0;if(de.Ka)return ln(R,3,"cannot parse segment header");if((ye=R.ed).zd=ae(de),ye.Tb=W(de,6),ye.wb=W(de,3),ye.Pc=ae(de),ye.Pc&&ae(de)){for(Pe=0;4>Pe;++Pe)ae(de)&&(ye.vd[Pe]=G(de,6));for(Pe=0;4>Pe;++Pe)ae(de)&&(ye.od[Pe]=G(de,6))}if(R.L=ye.Tb==0?0:ye.zd?1:2,de.Ka)return ln(R,3,"cannot parse filter header");var je=ue;if(ue=be=oe,oe=be+je,ye=je,R.Xb=(1<<W(R.m,2))-1,je<3*(Pe=R.Xb))te=7;else{for(be+=3*Pe,ye-=3*Pe,je=0;je<Pe;++je){var Qe=te[ue+0]|te[ue+1]<<8|te[ue+2]<<16;Qe>ye&&(Qe=ye),I(R.Jc[+je],te,be,Qe),be+=Qe,ye-=Qe,ue+=3}I(R.Jc[+Pe],te,be,ye),te=be<oe?0:5}if(te!=0)return ln(R,te,"cannot parse partitions");for(te=W(be=R.m,7),ue=ae(be)?G(be,4):0,oe=ae(be)?G(be,4):0,ye=ae(be)?G(be,4):0,Pe=ae(be)?G(be,4):0,be=ae(be)?G(be,4):0,je=R.Qa,Qe=0;4>Qe;++Qe){if(je.Cb){var Xe=je.Zb[Qe];je.Fb||(Xe+=te)}else{if(0<Qe){R.pb[Qe]=R.pb[0];continue}Xe=te}var Ye=R.pb[Qe];Ye.Sc[0]=ks[Ea(Xe+ue,127)],Ye.Sc[1]=Wu[Ea(Xe+0,127)],Ye.Eb[0]=2*ks[Ea(Xe+oe,127)],Ye.Eb[1]=101581*Wu[Ea(Xe+ye,127)]>>16,8>Ye.Eb[1]&&(Ye.Eb[1]=8),Ye.Qc[0]=ks[Ea(Xe+Pe,117)],Ye.Qc[1]=Wu[Ea(Xe+be,127)],Ye.lc=Xe+be}if(!ge.Rb)return ln(R,4,"Not a key frame.");for(ae(de),ge=R.Pa,te=0;4>te;++te){for(ue=0;8>ue;++ue)for(oe=0;3>oe;++oe)for(ye=0;11>ye;++ye)Pe=se(de,Hf[te][ue][oe][ye])?W(de,8):$u[te][ue][oe][ye],ge.Wc[te][ue].Yb[oe][ye]=Pe;for(ue=0;17>ue;++ue)ge.Xc[te][ue]=ge.Wc[te][wc[ue]]}return R.kc=ae(de),R.kc&&(R.Bd=W(de,8)),R.cb=1}function Ia(R,U,te,oe,ue,de,ge){var ye=U[ue].Yb[te];for(te=0;16>ue;++ue){if(!se(R,ye[te+0]))return ue;for(;!se(R,ye[te+1]);)if(ye=U[++ue].Yb[0],te=0,ue==16)return 16;var be=U[ue+1].Yb;if(se(R,ye[te+2])){var Pe=R,je=0;if(se(Pe,(Xe=ye)[(Qe=te)+3]))if(se(Pe,Xe[Qe+6])){for(ye=0,Qe=2*(je=se(Pe,Xe[Qe+8]))+(Xe=se(Pe,Xe[Qe+9+je])),je=0,Xe=uf[Qe];Xe[ye];++ye)je+=je+se(Pe,Xe[ye]);je+=3+(8<<Qe)}else se(Pe,Xe[Qe+7])?(je=7+2*se(Pe,165),je+=se(Pe,145)):je=5+se(Pe,159);else je=se(Pe,Xe[Qe+4])?3+se(Pe,Xe[Qe+5]):2;ye=be[2]}else je=1,ye=be[1];be=ge+$a[ue],0>(Pe=R).b&&ee(Pe);var Qe,Xe=Pe.b,Ye=(Qe=Pe.Ca>>1)-(Pe.I>>Xe)>>31;--Pe.b,Pe.Ca+=Ye,Pe.Ca|=1,Pe.I-=(Qe+1&Ye)<<Xe,de[be]=((je^Ye)-Ye)*oe[(0<ue)+0]}return 16}function ja(R){var U=R.rb[R.sb-1];U.la=0,U.Na=0,a(R.zc,0,0,R.zc.length),R.ja=0}function ii(R,U){if(R==null)return 0;if(U==null)return ln(R,2,"NULL VP8Io parameter in VP8Decode().");if(!R.cb&&!Ti(R,U))return 0;if(r(R.cb),U.ac==null||U.ac(U)){U.ob&&(R.L=0);var te=is[R.L];if(R.L==2?(R.yb=0,R.zb=0):(R.yb=U.v-te>>4,R.zb=U.j-te>>4,0>R.yb&&(R.yb=0),0>R.zb&&(R.zb=0)),R.Va=U.o+15+te>>4,R.Hb=U.va+15+te>>4,R.Hb>R.za&&(R.Hb=R.za),R.Va>R.Ub&&(R.Va=R.Ub),0<R.L){var oe=R.ed;for(te=0;4>te;++te){var ue;if(R.Qa.Cb){var de=R.Qa.Lb[te];R.Qa.Fb||(de+=oe.Tb)}else de=oe.Tb;for(ue=0;1>=ue;++ue){var ge=R.gd[te][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 be=ye;0<oe.wb&&(be=4<oe.wb?be>>2:be>>1)>9-oe.wb&&(be=9-oe.wb),1>be&&(be=1),ge.dd=be,ge.tc=2*ye+be,ge.ld=40<=ye?2:15<=ye?1:0}else ge.tc=0;ge.La=ue}}}te=0}else ln(R,6,"Frame setup failed"),te=R.a;if(te=te==0){if(te){R.$c=0,0<R.Aa||(R.Ic=as);e:{te=R.Ic,oe=4*(be=R.za);var Pe=32*be,je=be+1,Qe=0<R.L?be*(0<R.Aa?2:1):0,Xe=(R.Aa==2?2:1)*be;if((ge=oe+832+(ue=3*(16*te+is[R.L])/2*Pe)+(de=R.Fa!=null&&0<R.Fa.length?R.Kc.c*R.Kc.i:0))!=ge)te=0;else{if(ge>R.Vb){if(R.Vb=0,R.Ec=i(ge),R.Fc=0,R.Ec==null){te=ln(R,1,"no memory during frame initialization.");break e}R.Vb=ge}ge=R.Ec,ye=R.Fc,R.Ac=ge,R.Bc=ye,ye+=oe,R.Gd=o(Pe,so),R.Hd=0,R.rb=o(je+1,dl),R.sb=1,R.wa=Qe?o(Qe,oo):null,R.Y=0,R.D.Nb=0,R.D.wa=R.wa,R.D.Y=R.Y,0<R.Aa&&(R.D.Y+=be),r(!0),R.oc=ge,R.pc=ye,ye+=832,R.ya=o(Xe,qu),R.aa=0,R.D.ya=R.ya,R.D.aa=R.aa,R.Aa==2&&(R.D.aa+=be),R.R=16*be,R.B=8*be,be=(Pe=is[R.L])*R.R,Pe=Pe/2*R.B,R.sa=ge,R.ta=ye+be,R.qa=R.sa,R.ra=R.ta+16*te*R.R+Pe,R.Ha=R.qa,R.Ia=R.ra+8*te*R.B+Pe,R.$c=0,ye+=ue,R.mb=de?ge:null,R.nb=de?ye:null,r(ye+de<=R.Fc+R.Vb),ja(R),a(R.Ac,R.Bc,0,oe),te=1}}if(te){if(U.ka=0,U.y=R.sa,U.O=R.ta,U.f=R.qa,U.N=R.ra,U.ea=R.Ha,U.Vd=R.Ia,U.fa=R.R,U.Rc=R.B,U.F=null,U.J=0,!cu){for(te=-255;255>=te;++te)ei[255+te]=0>te?-te:te;for(te=-1020;1020>=te;++te)Io[1020+te]=-128>te?-128:127<te?127:te;for(te=-112;112>=te;++te)_l[112+te]=-16>te?-16:15<te?15:te;for(te=-255;510>=te;++te)rl[255+te]=0>te?0:255<te?255:te;cu=1}tl=Ir,ko=da,Lo=Vs,Yn=af,Tr=iu,jr=nu,xn=Fi,Xn=_n,ts=qa,No=lu,To=ea,Ga=ta,kn=Os,ho=Ks,Ro=oi,Mo=Ii,zi=ji,un=vl,Hi[0]=Oo,Hi[1]=Gs,Hi[2]=$s,Hi[3]=lo,Hi[4]=zu,Hi[5]=In,Hi[6]=Ys,Hi[7]=Xs,Hi[8]=ou,Hi[9]=au,Ui[0]=Es,Ui[1]=mc,Ui[2]=$o,Ui[3]=Ss,Ui[4]=gn,Ui[5]=Yo,Ui[6]=Fa,na[0]=Da,na[1]=Ws,na[2]=of,na[3]=uo,na[4]=Mi,na[5]=su,na[6]=Ba,te=1}else te=0}te&&(te=function(Ye,yt){for(Ye.M=0;Ye.M<Ye.Va;++Ye.M){var lt,Me=Ye.Jc[Ye.M&Ye.Xb],ze=Ye.m,Ge=Ye;for(lt=0;lt<Ge.za;++lt){var ct=ze,pt=Ge,Ut=pt.Ac,jt=pt.Bc+4*lt,ir=pt.zc,Mt=pt.ya[pt.aa+lt];if(pt.Qa.Bb?Mt.$b=se(ct,pt.Pa.jb[0])?2+se(ct,pt.Pa.jb[2]):se(ct,pt.Pa.jb[1]):Mt.$b=0,pt.kc&&(Mt.Ad=se(ct,pt.Bd)),Mt.Za=!se(ct,145)+0,Mt.Za){var Fr=Mt.Ob,qr=0;for(pt=0;4>pt;++pt){var Rr,yr=ir[0+pt];for(Rr=0;4>Rr;++Rr){yr=Uf[Ut[jt+Rr]][yr];for(var Xr=bc[se(ct,yr[0])];0<Xr;)Xr=bc[2*Xr+se(ct,yr[Xr])];yr=-Xr,Ut[jt+Rr]=yr}n(Fr,qr,Ut,jt,4),qr+=4,ir[0+pt]=yr}}else yr=se(ct,156)?se(ct,128)?1:3:se(ct,163)?2:0,Mt.Ob[0]=yr,a(Ut,jt,yr,4),a(ir,0,yr,4);Mt.Dd=se(ct,142)?se(ct,114)?se(ct,183)?1:3:2:0}if(Ge.m.Ka)return ln(Ye,7,"Premature end-of-partition0 encountered.");for(;Ye.ja<Ye.za;++Ye.ja){if(Ge=Me,ct=(ze=Ye).rb[ze.sb-1],Ut=ze.rb[ze.sb+ze.ja],lt=ze.ya[ze.aa+ze.ja],jt=ze.kc?lt.Ad:0)ct.la=Ut.la=0,lt.Za||(ct.Na=Ut.Na=0),lt.Hc=0,lt.Gc=0,lt.ia=0;else{var Qr,Zt;if(ct=Ut,Ut=Ge,jt=ze.Pa.Xc,ir=ze.ya[ze.aa+ze.ja],Mt=ze.pb[ir.$b],pt=ir.ad,Fr=0,qr=ze.rb[ze.sb-1],yr=Rr=0,a(pt,Fr,0,384),ir.Za)var zr=0,Ln=jt[3];else{Xr=i(16);var Dn=ct.Na+qr.Na;if(Dn=Ol(Ut,jt[1],Dn,Mt.Eb,0,Xr,0),ct.Na=qr.Na=(0<Dn)+0,1<Dn)tl(Xr,0,pt,Fr);else{var ci=Xr[0]+3>>3;for(Xr=0;256>Xr;Xr+=16)pt[Fr+Xr]=ci}zr=1,Ln=jt[0]}var xr=15&ct.la,Gi=15&qr.la;for(Xr=0;4>Xr;++Xr){var En=1&Gi;for(ci=Zt=0;4>ci;++ci)xr=xr>>1|(En=(Dn=Ol(Ut,Ln,Dn=En+(1&xr),Mt.Sc,zr,pt,Fr))>zr)<<7,Zt=Zt<<2|(3<Dn?3:1<Dn?2:pt[Fr+0]!=0),Fr+=16;xr>>=4,Gi=Gi>>1|En<<7,Rr=(Rr<<8|Zt)>>>0}for(Ln=xr,zr=Gi>>4,Qr=0;4>Qr;Qr+=2){for(Zt=0,xr=ct.la>>4+Qr,Gi=qr.la>>4+Qr,Xr=0;2>Xr;++Xr){for(En=1&Gi,ci=0;2>ci;++ci)Dn=En+(1&xr),xr=xr>>1|(En=0<(Dn=Ol(Ut,jt[2],Dn,Mt.Qc,0,pt,Fr)))<<3,Zt=Zt<<2|(3<Dn?3:1<Dn?2:pt[Fr+0]!=0),Fr+=16;xr>>=2,Gi=Gi>>1|En<<5}yr|=Zt<<4*Qr,Ln|=xr<<4<<Qr,zr|=(240&Gi)<<Qr}ct.la=Ln,qr.la=zr,ir.Hc=Rr,ir.Gc=yr,ir.ia=43690&yr?0:Mt.ia,jt=!(Rr|yr)}if(0<ze.L&&(ze.wa[ze.Y+ze.ja]=ze.gd[lt.$b][lt.Za],ze.wa[ze.Y+ze.ja].La|=!jt),Ge.Ka)return ln(Ye,7,"Premature end-of-file encountered.")}if(ja(Ye),ze=yt,Ge=1,lt=(Me=Ye).D,ct=0<Me.L&&Me.M>=Me.zb&&Me.M<=Me.Va,Me.Aa==0)e:{if(lt.M=Me.M,lt.uc=ct,Di(Me,lt),Ge=1,lt=(Zt=Me.D).Nb,ct=(yr=is[Me.L])*Me.R,Ut=yr/2*Me.B,Xr=16*lt*Me.R,ci=8*lt*Me.B,jt=Me.sa,ir=Me.ta-ct+Xr,Mt=Me.qa,pt=Me.ra-Ut+ci,Fr=Me.Ha,qr=Me.Ia-Ut+ci,Gi=(xr=Zt.M)==0,Rr=xr>=Me.Va-1,Me.Aa==2&&Di(Me,Zt),Zt.uc)for(En=(Dn=Me).D.M,r(Dn.D.uc),Zt=Dn.yb;Zt<Dn.Hb;++Zt){zr=Zt,Ln=En;var Bn=(fi=(Dr=Dn).D).Nb;Qr=Dr.R;var fi=fi.wa[fi.Y+zr],Oi=Dr.sa,ga=Dr.ta+16*Bn*Qr+16*zr,Ya=fi.dd,yn=fi.tc;if(yn!=0)if(r(3<=yn),Dr.L==1)0<zr&&Mo(Oi,ga,Qr,yn+4),fi.La&&un(Oi,ga,Qr,yn),0<Ln&&Ro(Oi,ga,Qr,yn+4),fi.La&&zi(Oi,ga,Qr,yn);else{var qn=Dr.B,oa=Dr.qa,Do=Dr.ra+8*Bn*qn+8*zr,vo=Dr.Ha,Dr=Dr.Ia+8*Bn*qn+8*zr;Bn=fi.ld,0<zr&&(Xn(Oi,ga,Qr,yn+4,Ya,Bn),No(oa,Do,vo,Dr,qn,yn+4,Ya,Bn)),fi.La&&(Ga(Oi,ga,Qr,yn,Ya,Bn),ho(oa,Do,vo,Dr,qn,yn,Ya,Bn)),0<Ln&&(xn(Oi,ga,Qr,yn+4,Ya,Bn),ts(oa,Do,vo,Dr,qn,yn+4,Ya,Bn)),fi.La&&(To(Oi,ga,Qr,yn,Ya,Bn),kn(oa,Do,vo,Dr,qn,yn,Ya,Bn))}}if(Me.ia&&alert("todo:DitherRow"),ze.put!=null){if(Zt=16*xr,xr=16*(xr+1),Gi?(ze.y=Me.sa,ze.O=Me.ta+Xr,ze.f=Me.qa,ze.N=Me.ra+ci,ze.ea=Me.Ha,ze.W=Me.Ia+ci):(Zt-=yr,ze.y=jt,ze.O=ir,ze.f=Mt,ze.N=pt,ze.ea=Fr,ze.W=qr),Rr||(xr-=yr),xr>ze.o&&(xr=ze.o),ze.F=null,ze.J=null,Me.Fa!=null&&0<Me.Fa.length&&Zt<xr&&(ze.J=uu(Me,ze,Zt,xr-Zt),ze.F=Me.mb,ze.F==null&&ze.F.length==0)){Ge=ln(Me,3,"Could not decode alpha data.");break e}Zt<ze.j&&(yr=ze.j-Zt,Zt=ze.j,r(!(1&yr)),ze.O+=Me.R*yr,ze.N+=Me.B*(yr>>1),ze.W+=Me.B*(yr>>1),ze.F!=null&&(ze.J+=ze.width*yr)),Zt<xr&&(ze.O+=ze.v,ze.N+=ze.v>>1,ze.W+=ze.v>>1,ze.F!=null&&(ze.J+=ze.v),ze.ka=Zt-ze.j,ze.U=ze.va-ze.v,ze.T=xr-Zt,Ge=ze.put(ze))}lt+1!=Me.Ic||Rr||(n(Me.sa,Me.ta-ct,jt,ir+16*Me.R,ct),n(Me.qa,Me.ra-Ut,Mt,pt+8*Me.B,Ut),n(Me.Ha,Me.Ia-Ut,Fr,qr+8*Me.B,Ut))}if(!Ge)return ln(Ye,6,"Output aborted.")}return 1}(R,U)),U.bc!=null&&U.bc(U),te&=1}return te?(R.cb=0,te):0}function Ri(R,U,te,oe,ue){ue=R[U+te+32*oe]+(ue>>3),R[U+te+32*oe]=-256&ue?0>ue?0:255:ue}function pl(R,U,te,oe,ue,de){Ri(R,U,0,te,oe+ue),Ri(R,U,1,te,oe+de),Ri(R,U,2,te,oe-de),Ri(R,U,3,te,oe-ue)}function ha(R){return(20091*R>>16)+R}function Wo(R,U,te,oe){var ue,de=0,ge=i(16);for(ue=0;4>ue;++ue){var ye=R[U+0]+R[U+8],be=R[U+0]-R[U+8],Pe=(35468*R[U+4]>>16)-ha(R[U+12]),je=ha(R[U+4])+(35468*R[U+12]>>16);ge[de+0]=ye+je,ge[de+1]=be+Pe,ge[de+2]=be-Pe,ge[de+3]=ye-je,de+=4,U++}for(ue=de=0;4>ue;++ue)ye=(R=ge[de+0]+4)+ge[de+8],be=R-ge[de+8],Pe=(35468*ge[de+4]>>16)-ha(ge[de+12]),Ri(te,oe,0,0,ye+(je=ha(ge[de+4])+(35468*ge[de+12]>>16))),Ri(te,oe,1,0,be+Pe),Ri(te,oe,2,0,be-Pe),Ri(te,oe,3,0,ye-je),de++,oe+=32}function nu(R,U,te,oe){var ue=R[U+0]+4,de=35468*R[U+4]>>16,ge=ha(R[U+4]),ye=35468*R[U+1]>>16;pl(te,oe,0,ue+ge,R=ha(R[U+1]),ye),pl(te,oe,1,ue+de,R,ye),pl(te,oe,2,ue-de,R,ye),pl(te,oe,3,ue-ge,R,ye)}function da(R,U,te,oe,ue){Wo(R,U,te,oe),ue&&Wo(R,U+16,te,oe+4)}function Vs(R,U,te,oe){ko(R,U+0,te,oe,1),ko(R,U+32,te,oe+128,1)}function af(R,U,te,oe){var ue;for(R=R[U+0]+4,ue=0;4>ue;++ue)for(U=0;4>U;++U)Ri(te,oe,U,ue,R)}function iu(R,U,te,oe){R[U+0]&&Yn(R,U+0,te,oe),R[U+16]&&Yn(R,U+16,te,oe+4),R[U+32]&&Yn(R,U+32,te,oe+128),R[U+48]&&Yn(R,U+48,te,oe+128+4)}function Ir(R,U,te,oe){var ue,de=i(16);for(ue=0;4>ue;++ue){var ge=R[U+0+ue]+R[U+12+ue],ye=R[U+4+ue]+R[U+8+ue],be=R[U+4+ue]-R[U+8+ue],Pe=R[U+0+ue]-R[U+12+ue];de[0+ue]=ge+ye,de[8+ue]=ge-ye,de[4+ue]=Pe+be,de[12+ue]=Pe-be}for(ue=0;4>ue;++ue)ge=(R=de[0+4*ue]+3)+de[3+4*ue],ye=de[1+4*ue]+de[2+4*ue],be=de[1+4*ue]-de[2+4*ue],Pe=R-de[3+4*ue],te[oe+0]=ge+ye>>3,te[oe+16]=Pe+be>>3,te[oe+32]=ge-ye>>3,te[oe+48]=Pe-be>>3,oe+=64}function _s(R,U,te){var oe,ue=U-32,de=bi,ge=255-R[ue-1];for(oe=0;oe<te;++oe){var ye,be=de,Pe=ge+R[U-1];for(ye=0;ye<te;++ye)R[U+ye]=be[Pe+R[ue+ye]];U+=32}}function Gs(R,U){_s(R,U,4)}function Ws(R,U){_s(R,U,8)}function mc(R,U){_s(R,U,16)}function $o(R,U){var te;for(te=0;16>te;++te)n(R,U+32*te,R,U-32,16)}function Ss(R,U){var te;for(te=16;0<te;--te)a(R,U,R[U-1],16),U+=32}function xs(R,U,te){var oe;for(oe=0;16>oe;++oe)a(U,te+32*oe,R,16)}function Es(R,U){var te,oe=16;for(te=0;16>te;++te)oe+=R[U-1+32*te]+R[U+te-32];xs(oe>>5,R,U)}function gn(R,U){var te,oe=8;for(te=0;16>te;++te)oe+=R[U-1+32*te];xs(oe>>4,R,U)}function Yo(R,U){var te,oe=8;for(te=0;16>te;++te)oe+=R[U+te-32];xs(oe>>4,R,U)}function Fa(R,U){xs(128,R,U)}function It(R,U,te){return R+2*U+te+2>>2}function $s(R,U){var te,oe=U-32;for(oe=new Uint8Array([It(R[oe-1],R[oe+0],R[oe+1]),It(R[oe+0],R[oe+1],R[oe+2]),It(R[oe+1],R[oe+2],R[oe+3]),It(R[oe+2],R[oe+3],R[oe+4])]),te=0;4>te;++te)n(R,U+32*te,oe,0,oe.length)}function lo(R,U){var te=R[U-1],oe=R[U-1+32],ue=R[U-1+64],de=R[U-1+96];ce(R,U+0,16843009*It(R[U-1-32],te,oe)),ce(R,U+32,16843009*It(te,oe,ue)),ce(R,U+64,16843009*It(oe,ue,de)),ce(R,U+96,16843009*It(ue,de,de))}function Oo(R,U){var te,oe=4;for(te=0;4>te;++te)oe+=R[U+te-32]+R[U-1+32*te];for(oe>>=3,te=0;4>te;++te)a(R,U+32*te,oe,4)}function zu(R,U){var te=R[U-1+0],oe=R[U-1+32],ue=R[U-1+64],de=R[U-1-32],ge=R[U+0-32],ye=R[U+1-32],be=R[U+2-32],Pe=R[U+3-32];R[U+0+96]=It(oe,ue,R[U-1+96]),R[U+1+96]=R[U+0+64]=It(te,oe,ue),R[U+2+96]=R[U+1+64]=R[U+0+32]=It(de,te,oe),R[U+3+96]=R[U+2+64]=R[U+1+32]=R[U+0+0]=It(ge,de,te),R[U+3+64]=R[U+2+32]=R[U+1+0]=It(ye,ge,de),R[U+3+32]=R[U+2+0]=It(be,ye,ge),R[U+3+0]=It(Pe,be,ye)}function Ys(R,U){var te=R[U+1-32],oe=R[U+2-32],ue=R[U+3-32],de=R[U+4-32],ge=R[U+5-32],ye=R[U+6-32],be=R[U+7-32];R[U+0+0]=It(R[U+0-32],te,oe),R[U+1+0]=R[U+0+32]=It(te,oe,ue),R[U+2+0]=R[U+1+32]=R[U+0+64]=It(oe,ue,de),R[U+3+0]=R[U+2+32]=R[U+1+64]=R[U+0+96]=It(ue,de,ge),R[U+3+32]=R[U+2+64]=R[U+1+96]=It(de,ge,ye),R[U+3+64]=R[U+2+96]=It(ge,ye,be),R[U+3+96]=It(ye,be,be)}function In(R,U){var te=R[U-1+0],oe=R[U-1+32],ue=R[U-1+64],de=R[U-1-32],ge=R[U+0-32],ye=R[U+1-32],be=R[U+2-32],Pe=R[U+3-32];R[U+0+0]=R[U+1+64]=de+ge+1>>1,R[U+1+0]=R[U+2+64]=ge+ye+1>>1,R[U+2+0]=R[U+3+64]=ye+be+1>>1,R[U+3+0]=be+Pe+1>>1,R[U+0+96]=It(ue,oe,te),R[U+0+64]=It(oe,te,de),R[U+0+32]=R[U+1+96]=It(te,de,ge),R[U+1+32]=R[U+2+96]=It(de,ge,ye),R[U+2+32]=R[U+3+96]=It(ge,ye,be),R[U+3+32]=It(ye,be,Pe)}function Xs(R,U){var te=R[U+0-32],oe=R[U+1-32],ue=R[U+2-32],de=R[U+3-32],ge=R[U+4-32],ye=R[U+5-32],be=R[U+6-32],Pe=R[U+7-32];R[U+0+0]=te+oe+1>>1,R[U+1+0]=R[U+0+64]=oe+ue+1>>1,R[U+2+0]=R[U+1+64]=ue+de+1>>1,R[U+3+0]=R[U+2+64]=de+ge+1>>1,R[U+0+32]=It(te,oe,ue),R[U+1+32]=R[U+0+96]=It(oe,ue,de),R[U+2+32]=R[U+1+96]=It(ue,de,ge),R[U+3+32]=R[U+2+96]=It(de,ge,ye),R[U+3+64]=It(ge,ye,be),R[U+3+96]=It(ye,be,Pe)}function au(R,U){var te=R[U-1+0],oe=R[U-1+32],ue=R[U-1+64],de=R[U-1+96];R[U+0+0]=te+oe+1>>1,R[U+2+0]=R[U+0+32]=oe+ue+1>>1,R[U+2+32]=R[U+0+64]=ue+de+1>>1,R[U+1+0]=It(te,oe,ue),R[U+3+0]=R[U+1+32]=It(oe,ue,de),R[U+3+32]=R[U+1+64]=It(ue,de,de),R[U+3+64]=R[U+2+64]=R[U+0+96]=R[U+1+96]=R[U+2+96]=R[U+3+96]=de}function ou(R,U){var te=R[U-1+0],oe=R[U-1+32],ue=R[U-1+64],de=R[U-1+96],ge=R[U-1-32],ye=R[U+0-32],be=R[U+1-32],Pe=R[U+2-32];R[U+0+0]=R[U+2+32]=te+ge+1>>1,R[U+0+32]=R[U+2+64]=oe+te+1>>1,R[U+0+64]=R[U+2+96]=ue+oe+1>>1,R[U+0+96]=de+ue+1>>1,R[U+3+0]=It(ye,be,Pe),R[U+2+0]=It(ge,ye,be),R[U+1+0]=R[U+3+32]=It(te,ge,ye),R[U+1+32]=R[U+3+64]=It(oe,te,ge),R[U+1+64]=R[U+3+96]=It(ue,oe,te),R[U+1+96]=It(de,ue,oe)}function of(R,U){var te;for(te=0;8>te;++te)n(R,U+32*te,R,U-32,8)}function uo(R,U){var te;for(te=0;8>te;++te)a(R,U,R[U-1],8),U+=32}function ai(R,U,te){var oe;for(oe=0;8>oe;++oe)a(U,te+32*oe,R,8)}function Da(R,U){var te,oe=8;for(te=0;8>te;++te)oe+=R[U+te-32]+R[U-1+32*te];ai(oe>>4,R,U)}function su(R,U){var te,oe=4;for(te=0;8>te;++te)oe+=R[U+te-32];ai(oe>>3,R,U)}function Mi(R,U){var te,oe=4;for(te=0;8>te;++te)oe+=R[U-1+32*te];ai(oe>>3,R,U)}function Ba(R,U){ai(128,R,U)}function Ao(R,U,te){var oe=R[U-te],ue=R[U+0],de=3*(ue-oe)+jo[1020+R[U-2*te]-R[U+te]],ge=Sl[112+(de+4>>3)];R[U-te]=bi[255+oe+Sl[112+(de+3>>3)]],R[U+0]=bi[255+ue-ge]}function Ps(R,U,te,oe){var ue=R[U+0],de=R[U+te];return Wa[255+R[U-2*te]-R[U-te]]>oe||Wa[255+de-ue]>oe}function gl(R,U,te,oe){return 4*Wa[255+R[U-te]-R[U+0]]+Wa[255+R[U-2*te]-R[U+te]]<=oe}function Uu(R,U,te,oe,ue){var de=R[U-3*te],ge=R[U-2*te],ye=R[U-te],be=R[U+0],Pe=R[U+te],je=R[U+2*te],Qe=R[U+3*te];return 4*Wa[255+ye-be]+Wa[255+ge-Pe]>oe?0:Wa[255+R[U-4*te]-de]<=ue&&Wa[255+de-ge]<=ue&&Wa[255+ge-ye]<=ue&&Wa[255+Qe-je]<=ue&&Wa[255+je-Pe]<=ue&&Wa[255+Pe-be]<=ue}function oi(R,U,te,oe){var ue=2*oe+1;for(oe=0;16>oe;++oe)gl(R,U+oe,te,ue)&&Ao(R,U+oe,te)}function Ii(R,U,te,oe){var ue=2*oe+1;for(oe=0;16>oe;++oe)gl(R,U+oe*te,1,ue)&&Ao(R,U+oe*te,1)}function ji(R,U,te,oe){var ue;for(ue=3;0<ue;--ue)oi(R,U+=4*te,te,oe)}function vl(R,U,te,oe){var ue;for(ue=3;0<ue;--ue)Ii(R,U+=4,te,oe)}function xa(R,U,te,oe,ue,de,ge,ye){for(de=2*de+1;0<ue--;){if(Uu(R,U,te,de,ge))if(Ps(R,U,te,ye))Ao(R,U,te);else{var be=R,Pe=U,je=te,Qe=be[Pe-2*je],Xe=be[Pe-je],Ye=be[Pe+0],yt=be[Pe+je],lt=be[Pe+2*je],Me=27*(Ge=jo[1020+3*(Ye-Xe)+jo[1020+Qe-yt]])+63>>7,ze=18*Ge+63>>7,Ge=9*Ge+63>>7;be[Pe-3*je]=bi[255+be[Pe-3*je]+Ge],be[Pe-2*je]=bi[255+Qe+ze],be[Pe-je]=bi[255+Xe+Me],be[Pe+0]=bi[255+Ye-Me],be[Pe+je]=bi[255+yt-ze],be[Pe+2*je]=bi[255+lt-Ge]}U+=oe}}function wn(R,U,te,oe,ue,de,ge,ye){for(de=2*de+1;0<ue--;){if(Uu(R,U,te,de,ge))if(Ps(R,U,te,ye))Ao(R,U,te);else{var be=R,Pe=U,je=te,Qe=be[Pe-je],Xe=be[Pe+0],Ye=be[Pe+je],yt=Sl[112+((lt=3*(Xe-Qe))+4>>3)],lt=Sl[112+(lt+3>>3)],Me=yt+1>>1;be[Pe-2*je]=bi[255+be[Pe-2*je]+Me],be[Pe-je]=bi[255+Qe+lt],be[Pe+0]=bi[255+Xe-yt],be[Pe+je]=bi[255+Ye-Me]}U+=oe}}function Fi(R,U,te,oe,ue,de){xa(R,U,te,1,16,oe,ue,de)}function _n(R,U,te,oe,ue,de){xa(R,U,1,te,16,oe,ue,de)}function ea(R,U,te,oe,ue,de){var ge;for(ge=3;0<ge;--ge)wn(R,U+=4*te,te,1,16,oe,ue,de)}function ta(R,U,te,oe,ue,de){var ge;for(ge=3;0<ge;--ge)wn(R,U+=4,1,te,16,oe,ue,de)}function qa(R,U,te,oe,ue,de,ge,ye){xa(R,U,ue,1,8,de,ge,ye),xa(te,oe,ue,1,8,de,ge,ye)}function lu(R,U,te,oe,ue,de,ge,ye){xa(R,U,1,ue,8,de,ge,ye),xa(te,oe,1,ue,8,de,ge,ye)}function Os(R,U,te,oe,ue,de,ge,ye){wn(R,U+4*ue,ue,1,8,de,ge,ye),wn(te,oe+4*ue,ue,1,8,de,ge,ye)}function Ks(R,U,te,oe,ue,de,ge,ye){wn(R,U+4,1,ue,8,de,ge,ye),wn(te,oe+4,1,ue,8,de,ge,ye)}function $n(){this.ba=new wt,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new Vt,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function vi(){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 tn(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Zs(){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 N,this.yc=new L}function za(){this.xb=this.a=0,this.l=new Kr,this.ca=new wt,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new z,this.Pb=0,this.wd=new z,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Zs,this.ab=0,this.gc=o(4,tn),this.Oc=0}function ml(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Kr,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Xo(R,U,te,oe,ue,de,ge){for(R=R==null?0:R[U+0],U=0;U<ge;++U)ue[de+U]=R+te[oe+U]&255,R=ue[de+U]}function yl(R,U,te,oe,ue,de,ge){var ye;if(R==null)Xo(null,null,te,oe,ue,de,ge);else for(ye=0;ye<ge;++ye)ue[de+ye]=R[U+ye]+te[oe+ye]&255}function Ko(R,U,te,oe,ue,de,ge){if(R==null)Xo(null,null,te,oe,ue,de,ge);else{var ye,be=R[U+0],Pe=be,je=be;for(ye=0;ye<ge;++ye)Pe=je+(be=R[U+ye])-Pe,je=te[oe+ye]+(-256&Pe?0>Pe?0:255:Pe)&255,Pe=be,ue[de+ye]=je}}function uu(R,U,te,oe){var ue=U.width,de=U.o;if(r(R!=null&&U!=null),0>te||0>=oe||te+oe>de)return null;if(!R.Cc){if(R.ga==null){var ge;if(R.ga=new ml,(ge=R.ga==null)||(ge=U.width*U.o,r(R.Gb.length==0),R.Gb=i(ge),R.Uc=0,R.Gb==null?ge=0:(R.mb=R.Gb,R.nb=R.Uc,R.rc=null,ge=1),ge=!ge),!ge){ge=R.ga;var ye=R.Fa,be=R.P,Pe=R.qc,je=R.mb,Qe=R.nb,Xe=be+1,Ye=Pe-1,yt=ge.l;if(r(ye!=null&&je!=null&&U!=null),Vi[0]=null,Vi[1]=Xo,Vi[2]=yl,Vi[3]=Ko,ge.ca=je,ge.tb=Qe,ge.c=U.width,ge.i=U.height,r(0<ge.c&&0<ge.i),1>=Pe)U=0;else if(ge.$a=ye[be+0]>>0&3,ge.Z=ye[be+0]>>2&3,ge.Lc=ye[be+0]>>4&3,be=ye[be+0]>>6&3,0>ge.$a||1<ge.$a||4<=ge.Z||1<ge.Lc||be)U=0;else if(yt.put=Fe,yt.ac=Ve,yt.bc=bt,yt.ma=ge,yt.width=U.width,yt.height=U.height,yt.Da=U.Da,yt.v=U.v,yt.va=U.va,yt.j=U.j,yt.o=U.o,ge.$a)e:{r(ge.$a==1),U=_i();t:for(;;){if(U==null){U=0;break e}if(r(ge!=null),ge.mc=U,U.c=ge.c,U.i=ge.i,U.l=ge.l,U.l.ma=ge,U.l.width=ge.c,U.l.height=ge.i,U.a=0,$(U.m,ye,Xe,Ye),!Ni(ge.c,ge.i,1,U,null)||(U.ab==1&&U.gc[0].hc==3&&Lr(U.s)?(ge.ic=1,ye=U.c*U.i,U.Ta=null,U.Ua=0,U.V=i(ye),U.Ba=0,U.V==null?(U.a=1,U=0):U=1):(ge.ic=0,U=Si(U,ge.c)),!U))break t;U=1;break e}ge.mc=null,U=0}else U=Ye>=ge.c*ge.i;ge=!U}if(ge)return null;R.ga.Lc!=1?R.Ga=0:oe=de-te}r(R.ga!=null),r(te+oe<=de);e:{if(U=(ye=R.ga).c,de=ye.l.o,ye.$a==0){if(Xe=R.rc,Ye=R.Vc,yt=R.Fa,be=R.P+1+te*U,Pe=R.mb,je=R.nb+te*U,r(be<=R.P+R.qc),ye.Z!=0)for(r(Vi[ye.Z]!=null),ge=0;ge<oe;++ge)Vi[ye.Z](Xe,Ye,yt,be,Pe,je,U),Xe=Pe,Ye=je,je+=U,be+=U;else for(ge=0;ge<oe;++ge)n(Pe,je,yt,be,U),Xe=Pe,Ye=je,je+=U,be+=U;R.rc=Xe,R.Vc=Ye}else{if(r(ye.mc!=null),U=te+oe,r((ge=ye.mc)!=null),r(U<=ge.i),ge.C>=U)U=1;else if(ye.ic||Je(),ye.ic){ye=ge.V,Xe=ge.Ba,Ye=ge.c;var lt=ge.i,Me=(yt=1,be=ge.$/Ye,Pe=ge.$%Ye,je=ge.m,Qe=ge.s,ge.$),ze=Ye*lt,Ge=Ye*U,ct=Qe.wc,pt=Me<Ge?Wt(Qe,Pe,be):null;r(Me<=ze),r(U<=lt),r(Lr(Qe));t:for(;;){for(;!je.h&&Me<Ge;){if(Pe&ct||(pt=Wt(Qe,Pe,be)),r(pt!=null),Z(je),256>(lt=Ft(pt.G[0],pt.H[0],je)))ye[Xe+Me]=lt,++Me,++Pe>=Ye&&(Pe=0,++be<=U&&!(be%16)&&Wn(ge,be));else{if(!(280>lt)){yt=0;break t}lt=St(lt-256,je);var Ut,jt=Ft(pt.G[4],pt.H[4],je);if(Z(je),!(Me>=(jt=kt(Ye,jt=St(jt,je)))&&ze-Me>=lt)){yt=0;break t}for(Ut=0;Ut<lt;++Ut)ye[Xe+Me+Ut]=ye[Xe+Me+Ut-jt];for(Me+=lt,Pe+=lt;Pe>=Ye;)Pe-=Ye,++be<=U&&!(be%16)&&Wn(ge,be);Me<Ge&&Pe&ct&&(pt=Wt(Qe,Pe,be))}r(je.h==K(je))}Wn(ge,be>U?U:be);break t}!yt||je.h&&Me<ze?(yt=0,ge.a=je.h?5:3):ge.$=Me,U=yt}else U=en(ge,ge.V,ge.Ba,ge.c,ge.i,U,fa);if(!U){oe=0;break e}}te+oe>=de&&(R.Cc=1),oe=1}if(!oe)return null;if(R.Cc&&((oe=R.ga)!=null&&(oe.mc=null),R.ga=null,0<R.Ga))return alert("todo:WebPDequantizeLevels"),null}return R.nb+te*ue}function Y(R,U,te,oe,ue,de){for(;0<ue--;){var ge,ye=R,be=U+(te?1:0),Pe=R,je=U+(te?0:3);for(ge=0;ge<oe;++ge){var Qe=Pe[je+4*ge];Qe!=255&&(Qe*=32897,ye[be+4*ge+0]=ye[be+4*ge+0]*Qe>>23,ye[be+4*ge+1]=ye[be+4*ge+1]*Qe>>23,ye[be+4*ge+2]=ye[be+4*ge+2]*Qe>>23)}U+=de}}function fe(R,U,te,oe,ue){for(;0<oe--;){var de;for(de=0;de<te;++de){var ge=R[U+2*de+0],ye=15&(Pe=R[U+2*de+1]),be=4369*ye,Pe=(240&Pe|Pe>>4)*be>>16;R[U+2*de+0]=(240&ge|ge>>4)*be>>16&240|(15&ge|ge<<4)*be>>16>>4&15,R[U+2*de+1]=240&Pe|ye}U+=ue}}function ke(R,U,te,oe,ue,de,ge,ye){var be,Pe,je=255;for(Pe=0;Pe<ue;++Pe){for(be=0;be<oe;++be){var Qe=R[U+be];de[ge+4*be]=Qe,je&=Qe}U+=te,ge+=ye}return je!=255}function Ie(R,U,te,oe,ue){var de;for(de=0;de<ue;++de)te[oe+de]=R[U+de]>>8}function Je(){Ei=Y,nn=fe,Yr=ke,Fn=Ie}function ft(R,U,te){M[R]=function(oe,ue,de,ge,ye,be,Pe,je,Qe,Xe,Ye,yt,lt,Me,ze,Ge,ct){var pt,Ut=ct-1>>1,jt=ye[be+0]|Pe[je+0]<<16,ir=Qe[Xe+0]|Ye[yt+0]<<16;r(oe!=null);var Mt=3*jt+ir+131074>>2;for(U(oe[ue+0],255&Mt,Mt>>16,lt,Me),de!=null&&(Mt=3*ir+jt+131074>>2,U(de[ge+0],255&Mt,Mt>>16,ze,Ge)),pt=1;pt<=Ut;++pt){var Fr=ye[be+pt]|Pe[je+pt]<<16,qr=Qe[Xe+pt]|Ye[yt+pt]<<16,Rr=jt+Fr+ir+qr+524296,yr=Rr+2*(Fr+ir)>>3;Mt=yr+jt>>1,jt=(Rr=Rr+2*(jt+qr)>>3)+Fr>>1,U(oe[ue+2*pt-1],255&Mt,Mt>>16,lt,Me+(2*pt-1)*te),U(oe[ue+2*pt-0],255&jt,jt>>16,lt,Me+(2*pt-0)*te),de!=null&&(Mt=Rr+ir>>1,jt=yr+qr>>1,U(de[ge+2*pt-1],255&Mt,Mt>>16,ze,Ge+(2*pt-1)*te),U(de[ge+2*pt+0],255&jt,jt>>16,ze,Ge+(2*pt+0)*te)),jt=Fr,ir=qr}1&ct||(Mt=3*jt+ir+131074>>2,U(oe[ue+ct-1],255&Mt,Mt>>16,lt,Me+(ct-1)*te),de!=null&&(Mt=3*ir+jt+131074>>2,U(de[ge+ct-1],255&Mt,Mt>>16,ze,Ge+(ct-1)*te)))}}function xt(){pa[xl]=Vf,pa[Fo]=Ls,pa[sf]=Gf,pa[El]=vu,pa[fu]=ui,pa[cn]=wi,pa[Vu]=_c,pa[Pl]=Ls,pa[Cs]=vu,pa[hu]=ui,pa[du]=wi}function Dt(R){return R&-16384?0>R?0:255:R>>ns}function nr(R,U){return Dt((19077*R>>8)+(26149*U>>8)-14234)}function gr(R,U,te){return Dt((19077*R>>8)-(6419*U>>8)-(13320*te>>8)+8708)}function dr(R,U){return Dt((19077*R>>8)+(33050*U>>8)-17685)}function Sr(R,U,te,oe,ue){oe[ue+0]=nr(R,te),oe[ue+1]=gr(R,U,te),oe[ue+2]=dr(R,U)}function Cn(R,U,te,oe,ue){oe[ue+0]=dr(R,U),oe[ue+1]=gr(R,U,te),oe[ue+2]=nr(R,te)}function Sn(R,U,te,oe,ue){var de=gr(R,U,te);U=de<<3&224|dr(R,U)>>3,oe[ue+0]=248&nr(R,te)|de>>5,oe[ue+1]=U}function jn(R,U,te,oe,ue){var de=240&dr(R,U)|15;oe[ue+0]=240&nr(R,te)|gr(R,U,te)>>4,oe[ue+1]=de}function Jn(R,U,te,oe,ue){oe[ue+0]=255,Sr(R,U,te,oe,ue+1)}function si(R,U,te,oe,ue){Cn(R,U,te,oe,ue),oe[ue+3]=255}function Ua(R,U,te,oe,ue){Sr(R,U,te,oe,ue),oe[ue+3]=255}function Ea(R,U){return 0>R?0:R>U?U:R}function Pa(R,U,te){M[R]=function(oe,ue,de,ge,ye,be,Pe,je,Qe){for(var Xe=je+(-2&Qe)*te;je!=Xe;)U(oe[ue+0],de[ge+0],ye[be+0],Pe,je),U(oe[ue+1],de[ge+0],ye[be+0],Pe,je+te),ue+=2,++ge,++be,je+=2*te;1&Qe&&U(oe[ue+0],de[ge+0],ye[be+0],Pe,je)}}function Zo(R,U,te){return te==0?R==0?U==0?6:5:U==0?4:0:te}function Qo(R,U,te,oe,ue){switch(R>>>30){case 3:ko(U,te,oe,ue,0);break;case 2:jr(U,te,oe,ue);break;case 1:Yn(U,te,oe,ue)}}function Di(R,U){var te,oe,ue=U.M,de=U.Nb,ge=R.oc,ye=R.pc+40,be=R.oc,Pe=R.pc+584,je=R.oc,Qe=R.pc+600;for(te=0;16>te;++te)ge[ye+32*te-1]=129;for(te=0;8>te;++te)be[Pe+32*te-1]=129,je[Qe+32*te-1]=129;for(0<ue?ge[ye-1-32]=be[Pe-1-32]=je[Qe-1-32]=129:(a(ge,ye-32-1,127,21),a(be,Pe-32-1,127,9),a(je,Qe-32-1,127,9)),oe=0;oe<R.za;++oe){var Xe=U.ya[U.aa+oe];if(0<oe){for(te=-1;16>te;++te)n(ge,ye+32*te-4,ge,ye+32*te+12,4);for(te=-1;8>te;++te)n(be,Pe+32*te-4,be,Pe+32*te+4,4),n(je,Qe+32*te-4,je,Qe+32*te+4,4)}var Ye=R.Gd,yt=R.Hd+oe,lt=Xe.ad,Me=Xe.Hc;if(0<ue&&(n(ge,ye-32,Ye[yt].y,0,16),n(be,Pe-32,Ye[yt].f,0,8),n(je,Qe-32,Ye[yt].ea,0,8)),Xe.Za){var ze=ge,Ge=ye-32+16;for(0<ue&&(oe>=R.za-1?a(ze,Ge,Ye[yt].y[15],4):n(ze,Ge,Ye[yt+1].y,0,4)),te=0;4>te;te++)ze[Ge+128+te]=ze[Ge+256+te]=ze[Ge+384+te]=ze[Ge+0+te];for(te=0;16>te;++te,Me<<=2)ze=ge,Ge=ye+Yu[te],Hi[Xe.Ob[te]](ze,Ge),Qo(Me,lt,16*+te,ze,Ge)}else if(ze=Zo(oe,ue,Xe.Ob[0]),Ui[ze](ge,ye),Me!=0)for(te=0;16>te;++te,Me<<=2)Qo(Me,lt,16*+te,ge,ye+Yu[te]);for(te=Xe.Gc,ze=Zo(oe,ue,Xe.Dd),na[ze](be,Pe),na[ze](je,Qe),Me=lt,ze=be,Ge=Pe,255&(Xe=te>>0)&&(170&Xe?Lo(Me,256,ze,Ge):Tr(Me,256,ze,Ge)),Xe=je,Me=Qe,255&(te>>=8)&&(170&te?Lo(lt,320,Xe,Me):Tr(lt,320,Xe,Me)),ue<R.Ub-1&&(n(Ye[yt].y,0,ge,ye+480,16),n(Ye[yt].f,0,be,Pe+224,8),n(Ye[yt].ea,0,je,Qe+224,8)),te=8*de*R.B,Ye=R.sa,yt=R.ta+16*oe+16*de*R.R,lt=R.qa,Xe=R.ra+8*oe+te,Me=R.Ha,ze=R.Ia+8*oe+te,te=0;16>te;++te)n(Ye,yt+te*R.R,ge,ye+32*te,16);for(te=0;8>te;++te)n(lt,Xe+te*R.B,be,Pe+32*te,8),n(Me,ze+te*R.B,je,Qe+32*te,8)}}function Ha(R,U,te,oe,ue,de,ge,ye,be){var Pe=[0],je=[0],Qe=0,Xe=be!=null?be.kd:0,Ye=be??new vi;if(R==null||12>te)return 7;Ye.data=R,Ye.w=U,Ye.ha=te,U=[U],te=[te],Ye.gb=[Ye.gb];e:{var yt=U,lt=te,Me=Ye.gb;if(r(R!=null),r(lt!=null),r(Me!=null),Me[0]=0,12<=lt[0]&&!t(R,yt[0],"RIFF")){if(t(R,yt[0]+8,"WEBP")){Me=3;break e}var ze=Oe(R,yt[0]+4);if(12>ze||4294967286<ze){Me=3;break e}if(Xe&&ze>lt[0]-8){Me=7;break e}Me[0]=ze,yt[0]+=12,lt[0]-=12}Me=0}if(Me!=0)return Me;for(ze=0<Ye.gb[0],te=te[0];;){e:{var Ge=R;lt=U,Me=te;var ct=Pe,pt=je,Ut=yt=[0];if((Mt=Qe=[Qe])[0]=0,8>Me[0])Me=7;else{if(!t(Ge,lt[0],"VP8X")){if(Oe(Ge,lt[0]+4)!=10){Me=3;break e}if(18>Me[0]){Me=7;break e}var jt=Oe(Ge,lt[0]+8),ir=1+xe(Ge,lt[0]+12);if(2147483648<=ir*(Ge=1+xe(Ge,lt[0]+15))){Me=3;break e}Ut!=null&&(Ut[0]=jt),ct!=null&&(ct[0]=ir),pt!=null&&(pt[0]=Ge),lt[0]+=18,Me[0]-=18,Mt[0]=1}Me=0}}if(Qe=Qe[0],yt=yt[0],Me!=0)return Me;if(lt=!!(2&yt),!ze&&Qe)return 3;if(de!=null&&(de[0]=!!(16&yt)),ge!=null&&(ge[0]=lt),ye!=null&&(ye[0]=0),ge=Pe[0],yt=je[0],Qe&<&&be==null){Me=0;break}if(4>te){Me=7;break}if(ze&&Qe||!ze&&!Qe&&!t(R,U[0],"ALPH")){te=[te],Ye.na=[Ye.na],Ye.P=[Ye.P],Ye.Sa=[Ye.Sa];e:{jt=R,Me=U,ze=te;var Mt=Ye.gb;ct=Ye.na,pt=Ye.P,Ut=Ye.Sa,ir=22,r(jt!=null),r(ze!=null),Ge=Me[0];var Fr=ze[0];for(r(ct!=null),r(Ut!=null),ct[0]=null,pt[0]=null,Ut[0]=0;;){if(Me[0]=Ge,ze[0]=Fr,8>Fr){Me=7;break e}var qr=Oe(jt,Ge+4);if(4294967286<qr){Me=3;break e}var Rr=8+qr+1&-2;if(ir+=Rr,0<Mt&&ir>Mt){Me=3;break e}if(!t(jt,Ge,"VP8 ")||!t(jt,Ge,"VP8L")){Me=0;break e}if(Fr[0]<Rr){Me=7;break e}t(jt,Ge,"ALPH")||(ct[0]=jt,pt[0]=Ge+8,Ut[0]=qr),Ge+=Rr,Fr-=Rr}}if(te=te[0],Ye.na=Ye.na[0],Ye.P=Ye.P[0],Ye.Sa=Ye.Sa[0],Me!=0)break}te=[te],Ye.Ja=[Ye.Ja],Ye.xa=[Ye.xa];e:if(Mt=R,Me=U,ze=te,ct=Ye.gb[0],pt=Ye.Ja,Ut=Ye.xa,jt=Me[0],Ge=!t(Mt,jt,"VP8 "),ir=!t(Mt,jt,"VP8L"),r(Mt!=null),r(ze!=null),r(pt!=null),r(Ut!=null),8>ze[0])Me=7;else{if(Ge||ir){if(Mt=Oe(Mt,jt+4),12<=ct&&Mt>ct-12){Me=3;break e}if(Xe&&Mt>ze[0]-8){Me=7;break e}pt[0]=Mt,Me[0]+=8,ze[0]-=8,Ut[0]=ir}else Ut[0]=5<=ze[0]&&Mt[jt+0]==47&&!(Mt[jt+4]>>5),pt[0]=ze[0];Me=0}if(te=te[0],Ye.Ja=Ye.Ja[0],Ye.xa=Ye.xa[0],U=U[0],Me!=0)break;if(4294967286<Ye.Ja)return 3;if(ye==null||lt||(ye[0]=Ye.xa?2:1),ge=[ge],yt=[yt],Ye.xa){if(5>te){Me=7;break}ye=ge,Xe=yt,lt=de,R==null||5>te?R=0:5<=te&&R[U+0]==47&&!(R[U+4]>>5)?(ze=[0],Mt=[0],ct=[0],$(pt=new z,R,U,te),Ue(pt,ze,Mt,ct)?(ye!=null&&(ye[0]=ze[0]),Xe!=null&&(Xe[0]=Mt[0]),lt!=null&&(lt[0]=ct[0]),R=1):R=0):R=0}else{if(10>te){Me=7;break}ye=yt,R==null||10>te||!gi(R,U+3,te-3)?R=0:(Xe=R[U+0]|R[U+1]<<8|R[U+2]<<16,lt=16383&(R[U+7]<<8|R[U+6]),R=16383&(R[U+9]<<8|R[U+8]),1&Xe||3<(Xe>>1&7)||!(Xe>>4&1)||Xe>>5>=Ye.Ja||!lt||!R?R=0:(ge&&(ge[0]=lt),ye&&(ye[0]=R),R=1))}if(!R||(ge=ge[0],yt=yt[0],Qe&&(Pe[0]!=ge||je[0]!=yt)))return 3;be!=null&&(be[0]=Ye,be.offset=U-be.w,r(4294967286>U-be.w),r(be.offset==be.ha-te));break}return Me==0||Me==7&&Qe&&be==null?(de!=null&&(de[0]|=Ye.na!=null&&0<Ye.na.length),oe!=null&&(oe[0]=ge),ue!=null&&(ue[0]=yt),0):Me}function Qs(R,U,te){var oe=U.width,ue=U.height,de=0,ge=0,ye=oe,be=ue;if(U.Da=R!=null&&0<R.Da,U.Da&&(ye=R.cd,be=R.bd,de=R.v,ge=R.j,11>te||(de&=-2,ge&=-2),0>de||0>ge||0>=ye||0>=be||de+ye>oe||ge+be>ue))return 0;if(U.v=de,U.j=ge,U.va=de+ye,U.o=ge+be,U.U=ye,U.T=be,U.da=R!=null&&0<R.da,U.da){if(!He(ye,be,te=[R.ib],de=[R.hb]))return 0;U.ib=te[0],U.hb=de[0]}return U.ob=R!=null&&R.ob,U.Kb=R==null||!R.Sd,U.da&&(U.ob=U.ib<3*oe/4&&U.hb<3*ue/4,U.Kb=0),1}function bl(R){if(R==null)return 2;if(11>R.S){var U=R.f.RGBA;U.fb+=(R.height-1)*U.A,U.A=-U.A}else U=R.f.kb,R=R.height,U.O+=(R-1)*U.fa,U.fa=-U.fa,U.N+=(R-1>>1)*U.Ab,U.Ab=-U.Ab,U.W+=(R-1>>1)*U.Db,U.Db=-U.Db,U.F!=null&&(U.J+=(R-1)*U.lb,U.lb=-U.lb);return 0}function ra(R,U,te,oe){if(oe==null||0>=R||0>=U)return 2;if(te!=null){if(te.Da){var ue=te.cd,de=te.bd,ge=-2&te.v,ye=-2&te.j;if(0>ge||0>ye||0>=ue||0>=de||ge+ue>R||ye+de>U)return 2;R=ue,U=de}if(te.da){if(!He(R,U,ue=[te.ib],de=[te.hb]))return 2;R=ue[0],U=de[0]}}oe.width=R,oe.height=U;e:{var be=oe.width,Pe=oe.height;if(R=oe.S,0>=be||0>=Pe||!(R>=xl&&13>R))R=2;else{if(0>=oe.Rd&&oe.sd==null){ge=de=ue=U=0;var je=(ye=be*Cl[R])*Pe;if(11>R||(de=(Pe+1)/2*(U=(be+1)/2),R==12&&(ge=(ue=be)*Pe)),(Pe=i(je+2*de+ge))==null){R=1;break e}oe.sd=Pe,11>R?((be=oe.f.RGBA).eb=Pe,be.fb=0,be.A=ye,be.size=je):((be=oe.f.kb).y=Pe,be.O=0,be.fa=ye,be.Fd=je,be.f=Pe,be.N=0+je,be.Ab=U,be.Cd=de,be.ea=Pe,be.W=0+je+de,be.Db=U,be.Ed=de,R==12&&(be.F=Pe,be.J=0+je+2*de),be.Tc=ge,be.lb=ue)}if(U=1,ue=oe.S,de=oe.width,ge=oe.height,ue>=xl&&13>ue)if(11>ue)R=oe.f.RGBA,U&=(ye=Math.abs(R.A))*(ge-1)+de<=R.size,U&=ye>=de*Cl[ue],U&=R.eb!=null;else{R=oe.f.kb,ye=(de+1)/2,je=(ge+1)/2,be=Math.abs(R.fa),Pe=Math.abs(R.Ab);var Qe=Math.abs(R.Db),Xe=Math.abs(R.lb),Ye=Xe*(ge-1)+de;U&=be*(ge-1)+de<=R.Fd,U&=Pe*(je-1)+ye<=R.Cd,U=(U&=Qe*(je-1)+ye<=R.Ed)&be>=de&Pe>=ye&Qe>=ye,U&=R.y!=null,U&=R.f!=null,U&=R.ea!=null,ue==12&&(U&=Xe>=de,U&=Ye<=R.Tc,U&=R.F!=null)}else U=0;R=U?0:2}}return R!=0||te!=null&&te.fd&&(R=bl(oe)),R}var rn=64,Js=[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,Va=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];Ee("Predictor0","PredictorAdd0"),M.Predictor0=function(){return 4278190080},M.Predictor1=function(R){return R},M.Predictor2=function(R,U,te){return U[te+0]},M.Predictor3=function(R,U,te){return U[te+1]},M.Predictor4=function(R,U,te){return U[te-1]},M.Predictor5=function(R,U,te){return he(he(R,U[te+1]),U[te+0])},M.Predictor6=function(R,U,te){return he(R,U[te-1])},M.Predictor7=function(R,U,te){return he(R,U[te+0])},M.Predictor8=function(R,U,te){return he(U[te-1],U[te+0])},M.Predictor9=function(R,U,te){return he(U[te+0],U[te+1])},M.Predictor10=function(R,U,te){return he(he(R,U[te-1]),he(U[te+0],U[te+1]))},M.Predictor11=function(R,U,te){var oe=U[te+0];return 0>=De(oe>>24&255,R>>24&255,(U=U[te-1])>>24&255)+De(oe>>16&255,R>>16&255,U>>16&255)+De(oe>>8&255,R>>8&255,U>>8&255)+De(255&oe,255&R,255&U)?oe:R},M.Predictor12=function(R,U,te){var oe=U[te+0];return(Le((R>>24&255)+(oe>>24&255)-((U=U[te-1])>>24&255))<<24|Le((R>>16&255)+(oe>>16&255)-(U>>16&255))<<16|Le((R>>8&255)+(oe>>8&255)-(U>>8&255))<<8|Le((255&R)+(255&oe)-(255&U)))>>>0},M.Predictor13=function(R,U,te){var oe=U[te-1];return(Ce((R=he(R,U[te+0]))>>24&255,oe>>24&255)<<24|Ce(R>>16&255,oe>>16&255)<<16|Ce(R>>8&255,oe>>8&255)<<8|Ce(R>>0&255,oe>>0&255))>>>0};var el=M.PredictorAdd0;M.PredictorAdd1=tt,Ee("Predictor2","PredictorAdd2"),Ee("Predictor3","PredictorAdd3"),Ee("Predictor4","PredictorAdd4"),Ee("Predictor5","PredictorAdd5"),Ee("Predictor6","PredictorAdd6"),Ee("Predictor7","PredictorAdd7"),Ee("Predictor8","PredictorAdd8"),Ee("Predictor9","PredictorAdd9"),Ee("Predictor10","PredictorAdd10"),Ee("Predictor11","PredictorAdd11"),Ee("Predictor12","PredictorAdd12"),Ee("Predictor13","PredictorAdd13");var co=M.PredictorAdd2;nt("ColorIndexInverseTransform","MapARGB","32b",function(R){return R>>8&255},function(R){return R}),nt("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(R){return R},function(R){return R>>8&255});var Hu,mi=M.ColorIndexInverseTransform,Bi=M.MapARGB,As=M.VP8LColorIndexInverseTransformAlpha,Co=M.MapAlpha,yi=M.VP8LPredictorsAdd=[];yi.length=16,(M.VP8LPredictors=[]).length=16,(M.VP8LPredictorsAdd_C=[]).length=16,(M.VP8LPredictors_C=[]).length=16;var Jo,li,qi,es,$r,fo,tl,ko,jr,Lo,Yn,Tr,xn,Xn,ts,No,To,Ga,kn,ho,Ro,Mo,zi,un,Ei,nn,Yr,Fn,ei=i(511),Io=i(2041),_l=i(225),rl=i(767),cu=0,jo=Io,Sl=_l,bi=rl,Wa=ei,xl=0,Fo=1,sf=2,El=3,fu=4,cn=5,Vu=6,Pl=7,Cs=8,hu=9,du=10,pu=[2,3,7],yc=[3,3,11],nl=[280,256,256,256,40],qf=[0,1,1,1,0],Bh=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],zf=[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],Gu=8,ks=[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],bc=[-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]]]],Uf=[[[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]]],Hf=[[[[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]]]],wc=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Ui=[],Hi=[],na=[],po=1,gu=2,Vi=[],pa=[];ft("UpsampleRgbLinePair",Sr,3),ft("UpsampleBgrLinePair",Cn,3),ft("UpsampleRgbaLinePair",Ua,4),ft("UpsampleBgraLinePair",si,4),ft("UpsampleArgbLinePair",Jn,4),ft("UpsampleRgba4444LinePair",jn,2),ft("UpsampleRgb565LinePair",Sn,2);var Vf=M.UpsampleRgbLinePair,Gf=M.UpsampleBgrLinePair,Ls=M.UpsampleRgbaLinePair,vu=M.UpsampleBgraLinePair,ui=M.UpsampleArgbLinePair,wi=M.UpsampleRgba4444LinePair,_c=M.UpsampleRgb565LinePair,rs=16,go=1<<rs-1,Zr=-227,an=482,ns=6,Pi=0,ia=i(256),il=i(256),Al=i(256),aa=i(256),mu=i(an-Zr),cf=i(an-Zr);Pa("YuvToRgbRow",Sr,3),Pa("YuvToBgrRow",Cn,3),Pa("YuvToRgbaRow",Ua,4),Pa("YuvToBgraRow",si,4),Pa("YuvToArgbRow",Jn,4),Pa("YuvToRgba4444Row",jn,2),Pa("YuvToRgb565Row",Sn,2);var Yu=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],is=[0,2,8],Wf=[8,7,6,4,4,2,2,2,1,1,1,1],as=1;this.WebPDecodeRGBA=function(R,U,te,oe,ue){var de=Fo,ge=new $n,ye=new wt;ge.ba=ye,ye.S=de,ye.width=[ye.width],ye.height=[ye.height];var be=ye.width,Pe=ye.height,je=new tr;if(je==null||R==null)var Qe=2;else r(je!=null),Qe=Ha(R,U,te,je.width,je.height,je.Pd,je.Qd,je.format,null);if(Qe!=0?be=0:(be!=null&&(be[0]=je.width[0]),Pe!=null&&(Pe[0]=je.height[0]),be=1),be){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 Kr,(ue=new vi).data=R,ue.w=U,ue.ha=te,ue.kd=1,U=[0],r(ue!=null),((R=Ha(ue.data,ue.w,ue.ha,null,null,null,U,null,ue))==0||R==7)&&U[0]&&(R=4),(U=R)==0){if(r(ge!=null),oe.data=ue.data,oe.w=ue.w+ue.offset,oe.ha=ue.ha-ue.offset,oe.put=Fe,oe.ac=Ve,oe.bc=bt,oe.ma=ge,ue.xa){if((R=_i())==null){ge=1;break e}if(function(Xe,Ye){var yt=[0],lt=[0],Me=[0];t:for(;;){if(Xe==null)return 0;if(Ye==null)return Xe.a=2,0;if(Xe.l=Ye,Xe.a=0,$(Xe.m,Ye.data,Ye.w,Ye.ha),!Ue(Xe.m,yt,lt,Me)){Xe.a=3;break t}if(Xe.xb=gu,Ye.width=yt[0],Ye.height=lt[0],!Ni(yt[0],lt[0],1,Xe,null))break t;return 1}return r(Xe.a!=0),0}(R,oe)){if(oe=(U=ra(oe.width,oe.height,ge.Oa,ge.ba))==0){t:{oe=R;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((te=oe.l)!=null),r((ue=te.ma)!=null),oe.xb!=0){if(oe.ca=ue.ba,oe.tb=ue.tb,r(oe.ca!=null),!Qs(ue.Oa,te,El)){oe.a=2;break r}if(!Si(oe,te.width)||te.da)break r;if((te.da||Nt(oe.ca.S))&&Je(),11>oe.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),oe.ca.f.kb.F!=null&&Je()),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(!en(oe,oe.V,oe.Ba,oe.c,oe.i,te.o,kr))break r;ue.Dc=oe.Ma,oe=1;break t}r(oe.a!=0),oe=0}oe=!oe}oe&&(U=R.a)}else U=R.a}else{if((R=new Ar)==null){ge=1;break e}if(R.Fa=ue.na,R.P=ue.P,R.qc=ue.Sa,Ti(R,oe)){if((U=ra(oe.width,oe.height,ge.Oa,ge.ba))==0){if(R.Aa=0,te=ge.Oa,r((ue=R)!=null),te!=null){if(0<(be=0>(be=te.Md)?0:100<be?255:255*be/100)){for(Pe=je=0;4>Pe;++Pe)12>(Qe=ue.pb[Pe]).lc&&(Qe.ia=be*Wf[0>Qe.lc?0:Qe.lc]>>3),je|=Qe.ia;je&&(alert("todo:VP8InitRandom"),ue.ia=1)}ue.Ga=te.Id,100<ue.Ga?ue.Ga=100:0>ue.Ga&&(ue.Ga=0)}ii(R,oe)||(U=R.a)}}else U=R.a}U==0&&ge.Oa!=null&&ge.Oa.fd&&(U=bl(ge.ba))}ge=U}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(M,F){for(var C="",x=0;x<4;x++)C+=String.fromCharCode(M[F++]);return C}function h(M,F){return(M[F+0]<<0|M[F+1]<<8|M[F+2]<<16)>>>0}function p(M,F){return(M[F+0]<<0|M[F+1]<<8|M[F+2]<<16|M[F+3]<<24)>>>0}new u;var w=[0],d=[0],_=[],E=new u,S=e,y=function(M,F){var C={},x=0,L=!1,A=0,N=0;if(C.frames=[],!function(D,K,ne,Z){for(var ee=0;ee<Z;ee++)if(D[K+ee]!=ne.charCodeAt(ee))return!0;return!1}(M,F,"RIFF",4)){for(p(M,F+=4),F+=8;F<M.length;){var I=c(M,F),W=p(M,F+=4);F+=4;var G=W+(1&W);switch(I){case"VP8 ":case"VP8L":C.frames[x]===void 0&&(C.frames[x]={}),(V=C.frames[x]).src_off=L?N:F-8,V.src_size=A+W+8,x++,L&&(L=!1,A=0,N=0);break;case"VP8X":(V=C.header={}).feature_flags=M[F];var $=F+4;V.canvas_width=1+h(M,$),$+=3,V.canvas_height=1+h(M,$),$+=3;break;case"ALPH":L=!0,A=G+8,N=F-8;break;case"ANIM":(V=C.header).bgcolor=p(M,F),$=F+4,V.loop_count=(H=M)[(z=$)+0]<<0|H[z+1]<<8,$+=2;break;case"ANMF":var J,V;(V=C.frames[x]={}).offset_x=2*h(M,F),F+=3,V.offset_y=2*h(M,F),F+=3,V.width=1+h(M,F),F+=3,V.height=1+h(M,F),F+=3,V.duration=h(M,F),F+=3,J=M[F++],V.dispose=1&J,V.blend=J>>1&1}I!="ANMF"&&(F+=G)}var H,z;return C}}(S,0);y.response=S,y.rgbaoutput=!0,y.dataurl=!1;var g=y.header?y.header:null,v=y.frames?y.frames:null;if(g){g.loop_counter=g.loop_count,w=[g.canvas_height],d=[g.canvas_width];for(var b=0;b<v.length&&v[b].blend!=0;b++);}var O=v[0],j=E.WebPDecodeRGBA(S,O.src_off,O.src_size,d,w);O.rgba=j,O.imgwidth=d[0],O.imgheight=w[0];for(var T=0;T<d[0]*w[0]*4;T++)_[T]=j[T];return this.width=d,this.height=w,this.data=_,this}(function(e){var r=function(){return typeof N2=="function"},t=function(w,d,_,E){var S=4,y=o;switch(E){case e.image_compression.FAST:S=1,y=i;break;case e.image_compression.MEDIUM:S=6,y=l;break;case e.image_compression.SLOW:S=9,y=u}w=n(w,d,_,y);var g=N2(w,{level:S});return e.__addimage__.arrayBufferToBinaryString(g)},n=function(w,d,_,E){for(var S,y,g,v=w.length/d,b=new Uint8Array(w.length+v),O=h(),j=0;j<v;j+=1){if(g=j*d,S=w.subarray(g,g+d),E)b.set(E(S,_,y),g+j);else{for(var T,M=O.length,F=[];T<M;T+=1)F[T]=O[T](S,_,y);var C=p(F.concat());b.set(F[C],g+j)}y=S}return b},a=function(w){var d=Array.apply([],w);return d.unshift(0),d},i=function(w,d){var _,E=[],S=w.length;E[0]=1;for(var y=0;y<S;y+=1)_=w[y-d]||0,E[y+1]=w[y]-_+256&255;return E},o=function(w,d,_){var E,S=[],y=w.length;S[0]=2;for(var g=0;g<y;g+=1)E=_&&_[g]||0,S[g+1]=w[g]-E+256&255;return S},l=function(w,d,_){var E,S,y=[],g=w.length;y[0]=3;for(var v=0;v<g;v+=1)E=w[v-d]||0,S=_&&_[v]||0,y[v+1]=w[v]+256-(E+S>>>1)&255;return y},u=function(w,d,_){var E,S,y,g,v=[],b=w.length;v[0]=4;for(var O=0;O<b;O+=1)E=w[O-d]||0,S=_&&_[O]||0,y=_&&_[O-d]||0,g=c(E,S,y),v[O+1]=w[O]-g+256&255;return v},c=function(w,d,_){if(w===d&&d===_)return w;var E=Math.abs(d-_),S=Math.abs(w-_),y=Math.abs(w+d-_-_);return E<=S&&E<=y?w:S<=y?d:_},h=function(){return[a,i,o,l,u]},p=function(w){var d=w.map(function(_){return _.reduce(function(E,S){return E+Math.abs(S)},0)});return d.indexOf(Math.min.apply(null,d))};e.processPNG=function(w,d,_,E){var S,y,g,v,b,O,j,T,M,F,C,x,L,A,N,I=this.decode.FLATE_DECODE,W="";if(this.__addimage__.isArrayBuffer(w)&&(w=new Uint8Array(w)),this.__addimage__.isArrayBufferView(w)){if(w=(g=new Zk(w)).imgData,y=g.bits,S=g.colorSpace,b=g.colors,[4,6].indexOf(g.colorType)!==-1){if(g.bits===8){M=(T=g.pixelBitlength==32?new Uint32Array(g.decodePixels().buffer):g.pixelBitlength==16?new Uint16Array(g.decodePixels().buffer):new Uint8Array(g.decodePixels().buffer)).length,C=new Uint8Array(M*g.colors),F=new Uint8Array(M);var G,$=g.pixelBitlength-g.bits;for(A=0,N=0;A<M;A++){for(L=T[A],G=0;G<$;)C[N++]=L>>>G&255,G+=g.bits;F[A]=L>>>G&255}}if(g.bits===16){M=(T=new Uint32Array(g.decodePixels().buffer)).length,C=new Uint8Array(M*(32/g.pixelBitlength)*g.colors),F=new Uint8Array(M*(32/g.pixelBitlength)),x=g.colors>1,A=0,N=0;for(var J=0;A<M;)L=T[A++],C[N++]=L>>>0&255,x&&(C[N++]=L>>>16&255,L=T[A++],C[N++]=L>>>0&255),F[J++]=L>>>16&255;y=8}E!==e.image_compression.NONE&&r()?(w=t(C,g.width*g.colors,g.colors,E),j=t(F,g.width,1,E)):(w=C,j=F,I=void 0)}if(g.colorType===3&&(S=this.color_spaces.INDEXED,O=g.palette,g.transparency.indexed)){var V=g.transparency.indexed,H=0;for(A=0,M=V.length;A<M;++A)H+=V[A];if((H/=255)===M-1&&V.indexOf(0)!==-1)v=[V.indexOf(0)];else if(H!==M){for(T=g.decodePixels(),F=new Uint8Array(T.length),A=0,M=T.length;A<M;A++)F[A]=V[T[A]];j=t(F,g.width,1)}}var z=function(D){var K;switch(D){case e.image_compression.FAST:K=11;break;case e.image_compression.MEDIUM:K=13;break;case e.image_compression.SLOW:K=14;break;default:K=12}return K}(E);return I===this.decode.FLATE_DECODE&&(W="/Predictor "+z+" "),W+="/Colors "+b+" /BitsPerComponent "+y+" /Columns "+g.width,(this.__addimage__.isArrayBuffer(w)||this.__addimage__.isArrayBufferView(w))&&(w=this.__addimage__.arrayBufferToBinaryString(w)),(j&&this.__addimage__.isArrayBuffer(j)||this.__addimage__.isArrayBufferView(j))&&(j=this.__addimage__.arrayBufferToBinaryString(j)),{alias:_,data:w,index:d,filter:I,decodeParameters:W,transparency:v,palette:O,sMask:j,predictor:z,width:g.width,height:g.height,bitsPerComponent:y,colorSpace:S}}}})(hr.API),function(e){e.processGIF89A=function(r,t,n,a){var i=new Qk(r),o=i.width,l=i.height,u=[];i.decodeAndBlitFrameRGBA(0,u);var c={data:u,width:o,height:l},h=new c2(100).encode(c,100);return e.processJPEG.call(this,h,t,n,a)},e.processGIF87A=e.processGIF89A}(hr.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){Gn.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,l=0;l<8&&8*a+l<this.width;l++){var u=this.palette[i>>7-l&1];this.data[o+4*l]=u.blue,this.data[o+4*l+1]=u.green,this.data[o+4*l+2]=u.red,this.data[o+4*l+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,l=i>>4,u=15&i,c=this.palette[l];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,l=(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]=l,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 l=(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]=l,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),l=r*this.width*4+4*t;this.data[l]=i,this.data[l+1]=a,this.data[l+2]=n,this.data[l+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,l=i.height,u={data:i.getData(),width:o,height:l},c=new c2(100).encode(u,100);return e.processJPEG.call(this,c,t,n,a)}}(hr.API),lw.prototype.getData=function(){return this.data},function(e){e.processWEBP=function(r,t,n,a){var i=new lw(r),o=i.width,l=i.height,u={data:i.getData(),width:o,height:l},c=new c2(100).encode(u,100);return e.processJPEG.call(this,c,t,n,a)}}(hr.API),hr.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),l=0,u=0,c=0;c<a;c+=4){var h=n[c],p=n[c+1],w=n[c+2],d=n[c+3];i[l++]=h,i[l++]=p,i[l++]=w,o[u++]=d}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}},hr.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},oh=hr.API,p1=oh.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(),l=r.widths?r.widths:a.metadata.Unicode.widths,u=l.fof?l.fof:1,c=r.kerning?r.kerning:a.metadata.Unicode.kerning,h=c.fof?c.fof:1,p=r.doKerning!==!1,w=0,d=e.length,_=0,E=l[0]||u,S=[];for(t=0;t<d;t++)n=e.charCodeAt(t),typeof a.metadata.widthOfString=="function"?S.push((a.metadata.widthOfGlyph(a.metadata.characterToGlyph(n))+o*(1e3/i)||0)/1e3):(w=p&&On(c[n])==="object"&&!isNaN(parseInt(c[n][_],10))?c[n][_]/h:0,S.push((l[n]||E)/u+w)),_=n;return S},iw=oh.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 oh.processArabic&&(e=oh.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)},aw=function(e,r,t,n){for(var a=[],i=0,o=e.length,l=0;i!==o&&l+r[i]<t;)l+=r[i],i++;a.push(e.slice(0,i));var u=i;for(l=0;i!==o;)l+r[i]>n&&(a.push(e.slice(u,i)),l=0,u=i),l+=r[i],i++;return u!==i&&a.push(e.slice(u,i)),a},ow=function(e,r,t){t||(t={});var n,a,i,o,l,u,c,h=[],p=[h],w=t.textIndent||0,d=0,_=0,E=e.split(" "),S=p1.apply(this,[" ",t])[0];if(u=t.lineIndent===-1?E[0].length+2:t.lineIndent||0){var y=Array(u).join(" "),g=[];E.map(function(b){(b=b.split(/\s*\n/)).length>1?g=g.concat(b.map(function(O,j){return(j&&O.length?`
|
|
493
|
-
`:"")+O})):g.push(b[0])}),E=g,u=iw.apply(this,[y,t])}for(i=0,o=E.length;i<o;i++){var v=0;if(n=E[i],u&&n[0]==`
|
|
494
|
-
`&&(n=n.substr(1),v=1),w+d+(_=(a=p1.apply(this,[n,t])).reduce(function(b,O){return b+O},0))>r||v){if(_>r){for(l=aw.apply(this,[n,a,r-(w+d),r]),h.push(l.shift()),h=[l.pop()];l.length;)p.push([l.shift()]);_=a.slice(n.length-(h[0]?h[0].length:0)).reduce(function(b,O){return b+O},0)}else h=[n];p.push(h),w=_+u,d=S}else h.push(n),w+=d+_,d=S}return c=u?function(b,O){return(O?y:"")+b.join(" ")}:function(b){return b.join(" ")},p.map(c)},oh.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 l,u,c=[];for(l=0,u=n.length;l<u;l++)c=c.concat(ow.apply(this,[n[l],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 w,d,_,E,S=["{"];for(var y in p){if(w=p[y],isNaN(parseInt(y,10))?d="'"+y+"'":(y=parseInt(y,10),d=(d=i(y).slice(2)).slice(0,-1)+n[d.slice(-1)]),typeof w=="number")w<0?(_=i(w).slice(3),E="-"):(_=i(w).slice(2),E=""),_=E+_.slice(0,-1)+n[_.slice(-1)];else{if(On(w)!=="object")throw new Error("Don't know what to do with value type "+On(w)+".");_=o(w)}S.push(d+_)}return S.push("}"),S.join("")},l=e.__fontmetrics__.uncompress=function(p){if(typeof p!="string")throw new Error("Invalid argument passed to uncompress.");for(var w,d,_,E,S={},y=1,g=S,v=[],b="",O="",j=p.length-1,T=1;T<j;T+=1)(E=p[T])=="'"?w?(_=w.join(""),w=void 0):w=[]:w?w.push(E):E=="{"?(v.push([g,_]),g={},_=void 0):E=="}"?((d=v.pop())[0][d[1]]=g,_=void 0,g=d[0]):E=="-"?y=-1:_===void 0?t.hasOwnProperty(E)?(b+=t[E],_=parseInt(b,16)*y,y=1,b=""):b+=E:t.hasOwnProperty(E)?(O+=t[E],g[_]=parseInt(O,16)*y,y=1,_=void 0,O=""):O+=E;return S},u={codePages:["WinAnsiEncoding"],WinAnsiEncoding:l("{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":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":l("{'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":l("{'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:l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":l("{'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:l("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:l("{'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":l("{'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:l("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":l("{'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":l("{'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":l("{'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 w=p.font,d=h.Unicode[w.postScriptName];d&&(w.metadata.Unicode={},w.metadata.Unicode.widths=d.widths,w.metadata.Unicode.kerning=d.kerning);var _=c.Unicode[w.postScriptName];_&&(w.metadata.Unicode.encoding=_,w.encoding=_.codePages[0])}])}(hr.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,l){l=/^\x00\x01\x00\x00/.test(l)?r(l):r(lp(l)),o.metadata=e.API.TTFFont.open(l),o.metadata.Unicode=o.metadata.Unicode||{encoding:{},kerning:{},widths:[]},o.metadata.glyIdsUsed=[0]})(a,n)}}])}(hr),function(e){function r(){return(pr.canvg?Promise.resolve(pr.canvg):O2(()=>import("./index.es-CilQ1Z1u.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})}hr.API.addSvgAsImage=function(t,n,a,i,o,l,u,c){if(isNaN(n)||isNaN(a))throw Gn.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(o))throw Gn.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 w={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},d=this;return r().then(function(_){return _.fromString(p,t,w)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(_){return _.render(w)}).then(function(){d.addImage(h.toDataURL("image/jpeg",1),n,a,i,o,u,c)})}}(),hr.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},hr.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}},l=Object.keys(o),u=[],c=0,h=0,p=0;function w(_,E){var S,y=!1;for(S=0;S<_.length;S+=1)_[S]===E&&(y=!0);return y}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 d=l.length;for(p=0;p<d;p+=1)t[l[p]].value=t[l[p]].defaultValue,t[l[p]].explicitSet=!1}if(On(e)==="object"){for(a in e)if(i=e[a],w(l,a)&&i!==void 0){if(t[a].type==="boolean"&&typeof i=="boolean")t[a].value=i;else if(t[a].type==="name"&&w(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
|
|
495
|
-
<<
|
|
496
|
-
`+E.join(`
|
|
497
|
-
`)+`
|
|
498
|
-
>>`)}),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)),l=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),u=unescape(encodeURIComponent("</x:xmpmeta>")),c=i.length+o.length+l.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+l+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}}(hr.API),function(e){var r=e.API,t=r.pdfEscape16=function(i,o){for(var l,u=o.metadata.Unicode.widths,c=["","0","00","000","0000"],h=[""],p=0,w=i.length;p<w;++p){if(l=o.metadata.characterToGlyph(i.charCodeAt(p)),o.metadata.glyIdsUsed.push(l),o.metadata.toUnicode[l]=i.charCodeAt(p),u.indexOf(l)==-1&&(u.push(l),u.push([parseInt(o.metadata.widthOfGlyph(l),10)])),l=="0")return h.join("");l=l.toString(16),h.push(c[4-l.length],l)}return h.join("")},n=function(i){var o,l,u,c,h,p,w;for(h=`/CIDInit /ProcSet findresource begin
|
|
499
|
-
12 dict begin
|
|
500
|
-
begincmap
|
|
501
|
-
/CIDSystemInfo <<
|
|
502
|
-
/Registry (Adobe)
|
|
503
|
-
/Ordering (UCS)
|
|
504
|
-
/Supplement 0
|
|
505
|
-
>> def
|
|
506
|
-
/CMapName /Adobe-Identity-UCS def
|
|
507
|
-
/CMapType 2 def
|
|
508
|
-
1 begincodespacerange
|
|
509
|
-
<0000><ffff>
|
|
510
|
-
endcodespacerange`,u=[],p=0,w=(l=Object.keys(i).sort(function(d,_){return d-_})).length;p<w;p++)o=l[p],u.length>=100&&(h+=`
|
|
511
|
-
`+u.length+` beginbfchar
|
|
512
|
-
`+u.join(`
|
|
513
|
-
`)+`
|
|
514
|
-
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+=`
|
|
515
|
-
`+u.length+` beginbfchar
|
|
516
|
-
`+u.join(`
|
|
517
|
-
`)+`
|
|
518
|
-
endbfchar
|
|
519
|
-
`),h+=`endcmap
|
|
520
|
-
CMapName currentdict /CMap defineresource pop
|
|
521
|
-
end
|
|
522
|
-
end`};r.events.push(["putFont",function(i){(function(o){var l=o.font,u=o.out,c=o.newObject,h=o.putStream;if(l.metadata instanceof e.API.TTFFont&&l.encoding==="Identity-H"){for(var p=l.metadata.Unicode.widths,w=l.metadata.subset.encode(l.metadata.glyIdsUsed,1),d="",_=0;_<w.length;_++)d+=String.fromCharCode(w[_]);var E=c();h({data:d,addLength1:!0,objectId:E}),u("endobj");var S=c();h({data:n(l.metadata.toUnicode),addLength1:!0,objectId:S}),u("endobj");var y=c();u("<<"),u("/Type /FontDescriptor"),u("/FontName /"+ch(l.fontName)),u("/FontFile2 "+E+" 0 R"),u("/FontBBox "+e.API.PDFObject.convert(l.metadata.bbox)),u("/Flags "+l.metadata.flags),u("/StemV "+l.metadata.stemV),u("/ItalicAngle "+l.metadata.italicAngle),u("/Ascent "+l.metadata.ascender),u("/Descent "+l.metadata.decender),u("/CapHeight "+l.metadata.capHeight),u(">>"),u("endobj");var g=c();u("<<"),u("/Type /Font"),u("/BaseFont /"+ch(l.fontName)),u("/FontDescriptor "+y+" 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 ("+l.encoding+")"),u(">>"),u(">>"),u("endobj"),l.objectNumber=c(),u("<<"),u("/Type /Font"),u("/Subtype /Type0"),u("/ToUnicode "+S+" 0 R"),u("/BaseFont /"+ch(l.fontName)),u("/Encoding /"+l.encoding),u("/DescendantFonts ["+g+" 0 R]"),u(">>"),u("endobj"),l.isAlreadyPutted=!0}})(i)}]),r.events.push(["putFont",function(i){(function(o){var l=o.font,u=o.out,c=o.newObject,h=o.putStream;if(l.metadata instanceof e.API.TTFFont&&l.encoding==="WinAnsiEncoding"){for(var p=l.metadata.rawData,w="",d=0;d<p.length;d++)w+=String.fromCharCode(p[d]);var _=c();h({data:w,addLength1:!0,objectId:_}),u("endobj");var E=c();h({data:n(l.metadata.toUnicode),addLength1:!0,objectId:E}),u("endobj");var S=c();u("<<"),u("/Descent "+l.metadata.decender),u("/CapHeight "+l.metadata.capHeight),u("/StemV "+l.metadata.stemV),u("/Type /FontDescriptor"),u("/FontFile2 "+_+" 0 R"),u("/Flags 96"),u("/FontBBox "+e.API.PDFObject.convert(l.metadata.bbox)),u("/FontName /"+ch(l.fontName)),u("/ItalicAngle "+l.metadata.italicAngle),u("/Ascent "+l.metadata.ascender),u(">>"),u("endobj"),l.objectNumber=c();for(var y=0;y<l.metadata.hmtx.widths.length;y++)l.metadata.hmtx.widths[y]=parseInt(l.metadata.hmtx.widths[y]*(1e3/l.metadata.head.unitsPerEm));u("<</Subtype/TrueType/Type/Font/ToUnicode "+E+" 0 R/BaseFont/"+ch(l.fontName)+"/FontDescriptor "+S+" 0 R/Encoding/"+l.encoding+" /FirstChar 29 /LastChar 255 /Widths "+e.API.PDFObject.convert(l.metadata.hmtx.widths)+">>"),u("endobj"),l.isAlreadyPutted=!0}})(i)}]);var a=function(i){var o,l=i.text||"",u=i.x,c=i.y,h=i.options||{},p=i.mutex||{},w=p.pdfEscape,d=p.activeFontKey,_=p.fonts,E=d,S="",y=0,g="",v=_[E].encoding;if(_[E].encoding!=="Identity-H")return{text:l,x:u,y:c,options:h,mutex:p};for(g=l,E=d,Array.isArray(l)&&(g=l[0]),y=0;y<g.length;y+=1)_[E].metadata.hasOwnProperty("cmap")&&(o=_[E].metadata.cmap.unicode.codeMap[g[y].charCodeAt(0)]),o||g[y].charCodeAt(0)<256&&_[E].metadata.hasOwnProperty("Unicode")?S+=g[y]:S+="";var b="";return parseInt(E.slice(1))<14||v==="WinAnsiEncoding"?b=w(S,E).split("").map(function(O){return O.charCodeAt(0).toString(16)}).join(""):v==="Identity-H"&&(b=t(S,_[E])),p.isHex=!0,{text:b,x:u,y:c,options:h,mutex:p}};r.events.push(["postProcessText",function(i){var o=i.text||"",l=[],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?l.push([a(Object.assign({},u,{text:o[c][0]})).text,o[c][1],o[c][2]]):l.push(a(Object.assign({},u,{text:o[c]})).text);i.text=l}else i.text=a(Object.assign({},u,{text:o})).text}])}(hr),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}}(hr.API),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(n){var a,i,o,l,u,c,h,p=r,w=[[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]],d=[[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},S=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],y=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)$/),g=!1,v=0;this.__bidiEngine__={};var b=function(x){var L=x.charCodeAt(),A=L>>8,N=E[A];return N!==void 0?p[256*N+(255&L)]:A===252||A===253?"AL":y.test(A)?"L":A===8?"R":"N"},O=function(x){for(var L,A=0;A<x.length;A++){if((L=b(x.charAt(A)))==="L")return!1;if(L==="R")return!0}return!1},j=function(x,L,A,N){var I,W,G,$,J=L[N];switch(J){case"L":case"R":g=!1;break;case"N":case"AN":break;case"EN":g&&(J="AN");break;case"AL":g=!0,J="R";break;case"WS":J="N";break;case"CS":N<1||N+1>=L.length||(I=A[N-1])!=="EN"&&I!=="AN"||(W=L[N+1])!=="EN"&&W!=="AN"?J="N":g&&(W="AN"),J=W===I?W:"N";break;case"ES":J=(I=N>0?A[N-1]:"B")==="EN"&&N+1<L.length&&L[N+1]==="EN"?"EN":"N";break;case"ET":if(N>0&&A[N-1]==="EN"){J="EN";break}if(g){J="N";break}for(G=N+1,$=L.length;G<$&&L[G]==="ET";)G++;J=G<$&&L[G]==="EN"?"EN":"N";break;case"NSM":if(o&&!l){for($=L.length,G=N+1;G<$&&L[G]==="NSM";)G++;if(G<$){var V=x[N],H=V>=1425&&V<=2303||V===64286;if(I=L[G],H&&(I==="R"||I==="AL")){J="R";break}}}J=N<1||(I=L[N-1])==="B"?"N":A[N-1];break;case"B":g=!1,a=!0,J=v;break;case"S":i=!0,J="N";break;case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":g=!1;break;case"BN":J="N"}return J},T=function(x,L,A){var N=x.split("");return A&&M(N,A,{hiLevel:v}),N.reverse(),L&&L.reverse(),N.join("")},M=function(x,L,A){var N,I,W,G,$,J=-1,V=x.length,H=0,z=[],D=v?d:w,K=[];for(g=!1,a=!1,i=!1,I=0;I<V;I++)K[I]=b(x[I]);for(W=0;W<V;W++){if($=H,z[W]=j(x,K,z,W),N=240&(H=D[$][_[z[W]]]),H&=15,L[W]=G=D[H][5],N>0)if(N===16){for(I=J;I<W;I++)L[I]=1;J=-1}else J=-1;if(D[H][6])J===-1&&(J=W);else if(J>-1){for(I=J;I<W;I++)L[I]=G;J=-1}K[W]==="B"&&(L[W]=0),A.hiLevel|=G}i&&function(ne,Z,ee){for(var ae=0;ae<ee;ae++)if(ne[ae]==="S"){Z[ae]=v;for(var se=ae-1;se>=0&&ne[se]==="WS";se--)Z[se]=v}}(K,L,V)},F=function(x,L,A,N,I){if(!(I.hiLevel<x)){if(x===1&&v===1&&!a)return L.reverse(),void(A&&A.reverse());for(var W,G,$,J,V=L.length,H=0;H<V;){if(N[H]>=x){for($=H+1;$<V&&N[$]>=x;)$++;for(J=H,G=$-1;J<G;J++,G--)W=L[J],L[J]=L[G],L[G]=W,A&&(W=A[J],A[J]=A[G],A[G]=W);H=$}H++}}},C=function(x,L,A){var N=x.split(""),I={hiLevel:v};return A||(A=[]),M(N,A,I),function(W,G,$){if($.hiLevel!==0&&h)for(var J,V=0;V<W.length;V++)G[V]===1&&(J=S.indexOf(W[V]))>=0&&(W[V]=S[J+1])}(N,A,I),F(2,N,L,A,I),F(1,N,L,A,I),N.join("")};return this.__bidiEngine__.doBidiReorder=function(x,L,A){if(function(I,W){if(W)for(var G=0;G<I.length;G++)W[G]=G;l===void 0&&(l=O(I)),c===void 0&&(c=O(I))}(x,L),o||!u||c)if(o&&u&&l^c)v=l?1:0,x=T(x,L,A);else if(!o&&u&&c)v=l?1:0,x=C(x,L,A),x=T(x,L);else if(!o||l||u||c){if(o&&!u&&l^c)x=T(x,L),l?(v=0,x=C(x,L,A)):(v=1,x=C(x,L,A),x=T(x,L));else if(o&&l&&!u&&c)v=1,x=C(x,L,A),x=T(x,L);else if(!o&&!u&&l^c){var N=h;l?(v=1,x=C(x,L,A),v=0,h=!1,x=C(x,L,A),h=N):(v=0,x=C(x,L,A),x=T(x,L),v=1,h=!1,x=C(x,L,A),h=N,x=T(x,L))}}else v=0,x=C(x,L,A);else v=l?1:0,x=C(x,L,A);return x},this.__bidiEngine__.setOptions=function(x){x&&(o=x.isInputVisual,u=x.isOutputVisual,l=x.isInputRtl,c=x.isOutputRtl,h=x.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 l=0;for(o=[],l=0;l<a.length;l+=1)Object.prototype.toString.call(a[l])==="[object Array]"?o.push([t.doBidiReorder(a[l][0]),a[l][1],a[l][2]]):o.push([t.doBidiReorder(a[l])]);n.text=o}else n.text=t.doBidiReorder(a);t.setOptions({isInputVisual:!0})}])}(hr),hr.API.TTFFont=function(){function e(r){var t;if(this.rawData=r,t=this.contents=new Xc(r),this.contents.pos=4,t.readString(4)==="ttcf")throw new Error("TTCF not supported.");t.pos=0,this.parse(),this.subset=new dL(this),this.registerTTF()}return e.open=function(r){return new e(r)},e.prototype.parse=function(){return this.directory=new Jk(this.contents),this.head=new tL(this),this.name=new oL(this),this.cmap=new C_(this),this.toUnicode={},this.hhea=new rL(this),this.maxp=new sL(this),this.hmtx=new lL(this),this.post=new iL(this),this.os2=new nL(this),this.loca=new hL(this),this.glyf=new uL(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,l,u,c;for(c=[],o=0,l=(u=this.bbox).length;o<l;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,l;for(o=0,i=0,l=(r=""+r).length;0<=l?i<l:i>l;i=0<=l?++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,Xc=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,l,u;return r=this.readByte(),t=this.readByte(),n=this.readByte(),a=this.readByte(),i=this.readByte(),o=this.readByte(),l=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^l)+(255^u)+1):72057594037927940*r+281474976710656*t+1099511627776*n+4294967296*a+16777216*i+65536*o+256*l+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}(),Jk=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,l,u,c,h,p,w,d,_,E;for(E in d=Object.keys(t).length,u=Math.log(2),p=16*Math.floor(Math.log(d)/u),o=Math.floor(p/u),h=16*d-p,(a=new Xc).writeInt(this.scalarType),a.writeShort(d),a.writeShort(p),a.writeShort(o),a.writeShort(h),i=16*d,c=a.pos+i,l=null,_=[],t)for(w=t[E],a.writeString(E),a.writeInt(e(w)),a.writeInt(c),a.writeInt(w.length),_=_.concat(w),E==="head"&&(l=c),c+=w.length;c%4;)_.push(0),c++;return a.write(_),n=2981146554-e(a.data),a.pos=l+8,a.writeUInt32(n),a.data},e=function(t){var n,a,i,o;for(t=k_.call(t);t.length%4;)t.push(0);for(i=new Xc(t),a=0,n=0,o=t.length;n<o;n=n+=4)a+=i.readUInt32();return 4294967295&a},r}(),eL={}.hasOwnProperty,Du=function(e,r){for(var t in r)eL.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 tL=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 Xc).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}(),uw=function(){function e(r,t){var n,a,i,o,l,u,c,h,p,w,d,_,E,S,y,g,v;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(d=r.readUInt16(),w=d/2,r.pos+=6,i=function(){var b,O;for(O=[],u=b=0;0<=w?b<w:b>w;u=0<=w?++b:--b)O.push(r.readUInt16());return O}(),r.pos+=2,E=function(){var b,O;for(O=[],u=b=0;0<=w?b<w:b>w;u=0<=w?++b:--b)O.push(r.readUInt16());return O}(),c=function(){var b,O;for(O=[],u=b=0;0<=w?b<w:b>w;u=0<=w?++b:--b)O.push(r.readUInt16());return O}(),h=function(){var b,O;for(O=[],u=b=0;0<=w?b<w:b>w;u=0<=w?++b:--b)O.push(r.readUInt16());return O}(),a=(this.length-r.pos+this.offset)/2,l=function(){var b,O;for(O=[],u=b=0;0<=a?b<a:b>a;u=0<=a?++b:--b)O.push(r.readUInt16());return O}(),u=y=0,v=i.length;y<v;u=++y)for(S=i[u],n=g=_=E[u];_<=S?g<=S:g>=S;n=_<=S?++g:--g)h[u]===0?o=n+c[u]:(o=l[h[u]/2+(n-_)-(w-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,l,u,c,h,p,w,d,_,E,S,y,g,v,b,O,j,T,M,F,C,x,L,A,N,I,W,G,$,J,V,H,z,D,K,ne,Z,ee,ae,se,ce,me,xe;switch(N=new Xc,o=Object.keys(r).sort(function(Oe,Re){return Oe-Re}),t){case"macroman":for(E=0,S=function(){var Oe=[];for(_=0;_<256;++_)Oe.push(0);return Oe}(),g={0:0},i={},I=0,J=o.length;I<J;I++)g[se=r[a=o[I]]]==null&&(g[se]=++E),i[a]={old:r[a],new:g[r[a]]},S[a]=g[r[a]];return N.writeUInt16(1),N.writeUInt16(0),N.writeUInt32(12),N.writeUInt16(0),N.writeUInt16(262),N.writeUInt16(0),N.write(S),{charMap:i,subtable:N.data,maxGlyphID:E+1};case"unicode":for(L=[],p=[],v=0,g={},n={},y=c=null,W=0,V=o.length;W<V;W++)g[O=r[a=o[W]]]==null&&(g[O]=++v),n[a]={old:O,new:g[O]},l=g[O]-a,y!=null&&l===c||(y&&p.push(y),L.push(a),c=l),y=a;for(y&&p.push(y),p.push(65535),L.push(65535),C=2*(F=L.length),M=2*Math.pow(Math.log(F)/Math.LN2,2),w=Math.log(M/2)/Math.LN2,T=2*F-M,u=[],j=[],d=[],_=G=0,H=L.length;G<H;_=++G){if(x=L[_],h=p[_],x===65535){u.push(0),j.push(0);break}if(x-(A=n[x].new)>=32768)for(u.push(0),j.push(2*(d.length+F-_)),a=$=x;x<=h?$<=h:$>=h;a=x<=h?++$:--$)d.push(n[a].new);else u.push(A-x),j.push(0)}for(N.writeUInt16(3),N.writeUInt16(1),N.writeUInt32(12),N.writeUInt16(4),N.writeUInt16(16+8*F+2*d.length),N.writeUInt16(0),N.writeUInt16(C),N.writeUInt16(M),N.writeUInt16(w),N.writeUInt16(T),ee=0,z=p.length;ee<z;ee++)a=p[ee],N.writeUInt16(a);for(N.writeUInt16(0),ae=0,D=L.length;ae<D;ae++)a=L[ae],N.writeUInt16(a);for(ce=0,K=u.length;ce<K;ce++)l=u[ce],N.writeUInt16(l);for(me=0,ne=j.length;me<ne;me++)b=j[me],N.writeUInt16(b);for(xe=0,Z=d.length;xe<Z;xe++)E=d[xe],N.writeUInt16(E);return{charMap:n,subtable:N.data,maxGlyphID:v+1}}},e}(),C_=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 uw(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=uw.encode(t,n),(i=new Xc).writeUInt16(0),i.writeUInt16(1),a.table=i.data.concat(a.subtable),a},r}(),rL=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}(),nL=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}(),iL=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 l,u,c;for(c=[],o=l=0,u=this.file.maxp.numGlyphs;0<=u?l<u:l>u;o=0<=u?++l:--l)c.push(t.readUInt32());return c}).call(this)}},r}(),aL=function(e,r){this.raw=e,this.length=e.length,this.platformID=r.platformID,this.encodingID=r.encodingID,this.languageID=r.languageID},oL=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,l,u,c,h,p,w,d;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,w=a.length;p<w;o=++p)i=a[o],t.pos=i.offset,h=t.readString(i.length),l=new aL(h,i),c[d=i.nameID]==null&&(c[d]=[]),c[i.nameID].push(l);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}(),sL=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}(),lL=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,l,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,w,d;for(d=[],h=0,p=(w=this.metrics).length;h<p;h++)o=w[h],d.push(o.advance);return d}).call(this),a=this.widths[this.widths.length-1],c=[],n=l=0;0<=i?l<i:l>i;n=0<=i?++l:--l)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}(),k_=[].slice,uL=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,l,u,c,h,p,w;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,l=(u=new Xc(n.read(i))).readShort(),h=u.readShort(),w=u.readShort(),c=u.readShort(),p=u.readShort(),this.cache[t]=l===-1?new fL(u,h,w,c,p):new cL(u,l,h,w,c,p),this.cache[t]))},r.prototype.encode=function(t,n,a){var i,o,l,u,c;for(l=[],o=[],u=0,c=n.length;u<c;u++)i=t[n[u]],o.push(l.length),i&&(l=l.concat(i.encode(a)));return o.push(l.length),{table:l,offsets:o}},r}(),cL=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}(),fL=function(){function e(r,t,n,a,i){var o,l;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;l=o.readShort(),this.glyphOffsets.push(o.pos),this.glyphIDs.push(o.readUInt16()),32&l;)o.pos+=1&l?4:2,128&l?o.pos+=8:64&l?o.pos+=4:8&l&&(o.pos+=2)}return e.prototype.encode=function(){var r,t,n;for(t=new Xc(k_.call(this.raw.data)),r=0,n=this.glyphIDs.length;r<n;++r)t.pos=this.glyphOffsets[r];return t.data},e}(),hL=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,l=0;l<a.length;++l)if(a[l]=i,o<n.length&&n[o]==l){++o,a[l]=i;var u=this.offsets[l],c=this.offsets[l+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}(),dL=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,l,u;for(a={},o=0,l=r.length;o<l;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,l,u,c,h,p,w,d,_,E,S,y;for(a in n=C_.encode(this.generateCmap(),"unicode"),o=this.glyphsFor(r),d={0:0},y=n.charMap)d[(u=y[a]).old]=u.new;for(_ in w=n.maxGlyphID,o)_ in d||(d[_]=w++);return h=function(g){var v,b;for(v in b={},g)b[g[v]]=v;return b}(d),p=Object.keys(h).sort(function(g,v){return g-v}),E=function(){var g,v,b;for(b=[],g=0,v=p.length;g<v;g++)l=p[g],b.push(h[l]);return b}(),i=this.font.glyf.encode(o,E,d),c=this.font.loca.encode(i.offsets,E),S={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&&(S["OS/2"]=this.font.os2.raw()),this.font.directory.encode(S)},e}();hr.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 l,u,c;for(c=[],l=0,u=t.length;l<u;l++)n=t[l],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(`
|
|
523
|
-
`)}return""+t},r}();window.jspdf={jsPDF:hr};dk.toggleFadeInAnimation(!1);np.setTextOverflow("change-font-size");const pL=new URLSearchParams(location.search).get("key"),L_=hk.createStore({key:pL});window.store=L_;window.config={addGlobalFont:pk.addGlobalFont,unstable_useHtmlTextRender:np.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:np.setTextVerticalResizeEnabled,unstable_setTextOverflow:np.setTextOverflow,onLoadError:t2.onLoadError,setAssetLoadTimeout:t2.setAssetLoadTimeout,setFontLoadTimeout:t2.setFontLoadTimeout,unstable_setTextSplitAllowed:np.setTextSplitAllowed};const gL=fw.createRoot(document.getElementById("root"));gL.render(Gr.createElement(fk.WorkspaceCanvas,{visiblePagesOffset:0,renderOnlyActivePage:!0,store:L_,components:{PageControls:()=>null,Tooltip:()=>null}}));export{On as _,wh as c,mp as g};
|