polotno-node 2.12.30 → 2.13.1
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 +51 -15
- package/dist/assets/html2canvas.esm-Ge7aVWlp.js +5 -0
- package/dist/assets/index-vFr48NCL.js +520 -0
- package/dist/assets/{index.es-CWfYjgqJ.js → index.es-Bm4liNaR.js} +2 -15
- package/dist/assets/purify.es-C65SP4u9.js +2 -0
- package/dist/index.html +1 -1
- package/instance.js +10 -13
- package/package.json +8 -8
- package/dist/assets/html2canvas.esm-B0tyYwQk.js +0 -22
- package/dist/assets/index-l_QMGoMi.js +0 -603
- package/dist/assets/purify.es-B6FQ9oRL.js +0 -2
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var d0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function G_(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Ig={exports:{}},qn={};var s5;function W_(){if(s5)return qn;s5=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),m=Symbol.iterator;function g(B){return B===null||typeof B!="object"?null:(B=m&&B[m]||B["@@iterator"],typeof B=="function"?B:null)}var d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,_={};function x(B,F,z){this.props=B,this.context=F,this.refs=_,this.updater=z||d}x.prototype.isReactComponent={},x.prototype.setState=function(B,F){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,F,"setState")},x.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function b(){}b.prototype=x.prototype;function S(B,F,z){this.props=B,this.context=F,this.refs=_,this.updater=z||d}var k=S.prototype=new b;k.constructor=S,y(k,x.prototype),k.isPureReactComponent=!0;var E=Array.isArray,A=Object.prototype.hasOwnProperty,R={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function I(B,F,z){var Y,J={},K=null,ie=null;if(F!=null)for(Y in F.ref!==void 0&&(ie=F.ref),F.key!==void 0&&(K=""+F.key),F)A.call(F,Y)&&!O.hasOwnProperty(Y)&&(J[Y]=F[Y]);var fe=arguments.length-2;if(fe===1)J.children=z;else if(1<fe){for(var ue=Array(fe),_e=0;_e<fe;_e++)ue[_e]=arguments[_e+2];J.children=ue}if(B&&B.defaultProps)for(Y in fe=B.defaultProps,fe)J[Y]===void 0&&(J[Y]=fe[Y]);return{$$typeof:e,type:B,key:K,ref:ie,props:J,_owner:R.current}}function j(B,F){return{$$typeof:e,type:B.type,key:F,ref:B.ref,props:B.props,_owner:B._owner}}function D(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function C(B){var F={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(z){return F[z]})}var N=/\/+/g;function $(B,F){return typeof B=="object"&&B!==null&&B.key!=null?C(""+B.key):F.toString(36)}function G(B,F,z,Y,J){var K=typeof B;(K==="undefined"||K==="boolean")&&(B=null);var ie=!1;if(B===null)ie=!0;else switch(K){case"string":case"number":ie=!0;break;case"object":switch(B.$$typeof){case e:case t:ie=!0}}if(ie)return ie=B,J=J(ie),B=Y===""?"."+$(ie,0):Y,E(J)?(z="",B!=null&&(z=B.replace(N,"$&/")+"/"),G(J,F,z,"",function(_e){return _e})):J!=null&&(D(J)&&(J=j(J,z+(!J.key||ie&&ie.key===J.key?"":(""+J.key).replace(N,"$&/")+"/")+B)),F.push(J)),1;if(ie=0,Y=Y===""?".":Y+":",E(B))for(var fe=0;fe<B.length;fe++){K=B[fe];var ue=Y+$(K,fe);ie+=G(K,F,z,ue,J)}else if(ue=g(B),typeof ue=="function")for(B=ue.call(B),fe=0;!(K=B.next()).done;)K=K.value,ue=Y+$(K,fe++),ie+=G(K,F,z,ue,J);else if(K==="object")throw F=String(B),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.");return ie}function te(B,F,z){if(B==null)return B;var Y=[],J=0;return G(B,Y,"","",function(K){return F.call(z,K,J++)}),Y}function se(B){if(B._status===-1){var F=B._result;F=F(),F.then(function(z){(B._status===0||B._status===-1)&&(B._status=1,B._result=z)},function(z){(B._status===0||B._status===-1)&&(B._status=2,B._result=z)}),B._status===-1&&(B._status=0,B._result=F)}if(B._status===1)return B._result.default;throw B._result}var ee={current:null},Q={transition:null},re={ReactCurrentDispatcher:ee,ReactCurrentBatchConfig:Q,ReactCurrentOwner:R};function X(){throw Error("act(...) is not supported in production builds of React.")}return qn.Children={map:te,forEach:function(B,F,z){te(B,function(){F.apply(this,arguments)},z)},count:function(B){var F=0;return te(B,function(){F++}),F},toArray:function(B){return te(B,function(F){return F})||[]},only:function(B){if(!D(B))throw Error("React.Children.only expected to receive a single React element child.");return B}},qn.Component=x,qn.Fragment=n,qn.Profiler=i,qn.PureComponent=S,qn.StrictMode=r,qn.Suspense=u,qn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=re,qn.act=X,qn.cloneElement=function(B,F,z){if(B==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+B+".");var Y=y({},B.props),J=B.key,K=B.ref,ie=B._owner;if(F!=null){if(F.ref!==void 0&&(K=F.ref,ie=R.current),F.key!==void 0&&(J=""+F.key),B.type&&B.type.defaultProps)var fe=B.type.defaultProps;for(ue in F)A.call(F,ue)&&!O.hasOwnProperty(ue)&&(Y[ue]=F[ue]===void 0&&fe!==void 0?fe[ue]:F[ue])}var ue=arguments.length-2;if(ue===1)Y.children=z;else if(1<ue){fe=Array(ue);for(var _e=0;_e<ue;_e++)fe[_e]=arguments[_e+2];Y.children=fe}return{$$typeof:e,type:B.type,key:J,ref:K,props:Y,_owner:ie}},qn.createContext=function(B){return B={$$typeof:o,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},B.Provider={$$typeof:a,_context:B},B.Consumer=B},qn.createElement=I,qn.createFactory=function(B){var F=I.bind(null,B);return F.type=B,F},qn.createRef=function(){return{current:null}},qn.forwardRef=function(B){return{$$typeof:s,render:B}},qn.isValidElement=D,qn.lazy=function(B){return{$$typeof:c,_payload:{_status:-1,_result:B},_init:se}},qn.memo=function(B,F){return{$$typeof:h,type:B,compare:F===void 0?null:F}},qn.startTransition=function(B){var F=Q.transition;Q.transition={};try{B()}finally{Q.transition=F}},qn.unstable_act=X,qn.useCallback=function(B,F){return ee.current.useCallback(B,F)},qn.useContext=function(B){return ee.current.useContext(B)},qn.useDebugValue=function(){},qn.useDeferredValue=function(B){return ee.current.useDeferredValue(B)},qn.useEffect=function(B,F){return ee.current.useEffect(B,F)},qn.useId=function(){return ee.current.useId()},qn.useImperativeHandle=function(B,F,z){return ee.current.useImperativeHandle(B,F,z)},qn.useInsertionEffect=function(B,F){return ee.current.useInsertionEffect(B,F)},qn.useLayoutEffect=function(B,F){return ee.current.useLayoutEffect(B,F)},qn.useMemo=function(B,F){return ee.current.useMemo(B,F)},qn.useReducer=function(B,F,z){return ee.current.useReducer(B,F,z)},qn.useRef=function(B){return ee.current.useRef(B)},qn.useState=function(B){return ee.current.useState(B)},qn.useSyncExternalStore=function(B,F,z){return ee.current.useSyncExternalStore(B,F,z)},qn.useTransition=function(){return ee.current.useTransition()},qn.version="18.3.1",qn}var l5;function Mp(){return l5||(l5=1,Ig.exports=W_()),Ig.exports}var Di=Mp();const oe=yh(Di);var x1={},jg={exports:{}},Cs={},Dg={exports:{}},Fg={};var u5;function V_(){return u5||(u5=1,(function(e){function t(Q,re){var X=Q.length;Q.push(re);e:for(;0<X;){var B=X-1>>>1,F=Q[B];if(0<i(F,re))Q[B]=re,Q[X]=F,X=B;else break e}}function n(Q){return Q.length===0?null:Q[0]}function r(Q){if(Q.length===0)return null;var re=Q[0],X=Q.pop();if(X!==re){Q[0]=X;e:for(var B=0,F=Q.length,z=F>>>1;B<z;){var Y=2*(B+1)-1,J=Q[Y],K=Y+1,ie=Q[K];if(0>i(J,X))K<F&&0>i(ie,J)?(Q[B]=ie,Q[K]=X,B=K):(Q[B]=J,Q[Y]=X,B=Y);else if(K<F&&0>i(ie,X))Q[B]=ie,Q[K]=X,B=K;else break e}}return re}function i(Q,re){var X=Q.sortIndex-re.sortIndex;return X!==0?X:Q.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var u=[],h=[],c=1,m=null,g=3,d=!1,y=!1,_=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(Q){for(var re=n(h);re!==null;){if(re.callback===null)r(h);else if(re.startTime<=Q)r(h),re.sortIndex=re.expirationTime,t(u,re);else break;re=n(h)}}function E(Q){if(_=!1,k(Q),!y)if(n(u)!==null)y=!0,se(A);else{var re=n(h);re!==null&&ee(E,re.startTime-Q)}}function A(Q,re){y=!1,_&&(_=!1,b(I),I=-1),d=!0;var X=g;try{for(k(re),m=n(u);m!==null&&(!(m.expirationTime>re)||Q&&!C());){var B=m.callback;if(typeof B=="function"){m.callback=null,g=m.priorityLevel;var F=B(m.expirationTime<=re);re=e.unstable_now(),typeof F=="function"?m.callback=F:m===n(u)&&r(u),k(re)}else r(u);m=n(u)}if(m!==null)var z=!0;else{var Y=n(h);Y!==null&&ee(E,Y.startTime-re),z=!1}return z}finally{m=null,g=X,d=!1}}var R=!1,O=null,I=-1,j=5,D=-1;function C(){return!(e.unstable_now()-D<j)}function N(){if(O!==null){var Q=e.unstable_now();D=Q;var re=!0;try{re=O(!0,Q)}finally{re?$():(R=!1,O=null)}}else R=!1}var $;if(typeof S=="function")$=function(){S(N)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,te=G.port2;G.port1.onmessage=N,$=function(){te.postMessage(null)}}else $=function(){x(N,0)};function se(Q){O=Q,R||(R=!0,$())}function ee(Q,re){I=x(function(){Q(e.unstable_now())},re)}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(Q){Q.callback=null},e.unstable_continueExecution=function(){y||d||(y=!0,se(A))},e.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<Q?Math.floor(1e3/Q):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(Q){switch(g){case 1:case 2:case 3:var re=3;break;default:re=g}var X=g;g=re;try{return Q()}finally{g=X}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Q,re){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var X=g;g=Q;try{return re()}finally{g=X}},e.unstable_scheduleCallback=function(Q,re,X){var B=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?B+X:B):X=B,Q){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=X+F,Q={id:c++,callback:re,priorityLevel:Q,startTime:X,expirationTime:F,sortIndex:-1},X>B?(Q.sortIndex=X,t(h,Q),n(u)===null&&Q===n(h)&&(_?(b(I),I=-1):_=!0,ee(E,X-B))):(Q.sortIndex=F,t(u,Q),y||d||(y=!0,se(A))),Q},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(Q){var re=g;return function(){var X=g;g=re;try{return Q.apply(this,arguments)}finally{g=X}}}})(Fg)),Fg}var c5;function qv(){return c5||(c5=1,Dg.exports=V_()),Dg.exports}var f5;function Y_(){if(f5)return Cs;f5=1;var e=Mp(),t=qv();function n(l){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+l,w=1;w<arguments.length;w++)f+="&args[]="+encodeURIComponent(arguments[w]);return"Minified React error #"+l+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function a(l,f){o(l,f),o(l+"Capture",f)}function o(l,f){for(i[l]=f,l=0;l<f.length;l++)r.add(f[l])}var s=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,h=/^[: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]*$/,c={},m={};function g(l){return u.call(m,l)?!0:u.call(c,l)?!1:h.test(l)?m[l]=!0:(c[l]=!0,!1)}function d(l,f,w,T){if(w!==null&&w.type===0)return!1;switch(typeof f){case"function":case"symbol":return!0;case"boolean":return T?!1:w!==null?!w.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function y(l,f,w,T){if(f===null||typeof f>"u"||d(l,f,w,T))return!0;if(T)return!1;if(w!==null)switch(w.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 _(l,f,w,T,H,Z,he){this.acceptsBooleans=f===2||f===3||f===4,this.attributeName=T,this.attributeNamespace=H,this.mustUseProperty=w,this.propertyName=l,this.type=f,this.sanitizeURL=Z,this.removeEmptyString=he}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){x[l]=new _(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var f=l[0];x[f]=new _(f,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){x[l]=new _(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){x[l]=new _(l,2,!1,l,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(l){x[l]=new _(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){x[l]=new _(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){x[l]=new _(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){x[l]=new _(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){x[l]=new _(l,5,!1,l.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function S(l){return l[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(l){var f=l.replace(b,S);x[f]=new _(f,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var f=l.replace(b,S);x[f]=new _(f,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var f=l.replace(b,S);x[f]=new _(f,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){x[l]=new _(l,1,!1,l.toLowerCase(),null,!1,!1)}),x.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){x[l]=new _(l,1,!1,l.toLowerCase(),null,!0,!0)});function k(l,f,w,T){var H=x.hasOwnProperty(f)?x[f]:null;(H!==null?H.type!==0:T||!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(y(f,w,H,T)&&(w=null),T||H===null?g(f)&&(w===null?l.removeAttribute(f):l.setAttribute(f,""+w)):H.mustUseProperty?l[H.propertyName]=w===null?H.type===3?!1:"":w:(f=H.attributeName,T=H.attributeNamespace,w===null?l.removeAttribute(f):(H=H.type,w=H===3||H===4&&w===!0?"":""+w,T?l.setAttributeNS(T,f,w):l.setAttribute(f,w))))}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),R=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),C=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),se=Symbol.for("react.lazy"),ee=Symbol.for("react.offscreen"),Q=Symbol.iterator;function re(l){return l===null||typeof l!="object"?null:(l=Q&&l[Q]||l["@@iterator"],typeof l=="function"?l:null)}var X=Object.assign,B;function F(l){if(B===void 0)try{throw Error()}catch(w){var f=w.stack.trim().match(/\n( *(at )?)/);B=f&&f[1]||""}return`
|
|
2
|
+
`+B+l}var z=!1;function Y(l,f){if(!l||z)return"";z=!0;var w=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(at){var T=at}Reflect.construct(l,[],f)}else{try{f.call()}catch(at){T=at}l.call(f.prototype)}else{try{throw Error()}catch(at){T=at}l()}}catch(at){if(at&&T&&typeof at.stack=="string"){for(var H=at.stack.split(`
|
|
3
|
+
`),Z=T.stack.split(`
|
|
4
|
+
`),he=H.length-1,Ne=Z.length-1;1<=he&&0<=Ne&&H[he]!==Z[Ne];)Ne--;for(;1<=he&&0<=Ne;he--,Ne--)if(H[he]!==Z[Ne]){if(he!==1||Ne!==1)do if(he--,Ne--,0>Ne||H[he]!==Z[Ne]){var Fe=`
|
|
5
|
+
`+H[he].replace(" at new "," at ");return l.displayName&&Fe.includes("<anonymous>")&&(Fe=Fe.replace("<anonymous>",l.displayName)),Fe}while(1<=he&&0<=Ne);break}}}finally{z=!1,Error.prepareStackTrace=w}return(l=l?l.displayName||l.name:"")?F(l):""}function J(l){switch(l.tag){case 5:return F(l.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return l=Y(l.type,!1),l;case 11:return l=Y(l.type.render,!1),l;case 1:return l=Y(l.type,!0),l;default:return""}}function K(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case O:return"Fragment";case R:return"Portal";case j:return"Profiler";case I:return"StrictMode";case $:return"Suspense";case G:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case C:return(l.displayName||"Context")+".Consumer";case D:return(l._context.displayName||"Context")+".Provider";case N:var f=l.render;return l=l.displayName,l||(l=f.displayName||f.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case te:return f=l.displayName||null,f!==null?f:K(l.type)||"Memo";case se:f=l._payload,l=l._init;try{return K(l(f))}catch{}}return null}function ie(l){var f=l.type;switch(l.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 l=f.render,l=l.displayName||l.name||"",f.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return f;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return K(f);case 8:return f===I?"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 fe(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function ue(l){var f=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(f==="checkbox"||f==="radio")}function _e(l){var f=ue(l)?"checked":"value",w=Object.getOwnPropertyDescriptor(l.constructor.prototype,f),T=""+l[f];if(!l.hasOwnProperty(f)&&typeof w<"u"&&typeof w.get=="function"&&typeof w.set=="function"){var H=w.get,Z=w.set;return Object.defineProperty(l,f,{configurable:!0,get:function(){return H.call(this)},set:function(he){T=""+he,Z.call(this,he)}}),Object.defineProperty(l,f,{enumerable:w.enumerable}),{getValue:function(){return T},setValue:function(he){T=""+he},stopTracking:function(){l._valueTracker=null,delete l[f]}}}}function Ce(l){l._valueTracker||(l._valueTracker=_e(l))}function $e(l){if(!l)return!1;var f=l._valueTracker;if(!f)return!0;var w=f.getValue(),T="";return l&&(T=ue(l)?l.checked?"true":"false":l.value),l=T,l!==w?(f.setValue(l),!0):!1}function ze(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function tt(l,f){var w=f.checked;return X({},f,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:w??l._wrapperState.initialChecked})}function pe(l,f){var w=f.defaultValue==null?"":f.defaultValue,T=f.checked!=null?f.checked:f.defaultChecked;w=fe(f.value!=null?f.value:w),l._wrapperState={initialChecked:T,initialValue:w,controlled:f.type==="checkbox"||f.type==="radio"?f.checked!=null:f.value!=null}}function ut(l,f){f=f.checked,f!=null&&k(l,"checked",f,!1)}function be(l,f){ut(l,f);var w=fe(f.value),T=f.type;if(w!=null)T==="number"?(w===0&&l.value===""||l.value!=w)&&(l.value=""+w):l.value!==""+w&&(l.value=""+w);else if(T==="submit"||T==="reset"){l.removeAttribute("value");return}f.hasOwnProperty("value")?xe(l,f.type,w):f.hasOwnProperty("defaultValue")&&xe(l,f.type,fe(f.defaultValue)),f.checked==null&&f.defaultChecked!=null&&(l.defaultChecked=!!f.defaultChecked)}function ge(l,f,w){if(f.hasOwnProperty("value")||f.hasOwnProperty("defaultValue")){var T=f.type;if(!(T!=="submit"&&T!=="reset"||f.value!==void 0&&f.value!==null))return;f=""+l._wrapperState.initialValue,w||f===l.value||(l.value=f),l.defaultValue=f}w=l.name,w!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,w!==""&&(l.name=w)}function xe(l,f,w){(f!=="number"||ze(l.ownerDocument)!==l)&&(w==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+w&&(l.defaultValue=""+w))}var Te=Array.isArray;function Me(l,f,w,T){if(l=l.options,f){f={};for(var H=0;H<w.length;H++)f["$"+w[H]]=!0;for(w=0;w<l.length;w++)H=f.hasOwnProperty("$"+l[w].value),l[w].selected!==H&&(l[w].selected=H),H&&T&&(l[w].defaultSelected=!0)}else{for(w=""+fe(w),f=null,H=0;H<l.length;H++){if(l[H].value===w){l[H].selected=!0,T&&(l[H].defaultSelected=!0);return}f!==null||l[H].disabled||(f=l[H])}f!==null&&(f.selected=!0)}}function ve(l,f){if(f.dangerouslySetInnerHTML!=null)throw Error(n(91));return X({},f,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function ye(l,f){var w=f.value;if(w==null){if(w=f.children,f=f.defaultValue,w!=null){if(f!=null)throw Error(n(92));if(Te(w)){if(1<w.length)throw Error(n(93));w=w[0]}f=w}f==null&&(f=""),w=f}l._wrapperState={initialValue:fe(w)}}function we(l,f){var w=fe(f.value),T=fe(f.defaultValue);w!=null&&(w=""+w,w!==l.value&&(l.value=w),f.defaultValue==null&&l.defaultValue!==w&&(l.defaultValue=w)),T!=null&&(l.defaultValue=""+T)}function je(l){var f=l.textContent;f===l._wrapperState.initialValue&&f!==""&&f!==null&&(l.value=f)}function Le(l){switch(l){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ye(l,f){return l==null||l==="http://www.w3.org/1999/xhtml"?Le(f):l==="http://www.w3.org/2000/svg"&&f==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var lt,rt=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(f,w,T,H){MSApp.execUnsafeLocalFunction(function(){return l(f,w,T,H)})}:l})(function(l,f){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=f;else{for(lt=lt||document.createElement("div"),lt.innerHTML="<svg>"+f.valueOf().toString()+"</svg>",f=lt.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;f.firstChild;)l.appendChild(f.firstChild)}});function ot(l,f){if(f){var w=l.firstChild;if(w&&w===l.lastChild&&w.nodeType===3){w.nodeValue=f;return}}l.textContent=f}var dt={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},Ct=["Webkit","ms","Moz","O"];Object.keys(dt).forEach(function(l){Ct.forEach(function(f){f=f+l.charAt(0).toUpperCase()+l.substring(1),dt[f]=dt[l]})});function Zt(l,f,w){return f==null||typeof f=="boolean"||f===""?"":w||typeof f!="number"||f===0||dt.hasOwnProperty(l)&&dt[l]?(""+f).trim():f+"px"}function on(l,f){l=l.style;for(var w in f)if(f.hasOwnProperty(w)){var T=w.indexOf("--")===0,H=Zt(w,f[w],T);w==="float"&&(w="cssFloat"),T?l.setProperty(w,H):l[w]=H}}var an=X({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 We(l,f){if(f){if(an[l]&&(f.children!=null||f.dangerouslySetInnerHTML!=null))throw Error(n(137,l));if(f.dangerouslySetInnerHTML!=null){if(f.children!=null)throw Error(n(60));if(typeof f.dangerouslySetInnerHTML!="object"||!("__html"in f.dangerouslySetInnerHTML))throw Error(n(61))}if(f.style!=null&&typeof f.style!="object")throw Error(n(62))}}function Be(l,f){if(l.indexOf("-")===-1)return typeof f.is=="string";switch(l){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $t=null;function At(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var Lt=null,Tt=null,tn=null;function Wt(l){if(l=Eu(l)){if(typeof Lt!="function")throw Error(n(280));var f=l.stateNode;f&&(f=Mi(f),Lt(l.stateNode,l.type,f))}}function hn(l){Tt?tn?tn.push(l):tn=[l]:Tt=l}function bi(){if(Tt){var l=Tt,f=tn;if(tn=Tt=null,Wt(l),f)for(l=0;l<f.length;l++)Wt(f[l])}}function nr(l,f){return l(f)}function ei(){}var dr=!1;function Jt(l,f,w){if(dr)return l(f,w);dr=!0;try{return nr(l,f,w)}finally{dr=!1,(Tt!==null||tn!==null)&&(ei(),bi())}}function ua(l,f){var w=l.stateNode;if(w===null)return null;var T=Mi(w);if(T===null)return null;w=T[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":(T=!T.disabled)||(l=l.type,T=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!T;break e;default:l=!1}if(l)return null;if(w&&typeof w!="function")throw Error(n(231,f,typeof w));return w}var Fa=!1;if(s)try{var ti={};Object.defineProperty(ti,"passive",{get:function(){Fa=!0}}),window.addEventListener("test",ti,ti),window.removeEventListener("test",ti,ti)}catch{Fa=!1}function Ki(l,f,w,T,H,Z,he,Ne,Fe){var at=Array.prototype.slice.call(arguments,3);try{f.apply(w,at)}catch(bt){this.onError(bt)}}var Hn=!1,Or=null,Dr=!1,Ea=null,Go={onError:function(l){Hn=!0,Or=l}};function ka(l,f,w,T,H,Z,he,Ne,Fe){Hn=!1,Or=null,Ki.apply(Go,arguments)}function io(l,f,w,T,H,Z,he,Ne,Fe){if(ka.apply(this,arguments),Hn){if(Hn){var at=Or;Hn=!1,Or=null}else throw Error(n(198));Dr||(Dr=!0,Ea=at)}}function ui(l){var f=l,w=l;if(l.alternate)for(;f.return;)f=f.return;else{l=f;do f=l,(f.flags&4098)!==0&&(w=f.return),l=f.return;while(l)}return f.tag===3?w:null}function Aa(l){if(l.tag===13){var f=l.memoizedState;if(f===null&&(l=l.alternate,l!==null&&(f=l.memoizedState)),f!==null)return f.dehydrated}return null}function Pa(l){if(ui(l)!==l)throw Error(n(188))}function Wo(l){var f=l.alternate;if(!f){if(f=ui(l),f===null)throw Error(n(188));return f!==l?null:l}for(var w=l,T=f;;){var H=w.return;if(H===null)break;var Z=H.alternate;if(Z===null){if(T=H.return,T!==null){w=T;continue}break}if(H.child===Z.child){for(Z=H.child;Z;){if(Z===w)return Pa(H),l;if(Z===T)return Pa(H),f;Z=Z.sibling}throw Error(n(188))}if(w.return!==T.return)w=H,T=Z;else{for(var he=!1,Ne=H.child;Ne;){if(Ne===w){he=!0,w=H,T=Z;break}if(Ne===T){he=!0,T=H,w=Z;break}Ne=Ne.sibling}if(!he){for(Ne=Z.child;Ne;){if(Ne===w){he=!0,w=Z,T=H;break}if(Ne===T){he=!0,T=Z,w=H;break}Ne=Ne.sibling}if(!he)throw Error(n(189))}}if(w.alternate!==T)throw Error(n(190))}if(w.tag!==3)throw Error(n(188));return w.stateNode.current===w?l:f}function zi(l){return l=Wo(l),l!==null?ao(l):null}function ao(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var f=ao(l);if(f!==null)return f;l=l.sibling}return null}var Fs=t.unstable_scheduleCallback,as=t.unstable_cancelCallback,fu=t.unstable_shouldYield,If=t.unstable_requestPaint,Cr=t.unstable_now,hu=t.unstable_getCurrentPriorityLevel,os=t.unstable_ImmediatePriority,Oa=t.unstable_UserBlockingPriority,ss=t.unstable_NormalPriority,Cc=t.unstable_LowPriority,hl=t.unstable_IdlePriority,Po=null,wi=null;function pr(l){if(wi&&typeof wi.onCommitFiberRoot=="function")try{wi.onCommitFiberRoot(Po,l,void 0,(l.current.flags&128)===128)}catch{}}var wn=Math.clz32?Math.clz32:Gn,oo=Math.log,Ui=Math.LN2;function Gn(l){return l>>>=0,l===0?32:31-(oo(l)/Ui|0)|0}var so=64,qi=4194304;function qr(l){switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function ls(l,f){var w=l.pendingLanes;if(w===0)return 0;var T=0,H=l.suspendedLanes,Z=l.pingedLanes,he=w&268435455;if(he!==0){var Ne=he&~H;Ne!==0?T=qr(Ne):(Z&=he,Z!==0&&(T=qr(Z)))}else he=w&~H,he!==0?T=qr(he):Z!==0&&(T=qr(Z));if(T===0)return 0;if(f!==0&&f!==T&&(f&H)===0&&(H=T&-T,Z=f&-f,H>=Z||H===16&&(Z&4194240)!==0))return f;if((T&4)!==0&&(T|=w&16),f=l.entangledLanes,f!==0)for(l=l.entanglements,f&=T;0<f;)w=31-wn(f),H=1<<w,T|=l[w],f&=~H;return T}function lo(l,f){switch(l){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 xi(l,f){for(var w=l.suspendedLanes,T=l.pingedLanes,H=l.expirationTimes,Z=l.pendingLanes;0<Z;){var he=31-wn(Z),Ne=1<<he,Fe=H[he];Fe===-1?((Ne&w)===0||(Ne&T)!==0)&&(H[he]=lo(Ne,f)):Fe<=f&&(l.expiredLanes|=Ne),Z&=~Ne}}function Ba(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function du(){var l=so;return so<<=1,(so&4194240)===0&&(so=64),l}function Ca(l){for(var f=[],w=0;31>w;w++)f.push(l);return f}function Rl(l,f,w){l.pendingLanes|=f,f!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,f=31-wn(f),l[f]=w}function us(l,f){var w=l.pendingLanes&~f;l.pendingLanes=f,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=f,l.mutableReadLanes&=f,l.entangledLanes&=f,f=l.entanglements;var T=l.eventTimes;for(l=l.expirationTimes;0<w;){var H=31-wn(w),Z=1<<H;f[H]=0,T[H]=-1,l[H]=-1,w&=~Z}}function pu(l,f){var w=l.entangledLanes|=f;for(l=l.entanglements;w;){var T=31-wn(w),H=1<<T;H&f|l[T]&f&&(l[T]|=f),w&=~H}}var jn=0;function cs(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var Oo,dl,Lc,Nc,pl,Ml=!1,ca=[],za=null,Ua=null,qa=null,Ln=new Map,cn=new Map,Co=[],Tc="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 Rc(l,f){switch(l){case"focusin":case"focusout":za=null;break;case"dragenter":case"dragleave":Ua=null;break;case"mouseover":case"mouseout":qa=null;break;case"pointerover":case"pointerout":Ln.delete(f.pointerId);break;case"gotpointercapture":case"lostpointercapture":cn.delete(f.pointerId)}}function uo(l,f,w,T,H,Z){return l===null||l.nativeEvent!==Z?(l={blockedOn:f,domEventName:w,eventSystemFlags:T,nativeEvent:Z,targetContainers:[H]},f!==null&&(f=Eu(f),f!==null&&dl(f)),l):(l.eventSystemFlags|=T,f=l.targetContainers,H!==null&&f.indexOf(H)===-1&&f.push(H),l)}function Er(l,f,w,T,H){switch(f){case"focusin":return za=uo(za,l,f,w,T,H),!0;case"dragenter":return Ua=uo(Ua,l,f,w,T,H),!0;case"mouseover":return qa=uo(qa,l,f,w,T,H),!0;case"pointerover":var Z=H.pointerId;return Ln.set(Z,uo(Ln.get(Z)||null,l,f,w,T,H)),!0;case"gotpointercapture":return Z=H.pointerId,cn.set(Z,uo(cn.get(Z)||null,l,f,w,T,H)),!0}return!1}function gu(l){var f=Qs(l.target);if(f!==null){var w=ui(f);if(w!==null){if(f=w.tag,f===13){if(f=Aa(w),f!==null){l.blockedOn=f,pl(l.priority,function(){Lc(w)});return}}else if(f===3&&w.stateNode.current.memoizedState.isDehydrated){l.blockedOn=w.tag===3?w.stateNode.containerInfo:null;return}}}l.blockedOn=null}function mu(l){if(l.blockedOn!==null)return!1;for(var f=l.targetContainers;0<f.length;){var w=gl(l.domEventName,l.eventSystemFlags,f[0],l.nativeEvent);if(w===null){w=l.nativeEvent;var T=new w.constructor(w.type,w);$t=T,w.target.dispatchEvent(T),$t=null}else return f=Eu(w),f!==null&&dl(f),l.blockedOn=w,!1;f.shift()}return!0}function Bs(l,f,w){mu(l)&&w.delete(f)}function Ku(){Ml=!1,za!==null&&mu(za)&&(za=null),Ua!==null&&mu(Ua)&&(Ua=null),qa!==null&&mu(qa)&&(qa=null),Ln.forEach(Bs),cn.forEach(Bs)}function $a(l,f){l.blockedOn===f&&(l.blockedOn=null,Ml||(Ml=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ku)))}function fa(l){function f(H){return $a(H,l)}if(0<ca.length){$a(ca[0],l);for(var w=1;w<ca.length;w++){var T=ca[w];T.blockedOn===l&&(T.blockedOn=null)}}for(za!==null&&$a(za,l),Ua!==null&&$a(Ua,l),qa!==null&&$a(qa,l),Ln.forEach(f),cn.forEach(f),w=0;w<Co.length;w++)T=Co[w],T.blockedOn===l&&(T.blockedOn=null);for(;0<Co.length&&(w=Co[0],w.blockedOn===null);)gu(w),w.blockedOn===null&&Co.shift()}var Ha=E.ReactCurrentBatchConfig,vu=!0;function La(l,f,w,T){var H=jn,Z=Ha.transition;Ha.transition=null;try{jn=1,zs(l,f,w,T)}finally{jn=H,Ha.transition=Z}}function co(l,f,w,T){var H=jn,Z=Ha.transition;Ha.transition=null;try{jn=4,zs(l,f,w,T)}finally{jn=H,Ha.transition=Z}}function zs(l,f,w,T){if(vu){var H=gl(l,f,w,T);if(H===null)xu(l,f,T,Ga,w),Rc(l,T);else if(Er(H,l,f,w,T))T.stopPropagation();else if(Rc(l,T),f&4&&-1<Tc.indexOf(l)){for(;H!==null;){var Z=Eu(H);if(Z!==null&&Oo(Z),Z=gl(l,f,w,T),Z===null&&xu(l,f,T,Ga,w),Z===H)break;H=Z}H!==null&&T.stopPropagation()}else xu(l,f,T,null,w)}}var Ga=null;function gl(l,f,w,T){if(Ga=null,l=At(T),l=Qs(l),l!==null)if(f=ui(l),f===null)l=null;else if(w=f.tag,w===13){if(l=Aa(f),l!==null)return l;l=null}else if(w===3){if(f.stateNode.current.memoizedState.isDehydrated)return f.tag===3?f.stateNode.containerInfo:null;l=null}else f!==l&&(l=null);return Ga=l,null}function Il(l){switch(l){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(hu()){case os:return 1;case Oa:return 4;case ss:case Cc:return 16;case hl:return 536870912;default:return 16}default:return 16}}var ci=null,Wa=null,fo=null;function ml(){if(fo)return fo;var l,f=Wa,w=f.length,T,H="value"in ci?ci.value:ci.textContent,Z=H.length;for(l=0;l<w&&f[l]===H[l];l++);var he=w-l;for(T=1;T<=he&&f[w-T]===H[Z-T];T++);return fo=H.slice(l,1<T?1-T:void 0)}function fs(l){var f=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&f===13&&(l=13)):l=f,l===10&&(l=13),32<=l||l===13?l:0}function $r(){return!0}function fi(){return!1}function ni(l){function f(w,T,H,Z,he){this._reactName=w,this._targetInst=H,this.type=T,this.nativeEvent=Z,this.target=he,this.currentTarget=null;for(var Ne in l)l.hasOwnProperty(Ne)&&(w=l[Ne],this[Ne]=w?w(Z):Z[Ne]);return this.isDefaultPrevented=(Z.defaultPrevented!=null?Z.defaultPrevented:Z.returnValue===!1)?$r:fi,this.isPropagationStopped=fi,this}return X(f.prototype,{preventDefault:function(){this.defaultPrevented=!0;var w=this.nativeEvent;w&&(w.preventDefault?w.preventDefault():typeof w.returnValue!="unknown"&&(w.returnValue=!1),this.isDefaultPrevented=$r)},stopPropagation:function(){var w=this.nativeEvent;w&&(w.stopPropagation?w.stopPropagation():typeof w.cancelBubble!="unknown"&&(w.cancelBubble=!0),this.isPropagationStopped=$r)},persist:function(){},isPersistent:$r}),f}var _i={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Va=ni(_i),q=X({},_i,{view:0,detail:0}),ce=ni(q),Oe,Ie,He,ft=X({},q,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vo,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==He&&(He&&l.type==="mousemove"?(Oe=l.screenX-He.screenX,Ie=l.screenY-He.screenY):Ie=Oe=0,He=l),Oe)},movementY:function(l){return"movementY"in l?l.movementY:Ie}}),pt=ni(ft),Ft=X({},ft,{dataTransfer:0}),jt=ni(Ft),mn=X({},q,{relatedTarget:0}),xn=ni(mn),Dn=X({},_i,{animationName:0,elapsedTime:0,pseudoElement:0}),Lr=ni(Dn),hi=X({},_i,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),lr=ni(hi),Si=X({},_i,{data:0}),kr=ni(Si),Li={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Us={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"},Ya={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qs(l){var f=this.nativeEvent;return f.getModifierState?f.getModifierState(l):(l=Ya[l])?!!f[l]:!1}function Vo(){return qs}var $s=X({},q,{key:function(l){if(l.key){var f=Li[l.key]||l.key;if(f!=="Unidentified")return f}return l.type==="keypress"?(l=fs(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?Us[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vo,charCode:function(l){return l.type==="keypress"?fs(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?fs(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),Hs=ni($s),vl=X({},ft,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ho=ni(vl),Gs=X({},q,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vo}),Ei=ni(Gs),hs=X({},_i,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lo=ni(hs),jl=X({},ft,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),Dl=ni(jl),ha=[9,13,27,32],po=s&&"CompositionEvent"in window,No=null;s&&"documentMode"in document&&(No=document.documentMode);var Ws=s&&"TextEvent"in window&&!No,Fr=s&&(!po||No&&8<No&&11>=No),Xa=" ",yl=!1;function Fl(l,f){switch(l){case"keyup":return ha.indexOf(f.keyCode)!==-1;case"keydown":return f.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $i(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Ni=!1;function Na(l,f){switch(l){case"compositionend":return $i(f);case"keypress":return f.which!==32?null:(yl=!0,Xa);case"textInput":return l=f.data,l===Xa&&yl?null:l;default:return null}}function Ka(l,f){if(Ni)return l==="compositionend"||!po&&Fl(l,f)?(l=ml(),fo=Wa=ci=null,Ni=!1,l):null;switch(l){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 Fr&&f.locale!=="ko"?null:f.data;default:return null}}var da={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 Zi(l){var f=l&&l.nodeName&&l.nodeName.toLowerCase();return f==="input"?!!da[l.type]:f==="textarea"}function To(l,f,w,T){hn(T),f=zc(f,"onChange"),0<f.length&&(w=new Va("onChange","change",null,w,T),l.push({event:w,listeners:f}))}var ds=null,go=null;function ri(l){bu(l,0)}function Yo(l){var f=ki(l);if($e(f))return l}function di(l,f){if(l==="change")return f}var Ta=!1;if(s){var Ro;if(s){var pa="oninput"in document;if(!pa){var bl=document.createElement("div");bl.setAttribute("oninput","return;"),pa=typeof bl.oninput=="function"}Ro=pa}else Ro=!1;Ta=Ro&&(!document.documentMode||9<document.documentMode)}function Xo(){ds&&(ds.detachEvent("onpropertychange",ps),go=ds=null)}function ps(l){if(l.propertyName==="value"&&Yo(go)){var f=[];To(f,go,l,At(l)),Jt(ri,f)}}function gs(l,f,w){l==="focusin"?(Xo(),ds=f,go=w,ds.attachEvent("onpropertychange",ps)):l==="focusout"&&Xo()}function rr(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Yo(go)}function ms(l,f){if(l==="click")return Yo(f)}function vs(l,f){if(l==="input"||l==="change")return Yo(f)}function Vs(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}var Nr=typeof Object.is=="function"?Object.is:Vs;function ga(l,f){if(Nr(l,f))return!0;if(typeof l!="object"||l===null||typeof f!="object"||f===null)return!1;var w=Object.keys(l),T=Object.keys(f);if(w.length!==T.length)return!1;for(T=0;T<w.length;T++){var H=w[T];if(!u.call(f,H)||!Nr(l[H],f[H]))return!1}return!0}function Rn(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function fn(l,f){var w=Rn(l);l=0;for(var T;w;){if(w.nodeType===3){if(T=l+w.textContent.length,l<=f&&T>=f)return{node:w,offset:f-l};l=T}e:{for(;w;){if(w.nextSibling){w=w.nextSibling;break e}w=w.parentNode}w=void 0}w=Rn(w)}}function Pn(l,f){return l&&f?l===f?!0:l&&l.nodeType===3?!1:f&&f.nodeType===3?Pn(l,f.parentNode):"contains"in l?l.contains(f):l.compareDocumentPosition?!!(l.compareDocumentPosition(f)&16):!1:!1}function Mn(){for(var l=window,f=ze();f instanceof l.HTMLIFrameElement;){try{var w=typeof f.contentWindow.location.href=="string"}catch{w=!1}if(w)l=f.contentWindow;else break;f=ze(l.document)}return f}function Za(l){var f=l&&l.nodeName&&l.nodeName.toLowerCase();return f&&(f==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||f==="textarea"||l.contentEditable==="true")}function Ys(l){var f=Mn(),w=l.focusedElem,T=l.selectionRange;if(f!==w&&w&&w.ownerDocument&&Pn(w.ownerDocument.documentElement,w)){if(T!==null&&Za(w)){if(f=T.start,l=T.end,l===void 0&&(l=f),"selectionStart"in w)w.selectionStart=f,w.selectionEnd=Math.min(l,w.value.length);else if(l=(f=w.ownerDocument||document)&&f.defaultView||window,l.getSelection){l=l.getSelection();var H=w.textContent.length,Z=Math.min(T.start,H);T=T.end===void 0?Z:Math.min(T.end,H),!l.extend&&Z>T&&(H=T,T=Z,Z=H),H=fn(w,Z);var he=fn(w,T);H&&he&&(l.rangeCount!==1||l.anchorNode!==H.node||l.anchorOffset!==H.offset||l.focusNode!==he.node||l.focusOffset!==he.offset)&&(f=f.createRange(),f.setStart(H.node,H.offset),l.removeAllRanges(),Z>T?(l.addRange(f),l.extend(he.node,he.offset)):(f.setEnd(he.node,he.offset),l.addRange(f)))}}for(f=[],l=w;l=l.parentNode;)l.nodeType===1&&f.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<f.length;w++)l=f[w],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var ys=s&&"documentMode"in document&&11>=document.documentMode,Xs=null,Ti=null,wl=null,yu=!1;function Zu(l,f,w){var T=w.window===w?w.document:w.nodeType===9?w:w.ownerDocument;yu||Xs==null||Xs!==ze(T)||(T=Xs,"selectionStart"in T&&Za(T)?T={start:T.selectionStart,end:T.selectionEnd}:(T=(T.ownerDocument&&T.ownerDocument.defaultView||window).getSelection(),T={anchorNode:T.anchorNode,anchorOffset:T.anchorOffset,focusNode:T.focusNode,focusOffset:T.focusOffset}),wl&&ga(wl,T)||(wl=T,T=zc(Ti,"onSelect"),0<T.length&&(f=new Va("onSelect","select",null,f,w),l.push({event:f,listeners:T}),f.target=Xs)))}function Qa(l,f){var w={};return w[l.toLowerCase()]=f.toLowerCase(),w["Webkit"+l]="webkit"+f,w["Moz"+l]="moz"+f,w}var Hi={animationend:Qa("Animation","AnimationEnd"),animationiteration:Qa("Animation","AnimationIteration"),animationstart:Qa("Animation","AnimationStart"),transitionend:Qa("Transition","TransitionEnd")},Ko={},Qu={};s&&(Qu=document.createElement("div").style,"AnimationEvent"in window||(delete Hi.animationend.animation,delete Hi.animationiteration.animation,delete Hi.animationstart.animation),"TransitionEvent"in window||delete Hi.transitionend.transition);function Bl(l){if(Ko[l])return Ko[l];if(!Hi[l])return l;var f=Hi[l],w;for(w in f)if(f.hasOwnProperty(w)&&w in Qu)return Ko[l]=f[w];return l}var Mc=Bl("animationend"),Ic=Bl("animationiteration"),jc=Bl("animationstart"),Dc=Bl("transitionend"),Fc=new Map,Bc="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 Zo(l,f){Fc.set(l,f),a(f,[l])}for(var zl=0;zl<Bc.length;zl++){var Ri=Bc[zl],mo=Ri.toLowerCase(),Ul=Ri[0].toUpperCase()+Ri.slice(1);Zo(mo,"on"+Ul)}Zo(Mc,"onAnimationEnd"),Zo(Ic,"onAnimationIteration"),Zo(jc,"onAnimationStart"),Zo("dblclick","onDoubleClick"),Zo("focusin","onFocus"),Zo("focusout","onBlur"),Zo(Dc,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qo="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(" "),jf=new Set("cancel close invalid load scroll toggle".split(" ").concat(Qo));function ql(l,f,w){var T=l.type||"unknown-event";l.currentTarget=w,io(T,f,void 0,l),l.currentTarget=null}function bu(l,f){f=(f&4)!==0;for(var w=0;w<l.length;w++){var T=l[w],H=T.event;T=T.listeners;e:{var Z=void 0;if(f)for(var he=T.length-1;0<=he;he--){var Ne=T[he],Fe=Ne.instance,at=Ne.currentTarget;if(Ne=Ne.listener,Fe!==Z&&H.isPropagationStopped())break e;ql(H,Ne,at),Z=Fe}else for(he=0;he<T.length;he++){if(Ne=T[he],Fe=Ne.instance,at=Ne.currentTarget,Ne=Ne.listener,Fe!==Z&&H.isPropagationStopped())break e;ql(H,Ne,at),Z=Fe}}}if(Dr)throw l=Ea,Dr=!1,Ea=null,l}function gr(l,f){var w=f[Ra];w===void 0&&(w=f[Ra]=new Set);var T=l+"__bubble";w.has(T)||(wu(f,l,2,!1),w.add(T))}function Ju(l,f,w){var T=0;f&&(T|=4),wu(w,l,T,f)}var $l="_reactListening"+Math.random().toString(36).slice(2);function Ks(l){if(!l[$l]){l[$l]=!0,r.forEach(function(w){w!=="selectionchange"&&(jf.has(w)||Ju(w,!1,l),Ju(w,!0,l))});var f=l.nodeType===9?l:l.ownerDocument;f===null||f[$l]||(f[$l]=!0,Ju("selectionchange",!1,f))}}function wu(l,f,w,T){switch(Il(f)){case 1:var H=La;break;case 4:H=co;break;default:H=zs}w=H.bind(null,f,w,l),H=void 0,!Fa||f!=="touchstart"&&f!=="touchmove"&&f!=="wheel"||(H=!0),T?H!==void 0?l.addEventListener(f,w,{capture:!0,passive:H}):l.addEventListener(f,w,!0):H!==void 0?l.addEventListener(f,w,{passive:H}):l.addEventListener(f,w,!1)}function xu(l,f,w,T,H){var Z=T;if((f&1)===0&&(f&2)===0&&T!==null)e:for(;;){if(T===null)return;var he=T.tag;if(he===3||he===4){var Ne=T.stateNode.containerInfo;if(Ne===H||Ne.nodeType===8&&Ne.parentNode===H)break;if(he===4)for(he=T.return;he!==null;){var Fe=he.tag;if((Fe===3||Fe===4)&&(Fe=he.stateNode.containerInfo,Fe===H||Fe.nodeType===8&&Fe.parentNode===H))return;he=he.return}for(;Ne!==null;){if(he=Qs(Ne),he===null)return;if(Fe=he.tag,Fe===5||Fe===6){T=Z=he;continue e}Ne=Ne.parentNode}}T=T.return}Jt(function(){var at=Z,bt=At(w),xt=[];e:{var yt=Fc.get(l);if(yt!==void 0){var qt=Va,Xt=l;switch(l){case"keypress":if(fs(w)===0)break e;case"keydown":case"keyup":qt=Hs;break;case"focusin":Xt="focus",qt=xn;break;case"focusout":Xt="blur",qt=xn;break;case"beforeblur":case"afterblur":qt=xn;break;case"click":if(w.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":qt=pt;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":qt=jt;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":qt=Ei;break;case Mc:case Ic:case jc:qt=Lr;break;case Dc:qt=Lo;break;case"scroll":qt=ce;break;case"wheel":qt=Dl;break;case"copy":case"cut":case"paste":qt=lr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":qt=ho}var Qt=(f&4)!==0,ra=!Qt&&l==="scroll",et=Qt?yt!==null?yt+"Capture":null:yt;Qt=[];for(var Ge=at,nt;Ge!==null;){nt=Ge;var St=nt.stateNode;if(nt.tag===5&&St!==null&&(nt=St,et!==null&&(St=ua(Ge,et),St!=null&&Qt.push(_u(Ge,St,nt)))),ra)break;Ge=Ge.return}0<Qt.length&&(yt=new qt(yt,Xt,null,w,bt),xt.push({event:yt,listeners:Qt}))}}if((f&7)===0){e:{if(yt=l==="mouseover"||l==="pointerover",qt=l==="mouseout"||l==="pointerout",yt&&w!==$t&&(Xt=w.relatedTarget||w.fromElement)&&(Qs(Xt)||Xt[ea]))break e;if((qt||yt)&&(yt=bt.window===bt?bt:(yt=bt.ownerDocument)?yt.defaultView||yt.parentWindow:window,qt?(Xt=w.relatedTarget||w.toElement,qt=at,Xt=Xt?Qs(Xt):null,Xt!==null&&(ra=ui(Xt),Xt!==ra||Xt.tag!==5&&Xt.tag!==6)&&(Xt=null)):(qt=null,Xt=at),qt!==Xt)){if(Qt=pt,St="onMouseLeave",et="onMouseEnter",Ge="mouse",(l==="pointerout"||l==="pointerover")&&(Qt=ho,St="onPointerLeave",et="onPointerEnter",Ge="pointer"),ra=qt==null?yt:ki(qt),nt=Xt==null?yt:ki(Xt),yt=new Qt(St,Ge+"leave",qt,w,bt),yt.target=ra,yt.relatedTarget=nt,St=null,Qs(bt)===at&&(Qt=new Qt(et,Ge+"enter",Xt,w,bt),Qt.target=nt,Qt.relatedTarget=ra,St=Qt),ra=St,qt&&Xt)t:{for(Qt=qt,et=Xt,Ge=0,nt=Qt;nt;nt=xl(nt))Ge++;for(nt=0,St=et;St;St=xl(St))nt++;for(;0<Ge-nt;)Qt=xl(Qt),Ge--;for(;0<nt-Ge;)et=xl(et),nt--;for(;Ge--;){if(Qt===et||et!==null&&Qt===et.alternate)break t;Qt=xl(Qt),et=xl(et)}Qt=null}else Qt=null;qt!==null&&Nh(xt,yt,qt,Qt,!1),Xt!==null&&ra!==null&&Nh(xt,ra,Xt,Qt,!0)}}e:{if(yt=at?ki(at):window,qt=yt.nodeName&&yt.nodeName.toLowerCase(),qt==="select"||qt==="input"&&yt.type==="file")var nn=di;else if(Zi(yt))if(Ta)nn=vs;else{nn=rr;var pn=gs}else(qt=yt.nodeName)&&qt.toLowerCase()==="input"&&(yt.type==="checkbox"||yt.type==="radio")&&(nn=ms);if(nn&&(nn=nn(l,at))){To(xt,nn,w,bt);break e}pn&&pn(l,yt,at),l==="focusout"&&(pn=yt._wrapperState)&&pn.controlled&&yt.type==="number"&&xe(yt,"number",yt.value)}switch(pn=at?ki(at):window,l){case"focusin":(Zi(pn)||pn.contentEditable==="true")&&(Xs=pn,Ti=at,wl=null);break;case"focusout":wl=Ti=Xs=null;break;case"mousedown":yu=!0;break;case"contextmenu":case"mouseup":case"dragend":yu=!1,Zu(xt,w,bt);break;case"selectionchange":if(ys)break;case"keydown":case"keyup":Zu(xt,w,bt)}var gn;if(po)e:{switch(l){case"compositionstart":var Sn="onCompositionStart";break e;case"compositionend":Sn="onCompositionEnd";break e;case"compositionupdate":Sn="onCompositionUpdate";break e}Sn=void 0}else Ni?Fl(l,w)&&(Sn="onCompositionEnd"):l==="keydown"&&w.keyCode===229&&(Sn="onCompositionStart");Sn&&(Fr&&w.locale!=="ko"&&(Ni||Sn!=="onCompositionStart"?Sn==="onCompositionEnd"&&Ni&&(gn=ml()):(ci=bt,Wa="value"in ci?ci.value:ci.textContent,Ni=!0)),pn=zc(at,Sn),0<pn.length&&(Sn=new kr(Sn,l,null,w,bt),xt.push({event:Sn,listeners:pn}),gn?Sn.data=gn:(gn=$i(w),gn!==null&&(Sn.data=gn)))),(gn=Ws?Na(l,w):Ka(l,w))&&(at=zc(at,"onBeforeInput"),0<at.length&&(bt=new kr("onBeforeInput","beforeinput",null,w,bt),xt.push({event:bt,listeners:at}),bt.data=gn))}bu(xt,f)})}function _u(l,f,w){return{instance:l,listener:f,currentTarget:w}}function zc(l,f){for(var w=f+"Capture",T=[];l!==null;){var H=l,Z=H.stateNode;H.tag===5&&Z!==null&&(H=Z,Z=ua(l,w),Z!=null&&T.unshift(_u(l,Z,H)),Z=ua(l,f),Z!=null&&T.push(_u(l,Z,H))),l=l.return}return T}function xl(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function Nh(l,f,w,T,H){for(var Z=f._reactName,he=[];w!==null&&w!==T;){var Ne=w,Fe=Ne.alternate,at=Ne.stateNode;if(Fe!==null&&Fe===T)break;Ne.tag===5&&at!==null&&(Ne=at,H?(Fe=ua(w,Z),Fe!=null&&he.unshift(_u(w,Fe,Ne))):H||(Fe=ua(w,Z),Fe!=null&&he.push(_u(w,Fe,Ne)))),w=w.return}he.length!==0&&l.push({event:f,listeners:he})}var Nd=/\r\n?/g,Th=/\u0000|\uFFFD/g;function Df(l){return(typeof l=="string"?l:""+l).replace(Nd,`
|
|
6
|
+
`).replace(Th,"")}function ec(l,f,w){if(f=Df(f),Df(l)!==f&&w)throw Error(n(425))}function Zs(){}var tc=null,Hl=null;function Ff(l,f){return l==="textarea"||l==="noscript"||typeof f.children=="string"||typeof f.children=="number"||typeof f.dangerouslySetInnerHTML=="object"&&f.dangerouslySetInnerHTML!==null&&f.dangerouslySetInnerHTML.__html!=null}var vo=typeof setTimeout=="function"?setTimeout:void 0,Uc=typeof clearTimeout=="function"?clearTimeout:void 0,nc=typeof Promise=="function"?Promise:void 0,Rh=typeof queueMicrotask=="function"?queueMicrotask:typeof nc<"u"?function(l){return nc.resolve(null).then(l).catch(Mh)}:vo;function Mh(l){setTimeout(function(){throw l})}function qc(l,f){var w=f,T=0;do{var H=w.nextSibling;if(l.removeChild(w),H&&H.nodeType===8)if(w=H.data,w==="/$"){if(T===0){l.removeChild(H),fa(f);return}T--}else w!=="$"&&w!=="$?"&&w!=="$!"||T++;w=H}while(w);fa(f)}function Qi(l){for(;l!=null;l=l.nextSibling){var f=l.nodeType;if(f===1||f===3)break;if(f===8){if(f=l.data,f==="$"||f==="$!"||f==="$?")break;if(f==="/$")return null}}return l}function Ji(l){l=l.previousSibling;for(var f=0;l;){if(l.nodeType===8){var w=l.data;if(w==="$"||w==="$!"||w==="$?"){if(f===0)return l;f--}else w==="/$"&&f++}l=l.previousSibling}return null}var ma=Math.random().toString(36).slice(2),Mo="__reactFiber$"+ma,Su="__reactProps$"+ma,ea="__reactContainer$"+ma,Ra="__reactEvents$"+ma,Ih="__reactListeners$"+ma,jh="__reactHandles$"+ma;function Qs(l){var f=l[Mo];if(f)return f;for(var w=l.parentNode;w;){if(f=w[ea]||w[Mo]){if(w=f.alternate,f.child!==null||w!==null&&w.child!==null)for(l=Ji(l);l!==null;){if(w=l[Mo])return w;l=Ji(l)}return f}l=w,w=l.parentNode}return null}function Eu(l){return l=l[Mo]||l[ea],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function ki(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function Mi(l){return l[Su]||null}var $c=[],bs=-1;function Io(l){return{current:l}}function ir(l){0>bs||(l.current=$c[bs],$c[bs]=null,bs--)}function ur(l,f){bs++,$c[bs]=l.current,l.current=f}var ws={},Gi=Io(ws),va=Io(!1),_l=ws;function Gl(l,f){var w=l.type.contextTypes;if(!w)return ws;var T=l.stateNode;if(T&&T.__reactInternalMemoizedUnmaskedChildContext===f)return T.__reactInternalMemoizedMaskedChildContext;var H={},Z;for(Z in w)H[Z]=f[Z];return T&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=f,l.__reactInternalMemoizedMaskedChildContext=H),H}function ya(l){return l=l.childContextTypes,l!=null}function ku(){ir(va),ir(Gi)}function Bf(l,f,w){if(Gi.current!==ws)throw Error(n(168));ur(Gi,f),ur(va,w)}function rc(l,f,w){var T=l.stateNode;if(f=f.childContextTypes,typeof T.getChildContext!="function")return w;T=T.getChildContext();for(var H in T)if(!(H in f))throw Error(n(108,ie(l)||"Unknown",H));return X({},w,T)}function xs(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||ws,_l=Gi.current,ur(Gi,l),ur(va,va.current),!0}function Dh(l,f,w){var T=l.stateNode;if(!T)throw Error(n(169));w?(l=rc(l,f,_l),T.__reactInternalMemoizedMergedChildContext=l,ir(va),ir(Gi),ur(Gi,l)):ir(va),ur(va,w)}var _s=null,Wl=!1,P=!1;function M(l){_s===null?_s=[l]:_s.push(l)}function V(l){Wl=!0,M(l)}function ne(){if(!P&&_s!==null){P=!0;var l=0,f=jn;try{var w=_s;for(jn=1;l<w.length;l++){var T=w[l];do T=T(!0);while(T!==null)}_s=null,Wl=!1}catch(H){throw _s!==null&&(_s=_s.slice(l+1)),Fs(os,ne),H}finally{jn=f,P=!1}}return null}var le=[],de=0,me=null,Se=0,Ee=[],Pe=0,De=null,Je=1,Ae="";function qe(l,f){le[de++]=Se,le[de++]=me,me=l,Se=f}function Qe(l,f,w){Ee[Pe++]=Je,Ee[Pe++]=Ae,Ee[Pe++]=De,De=l;var T=Je;l=Ae;var H=32-wn(T)-1;T&=~(1<<H),w+=1;var Z=32-wn(f)+H;if(30<Z){var he=H-H%5;Z=(T&(1<<he)-1).toString(32),T>>=he,H-=he,Je=1<<32-wn(f)+H|w<<H|T,Ae=Z+l}else Je=1<<Z|w<<H|T,Ae=l}function ht(l){l.return!==null&&(qe(l,1),Qe(l,1,0))}function Xe(l){for(;l===me;)me=le[--de],le[de]=null,Se=le[--de],le[de]=null;for(;l===De;)De=Ee[--Pe],Ee[Pe]=null,Ae=Ee[--Pe],Ee[Pe]=null,Je=Ee[--Pe],Ee[Pe]=null}var ct=null,Ue=null,mt=!1,vt=null;function Yt(l,f){var w=Al(5,null,null,0);w.elementType="DELETED",w.stateNode=f,w.return=l,f=l.deletions,f===null?(l.deletions=[w],l.flags|=16):f.push(w)}function zt(l,f){switch(l.tag){case 5:var w=l.type;return f=f.nodeType!==1||w.toLowerCase()!==f.nodeName.toLowerCase()?null:f,f!==null?(l.stateNode=f,ct=l,Ue=Qi(f.firstChild),!0):!1;case 6:return f=l.pendingProps===""||f.nodeType!==3?null:f,f!==null?(l.stateNode=f,ct=l,Ue=null,!0):!1;case 13:return f=f.nodeType!==8?null:f,f!==null?(w=De!==null?{id:Je,overflow:Ae}:null,l.memoizedState={dehydrated:f,treeContext:w,retryLane:1073741824},w=Al(18,null,null,0),w.stateNode=f,w.return=l,l.child=w,ct=l,Ue=null,!0):!1;default:return!1}}function vn(l){return(l.mode&1)!==0&&(l.flags&128)===0}function Ut(l){if(mt){var f=Ue;if(f){var w=f;if(!zt(l,f)){if(vn(l))throw Error(n(418));f=Qi(w.nextSibling);var T=ct;f&&zt(l,f)?Yt(T,w):(l.flags=l.flags&-4097|2,mt=!1,ct=l)}}else{if(vn(l))throw Error(n(418));l.flags=l.flags&-4097|2,mt=!1,ct=l}}}function Nn(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;ct=l}function Hr(l){if(l!==ct)return!1;if(!mt)return Nn(l),mt=!0,!1;var f;if((f=l.tag!==3)&&!(f=l.tag!==5)&&(f=l.type,f=f!=="head"&&f!=="body"&&!Ff(l.type,l.memoizedProps)),f&&(f=Ue)){if(vn(l))throw _n(),Error(n(418));for(;f;)Yt(l,f),f=Qi(f.nextSibling)}if(Nn(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(317));e:{for(l=l.nextSibling,f=0;l;){if(l.nodeType===8){var w=l.data;if(w==="/$"){if(f===0){Ue=Qi(l.nextSibling);break e}f--}else w!=="$"&&w!=="$!"&&w!=="$?"||f++}l=l.nextSibling}Ue=null}}else Ue=ct?Qi(l.stateNode.nextSibling):null;return!0}function _n(){for(var l=Ue;l;)l=Qi(l.nextSibling)}function Bt(){Ue=ct=null,mt=!1}function Et(l){vt===null?vt=[l]:vt.push(l)}var Gr=E.ReactCurrentBatchConfig;function Ht(l,f,w){if(l=w.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(w._owner){if(w=w._owner,w){if(w.tag!==1)throw Error(n(309));var T=w.stateNode}if(!T)throw Error(n(147,l));var H=T,Z=""+l;return f!==null&&f.ref!==null&&typeof f.ref=="function"&&f.ref._stringRef===Z?f.ref:(f=function(he){var Ne=H.refs;he===null?delete Ne[Z]:Ne[Z]=he},f._stringRef=Z,f)}if(typeof l!="string")throw Error(n(284));if(!w._owner)throw Error(n(290,l))}return l}function yn(l,f){throw l=Object.prototype.toString.call(f),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":l))}function Fn(l){var f=l._init;return f(l._payload)}function Ai(l){function f(et,Ge){if(l){var nt=et.deletions;nt===null?(et.deletions=[Ge],et.flags|=16):nt.push(Ge)}}function w(et,Ge){if(!l)return null;for(;Ge!==null;)f(et,Ge),Ge=Ge.sibling;return null}function T(et,Ge){for(et=new Map;Ge!==null;)Ge.key!==null?et.set(Ge.key,Ge):et.set(Ge.index,Ge),Ge=Ge.sibling;return et}function H(et,Ge){return et=rf(et,Ge),et.index=0,et.sibling=null,et}function Z(et,Ge,nt){return et.index=nt,l?(nt=et.alternate,nt!==null?(nt=nt.index,nt<Ge?(et.flags|=2,Ge):nt):(et.flags|=2,Ge)):(et.flags|=1048576,Ge)}function he(et){return l&&et.alternate===null&&(et.flags|=2),et}function Ne(et,Ge,nt,St){return Ge===null||Ge.tag!==6?(Ge=Cg(nt,et.mode,St),Ge.return=et,Ge):(Ge=H(Ge,nt),Ge.return=et,Ge)}function Fe(et,Ge,nt,St){var nn=nt.type;return nn===O?bt(et,Ge,nt.props.children,St,nt.key):Ge!==null&&(Ge.elementType===nn||typeof nn=="object"&&nn!==null&&nn.$$typeof===se&&Fn(nn)===Ge.type)?(St=H(Ge,nt.props),St.ref=Ht(et,Ge,nt),St.return=et,St):(St=d1(nt.type,nt.key,nt.props,null,et.mode,St),St.ref=Ht(et,Ge,nt),St.return=et,St)}function at(et,Ge,nt,St){return Ge===null||Ge.tag!==4||Ge.stateNode.containerInfo!==nt.containerInfo||Ge.stateNode.implementation!==nt.implementation?(Ge=Lg(nt,et.mode,St),Ge.return=et,Ge):(Ge=H(Ge,nt.children||[]),Ge.return=et,Ge)}function bt(et,Ge,nt,St,nn){return Ge===null||Ge.tag!==7?(Ge=Wf(nt,et.mode,St,nn),Ge.return=et,Ge):(Ge=H(Ge,nt),Ge.return=et,Ge)}function xt(et,Ge,nt){if(typeof Ge=="string"&&Ge!==""||typeof Ge=="number")return Ge=Cg(""+Ge,et.mode,nt),Ge.return=et,Ge;if(typeof Ge=="object"&&Ge!==null){switch(Ge.$$typeof){case A:return nt=d1(Ge.type,Ge.key,Ge.props,null,et.mode,nt),nt.ref=Ht(et,null,Ge),nt.return=et,nt;case R:return Ge=Lg(Ge,et.mode,nt),Ge.return=et,Ge;case se:var St=Ge._init;return xt(et,St(Ge._payload),nt)}if(Te(Ge)||re(Ge))return Ge=Wf(Ge,et.mode,nt,null),Ge.return=et,Ge;yn(et,Ge)}return null}function yt(et,Ge,nt,St){var nn=Ge!==null?Ge.key:null;if(typeof nt=="string"&&nt!==""||typeof nt=="number")return nn!==null?null:Ne(et,Ge,""+nt,St);if(typeof nt=="object"&&nt!==null){switch(nt.$$typeof){case A:return nt.key===nn?Fe(et,Ge,nt,St):null;case R:return nt.key===nn?at(et,Ge,nt,St):null;case se:return nn=nt._init,yt(et,Ge,nn(nt._payload),St)}if(Te(nt)||re(nt))return nn!==null?null:bt(et,Ge,nt,St,null);yn(et,nt)}return null}function qt(et,Ge,nt,St,nn){if(typeof St=="string"&&St!==""||typeof St=="number")return et=et.get(nt)||null,Ne(Ge,et,""+St,nn);if(typeof St=="object"&&St!==null){switch(St.$$typeof){case A:return et=et.get(St.key===null?nt:St.key)||null,Fe(Ge,et,St,nn);case R:return et=et.get(St.key===null?nt:St.key)||null,at(Ge,et,St,nn);case se:var pn=St._init;return qt(et,Ge,nt,pn(St._payload),nn)}if(Te(St)||re(St))return et=et.get(nt)||null,bt(Ge,et,St,nn,null);yn(Ge,St)}return null}function Xt(et,Ge,nt,St){for(var nn=null,pn=null,gn=Ge,Sn=Ge=0,no=null;gn!==null&&Sn<nt.length;Sn++){gn.index>Sn?(no=gn,gn=null):no=gn.sibling;var yr=yt(et,gn,nt[Sn],St);if(yr===null){gn===null&&(gn=no);break}l&&gn&&yr.alternate===null&&f(et,gn),Ge=Z(yr,Ge,Sn),pn===null?nn=yr:pn.sibling=yr,pn=yr,gn=no}if(Sn===nt.length)return w(et,gn),mt&&qe(et,Sn),nn;if(gn===null){for(;Sn<nt.length;Sn++)gn=xt(et,nt[Sn],St),gn!==null&&(Ge=Z(gn,Ge,Sn),pn===null?nn=gn:pn.sibling=gn,pn=gn);return mt&&qe(et,Sn),nn}for(gn=T(et,gn);Sn<nt.length;Sn++)no=qt(gn,et,Sn,nt[Sn],St),no!==null&&(l&&no.alternate!==null&&gn.delete(no.key===null?Sn:no.key),Ge=Z(no,Ge,Sn),pn===null?nn=no:pn.sibling=no,pn=no);return l&&gn.forEach(function(af){return f(et,af)}),mt&&qe(et,Sn),nn}function Qt(et,Ge,nt,St){var nn=re(nt);if(typeof nn!="function")throw Error(n(150));if(nt=nn.call(nt),nt==null)throw Error(n(151));for(var pn=nn=null,gn=Ge,Sn=Ge=0,no=null,yr=nt.next();gn!==null&&!yr.done;Sn++,yr=nt.next()){gn.index>Sn?(no=gn,gn=null):no=gn.sibling;var af=yt(et,gn,yr.value,St);if(af===null){gn===null&&(gn=no);break}l&&gn&&af.alternate===null&&f(et,gn),Ge=Z(af,Ge,Sn),pn===null?nn=af:pn.sibling=af,pn=af,gn=no}if(yr.done)return w(et,gn),mt&&qe(et,Sn),nn;if(gn===null){for(;!yr.done;Sn++,yr=nt.next())yr=xt(et,yr.value,St),yr!==null&&(Ge=Z(yr,Ge,Sn),pn===null?nn=yr:pn.sibling=yr,pn=yr);return mt&&qe(et,Sn),nn}for(gn=T(et,gn);!yr.done;Sn++,yr=nt.next())yr=qt(gn,et,Sn,yr.value,St),yr!==null&&(l&&yr.alternate!==null&&gn.delete(yr.key===null?Sn:yr.key),Ge=Z(yr,Ge,Sn),pn===null?nn=yr:pn.sibling=yr,pn=yr);return l&&gn.forEach(function(H_){return f(et,H_)}),mt&&qe(et,Sn),nn}function ra(et,Ge,nt,St){if(typeof nt=="object"&&nt!==null&&nt.type===O&&nt.key===null&&(nt=nt.props.children),typeof nt=="object"&&nt!==null){switch(nt.$$typeof){case A:e:{for(var nn=nt.key,pn=Ge;pn!==null;){if(pn.key===nn){if(nn=nt.type,nn===O){if(pn.tag===7){w(et,pn.sibling),Ge=H(pn,nt.props.children),Ge.return=et,et=Ge;break e}}else if(pn.elementType===nn||typeof nn=="object"&&nn!==null&&nn.$$typeof===se&&Fn(nn)===pn.type){w(et,pn.sibling),Ge=H(pn,nt.props),Ge.ref=Ht(et,pn,nt),Ge.return=et,et=Ge;break e}w(et,pn);break}else f(et,pn);pn=pn.sibling}nt.type===O?(Ge=Wf(nt.props.children,et.mode,St,nt.key),Ge.return=et,et=Ge):(St=d1(nt.type,nt.key,nt.props,null,et.mode,St),St.ref=Ht(et,Ge,nt),St.return=et,et=St)}return he(et);case R:e:{for(pn=nt.key;Ge!==null;){if(Ge.key===pn)if(Ge.tag===4&&Ge.stateNode.containerInfo===nt.containerInfo&&Ge.stateNode.implementation===nt.implementation){w(et,Ge.sibling),Ge=H(Ge,nt.children||[]),Ge.return=et,et=Ge;break e}else{w(et,Ge);break}else f(et,Ge);Ge=Ge.sibling}Ge=Lg(nt,et.mode,St),Ge.return=et,et=Ge}return he(et);case se:return pn=nt._init,ra(et,Ge,pn(nt._payload),St)}if(Te(nt))return Xt(et,Ge,nt,St);if(re(nt))return Qt(et,Ge,nt,St);yn(et,nt)}return typeof nt=="string"&&nt!==""||typeof nt=="number"?(nt=""+nt,Ge!==null&&Ge.tag===6?(w(et,Ge.sibling),Ge=H(Ge,nt),Ge.return=et,et=Ge):(w(et,Ge),Ge=Cg(nt,et.mode,St),Ge.return=et,et=Ge),he(et)):w(et,Ge)}return ra}var pi=Ai(!0),Wn=Ai(!1),Pi=Io(null),wr=null,Br=null,In=null;function Yn(){In=Br=wr=null}function Tr(l){var f=Pi.current;ir(Pi),l._currentValue=f}function Xn(l,f,w){for(;l!==null;){var T=l.alternate;if((l.childLanes&f)!==f?(l.childLanes|=f,T!==null&&(T.childLanes|=f)):T!==null&&(T.childLanes&f)!==f&&(T.childLanes|=f),l===w)break;l=l.return}}function Rr(l,f){wr=l,In=Br=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&f)!==0&&(ae=!0),l.firstContext=null)}function Mr(l){var f=l._currentValue;if(In!==l)if(l={context:l,memoizedValue:f,next:null},Br===null){if(wr===null)throw Error(n(308));Br=l,wr.dependencies={lanes:0,firstContext:l}}else Br=Br.next=l;return f}var ar=null;function Ii(l){ar===null?ar=[l]:ar.push(l)}function Jn(l,f,w,T){var H=f.interleaved;return H===null?(w.next=w,Ii(f)):(w.next=H.next,H.next=w),f.interleaved=w,er(l,T)}function er(l,f){l.lanes|=f;var w=l.alternate;for(w!==null&&(w.lanes|=f),w=l,l=l.return;l!==null;)l.childLanes|=f,w=l.alternate,w!==null&&(w.childLanes|=f),w=l,l=l.return;return w.tag===3?w.stateNode:null}var ii=!1;function ji(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ba(l,f){l=l.updateQueue,f.updateQueue===l&&(f.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function ai(l,f){return{eventTime:l,lane:f,tag:0,payload:null,callback:null,next:null}}function Wr(l,f,w){var T=l.updateQueue;if(T===null)return null;if(T=T.shared,(fr&2)!==0){var H=T.pending;return H===null?f.next=f:(f.next=H.next,H.next=f),T.pending=f,er(l,w)}return H=T.interleaved,H===null?(f.next=f,Ii(T)):(f.next=H.next,H.next=f),T.interleaved=f,er(l,w)}function wa(l,f,w){if(f=f.updateQueue,f!==null&&(f=f.shared,(w&4194240)!==0)){var T=f.lanes;T&=l.pendingLanes,w|=T,f.lanes=w,pu(l,w)}}function or(l,f){var w=l.updateQueue,T=l.alternate;if(T!==null&&(T=T.updateQueue,w===T)){var H=null,Z=null;if(w=w.firstBaseUpdate,w!==null){do{var he={eventTime:w.eventTime,lane:w.lane,tag:w.tag,payload:w.payload,callback:w.callback,next:null};Z===null?H=Z=he:Z=Z.next=he,w=w.next}while(w!==null);Z===null?H=Z=f:Z=Z.next=f}else H=Z=f;w={baseState:T.baseState,firstBaseUpdate:H,lastBaseUpdate:Z,shared:T.shared,effects:T.effects},l.updateQueue=w;return}l=w.lastBaseUpdate,l===null?w.firstBaseUpdate=f:l.next=f,w.lastBaseUpdate=f}function Wi(l,f,w,T){var H=l.updateQueue;ii=!1;var Z=H.firstBaseUpdate,he=H.lastBaseUpdate,Ne=H.shared.pending;if(Ne!==null){H.shared.pending=null;var Fe=Ne,at=Fe.next;Fe.next=null,he===null?Z=at:he.next=at,he=Fe;var bt=l.alternate;bt!==null&&(bt=bt.updateQueue,Ne=bt.lastBaseUpdate,Ne!==he&&(Ne===null?bt.firstBaseUpdate=at:Ne.next=at,bt.lastBaseUpdate=Fe))}if(Z!==null){var xt=H.baseState;he=0,bt=at=Fe=null,Ne=Z;do{var yt=Ne.lane,qt=Ne.eventTime;if((T&yt)===yt){bt!==null&&(bt=bt.next={eventTime:qt,lane:0,tag:Ne.tag,payload:Ne.payload,callback:Ne.callback,next:null});e:{var Xt=l,Qt=Ne;switch(yt=f,qt=w,Qt.tag){case 1:if(Xt=Qt.payload,typeof Xt=="function"){xt=Xt.call(qt,xt,yt);break e}xt=Xt;break e;case 3:Xt.flags=Xt.flags&-65537|128;case 0:if(Xt=Qt.payload,yt=typeof Xt=="function"?Xt.call(qt,xt,yt):Xt,yt==null)break e;xt=X({},xt,yt);break e;case 2:ii=!0}}Ne.callback!==null&&Ne.lane!==0&&(l.flags|=64,yt=H.effects,yt===null?H.effects=[Ne]:yt.push(Ne))}else qt={eventTime:qt,lane:yt,tag:Ne.tag,payload:Ne.payload,callback:Ne.callback,next:null},bt===null?(at=bt=qt,Fe=xt):bt=bt.next=qt,he|=yt;if(Ne=Ne.next,Ne===null){if(Ne=H.shared.pending,Ne===null)break;yt=Ne,Ne=yt.next,yt.next=null,H.lastBaseUpdate=yt,H.shared.pending=null}}while(!0);if(bt===null&&(Fe=xt),H.baseState=Fe,H.firstBaseUpdate=at,H.lastBaseUpdate=bt,f=H.shared.interleaved,f!==null){H=f;do he|=H.lane,H=H.next;while(H!==f)}else Z===null&&(H.shared.lanes=0);qf|=he,l.lanes=he,l.memoizedState=xt}}function Kn(l,f,w){if(l=f.effects,f.effects=null,l!==null)for(f=0;f<l.length;f++){var T=l[f],H=T.callback;if(H!==null){if(T.callback=null,T=w,typeof H!="function")throw Error(n(191,H));H.call(T)}}}var dn={},Bn=Io(dn),On=Io(dn),zr=Io(dn);function gi(l){if(l===dn)throw Error(n(174));return l}function Jo(l,f){switch(ur(zr,f),ur(On,l),ur(Bn,dn),l=f.nodeType,l){case 9:case 11:f=(f=f.documentElement)?f.namespaceURI:Ye(null,"");break;default:l=l===8?f.parentNode:f,f=l.namespaceURI||null,l=l.tagName,f=Ye(f,l)}ir(Bn),ur(Bn,f)}function mr(){ir(Bn),ir(On),ir(zr)}function Au(l){gi(zr.current);var f=gi(Bn.current),w=Ye(f,l.type);f!==w&&(ur(On,l),ur(Bn,w))}function Js(l){On.current===l&&(ir(Bn),ir(On))}var vr=Io(0);function yo(l){for(var f=l;f!==null;){if(f.tag===13){var w=f.memoizedState;if(w!==null&&(w=w.dehydrated,w===null||w.data==="$?"||w.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===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var Vl=[];function xa(){for(var l=0;l<Vl.length;l++)Vl[l]._workInProgressVersionPrimary=null;Vl.length=0}var Pu=E.ReactCurrentDispatcher,Ou=E.ReactCurrentBatchConfig,Vi=0,cr=null,Vr=null,Yr=null,bo=!1,jo=!1,wo=0,Hc=0;function Xr(){throw Error(n(321))}function Cu(l,f){if(f===null)return!1;for(var w=0;w<f.length&&w<l.length;w++)if(!Nr(l[w],f[w]))return!1;return!0}function Sl(l,f,w,T,H,Z){if(Vi=Z,cr=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,Pu.current=l===null||l.memoizedState===null?cg:Nu,l=w(T,H),jo){Z=0;do{if(jo=!1,wo=0,25<=Z)throw Error(n(301));Z+=1,Yr=Vr=null,f.updateQueue=null,Pu.current=Bh,l=w(T,H)}while(jo)}if(Pu.current=Yc,f=Vr!==null&&Vr.next!==null,Vi=0,Yr=Vr=cr=null,bo=!1,f)throw Error(n(300));return l}function xo(){var l=wo!==0;return wo=0,l}function Ar(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yr===null?cr.memoizedState=Yr=l:Yr=Yr.next=l,Yr}function Oi(){if(Vr===null){var l=cr.alternate;l=l!==null?l.memoizedState:null}else l=Vr.next;var f=Yr===null?cr.memoizedState:Yr.next;if(f!==null)Yr=f,Vr=l;else{if(l===null)throw Error(n(310));Vr=l,l={memoizedState:Vr.memoizedState,baseState:Vr.baseState,baseQueue:Vr.baseQueue,queue:Vr.queue,next:null},Yr===null?cr.memoizedState=Yr=l:Yr=Yr.next=l}return Yr}function _a(l,f){return typeof f=="function"?f(l):f}function ta(l){var f=Oi(),w=f.queue;if(w===null)throw Error(n(311));w.lastRenderedReducer=l;var T=Vr,H=T.baseQueue,Z=w.pending;if(Z!==null){if(H!==null){var he=H.next;H.next=Z.next,Z.next=he}T.baseQueue=H=Z,w.pending=null}if(H!==null){Z=H.next,T=T.baseState;var Ne=he=null,Fe=null,at=Z;do{var bt=at.lane;if((Vi&bt)===bt)Fe!==null&&(Fe=Fe.next={lane:0,action:at.action,hasEagerState:at.hasEagerState,eagerState:at.eagerState,next:null}),T=at.hasEagerState?at.eagerState:l(T,at.action);else{var xt={lane:bt,action:at.action,hasEagerState:at.hasEagerState,eagerState:at.eagerState,next:null};Fe===null?(Ne=Fe=xt,he=T):Fe=Fe.next=xt,cr.lanes|=bt,qf|=bt}at=at.next}while(at!==null&&at!==Z);Fe===null?he=T:Fe.next=Ne,Nr(T,f.memoizedState)||(ae=!0),f.memoizedState=T,f.baseState=he,f.baseQueue=Fe,w.lastRenderedState=T}if(l=w.interleaved,l!==null){H=l;do Z=H.lane,cr.lanes|=Z,qf|=Z,H=H.next;while(H!==l)}else H===null&&(w.lanes=0);return[f.memoizedState,w.dispatch]}function el(l){var f=Oi(),w=f.queue;if(w===null)throw Error(n(311));w.lastRenderedReducer=l;var T=w.dispatch,H=w.pending,Z=f.memoizedState;if(H!==null){w.pending=null;var he=H=H.next;do Z=l(Z,he.action),he=he.next;while(he!==H);Nr(Z,f.memoizedState)||(ae=!0),f.memoizedState=Z,f.baseQueue===null&&(f.baseState=Z),w.lastRenderedState=Z}return[Z,T]}function Gc(){}function ic(l,f){var w=cr,T=Oi(),H=f(),Z=!Nr(T.memoizedState,H);if(Z&&(T.memoizedState=H,ae=!0),T=T.queue,Vc(zf.bind(null,w,T,l),[l]),T.getSnapshot!==f||Z||Yr!==null&&Yr.memoizedState.tag&1){if(w.flags|=2048,Ja(9,Ss.bind(null,w,T,H,f),void 0,null),to===null)throw Error(n(349));(Vi&30)!==0||Fh(w,f,H)}return H}function Fh(l,f,w){l.flags|=16384,l={getSnapshot:f,value:w},f=cr.updateQueue,f===null?(f={lastEffect:null,stores:null},cr.updateQueue=f,f.stores=[l]):(w=f.stores,w===null?f.stores=[l]:w.push(l))}function Ss(l,f,w,T){f.value=w,f.getSnapshot=T,Yl(f)&&Lu(l)}function zf(l,f,w){return w(function(){Yl(f)&&Lu(l)})}function Yl(l){var f=l.getSnapshot;l=l.value;try{var w=f();return!Nr(l,w)}catch{return!0}}function Lu(l){var f=er(l,1);f!==null&&Ql(f,l,1,-1)}function es(l){var f=Ar();return typeof l=="function"&&(l=l()),f.memoizedState=f.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:_a,lastRenderedState:l},f.queue=l,l=l.dispatch=Jp.bind(null,cr,l),[f.memoizedState,l]}function Ja(l,f,w,T){return l={tag:l,create:f,destroy:w,deps:T,next:null},f=cr.updateQueue,f===null?(f={lastEffect:null,stores:null},cr.updateQueue=f,f.lastEffect=l.next=l):(w=f.lastEffect,w===null?f.lastEffect=l.next=l:(T=w.next,w.next=l,l.next=T,f.lastEffect=l)),l}function Es(){return Oi().memoizedState}function _o(l,f,w,T){var H=Ar();cr.flags|=l,H.memoizedState=Ja(1|f,w,void 0,T===void 0?null:T)}function ks(l,f,w,T){var H=Oi();T=T===void 0?null:T;var Z=void 0;if(Vr!==null){var he=Vr.memoizedState;if(Z=he.destroy,T!==null&&Cu(T,he.deps)){H.memoizedState=Ja(f,w,Z,T);return}}cr.flags|=l,H.memoizedState=Ja(1|f,w,Z,T)}function Wc(l,f){return _o(8390656,8,l,f)}function Vc(l,f){return ks(2048,8,l,f)}function Uf(l,f){return ks(4,2,l,f)}function ac(l,f){return ks(4,4,l,f)}function As(l,f){if(typeof f=="function")return l=l(),f(l),function(){f(null)};if(f!=null)return l=l(),f.current=l,function(){f.current=null}}function Xp(l,f,w){return w=w!=null?w.concat([l]):null,ks(4,4,As.bind(null,f,l),w)}function Xl(){}function Td(l,f){var w=Oi();f=f===void 0?null:f;var T=w.memoizedState;return T!==null&&f!==null&&Cu(f,T[1])?T[0]:(w.memoizedState=[l,f],l)}function Kr(l,f){var w=Oi();f=f===void 0?null:f;var T=w.memoizedState;return T!==null&&f!==null&&Cu(f,T[1])?T[0]:(l=l(),w.memoizedState=[l,f],l)}function Kp(l,f,w){return(Vi&21)===0?(l.baseState&&(l.baseState=!1,ae=!0),l.memoizedState=w):(Nr(w,f)||(w=du(),cr.lanes|=w,qf|=w,l.baseState=!0),f)}function Zp(l,f){var w=jn;jn=w!==0&&4>w?w:4,l(!0);var T=Ou.transition;Ou.transition={};try{l(!1),f()}finally{jn=w,Ou.transition=T}}function Qp(){return Oi().memoizedState}function ug(l,f,w){var T=tf(l);if(w={lane:T,action:w,hasEagerState:!1,eagerState:null,next:null},Rd(l))e1(f,w);else if(w=Jn(l,f,w,T),w!==null){var H=ns();Ql(w,l,T,H),ts(w,f,T)}}function Jp(l,f,w){var T=tf(l),H={lane:T,action:w,hasEagerState:!1,eagerState:null,next:null};if(Rd(l))e1(f,H);else{var Z=l.alternate;if(l.lanes===0&&(Z===null||Z.lanes===0)&&(Z=f.lastRenderedReducer,Z!==null))try{var he=f.lastRenderedState,Ne=Z(he,w);if(H.hasEagerState=!0,H.eagerState=Ne,Nr(Ne,he)){var Fe=f.interleaved;Fe===null?(H.next=H,Ii(f)):(H.next=Fe.next,Fe.next=H),f.interleaved=H;return}}catch{}finally{}w=Jn(l,f,H,T),w!==null&&(H=ns(),Ql(w,l,T,H),ts(w,f,T))}}function Rd(l){var f=l.alternate;return l===cr||f!==null&&f===cr}function e1(l,f){jo=bo=!0;var w=l.pending;w===null?f.next=f:(f.next=w.next,w.next=f),l.pending=f}function ts(l,f,w){if((w&4194240)!==0){var T=f.lanes;T&=l.pendingLanes,w|=T,f.lanes=w,pu(l,w)}}var Yc={readContext:Mr,useCallback:Xr,useContext:Xr,useEffect:Xr,useImperativeHandle:Xr,useInsertionEffect:Xr,useLayoutEffect:Xr,useMemo:Xr,useReducer:Xr,useRef:Xr,useState:Xr,useDebugValue:Xr,useDeferredValue:Xr,useTransition:Xr,useMutableSource:Xr,useSyncExternalStore:Xr,useId:Xr,unstable_isNewReconciler:!1},cg={readContext:Mr,useCallback:function(l,f){return Ar().memoizedState=[l,f===void 0?null:f],l},useContext:Mr,useEffect:Wc,useImperativeHandle:function(l,f,w){return w=w!=null?w.concat([l]):null,_o(4194308,4,As.bind(null,f,l),w)},useLayoutEffect:function(l,f){return _o(4194308,4,l,f)},useInsertionEffect:function(l,f){return _o(4,2,l,f)},useMemo:function(l,f){var w=Ar();return f=f===void 0?null:f,l=l(),w.memoizedState=[l,f],l},useReducer:function(l,f,w){var T=Ar();return f=w!==void 0?w(f):f,T.memoizedState=T.baseState=f,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:f},T.queue=l,l=l.dispatch=ug.bind(null,cr,l),[T.memoizedState,l]},useRef:function(l){var f=Ar();return l={current:l},f.memoizedState=l},useState:es,useDebugValue:Xl,useDeferredValue:function(l){return Ar().memoizedState=l},useTransition:function(){var l=es(!1),f=l[0];return l=Zp.bind(null,l[1]),Ar().memoizedState=l,[f,l]},useMutableSource:function(){},useSyncExternalStore:function(l,f,w){var T=cr,H=Ar();if(mt){if(w===void 0)throw Error(n(407));w=w()}else{if(w=f(),to===null)throw Error(n(349));(Vi&30)!==0||Fh(T,f,w)}H.memoizedState=w;var Z={value:w,getSnapshot:f};return H.queue=Z,Wc(zf.bind(null,T,Z,l),[l]),T.flags|=2048,Ja(9,Ss.bind(null,T,Z,w,f),void 0,null),w},useId:function(){var l=Ar(),f=to.identifierPrefix;if(mt){var w=Ae,T=Je;w=(T&~(1<<32-wn(T)-1)).toString(32)+w,f=":"+f+"R"+w,w=wo++,0<w&&(f+="H"+w.toString(32)),f+=":"}else w=Hc++,f=":"+f+"r"+w.toString(32)+":";return l.memoizedState=f},unstable_isNewReconciler:!1},Nu={readContext:Mr,useCallback:Td,useContext:Mr,useEffect:Vc,useImperativeHandle:Xp,useInsertionEffect:Uf,useLayoutEffect:ac,useMemo:Kr,useReducer:ta,useRef:Es,useState:function(){return ta(_a)},useDebugValue:Xl,useDeferredValue:function(l){var f=Oi();return Kp(f,Vr.memoizedState,l)},useTransition:function(){var l=ta(_a)[0],f=Oi().memoizedState;return[l,f]},useMutableSource:Gc,useSyncExternalStore:ic,useId:Qp,unstable_isNewReconciler:!1},Bh={readContext:Mr,useCallback:Td,useContext:Mr,useEffect:Vc,useImperativeHandle:Xp,useInsertionEffect:Uf,useLayoutEffect:ac,useMemo:Kr,useReducer:el,useRef:Es,useState:function(){return el(_a)},useDebugValue:Xl,useDeferredValue:function(l){var f=Oi();return Vr===null?f.memoizedState=l:Kp(f,Vr.memoizedState,l)},useTransition:function(){var l=el(_a)[0],f=Oi().memoizedState;return[l,f]},useMutableSource:Gc,useSyncExternalStore:ic,useId:Qp,unstable_isNewReconciler:!1};function Ma(l,f){if(l&&l.defaultProps){f=X({},f),l=l.defaultProps;for(var w in l)f[w]===void 0&&(f[w]=l[w]);return f}return f}function Xc(l,f,w,T){f=l.memoizedState,w=w(T,f),w=w==null?f:X({},f,w),l.memoizedState=w,l.lanes===0&&(l.updateQueue.baseState=w)}var Kc={isMounted:function(l){return(l=l._reactInternals)?ui(l)===l:!1},enqueueSetState:function(l,f,w){l=l._reactInternals;var T=ns(),H=tf(l),Z=ai(T,H);Z.payload=f,w!=null&&(Z.callback=w),f=Wr(l,Z,H),f!==null&&(Ql(f,l,H,T),wa(f,l,H))},enqueueReplaceState:function(l,f,w){l=l._reactInternals;var T=ns(),H=tf(l),Z=ai(T,H);Z.tag=1,Z.payload=f,w!=null&&(Z.callback=w),f=Wr(l,Z,H),f!==null&&(Ql(f,l,H,T),wa(f,l,H))},enqueueForceUpdate:function(l,f){l=l._reactInternals;var w=ns(),T=tf(l),H=ai(w,T);H.tag=2,f!=null&&(H.callback=f),f=Wr(l,H,T),f!==null&&(Ql(f,l,T,w),wa(f,l,T))}};function zh(l,f,w,T,H,Z,he){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(T,Z,he):f.prototype&&f.prototype.isPureReactComponent?!ga(w,T)||!ga(H,Z):!0}function t1(l,f,w){var T=!1,H=ws,Z=f.contextType;return typeof Z=="object"&&Z!==null?Z=Mr(Z):(H=ya(f)?_l:Gi.current,T=f.contextTypes,Z=(T=T!=null)?Gl(l,H):ws),f=new f(w,Z),l.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Kc,l.stateNode=f,f._reactInternals=l,T&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=H,l.__reactInternalMemoizedMaskedChildContext=Z),f}function Md(l,f,w,T){l=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(w,T),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(w,T),f.state!==l&&Kc.enqueueReplaceState(f,f.state,null)}function Uh(l,f,w,T){var H=l.stateNode;H.props=w,H.state=l.memoizedState,H.refs={},ji(l);var Z=f.contextType;typeof Z=="object"&&Z!==null?H.context=Mr(Z):(Z=ya(f)?_l:Gi.current,H.context=Gl(l,Z)),H.state=l.memoizedState,Z=f.getDerivedStateFromProps,typeof Z=="function"&&(Xc(l,f,Z,w),H.state=l.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof H.getSnapshotBeforeUpdate=="function"||typeof H.UNSAFE_componentWillMount!="function"&&typeof H.componentWillMount!="function"||(f=H.state,typeof H.componentWillMount=="function"&&H.componentWillMount(),typeof H.UNSAFE_componentWillMount=="function"&&H.UNSAFE_componentWillMount(),f!==H.state&&Kc.enqueueReplaceState(H,H.state,null),Wi(l,w,H,T),H.state=l.memoizedState),typeof H.componentDidMount=="function"&&(l.flags|=4194308)}function oc(l,f){try{var w="",T=f;do w+=J(T),T=T.return;while(T);var H=w}catch(Z){H=`
|
|
7
|
+
Error generating stack: `+Z.message+`
|
|
8
|
+
`+Z.stack}return{value:l,source:f,stack:H,digest:null}}function qh(l,f,w){return{value:l,source:null,stack:w??null,digest:f??null}}function Zc(l,f){try{console.error(f.value)}catch(w){setTimeout(function(){throw w})}}var fg=typeof WeakMap=="function"?WeakMap:Map;function n1(l,f,w){w=ai(-1,w),w.tag=3,w.payload={element:null};var T=f.value;return w.callback=function(){s1||(s1=!0,xg=T),Zc(l,f)},w}function p(l,f,w){w=ai(-1,w),w.tag=3;var T=l.type.getDerivedStateFromError;if(typeof T=="function"){var H=f.value;w.payload=function(){return T(H)},w.callback=function(){Zc(l,f)}}var Z=l.stateNode;return Z!==null&&typeof Z.componentDidCatch=="function"&&(w.callback=function(){Zc(l,f),typeof T!="function"&&(Jc===null?Jc=new Set([this]):Jc.add(this));var he=f.stack;this.componentDidCatch(f.value,{componentStack:he!==null?he:""})}),w}function v(l,f,w){var T=l.pingCache;if(T===null){T=l.pingCache=new fg;var H=new Set;T.set(f,H)}else H=T.get(f),H===void 0&&(H=new Set,T.set(f,H));H.has(w)||(H.add(w),l=R_.bind(null,l,f,w),f.then(l,l))}function L(l){do{var f;if((f=l.tag===13)&&(f=l.memoizedState,f=f!==null?f.dehydrated!==null:!0),f)return l;l=l.return}while(l!==null);return null}function U(l,f,w,T,H){return(l.mode&1)===0?(l===f?l.flags|=65536:(l.flags|=128,w.flags|=131072,w.flags&=-52805,w.tag===1&&(w.alternate===null?w.tag=17:(f=ai(-1,1),f.tag=2,Wr(w,f,1))),w.lanes|=1),l):(l.flags|=65536,l.lanes=H,l)}var W=E.ReactCurrentOwner,ae=!1;function ke(l,f,w,T){f.child=l===null?Wn(f,null,w,T):pi(f,l.child,w,T)}function Ve(l,f,w,T,H){w=w.render;var Z=f.ref;return Rr(f,H),T=Sl(l,f,w,T,Z,H),w=xo(),l!==null&&!ae?(f.updateQueue=l.updateQueue,f.flags&=-2053,l.lanes&=~H,eo(l,f,H)):(mt&&w&&ht(f),f.flags|=1,ke(l,f,T,H),f.child)}function st(l,f,w,T,H){if(l===null){var Z=w.type;return typeof Z=="function"&&!Og(Z)&&Z.defaultProps===void 0&&w.compare===null&&w.defaultProps===void 0?(f.tag=15,f.type=Z,_t(l,f,Z,T,H)):(l=d1(w.type,null,T,f,f.mode,H),l.ref=f.ref,l.return=f,f.child=l)}if(Z=l.child,(l.lanes&H)===0){var he=Z.memoizedProps;if(w=w.compare,w=w!==null?w:ga,w(he,T)&&l.ref===f.ref)return eo(l,f,H)}return f.flags|=1,l=rf(Z,T),l.ref=f.ref,l.return=f,f.child=l}function _t(l,f,w,T,H){if(l!==null){var Z=l.memoizedProps;if(ga(Z,T)&&l.ref===f.ref)if(ae=!1,f.pendingProps=T=Z,(l.lanes&H)!==0)(l.flags&131072)!==0&&(ae=!0);else return f.lanes=l.lanes,eo(l,f,H)}return Rt(l,f,w,T,H)}function Gt(l,f,w){var T=f.pendingProps,H=T.children,Z=l!==null?l.memoizedState:null;if(T.mode==="hidden")if((f.mode&1)===0)f.memoizedState={baseLanes:0,cachePool:null,transitions:null},ur(Hh,tl),tl|=w;else{if((w&1073741824)===0)return l=Z!==null?Z.baseLanes|w:w,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:l,cachePool:null,transitions:null},f.updateQueue=null,ur(Hh,tl),tl|=l,null;f.memoizedState={baseLanes:0,cachePool:null,transitions:null},T=Z!==null?Z.baseLanes:w,ur(Hh,tl),tl|=T}else Z!==null?(T=Z.baseLanes|w,f.memoizedState=null):T=w,ur(Hh,tl),tl|=T;return ke(l,f,H,w),f.child}function kn(l,f){var w=f.ref;(l===null&&w!==null||l!==null&&l.ref!==w)&&(f.flags|=512,f.flags|=2097152)}function Rt(l,f,w,T,H){var Z=ya(w)?_l:Gi.current;return Z=Gl(f,Z),Rr(f,H),w=Sl(l,f,w,T,Z,H),T=xo(),l!==null&&!ae?(f.updateQueue=l.updateQueue,f.flags&=-2053,l.lanes&=~H,eo(l,f,H)):(mt&&T&&ht(f),f.flags|=1,ke(l,f,w,H),f.child)}function Ur(l,f,w,T,H){if(ya(w)){var Z=!0;xs(f)}else Z=!1;if(Rr(f,H),f.stateNode===null)Vn(l,f),t1(f,w,T),Uh(f,w,T,H),T=!0;else if(l===null){var he=f.stateNode,Ne=f.memoizedProps;he.props=Ne;var Fe=he.context,at=w.contextType;typeof at=="object"&&at!==null?at=Mr(at):(at=ya(w)?_l:Gi.current,at=Gl(f,at));var bt=w.getDerivedStateFromProps,xt=typeof bt=="function"||typeof he.getSnapshotBeforeUpdate=="function";xt||typeof he.UNSAFE_componentWillReceiveProps!="function"&&typeof he.componentWillReceiveProps!="function"||(Ne!==T||Fe!==at)&&Md(f,he,T,at),ii=!1;var yt=f.memoizedState;he.state=yt,Wi(f,T,he,H),Fe=f.memoizedState,Ne!==T||yt!==Fe||va.current||ii?(typeof bt=="function"&&(Xc(f,w,bt,T),Fe=f.memoizedState),(Ne=ii||zh(f,w,Ne,T,yt,Fe,at))?(xt||typeof he.UNSAFE_componentWillMount!="function"&&typeof he.componentWillMount!="function"||(typeof he.componentWillMount=="function"&&he.componentWillMount(),typeof he.UNSAFE_componentWillMount=="function"&&he.UNSAFE_componentWillMount()),typeof he.componentDidMount=="function"&&(f.flags|=4194308)):(typeof he.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=T,f.memoizedState=Fe),he.props=T,he.state=Fe,he.context=at,T=Ne):(typeof he.componentDidMount=="function"&&(f.flags|=4194308),T=!1)}else{he=f.stateNode,ba(l,f),Ne=f.memoizedProps,at=f.type===f.elementType?Ne:Ma(f.type,Ne),he.props=at,xt=f.pendingProps,yt=he.context,Fe=w.contextType,typeof Fe=="object"&&Fe!==null?Fe=Mr(Fe):(Fe=ya(w)?_l:Gi.current,Fe=Gl(f,Fe));var qt=w.getDerivedStateFromProps;(bt=typeof qt=="function"||typeof he.getSnapshotBeforeUpdate=="function")||typeof he.UNSAFE_componentWillReceiveProps!="function"&&typeof he.componentWillReceiveProps!="function"||(Ne!==xt||yt!==Fe)&&Md(f,he,T,Fe),ii=!1,yt=f.memoizedState,he.state=yt,Wi(f,T,he,H);var Xt=f.memoizedState;Ne!==xt||yt!==Xt||va.current||ii?(typeof qt=="function"&&(Xc(f,w,qt,T),Xt=f.memoizedState),(at=ii||zh(f,w,at,T,yt,Xt,Fe)||!1)?(bt||typeof he.UNSAFE_componentWillUpdate!="function"&&typeof he.componentWillUpdate!="function"||(typeof he.componentWillUpdate=="function"&&he.componentWillUpdate(T,Xt,Fe),typeof he.UNSAFE_componentWillUpdate=="function"&&he.UNSAFE_componentWillUpdate(T,Xt,Fe)),typeof he.componentDidUpdate=="function"&&(f.flags|=4),typeof he.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof he.componentDidUpdate!="function"||Ne===l.memoizedProps&&yt===l.memoizedState||(f.flags|=4),typeof he.getSnapshotBeforeUpdate!="function"||Ne===l.memoizedProps&&yt===l.memoizedState||(f.flags|=1024),f.memoizedProps=T,f.memoizedState=Xt),he.props=T,he.state=Xt,he.context=Fe,T=at):(typeof he.componentDidUpdate!="function"||Ne===l.memoizedProps&&yt===l.memoizedState||(f.flags|=4),typeof he.getSnapshotBeforeUpdate!="function"||Ne===l.memoizedProps&&yt===l.memoizedState||(f.flags|=1024),T=!1)}return xr(l,f,w,T,Z,H)}function xr(l,f,w,T,H,Z){kn(l,f);var he=(f.flags&128)!==0;if(!T&&!he)return H&&Dh(f,w,!1),eo(l,f,Z);T=f.stateNode,W.current=f;var Ne=he&&typeof w.getDerivedStateFromError!="function"?null:T.render();return f.flags|=1,l!==null&&he?(f.child=pi(f,l.child,null,Z),f.child=pi(f,null,Ne,Z)):ke(l,f,Ne,Z),f.memoizedState=T.state,H&&Dh(f,w,!0),f.child}function So(l){var f=l.stateNode;f.pendingContext?Bf(l,f.pendingContext,f.pendingContext!==f.context):f.context&&Bf(l,f.context,!1),Jo(l,f.containerInfo)}function El(l,f,w,T,H){return Bt(),Et(H),f.flags|=256,ke(l,f,w,T),f.child}var it={dehydrated:null,treeContext:null,retryLane:0};function Ke(l){return{baseLanes:l,cachePool:null,transitions:null}}function gt(l,f,w){var T=f.pendingProps,H=vr.current,Z=!1,he=(f.flags&128)!==0,Ne;if((Ne=he)||(Ne=l!==null&&l.memoizedState===null?!1:(H&2)!==0),Ne?(Z=!0,f.flags&=-129):(l===null||l.memoizedState!==null)&&(H|=1),ur(vr,H&1),l===null)return Ut(f),l=f.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((f.mode&1)===0?f.lanes=1:l.data==="$!"?f.lanes=8:f.lanes=1073741824,null):(he=T.children,l=T.fallback,Z?(T=f.mode,Z=f.child,he={mode:"hidden",children:he},(T&1)===0&&Z!==null?(Z.childLanes=0,Z.pendingProps=he):Z=p1(he,T,0,null),l=Wf(l,T,w,null),Z.return=f,l.return=f,Z.sibling=l,f.child=Z,f.child.memoizedState=Ke(w),f.memoizedState=it,l):Mt(f,he));if(H=l.memoizedState,H!==null&&(Ne=H.dehydrated,Ne!==null))return Tn(l,f,he,T,Ne,H,w);if(Z){Z=T.fallback,he=f.mode,H=l.child,Ne=H.sibling;var Fe={mode:"hidden",children:T.children};return(he&1)===0&&f.child!==H?(T=f.child,T.childLanes=0,T.pendingProps=Fe,f.deletions=null):(T=rf(H,Fe),T.subtreeFlags=H.subtreeFlags&14680064),Ne!==null?Z=rf(Ne,Z):(Z=Wf(Z,he,w,null),Z.flags|=2),Z.return=f,T.return=f,T.sibling=Z,f.child=T,T=Z,Z=f.child,he=l.child.memoizedState,he=he===null?Ke(w):{baseLanes:he.baseLanes|w,cachePool:null,transitions:he.transitions},Z.memoizedState=he,Z.childLanes=l.childLanes&~w,f.memoizedState=it,T}return Z=l.child,l=Z.sibling,T=rf(Z,{mode:"visible",children:T.children}),(f.mode&1)===0&&(T.lanes=w),T.return=f,T.sibling=null,l!==null&&(w=f.deletions,w===null?(f.deletions=[l],f.flags|=16):w.push(l)),f.child=T,f.memoizedState=null,T}function Mt(l,f){return f=p1({mode:"visible",children:f},l.mode,0,null),f.return=l,l.child=f}function ln(l,f,w,T){return T!==null&&Et(T),pi(f,l.child,null,w),l=Mt(f,f.pendingProps.children),l.flags|=2,f.memoizedState=null,l}function Tn(l,f,w,T,H,Z,he){if(w)return f.flags&256?(f.flags&=-257,T=qh(Error(n(422))),ln(l,f,he,T)):f.memoizedState!==null?(f.child=l.child,f.flags|=128,null):(Z=T.fallback,H=f.mode,T=p1({mode:"visible",children:T.children},H,0,null),Z=Wf(Z,H,he,null),Z.flags|=2,T.return=f,Z.return=f,T.sibling=Z,f.child=T,(f.mode&1)!==0&&pi(f,l.child,null,he),f.child.memoizedState=Ke(he),f.memoizedState=it,Z);if((f.mode&1)===0)return ln(l,f,he,null);if(H.data==="$!"){if(T=H.nextSibling&&H.nextSibling.dataset,T)var Ne=T.dgst;return T=Ne,Z=Error(n(419)),T=qh(Z,T,void 0),ln(l,f,he,T)}if(Ne=(he&l.childLanes)!==0,ae||Ne){if(T=to,T!==null){switch(he&-he){case 4:H=2;break;case 16:H=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:H=32;break;case 536870912:H=268435456;break;default:H=0}H=(H&(T.suspendedLanes|he))!==0?0:H,H!==0&&H!==Z.retryLane&&(Z.retryLane=H,er(l,H),Ql(T,l,H,-1))}return Pg(),T=qh(Error(n(421))),ln(l,f,he,T)}return H.data==="$?"?(f.flags|=128,f.child=l.child,f=M_.bind(null,l),H._reactRetry=f,null):(l=Z.treeContext,Ue=Qi(H.nextSibling),ct=f,mt=!0,vt=null,l!==null&&(Ee[Pe++]=Je,Ee[Pe++]=Ae,Ee[Pe++]=De,Je=l.id,Ae=l.overflow,De=f),f=Mt(f,T.children),f.flags|=4096,f)}function An(l,f,w){l.lanes|=f;var T=l.alternate;T!==null&&(T.lanes|=f),Xn(l.return,f,w)}function Zn(l,f,w,T,H){var Z=l.memoizedState;Z===null?l.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:T,tail:w,tailMode:H}:(Z.isBackwards=f,Z.rendering=null,Z.renderingStartTime=0,Z.last=T,Z.tail=w,Z.tailMode=H)}function na(l,f,w){var T=f.pendingProps,H=T.revealOrder,Z=T.tail;if(ke(l,f,T.children,w),T=vr.current,(T&2)!==0)T=T&1|2,f.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=f.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&An(l,w,f);else if(l.tag===19)An(l,w,f);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===f)break e;for(;l.sibling===null;){if(l.return===null||l.return===f)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}T&=1}if(ur(vr,T),(f.mode&1)===0)f.memoizedState=null;else switch(H){case"forwards":for(w=f.child,H=null;w!==null;)l=w.alternate,l!==null&&yo(l)===null&&(H=w),w=w.sibling;w=H,w===null?(H=f.child,f.child=null):(H=w.sibling,w.sibling=null),Zn(f,!1,H,w,Z);break;case"backwards":for(w=null,H=f.child,f.child=null;H!==null;){if(l=H.alternate,l!==null&&yo(l)===null){f.child=H;break}l=H.sibling,H.sibling=w,w=H,H=l}Zn(f,!0,w,null,Z);break;case"together":Zn(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function Vn(l,f){(f.mode&1)===0&&l!==null&&(l.alternate=null,f.alternate=null,f.flags|=2)}function eo(l,f,w){if(l!==null&&(f.dependencies=l.dependencies),qf|=f.lanes,(w&f.childLanes)===0)return null;if(l!==null&&f.child!==l.child)throw Error(n(153));if(f.child!==null){for(l=f.child,w=rf(l,l.pendingProps),f.child=w,w.return=f;l.sibling!==null;)l=l.sibling,w=w.sibling=rf(l,l.pendingProps),w.return=f;w.sibling=null}return f.child}function hg(l,f,w){switch(f.tag){case 3:So(f),Bt();break;case 5:Au(f);break;case 1:ya(f.type)&&xs(f);break;case 4:Jo(f,f.stateNode.containerInfo);break;case 10:var T=f.type._context,H=f.memoizedProps.value;ur(Pi,T._currentValue),T._currentValue=H;break;case 13:if(T=f.memoizedState,T!==null)return T.dehydrated!==null?(ur(vr,vr.current&1),f.flags|=128,null):(w&f.child.childLanes)!==0?gt(l,f,w):(ur(vr,vr.current&1),l=eo(l,f,w),l!==null?l.sibling:null);ur(vr,vr.current&1);break;case 19:if(T=(w&f.childLanes)!==0,(l.flags&128)!==0){if(T)return na(l,f,w);f.flags|=128}if(H=f.memoizedState,H!==null&&(H.rendering=null,H.tail=null,H.lastEffect=null),ur(vr,vr.current),T)break;return null;case 22:case 23:return f.lanes=0,Gt(l,f,w)}return eo(l,f,w)}var Ty,dg,Ry,My;Ty=function(l,f){for(var w=f.child;w!==null;){if(w.tag===5||w.tag===6)l.appendChild(w.stateNode);else if(w.tag!==4&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===f)break;for(;w.sibling===null;){if(w.return===null||w.return===f)return;w=w.return}w.sibling.return=w.return,w=w.sibling}},dg=function(){},Ry=function(l,f,w,T){var H=l.memoizedProps;if(H!==T){l=f.stateNode,gi(Bn.current);var Z=null;switch(w){case"input":H=tt(l,H),T=tt(l,T),Z=[];break;case"select":H=X({},H,{value:void 0}),T=X({},T,{value:void 0}),Z=[];break;case"textarea":H=ve(l,H),T=ve(l,T),Z=[];break;default:typeof H.onClick!="function"&&typeof T.onClick=="function"&&(l.onclick=Zs)}We(w,T);var he;w=null;for(at in H)if(!T.hasOwnProperty(at)&&H.hasOwnProperty(at)&&H[at]!=null)if(at==="style"){var Ne=H[at];for(he in Ne)Ne.hasOwnProperty(he)&&(w||(w={}),w[he]="")}else at!=="dangerouslySetInnerHTML"&&at!=="children"&&at!=="suppressContentEditableWarning"&&at!=="suppressHydrationWarning"&&at!=="autoFocus"&&(i.hasOwnProperty(at)?Z||(Z=[]):(Z=Z||[]).push(at,null));for(at in T){var Fe=T[at];if(Ne=H?.[at],T.hasOwnProperty(at)&&Fe!==Ne&&(Fe!=null||Ne!=null))if(at==="style")if(Ne){for(he in Ne)!Ne.hasOwnProperty(he)||Fe&&Fe.hasOwnProperty(he)||(w||(w={}),w[he]="");for(he in Fe)Fe.hasOwnProperty(he)&&Ne[he]!==Fe[he]&&(w||(w={}),w[he]=Fe[he])}else w||(Z||(Z=[]),Z.push(at,w)),w=Fe;else at==="dangerouslySetInnerHTML"?(Fe=Fe?Fe.__html:void 0,Ne=Ne?Ne.__html:void 0,Fe!=null&&Ne!==Fe&&(Z=Z||[]).push(at,Fe)):at==="children"?typeof Fe!="string"&&typeof Fe!="number"||(Z=Z||[]).push(at,""+Fe):at!=="suppressContentEditableWarning"&&at!=="suppressHydrationWarning"&&(i.hasOwnProperty(at)?(Fe!=null&&at==="onScroll"&&gr("scroll",l),Z||Ne===Fe||(Z=[])):(Z=Z||[]).push(at,Fe))}w&&(Z=Z||[]).push("style",w);var at=Z;(f.updateQueue=at)&&(f.flags|=4)}},My=function(l,f,w,T){w!==T&&(f.flags|=4)};function Id(l,f){if(!mt)switch(l.tailMode){case"hidden":f=l.tail;for(var w=null;f!==null;)f.alternate!==null&&(w=f),f=f.sibling;w===null?l.tail=null:w.sibling=null;break;case"collapsed":w=l.tail;for(var T=null;w!==null;)w.alternate!==null&&(T=w),w=w.sibling;T===null?f||l.tail===null?l.tail=null:l.tail.sibling=null:T.sibling=null}}function Do(l){var f=l.alternate!==null&&l.alternate.child===l.child,w=0,T=0;if(f)for(var H=l.child;H!==null;)w|=H.lanes|H.childLanes,T|=H.subtreeFlags&14680064,T|=H.flags&14680064,H.return=l,H=H.sibling;else for(H=l.child;H!==null;)w|=H.lanes|H.childLanes,T|=H.subtreeFlags,T|=H.flags,H.return=l,H=H.sibling;return l.subtreeFlags|=T,l.childLanes=w,f}function S_(l,f,w){var T=f.pendingProps;switch(Xe(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Do(f),null;case 1:return ya(f.type)&&ku(),Do(f),null;case 3:return T=f.stateNode,mr(),ir(va),ir(Gi),xa(),T.pendingContext&&(T.context=T.pendingContext,T.pendingContext=null),(l===null||l.child===null)&&(Hr(f)?f.flags|=4:l===null||l.memoizedState.isDehydrated&&(f.flags&256)===0||(f.flags|=1024,vt!==null&&(Eg(vt),vt=null))),dg(l,f),Do(f),null;case 5:Js(f);var H=gi(zr.current);if(w=f.type,l!==null&&f.stateNode!=null)Ry(l,f,w,T,H),l.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!T){if(f.stateNode===null)throw Error(n(166));return Do(f),null}if(l=gi(Bn.current),Hr(f)){T=f.stateNode,w=f.type;var Z=f.memoizedProps;switch(T[Mo]=f,T[Su]=Z,l=(f.mode&1)!==0,w){case"dialog":gr("cancel",T),gr("close",T);break;case"iframe":case"object":case"embed":gr("load",T);break;case"video":case"audio":for(H=0;H<Qo.length;H++)gr(Qo[H],T);break;case"source":gr("error",T);break;case"img":case"image":case"link":gr("error",T),gr("load",T);break;case"details":gr("toggle",T);break;case"input":pe(T,Z),gr("invalid",T);break;case"select":T._wrapperState={wasMultiple:!!Z.multiple},gr("invalid",T);break;case"textarea":ye(T,Z),gr("invalid",T)}We(w,Z),H=null;for(var he in Z)if(Z.hasOwnProperty(he)){var Ne=Z[he];he==="children"?typeof Ne=="string"?T.textContent!==Ne&&(Z.suppressHydrationWarning!==!0&&ec(T.textContent,Ne,l),H=["children",Ne]):typeof Ne=="number"&&T.textContent!==""+Ne&&(Z.suppressHydrationWarning!==!0&&ec(T.textContent,Ne,l),H=["children",""+Ne]):i.hasOwnProperty(he)&&Ne!=null&&he==="onScroll"&&gr("scroll",T)}switch(w){case"input":Ce(T),ge(T,Z,!0);break;case"textarea":Ce(T),je(T);break;case"select":case"option":break;default:typeof Z.onClick=="function"&&(T.onclick=Zs)}T=H,f.updateQueue=T,T!==null&&(f.flags|=4)}else{he=H.nodeType===9?H:H.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=Le(w)),l==="http://www.w3.org/1999/xhtml"?w==="script"?(l=he.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof T.is=="string"?l=he.createElement(w,{is:T.is}):(l=he.createElement(w),w==="select"&&(he=l,T.multiple?he.multiple=!0:T.size&&(he.size=T.size))):l=he.createElementNS(l,w),l[Mo]=f,l[Su]=T,Ty(l,f,!1,!1),f.stateNode=l;e:{switch(he=Be(w,T),w){case"dialog":gr("cancel",l),gr("close",l),H=T;break;case"iframe":case"object":case"embed":gr("load",l),H=T;break;case"video":case"audio":for(H=0;H<Qo.length;H++)gr(Qo[H],l);H=T;break;case"source":gr("error",l),H=T;break;case"img":case"image":case"link":gr("error",l),gr("load",l),H=T;break;case"details":gr("toggle",l),H=T;break;case"input":pe(l,T),H=tt(l,T),gr("invalid",l);break;case"option":H=T;break;case"select":l._wrapperState={wasMultiple:!!T.multiple},H=X({},T,{value:void 0}),gr("invalid",l);break;case"textarea":ye(l,T),H=ve(l,T),gr("invalid",l);break;default:H=T}We(w,H),Ne=H;for(Z in Ne)if(Ne.hasOwnProperty(Z)){var Fe=Ne[Z];Z==="style"?on(l,Fe):Z==="dangerouslySetInnerHTML"?(Fe=Fe?Fe.__html:void 0,Fe!=null&&rt(l,Fe)):Z==="children"?typeof Fe=="string"?(w!=="textarea"||Fe!=="")&&ot(l,Fe):typeof Fe=="number"&&ot(l,""+Fe):Z!=="suppressContentEditableWarning"&&Z!=="suppressHydrationWarning"&&Z!=="autoFocus"&&(i.hasOwnProperty(Z)?Fe!=null&&Z==="onScroll"&&gr("scroll",l):Fe!=null&&k(l,Z,Fe,he))}switch(w){case"input":Ce(l),ge(l,T,!1);break;case"textarea":Ce(l),je(l);break;case"option":T.value!=null&&l.setAttribute("value",""+fe(T.value));break;case"select":l.multiple=!!T.multiple,Z=T.value,Z!=null?Me(l,!!T.multiple,Z,!1):T.defaultValue!=null&&Me(l,!!T.multiple,T.defaultValue,!0);break;default:typeof H.onClick=="function"&&(l.onclick=Zs)}switch(w){case"button":case"input":case"select":case"textarea":T=!!T.autoFocus;break e;case"img":T=!0;break e;default:T=!1}}T&&(f.flags|=4)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return Do(f),null;case 6:if(l&&f.stateNode!=null)My(l,f,l.memoizedProps,T);else{if(typeof T!="string"&&f.stateNode===null)throw Error(n(166));if(w=gi(zr.current),gi(Bn.current),Hr(f)){if(T=f.stateNode,w=f.memoizedProps,T[Mo]=f,(Z=T.nodeValue!==w)&&(l=ct,l!==null))switch(l.tag){case 3:ec(T.nodeValue,w,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&ec(T.nodeValue,w,(l.mode&1)!==0)}Z&&(f.flags|=4)}else T=(w.nodeType===9?w:w.ownerDocument).createTextNode(T),T[Mo]=f,f.stateNode=T}return Do(f),null;case 13:if(ir(vr),T=f.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(mt&&Ue!==null&&(f.mode&1)!==0&&(f.flags&128)===0)_n(),Bt(),f.flags|=98560,Z=!1;else if(Z=Hr(f),T!==null&&T.dehydrated!==null){if(l===null){if(!Z)throw Error(n(318));if(Z=f.memoizedState,Z=Z!==null?Z.dehydrated:null,!Z)throw Error(n(317));Z[Mo]=f}else Bt(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;Do(f),Z=!1}else vt!==null&&(Eg(vt),vt=null),Z=!0;if(!Z)return f.flags&65536?f:null}return(f.flags&128)!==0?(f.lanes=w,f):(T=T!==null,T!==(l!==null&&l.memoizedState!==null)&&T&&(f.child.flags|=8192,(f.mode&1)!==0&&(l===null||(vr.current&1)!==0?Ia===0&&(Ia=3):Pg())),f.updateQueue!==null&&(f.flags|=4),Do(f),null);case 4:return mr(),dg(l,f),l===null&&Ks(f.stateNode.containerInfo),Do(f),null;case 10:return Tr(f.type._context),Do(f),null;case 17:return ya(f.type)&&ku(),Do(f),null;case 19:if(ir(vr),Z=f.memoizedState,Z===null)return Do(f),null;if(T=(f.flags&128)!==0,he=Z.rendering,he===null)if(T)Id(Z,!1);else{if(Ia!==0||l!==null&&(l.flags&128)!==0)for(l=f.child;l!==null;){if(he=yo(l),he!==null){for(f.flags|=128,Id(Z,!1),T=he.updateQueue,T!==null&&(f.updateQueue=T,f.flags|=4),f.subtreeFlags=0,T=w,w=f.child;w!==null;)Z=w,l=T,Z.flags&=14680066,he=Z.alternate,he===null?(Z.childLanes=0,Z.lanes=l,Z.child=null,Z.subtreeFlags=0,Z.memoizedProps=null,Z.memoizedState=null,Z.updateQueue=null,Z.dependencies=null,Z.stateNode=null):(Z.childLanes=he.childLanes,Z.lanes=he.lanes,Z.child=he.child,Z.subtreeFlags=0,Z.deletions=null,Z.memoizedProps=he.memoizedProps,Z.memoizedState=he.memoizedState,Z.updateQueue=he.updateQueue,Z.type=he.type,l=he.dependencies,Z.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),w=w.sibling;return ur(vr,vr.current&1|2),f.child}l=l.sibling}Z.tail!==null&&Cr()>Gh&&(f.flags|=128,T=!0,Id(Z,!1),f.lanes=4194304)}else{if(!T)if(l=yo(he),l!==null){if(f.flags|=128,T=!0,w=l.updateQueue,w!==null&&(f.updateQueue=w,f.flags|=4),Id(Z,!0),Z.tail===null&&Z.tailMode==="hidden"&&!he.alternate&&!mt)return Do(f),null}else 2*Cr()-Z.renderingStartTime>Gh&&w!==1073741824&&(f.flags|=128,T=!0,Id(Z,!1),f.lanes=4194304);Z.isBackwards?(he.sibling=f.child,f.child=he):(w=Z.last,w!==null?w.sibling=he:f.child=he,Z.last=he)}return Z.tail!==null?(f=Z.tail,Z.rendering=f,Z.tail=f.sibling,Z.renderingStartTime=Cr(),f.sibling=null,w=vr.current,ur(vr,T?w&1|2:w&1),f):(Do(f),null);case 22:case 23:return Ag(),T=f.memoizedState!==null,l!==null&&l.memoizedState!==null!==T&&(f.flags|=8192),T&&(f.mode&1)!==0?(tl&1073741824)!==0&&(Do(f),f.subtreeFlags&6&&(f.flags|=8192)):Do(f),null;case 24:return null;case 25:return null}throw Error(n(156,f.tag))}function E_(l,f){switch(Xe(f),f.tag){case 1:return ya(f.type)&&ku(),l=f.flags,l&65536?(f.flags=l&-65537|128,f):null;case 3:return mr(),ir(va),ir(Gi),xa(),l=f.flags,(l&65536)!==0&&(l&128)===0?(f.flags=l&-65537|128,f):null;case 5:return Js(f),null;case 13:if(ir(vr),l=f.memoizedState,l!==null&&l.dehydrated!==null){if(f.alternate===null)throw Error(n(340));Bt()}return l=f.flags,l&65536?(f.flags=l&-65537|128,f):null;case 19:return ir(vr),null;case 4:return mr(),null;case 10:return Tr(f.type._context),null;case 22:case 23:return Ag(),null;case 24:return null;default:return null}}var r1=!1,Fo=!1,k_=typeof WeakSet=="function"?WeakSet:Set,Vt=null;function $h(l,f){var w=l.ref;if(w!==null)if(typeof w=="function")try{w(null)}catch(T){Yi(l,f,T)}else w.current=null}function pg(l,f,w){try{w()}catch(T){Yi(l,f,T)}}var Iy=!1;function A_(l,f){if(tc=vu,l=Mn(),Za(l)){if("selectionStart"in l)var w={start:l.selectionStart,end:l.selectionEnd};else e:{w=(w=l.ownerDocument)&&w.defaultView||window;var T=w.getSelection&&w.getSelection();if(T&&T.rangeCount!==0){w=T.anchorNode;var H=T.anchorOffset,Z=T.focusNode;T=T.focusOffset;try{w.nodeType,Z.nodeType}catch{w=null;break e}var he=0,Ne=-1,Fe=-1,at=0,bt=0,xt=l,yt=null;t:for(;;){for(var qt;xt!==w||H!==0&&xt.nodeType!==3||(Ne=he+H),xt!==Z||T!==0&&xt.nodeType!==3||(Fe=he+T),xt.nodeType===3&&(he+=xt.nodeValue.length),(qt=xt.firstChild)!==null;)yt=xt,xt=qt;for(;;){if(xt===l)break t;if(yt===w&&++at===H&&(Ne=he),yt===Z&&++bt===T&&(Fe=he),(qt=xt.nextSibling)!==null)break;xt=yt,yt=xt.parentNode}xt=qt}w=Ne===-1||Fe===-1?null:{start:Ne,end:Fe}}else w=null}w=w||{start:0,end:0}}else w=null;for(Hl={focusedElem:l,selectionRange:w},vu=!1,Vt=f;Vt!==null;)if(f=Vt,l=f.child,(f.subtreeFlags&1028)!==0&&l!==null)l.return=f,Vt=l;else for(;Vt!==null;){f=Vt;try{var Xt=f.alternate;if((f.flags&1024)!==0)switch(f.tag){case 0:case 11:case 15:break;case 1:if(Xt!==null){var Qt=Xt.memoizedProps,ra=Xt.memoizedState,et=f.stateNode,Ge=et.getSnapshotBeforeUpdate(f.elementType===f.type?Qt:Ma(f.type,Qt),ra);et.__reactInternalSnapshotBeforeUpdate=Ge}break;case 3:var nt=f.stateNode.containerInfo;nt.nodeType===1?nt.textContent="":nt.nodeType===9&&nt.documentElement&&nt.removeChild(nt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(St){Yi(f,f.return,St)}if(l=f.sibling,l!==null){l.return=f.return,Vt=l;break}Vt=f.return}return Xt=Iy,Iy=!1,Xt}function jd(l,f,w){var T=f.updateQueue;if(T=T!==null?T.lastEffect:null,T!==null){var H=T=T.next;do{if((H.tag&l)===l){var Z=H.destroy;H.destroy=void 0,Z!==void 0&&pg(f,w,Z)}H=H.next}while(H!==T)}}function i1(l,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var w=f=f.next;do{if((w.tag&l)===l){var T=w.create;w.destroy=T()}w=w.next}while(w!==f)}}function gg(l){var f=l.ref;if(f!==null){var w=l.stateNode;switch(l.tag){case 5:l=w;break;default:l=w}typeof f=="function"?f(l):f.current=l}}function jy(l){var f=l.alternate;f!==null&&(l.alternate=null,jy(f)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(f=l.stateNode,f!==null&&(delete f[Mo],delete f[Su],delete f[Ra],delete f[Ih],delete f[jh])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function Dy(l){return l.tag===5||l.tag===3||l.tag===4}function Fy(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Dy(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function mg(l,f,w){var T=l.tag;if(T===5||T===6)l=l.stateNode,f?w.nodeType===8?w.parentNode.insertBefore(l,f):w.insertBefore(l,f):(w.nodeType===8?(f=w.parentNode,f.insertBefore(l,w)):(f=w,f.appendChild(l)),w=w._reactRootContainer,w!=null||f.onclick!==null||(f.onclick=Zs));else if(T!==4&&(l=l.child,l!==null))for(mg(l,f,w),l=l.sibling;l!==null;)mg(l,f,w),l=l.sibling}function vg(l,f,w){var T=l.tag;if(T===5||T===6)l=l.stateNode,f?w.insertBefore(l,f):w.appendChild(l);else if(T!==4&&(l=l.child,l!==null))for(vg(l,f,w),l=l.sibling;l!==null;)vg(l,f,w),l=l.sibling}var Eo=null,Kl=!1;function Qc(l,f,w){for(w=w.child;w!==null;)By(l,f,w),w=w.sibling}function By(l,f,w){if(wi&&typeof wi.onCommitFiberUnmount=="function")try{wi.onCommitFiberUnmount(Po,w)}catch{}switch(w.tag){case 5:Fo||$h(w,f);case 6:var T=Eo,H=Kl;Eo=null,Qc(l,f,w),Eo=T,Kl=H,Eo!==null&&(Kl?(l=Eo,w=w.stateNode,l.nodeType===8?l.parentNode.removeChild(w):l.removeChild(w)):Eo.removeChild(w.stateNode));break;case 18:Eo!==null&&(Kl?(l=Eo,w=w.stateNode,l.nodeType===8?qc(l.parentNode,w):l.nodeType===1&&qc(l,w),fa(l)):qc(Eo,w.stateNode));break;case 4:T=Eo,H=Kl,Eo=w.stateNode.containerInfo,Kl=!0,Qc(l,f,w),Eo=T,Kl=H;break;case 0:case 11:case 14:case 15:if(!Fo&&(T=w.updateQueue,T!==null&&(T=T.lastEffect,T!==null))){H=T=T.next;do{var Z=H,he=Z.destroy;Z=Z.tag,he!==void 0&&((Z&2)!==0||(Z&4)!==0)&&pg(w,f,he),H=H.next}while(H!==T)}Qc(l,f,w);break;case 1:if(!Fo&&($h(w,f),T=w.stateNode,typeof T.componentWillUnmount=="function"))try{T.props=w.memoizedProps,T.state=w.memoizedState,T.componentWillUnmount()}catch(Ne){Yi(w,f,Ne)}Qc(l,f,w);break;case 21:Qc(l,f,w);break;case 22:w.mode&1?(Fo=(T=Fo)||w.memoizedState!==null,Qc(l,f,w),Fo=T):Qc(l,f,w);break;default:Qc(l,f,w)}}function zy(l){var f=l.updateQueue;if(f!==null){l.updateQueue=null;var w=l.stateNode;w===null&&(w=l.stateNode=new k_),f.forEach(function(T){var H=I_.bind(null,l,T);w.has(T)||(w.add(T),T.then(H,H))})}}function Zl(l,f){var w=f.deletions;if(w!==null)for(var T=0;T<w.length;T++){var H=w[T];try{var Z=l,he=f,Ne=he;e:for(;Ne!==null;){switch(Ne.tag){case 5:Eo=Ne.stateNode,Kl=!1;break e;case 3:Eo=Ne.stateNode.containerInfo,Kl=!0;break e;case 4:Eo=Ne.stateNode.containerInfo,Kl=!0;break e}Ne=Ne.return}if(Eo===null)throw Error(n(160));By(Z,he,H),Eo=null,Kl=!1;var Fe=H.alternate;Fe!==null&&(Fe.return=null),H.return=null}catch(at){Yi(H,f,at)}}if(f.subtreeFlags&12854)for(f=f.child;f!==null;)Uy(f,l),f=f.sibling}function Uy(l,f){var w=l.alternate,T=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Zl(f,l),Tu(l),T&4){try{jd(3,l,l.return),i1(3,l)}catch(Qt){Yi(l,l.return,Qt)}try{jd(5,l,l.return)}catch(Qt){Yi(l,l.return,Qt)}}break;case 1:Zl(f,l),Tu(l),T&512&&w!==null&&$h(w,w.return);break;case 5:if(Zl(f,l),Tu(l),T&512&&w!==null&&$h(w,w.return),l.flags&32){var H=l.stateNode;try{ot(H,"")}catch(Qt){Yi(l,l.return,Qt)}}if(T&4&&(H=l.stateNode,H!=null)){var Z=l.memoizedProps,he=w!==null?w.memoizedProps:Z,Ne=l.type,Fe=l.updateQueue;if(l.updateQueue=null,Fe!==null)try{Ne==="input"&&Z.type==="radio"&&Z.name!=null&&ut(H,Z),Be(Ne,he);var at=Be(Ne,Z);for(he=0;he<Fe.length;he+=2){var bt=Fe[he],xt=Fe[he+1];bt==="style"?on(H,xt):bt==="dangerouslySetInnerHTML"?rt(H,xt):bt==="children"?ot(H,xt):k(H,bt,xt,at)}switch(Ne){case"input":be(H,Z);break;case"textarea":we(H,Z);break;case"select":var yt=H._wrapperState.wasMultiple;H._wrapperState.wasMultiple=!!Z.multiple;var qt=Z.value;qt!=null?Me(H,!!Z.multiple,qt,!1):yt!==!!Z.multiple&&(Z.defaultValue!=null?Me(H,!!Z.multiple,Z.defaultValue,!0):Me(H,!!Z.multiple,Z.multiple?[]:"",!1))}H[Su]=Z}catch(Qt){Yi(l,l.return,Qt)}}break;case 6:if(Zl(f,l),Tu(l),T&4){if(l.stateNode===null)throw Error(n(162));H=l.stateNode,Z=l.memoizedProps;try{H.nodeValue=Z}catch(Qt){Yi(l,l.return,Qt)}}break;case 3:if(Zl(f,l),Tu(l),T&4&&w!==null&&w.memoizedState.isDehydrated)try{fa(f.containerInfo)}catch(Qt){Yi(l,l.return,Qt)}break;case 4:Zl(f,l),Tu(l);break;case 13:Zl(f,l),Tu(l),H=l.child,H.flags&8192&&(Z=H.memoizedState!==null,H.stateNode.isHidden=Z,!Z||H.alternate!==null&&H.alternate.memoizedState!==null||(wg=Cr())),T&4&&zy(l);break;case 22:if(bt=w!==null&&w.memoizedState!==null,l.mode&1?(Fo=(at=Fo)||bt,Zl(f,l),Fo=at):Zl(f,l),Tu(l),T&8192){if(at=l.memoizedState!==null,(l.stateNode.isHidden=at)&&!bt&&(l.mode&1)!==0)for(Vt=l,bt=l.child;bt!==null;){for(xt=Vt=bt;Vt!==null;){switch(yt=Vt,qt=yt.child,yt.tag){case 0:case 11:case 14:case 15:jd(4,yt,yt.return);break;case 1:$h(yt,yt.return);var Xt=yt.stateNode;if(typeof Xt.componentWillUnmount=="function"){T=yt,w=yt.return;try{f=T,Xt.props=f.memoizedProps,Xt.state=f.memoizedState,Xt.componentWillUnmount()}catch(Qt){Yi(T,w,Qt)}}break;case 5:$h(yt,yt.return);break;case 22:if(yt.memoizedState!==null){Hy(xt);continue}}qt!==null?(qt.return=yt,Vt=qt):Hy(xt)}bt=bt.sibling}e:for(bt=null,xt=l;;){if(xt.tag===5){if(bt===null){bt=xt;try{H=xt.stateNode,at?(Z=H.style,typeof Z.setProperty=="function"?Z.setProperty("display","none","important"):Z.display="none"):(Ne=xt.stateNode,Fe=xt.memoizedProps.style,he=Fe!=null&&Fe.hasOwnProperty("display")?Fe.display:null,Ne.style.display=Zt("display",he))}catch(Qt){Yi(l,l.return,Qt)}}}else if(xt.tag===6){if(bt===null)try{xt.stateNode.nodeValue=at?"":xt.memoizedProps}catch(Qt){Yi(l,l.return,Qt)}}else if((xt.tag!==22&&xt.tag!==23||xt.memoizedState===null||xt===l)&&xt.child!==null){xt.child.return=xt,xt=xt.child;continue}if(xt===l)break e;for(;xt.sibling===null;){if(xt.return===null||xt.return===l)break e;bt===xt&&(bt=null),xt=xt.return}bt===xt&&(bt=null),xt.sibling.return=xt.return,xt=xt.sibling}}break;case 19:Zl(f,l),Tu(l),T&4&&zy(l);break;case 21:break;default:Zl(f,l),Tu(l)}}function Tu(l){var f=l.flags;if(f&2){try{e:{for(var w=l.return;w!==null;){if(Dy(w)){var T=w;break e}w=w.return}throw Error(n(160))}switch(T.tag){case 5:var H=T.stateNode;T.flags&32&&(ot(H,""),T.flags&=-33);var Z=Fy(l);vg(l,Z,H);break;case 3:case 4:var he=T.stateNode.containerInfo,Ne=Fy(l);mg(l,Ne,he);break;default:throw Error(n(161))}}catch(Fe){Yi(l,l.return,Fe)}l.flags&=-3}f&4096&&(l.flags&=-4097)}function P_(l,f,w){Vt=l,qy(l)}function qy(l,f,w){for(var T=(l.mode&1)!==0;Vt!==null;){var H=Vt,Z=H.child;if(H.tag===22&&T){var he=H.memoizedState!==null||r1;if(!he){var Ne=H.alternate,Fe=Ne!==null&&Ne.memoizedState!==null||Fo;Ne=r1;var at=Fo;if(r1=he,(Fo=Fe)&&!at)for(Vt=H;Vt!==null;)he=Vt,Fe=he.child,he.tag===22&&he.memoizedState!==null?Gy(H):Fe!==null?(Fe.return=he,Vt=Fe):Gy(H);for(;Z!==null;)Vt=Z,qy(Z),Z=Z.sibling;Vt=H,r1=Ne,Fo=at}$y(l)}else(H.subtreeFlags&8772)!==0&&Z!==null?(Z.return=H,Vt=Z):$y(l)}}function $y(l){for(;Vt!==null;){var f=Vt;if((f.flags&8772)!==0){var w=f.alternate;try{if((f.flags&8772)!==0)switch(f.tag){case 0:case 11:case 15:Fo||i1(5,f);break;case 1:var T=f.stateNode;if(f.flags&4&&!Fo)if(w===null)T.componentDidMount();else{var H=f.elementType===f.type?w.memoizedProps:Ma(f.type,w.memoizedProps);T.componentDidUpdate(H,w.memoizedState,T.__reactInternalSnapshotBeforeUpdate)}var Z=f.updateQueue;Z!==null&&Kn(f,Z,T);break;case 3:var he=f.updateQueue;if(he!==null){if(w=null,f.child!==null)switch(f.child.tag){case 5:w=f.child.stateNode;break;case 1:w=f.child.stateNode}Kn(f,he,w)}break;case 5:var Ne=f.stateNode;if(w===null&&f.flags&4){w=Ne;var Fe=f.memoizedProps;switch(f.type){case"button":case"input":case"select":case"textarea":Fe.autoFocus&&w.focus();break;case"img":Fe.src&&(w.src=Fe.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(f.memoizedState===null){var at=f.alternate;if(at!==null){var bt=at.memoizedState;if(bt!==null){var xt=bt.dehydrated;xt!==null&&fa(xt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Fo||f.flags&512&&gg(f)}catch(yt){Yi(f,f.return,yt)}}if(f===l){Vt=null;break}if(w=f.sibling,w!==null){w.return=f.return,Vt=w;break}Vt=f.return}}function Hy(l){for(;Vt!==null;){var f=Vt;if(f===l){Vt=null;break}var w=f.sibling;if(w!==null){w.return=f.return,Vt=w;break}Vt=f.return}}function Gy(l){for(;Vt!==null;){var f=Vt;try{switch(f.tag){case 0:case 11:case 15:var w=f.return;try{i1(4,f)}catch(Fe){Yi(f,w,Fe)}break;case 1:var T=f.stateNode;if(typeof T.componentDidMount=="function"){var H=f.return;try{T.componentDidMount()}catch(Fe){Yi(f,H,Fe)}}var Z=f.return;try{gg(f)}catch(Fe){Yi(f,Z,Fe)}break;case 5:var he=f.return;try{gg(f)}catch(Fe){Yi(f,he,Fe)}}}catch(Fe){Yi(f,f.return,Fe)}if(f===l){Vt=null;break}var Ne=f.sibling;if(Ne!==null){Ne.return=f.return,Vt=Ne;break}Vt=f.return}}var O_=Math.ceil,a1=E.ReactCurrentDispatcher,yg=E.ReactCurrentOwner,kl=E.ReactCurrentBatchConfig,fr=0,to=null,Sa=null,ko=0,tl=0,Hh=Io(0),Ia=0,Dd=null,qf=0,o1=0,bg=0,Fd=null,Ps=null,wg=0,Gh=1/0,sc=null,s1=!1,xg=null,Jc=null,l1=!1,ef=null,u1=0,Bd=0,_g=null,c1=-1,f1=0;function ns(){return(fr&6)!==0?Cr():c1!==-1?c1:c1=Cr()}function tf(l){return(l.mode&1)===0?1:(fr&2)!==0&&ko!==0?ko&-ko:Gr.transition!==null?(f1===0&&(f1=du()),f1):(l=jn,l!==0||(l=window.event,l=l===void 0?16:Il(l.type)),l)}function Ql(l,f,w,T){if(50<Bd)throw Bd=0,_g=null,Error(n(185));Rl(l,w,T),((fr&2)===0||l!==to)&&(l===to&&((fr&2)===0&&(o1|=w),Ia===4&&nf(l,ko)),Os(l,T),w===1&&fr===0&&(f.mode&1)===0&&(Gh=Cr()+500,Wl&&ne()))}function Os(l,f){var w=l.callbackNode;xi(l,f);var T=ls(l,l===to?ko:0);if(T===0)w!==null&&as(w),l.callbackNode=null,l.callbackPriority=0;else if(f=T&-T,l.callbackPriority!==f){if(w!=null&&as(w),f===1)l.tag===0?V(Vy.bind(null,l)):M(Vy.bind(null,l)),Rh(function(){(fr&6)===0&&ne()}),w=null;else{switch(cs(T)){case 1:w=os;break;case 4:w=Oa;break;case 16:w=ss;break;case 536870912:w=hl;break;default:w=ss}w=t5(w,Wy.bind(null,l))}l.callbackPriority=f,l.callbackNode=w}}function Wy(l,f){if(c1=-1,f1=0,(fr&6)!==0)throw Error(n(327));var w=l.callbackNode;if(Wh()&&l.callbackNode!==w)return null;var T=ls(l,l===to?ko:0);if(T===0)return null;if((T&30)!==0||(T&l.expiredLanes)!==0||f)f=h1(l,T);else{f=T;var H=fr;fr|=2;var Z=Xy();(to!==l||ko!==f)&&(sc=null,Gh=Cr()+500,Hf(l,f));do try{N_();break}catch(Ne){Yy(l,Ne)}while(!0);Yn(),a1.current=Z,fr=H,Sa!==null?f=0:(to=null,ko=0,f=Ia)}if(f!==0){if(f===2&&(H=Ba(l),H!==0&&(T=H,f=Sg(l,H))),f===1)throw w=Dd,Hf(l,0),nf(l,T),Os(l,Cr()),w;if(f===6)nf(l,T);else{if(H=l.current.alternate,(T&30)===0&&!C_(H)&&(f=h1(l,T),f===2&&(Z=Ba(l),Z!==0&&(T=Z,f=Sg(l,Z))),f===1))throw w=Dd,Hf(l,0),nf(l,T),Os(l,Cr()),w;switch(l.finishedWork=H,l.finishedLanes=T,f){case 0:case 1:throw Error(n(345));case 2:Gf(l,Ps,sc);break;case 3:if(nf(l,T),(T&130023424)===T&&(f=wg+500-Cr(),10<f)){if(ls(l,0)!==0)break;if(H=l.suspendedLanes,(H&T)!==T){ns(),l.pingedLanes|=l.suspendedLanes&H;break}l.timeoutHandle=vo(Gf.bind(null,l,Ps,sc),f);break}Gf(l,Ps,sc);break;case 4:if(nf(l,T),(T&4194240)===T)break;for(f=l.eventTimes,H=-1;0<T;){var he=31-wn(T);Z=1<<he,he=f[he],he>H&&(H=he),T&=~Z}if(T=H,T=Cr()-T,T=(120>T?120:480>T?480:1080>T?1080:1920>T?1920:3e3>T?3e3:4320>T?4320:1960*O_(T/1960))-T,10<T){l.timeoutHandle=vo(Gf.bind(null,l,Ps,sc),T);break}Gf(l,Ps,sc);break;case 5:Gf(l,Ps,sc);break;default:throw Error(n(329))}}}return Os(l,Cr()),l.callbackNode===w?Wy.bind(null,l):null}function Sg(l,f){var w=Fd;return l.current.memoizedState.isDehydrated&&(Hf(l,f).flags|=256),l=h1(l,f),l!==2&&(f=Ps,Ps=w,f!==null&&Eg(f)),l}function Eg(l){Ps===null?Ps=l:Ps.push.apply(Ps,l)}function C_(l){for(var f=l;;){if(f.flags&16384){var w=f.updateQueue;if(w!==null&&(w=w.stores,w!==null))for(var T=0;T<w.length;T++){var H=w[T],Z=H.getSnapshot;H=H.value;try{if(!Nr(Z(),H))return!1}catch{return!1}}}if(w=f.child,f.subtreeFlags&16384&&w!==null)w.return=f,f=w;else{if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function nf(l,f){for(f&=~bg,f&=~o1,l.suspendedLanes|=f,l.pingedLanes&=~f,l=l.expirationTimes;0<f;){var w=31-wn(f),T=1<<w;l[w]=-1,f&=~T}}function Vy(l){if((fr&6)!==0)throw Error(n(327));Wh();var f=ls(l,0);if((f&1)===0)return Os(l,Cr()),null;var w=h1(l,f);if(l.tag!==0&&w===2){var T=Ba(l);T!==0&&(f=T,w=Sg(l,T))}if(w===1)throw w=Dd,Hf(l,0),nf(l,f),Os(l,Cr()),w;if(w===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=f,Gf(l,Ps,sc),Os(l,Cr()),null}function kg(l,f){var w=fr;fr|=1;try{return l(f)}finally{fr=w,fr===0&&(Gh=Cr()+500,Wl&&ne())}}function $f(l){ef!==null&&ef.tag===0&&(fr&6)===0&&Wh();var f=fr;fr|=1;var w=kl.transition,T=jn;try{if(kl.transition=null,jn=1,l)return l()}finally{jn=T,kl.transition=w,fr=f,(fr&6)===0&&ne()}}function Ag(){tl=Hh.current,ir(Hh)}function Hf(l,f){l.finishedWork=null,l.finishedLanes=0;var w=l.timeoutHandle;if(w!==-1&&(l.timeoutHandle=-1,Uc(w)),Sa!==null)for(w=Sa.return;w!==null;){var T=w;switch(Xe(T),T.tag){case 1:T=T.type.childContextTypes,T!=null&&ku();break;case 3:mr(),ir(va),ir(Gi),xa();break;case 5:Js(T);break;case 4:mr();break;case 13:ir(vr);break;case 19:ir(vr);break;case 10:Tr(T.type._context);break;case 22:case 23:Ag()}w=w.return}if(to=l,Sa=l=rf(l.current,null),ko=tl=f,Ia=0,Dd=null,bg=o1=qf=0,Ps=Fd=null,ar!==null){for(f=0;f<ar.length;f++)if(w=ar[f],T=w.interleaved,T!==null){w.interleaved=null;var H=T.next,Z=w.pending;if(Z!==null){var he=Z.next;Z.next=H,T.next=he}w.pending=T}ar=null}return l}function Yy(l,f){do{var w=Sa;try{if(Yn(),Pu.current=Yc,bo){for(var T=cr.memoizedState;T!==null;){var H=T.queue;H!==null&&(H.pending=null),T=T.next}bo=!1}if(Vi=0,Yr=Vr=cr=null,jo=!1,wo=0,yg.current=null,w===null||w.return===null){Ia=1,Dd=f,Sa=null;break}e:{var Z=l,he=w.return,Ne=w,Fe=f;if(f=ko,Ne.flags|=32768,Fe!==null&&typeof Fe=="object"&&typeof Fe.then=="function"){var at=Fe,bt=Ne,xt=bt.tag;if((bt.mode&1)===0&&(xt===0||xt===11||xt===15)){var yt=bt.alternate;yt?(bt.updateQueue=yt.updateQueue,bt.memoizedState=yt.memoizedState,bt.lanes=yt.lanes):(bt.updateQueue=null,bt.memoizedState=null)}var qt=L(he);if(qt!==null){qt.flags&=-257,U(qt,he,Ne,Z,f),qt.mode&1&&v(Z,at,f),f=qt,Fe=at;var Xt=f.updateQueue;if(Xt===null){var Qt=new Set;Qt.add(Fe),f.updateQueue=Qt}else Xt.add(Fe);break e}else{if((f&1)===0){v(Z,at,f),Pg();break e}Fe=Error(n(426))}}else if(mt&&Ne.mode&1){var ra=L(he);if(ra!==null){(ra.flags&65536)===0&&(ra.flags|=256),U(ra,he,Ne,Z,f),Et(oc(Fe,Ne));break e}}Z=Fe=oc(Fe,Ne),Ia!==4&&(Ia=2),Fd===null?Fd=[Z]:Fd.push(Z),Z=he;do{switch(Z.tag){case 3:Z.flags|=65536,f&=-f,Z.lanes|=f;var et=n1(Z,Fe,f);or(Z,et);break e;case 1:Ne=Fe;var Ge=Z.type,nt=Z.stateNode;if((Z.flags&128)===0&&(typeof Ge.getDerivedStateFromError=="function"||nt!==null&&typeof nt.componentDidCatch=="function"&&(Jc===null||!Jc.has(nt)))){Z.flags|=65536,f&=-f,Z.lanes|=f;var St=p(Z,Ne,f);or(Z,St);break e}}Z=Z.return}while(Z!==null)}Zy(w)}catch(nn){f=nn,Sa===w&&w!==null&&(Sa=w=w.return);continue}break}while(!0)}function Xy(){var l=a1.current;return a1.current=Yc,l===null?Yc:l}function Pg(){(Ia===0||Ia===3||Ia===2)&&(Ia=4),to===null||(qf&268435455)===0&&(o1&268435455)===0||nf(to,ko)}function h1(l,f){var w=fr;fr|=2;var T=Xy();(to!==l||ko!==f)&&(sc=null,Hf(l,f));do try{L_();break}catch(H){Yy(l,H)}while(!0);if(Yn(),fr=w,a1.current=T,Sa!==null)throw Error(n(261));return to=null,ko=0,Ia}function L_(){for(;Sa!==null;)Ky(Sa)}function N_(){for(;Sa!==null&&!fu();)Ky(Sa)}function Ky(l){var f=e5(l.alternate,l,tl);l.memoizedProps=l.pendingProps,f===null?Zy(l):Sa=f,yg.current=null}function Zy(l){var f=l;do{var w=f.alternate;if(l=f.return,(f.flags&32768)===0){if(w=S_(w,f,tl),w!==null){Sa=w;return}}else{if(w=E_(w,f),w!==null){w.flags&=32767,Sa=w;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Ia=6,Sa=null;return}}if(f=f.sibling,f!==null){Sa=f;return}Sa=f=l}while(f!==null);Ia===0&&(Ia=5)}function Gf(l,f,w){var T=jn,H=kl.transition;try{kl.transition=null,jn=1,T_(l,f,w,T)}finally{kl.transition=H,jn=T}return null}function T_(l,f,w,T){do Wh();while(ef!==null);if((fr&6)!==0)throw Error(n(327));w=l.finishedWork;var H=l.finishedLanes;if(w===null)return null;if(l.finishedWork=null,l.finishedLanes=0,w===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var Z=w.lanes|w.childLanes;if(us(l,Z),l===to&&(Sa=to=null,ko=0),(w.subtreeFlags&2064)===0&&(w.flags&2064)===0||l1||(l1=!0,t5(ss,function(){return Wh(),null})),Z=(w.flags&15990)!==0,(w.subtreeFlags&15990)!==0||Z){Z=kl.transition,kl.transition=null;var he=jn;jn=1;var Ne=fr;fr|=4,yg.current=null,A_(l,w),Uy(w,l),Ys(Hl),vu=!!tc,Hl=tc=null,l.current=w,P_(w),If(),fr=Ne,jn=he,kl.transition=Z}else l.current=w;if(l1&&(l1=!1,ef=l,u1=H),Z=l.pendingLanes,Z===0&&(Jc=null),pr(w.stateNode),Os(l,Cr()),f!==null)for(T=l.onRecoverableError,w=0;w<f.length;w++)H=f[w],T(H.value,{componentStack:H.stack,digest:H.digest});if(s1)throw s1=!1,l=xg,xg=null,l;return(u1&1)!==0&&l.tag!==0&&Wh(),Z=l.pendingLanes,(Z&1)!==0?l===_g?Bd++:(Bd=0,_g=l):Bd=0,ne(),null}function Wh(){if(ef!==null){var l=cs(u1),f=kl.transition,w=jn;try{if(kl.transition=null,jn=16>l?16:l,ef===null)var T=!1;else{if(l=ef,ef=null,u1=0,(fr&6)!==0)throw Error(n(331));var H=fr;for(fr|=4,Vt=l.current;Vt!==null;){var Z=Vt,he=Z.child;if((Vt.flags&16)!==0){var Ne=Z.deletions;if(Ne!==null){for(var Fe=0;Fe<Ne.length;Fe++){var at=Ne[Fe];for(Vt=at;Vt!==null;){var bt=Vt;switch(bt.tag){case 0:case 11:case 15:jd(8,bt,Z)}var xt=bt.child;if(xt!==null)xt.return=bt,Vt=xt;else for(;Vt!==null;){bt=Vt;var yt=bt.sibling,qt=bt.return;if(jy(bt),bt===at){Vt=null;break}if(yt!==null){yt.return=qt,Vt=yt;break}Vt=qt}}}var Xt=Z.alternate;if(Xt!==null){var Qt=Xt.child;if(Qt!==null){Xt.child=null;do{var ra=Qt.sibling;Qt.sibling=null,Qt=ra}while(Qt!==null)}}Vt=Z}}if((Z.subtreeFlags&2064)!==0&&he!==null)he.return=Z,Vt=he;else e:for(;Vt!==null;){if(Z=Vt,(Z.flags&2048)!==0)switch(Z.tag){case 0:case 11:case 15:jd(9,Z,Z.return)}var et=Z.sibling;if(et!==null){et.return=Z.return,Vt=et;break e}Vt=Z.return}}var Ge=l.current;for(Vt=Ge;Vt!==null;){he=Vt;var nt=he.child;if((he.subtreeFlags&2064)!==0&&nt!==null)nt.return=he,Vt=nt;else e:for(he=Ge;Vt!==null;){if(Ne=Vt,(Ne.flags&2048)!==0)try{switch(Ne.tag){case 0:case 11:case 15:i1(9,Ne)}}catch(nn){Yi(Ne,Ne.return,nn)}if(Ne===he){Vt=null;break e}var St=Ne.sibling;if(St!==null){St.return=Ne.return,Vt=St;break e}Vt=Ne.return}}if(fr=H,ne(),wi&&typeof wi.onPostCommitFiberRoot=="function")try{wi.onPostCommitFiberRoot(Po,l)}catch{}T=!0}return T}finally{jn=w,kl.transition=f}}return!1}function Qy(l,f,w){f=oc(w,f),f=n1(l,f,1),l=Wr(l,f,1),f=ns(),l!==null&&(Rl(l,1,f),Os(l,f))}function Yi(l,f,w){if(l.tag===3)Qy(l,l,w);else for(;f!==null;){if(f.tag===3){Qy(f,l,w);break}else if(f.tag===1){var T=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof T.componentDidCatch=="function"&&(Jc===null||!Jc.has(T))){l=oc(w,l),l=p(f,l,1),f=Wr(f,l,1),l=ns(),f!==null&&(Rl(f,1,l),Os(f,l));break}}f=f.return}}function R_(l,f,w){var T=l.pingCache;T!==null&&T.delete(f),f=ns(),l.pingedLanes|=l.suspendedLanes&w,to===l&&(ko&w)===w&&(Ia===4||Ia===3&&(ko&130023424)===ko&&500>Cr()-wg?Hf(l,0):bg|=w),Os(l,f)}function Jy(l,f){f===0&&((l.mode&1)===0?f=1:(f=qi,qi<<=1,(qi&130023424)===0&&(qi=4194304)));var w=ns();l=er(l,f),l!==null&&(Rl(l,f,w),Os(l,w))}function M_(l){var f=l.memoizedState,w=0;f!==null&&(w=f.retryLane),Jy(l,w)}function I_(l,f){var w=0;switch(l.tag){case 13:var T=l.stateNode,H=l.memoizedState;H!==null&&(w=H.retryLane);break;case 19:T=l.stateNode;break;default:throw Error(n(314))}T!==null&&T.delete(f),Jy(l,w)}var e5;e5=function(l,f,w){if(l!==null)if(l.memoizedProps!==f.pendingProps||va.current)ae=!0;else{if((l.lanes&w)===0&&(f.flags&128)===0)return ae=!1,hg(l,f,w);ae=(l.flags&131072)!==0}else ae=!1,mt&&(f.flags&1048576)!==0&&Qe(f,Se,f.index);switch(f.lanes=0,f.tag){case 2:var T=f.type;Vn(l,f),l=f.pendingProps;var H=Gl(f,Gi.current);Rr(f,w),H=Sl(null,f,T,l,H,w);var Z=xo();return f.flags|=1,typeof H=="object"&&H!==null&&typeof H.render=="function"&&H.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,ya(T)?(Z=!0,xs(f)):Z=!1,f.memoizedState=H.state!==null&&H.state!==void 0?H.state:null,ji(f),H.updater=Kc,f.stateNode=H,H._reactInternals=f,Uh(f,T,l,w),f=xr(null,f,T,!0,Z,w)):(f.tag=0,mt&&Z&&ht(f),ke(null,f,H,w),f=f.child),f;case 16:T=f.elementType;e:{switch(Vn(l,f),l=f.pendingProps,H=T._init,T=H(T._payload),f.type=T,H=f.tag=D_(T),l=Ma(T,l),H){case 0:f=Rt(null,f,T,l,w);break e;case 1:f=Ur(null,f,T,l,w);break e;case 11:f=Ve(null,f,T,l,w);break e;case 14:f=st(null,f,T,Ma(T.type,l),w);break e}throw Error(n(306,T,""))}return f;case 0:return T=f.type,H=f.pendingProps,H=f.elementType===T?H:Ma(T,H),Rt(l,f,T,H,w);case 1:return T=f.type,H=f.pendingProps,H=f.elementType===T?H:Ma(T,H),Ur(l,f,T,H,w);case 3:e:{if(So(f),l===null)throw Error(n(387));T=f.pendingProps,Z=f.memoizedState,H=Z.element,ba(l,f),Wi(f,T,null,w);var he=f.memoizedState;if(T=he.element,Z.isDehydrated)if(Z={element:T,isDehydrated:!1,cache:he.cache,pendingSuspenseBoundaries:he.pendingSuspenseBoundaries,transitions:he.transitions},f.updateQueue.baseState=Z,f.memoizedState=Z,f.flags&256){H=oc(Error(n(423)),f),f=El(l,f,T,w,H);break e}else if(T!==H){H=oc(Error(n(424)),f),f=El(l,f,T,w,H);break e}else for(Ue=Qi(f.stateNode.containerInfo.firstChild),ct=f,mt=!0,vt=null,w=Wn(f,null,T,w),f.child=w;w;)w.flags=w.flags&-3|4096,w=w.sibling;else{if(Bt(),T===H){f=eo(l,f,w);break e}ke(l,f,T,w)}f=f.child}return f;case 5:return Au(f),l===null&&Ut(f),T=f.type,H=f.pendingProps,Z=l!==null?l.memoizedProps:null,he=H.children,Ff(T,H)?he=null:Z!==null&&Ff(T,Z)&&(f.flags|=32),kn(l,f),ke(l,f,he,w),f.child;case 6:return l===null&&Ut(f),null;case 13:return gt(l,f,w);case 4:return Jo(f,f.stateNode.containerInfo),T=f.pendingProps,l===null?f.child=pi(f,null,T,w):ke(l,f,T,w),f.child;case 11:return T=f.type,H=f.pendingProps,H=f.elementType===T?H:Ma(T,H),Ve(l,f,T,H,w);case 7:return ke(l,f,f.pendingProps,w),f.child;case 8:return ke(l,f,f.pendingProps.children,w),f.child;case 12:return ke(l,f,f.pendingProps.children,w),f.child;case 10:e:{if(T=f.type._context,H=f.pendingProps,Z=f.memoizedProps,he=H.value,ur(Pi,T._currentValue),T._currentValue=he,Z!==null)if(Nr(Z.value,he)){if(Z.children===H.children&&!va.current){f=eo(l,f,w);break e}}else for(Z=f.child,Z!==null&&(Z.return=f);Z!==null;){var Ne=Z.dependencies;if(Ne!==null){he=Z.child;for(var Fe=Ne.firstContext;Fe!==null;){if(Fe.context===T){if(Z.tag===1){Fe=ai(-1,w&-w),Fe.tag=2;var at=Z.updateQueue;if(at!==null){at=at.shared;var bt=at.pending;bt===null?Fe.next=Fe:(Fe.next=bt.next,bt.next=Fe),at.pending=Fe}}Z.lanes|=w,Fe=Z.alternate,Fe!==null&&(Fe.lanes|=w),Xn(Z.return,w,f),Ne.lanes|=w;break}Fe=Fe.next}}else if(Z.tag===10)he=Z.type===f.type?null:Z.child;else if(Z.tag===18){if(he=Z.return,he===null)throw Error(n(341));he.lanes|=w,Ne=he.alternate,Ne!==null&&(Ne.lanes|=w),Xn(he,w,f),he=Z.sibling}else he=Z.child;if(he!==null)he.return=Z;else for(he=Z;he!==null;){if(he===f){he=null;break}if(Z=he.sibling,Z!==null){Z.return=he.return,he=Z;break}he=he.return}Z=he}ke(l,f,H.children,w),f=f.child}return f;case 9:return H=f.type,T=f.pendingProps.children,Rr(f,w),H=Mr(H),T=T(H),f.flags|=1,ke(l,f,T,w),f.child;case 14:return T=f.type,H=Ma(T,f.pendingProps),H=Ma(T.type,H),st(l,f,T,H,w);case 15:return _t(l,f,f.type,f.pendingProps,w);case 17:return T=f.type,H=f.pendingProps,H=f.elementType===T?H:Ma(T,H),Vn(l,f),f.tag=1,ya(T)?(l=!0,xs(f)):l=!1,Rr(f,w),t1(f,T,H),Uh(f,T,H,w),xr(null,f,T,!0,l,w);case 19:return na(l,f,w);case 22:return Gt(l,f,w)}throw Error(n(156,f.tag))};function t5(l,f){return Fs(l,f)}function j_(l,f,w,T){this.tag=l,this.key=w,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=T,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Al(l,f,w,T){return new j_(l,f,w,T)}function Og(l){return l=l.prototype,!(!l||!l.isReactComponent)}function D_(l){if(typeof l=="function")return Og(l)?1:0;if(l!=null){if(l=l.$$typeof,l===N)return 11;if(l===te)return 14}return 2}function rf(l,f){var w=l.alternate;return w===null?(w=Al(l.tag,f,l.key,l.mode),w.elementType=l.elementType,w.type=l.type,w.stateNode=l.stateNode,w.alternate=l,l.alternate=w):(w.pendingProps=f,w.type=l.type,w.flags=0,w.subtreeFlags=0,w.deletions=null),w.flags=l.flags&14680064,w.childLanes=l.childLanes,w.lanes=l.lanes,w.child=l.child,w.memoizedProps=l.memoizedProps,w.memoizedState=l.memoizedState,w.updateQueue=l.updateQueue,f=l.dependencies,w.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},w.sibling=l.sibling,w.index=l.index,w.ref=l.ref,w}function d1(l,f,w,T,H,Z){var he=2;if(T=l,typeof l=="function")Og(l)&&(he=1);else if(typeof l=="string")he=5;else e:switch(l){case O:return Wf(w.children,H,Z,f);case I:he=8,H|=8;break;case j:return l=Al(12,w,f,H|2),l.elementType=j,l.lanes=Z,l;case $:return l=Al(13,w,f,H),l.elementType=$,l.lanes=Z,l;case G:return l=Al(19,w,f,H),l.elementType=G,l.lanes=Z,l;case ee:return p1(w,H,Z,f);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case D:he=10;break e;case C:he=9;break e;case N:he=11;break e;case te:he=14;break e;case se:he=16,T=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return f=Al(he,w,f,H),f.elementType=l,f.type=T,f.lanes=Z,f}function Wf(l,f,w,T){return l=Al(7,l,T,f),l.lanes=w,l}function p1(l,f,w,T){return l=Al(22,l,T,f),l.elementType=ee,l.lanes=w,l.stateNode={isHidden:!1},l}function Cg(l,f,w){return l=Al(6,l,null,f),l.lanes=w,l}function Lg(l,f,w){return f=Al(4,l.children!==null?l.children:[],l.key,f),f.lanes=w,f.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},f}function F_(l,f,w,T,H){this.tag=f,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ca(0),this.expirationTimes=Ca(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ca(0),this.identifierPrefix=T,this.onRecoverableError=H,this.mutableSourceEagerHydrationData=null}function Ng(l,f,w,T,H,Z,he,Ne,Fe){return l=new F_(l,f,w,Ne,Fe),f===1?(f=1,Z===!0&&(f|=8)):f=0,Z=Al(3,null,null,f),l.current=Z,Z.stateNode=l,Z.memoizedState={element:T,isDehydrated:w,cache:null,transitions:null,pendingSuspenseBoundaries:null},ji(Z),l}function B_(l,f,w){var T=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:T==null?null:""+T,children:l,containerInfo:f,implementation:w}}function n5(l){if(!l)return ws;l=l._reactInternals;e:{if(ui(l)!==l||l.tag!==1)throw Error(n(170));var f=l;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(ya(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(n(171))}if(l.tag===1){var w=l.type;if(ya(w))return rc(l,w,f)}return f}function r5(l,f,w,T,H,Z,he,Ne,Fe){return l=Ng(w,T,!0,l,H,Z,he,Ne,Fe),l.context=n5(null),w=l.current,T=ns(),H=tf(w),Z=ai(T,H),Z.callback=f??null,Wr(w,Z,H),l.current.lanes=H,Rl(l,H,T),Os(l,T),l}function g1(l,f,w,T){var H=f.current,Z=ns(),he=tf(H);return w=n5(w),f.context===null?f.context=w:f.pendingContext=w,f=ai(Z,he),f.payload={element:l},T=T===void 0?null:T,T!==null&&(f.callback=T),l=Wr(H,f,he),l!==null&&(Ql(l,H,he,Z),wa(l,H,he)),he}function m1(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return l.child.stateNode;default:return l.child.stateNode}}function i5(l,f){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var w=l.retryLane;l.retryLane=w!==0&&w<f?w:f}}function Tg(l,f){i5(l,f),(l=l.alternate)&&i5(l,f)}function z_(){return null}var a5=typeof reportError=="function"?reportError:function(l){console.error(l)};function Rg(l){this._internalRoot=l}v1.prototype.render=Rg.prototype.render=function(l){var f=this._internalRoot;if(f===null)throw Error(n(409));g1(l,f,null,null)},v1.prototype.unmount=Rg.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var f=l.containerInfo;$f(function(){g1(null,l,null,null)}),f[ea]=null}};function v1(l){this._internalRoot=l}v1.prototype.unstable_scheduleHydration=function(l){if(l){var f=Nc();l={blockedOn:null,target:l,priority:f};for(var w=0;w<Co.length&&f!==0&&f<Co[w].priority;w++);Co.splice(w,0,l),w===0&&gu(l)}};function Mg(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function y1(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function o5(){}function U_(l,f,w,T,H){if(H){if(typeof T=="function"){var Z=T;T=function(){var at=m1(he);Z.call(at)}}var he=r5(f,T,l,0,null,!1,!1,"",o5);return l._reactRootContainer=he,l[ea]=he.current,Ks(l.nodeType===8?l.parentNode:l),$f(),he}for(;H=l.lastChild;)l.removeChild(H);if(typeof T=="function"){var Ne=T;T=function(){var at=m1(Fe);Ne.call(at)}}var Fe=Ng(l,0,!1,null,null,!1,!1,"",o5);return l._reactRootContainer=Fe,l[ea]=Fe.current,Ks(l.nodeType===8?l.parentNode:l),$f(function(){g1(f,Fe,w,T)}),Fe}function b1(l,f,w,T,H){var Z=w._reactRootContainer;if(Z){var he=Z;if(typeof H=="function"){var Ne=H;H=function(){var Fe=m1(he);Ne.call(Fe)}}g1(f,he,l,H)}else he=U_(w,f,l,H,T);return m1(he)}Oo=function(l){switch(l.tag){case 3:var f=l.stateNode;if(f.current.memoizedState.isDehydrated){var w=qr(f.pendingLanes);w!==0&&(pu(f,w|1),Os(f,Cr()),(fr&6)===0&&(Gh=Cr()+500,ne()))}break;case 13:$f(function(){var T=er(l,1);if(T!==null){var H=ns();Ql(T,l,1,H)}}),Tg(l,1)}},dl=function(l){if(l.tag===13){var f=er(l,134217728);if(f!==null){var w=ns();Ql(f,l,134217728,w)}Tg(l,134217728)}},Lc=function(l){if(l.tag===13){var f=tf(l),w=er(l,f);if(w!==null){var T=ns();Ql(w,l,f,T)}Tg(l,f)}},Nc=function(){return jn},pl=function(l,f){var w=jn;try{return jn=l,f()}finally{jn=w}},Lt=function(l,f,w){switch(f){case"input":if(be(l,w),f=w.name,w.type==="radio"&&f!=null){for(w=l;w.parentNode;)w=w.parentNode;for(w=w.querySelectorAll("input[name="+JSON.stringify(""+f)+'][type="radio"]'),f=0;f<w.length;f++){var T=w[f];if(T!==l&&T.form===l.form){var H=Mi(T);if(!H)throw Error(n(90));$e(T),be(T,H)}}}break;case"textarea":we(l,w);break;case"select":f=w.value,f!=null&&Me(l,!!w.multiple,f,!1)}},nr=kg,ei=$f;var q_={usingClientEntryPoint:!1,Events:[Eu,ki,Mi,hn,bi,kg]},zd={findFiberByHostInstance:Qs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},$_={bundleType:zd.bundleType,version:zd.version,rendererPackageName:zd.rendererPackageName,rendererConfig:zd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=zi(l),l===null?null:l.stateNode},findFiberByHostInstance:zd.findFiberByHostInstance||z_,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 w1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!w1.isDisabled&&w1.supportsFiber)try{Po=w1.inject($_),wi=w1}catch{}}return Cs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q_,Cs.createPortal=function(l,f){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Mg(f))throw Error(n(200));return B_(l,f,null,w)},Cs.createRoot=function(l,f){if(!Mg(l))throw Error(n(299));var w=!1,T="",H=a5;return f!=null&&(f.unstable_strictMode===!0&&(w=!0),f.identifierPrefix!==void 0&&(T=f.identifierPrefix),f.onRecoverableError!==void 0&&(H=f.onRecoverableError)),f=Ng(l,1,!1,null,null,w,!1,T,H),l[ea]=f.current,Ks(l.nodeType===8?l.parentNode:l),new Rg(f)},Cs.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var f=l._reactInternals;if(f===void 0)throw typeof l.render=="function"?Error(n(188)):(l=Object.keys(l).join(","),Error(n(268,l)));return l=zi(f),l=l===null?null:l.stateNode,l},Cs.flushSync=function(l){return $f(l)},Cs.hydrate=function(l,f,w){if(!y1(f))throw Error(n(200));return b1(null,l,f,!0,w)},Cs.hydrateRoot=function(l,f,w){if(!Mg(l))throw Error(n(405));var T=w!=null&&w.hydratedSources||null,H=!1,Z="",he=a5;if(w!=null&&(w.unstable_strictMode===!0&&(H=!0),w.identifierPrefix!==void 0&&(Z=w.identifierPrefix),w.onRecoverableError!==void 0&&(he=w.onRecoverableError)),f=r5(f,null,l,1,w??null,H,!1,Z,he),l[ea]=f.current,Ks(l),T)for(l=0;l<T.length;l++)w=T[l],H=w._getVersion,H=H(w._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[w,H]:f.mutableSourceEagerHydrationData.push(w,H);return new v1(f)},Cs.render=function(l,f,w){if(!y1(f))throw Error(n(200));return b1(null,l,f,!1,w)},Cs.unmountComponentAtNode=function(l){if(!y1(l))throw Error(n(40));return l._reactRootContainer?($f(function(){b1(null,null,l,!1,function(){l._reactRootContainer=null,l[ea]=null})}),!0):!1},Cs.unstable_batchedUpdates=kg,Cs.unstable_renderSubtreeIntoContainer=function(l,f,w,T){if(!y1(w))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return b1(l,f,w,!1,T)},Cs.version="18.3.1-next-f1338f8080-20240426",Cs}var h5;function r6(){if(h5)return jg.exports;h5=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(t){console.error(t)}}return e(),jg.exports=Y_(),jg.exports}var d5;function X_(){if(d5)return x1;d5=1;var e=r6();return x1.createRoot=e.createRoot,x1.hydrateRoot=e.hydrateRoot,x1}var K_=X_();const i6=yh(K_);function zn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var Z_={};function F0(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Z_}var a6=Object.assign,p0=Object.getOwnPropertyDescriptor,Fu=Object.defineProperty,B0=Object.prototype,Km=[];Object.freeze(Km);var $v={};Object.freeze($v);var Q_=typeof Proxy<"u",J_=Object.toString();function o6(){Q_||zn("Proxy not available")}function s6(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var nd=function(){};function cl(e){return typeof e=="function"}function ch(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function z0(e){return e!==null&&typeof e=="object"}function wf(e){if(!z0(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n.toString()===J_}function l6(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function U0(e,t,n){Fu(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function u6(e,t,n){Fu(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function kf(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(r){return z0(r)&&r[n]===!0}}function _d(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function e9(e){var t=Object.getPrototypeOf(e),n=Object.getPrototypeOf(t),r=Object.getPrototypeOf(n);return r===null}function gc(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var c6=typeof Object.getOwnPropertySymbols<"u";function t9(e){var t=Object.keys(e);if(!c6)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter(function(r){return B0.propertyIsEnumerable.call(e,r)})):t}var q0=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:c6?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function f6(e){return e===null?null:typeof e=="object"?""+e:e}function wc(e,t){return B0.hasOwnProperty.call(e,t)}var n9=Object.getOwnPropertyDescriptors||function(t){var n={};return q0(t).forEach(function(r){n[r]=p0(t,r)}),n};function al(e,t){return!!(e&t)}function ol(e,t,n){return n?e|=t:e&=~t,e}function p5(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function r9(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a9(r.key),r)}}function Sd(e,t,n){return t&&r9(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function rd(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=o9(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
9
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xf(){return xf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xf.apply(null,arguments)}function h6(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Zm(e,t)}function Zm(e,t){return Zm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Zm(e,t)}function i9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function a9(e){var t=i9(e,"string");return typeof t=="symbol"?t:t+""}function o9(e,t){if(e){if(typeof e=="string")return p5(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p5(e,t):void 0}}var Iu=Symbol("mobx-stored-annotations");function Bu(e){function t(n,r){if(jp(r))return e.decorate_20223_(n,r);Ip(n,r,e)}return Object.assign(t,e)}function Ip(e,t,n){wc(e,Iu)||U0(e,Iu,xf({},e[Iu])),d9(n)||(e[Iu][t]=n)}function s9(e){return wc(e,Iu)||U0(e,Iu,xf({},e[Iu])),e[Iu]}function jp(e){return typeof e=="object"&&typeof e.kind=="string"}var bn=Symbol("mobx administration"),Af=(function(){function e(n){n===void 0&&(n="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=br.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=n}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},t.reportObserved=function(){return C6(this)},t.reportChanged=function(){Ns(),L6(this),Ts()},t.toString=function(){return this.name_},Sd(e,[{key:"isBeingObserved",get:function(){return al(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=ol(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return al(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=ol(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return al(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=ol(this.flags_,e.diffValueMask_,r===1)}}])})();Af.isBeingObservedMask_=1;Af.isPendingUnobservationMask_=2;Af.diffValueMask_=4;var Hv=kf("Atom",Af);function g0(e,t,n){t===void 0&&(t=nd),n===void 0&&(n=nd);var r=new Af(e);return t!==nd&&mS(r,t),n!==nd&&F6(r,n),r}function l9(e,t){return t8(e,t)}function u9(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var pd={structural:l9,default:u9};function fh(e,t,n){return $6(e)?e:Array.isArray(e)?Qn.array(e,{name:n}):wf(e)?Qn.object(e,void 0,{name:n}):_d(e)?Qn.map(e,{name:n}):gc(e)?Qn.set(e,{name:n}):typeof e=="function"&&!gd(e)&&!_p(e)?l6(e)?md(e):xp(n,e):e}function c9(e,t,n){if(e==null||ou(e)||Vu(e)||Tl(e)||is(e))return e;if(Array.isArray(e))return Qn.array(e,{name:n,deep:!1});if(wf(e))return Qn.object(e,void 0,{name:n,deep:!1});if(_d(e))return Qn.map(e,{name:n,deep:!1});if(gc(e))return Qn.set(e,{name:n,deep:!1})}function $0(e){return e}function f9(e,t){return t8(e,t)?t:e}var h9="override";function d9(e){return e.annotationType_===h9}function Dp(e,t){return{annotationType_:e,options_:t,make_:p9,extend_:g9,decorate_20223_:m9}}function p9(e,t,n,r){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,n,!1)===null?0:1;if(r===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if(gd(n.value))return 1;var a=d6(e,this,t,n,!1);return Fu(r,t,a),2}function g9(e,t,n,r){var i=d6(e,this,t,n);return e.defineProperty_(t,i,r)}function m9(e,t){var n=t.kind,r=t.name,i=t.addInitializer,a=this,o=function(h){var c,m,g,d;return _f((c=(m=a.options_)==null?void 0:m.name)!=null?c:r.toString(),h,(g=(d=a.options_)==null?void 0:d.autoAction)!=null?g:!1)};if(n=="field")return function(u){var h,c=u;return gd(c)||(c=o(c)),(h=a.options_)!=null&&h.bound&&(c=c.bind(this),c.isMobxAction=!0),c};if(n=="method"){var s;return gd(e)||(e=o(e)),(s=this.options_)!=null&&s.bound&&i(function(){var u=this,h=u[r].bind(u);h.isMobxAction=!0,u[r]=h}),e}zn("Cannot apply '"+a.annotationType_+"' to '"+String(r)+"' (kind: "+n+"):"+(`
|
|
10
|
+
'`+a.annotationType_+"' can only be used on properties with a function value."))}function v9(e,t,n,r){t.annotationType_,r.value}function d6(e,t,n,r,i){var a,o,s,u,h,c,m;i===void 0&&(i=Nt.safeDescriptors),v9(e,t,n,r);var g=r.value;if((a=t.options_)!=null&&a.bound){var d;g=g.bind((d=e.proxy_)!=null?d:e.target_)}return{value:_f((o=(s=t.options_)==null?void 0:s.name)!=null?o:n.toString(),g,(u=(h=t.options_)==null?void 0:h.autoAction)!=null?u:!1,(c=t.options_)!=null&&c.bound?(m=e.proxy_)!=null?m:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function p6(e,t){return{annotationType_:e,options_:t,make_:y9,extend_:b9,decorate_20223_:w9}}function y9(e,t,n,r){var i;if(r===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!wc(e.target_,t)||!_p(e.target_[t]))&&this.extend_(e,t,n,!1)===null)return 0;if(_p(n.value))return 1;var a=g6(e,this,t,n,!1,!1);return Fu(r,t,a),2}function b9(e,t,n,r){var i,a=g6(e,this,t,n,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,a,r)}function w9(e,t){var n,r=t.name,i=t.addInitializer;return _p(e)||(e=md(e)),(n=this.options_)!=null&&n.bound&&i(function(){var a=this,o=a[r].bind(a);o.isMobXFlow=!0,a[r]=o}),e}function x9(e,t,n,r){t.annotationType_,r.value}function g6(e,t,n,r,i,a){a===void 0&&(a=Nt.safeDescriptors),x9(e,t,n,r);var o=r.value;if(_p(o)||(o=md(o)),i){var s;o=o.bind((s=e.proxy_)!=null?s:e.target_),o.isMobXFlow=!0}return{value:o,configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function Gv(e,t){return{annotationType_:e,options_:t,make_:_9,extend_:S9,decorate_20223_:E9}}function _9(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function S9(e,t,n,r){return k9(e,this,t,n),e.defineComputedProperty_(t,xf({},this.options_,{get:n.get,set:n.set}),r)}function E9(e,t){var n=this,r=t.name,i=t.addInitializer;return i(function(){var a=Ed(this)[bn],o=xf({},n.options_,{get:e,context:this});o.name||(o.name="ObservableObject."+r.toString()),a.values_.set(r,new ru(o))}),function(){return this[bn].getObservablePropValue_(r)}}function k9(e,t,n,r){t.annotationType_,r.get}function H0(e,t){return{annotationType_:e,options_:t,make_:A9,extend_:P9,decorate_20223_:O9}}function A9(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function P9(e,t,n,r){var i,a;return C9(e,this),e.defineObservableProperty_(t,n.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:fh,r)}function O9(e,t){var n=this,r=t.kind,i=t.name,a=new WeakSet;function o(s,u){var h,c,m=Ed(s)[bn],g=new bf(u,(h=(c=n.options_)==null?void 0:c.enhancer)!=null?h:fh,"ObservableObject."+i.toString(),!1);m.values_.set(i,g),a.add(s)}if(r=="accessor")return{get:function(){return a.has(this)||o(this,e.get.call(this)),this[bn].getObservablePropValue_(i)},set:function(u){return a.has(this)||o(this,u),this[bn].setObservablePropValue_(i,u)},init:function(u){return a.has(this)||o(this,u),u}}}function C9(e,t,n,r){t.annotationType_}var L9="true",N9=m6();function m6(e){return{annotationType_:L9,options_:e,make_:T9,extend_:R9,decorate_20223_:M9}}function T9(e,t,n,r){var i,a;if(n.get)return bh.make_(e,t,n,r);if(n.set){var o=gd(n.set)?n.set:_f(t.toString(),n.set);return r===e.target_?e.defineProperty_(t,{configurable:Nt.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(Fu(r,t,{configurable:!0,set:o}),2)}if(r!==e.target_&&typeof n.value=="function"){var s;if(l6(n.value)){var u,h=(u=this.options_)!=null&&u.autoBind?md.bound:md;return h.make_(e,t,n,r)}var c=(s=this.options_)!=null&&s.autoBind?xp.bound:xp;return c.make_(e,t,n,r)}var m=((i=this.options_)==null?void 0:i.deep)===!1?Qn.ref:Qn;if(typeof n.value=="function"&&(a=this.options_)!=null&&a.autoBind){var g;n.value=n.value.bind((g=e.proxy_)!=null?g:e.target_)}return m.make_(e,t,n,r)}function R9(e,t,n,r){var i,a;if(n.get)return bh.extend_(e,t,n,r);if(n.set)return e.defineProperty_(t,{configurable:Nt.safeDescriptors?e.isPlainObject_:!0,set:_f(t.toString(),n.set)},r);if(typeof n.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;n.value=n.value.bind((o=e.proxy_)!=null?o:e.target_)}var s=((a=this.options_)==null?void 0:a.deep)===!1?Qn.ref:Qn;return s.extend_(e,t,n,r)}function M9(e,t){zn("'"+this.annotationType_+"' cannot be used as a decorator")}var I9="observable",j9="observable.ref",D9="observable.shallow",F9="observable.struct",v6={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(v6);function _1(e){return e||v6}var Qm=H0(I9),B9=H0(j9,{enhancer:$0}),z9=H0(D9,{enhancer:c9}),U9=H0(F9,{enhancer:f9}),y6=Bu(Qm);function S1(e){return e.deep===!0?fh:e.deep===!1?$0:$9(e.defaultDecorator)}function q9(e){var t;return e?(t=e.defaultDecorator)!=null?t:m6(e):void 0}function $9(e){var t,n;return e&&(t=(n=e.options_)==null?void 0:n.enhancer)!=null?t:fh}function b6(e,t,n){if(jp(t))return Qm.decorate_20223_(e,t);if(ch(t)){Ip(e,t,Qm);return}return $6(e)?e:wf(e)?Qn.object(e,t,n):Array.isArray(e)?Qn.array(e,t):_d(e)?Qn.map(e,t):gc(e)?Qn.set(e,t):typeof e=="object"&&e!==null?e:Qn.box(e,t)}a6(b6,y6);var H9={box:function(t,n){var r=_1(n);return new bf(t,S1(r),r.name,!0,r.equals)},array:function(t,n){var r=_1(n);return(Nt.useProxies===!1||r.proxy===!1?WS:jS)(t,S1(r),r.name)},map:function(t,n){var r=_1(n);return new Kv(t,S1(r),r.name)},set:function(t,n){var r=_1(n);return new K6(t,S1(r),r.name)},object:function(t,n,r){return xh(function(){return wS(Nt.useProxies===!1||r?.proxy===!1?Ed({},r):RS({},r),t,n)})},ref:Bu(B9),shallow:Bu(z9),deep:y6,struct:Bu(U9)},Qn=a6(b6,H9),w6="computed",G9="computed.struct",Jm=Gv(w6),W9=Gv(G9,{equals:pd.structural}),bh=function(t,n){if(jp(n))return Jm.decorate_20223_(t,n);if(ch(n))return Ip(t,n,Jm);if(wf(t))return Bu(Gv(w6,t));var r=wf(n)?n:{};return r.get=t,r.name||(r.name=t.name||""),new ru(r)};Object.assign(bh,Jm);bh.struct=Bu(W9);var g5,m5,m0=0,V9=1,Y9=(g5=(m5=p0(function(){},"name"))==null?void 0:m5.configurable)!=null?g5:!1,v5={value:"action",configurable:!0,writable:!1,enumerable:!1};function _f(e,t,n,r){n===void 0&&(n=!1);function i(){return x6(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},Y9&&(v5.value=e,Fu(i,"name",v5)),i}function x6(e,t,n,r,i){var a=X9(e,t);try{return n.apply(r,i)}catch(o){throw a.error_=o,o}finally{K9(a)}}function X9(e,t,n,r){var i=!1,a=0,o=Nt.trackingDerivation,s=!t||!o;Ns();var u=Nt.allowStateChanges;s&&(wh(),u=G0(!0));var h=Wv(!0),c={runAsAction_:s,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:h,notifySpy_:i,startTime_:a,actionId_:V9++,parentActionId_:m0};return m0=c.actionId_,c}function K9(e){m0!==e.actionId_&&zn(30),m0=e.parentActionId_,e.error_!==void 0&&(Nt.suppressReactionErrors=!0),W0(e.prevAllowStateChanges_),sp(e.prevAllowStateReads_),Ts(),e.runAsAction_&&xc(e.prevDerivation_),Nt.suppressReactionErrors=!1}function _6(e,t){var n=G0(e);try{return t()}finally{W0(n)}}function G0(e){var t=Nt.allowStateChanges;return Nt.allowStateChanges=e,t}function W0(e){Nt.allowStateChanges=e}var bf=(function(e){function t(r,i,a,o,s){var u;return a===void 0&&(a="ObservableValue"),s===void 0&&(s=pd.default),u=e.call(this,a)||this,u.enhancer=void 0,u.name_=void 0,u.equals=void 0,u.hasUnreportedChange_=!1,u.interceptors_=void 0,u.changeListeners_=void 0,u.value_=void 0,u.dehancer=void 0,u.enhancer=i,u.name_=a,u.equals=s,u.value_=i(r,void 0,a),u}h6(t,e);var n=t.prototype;return n.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},n.set=function(i){this.value_,i=this.prepareNewValue_(i),i!==Nt.UNCHANGED&&this.setNewValue_(i)},n.prepareNewValue_=function(i){if(Pl(this)){var a=Ol(this,{object:this,type:zu,newValue:i});if(!a)return Nt.UNCHANGED;i=a.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?Nt.UNCHANGED:i},n.setNewValue_=function(i){var a=this.value_;this.value_=i,this.reportChanged(),tu(this)&&nu(this,{type:zu,object:this,newValue:i,oldValue:a})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(i){return Fp(this,i)},n.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:zu,newValue:this.value_,oldValue:void 0}),Bp(this,i)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return f6(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},t})(Af),Z9=kf("ObservableValue",bf),ru=(function(){function e(n){this.dependenciesState_=br.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=br.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new y0(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=v0.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,n.get||zn(31),this.derivation=n.get,this.name_=n.name||"ComputedValue",n.set&&(this.setter_=_f("ComputedValue-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?pd.structural:pd.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){rS(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},t.get=function(){if(this.isComputing&&zn(32,this.name_,this.derivation),Nt.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)ev(this)&&(this.warnAboutUntrackedRead_(),Ns(),this.value_=this.computeValue_(!1),Ts());else if(C6(this),ev(this)){var r=Nt.trackingContext;this.keepAlive_&&!r&&(Nt.trackingContext=this),this.trackAndCompute()&&nS(this),Nt.trackingContext=r}var i=this.value_;if(Q1(i))throw i.cause;return i},t.set=function(r){if(this.setter_){this.isRunningSetter&&zn(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,r)}finally{this.isRunningSetter=!1}}else zn(34,this.name_)},t.trackAndCompute=function(){var r=this.value_,i=this.dependenciesState_===br.NOT_TRACKING_,a=this.computeValue_(!0),o=i||Q1(r)||Q1(a)||!this.equals_(r,a);return o&&(this.value_=a),o},t.computeValue_=function(r){this.isComputing=!0;var i=G0(!1),a;if(r)a=S6(this,this.derivation,this.scope_);else if(Nt.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(o){a=new y0(o)}return W0(i),this.isComputing=!1,a},t.suspend_=function(){this.keepAlive_||(tv(this),this.value_=void 0)},t.observe_=function(r,i){var a=this,o=!0,s=void 0;return $u(function(){var u=a.get();if(!o||i){var h=wh();r({observableKind:"computed",debugObjectName:a.name_,type:zu,object:a,newValue:u,oldValue:s}),xc(h)}o=!1,s=u})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return f6(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},Sd(e,[{key:"isComputing",get:function(){return al(this.flags_,e.isComputingMask_)},set:function(r){this.flags_=ol(this.flags_,e.isComputingMask_,r)}},{key:"isRunningSetter",get:function(){return al(this.flags_,e.isRunningSetterMask_)},set:function(r){this.flags_=ol(this.flags_,e.isRunningSetterMask_,r)}},{key:"isBeingObserved",get:function(){return al(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=ol(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return al(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=ol(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return al(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=ol(this.flags_,e.diffValueMask_,r===1)}}])})();ru.isComputingMask_=1;ru.isRunningSetterMask_=2;ru.isBeingObservedMask_=4;ru.isPendingUnobservationMask_=8;ru.diffValueMask_=16;var V0=kf("ComputedValue",ru),br;(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_"})(br||(br={}));var v0;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(v0||(v0={}));var y0=function(t){this.cause=void 0,this.cause=t};function Q1(e){return e instanceof y0}function ev(e){switch(e.dependenciesState_){case br.UP_TO_DATE_:return!1;case br.NOT_TRACKING_:case br.STALE_:return!0;case br.POSSIBLY_STALE_:{for(var t=Wv(!0),n=wh(),r=e.observing_,i=r.length,a=0;a<i;a++){var o=r[a];if(V0(o)){if(Nt.disableErrorBoundaries)o.get();else try{o.get()}catch{return xc(n),sp(t),!0}if(e.dependenciesState_===br.STALE_)return xc(n),sp(t),!0}}return k6(e),xc(n),sp(t),!1}}}function S6(e,t,n){var r=Wv(!0);k6(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++Nt.runId;var i=Nt.trackingDerivation;Nt.trackingDerivation=e,Nt.inBatch++;var a;if(Nt.disableErrorBoundaries===!0)a=t.call(n);else try{a=t.call(n)}catch(o){a=new y0(o)}return Nt.inBatch--,Nt.trackingDerivation=i,Q9(e),sp(r),a}function Q9(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,r=br.UP_TO_DATE_,i=0,a=e.unboundDepsCount_,o=0;o<a;o++){var s=n[o];s.diffValue===0&&(s.diffValue=1,i!==o&&(n[i]=s),i++),s.dependenciesState_>r&&(r=s.dependenciesState_)}for(n.length=i,e.newObserving_=null,a=t.length;a--;){var u=t[a];u.diffValue===0&&P6(u,e),u.diffValue=0}for(;i--;){var h=n[i];h.diffValue===1&&(h.diffValue=0,tS(h,e))}r!==br.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function tv(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)P6(t[n],e);e.dependenciesState_=br.NOT_TRACKING_}function E6(e){var t=wh();try{return e()}finally{xc(t)}}function wh(){var e=Nt.trackingDerivation;return Nt.trackingDerivation=null,e}function xc(e){Nt.trackingDerivation=e}function Wv(e){var t=Nt.allowStateReads;return Nt.allowStateReads=e,t}function sp(e){Nt.allowStateReads=e}function k6(e){if(e.dependenciesState_!==br.UP_TO_DATE_){e.dependenciesState_=br.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=br.UP_TO_DATE_}}var J1=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},e0=!0,A6=!1,Nt=(function(){var e=F0();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(e0=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new J1().version&&(e0=!1),e0?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new J1):(setTimeout(function(){A6||zn(35)},1),new J1)})();function J9(){if((Nt.pendingReactions.length||Nt.inBatch||Nt.isRunningReactions)&&zn(36),A6=!0,e0){var e=F0();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Nt=new J1}}function eS(){return Nt}function tS(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function P6(e,t){e.observers_.delete(t),e.observers_.size===0&&O6(e)}function O6(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,Nt.pendingUnobservations.push(e))}function Ns(){Nt.inBatch++}function Ts(){if(--Nt.inBatch===0){N6();for(var e=Nt.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof ru&&n.suspend_())}Nt.pendingUnobservations=[]}}function C6(e){var t=Nt.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&Nt.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&Nt.inBatch>0&&O6(e),!1)}function L6(e){e.lowestObserverState_!==br.STALE_&&(e.lowestObserverState_=br.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===br.UP_TO_DATE_&&t.onBecomeStale_(),t.dependenciesState_=br.STALE_}))}function nS(e){e.lowestObserverState_!==br.STALE_&&(e.lowestObserverState_=br.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===br.POSSIBLY_STALE_?t.dependenciesState_=br.STALE_:t.dependenciesState_===br.UP_TO_DATE_&&(e.lowestObserverState_=br.UP_TO_DATE_)}))}function rS(e){e.lowestObserverState_===br.UP_TO_DATE_&&(e.lowestObserverState_=br.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===br.UP_TO_DATE_&&(t.dependenciesState_=br.POSSIBLY_STALE_,t.onBecomeStale_())}))}var qu=(function(){function e(n,r,i,a){n===void 0&&(n="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=br.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=v0.NONE,this.name_=n,this.onInvalidate_=r,this.errorHandler_=i,this.requiresObservable_=a}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,Nt.pendingReactions.push(this),N6())},t.runReaction_=function(){if(!this.isDisposed){Ns(),this.isScheduled=!1;var r=Nt.trackingContext;if(Nt.trackingContext=this,ev(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}Nt.trackingContext=r,Ts()}},t.track=function(r){if(!this.isDisposed){Ns(),this.isRunning=!0;var i=Nt.trackingContext;Nt.trackingContext=this;var a=S6(this,r,void 0);Nt.trackingContext=i,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&tv(this),Q1(a)&&this.reportExceptionInDerivation_(a.cause),Ts()}},t.reportExceptionInDerivation_=function(r){var i=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(Nt.disableErrorBoundaries)throw r;var a="[mobx] uncaught error in '"+this+"'";Nt.suppressReactionErrors||console.error(a,r),Nt.globalReactionErrorHandlers.forEach(function(o){return o(r,i)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Ns(),tv(this),Ts()))},t.getDisposer_=function(r){var i=this,a=function o(){i.dispose(),r==null||r.removeEventListener==null||r.removeEventListener("abort",o)};return r==null||r.addEventListener==null||r.addEventListener("abort",a),a[bn]=this,"dispose"in Symbol&&typeof Symbol.dispose=="symbol"&&(a[Symbol.dispose]=a),a},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(r){},Sd(e,[{key:"isDisposed",get:function(){return al(this.flags_,e.isDisposedMask_)},set:function(r){this.flags_=ol(this.flags_,e.isDisposedMask_,r)}},{key:"isScheduled",get:function(){return al(this.flags_,e.isScheduledMask_)},set:function(r){this.flags_=ol(this.flags_,e.isScheduledMask_,r)}},{key:"isTrackPending",get:function(){return al(this.flags_,e.isTrackPendingMask_)},set:function(r){this.flags_=ol(this.flags_,e.isTrackPendingMask_,r)}},{key:"isRunning",get:function(){return al(this.flags_,e.isRunningMask_)},set:function(r){this.flags_=ol(this.flags_,e.isRunningMask_,r)}},{key:"diffValue",get:function(){return al(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=ol(this.flags_,e.diffValueMask_,r===1)}}])})();qu.isDisposedMask_=1;qu.isScheduledMask_=2;qu.isTrackPendingMask_=4;qu.isRunningMask_=8;qu.diffValueMask_=16;var iS=100,nv=function(t){return t()};function N6(){Nt.inBatch>0||Nt.isRunningReactions||nv(aS)}function aS(){Nt.isRunningReactions=!0;for(var e=Nt.pendingReactions,t=0;e.length>0;){++t===iS&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}Nt.isRunningReactions=!1}var b0=kf("Reaction",qu);function oS(e){var t=nv;nv=function(r){return e(function(){return t(r)})}}function lp(){return!1}function sS(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var T6="action",lS="action.bound",R6="autoAction",uS="autoAction.bound",M6="<unnamed action>",rv=Dp(T6),cS=Dp(lS,{bound:!0}),iv=Dp(R6,{autoAction:!0}),fS=Dp(uS,{autoAction:!0,bound:!0});function I6(e){var t=function(r,i){if(cl(r))return _f(r.name||M6,r,e);if(cl(i))return _f(r,i,e);if(jp(i))return(e?iv:rv).decorate_20223_(r,i);if(ch(i))return Ip(r,i,e?iv:rv);if(ch(r))return Bu(Dp(e?R6:T6,{name:r,autoAction:e}))};return t}var Un=I6(!1);Object.assign(Un,rv);var xp=I6(!0);Object.assign(xp,iv);Un.bound=Bu(cS);xp.bound=Bu(fS);function mc(e){return x6(e.name||M6,!1,e,this,void 0)}function gd(e){return cl(e)&&e.isMobxAction===!0}function $u(e,t){var n,r,i,a;t===void 0&&(t=$v);var o=(n=(r=t)==null?void 0:r.name)!=null?n:"Autorun",s=!t.scheduler&&!t.delay,u;if(s)u=new qu(o,function(){this.track(m)},t.onError,t.requiresObservable);else{var h=j6(t),c=!1;u=new qu(o,function(){c||(c=!0,h(function(){c=!1,u.isDisposed||u.track(m)}))},t.onError,t.requiresObservable)}function m(){e(u)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||u.schedule_(),u.getDisposer_((a=t)==null?void 0:a.signal)}var hS=function(t){return t()};function j6(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:hS}function D6(e,t,n){var r,i,a;n===void 0&&(n=$v);var o=(r=n.name)!=null?r:"Reaction",s=Un(o,n.onError?dS(n.onError,t):t),u=!n.scheduler&&!n.delay,h=j6(n),c=!0,m=!1,g,d=n.compareStructural?pd.structural:n.equals||pd.default,y=new qu(o,function(){c||u?_():m||(m=!0,h(_))},n.onError,n.requiresObservable);function _(){if(m=!1,!y.isDisposed){var x=!1,b=g;y.track(function(){var S=_6(!1,function(){return e(y)});x=c||!d(g,S),g=S}),(c&&n.fireImmediately||!c&&x)&&s(g,b,y),c=!1}}return(i=n)!=null&&(i=i.signal)!=null&&i.aborted||y.schedule_(),y.getDisposer_((a=n)==null?void 0:a.signal)}function dS(e,t){return function(){try{return t.apply(this,arguments)}catch(n){e.call(this,n)}}}var pS="onBO",gS="onBUO";function mS(e,t,n){return B6(pS,e,t,n)}function F6(e,t,n){return B6(gS,e,t,n)}function B6(e,t,n,r){var i=vd(t),a=cl(r)?r:n,o=e+"L";return i[o]?i[o].add(a):i[o]=new Set([a]),function(){var s=i[o];s&&(s.delete(a),s.size===0&&delete i[o])}}var vS="never",E1="always",yS="observed";function bS(e){e.isolateGlobalState===!0&&J9();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&(Nt.useProxies=t===E1?!0:t===vS?!1:typeof Proxy<"u"),t==="ifavailable"&&(Nt.verifyProxies=!0),n!==void 0){var r=n===E1?E1:n===yS;Nt.enforceActions=r,Nt.allowStateChanges=!(r===!0||r===E1)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(Nt[i]=!!e[i])}),Nt.allowStateReads=!Nt.observableRequiresReaction,e.reactionScheduler&&oS(e.reactionScheduler)}function wS(e,t,n,r){var i=n9(t);return xh(function(){var a=Ed(e,r)[bn];q0(i).forEach(function(o){a.extend_(o,i[o],n&&o in n?n[o]:!0)})}),e}function xS(e,t){return z6(vd(e,t))}function z6(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=_S(e.observing_).map(z6)),t}function _S(e){return Array.from(new Set(e))}var SS=0;function U6(){this.message="FLOW_CANCELLED"}U6.prototype=Object.create(Error.prototype);var Bg=p6("flow"),ES=p6("flow.bound",{bound:!0}),md=Object.assign(function(t,n){if(jp(n))return Bg.decorate_20223_(t,n);if(ch(n))return Ip(t,n,Bg);var r=t,i=r.name||"<unnamed flow>",a=function(){var s=this,u=arguments,h=++SS,c=Un(i+" - runid: "+h+" - init",r).apply(s,u),m,g=void 0,d=new Promise(function(y,_){var x=0;m=_;function b(E){g=void 0;var A;try{A=Un(i+" - runid: "+h+" - yield "+x++,c.next).call(c,E)}catch(R){return _(R)}k(A)}function S(E){g=void 0;var A;try{A=Un(i+" - runid: "+h+" - yield "+x++,c.throw).call(c,E)}catch(R){return _(R)}k(A)}function k(E){if(cl(E?.then)){E.then(k,_);return}return E.done?y(E.value):(g=Promise.resolve(E.value),g.then(b,S))}b(void 0)});return d.cancel=Un(i+" - runid: "+h+" - cancel",function(){try{g&&y5(g);var y=c.return(void 0),_=Promise.resolve(y.value);_.then(nd,nd),y5(_),m(new U6)}catch(x){m(x)}}),d};return a.isMobXFlow=!0,a},Bg);md.bound=Bu(ES);function y5(e){cl(e.cancel)&&e.cancel()}function _p(e){return e?.isMobXFlow===!0}function q6(e,t,n){var r;return Tl(e)||Vu(e)||Z9(e)?r=Hu(e):ou(e)&&(r=Hu(e,t)),r.dehancer=typeof t=="function"?t:n,function(){r.dehancer=void 0}}function Vv(e,t,n){return cl(n)?AS(e,t,n):kS(e,t)}function kS(e,t){return Hu(e).intercept_(t)}function AS(e,t,n){return Hu(e,t).intercept_(n)}function PS(e,t){return e?ou(e)||!!e[bn]||Hv(e)||b0(e)||V0(e):!1}function $6(e){return PS(e)}function w0(e){if(ou(e))return e[bn].keys_();if(Tl(e)||is(e))return Array.from(e.keys());if(Vu(e))return e.map(function(t,n){return n});zn(5)}function H6(e){if(ou(e))return w0(e).map(function(t){return e[t]});if(Tl(e))return w0(e).map(function(t){return e.get(t)});if(is(e))return Array.from(e.values());if(Vu(e))return e.slice();zn(6)}function OS(e){if(ou(e))return w0(e).map(function(t){return[t,e[t]]});if(Tl(e))return w0(e).map(function(t){return[t,e.get(t)]});if(is(e))return Array.from(e.entries());if(Vu(e))return e.map(function(t,n){return[n,t]});zn(7)}function G6(e,t,n){if(arguments.length===2&&!is(e)){Ns();var r=t;try{for(var i in r)G6(e,i,r[i])}finally{Ts()}return}ou(e)?e[bn].set_(t,n):Tl(e)?e.set(t,n):is(e)?e.add(t):Vu(e)?(typeof t!="number"&&(t=parseInt(t,10)),t<0&&zn("Invalid index: '"+t+"'"),Ns(),t>=e.length&&(e.length=t+1),e[t]=n,Ts()):zn(8)}function W6(e,t,n){if(ou(e))return e[bn].defineProperty_(t,n);zn(39)}function Yv(e,t,n,r){return cl(n)?LS(e,t,n,r):CS(e,t,n)}function CS(e,t,n){return Hu(e).observe_(t,n)}function LS(e,t,n,r){return Hu(e,t).observe_(n,r)}function vc(e,t){t===void 0&&(t=void 0),Ns();try{return e.apply(t)}finally{Ts()}}function b5(e,t,n){return arguments.length===1||t&&typeof t=="object"?NS(e,t):V6(e,t,{})}function V6(e,t,n){var r;if(typeof n.timeout=="number"){var i=new Error("WHEN_TIMEOUT");r=setTimeout(function(){if(!o[bn].isDisposed)if(o(),n.onError)n.onError(i);else throw i},n.timeout)}n.name="When";var a=_f("When-effect",t),o=$u(function(s){var u=_6(!1,e);u&&(s.dispose(),r&&clearTimeout(r),a())},n);return o}function NS(e,t){var n;if(t!=null&&(n=t.signal)!=null&&n.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var r,i,a=new Promise(function(o,s){var u,h=V6(e,o,xf({},t,{onError:s}));r=function(){h(),s(new Error("WHEN_CANCELLED"))},i=function(){h(),s(new Error("WHEN_ABORTED"))},t==null||(u=t.signal)==null||u.addEventListener==null||u.addEventListener("abort",i)}).finally(function(){var o;return t==null||(o=t.signal)==null||o.removeEventListener==null?void 0:o.removeEventListener("abort",i)});return a.cancel=r,a}function Vh(e){return e[bn]}var TS={has:function(t,n){return Vh(t).has_(n)},get:function(t,n){return Vh(t).get_(n)},set:function(t,n,r){var i;return ch(n)?(i=Vh(t).set_(n,r,!0))!=null?i:!0:!1},deleteProperty:function(t,n){var r;return ch(n)?(r=Vh(t).delete_(n,!0))!=null?r:!0:!1},defineProperty:function(t,n,r){var i;return(i=Vh(t).defineProperty_(n,r))!=null?i:!0},ownKeys:function(t){return Vh(t).ownKeys_()},preventExtensions:function(t){zn(13)}};function RS(e,t){var n,r;return o6(),e=Ed(e,t),(r=(n=e[bn]).proxy_)!=null?r:n.proxy_=new Proxy(e,TS)}function Pl(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Fp(e,t){var n=e.interceptors_||(e.interceptors_=[]);return n.push(t),s6(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function Ol(e,t){var n=wh();try{for(var r=[].concat(e.interceptors_||[]),i=0,a=r.length;i<a&&(t=r[i](t),t&&!t.type&&zn(14),!!t);i++);return t}finally{xc(n)}}function tu(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Bp(e,t){var n=e.changeListeners_||(e.changeListeners_=[]);return n.push(t),s6(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function nu(e,t){var n=wh(),r=e.changeListeners_;if(r){r=r.slice();for(var i=0,a=r.length;i<a;i++)r[i](t);xc(n)}}function Y6(e,t,n){return xh(function(){var r,i=Ed(e,n)[bn];(r=t)!=null||(t=s9(e)),q0(t).forEach(function(a){return i.make_(a,t[a])})}),e}var w5="splice",zu="update",MS=1e4,IS={get:function(t,n){var r=t[bn];return n===bn?r:n==="length"?r.getArrayLength_():typeof n=="string"&&!isNaN(n)?r.get_(parseInt(n)):wc(x0,n)?x0[n]:t[n]},set:function(t,n,r){var i=t[bn];return n==="length"&&i.setArrayLength_(r),typeof n=="symbol"||isNaN(n)?t[n]=r:i.set_(parseInt(n),r),!0},preventExtensions:function(){zn(15)}},Xv=(function(){function e(n,r,i,a){n===void 0&&(n="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=a,this.atom_=new Af(n),this.enhancer_=function(o,s){return r(o,s,"ObservableArray[..]")}}var t=e.prototype;return t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.dehanceValues_=function(r){return this.dehancer!==void 0&&r.length>0?r.map(this.dehancer):r},t.intercept_=function(r){return Fp(this,r)},t.observe_=function(r,i){return i===void 0&&(i=!1),i&&r({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Bp(this,r)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(r){(typeof r!="number"||isNaN(r)||r<0)&&zn("Out of range: "+r);var i=this.values_.length;if(r!==i)if(r>i){for(var a=new Array(r-i),o=0;o<r-i;o++)a[o]=void 0;this.spliceWithArray_(i,0,a)}else this.spliceWithArray_(r,i-r)},t.updateArrayLength_=function(r,i){r!==this.lastKnownLength_&&zn(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&e8(r+i+1)},t.spliceWithArray_=function(r,i,a){var o=this;this.atom_;var s=this.values_.length;if(r===void 0?r=0:r>s?r=s:r<0&&(r=Math.max(0,s+r)),arguments.length===1?i=s-r:i==null?i=0:i=Math.max(0,Math.min(i,s-r)),a===void 0&&(a=Km),Pl(this)){var u=Ol(this,{object:this.proxy_,type:w5,index:r,removedCount:i,added:a});if(!u)return Km;i=u.removedCount,a=u.added}if(a=a.length===0?a:a.map(function(m){return o.enhancer_(m,void 0)}),this.legacyMode_){var h=a.length-i;this.updateArrayLength_(s,h)}var c=this.spliceItemsIntoValues_(r,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(r,a,c),this.dehanceValues_(c)},t.spliceItemsIntoValues_=function(r,i,a){if(a.length<MS){var o;return(o=this.values_).splice.apply(o,[r,i].concat(a))}else{var s=this.values_.slice(r,r+i),u=this.values_.slice(r+i);this.values_.length+=a.length-i;for(var h=0;h<a.length;h++)this.values_[r+h]=a[h];for(var c=0;c<u.length;c++)this.values_[r+a.length+c]=u[c];return s}},t.notifyArrayChildUpdate_=function(r,i,a){var o=!this.owned_&&lp(),s=tu(this),u=s||o?{observableKind:"array",object:this.proxy_,type:zu,debugObjectName:this.atom_.name_,index:r,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),s&&nu(this,u)},t.notifyArraySplice_=function(r,i,a){var o=!this.owned_&&lp(),s=tu(this),u=s||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:w5,index:r,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),s&&nu(this,u)},t.get_=function(r){if(this.legacyMode_&&r>=this.values_.length){console.warn("[mobx] Out of bounds read: "+r);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[r])},t.set_=function(r,i){var a=this.values_;if(this.legacyMode_&&r>a.length&&zn(17,r,a.length),r<a.length){this.atom_;var o=a[r];if(Pl(this)){var s=Ol(this,{type:zu,object:this.proxy_,index:r,newValue:i});if(!s)return;i=s.newValue}i=this.enhancer_(i,o);var u=i!==o;u&&(a[r]=i,this.notifyArrayChildUpdate_(r,i,o))}else{for(var h=new Array(r+1-a.length),c=0;c<h.length-1;c++)h[c]=void 0;h[h.length-1]=i,this.spliceWithArray_(a.length,0,h)}},e})();function jS(e,t,n,r){return n===void 0&&(n="ObservableArray"),r===void 0&&(r=!1),o6(),xh(function(){var i=new Xv(n,t,r,!1);u6(i.values_,bn,i);var a=new Proxy(i.values_,IS);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}var x0={clear:function(){return this.splice(0)},replace:function(t){var n=this[bn];return n.spliceWithArray_(0,n.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];var o=this[bn];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(t);case 2:return o.spliceWithArray_(t,n)}return o.spliceWithArray_(t,n,i)},spliceWithArray:function(t,n,r){return this[bn].spliceWithArray_(t,n,r)},push:function(){for(var t=this[bn],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,r),t.values_.length},pop:function(){return this.splice(Math.max(this[bn].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[bn],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.spliceWithArray_(0,0,r),t.values_.length},reverse:function(){return Nt.trackingDerivation&&zn(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Nt.trackingDerivation&&zn(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var n=this[bn],r=n.dehanceValues_(n.values_).indexOf(t);return r>-1?(this.splice(r,1),!0):!1}};si("at",fl);si("concat",fl);si("flat",fl);si("includes",fl);si("indexOf",fl);si("join",fl);si("lastIndexOf",fl);si("slice",fl);si("toString",fl);si("toLocaleString",fl);si("toSorted",fl);si("toSpliced",fl);si("with",fl);si("every",au);si("filter",au);si("find",au);si("findIndex",au);si("findLast",au);si("findLastIndex",au);si("flatMap",au);si("forEach",au);si("map",au);si("some",au);si("toReversed",au);si("reduce",X6);si("reduceRight",X6);function si(e,t){typeof Array.prototype[e]=="function"&&(x0[e]=t(e))}function fl(e){return function(){var t=this[bn];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function au(e){return function(t,n){var r=this,i=this[bn];i.atom_.reportObserved();var a=i.dehanceValues_(i.values_);return a[e](function(o,s){return t.call(n,o,s,r)})}}function X6(e){return function(){var t=this,n=this[bn];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(a,o,s){return i(a,o,s,t)},r[e].apply(r,arguments)}}var DS=kf("ObservableArrayAdministration",Xv);function Vu(e){return z0(e)&&DS(e[bn])}var FS={},mf="add",_0="delete",Kv=(function(){function e(n,r,i){var a=this;r===void 0&&(r=fh),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[bn]=FS,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=r,this.name_=i,cl(Map)||zn(18),xh(function(){a.keysAtom_=g0("ObservableMap.keys()"),a.data_=new Map,a.hasMap_=new Map,n&&a.merge(n)})}var t=e.prototype;return t.has_=function(r){return this.data_.has(r)},t.has=function(r){var i=this;if(!Nt.trackingDerivation)return this.has_(r);var a=this.hasMap_.get(r);if(!a){var o=a=new bf(this.has_(r),$0,"ObservableMap.key?",!1);this.hasMap_.set(r,o),F6(o,function(){return i.hasMap_.delete(r)})}return a.get()},t.set=function(r,i){var a=this.has_(r);if(Pl(this)){var o=Ol(this,{type:a?zu:mf,object:this,newValue:i,name:r});if(!o)return this;i=o.newValue}return a?this.updateValue_(r,i):this.addValue_(r,i),this},t.delete=function(r){var i=this;if(this.keysAtom_,Pl(this)){var a=Ol(this,{type:_0,object:this,name:r});if(!a)return!1}if(this.has_(r)){var o=lp(),s=tu(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:_0,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return vc(function(){var h;i.keysAtom_.reportChanged(),(h=i.hasMap_.get(r))==null||h.setNewValue_(!1);var c=i.data_.get(r);c.setNewValue_(void 0),i.data_.delete(r)}),s&&nu(this,u),!0}return!1},t.updateValue_=function(r,i){var a=this.data_.get(r);if(i=a.prepareNewValue_(i),i!==Nt.UNCHANGED){var o=lp(),s=tu(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:zu,object:this,oldValue:a.value_,name:r,newValue:i}:null;a.setNewValue_(i),s&&nu(this,u)}},t.addValue_=function(r,i){var a=this;this.keysAtom_,vc(function(){var h,c=new bf(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(r,c),i=c.value_,(h=a.hasMap_.get(r))==null||h.setNewValue_(!0),a.keysAtom_.reportChanged()});var o=lp(),s=tu(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:mf,object:this,name:r,newValue:i}:null;s&&nu(this,u)},t.get=function(r){return this.has(r)?this.dehanceValue_(this.data_.get(r).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var r=this,i=this.keys();return x5({next:function(){var o=i.next(),s=o.done,u=o.value;return{done:s,value:s?void 0:r.get(u)}}})},t.entries=function(){var r=this,i=this.keys();return x5({next:function(){var o=i.next(),s=o.done,u=o.value;return{done:s,value:s?void 0:[u,r.get(u)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(r,i){for(var a=rd(this),o;!(o=a()).done;){var s=o.value,u=s[0],h=s[1];r.call(i,h,u,this)}},t.merge=function(r){var i=this;return Tl(r)&&(r=new Map(r)),vc(function(){wf(r)?t9(r).forEach(function(a){return i.set(a,r[a])}):Array.isArray(r)?r.forEach(function(a){var o=a[0],s=a[1];return i.set(o,s)}):_d(r)?(e9(r)||zn(19,r),r.forEach(function(a,o){return i.set(o,a)})):r!=null&&zn(20,r)}),this},t.clear=function(){var r=this;vc(function(){E6(function(){for(var i=rd(r.keys()),a;!(a=i()).done;){var o=a.value;r.delete(o)}})})},t.replace=function(r){var i=this;return vc(function(){for(var a=BS(r),o=new Map,s=!1,u=rd(i.data_.keys()),h;!(h=u()).done;){var c=h.value;if(!a.has(c)){var m=i.delete(c);if(m)s=!0;else{var g=i.data_.get(c);o.set(c,g)}}}for(var d=rd(a.entries()),y;!(y=d()).done;){var _=y.value,x=_[0],b=_[1],S=i.data_.has(x);if(i.set(x,b),i.data_.has(x)){var k=i.data_.get(x);o.set(x,k),S||(s=!0)}}if(!s)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var E=i.data_.keys(),A=o.keys(),R=E.next(),O=A.next();!R.done;){if(R.value!==O.value){i.keysAtom_.reportChanged();break}R=E.next(),O=A.next()}i.data_=o}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(r,i){return Bp(this,r)},t.intercept_=function(r){return Fp(this,r)},Sd(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])})(),Tl=kf("ObservableMap",Kv);function x5(e){return e[Symbol.toStringTag]="MapIterator",Qv(e)}function BS(e){if(_d(e)||Tl(e))return e;if(Array.isArray(e))return new Map(e);if(wf(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return zn(21,e)}var zS={},K6=(function(){function e(n,r,i){var a=this;r===void 0&&(r=fh),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[bn]=zS,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,cl(Set)||zn(22),this.enhancer_=function(o,s){return r(o,s,i)},xh(function(){a.atom_=g0(a.name_),n&&a.replace(n)})}var t=e.prototype;return t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.clear=function(){var r=this;vc(function(){E6(function(){for(var i=rd(r.data_.values()),a;!(a=i()).done;){var o=a.value;r.delete(o)}})})},t.forEach=function(r,i){for(var a=rd(this),o;!(o=a()).done;){var s=o.value;r.call(i,s,s,this)}},t.add=function(r){var i=this;if(this.atom_,Pl(this)){var a=Ol(this,{type:mf,object:this,newValue:r});if(!a)return this;r=a.newValue}if(!this.has(r)){vc(function(){i.data_.add(i.enhancer_(r,void 0)),i.atom_.reportChanged()});var o=!1,s=tu(this),u=s||o?{observableKind:"set",debugObjectName:this.name_,type:mf,object:this,newValue:r}:null;s&&nu(this,u)}return this},t.delete=function(r){var i=this;if(Pl(this)){var a=Ol(this,{type:_0,object:this,oldValue:r});if(!a)return!1}if(this.has(r)){var o=!1,s=tu(this),u=s||o?{observableKind:"set",debugObjectName:this.name_,type:_0,object:this,oldValue:r}:null;return vc(function(){i.atom_.reportChanged(),i.data_.delete(r)}),s&&nu(this,u),!0}return!1},t.has=function(r){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(r))},t.entries=function(){var r=this.values();return _5({next:function(){var a=r.next(),o=a.value,s=a.done;return s?{value:void 0,done:s}:{value:[o,o],done:s}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var r=this,i=this.data_.values();return _5({next:function(){var o=i.next(),s=o.value,u=o.done;return u?{value:void 0,done:u}:{value:r.dehanceValue_(s),done:u}}})},t.intersection=function(r){if(gc(r)&&!is(r))return r.intersection(this);var i=new Set(this);return i.intersection(r)},t.union=function(r){if(gc(r)&&!is(r))return r.union(this);var i=new Set(this);return i.union(r)},t.difference=function(r){return new Set(this).difference(r)},t.symmetricDifference=function(r){if(gc(r)&&!is(r))return r.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(r)},t.isSubsetOf=function(r){return new Set(this).isSubsetOf(r)},t.isSupersetOf=function(r){return new Set(this).isSupersetOf(r)},t.isDisjointFrom=function(r){if(gc(r)&&!is(r))return r.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(r)},t.replace=function(r){var i=this;return is(r)&&(r=new Set(r)),vc(function(){Array.isArray(r)?(i.clear(),r.forEach(function(a){return i.add(a)})):gc(r)?(i.clear(),r.forEach(function(a){return i.add(a)})):r!=null&&zn("Cannot initialize set from "+r)}),this},t.observe_=function(r,i){return Bp(this,r)},t.intercept_=function(r){return Fp(this,r)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},Sd(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])})(),is=kf("ObservableSet",K6);function _5(e){return e[Symbol.toStringTag]="SetIterator",Qv(e)}var S5=Object.create(null),E5="remove",Z6=(function(){function e(n,r,i,a){r===void 0&&(r=new Map),a===void 0&&(a=N9),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=n,this.values_=r,this.name_=i,this.defaultAnnotation_=a,this.keysAtom_=new Af("ObservableObject.keys"),this.isPlainObject_=wf(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(r){return this.values_.get(r).get()},t.setObservablePropValue_=function(r,i){var a=this.values_.get(r);if(a instanceof ru)return a.set(i),!0;if(Pl(this)){var o=Ol(this,{type:zu,object:this.proxy_||this.target_,name:r,newValue:i});if(!o)return null;i=o.newValue}if(i=a.prepareNewValue_(i),i!==Nt.UNCHANGED){var s=tu(this),u=!1,h=s||u?{type:zu,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:r,newValue:i}:null;a.setNewValue_(i),s&&nu(this,h)}return!0},t.get_=function(r){return Nt.trackingDerivation&&!wc(this.target_,r)&&this.has_(r),this.target_[r]},t.set_=function(r,i,a){return a===void 0&&(a=!1),wc(this.target_,r)?this.values_.has(r)?this.setObservablePropValue_(r,i):a?Reflect.set(this.target_,r,i):(this.target_[r]=i,!0):this.extend_(r,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,a)},t.has_=function(r){if(!Nt.trackingDerivation)return r in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(r);return i||(i=new bf(r in this.target_,$0,"ObservableObject.key?",!1),this.pendingKeys_.set(r,i)),i.get()},t.make_=function(r,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(!(r in this.target_)){var a;if((a=this.target_[Iu])!=null&&a[r])return;zn(1,i.annotationType_,this.name_+"."+r.toString())}for(var o=this.target_;o&&o!==B0;){var s=p0(o,r);if(s){var u=i.make_(this,r,s,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}A5(this,i,r)}},t.extend_=function(r,i,a,o){if(o===void 0&&(o=!1),a===!0&&(a=this.defaultAnnotation_),a===!1)return this.defineProperty_(r,i,o);var s=a.extend_(this,r,i,o);return s&&A5(this,a,r),s},t.defineProperty_=function(r,i,a){a===void 0&&(a=!1),this.keysAtom_;try{Ns();var o=this.delete_(r);if(!o)return o;if(Pl(this)){var s=Ol(this,{object:this.proxy_||this.target_,name:r,type:mf,newValue:i.value});if(!s)return null;var u=s.newValue;i.value!==u&&(i=xf({},i,{value:u}))}if(a){if(!Reflect.defineProperty(this.target_,r,i))return!1}else Fu(this.target_,r,i);this.notifyPropertyAddition_(r,i.value)}finally{Ts()}return!0},t.defineObservableProperty_=function(r,i,a,o){o===void 0&&(o=!1),this.keysAtom_;try{Ns();var s=this.delete_(r);if(!s)return s;if(Pl(this)){var u=Ol(this,{object:this.proxy_||this.target_,name:r,type:mf,newValue:i});if(!u)return null;i=u.newValue}var h=k5(r),c={configurable:Nt.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:h.get,set:h.set};if(o){if(!Reflect.defineProperty(this.target_,r,c))return!1}else Fu(this.target_,r,c);var m=new bf(i,a,"ObservableObject.key",!1);this.values_.set(r,m),this.notifyPropertyAddition_(r,m.value_)}finally{Ts()}return!0},t.defineComputedProperty_=function(r,i,a){a===void 0&&(a=!1),this.keysAtom_;try{Ns();var o=this.delete_(r);if(!o)return o;if(Pl(this)){var s=Ol(this,{object:this.proxy_||this.target_,name:r,type:mf,newValue:void 0});if(!s)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var u=k5(r),h={configurable:Nt.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:u.get,set:u.set};if(a){if(!Reflect.defineProperty(this.target_,r,h))return!1}else Fu(this.target_,r,h);this.values_.set(r,new ru(i)),this.notifyPropertyAddition_(r,void 0)}finally{Ts()}return!0},t.delete_=function(r,i){if(i===void 0&&(i=!1),this.keysAtom_,!wc(this.target_,r))return!0;if(Pl(this)){var a=Ol(this,{object:this.proxy_||this.target_,name:r,type:E5});if(!a)return null}try{var o;Ns();var s=tu(this),u=!1,h=this.values_.get(r),c=void 0;if(!h&&(s||u)){var m;c=(m=p0(this.target_,r))==null?void 0:m.value}if(i){if(!Reflect.deleteProperty(this.target_,r))return!1}else delete this.target_[r];if(h&&(this.values_.delete(r),h instanceof bf&&(c=h.value_),L6(h)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(r))==null||o.set(r in this.target_),s||u){var g={type:E5,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:c,name:r};s&&nu(this,g)}}finally{Ts()}return!0},t.observe_=function(r,i){return Bp(this,r)},t.intercept_=function(r){return Fp(this,r)},t.notifyPropertyAddition_=function(r,i){var a,o=tu(this),s=!1;if(o||s){var u=o||s?{type:mf,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:r,newValue:i}:null;o&&nu(this,u)}(a=this.pendingKeys_)==null||(a=a.get(r))==null||a.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),q0(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e})();function Ed(e,t){var n;if(wc(e,bn))return e;var r=(n=t?.name)!=null?n:"ObservableObject",i=new Z6(e,new Map,String(r),q9(t));return U0(e,bn,i),e}var US=kf("ObservableObjectAdministration",Z6);function k5(e){return S5[e]||(S5[e]={get:function(){return this[bn].getObservablePropValue_(e)},set:function(n){return this[bn].setObservablePropValue_(e,n)}})}function ou(e){return z0(e)?US(e[bn]):!1}function A5(e,t,n){var r;(r=e.target_[Iu])==null||delete r[n]}var qS=J6(0),$S=(function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1})(),zg=0,Q6=function(){};function HS(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}HS(Q6,Array.prototype);var Zv=(function(e){function t(r,i,a,o){var s;return a===void 0&&(a="ObservableArray"),o===void 0&&(o=!1),s=e.call(this)||this,xh(function(){var u=new Xv(a,i,o,!0);u.proxy_=s,u6(s,bn,u),r&&r.length&&s.spliceWithArray(0,0,r),$S&&Object.defineProperty(s,"0",qS)}),s}h6(t,e);var n=t.prototype;return n.concat=function(){this[bn].atom_.reportObserved();for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),a.map(function(s){return Vu(s)?s.slice():s}))},n[Symbol.iterator]=function(){var r=this,i=0;return Qv({next:function(){return i<r.length?{value:r[i++],done:!1}:{done:!0,value:void 0}}})},Sd(t,[{key:"length",get:function(){return this[bn].getArrayLength_()},set:function(i){this[bn].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])})(Q6);Object.entries(x0).forEach(function(e){var t=e[0],n=e[1];t!=="concat"&&U0(Zv.prototype,t,n)});function J6(e){return{enumerable:!1,configurable:!0,get:function(){return this[bn].get_(e)},set:function(n){this[bn].set_(e,n)}}}function GS(e){Fu(Zv.prototype,""+e,J6(e))}function e8(e){if(e>zg){for(var t=zg;t<e+100;t++)GS(t);zg=e}}e8(1e3);function WS(e,t,n){return new Zv(e,t,n)}function vd(e,t){if(typeof e=="object"&&e!==null){if(Vu(e))return t!==void 0&&zn(23),e[bn].atom_;if(is(e))return e.atom_;if(Tl(e)){if(t===void 0)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||zn(25,t,av(e)),n}if(ou(e)){if(!t)return zn(26);var r=e[bn].values_.get(t);return r||zn(27,t,av(e)),r}if(Hv(e)||V0(e)||b0(e))return e}else if(cl(e)&&b0(e[bn]))return e[bn];zn(28)}function Hu(e,t){if(e||zn(29),t!==void 0)return Hu(vd(e,t));if(Hv(e)||V0(e)||b0(e)||Tl(e)||is(e))return e;if(e[bn])return e[bn];zn(24,e)}function av(e,t){var n;if(t!==void 0)n=vd(e,t);else{if(gd(e))return e.name;ou(e)||Tl(e)||is(e)?n=Hu(e):n=vd(e)}return n.name_}function xh(e){var t=wh(),n=G0(!0);Ns();try{return e()}finally{Ts(),W0(n),xc(t)}}var P5=B0.toString;function t8(e,t,n){return n===void 0&&(n=-1),ov(e,t,n)}function ov(e,t,n,r,i){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var a=typeof e;if(a!=="function"&&a!=="object"&&typeof t!="object")return!1;var o=P5.call(e);if(o!==P5.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":n>=0&&n++;break}e=O5(e),t=O5(t);var s=o==="[object Array]";if(!s){if(typeof e!="object"||typeof t!="object")return!1;var u=e.constructor,h=t.constructor;if(u!==h&&!(cl(u)&&u instanceof u&&cl(h)&&h instanceof h)&&"constructor"in e&&"constructor"in t)return!1}if(n===0)return!1;n<0&&(n=-1),r=r||[],i=i||[];for(var c=r.length;c--;)if(r[c]===e)return i[c]===t;if(r.push(e),i.push(t),s){if(c=e.length,c!==t.length)return!1;for(;c--;)if(!ov(e[c],t[c],n-1,r,i))return!1}else{var m=Object.keys(e),g=m.length;if(Object.keys(t).length!==g)return!1;for(var d=0;d<g;d++){var y=m[d];if(!(wc(t,y)&&ov(e[y],t[y],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function O5(e){return Vu(e)?e.slice():_d(e)||Tl(e)||gc(e)||is(e)?Array.from(e.entries()):e}var C5,VS=((C5=F0().Iterator)==null?void 0:C5.prototype)||{};function Qv(e){return e[Symbol.iterator]=YS,Object.assign(Object.create(VS),e)}function YS(){return this}["Symbol","Map","Set"].forEach(function(e){var t=F0();typeof t[e]>"u"&&zn("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:sS,extras:{getDebugName:av},$mobx:bn});if(!Di.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!Y6)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var n8=r6();function XS(e){e()}function KS(e){e||(e=XS),bS({reactionScheduler:e})}function ZS(e){return xS(e)}var QS=1e4,JS=1e4,eE=(function(){function e(t){var n=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=QS),clearTimeout(n.sweepTimeout),n.sweepTimeout=void 0;var i=Date.now();n.registrations.forEach(function(a,o){i-a.registeredAt>=r&&(n.finalize(a.value),n.registrations.delete(o))}),n.registrations.size>0&&n.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){n.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,r){this.registrations.set(r,{value:n,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.registrations.delete(t)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,JS))}}),e})(),tE=typeof FinalizationRegistry<"u"?FinalizationRegistry:eE,sv=new tE(function(e){var t;(t=e.reaction)===null||t===void 0||t.dispose(),e.reaction=null}),Ug={exports:{}},qg={};var L5;function nE(){if(L5)return qg;L5=1;var e=Mp();function t(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function s(m,g){var d=g(),y=r({inst:{value:d,getSnapshot:g}}),_=y[0].inst,x=y[1];return a(function(){_.value=d,_.getSnapshot=g,u(_)&&x({inst:_})},[m,d,g]),i(function(){return u(_)&&x({inst:_}),m(function(){u(_)&&x({inst:_})})},[m]),o(d),d}function u(m){var g=m.getSnapshot;m=m.value;try{var d=g();return!n(m,d)}catch{return!0}}function h(m,g){return g()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:s;return qg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:c,qg}var N5;function rE(){return N5||(N5=1,Ug.exports=nE()),Ug.exports}var iE=rE();function T5(e){e.reaction=new qu("observer".concat(e.name),function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)===null||t===void 0||t.call(e)})}function aE(e,t){t===void 0&&(t="observed");var n=oe.useRef(null);if(!n.current){var r={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(s){return sv.unregister(r),r.onStoreChange=s,r.reaction||(T5(r),r.stateVersion=Symbol()),function(){var u;r.onStoreChange=null,(u=r.reaction)===null||u===void 0||u.dispose(),r.reaction=null}},getSnapshot:function(){return r.stateVersion}};n.current=r}var i=n.current;i.reaction||(T5(i),sv.register(n,i,i)),oe.useDebugValue(i.reaction,ZS),iE.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot);var a,o;if(i.reaction.track(function(){try{a=e()}catch(s){o=s}}),o)throw o;return a}var $g,Hg,r8=typeof Symbol=="function"&&Symbol.for,oE=(Hg=($g=Object.getOwnPropertyDescriptor(function(){},"name"))===null||$g===void 0?void 0:$g.configurable)!==null&&Hg!==void 0?Hg:!1,R5=r8?Symbol.for("react.forward_ref"):typeof Di.forwardRef=="function"&&Di.forwardRef(function(e){return null}).$$typeof,M5=r8?Symbol.for("react.memo"):typeof Di.memo=="function"&&Di.memo(function(e){return null}).$$typeof;function Qr(e,t){var n;if(M5&&e.$$typeof===M5)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.");var r=(n=void 0)!==null&&n!==void 0?n:!1,i=e,a=e.displayName||e.name;if(R5&&e.$$typeof===R5&&(r=!0,i=e.render,typeof i!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var o=function(s,u){return aE(function(){return i(s,u)},a)};return o.displayName=e.displayName,oE&&Object.defineProperty(o,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(o.contextTypes=e.contextTypes),r&&(o=Di.forwardRef(o)),o=Di.memo(o),lE(e,o),o}var sE={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function lE(e,t){Object.keys(e).forEach(function(n){sE[n]||Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}function uE(e,t){return Di.useState(function(){return Qn(e(),t,{autoBind:!0})})[0]}var Gg;KS(n8.unstable_batchedUpdates);Gg=sv.finalizeAllImmediately;const cE=Math.PI/180;function fE(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const nh=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},Ot={_global:nh,version:"10.0.12",isBrowser:fE(),isUnminified:/param/.test((function(e){}).toString()),dblClickWindow:400,getAngle(e){return Ot.angleDeg?e*cE:e},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,_renderBackend:"web",legacyTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return Ot.DD.isDragging},isTransforming(){var e,t;return(t=(e=Ot.Transformer)===null||e===void 0?void 0:e.isTransforming())!==null&&t!==void 0?t:!1},isDragReady(){return!!Ot.DD.node},releaseCanvasOnDestroy:!0,document:nh.document,_injectGlobal(e){typeof nh.Konva<"u"&&console.error("Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."),nh.Konva=e}},Bi=e=>{Ot[e.prototype.getClassName()]=e};Ot._injectGlobal(Ot);const hE=`Konva.js unsupported environment.
|
|
11
|
+
|
|
12
|
+
Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined.
|
|
13
|
+
|
|
14
|
+
To use Konva.js in Node.js environment, you need to use the "canvas-backend" or "skia-backend" module.
|
|
15
|
+
|
|
16
|
+
bash: npm install canvas
|
|
17
|
+
js: import "konva/canvas-backend";
|
|
18
|
+
|
|
19
|
+
or
|
|
20
|
+
|
|
21
|
+
bash: npm install skia-canvas
|
|
22
|
+
js: import "konva/skia-backend";
|
|
23
|
+
`,I5=()=>{if(typeof document>"u")throw new Error(hE)};class sl{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.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 sl(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){const n=this.m;return{x:n[0]*t.x+n[2]*t.y+n[4],y:n[1]*t.x+n[3]*t.y+n[5]}}translate(t,n){return this.m[4]+=this.m[0]*t+this.m[2]*n,this.m[5]+=this.m[1]*t+this.m[3]*n,this}scale(t,n){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=n,this.m[3]*=n,this}rotate(t){const n=Math.cos(t),r=Math.sin(t),i=this.m[0]*n+this.m[2]*r,a=this.m[1]*n+this.m[3]*r,o=this.m[0]*-r+this.m[2]*n,s=this.m[1]*-r+this.m[3]*n;return this.m[0]=i,this.m[1]=a,this.m[2]=o,this.m[3]=s,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,n){const r=this.m[0]+this.m[2]*n,i=this.m[1]+this.m[3]*n,a=this.m[2]+this.m[0]*t,o=this.m[3]+this.m[1]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=a,this.m[3]=o,this}multiply(t){const n=this.m[0]*t.m[0]+this.m[2]*t.m[1],r=this.m[1]*t.m[0]+this.m[3]*t.m[1],i=this.m[0]*t.m[2]+this.m[2]*t.m[3],a=this.m[1]*t.m[2]+this.m[3]*t.m[3],o=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],s=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=a,this.m[4]=o,this.m[5]=s,this}invert(){const t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*t,r=-this.m[1]*t,i=-this.m[2]*t,a=this.m[0]*t,o=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),s=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=a,this.m[4]=o,this.m[5]=s,this}getMatrix(){return this.m}decompose(){const t=this.m[0],n=this.m[1],r=this.m[2],i=this.m[3],a=this.m[4],o=this.m[5],s=t*i-n*r,u={x:a,y:o,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||n!=0){const h=Math.sqrt(t*t+n*n);u.rotation=n>0?Math.acos(t/h):-Math.acos(t/h),u.scaleX=h,u.scaleY=s/h,u.skewX=(t*r+n*i)/s,u.skewY=0}else if(r!=0||i!=0){const h=Math.sqrt(r*r+i*i);u.rotation=Math.PI/2-(i>0?Math.acos(-r/h):-Math.acos(r/h)),u.scaleX=s/h,u.scaleY=h,u.skewX=0,u.skewY=(t*r+n*i)/s}return u.rotation=Ze._getRotation(u.rotation),u}}const dE="[object Array]",pE="[object Number]",gE="[object String]",mE="[object Boolean]",vE=Math.PI/180,yE=180/Math.PI,Ud="#",bE="",wE="0",xE="Konva warning: ",j5="Konva error: ",_E="rgb(",Wg={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]},SE=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let k1=[],qd=null;const EE=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(e){setTimeout(e,60)},Ze={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===dE},_isNumber(e){return Object.prototype.toString.call(e)===pE&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===gE},_isBoolean(e){return Object.prototype.toString.call(e)===mE},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!="string")return!1;const t=e[0];return t==="#"||t==="."||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e){k1.push(e),k1.length===1&&EE(function(){const t=k1;k1=[],t.forEach(function(n){n()})})},createCanvasElement(){I5();const e=document.createElement("canvas");try{e.style=e.style||{}}catch{}return e},createImageElement(){return I5(),document.createElement("img")},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){const n=Ze.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb(e){e=e.replace(Ud,bE);const t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){let e=(Math.random()*16777215<<0).toString(16);for(;e.length<6;)e=wE+e;return Ud+e},isCanvasFarblingActive(){if(qd!==null)return qd;if(typeof document>"u")return qd=!1,!1;const e=this.createCanvasElement();e.width=10,e.height=10;const t=e.getContext("2d",{willReadFrequently:!0});t.clearRect(0,0,10,10),t.fillStyle="#282828",t.fillRect(0,0,10,10);const n=t.getImageData(0,0,10,10).data;let r=!1;for(let i=0;i<100;i++)if(n[i*4]!==40||n[i*4+1]!==40||n[i*4+2]!==40||n[i*4+3]!==255){r=!0;break}return qd=r,this.releaseCanvas(e),qd},getHitColor(){const e=this.getRandomColor();return this.isCanvasFarblingActive()?this.getSnappedHexColor(e):e},getHitColorKey(e,t,n){return this.isCanvasFarblingActive()&&(e=Math.round(e/5)*5,t=Math.round(t/5)*5,n=Math.round(n/5)*5),Ud+this._rgbToHex(e,t,n)},getSnappedHexColor(e){const t=this._hexToRgb(e);return Ud+this._rgbToHex(Math.round(t.r/5)*5,Math.round(t.g/5)*5,Math.round(t.b/5)*5)},getRGB(e){let t;return e in Wg?(t=Wg[e],{r:t[0],g:t[1],b:t[2]}):e[0]===Ud?this._hexToRgb(e.substring(1)):e.substr(0,4)===_E?(t=SE.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(e){return e=e||"black",Ze._namedColorToRBA(e)||Ze._hex3ColorToRGBA(e)||Ze._hex4ColorToRGBA(e)||Ze._hex6ColorToRGBA(e)||Ze._hex8ColorToRGBA(e)||Ze._rgbColorToRGBA(e)||Ze._rgbaColorToRGBA(e)||Ze._hslColorToRGBA(e)},_namedColorToRBA(e){const t=Wg[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(e.indexOf("rgb(")===0){e=e.match(/rgb\(([^)]+)\)/)[1];const t=e.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(e.indexOf("rgba(")===0){e=e.match(/rgba\(([^)]+)\)/)[1];const t=e.split(/ *, */).map((n,r)=>n.slice(-1)==="%"?r===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex8ColorToRGBA(e){if(e[0]==="#"&&e.length===9)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:parseInt(e.slice(7,9),16)/255}},_hex6ColorToRGBA(e){if(e[0]==="#"&&e.length===7)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex4ColorToRGBA(e){if(e[0]==="#"&&e.length===5)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:parseInt(e[4]+e[4],16)/255}},_hex3ColorToRGBA(e){if(e[0]==="#"&&e.length===4)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){const[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,i=Number(n[1])/100,a=Number(n[2])/100;let o,s,u;if(i===0)return u=a*255,{r:Math.round(u),g:Math.round(u),b:Math.round(u),a:1};a<.5?o=a*(1+i):o=a+i-a*i;const h=2*a-o,c=[0,0,0];for(let m=0;m<3;m++)s=r+1/3*-(m-1),s<0&&s++,s>1&&s--,6*s<1?u=h+(o-h)*6*s:2*s<1?u=o:3*s<2?u=h+(o-h)*(2/3-s)*6:u=h,c[m]=u*255;return{r:Math.round(c[0]),g:Math.round(c[1]),b:Math.round(c[2]),a:1}}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.width<e.x||t.y>e.y+e.height||t.y+t.height<e.y)},cloneObject(e){const t={};for(const n in e)this._isPlainObject(e[n])?t[n]=this.cloneObject(e[n]):this._isArray(e[n])?t[n]=this.cloneArray(e[n]):t[n]=e[n];return t},cloneArray(e){return e.slice(0)},degToRad(e){return e*vE},radToDeg(e){return e*yE},_degToRad(e){return Ze.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),Ze.degToRad(e)},_radToDeg(e){return Ze.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),Ze.radToDeg(e)},_getRotation(e){return Ot.angleDeg?Ze.radToDeg(e):e},_capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)},throw(e){throw new Error(j5+e)},error(e){console.error(j5+e)},warn(e){Ot.showWarnings&&console.warn(xE+e)},each(e,t){for(const n in e)t(n,e[n])},_inRange(e,t,n){return t<=e&&e<n},_getProjectionToSegment(e,t,n,r,i,a){let o,s,u;const h=(e-n)*(e-n)+(t-r)*(t-r);if(h==0)o=e,s=t,u=(i-n)*(i-n)+(a-r)*(a-r);else{const c=((i-e)*(n-e)+(a-t)*(r-t))/h;c<0?(o=e,s=t,u=(e-i)*(e-i)+(t-a)*(t-a)):c>1?(o=n,s=r,u=(n-i)*(n-i)+(r-a)*(r-a)):(o=e+c*(n-e),s=t+c*(r-t),u=(o-i)*(o-i)+(s-a)*(s-a))}return[o,s,u]},_getProjectionToLine(e,t,n){const r=Ze.cloneObject(e);let i=Number.MAX_VALUE;return t.forEach(function(a,o){if(!n&&o===t.length-1)return;const s=t[(o+1)%t.length],u=Ze._getProjectionToSegment(a.x,a.y,s.x,s.y,e.x,e.y),h=u[0],c=u[1],m=u[2];m<i&&(r.x=h,r.y=c,i=m)}),r},_prepareArrayForTween(e,t,n){const r=[],i=[];if(e.length>t.length){const o=t;t=e,e=o}for(let o=0;o<e.length;o+=2)r.push({x:e[o],y:e[o+1]});for(let o=0;o<t.length;o+=2)i.push({x:t[o],y:t[o+1]});const a=[];return i.forEach(function(o){const s=Ze._getProjectionToLine(o,r,n);a.push(s.x),a.push(s.y)}),a},_prepareToStringify(e){let t;e.visitedByCircularReferenceRemoval=!0;for(const n in e)if(e.hasOwnProperty(n)&&e[n]&&typeof e[n]=="object"){if(t=Object.getOwnPropertyDescriptor(e,n),e[n].visitedByCircularReferenceRemoval||Ze._isElement(e[n]))if(t.configurable)delete e[n];else return null;else if(Ze._prepareToStringify(e[n])===null)if(t.configurable)delete e[n];else return null}return delete e.visitedByCircularReferenceRemoval,e},_assign(e,t){for(const n in t)e[n]=t[n];return e},_getFirstPointerId(e){return e.touches?e.changedTouches[0].identifier:e.pointerId||999},releaseCanvas(...e){Ot.releaseCanvasOnDestroy&&e.forEach(t=>{t.width=0,t.height=0})},drawRoundedRectPath(e,t,n,r){let i=t<0?t:0,a=n<0?n:0;t=Math.abs(t),n=Math.abs(n);let o=0,s=0,u=0,h=0;typeof r=="number"?o=s=u=h=Math.min(r,t/2,n/2):(o=Math.min(r[0]||0,t/2,n/2),s=Math.min(r[1]||0,t/2,n/2),h=Math.min(r[2]||0,t/2,n/2),u=Math.min(r[3]||0,t/2,n/2)),e.moveTo(i+o,a),e.lineTo(i+t-s,a),e.arc(i+t-s,a+s,s,Math.PI*3/2,0,!1),e.lineTo(i+t,a+n-h),e.arc(i+t-h,a+n-h,h,0,Math.PI/2,!1),e.lineTo(i+u,a+n),e.arc(i+u,a+n-u,u,Math.PI/2,Math.PI,!1),e.lineTo(i,a+o),e.arc(i+o,a+o,o,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(e,t,n,r,i){r=Math.abs(r);for(let a=0;a<n;a++){const o=t[(a-1+n)%n],s=t[a],u=t[(a+1)%n],h={x:s.x-o.x,y:s.y-o.y},c={x:u.x-s.x,y:u.y-s.y},m=Math.hypot(h.x,h.y),g=Math.hypot(c.x,c.y);let d;typeof i=="number"?d=i:d=a<i.length?i[a]:0,d=r*Math.cos(Math.PI/n)*Math.min(1,d/r*2);const _={x:h.x/m,y:h.y/m},x={x:c.x/g,y:c.y/g},b={x:s.x-_.x*d,y:s.y-_.y*d},S={x:s.x+x.x*d,y:s.y+x.y*d};a===0?e.moveTo(b.x,b.y):e.lineTo(b.x,b.y),e.arcTo(s.x,s.y,S.x,S.y,d)}}};function kE(e){const t=[],n=e.length,r=Ze;for(let i=0;i<n;i++){let a=e[i];r._isNumber(a)?a=Math.round(a*1e3)/1e3:r._isString(a)||(a=a+""),t.push(a)}return t}const D5=",",AE="(",PE=")",OE="([",CE="])",LE=";",NE="()",TE="=",F5=["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"],RE=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],ME=100;let A1=null;function B5(){if(A1!==null)return A1;try{const t=Ze.createCanvasElement().getContext("2d");return t?!!t&&"filter"in t:(A1=!1,!1)}catch{return A1=!1,!1}}class Y0{constructor(t){this.canvas=t,Ot.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,n){let r=this.traceArr,i=r.length,a="",o,s,u,h;for(o=0;o<i;o++)s=r[o],u=s.method,u?(h=s.args,a+=u,t?a+=NE:Ze._isArray(h[0])?a+=OE+h.join(D5)+CE:(n&&(h=h.map(c=>typeof c=="number"?Math.floor(c):c)),a+=AE+h.join(D5)+PE)):(a+=s.property,t||(a+=TE+s.val)),a+=LE;return a}clearTrace(){this.traceArr=[]}_trace(t){let n=this.traceArr,r;n.push(t),r=n.length,r>=ME&&n.shift()}reset(){const t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){const n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){const n=t.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(t){const n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){const n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}_applyMiterLimit(t){const n=t.attrs.miterLimit;n!=null&&this.setAttr("miterLimit",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,i,a,o){this._context.arc(t,n,r,i,a,o)}arcTo(t,n,r,i,a){this._context.arcTo(t,n,r,i,a)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,i,a,o){this._context.bezierCurveTo(t,n,r,i,a,o)}clearRect(t,n,r,i){this._context.clearRect(t,n,r,i)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,n){const r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,i){return this._context.createLinearGradient(t,n,r,i)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,i,a,o){return this._context.createRadialGradient(t,n,r,i,a,o)}drawImage(t,n,r,i,a,o,s,u,h){const c=arguments,m=this._context;c.length===3?m.drawImage(t,n,r):c.length===5?m.drawImage(t,n,r,i,a):c.length===9&&m.drawImage(t,n,r,i,a,o,s,u,h)}ellipse(t,n,r,i,a,o,s,u){this._context.ellipse(t,n,r,i,a,o,s,u)}isPointInPath(t,n,r,i){return r?this._context.isPointInPath(r,t,n,i):this._context.isPointInPath(t,n,i)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,n,r,i){this._context.fillRect(t,n,r,i)}strokeRect(t,n,r,i){this._context.strokeRect(t,n,r,i)}fillText(t,n,r,i){i?this._context.fillText(t,n,r,i):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,i){return this._context.getImageData(t,n,r,i)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,i){this._context.rect(t,n,r,i)}roundRect(t,n,r,i,a){this._context.roundRect(t,n,r,i,a)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,i){this._context.quadraticCurveTo(t,n,r,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,n,r,i,a,o){this._context.setTransform(t,n,r,i,a,o)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,i){this._context.strokeText(t,n,r,i)}transform(t,n,r,i,a,o){this._context.transform(t,n,r,i,a,o)}translate(t,n){this._context.translate(t,n)}_enableTrace(){let t=this,n=F5.length,r=this.setAttr,i,a;const o=function(s){let u=t[s],h;t[s]=function(){return a=kE(Array.prototype.slice.call(arguments,0)),h=u.apply(t,arguments),t._trace({method:s,args:a}),h}};for(i=0;i<n;i++)o(F5[i]);t.setAttr=function(){r.apply(t,arguments);const s=arguments[0];let u=arguments[1];(s==="shadowOffsetX"||s==="shadowOffsetY"||s==="shadowBlur")&&(u=u/this.canvas.getPixelRatio()),t._trace({property:s,val:u})}}_applyGlobalCompositeOperation(t){const n=t.attrs.globalCompositeOperation;!n||n==="source-over"||this.setAttr("globalCompositeOperation",n)}}RE.forEach(function(e){Object.defineProperty(Y0.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class IE extends Y0{constructor(t,{willReadFrequently:n=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(t){const n=t.fill();this.setAttr("fillStyle",n),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){const n=t._getLinearGradient();n&&(this.setAttr("fillStyle",n),t._fillFunc(this))}_fillRadialGradient(t){const n=t._getRadialGradient();n&&(this.setAttr("fillStyle",n),t._fillFunc(this))}_fill(t){const n=t.fill(),r=t.getFillPriority();if(n&&r==="color"){this._fillColor(t);return}const i=t.getFillPatternImage();if(i&&r==="pattern"){this._fillPattern(t);return}const a=t.getFillLinearGradientColorStops();if(a&&r==="linear-gradient"){this._fillLinearGradient(t);return}const o=t.getFillRadialGradientColorStops();if(o&&r==="radial-gradient"){this._fillRadialGradient(t);return}n?this._fillColor(t):i?this._fillPattern(t):a?this._fillLinearGradient(t):o&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const n=t.getStrokeLinearGradientStartPoint(),r=t.getStrokeLinearGradientEndPoint(),i=t.getStrokeLinearGradientColorStops(),a=this.createLinearGradient(n.x,n.y,r.x,r.y);if(i){for(let o=0;o<i.length;o+=2)a.addColorStop(i[o],i[o+1]);this.setAttr("strokeStyle",a)}}_stroke(t){const n=t.dash(),r=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!r){this.save();const a=this.getCanvas().getPixelRatio();this.setTransform(a,0,0,a,0,0)}this._applyLineCap(t),n&&t.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),t.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),r||this.restore()}}_applyShadow(t){var n,r,i;const a=(n=t.getShadowRGBA())!==null&&n!==void 0?n:"black",o=(r=t.getShadowBlur())!==null&&r!==void 0?r:5,s=(i=t.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},u=t.getAbsoluteScale(),h=this.canvas.getPixelRatio(),c=u.x*h,m=u.y*h;this.setAttr("shadowColor",a),this.setAttr("shadowBlur",o*Math.min(Math.abs(c),Math.abs(m))),this.setAttr("shadowOffsetX",s.x*c),this.setAttr("shadowOffsetY",s.y*m)}}class jE extends Y0{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){const n=t.getStrokeScaleEnabled();if(!n){this.save();const a=this.getCanvas().getPixelRatio();this.setTransform(a,0,0,a,0,0)}this._applyLineCap(t);const r=t.hitStrokeWidth(),i=r==="auto"?t.strokeWidth():r;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),n||this.restore()}}}let P1;function DE(){if(P1)return P1;const e=Ze.createCanvasElement(),t=e.getContext("2d");return P1=(function(){const n=Ot._global.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return n/r})(),Ze.releaseCanvas(e),P1}class Jv{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const r=(t||{}).pixelRatio||Ot.pixelRatio||DE();this.pixelRatio=r,this._canvas=Ze.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){const n=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/n,this.getHeight()/n)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,n){this.setWidth(t||0),this.setHeight(n||0)}toDataURL(t,n){try{return this._canvas.toDataURL(t,n)}catch{try{return this._canvas.toDataURL()}catch(i){return Ze.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}class hf extends Jv{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new IE(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}class ey extends Jv{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new jE(this),this.setSize(t.width,t.height)}}const Sr={get isDragging(){let e=!1;return Sr._dragElements.forEach(t=>{t.dragStatus==="dragging"&&(e=!0)}),e},justDragged:!1,get node(){let e;return Sr._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){const t=[];Sr._dragElements.forEach((n,r)=>{const{node:i}=n,a=i.getStage();a.setPointersPositions(e),n.pointerId===void 0&&(n.pointerId=Ze._getFirstPointerId(e));const o=a._changedPointerPositions.find(s=>s.id===n.pointerId);if(o){if(n.dragStatus!=="dragging"){const s=i.dragDistance();if(Math.max(Math.abs(o.x-n.startPointerPos.x),Math.abs(o.y-n.startPointerPos.y))<s||(i.startDrag({evt:e}),!i.isDragging()))return}i._setDragPosition(e,n),t.push(i)}}),t.forEach(n=>{n.fire("dragmove",{type:"dragmove",target:n,evt:e},!0)})},_endDragBefore(e){const t=[];Sr._dragElements.forEach(n=>{const{node:r}=n,i=r.getStage();if(e&&i.setPointersPositions(e),!i._changedPointerPositions.find(s=>s.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(Sr.justDragged=!0,Ot._mouseListenClick=!1,Ot._touchListenClick=!1,Ot._pointerListenClick=!1,n.dragStatus="stopped");const o=n.node.getLayer()||n.node instanceof Ot.Stage&&n.node;o&&t.indexOf(o)===-1&&t.push(o)}),t.forEach(n=>{n.draw()})},_endDragAfter(e){Sr._dragElements.forEach((t,n)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),t.dragStatus!=="dragging"&&Sr._dragElements.delete(n)})}};Ot.isBrowser&&(window.addEventListener("mouseup",Sr._endDragBefore,!0),window.addEventListener("touchend",Sr._endDragBefore,!0),window.addEventListener("touchcancel",Sr._endDragBefore,!0),window.addEventListener("mousemove",Sr._drag),window.addEventListener("touchmove",Sr._drag),window.addEventListener("mouseup",Sr._endDragAfter,!1),window.addEventListener("touchend",Sr._endDragAfter,!1),window.addEventListener("touchcancel",Sr._endDragAfter,!1));function Pf(e){return Ze._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||Ze._isBoolean(e)?e:Object.prototype.toString.call(e)}function i8(e){return e>255?255:e<0?0:Math.round(e)}function kt(){if(Ot.isUnminified)return function(e,t){return Ze._isNumber(e)||Ze.warn(Pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function X0(e){if(Ot.isUnminified)return function(t,n){let r=Ze._isNumber(t),i=Ze._isArray(t)&&t.length==e;return!r&&!i&&Ze.warn(Pf(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+e+")"),t}}function ty(){if(Ot.isUnminified)return function(e,t){return Ze._isNumber(e)||e==="auto"||Ze.warn(Pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function _h(){if(Ot.isUnminified)return function(e,t){return Ze._isString(e)||Ze.warn(Pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function a8(){if(Ot.isUnminified)return function(e,t){const n=Ze._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||Ze.warn(Pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function FE(){if(Ot.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(Ze._isArray(e)?e.forEach(function(r){Ze._isNumber(r)||Ze.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):Ze.warn(Pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function su(){if(Ot.isUnminified)return function(e,t){return e===!0||e===!1||Ze.warn(Pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}function BE(e){if(Ot.isUnminified)return function(t,n){return t==null||Ze.isObject(t)||Ze.warn(Pf(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}const $d="get",Hd="set",Re={addGetterSetter(e,t,n,r,i){Re.addGetter(e,t,n),Re.addSetter(e,t,r,i),Re.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){const r=$d+Ze._capitalize(t);e.prototype[r]=e.prototype[r]||function(){const i=this.attrs[t];return i===void 0?n:i}},addSetter(e,t,n,r){const i=Hd+Ze._capitalize(t);e.prototype[i]||Re.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){const i=Hd+Ze._capitalize(t);e.prototype[i]=function(a){return n&&a!==void 0&&a!==null&&(a=n.call(this,a,t)),this._setAttr(t,a),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,i){const a=n.length,o=Ze._capitalize,s=$d+o(t),u=Hd+o(t);e.prototype[s]=function(){const c={};for(let m=0;m<a;m++){const g=n[m];c[g]=this.getAttr(t+o(g))}return c};const h=BE(n);e.prototype[u]=function(c){const m=this.attrs[t];r&&(c=r.call(this,c,t)),h&&h.call(this,c,t);for(const g in c)c.hasOwnProperty(g)&&this._setAttr(t+o(g),c[g]);return c||n.forEach(g=>{this._setAttr(t+o(g),void 0)}),this._fireChangeEvent(t,m,c),i&&i.call(this),this},Re.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){const n=Ze._capitalize(t),r=Hd+n,i=$d+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){Ze.error("Adding deprecated "+t);const i=$d+Ze._capitalize(t),a=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[i]=function(){Ze.error(a);const o=this.attrs[t];return o===void 0?n:o},Re.addSetter(e,t,r,function(){Ze.error(a)}),Re.addOverloadedGetterSetter(e,t)},backCompat(e,t){Ze.each(t,function(n,r){const i=e.prototype[r],a=$d+Ze._capitalize(n),o=Hd+Ze._capitalize(n);function s(){i.apply(this,arguments),Ze.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+r+'" instead.')}e.prototype[n]=s,e.prototype[a]=s,e.prototype[o]=s})},afterSetFilter(){this._filterUpToDate=!1}};function zE(e){const t=/(\w+)\(([^)]+)\)/g;let n;for(;(n=t.exec(e))!==null;){const[,r,i]=n;switch(r){case"blur":{const a=parseFloat(i.replace("px",""));return function(o){this.blurRadius(a*.5);const s=Ot.Filters;s&&s.Blur&&s.Blur.call(this,o)}}case"brightness":{const a=i.includes("%")?parseFloat(i)/100:parseFloat(i);return function(o){this.brightness(a);const s=Ot.Filters;s&&s.Brightness&&s.Brightness.call(this,o)}}case"contrast":{const a=parseFloat(i);return function(o){const s=100*(Math.sqrt(a)-1);this.contrast(s);const u=Ot.Filters;u&&u.Contrast&&u.Contrast.call(this,o)}}case"grayscale":return function(a){const o=Ot.Filters;o&&o.Grayscale&&o.Grayscale.call(this,a)};case"sepia":return function(a){const o=Ot.Filters;o&&o.Sepia&&o.Sepia.call(this,a)};case"invert":return function(a){const o=Ot.Filters;o&&o.Invert&&o.Invert.call(this,a)};default:Ze.warn(`CSS filter "${r}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}const t0="absoluteOpacity",O1="allEventListeners",hc="absoluteTransform",z5="absoluteScale",Vf="canvas",UE="Change",qE="children",$E="konva",lv="listening",HE="mouseenter",GE="mouseleave",WE="pointerenter",VE="pointerleave",YE="touchenter",XE="touchleave",U5="set",q5="Shape",n0=" ",$5="stage",cf="transform",KE="Stage",uv="visible",ZE=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(n0);let QE=1,Pt=class cv{constructor(t){this._id=QE++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===cf||t===hc)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){let r=this._cache.get(t);return(r===void 0||(t===cf||t===hc)&&r.dirty===!0)&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const i=n.map(a=>a+"Change.konva").join(n0);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(Vf)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===hc&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Vf)){const{scene:t,filter:n,hit:r,buffer:i}=this._cache.get(Vf);Ze.releaseCanvas(t,n,r,i),this._cache.delete(Vf)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){const n=t||{};let r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let i=Math.ceil(n.width||r.width),a=Math.ceil(n.height||r.height),o=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,u=n.y===void 0?Math.floor(r.y):n.y,h=n.offset||0,c=n.drawBorder||!1,m=n.hitCanvasPixelRatio||1;if(!i||!a){Ze.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const g=Math.abs(Math.round(r.x)-s)>.5?1:0,d=Math.abs(Math.round(r.y)-u)>.5?1:0;i+=h*2+g,a+=h*2+d,s-=h,u-=h;const y=new hf({pixelRatio:o,width:i,height:a}),_=new hf({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),x=new ey({pixelRatio:m,width:i,height:a}),b=y.getContext(),S=x.getContext(),k=new hf({width:y.width/y.pixelRatio+Math.abs(s),height:y.height/y.pixelRatio+Math.abs(u),pixelRatio:y.pixelRatio}),E=k.getContext();return x.isCache=!0,y.isCache=!0,this._cache.delete(Vf),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(y.getContext()._context.imageSmoothingEnabled=!1,_.getContext()._context.imageSmoothingEnabled=!1),b.save(),S.save(),E.save(),b.translate(-s,-u),S.translate(-s,-u),E.translate(-s,-u),k.x=s,k.y=u,this._isUnderCache=!0,this._clearSelfAndDescendantCache(t0),this._clearSelfAndDescendantCache(z5),this.drawScene(y,this,k),this.drawHit(x,this),this._isUnderCache=!1,b.restore(),S.restore(),c&&(b.save(),b.beginPath(),b.rect(0,0,i,a),b.closePath(),b.setAttr("strokeStyle","red"),b.setAttr("lineWidth",5),b.stroke(),b.restore()),this._cache.set(Vf,{scene:y,filter:_,hit:x,buffer:k,x:s,y:u}),this._requestDraw(),this}isCached(){return this._cache.has(Vf)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){const r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}];let i=1/0,a=1/0,o=-1/0,s=-1/0;const u=this.getAbsoluteTransform(n);return r.forEach(function(h){const c=u.point(h);i===void 0&&(i=o=c.x,a=s=c.y),i=Math.min(i,c.x),a=Math.min(a,c.y),o=Math.max(o,c.x),s=Math.max(s,c.y)}),{x:i,y:a,width:o-i,height:s-a}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);const r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){const n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){let t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,a=i.getContext(),o,s,u,h;if(!t||t.length===0)return r;if(this._filterUpToDate)return i;let c=!0;for(let g=0;g<t.length;g++)if(typeof t[g]=="string"&&B5(),typeof t[g]!="string"||!B5()){c=!1;break}const m=r.pixelRatio;if(i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio),c){const g=t.join(" ");return a.save(),a.setAttr("filter",g),a.drawImage(r._canvas,0,0,r.getWidth()/m,r.getHeight()/m),a.restore(),this._filterUpToDate=!0,i}try{for(o=t.length,a.clear(),a.drawImage(r._canvas,0,0,r.getWidth()/m,r.getHeight()/m),s=a.getImageData(0,0,i.getWidth(),i.getHeight()),u=0;u<o;u++)h=t[u],typeof h=="string"&&(h=zE(h)),h.call(this,s),a.putImageData(s,0,0)}catch(g){Ze.error("Unable to apply filter. "+g.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}return this._filterUpToDate=!0,i}on(t,n){if(this._cache&&this._cache.delete(O1),arguments.length===3)return this._delegate.apply(this,arguments);const r=t.split(n0);for(let i=0;i<r.length;i++){const o=r[i].split("."),s=o[0],u=o[1]||"";this.eventListeners[s]||(this.eventListeners[s]=[]),this.eventListeners[s].push({name:u,handler:n})}return this}off(t,n){let r=(t||"").split(n0),i=r.length,a,o,s,u,h,c;if(this._cache&&this._cache.delete(O1),!t)for(o in this.eventListeners)this._off(o);for(a=0;a<i;a++)if(s=r[a],u=s.split("."),h=u[0],c=u[1],h)this.eventListeners[h]&&this._off(h,c,n);else for(o in this.eventListeners)this._off(o,c,n);return this}dispatchEvent(t){const n={target:this,type:t.type,evt:t};return this.fire(t.type,n),this}addEventListener(t,n){return this.on(t,function(r){n.call(this,r.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,n,r){const i=this;this.on(t,function(a){const o=a.target.findAncestors(n,!0,i);for(let s=0;s<o.length;s++)a=Ze.cloneObject(a),a.currentTarget=o[s],r.call(o[s],a)})}remove(){return this.isDragging()&&this.stopDrag(),Sr._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(hc),this._clearSelfAndDescendantCache(t0),this._clearSelfAndDescendantCache(z5),this._clearSelfAndDescendantCache($5),this._clearSelfAndDescendantCache(uv),this._clearSelfAndDescendantCache(lv)}_remove(){this._clearCaches();const t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){const n="get"+Ze._capitalize(t);return Ze._isFunction(this[n])?this[n]():this.attrs[t]}getAncestors(){let t=this.getParent(),n=[];for(;t;)n.push(t),t=t.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{let n,r;if(!t)return this;for(n in t)n!==qE&&(r=U5+Ze._capitalize(n),Ze._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(lv,this._isListening)}_isListening(t){if(!this.listening())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isListening(t):!0}isVisible(){return this._getCache(uv,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);const r=this.getLayer();let i=!1;Sr._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===r)&&(i=!0)});const a=!n&&!Ot.hitOnDragEnabled&&(i||Ot.isTransforming());return this.isListening()&&this.isVisible()&&!a}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let t=this.getDepth(),n=this,r=0,i,a,o,s;function u(c){for(i=[],a=c.length,o=0;o<a;o++)s=c[o],r++,s.nodeType!==q5&&(i=i.concat(s.getChildren().slice())),s._id===n._id&&(o=a);i.length>0&&i[0].getDepth()<=t&&u(i)}const h=this.getStage();return n.nodeType!==KE&&h&&u(h.getChildren()),r}getDepth(){let t=0,n=this.parent;for(;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(cf),this._clearSelfAndDescendantCache(hc)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const t=this.getStage();if(!t)return null;const n=t.getPointerPosition();if(!n)return null;const r=this.getAbsoluteTransform().copy();return r.invert(),r.point(n)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);const i=this.getAbsoluteTransform(t).getMatrix(),a=new sl,o=this.offset();return a.m=i.slice(),a.translate(o.x,o.y),a.getTranslation()}setAbsolutePosition(t){const{x:n,y:r,...i}=this._clearTransform();this.attrs.x=n,this.attrs.y=r,this._clearCache(cf);const a=this._getAbsoluteTransform().copy();return a.invert(),a.translate(t.x,t.y),t={x:this.attrs.x+a.getTranslation().x,y:this.attrs.y+a.getTranslation().y},this._setTransform(i),this.setPosition({x:t.x,y:t.y}),this._clearCache(cf),this._clearSelfAndDescendantCache(hc),this}_setTransform(t){let n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){const t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){let n=t.x,r=t.y,i=this.x(),a=this.y();return n!==void 0&&(i+=n),r!==void 0&&(a+=r),this.setPosition({x:i,y:a}),this}_eachAncestorReverse(t,n){let r=[],i=this.getParent(),a,o;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(a=r.length,o=0;o<a;o++)t(r[o])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return Ze.warn("Node has no parent. moveToTop function is ignored."),!1;const t=this.index,n=this.parent.getChildren().length;return t<n-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return Ze.warn("Node has no parent. moveUp function is ignored."),!1;const t=this.index,n=this.parent.getChildren().length;return t<n-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return Ze.warn("Node has no parent. moveDown function is ignored."),!1;const t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return Ze.warn("Node has no parent. moveToBottom function is ignored."),!1;const t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return Ze.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&Ze.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(t0,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let t=this.opacity();const n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){let t=this.getAttrs(),n,r,i,a,o;const s={attrs:{},className:this.getClassName()};for(n in t)r=t[n],o=Ze.isObject(r)&&!Ze._isPlainObject(r)&&!Ze._isArray(r),!o&&(i=typeof this[n]=="function"&&this[n],delete t[n],a=i?i.call(this):null,t[n]=r,a!==r&&(s.attrs[n]=r));return Ze._prepareToStringify(s)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){const i=[];n&&this._isMatch(t)&&i.push(this);let a=this.parent;for(;a;){if(a===r)return i;a._isMatch(t)&&i.push(a),a=a.parent}return i}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);let n=t.replace(/ /g,"").split(","),r=n.length,i,a;for(i=0;i<r;i++)if(a=n[i],Ze.isValidSelector(a)||(Ze.warn('Selector "'+a+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),Ze.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),Ze.warn("Konva is awesome, right?")),a.charAt(0)==="#"){if(this.id()===a.slice(1))return!0}else if(a.charAt(0)==="."){if(this.hasName(a.slice(1)))return!0}else if(this.className===a||this.nodeType===a)return!0;return!1}getLayer(){const t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache($5,this._getStage)}_getStage(){const t=this.getParent();return t?t.getStage():null}fire(t,n={},r){return n.target=n.target||this,r?this._fireAndBubble(t,n):this._fire(t,n),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(hc,this._getAbsoluteTransform)}_getAbsoluteTransform(t){let n;if(t)return n=new sl,this._eachAncestorReverse(function(r){const i=r.transformsEnabled();i==="all"?n.multiply(r.getTransform()):i==="position"&&n.translate(r.x()-r.offsetX(),r.y()-r.offsetY())},t),n;{n=this._cache.get(hc)||new sl,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();const r=this.transformsEnabled();if(r==="all")n.multiply(this.getTransform());else if(r==="position"){const i=this.attrs.x||0,a=this.attrs.y||0,o=this.attrs.offsetX||0,s=this.attrs.offsetY||0;n.translate(i-o,a-s)}return n.dirty=!1,n}}getAbsoluteScale(t){let n=this;for(;n;)n._isUnderCache&&(t=n),n=n.getParent();const i=this.getAbsoluteTransform(t).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(cf,this._getTransform)}_getTransform(){var t,n;const r=this._cache.get(cf)||new sl;r.reset();const i=this.x(),a=this.y(),o=Ot.getAngle(this.rotation()),s=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,u=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,h=this.attrs.skewX||0,c=this.attrs.skewY||0,m=this.attrs.offsetX||0,g=this.attrs.offsetY||0;return(i!==0||a!==0)&&r.translate(i,a),o!==0&&r.rotate(o),(h!==0||c!==0)&&r.skew(h,c),(s!==1||u!==1)&&r.scale(s,u),(m!==0||g!==0)&&r.translate(-1*m,-1*g),r.dirty=!1,r}clone(t){let n=Ze.cloneObject(this.attrs),r,i,a,o,s;for(r in t)n[r]=t[r];const u=new this.constructor(n);for(r in this.eventListeners)for(i=this.eventListeners[r],a=i.length,o=0;o<a;o++)s=i[o],s.name.indexOf($E)<0&&(u.eventListeners[r]||(u.eventListeners[r]=[]),u.eventListeners[r].push(s));return u}_toKonvaCanvas(t){t=t||{};const n=this.getClientRect(),r=this.getStage(),i=t.x!==void 0?t.x:Math.floor(n.x),a=t.y!==void 0?t.y:Math.floor(n.y),o=t.pixelRatio||1,s=new hf({width:t.width||Math.ceil(n.width)||(r?r.width():0),height:t.height||Math.ceil(n.height)||(r?r.height():0),pixelRatio:o}),u=s.getContext(),h=new hf({width:s.width/s.pixelRatio+Math.abs(i),height:s.height/s.pixelRatio+Math.abs(a),pixelRatio:s.pixelRatio});return t.imageSmoothingEnabled===!1&&(u._context.imageSmoothingEnabled=!1),u.save(),(i||a)&&u.translate(-1*i,-1*a),this.drawScene(s,void 0,h),u.restore(),s}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};const n=t.mimeType||null,r=t.quality||null,i=this._toKonvaCanvas(t).toDataURL(n,r);return t.callback&&t.callback(i),i}toImage(t){return new Promise((n,r)=>{try{const i=t?.callback;i&&delete t.callback,Ze._urlToImage(this.toDataURL(t),function(a){n(a),i?.(a)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t?.callback;i&&delete t.callback,this.toCanvas(t).toBlob(a=>{n(a),i?.(a)},t?.mimeType,t?.quality)}catch(i){r(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():Ot.dragDistance}_off(t,n,r){let i=this.eventListeners[t],a,o,s;for(a=0;a<i.length;a++)if(o=i[a].name,s=i[a].handler,(o!=="konva"||n==="konva")&&(!n||o===n)&&(!r||r===s)){if(i.splice(a,1),i.length===0){delete this.eventListeners[t];break}a--}}_fireChangeEvent(t,n,r){this._fire(t+UE,{oldVal:n,newVal:r})}addName(t){if(!this.hasName(t)){const n=this.name(),r=n?n+" "+t:t;this.name(r)}return this}hasName(t){if(!t)return!1;const n=this.name();return n?(n||"").split(/\s/g).indexOf(t)!==-1:!1}removeName(t){const n=(this.name()||"").split(/\s/g),r=n.indexOf(t);return r!==-1&&(n.splice(r,1),this.name(n.join(" "))),this}setAttr(t,n){const r=this[U5+Ze._capitalize(t)];return Ze._isFunction(r)?r.call(this,n):this._setAttr(t,n),this}_requestDraw(){if(Ot.autoDrawEnabled){const t=this.getLayer()||this.getStage();t?.batchDraw()}}_setAttr(t,n){const r=this.attrs[t];r===n&&!Ze.isObject(n)||(n==null?delete this.attrs[t]:this.attrs[t]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(t,r,n),this._requestDraw())}_setComponentAttr(t,n,r){let i;r!==void 0&&(i=this.attrs[t],i||(this.attrs[t]=this.getAttr(t)),this.attrs[t][n]=r,this._fireChangeEvent(t,i,r))}_fireAndBubble(t,n,r){n&&this.nodeType===q5&&(n.target=this);const i=[HE,GE,WE,VE,YE,XE];if(!(i.indexOf(t)!==-1&&(r&&(this===r||this.isAncestorOf&&this.isAncestorOf(r))||this.nodeType==="Stage"&&!r))){this._fire(t,n);const o=i.indexOf(t)!==-1&&r&&r.isAncestorOf&&r.isAncestorOf(this)&&!r.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!o&&(r&&r.parent?this._fireAndBubble.call(this.parent,t,n,r):this._fireAndBubble.call(this.parent,t,n))}}_getProtoListeners(t){var n,r,i;const a=(n=this._cache.get(O1))!==null&&n!==void 0?n:{};let o=a?.[t];if(o===void 0){o=[];let s=Object.getPrototypeOf(this);for(;s;){const u=(i=(r=s.eventListeners)===null||r===void 0?void 0:r[t])!==null&&i!==void 0?i:[];o.push(...u),s=Object.getPrototypeOf(s)}a[t]=o,this._cache.set(O1,a)}return o}_fire(t,n){n=n||{},n.currentTarget=this,n.type=t;const r=this._getProtoListeners(t);if(r)for(let a=0;a<r.length;a++)r[a].handler.call(this,n);const i=this.eventListeners[t];if(i)for(let a=0;a<i.length;a++)i[a].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){const n=t?t.pointerId:void 0,r=this.getStage(),i=this.getAbsolutePosition();if(!r)return;const a=r._getPointerById(n)||r._changedPointerPositions[0]||i;Sr._dragElements.set(this._id,{node:this,startPointerPos:a,offset:{x:a.x-i.x,y:a.y-i.y},dragStatus:"ready",pointerId:n})}startDrag(t,n=!0){Sr._dragElements.has(this._id)||this._createDragElement(t);const r=Sr._dragElements.get(this._id);r.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},n)}_setDragPosition(t,n){const r=this.getStage()._getPointerById(n.pointerId);if(!r)return;let i={x:r.x-n.offset.x,y:r.y-n.offset.y};const a=this.dragBoundFunc();if(a!==void 0){const o=a.call(this,i,t);o?i=o:Ze.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}stopDrag(t){const n=Sr._dragElements.get(this._id);n&&(n.dragStatus="stopped"),Sr._endDragBefore(t),Sr._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=Sr._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){if(!(!(t.evt.button!==void 0)||Ot.dragButtons.indexOf(t.evt.button)>=0)||this.isDragging())return;let i=!1;Sr._dragElements.forEach(a=>{this.isAncestorOf(a.node)&&(i=!0)}),i||this._createDragElement(t)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const n=Sr._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&Sr._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return Ze.haveIntersection(r,this.getClientRect())}static create(t,n){return Ze._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){let r=cv.prototype.getClassName.call(t),i=t.children,a,o,s;n&&(t.attrs.container=n),Ot[r]||(Ze.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const u=Ot[r];if(a=new u(t.attrs),i)for(o=i.length,s=0;s<o;s++)a.add(cv._createNode(i[s]));return a}};Pt.prototype.nodeType="Node";Pt.prototype._attrsAffectingSize=[];Pt.prototype.eventListeners={};Pt.prototype.on.call(Pt.prototype,ZE,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(cf),this._clearSelfAndDescendantCache(hc)});Pt.prototype.on.call(Pt.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(uv)});Pt.prototype.on.call(Pt.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(lv)});Pt.prototype.on.call(Pt.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(t0)});const Jr=Re.addGetterSetter;Jr(Pt,"zIndex");Jr(Pt,"absolutePosition");Jr(Pt,"position");Jr(Pt,"x",0,kt());Jr(Pt,"y",0,kt());Jr(Pt,"globalCompositeOperation","source-over",_h());Jr(Pt,"opacity",1,kt());Jr(Pt,"name","",_h());Jr(Pt,"id","",_h());Jr(Pt,"rotation",0,kt());Re.addComponentsGetterSetter(Pt,"scale",["x","y"]);Jr(Pt,"scaleX",1,kt());Jr(Pt,"scaleY",1,kt());Re.addComponentsGetterSetter(Pt,"skew",["x","y"]);Jr(Pt,"skewX",0,kt());Jr(Pt,"skewY",0,kt());Re.addComponentsGetterSetter(Pt,"offset",["x","y"]);Jr(Pt,"offsetX",0,kt());Jr(Pt,"offsetY",0,kt());Jr(Pt,"dragDistance",void 0,kt());Jr(Pt,"width",0,kt());Jr(Pt,"height",0,kt());Jr(Pt,"listening",!0,su());Jr(Pt,"preventDefault",!0,su());Jr(Pt,"filters",void 0,function(e){return this._filterUpToDate=!1,e});Jr(Pt,"visible",!0,su());Jr(Pt,"transformsEnabled","all",_h());Jr(Pt,"size");Jr(Pt,"dragBoundFunc");Jr(Pt,"draggable",!1,su());Re.backCompat(Pt,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class ul extends Pt{constructor(){super(...arguments),this.children=[]}getChildren(t){const n=this.children||[];return t?n.filter(t):n}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(let r=0;r<t.length;r++)this.add(t[r]);return this}const n=t[0];return n.getParent()?(n.moveTo(this),this):(this._validateAdd(n),n.index=this.getChildren().length,n.parent=this,n._clearCaches(),this.getChildren().push(n),this._fire("add",{child:n}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(t){return this._generalFind(t,!1)}findOne(t){const n=this._generalFind(t,!0);return n.length>0?n[0]:void 0}_generalFind(t,n){const r=[];return this._descendants(i=>{const a=i._isMatch(t);return a&&r.push(i),!!(a&&n)}),r}_descendants(t){let n=!1;const r=this.getChildren();for(const i of r){if(n=t(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(t),n))return!0}return!1}toObject(){const t=Pt.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(n=>{t.children.push(n.toObject())}),t}isAncestorOf(t){let n=t.getParent();for(;n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(t){const n=Pt.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){const n=[];return this.find("Shape").forEach(r=>{r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n,r){const i=this.getLayer(),a=t||i&&i.getCanvas(),o=a&&a.getContext(),s=this._getCanvasCache(),u=s&&s.scene,h=a&&a.isCache;if(!this.isVisible()&&!h)return this;if(u){o.save();const c=this.getAbsoluteTransform(n).getMatrix();o.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",a,n,r);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;const r=this.getLayer(),i=t||r&&r.hitCanvas,a=i&&i.getContext(),o=this._getCanvasCache();if(o&&o.hit){a.save();const u=this.getAbsoluteTransform(n).getMatrix();a.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedHitCanvas(a),a.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r,i){var a;const o=n&&n.getContext(),s=this.clipWidth(),u=this.clipHeight(),h=this.clipFunc(),c=typeof s=="number"&&typeof u=="number"||h,m=r===this;if(c){o.save();const d=this.getAbsoluteTransform(r);let y=d.getMatrix();o.transform(y[0],y[1],y[2],y[3],y[4],y[5]),o.beginPath();let _;if(h)_=h.call(this,o,this);else{const x=this.clipX(),b=this.clipY();o.rect(x||0,b||0,s,u)}o.clip.apply(o,_),y=d.copy().invert().getMatrix(),o.transform(y[0],y[1],y[2],y[3],y[4],y[5])}const g=!m&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";g&&(o.save(),o._applyGlobalCompositeOperation(this)),(a=this.children)===null||a===void 0||a.forEach(function(d){d[t](n,r,i)}),g&&o.restore(),c&&o.restore()}getClientRect(t={}){var n;const r=t.skipTransform,i=t.relativeTo;let a,o,s,u,h={x:1/0,y:1/0,width:0,height:0};const c=this;(n=this.children)===null||n===void 0||n.forEach(function(d){if(!d.visible())return;const y=d.getClientRect({relativeTo:c,skipShadow:t.skipShadow,skipStroke:t.skipStroke});y.width===0&&y.height===0||(a===void 0?(a=y.x,o=y.y,s=y.x+y.width,u=y.y+y.height):(a=Math.min(a,y.x),o=Math.min(o,y.y),s=Math.max(s,y.x+y.width),u=Math.max(u,y.y+y.height)))});const m=this.find("Shape");let g=!1;for(let d=0;d<m.length;d++)if(m[d]._isVisible(this)){g=!0;break}return g&&a!==void 0?h={x:a,y:o,width:s-a,height:u-o}:h={x:0,y:0,width:0,height:0},r?h:this._transformedRect(h,i)}}Re.addComponentsGetterSetter(ul,"clip",["x","y","width","height"]);Re.addGetterSetter(ul,"clipX",void 0,kt());Re.addGetterSetter(ul,"clipY",void 0,kt());Re.addGetterSetter(ul,"clipWidth",void 0,kt());Re.addGetterSetter(ul,"clipHeight",void 0,kt());Re.addGetterSetter(ul,"clipFunc");const Sp=new Map,o8=Ot._global.PointerEvent!==void 0;function Vg(e){return Sp.get(e)}function ny(e){return{evt:e,pointerId:e.pointerId}}function s8(e,t){return Sp.get(e)===t}function l8(e,t){up(e),t.getStage()&&(Sp.set(e,t),o8&&t._fire("gotpointercapture",ny(new PointerEvent("gotpointercapture"))))}function up(e,t){const n=Sp.get(e);if(!n)return;const r=n.getStage();r&&r.content,Sp.delete(e),o8&&n._fire("lostpointercapture",ny(new PointerEvent("lostpointercapture")))}const JE="Stage",ek="string",H5="px",tk="mouseout",u8="mouseleave",c8="mouseover",f8="mouseenter",h8="mousemove",d8="mousedown",p8="mouseup",Jd="pointermove",ep="pointerdown",id="pointerup",tp="pointercancel",nk="lostpointercapture",C1="pointerout",np="pointerleave",L1="pointerover",N1="pointerenter",fv="contextmenu",g8="touchstart",m8="touchend",v8="touchmove",y8="touchcancel",hv="wheel",rk=5,ik=[[f8,"_pointerenter"],[d8,"_pointerdown"],[h8,"_pointermove"],[p8,"_pointerup"],[u8,"_pointerleave"],[g8,"_pointerdown"],[v8,"_pointermove"],[m8,"_pointerup"],[y8,"_pointercancel"],[c8,"_pointerover"],[hv,"_wheel"],[fv,"_contextmenu"],[ep,"_pointerdown"],[Jd,"_pointermove"],[id,"_pointerup"],[tp,"_pointercancel"],[np,"_pointerleave"],[nk,"_lostpointercapture"]],Yg={mouse:{[C1]:tk,[np]:u8,[L1]:c8,[N1]:f8,[Jd]:h8,[ep]:d8,[id]:p8,[tp]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[C1]:"touchout",[np]:"touchleave",[L1]:"touchover",[N1]:"touchenter",[Jd]:v8,[ep]:g8,[id]:m8,[tp]:y8,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[C1]:C1,[np]:np,[L1]:L1,[N1]:N1,[Jd]:Jd,[ep]:ep,[id]:id,[tp]:tp,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},rp=e=>e.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",Yh=e=>{const t=rp(e);if(t==="pointer")return Ot.pointerEventsEnabled&&Yg.pointer;if(t==="touch")return Yg.touch;if(t==="mouse")return Yg.mouse};function G5(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&Ze.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const ak="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);",cp=[];let K0=class extends ul{constructor(t){super(G5(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),cp.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{G5(this.attrs)}),this._checkVisibility()}_validateAdd(t){const n=t.getType()==="Layer",r=t.getType()==="FastLayer";n||r||Ze.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const t=this.visible()?"":"none";this.content.style.display=t}setContainer(t){if(typeof t===ek){let n;if(t.charAt(0)==="."){const r=t.slice(1);t=document.getElementsByClassName(r)[0]}else t.charAt(0)!=="#"?n=t:n=t.slice(1),t=document.getElementById(n);if(!t)throw"Can not find container in document with id "+n}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const t=this.children,n=t.length;for(let r=0;r<n;r++)t[r].clear();return this}clone(t){return t||(t={}),t.container=typeof document<"u"&&document.createElement("div"),ul.prototype.clone.call(this,t)}destroy(){super.destroy();const t=this.content;t&&Ze._isInDocument(t)&&this.container().removeChild(t);const n=cp.indexOf(this);return n>-1&&cp.splice(n,1),Ze.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(Ze.warn(ak),null)}_getPointerById(t){return this._pointerPositions.find(n=>n.id===t)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(t){t={...t},t.x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();const n=new hf({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),r=n.getContext()._context,i=this.children;return(t.x||t.y)&&r.translate(-1*t.x,-1*t.y),i.forEach(function(a){if(!a.isVisible())return;const o=a._toKonvaCanvas(t);r.drawImage(o._canvas,t.x,t.y,o.getWidth()/o.getPixelRatio(),o.getHeight()/o.getPixelRatio())}),n}getIntersection(t){if(!t)return null;const n=this.children,r=n.length,i=r-1;for(let a=i;a>=0;a--){const o=n[a].getIntersection(t);if(o)return o}return null}_resizeDOM(){const t=this.width(),n=this.height();this.content&&(this.content.style.width=t+H5,this.content.style.height=n+H5),this.bufferCanvas.setSize(t,n),this.bufferHitCanvas.setSize(t,n),this.children.forEach(r=>{r.setSize({width:t,height:n}),r.draw()})}add(t,...n){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.add(arguments[i]);return this}super.add(t);const r=this.children.length;return r>rk&&Ze.warn("The stage has "+r+" 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."),t.setSize({width:this.width(),height:this.height()}),t.draw(),Ot.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return s8(t,this)}setPointerCapture(t){l8(t,this)}releaseCapture(t){up(t)}getLayers(){return this.children}_bindContentEvents(){Ot.isBrowser&&ik.forEach(([t,n])=>{this.content.addEventListener(t,r=>{this[n](r)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const n=Yh(t.type);n&&this._fire(n.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const n=Yh(t.type);n&&this._fire(n.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let n=this[t+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(t){const n=Yh(t.type),r=rp(t.type);if(!n)return;this.setPointersPositions(t);const i=this._getTargetShape(r),a=!(Ot.isDragging()||Ot.isTransforming())||Ot.hitOnDragEnabled;i&&a?(i._fireAndBubble(n.pointerout,{evt:t}),i._fireAndBubble(n.pointerleave,{evt:t}),this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this[r+"targetShape"]=null):a&&(this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(t){const n=Yh(t.type),r=rp(t.type);if(!n)return;this.setPointersPositions(t);let i=!1;this._changedPointerPositions.forEach(a=>{const o=this.getIntersection(a);if(Sr.justDragged=!1,Ot["_"+r+"ListenClick"]=!0,!o||!o.isListening()){this[r+"ClickStartShape"]=void 0;return}Ot.capturePointerEventsEnabled&&o.setPointerCapture(a.id),this[r+"ClickStartShape"]=o,o._fireAndBubble(n.pointerdown,{evt:t,pointerId:a.id}),i=!0;const s=t.type.indexOf("touch")>=0;o.preventDefault()&&t.cancelable&&s&&t.preventDefault()}),i||this._fire(n.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(t){const n=Yh(t.type),r=rp(t.type);if(!n)return;const i=t.type.indexOf("touch")>=0||t.pointerType==="touch";if(Ot.isDragging()&&Sr.node.preventDefault()&&t.cancelable&&i&&t.preventDefault(),this.setPointersPositions(t),!(!(Ot.isDragging()||Ot.isTransforming())||Ot.hitOnDragEnabled))return;const o={};let s=!1;const u=this._getTargetShape(r);this._changedPointerPositions.forEach(h=>{const c=Vg(h.id)||this.getIntersection(h),m=h.id,g={evt:t,pointerId:m},d=u!==c;if(d&&u&&(u._fireAndBubble(n.pointerout,{...g},c),u._fireAndBubble(n.pointerleave,{...g},c)),c){if(o[c._id])return;o[c._id]=!0}c&&c.isListening()?(s=!0,d&&(c._fireAndBubble(n.pointerover,{...g},u),c._fireAndBubble(n.pointerenter,{...g},u),this[r+"targetShape"]=c),c._fireAndBubble(n.pointermove,{...g})):u&&(this._fire(n.pointerover,{evt:t,target:this,currentTarget:this,pointerId:m}),this[r+"targetShape"]=null)}),s||this._fire(n.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const n=Yh(t.type),r=rp(t.type);if(!n)return;this.setPointersPositions(t);const i=this[r+"ClickStartShape"],a=this[r+"ClickEndShape"],o={};let s=!1;this._changedPointerPositions.forEach(u=>{const h=Vg(u.id)||this.getIntersection(u);if(h){if(h.releaseCapture(u.id),o[h._id])return;o[h._id]=!0}const c=u.id,m={evt:t,pointerId:c};let g=!1;Ot["_"+r+"InDblClickWindow"]?(g=!0,clearTimeout(this[r+"DblTimeout"])):Sr.justDragged||(Ot["_"+r+"InDblClickWindow"]=!0,clearTimeout(this[r+"DblTimeout"])),this[r+"DblTimeout"]=setTimeout(function(){Ot["_"+r+"InDblClickWindow"]=!1},Ot.dblClickWindow),h&&h.isListening()?(s=!0,this[r+"ClickEndShape"]=h,h._fireAndBubble(n.pointerup,{...m}),Ot["_"+r+"ListenClick"]&&i&&i===h&&(h._fireAndBubble(n.pointerclick,{...m}),g&&a&&a===h&&h._fireAndBubble(n.pointerdblclick,{...m}))):(this[r+"ClickEndShape"]=null,s||(this._fire(n.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),s=!0),Ot["_"+r+"ListenClick"]&&this._fire(n.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:c}),g&&this._fire(n.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:c}))}),s||this._fire(n.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),Ot["_"+r+"ListenClick"]=!1,t.cancelable&&r!=="touch"&&r!=="pointer"&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);const n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(fv,{evt:t}):this._fire(fv,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);const n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(hv,{evt:t}):this._fire(hv,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const n=Vg(t.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(id,ny(t)),up(t.pointerId)}_lostpointercapture(t){up(t.pointerId)}setPointersPositions(t){const n=this._getContentPosition();let r=null,i=null;t=t||window.event,t.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,a=>{this._pointerPositions.push({id:a.identifier,x:(a.clientX-n.left)/n.scaleX,y:(a.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,a=>{this._changedPointerPositions.push({id:a.identifier,x:(a.clientX-n.left)/n.scaleX,y:(a.clientY-n.top)/n.scaleY})})):(r=(t.clientX-n.left)/n.scaleX,i=(t.clientY-n.top)/n.scaleY,this.pointerPos={x:r,y:i},this._pointerPositions=[{x:r,y:i,id:Ze._getFirstPointerId(t)}],this._changedPointerPositions=[{x:r,y:i,id:Ze._getFirstPointerId(t)}])}_setPointerPosition(t){Ze.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new hf({width:this.width(),height:this.height()}),this.bufferHitCanvas=new ey({pixelRatio:1,width:this.width(),height:this.height()}),!Ot.isBrowser)return;const t=this.container();if(!t)throw"Stage has no container. A container is required.";t.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"),t.appendChild(this.content),this._resizeDOM()}cache(){return Ze.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(t){t.batchDraw()}),this}};K0.prototype.nodeType=JE;Bi(K0);Re.addGetterSetter(K0,"container");Ot.isBrowser&&document.addEventListener("visibilitychange",()=>{cp.forEach(e=>{e.batchDraw()})});const b8="hasShadow",w8="shadowRGBA",x8="patternImage",_8="linearGradient",S8="radialGradient";let T1;function Xg(){return T1||(T1=Ze.createCanvasElement().getContext("2d"),T1)}const fp={};function ok(e){const t=this.attrs.fillRule;t?e.fill(t):e.fill()}function sk(e){e.stroke()}function lk(e){const t=this.attrs.fillRule;t?e.fill(t):e.fill()}function uk(e){e.stroke()}function ck(){this._clearCache(b8)}function fk(){this._clearCache(w8)}function hk(){this._clearCache(x8)}function dk(){this._clearCache(_8)}function pk(){this._clearCache(S8)}let wt=class extends Pt{constructor(t){super(t);let n,r=0;for(;n=Ze.getHitColor(),!(n&&!(n in fp));)if(r++,r>=1e4){Ze.warn("Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it."),n=Ze.getRandomColor();break}this.colorKey=n,fp[n]=this}getContext(){return Ze.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return Ze.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(b8,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(x8,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const n=Xg().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const r=new sl;r.translate(this.fillPatternX(),this.fillPatternY()),r.rotate(Ot.getAngle(this.fillPatternRotation())),r.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),r.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=r.getMatrix(),a=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);n.setTransform(a)}return n}}_getLinearGradient(){return this._getCache(_8,this.__getLinearGradient)}__getLinearGradient(){const t=this.fillLinearGradientColorStops();if(t){const n=Xg(),r=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),a=n.createLinearGradient(r.x,r.y,i.x,i.y);for(let o=0;o<t.length;o+=2)a.addColorStop(t[o],t[o+1]);return a}}_getRadialGradient(){return this._getCache(S8,this.__getRadialGradient)}__getRadialGradient(){const t=this.fillRadialGradientColorStops();if(t){const n=Xg(),r=this.fillRadialGradientStartPoint(),i=this.fillRadialGradientEndPoint(),a=n.createRadialGradient(r.x,r.y,this.fillRadialGradientStartRadius(),i.x,i.y,this.fillRadialGradientEndRadius());for(let o=0;o<t.length;o+=2)a.addColorStop(t[o],t[o+1]);return a}}getShadowRGBA(){return this._getCache(w8,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const t=Ze.colorToRGBA(this.shadowColor());if(t)return"rgba("+t.r+","+t.g+","+t.b+","+t.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 t=this.hitStrokeWidth();return t==="auto"?this.hasStroke():this.strokeEnabled()&&!!t}intersects(t){const n=this.getStage();if(!n)return!1;const r=n.bufferHitCanvas;return r.getContext().clear(),this.drawHit(r,void 0,!0),r.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data[3]>0}destroy(){return Pt.prototype.destroy.call(this),delete fp[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var n;if(!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const i=t||this.hasFill(),a=this.hasStroke(),o=this.getAbsoluteOpacity()!==1;if(i&&a&&o)return!0;const s=this.hasShadow(),u=this.shadowForStrokeEnabled();return!!(i&&a&&s&&u)}setStrokeHitEnabled(t){Ze.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}}getClientRect(t={}){let n=!1,r=this.getParent();for(;r;){if(r.isCached()){n=!0;break}r=r.getParent()}const i=t.skipTransform,a=t.relativeTo||n&&this.getStage()||void 0,o=this.getSelfRect(),u=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,h=o.width+u,c=o.height+u,m=!t.skipShadow&&this.hasShadow(),g=m?this.shadowOffsetX():0,d=m?this.shadowOffsetY():0,y=h+Math.abs(g),_=c+Math.abs(d),x=m&&this.shadowBlur()||0,b=y+x*2,S=_+x*2,k={width:b,height:S,x:-(u/2+x)+Math.min(g,0)+o.x,y:-(u/2+x)+Math.min(d,0)+o.y};return i?k:this._transformedRect(k,a)}drawScene(t,n,r){const i=this.getLayer(),a=t||i.getCanvas(),o=a.getContext(),s=this._getCanvasCache(),u=this.getSceneFunc(),h=this.hasShadow();let c;const m=n===this;if(!this.isVisible()&&!m)return this;if(s){o.save();const g=this.getAbsoluteTransform(n).getMatrix();return o.transform(g[0],g[1],g[2],g[3],g[4],g[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!u)return this;if(o.save(),this._useBufferCanvas()){c=this.getStage();const g=r||c.bufferCanvas,d=g.getContext();d.clear(),d.save(),d._applyLineJoin(this),d._applyMiterLimit(this);const y=this.getAbsoluteTransform(n).getMatrix();d.transform(y[0],y[1],y[2],y[3],y[4],y[5]),u.call(this,d,this),d.restore();const _=g.pixelRatio;h&&o._applyShadow(this),m||(o._applyOpacity(this),o._applyGlobalCompositeOperation(this)),o.drawImage(g._canvas,g.x||0,g.y||0,g.width/_,g.height/_)}else{if(o._applyLineJoin(this),o._applyMiterLimit(this),!m){const g=this.getAbsoluteTransform(n).getMatrix();o.transform(g[0],g[1],g[2],g[3],g[4],g[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)}h&&o._applyShadow(this),u.call(this,o,this)}return o.restore(),this}drawHit(t,n,r=!1){if(!this.shouldDrawHit(n,r))return this;const i=this.getLayer(),a=t||i.hitCanvas,o=a&&a.getContext(),s=this.hitFunc()||this.sceneFunc(),u=this._getCanvasCache(),h=u&&u.hit;if(this.colorKey||Ze.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),h){o.save();const m=this.getAbsoluteTransform(n).getMatrix();return o.transform(m[0],m[1],m[2],m[3],m[4],m[5]),this._drawCachedHitCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),o._applyLineJoin(this),o._applyMiterLimit(this),!(this===n)){const m=this.getAbsoluteTransform(n).getMatrix();o.transform(m[0],m[1],m[2],m[3],m[4],m[5])}return s.call(this,o,this),o.restore(),this}drawHitFromCache(t=0){const n=this._getCanvasCache(),r=this._getCachedSceneCanvas(),i=n.hit,a=i.getContext(),o=i.getWidth(),s=i.getHeight();a.clear(),a.drawImage(r._canvas,0,0,o,s);try{const u=a.getImageData(0,0,o,s),h=u.data,c=h.length,m=Ze._hexToRgb(this.colorKey);for(let g=0;g<c;g+=4)h[g+3]>t?(h[g]=m.r,h[g+1]=m.g,h[g+2]=m.b,h[g+3]=255):h[g+3]=0;a.putImageData(u,0,0)}catch(u){Ze.error("Unable to draw hit graph from cached scene canvas. "+u.message)}return this}hasPointerCapture(t){return s8(t,this)}setPointerCapture(t){l8(t,this)}releaseCapture(t){up(t)}};wt.prototype._fillFunc=ok;wt.prototype._strokeFunc=sk;wt.prototype._fillFuncHit=lk;wt.prototype._strokeFuncHit=uk;wt.prototype._centroid=!1;wt.prototype.nodeType="Shape";Bi(wt);wt.prototype.eventListeners={};wt.prototype.on.call(wt.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",ck);wt.prototype.on.call(wt.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",fk);wt.prototype.on.call(wt.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",hk);wt.prototype.on.call(wt.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",dk);wt.prototype.on.call(wt.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",pk);Re.addGetterSetter(wt,"stroke",void 0,a8());Re.addGetterSetter(wt,"strokeWidth",2,kt());Re.addGetterSetter(wt,"fillAfterStrokeEnabled",!1);Re.addGetterSetter(wt,"hitStrokeWidth","auto",ty());Re.addGetterSetter(wt,"strokeHitEnabled",!0,su());Re.addGetterSetter(wt,"perfectDrawEnabled",!0,su());Re.addGetterSetter(wt,"shadowForStrokeEnabled",!0,su());Re.addGetterSetter(wt,"lineJoin");Re.addGetterSetter(wt,"lineCap");Re.addGetterSetter(wt,"miterLimit");Re.addGetterSetter(wt,"sceneFunc");Re.addGetterSetter(wt,"hitFunc");Re.addGetterSetter(wt,"dash");Re.addGetterSetter(wt,"dashOffset",0,kt());Re.addGetterSetter(wt,"shadowColor",void 0,_h());Re.addGetterSetter(wt,"shadowBlur",0,kt());Re.addGetterSetter(wt,"shadowOpacity",1,kt());Re.addComponentsGetterSetter(wt,"shadowOffset",["x","y"]);Re.addGetterSetter(wt,"shadowOffsetX",0,kt());Re.addGetterSetter(wt,"shadowOffsetY",0,kt());Re.addGetterSetter(wt,"fillPatternImage");Re.addGetterSetter(wt,"fill",void 0,a8());Re.addGetterSetter(wt,"fillPatternX",0,kt());Re.addGetterSetter(wt,"fillPatternY",0,kt());Re.addGetterSetter(wt,"fillLinearGradientColorStops");Re.addGetterSetter(wt,"strokeLinearGradientColorStops");Re.addGetterSetter(wt,"fillRadialGradientStartRadius",0);Re.addGetterSetter(wt,"fillRadialGradientEndRadius",0);Re.addGetterSetter(wt,"fillRadialGradientColorStops");Re.addGetterSetter(wt,"fillPatternRepeat","repeat");Re.addGetterSetter(wt,"fillEnabled",!0);Re.addGetterSetter(wt,"strokeEnabled",!0);Re.addGetterSetter(wt,"shadowEnabled",!0);Re.addGetterSetter(wt,"dashEnabled",!0);Re.addGetterSetter(wt,"strokeScaleEnabled",!0);Re.addGetterSetter(wt,"fillPriority","color");Re.addComponentsGetterSetter(wt,"fillPatternOffset",["x","y"]);Re.addGetterSetter(wt,"fillPatternOffsetX",0,kt());Re.addGetterSetter(wt,"fillPatternOffsetY",0,kt());Re.addComponentsGetterSetter(wt,"fillPatternScale",["x","y"]);Re.addGetterSetter(wt,"fillPatternScaleX",1,kt());Re.addGetterSetter(wt,"fillPatternScaleY",1,kt());Re.addComponentsGetterSetter(wt,"fillLinearGradientStartPoint",["x","y"]);Re.addComponentsGetterSetter(wt,"strokeLinearGradientStartPoint",["x","y"]);Re.addGetterSetter(wt,"fillLinearGradientStartPointX",0);Re.addGetterSetter(wt,"strokeLinearGradientStartPointX",0);Re.addGetterSetter(wt,"fillLinearGradientStartPointY",0);Re.addGetterSetter(wt,"strokeLinearGradientStartPointY",0);Re.addComponentsGetterSetter(wt,"fillLinearGradientEndPoint",["x","y"]);Re.addComponentsGetterSetter(wt,"strokeLinearGradientEndPoint",["x","y"]);Re.addGetterSetter(wt,"fillLinearGradientEndPointX",0);Re.addGetterSetter(wt,"strokeLinearGradientEndPointX",0);Re.addGetterSetter(wt,"fillLinearGradientEndPointY",0);Re.addGetterSetter(wt,"strokeLinearGradientEndPointY",0);Re.addComponentsGetterSetter(wt,"fillRadialGradientStartPoint",["x","y"]);Re.addGetterSetter(wt,"fillRadialGradientStartPointX",0);Re.addGetterSetter(wt,"fillRadialGradientStartPointY",0);Re.addComponentsGetterSetter(wt,"fillRadialGradientEndPoint",["x","y"]);Re.addGetterSetter(wt,"fillRadialGradientEndPointX",0);Re.addGetterSetter(wt,"fillRadialGradientEndPointY",0);Re.addGetterSetter(wt,"fillPatternRotation",0);Re.addGetterSetter(wt,"fillRule",void 0,_h());Re.backCompat(wt,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});const gk="beforeDraw",mk="draw",E8=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],vk=E8.length;let Sh=class extends ul{constructor(t){super(t),this.canvas=new hf,this.hitCanvas=new ey({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);const n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),t<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[t+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){Pt.prototype.moveToTop.call(this);const t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!Pt.prototype.moveUp.call(this))return!1;const n=this.getStage();return!n||!n.content?!1:(n.content.removeChild(this.getNativeCanvasElement()),this.index<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[this.index+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(Pt.prototype.moveDown.call(this)){const t=this.getStage();if(t){const n=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),n[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(Pt.prototype.moveToBottom.call(this)){const t=this.getStage();if(t){const n=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),n[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const t=this.getNativeCanvasElement();return Pt.prototype.remove.call(this),t&&t.parentNode&&Ze._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:n}){return this.canvas.setSize(t,n),this.hitCanvas.setSize(t,n),this._setSmoothEnabled(),this}_validateAdd(t){const n=t.getType();n!=="Group"&&n!=="Shape"&&Ze.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return t={...t},t.width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=t.x!==void 0?t.x:this.x(),t.y=t.y!==void 0?t.y:this.y(),Pt.prototype._toKonvaCanvas.call(this,t)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){Ze.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){Ze.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,Ze.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;let n=1,r=!1;for(;;){for(let i=0;i<vk;i++){const a=E8[i],o=this._getIntersection({x:t.x+a.x*n,y:t.y+a.y*n}),s=o.shape;if(s)return s;if(r=!!o.antialiased,!o.antialiased)break}if(r)n+=1;else return null}}_getIntersection(t){const n=this.hitCanvas.pixelRatio,r=this.hitCanvas.context.getImageData(Math.round(t.x*n),Math.round(t.y*n),1,1).data,i=r[3];if(i===255){const a=Ze.getHitColorKey(r[0],r[1],r[2]),o=fp[a];return o?{shape:o}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(t,n,r){const i=this.getLayer(),a=t||i&&i.getCanvas();return this._fire(gk,{node:this}),this.clearBeforeDraw()&&a.getContext().clear(),ul.prototype.drawScene.call(this,a,n,r),this._fire(mk,{node:this}),this}drawHit(t,n){const r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),ul.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){Ze.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return Ze.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const t=this.parent;!!this.hitCanvas._canvas.parentNode?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}destroy(){return Ze.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};Sh.prototype.nodeType="Layer";Bi(Sh);Re.addGetterSetter(Sh,"imageSmoothingEnabled",!0);Re.addGetterSetter(Sh,"clearBeforeDraw",!0);Re.addGetterSetter(Sh,"hitGraphEnabled",!0,su());class ry extends Sh{constructor(t){super(t),this.listening(!1),Ze.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}ry.prototype.nodeType="FastLayer";Bi(ry);let yd=class extends ul{_validateAdd(t){const n=t.getType();n!=="Group"&&n!=="Shape"&&Ze.throw("You may only add groups and shapes to groups.")}};yd.prototype.nodeType="Group";Bi(yd);const Kg=(function(){return nh.performance&&nh.performance.now?function(){return nh.performance.now()}:function(){return new Date().getTime()}})();let kd=class Jh{constructor(t,n){this.id=Jh.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Kg(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){let n=[];return t&&(n=Array.isArray(t)?t:[t]),this.layers=n,this}getLayers(){return this.layers}addLayer(t){const n=this.layers,r=n.length;for(let i=0;i<r;i++)if(n[i]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){const n=Jh.animations,r=n.length;for(let i=0;i<r;i++)if(n[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=Kg(),Jh._addAnimation(this),this}stop(){return Jh._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){const n=t.id,r=this.animations,i=r.length;for(let a=0;a<i;a++)if(r[a].id===n){this.animations.splice(a,1);break}}static _runFrames(){const t={},n=this.animations;for(let r=0;r<n.length;r++){const i=n[r],a=i.layers,o=i.func;i._updateFrameObject(Kg());const s=a.length;let u;if(o?u=o.call(i,i.frame)!==!1:u=!0,!!u)for(let h=0;h<s;h++){const c=a[h];c._id!==void 0&&(t[c._id]=c)}}for(const r in t)t.hasOwnProperty(r)&&t[r].batchDraw()}static _animationLoop(){const t=Jh;t.animations.length?(t._runFrames(),Ze.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,Ze.requestAnimFrame(this._animationLoop))}};kd.animations=[];kd.animIdCounter=0;kd.animRunning=!1;const yk={node:1,duration:1,easing:1,onFinish:1,yoyo:1},bk=1,W5=2,V5=3,Y5=["fill","stroke","shadowColor"];let wk=0;class xk{constructor(t,n,r,i,a,o,s){this.prop=t,this.propFunc=n,this.begin=i,this._pos=i,this.duration=o,this._change=0,this.prevPos=0,this.yoyo=s,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=r,this._change=a-this.begin,this.pause()}fire(t){const n=this[t];n&&n()}setTime(t){t>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())}getTime(){return this._time}setPosition(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t}getPosition(t){return t===void 0&&(t=this._time),this.func(t,this.begin,this._change,this.duration)}play(){this.state=W5,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=V5,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(t){this.pause(),this._time=t,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 t=this.getTimer()-this._startTime;this.state===W5?this.setTime(t):this.state===V5&&this.setTime(this.duration-t)}pause(){this.state=bk,this.fire("onPause")}getTimer(){return new Date().getTime()}}class oi{constructor(t){const n=this,r=t.node,i=r._id,a=t.easing||hp.Linear,o=!!t.yoyo;let s,u;typeof t.duration>"u"?s=.3:t.duration===0?s=.001:s=t.duration,this.node=r,this._id=wk++;const h=r.getLayer()||(r instanceof Ot.Stage?r.getLayers():null);h||Ze.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new kd(function(){n.tween.onEnterFrame()},h),this.tween=new xk(u,function(c){n._tweenFunc(c)},a,0,1,s*1e3,o),this._addListeners(),oi.attrs[i]||(oi.attrs[i]={}),oi.attrs[i][this._id]||(oi.attrs[i][this._id]={}),oi.tweens[i]||(oi.tweens[i]={});for(u in t)yk[u]===void 0&&this._addAttr(u,t[u]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,n){const r=this.node,i=r._id;let a,o,s,u,h;const c=oi.tweens[i][t];c&&delete oi.attrs[i][c][t];let m=r.getAttr(t);if(Ze._isArray(n))if(a=[],o=Math.max(n.length,m.length),t==="points"&&n.length!==m.length&&(n.length>m.length?(u=m,m=Ze._prepareArrayForTween(m,n,r.closed())):(s=n,n=Ze._prepareArrayForTween(n,m,r.closed()))),t.indexOf("fill")===0)for(let g=0;g<o;g++)if(g%2===0)a.push(n[g]-m[g]);else{const d=Ze.colorToRGBA(m[g]);h=Ze.colorToRGBA(n[g]),m[g]=d,a.push({r:h.r-d.r,g:h.g-d.g,b:h.b-d.b,a:h.a-d.a})}else for(let g=0;g<o;g++)a.push(n[g]-m[g]);else Y5.indexOf(t)!==-1?(m=Ze.colorToRGBA(m),h=Ze.colorToRGBA(n),a={r:h.r-m.r,g:h.g-m.g,b:h.b-m.b,a:h.a-m.a}):a=n-m;oi.attrs[i][this._id][t]={start:m,diff:a,end:n,trueEnd:s,trueStart:u},oi.tweens[i][t]=this._id}_tweenFunc(t){const n=this.node,r=oi.attrs[n._id][this._id];let i,a,o,s,u,h,c,m;for(i in r){if(a=r[i],o=a.start,s=a.diff,m=a.end,Ze._isArray(o))if(u=[],c=Math.max(o.length,m.length),i.indexOf("fill")===0)for(h=0;h<c;h++)h%2===0?u.push((o[h]||0)+s[h]*t):u.push("rgba("+Math.round(o[h].r+s[h].r*t)+","+Math.round(o[h].g+s[h].g*t)+","+Math.round(o[h].b+s[h].b*t)+","+(o[h].a+s[h].a*t)+")");else for(h=0;h<c;h++)u.push((o[h]||0)+s[h]*t);else Y5.indexOf(i)!==-1?u="rgba("+Math.round(o.r+s.r*t)+","+Math.round(o.g+s.g*t)+","+Math.round(o.b+s.b*t)+","+(o.a+s.a*t)+")":u=o+s*t;n.setAttr(i,u)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const t=this.node,n=oi.attrs[t._id][this._id];n.points&&n.points.trueEnd&&t.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const t=this.node,n=oi.attrs[t._id][this._id];n.points&&n.points.trueStart&&t.points(n.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(t){return this.tween.seek(t*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const t=this.node._id,n=this._id,r=oi.tweens[t];this.pause(),this.anim&&this.anim.stop();for(const i in r)delete oi.tweens[t][i];delete oi.attrs[t][n],oi.tweens[t]&&(Object.keys(oi.tweens[t]).length===0&&delete oi.tweens[t],Object.keys(oi.attrs[t]).length===0&&delete oi.attrs[t])}}oi.attrs={};oi.tweens={};Pt.prototype.to=function(e){const t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()},new oi(e).play()};const hp={BackEaseIn(e,t,n,r){return n*(e/=r)*e*((1.70158+1)*e-1.70158)+t},BackEaseOut(e,t,n,r){return n*((e=e/r-1)*e*((1.70158+1)*e+1.70158)+1)+t},BackEaseInOut(e,t,n,r){let i=1.70158;return(e/=r/2)<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,a){let o=0;return e===0?t:(e/=r)===1?t+n:(a||(a=r*.3),!i||i<Math.abs(n)?(i=n,o=a/4):o=a/(2*Math.PI)*Math.asin(n/i),-(i*Math.pow(2,10*(e-=1))*Math.sin((e*r-o)*(2*Math.PI)/a))+t)},ElasticEaseOut(e,t,n,r,i,a){let o=0;return e===0?t:(e/=r)===1?t+n:(a||(a=r*.3),!i||i<Math.abs(n)?(i=n,o=a/4):o=a/(2*Math.PI)*Math.asin(n/i),i*Math.pow(2,-10*e)*Math.sin((e*r-o)*(2*Math.PI)/a)+n+t)},ElasticEaseInOut(e,t,n,r,i,a){let o=0;return e===0?t:(e/=r/2)===2?t+n:(a||(a=r*(.3*1.5)),!i||i<Math.abs(n)?(i=n,o=a/4):o=a/(2*Math.PI)*Math.asin(n/i),e<1?-.5*(i*Math.pow(2,10*(e-=1))*Math.sin((e*r-o)*(2*Math.PI)/a))+t:i*Math.pow(2,-10*(e-=1))*Math.sin((e*r-o)*(2*Math.PI)/a)*.5+n+t)},BounceEaseOut(e,t,n,r){return(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t},BounceEaseIn(e,t,n,r){return n-hp.BounceEaseOut(r-e,0,n,r)+t},BounceEaseInOut(e,t,n,r){return e<r/2?hp.BounceEaseIn(e*2,0,n,r)*.5+t:hp.BounceEaseOut(e*2-r,0,n,r)*.5+n*.5+t},EaseIn(e,t,n,r){return n*(e/=r)*e+t},EaseOut(e,t,n,r){return-n*(e/=r)*(e-2)+t},EaseInOut(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t},StrongEaseIn(e,t,n,r){return n*(e/=r)*e*e*e*e+t},StrongEaseOut(e,t,n,r){return n*((e=e/r-1)*e*e*e*e+1)+t},StrongEaseInOut(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t},Linear(e,t,n,r){return n*e/r+t}},hh=Ze._assign(Ot,{Util:Ze,Transform:sl,Node:Pt,Container:ul,Stage:K0,stages:cp,Layer:Sh,FastLayer:ry,Group:yd,DD:Sr,Shape:wt,shapes:fp,Animation:kd,Tween:oi,Easings:hp,Context:Y0,Canvas:Jv});let kc=class extends wt{_sceneFunc(t){const n=Ot.getAngle(this.angle()),r=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,n,r),t.arc(0,0,this.innerRadius(),n,0,!r),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}getSelfRect(){const t=this.innerRadius(),n=this.outerRadius(),r=this.clockwise(),i=Ot.getAngle(r?360-this.angle():this.angle()),a=Math.cos(Math.min(i,Math.PI)),o=1,s=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),u=Math.sin(Math.min(i,Math.PI/2)),h=a*(a>0?t:n),c=o*n,m=s*(s>0?t:n),g=u*(u>0?n:t);return{x:h,y:r?-1*g:m,width:c-h,height:g-m}}};kc.prototype._centroid=!0;kc.prototype.className="Arc";kc.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"];Bi(kc);Re.addGetterSetter(kc,"innerRadius",0,kt());Re.addGetterSetter(kc,"outerRadius",0,kt());Re.addGetterSetter(kc,"angle",0,kt());Re.addGetterSetter(kc,"clockwise",!1,su());function dv(e,t,n,r,i,a,o){const s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),u=Math.sqrt(Math.pow(i-n,2)+Math.pow(a-r,2)),h=o*s/(s+u),c=o*u/(s+u),m=n-h*(i-e),g=r-h*(a-t),d=n+c*(i-e),y=r+c*(a-t);return[m,g,d,y]}function X5(e,t){const n=e.length,r=[];for(let i=2;i<n-2;i+=2){const a=dv(e[i-2],e[i-1],e[i],e[i+1],e[i+2],e[i+3],t);isNaN(a[0])||(r.push(a[0]),r.push(a[1]),r.push(e[i]),r.push(e[i+1]),r.push(a[2]),r.push(a[3]))}return r}let Ac=class extends wt{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){const n=this.points(),r=n.length,i=this.tension(),a=this.closed(),o=this.bezier();if(!r)return;let s=0;if(t.beginPath(),t.moveTo(n[0],n[1]),i!==0&&r>4){const u=this.getTensionPoints(),h=u.length;for(s=a?0:4,a||t.quadraticCurveTo(u[0],u[1],u[2],u[3]);s<h-2;)t.bezierCurveTo(u[s++],u[s++],u[s++],u[s++],u[s++],u[s++]);a||t.quadraticCurveTo(u[h-2],u[h-1],n[r-2],n[r-1])}else if(o)for(s=2;s<r;)t.bezierCurveTo(n[s++],n[s++],n[s++],n[s++],n[s++],n[s++]);else for(s=2;s<r;s+=2)t.lineTo(n[s],n[s+1]);a?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():X5(this.points(),this.tension())}_getTensionPointsClosed(){const t=this.points(),n=t.length,r=this.tension(),i=dv(t[n-2],t[n-1],t[0],t[1],t[2],t[3],r),a=dv(t[n-4],t[n-3],t[n-2],t[n-1],t[0],t[1],r),o=X5(t,r);return[i[2],i[3]].concat(o).concat([a[0],a[1],t[n-2],t[n-1],a[2],a[3],i[0],i[1],t[0],t[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};this.tension()!==0?t=[t[0],t[1],...this._getTensionPoints(),t[t.length-2],t[t.length-1]]:t=this.points();let n=t[0],r=t[0],i=t[1],a=t[1],o,s;for(let u=0;u<t.length/2;u++)o=t[u*2],s=t[u*2+1],n=Math.min(n,o),r=Math.max(r,o),i=Math.min(i,s),a=Math.max(a,s);return{x:n,y:i,width:r-n,height:a-i}}};Ac.prototype.className="Line";Ac.prototype._attrsAffectingSize=["points","bezier","tension"];Bi(Ac);Re.addGetterSetter(Ac,"closed",!1);Re.addGetterSetter(Ac,"bezier",!1);Re.addGetterSetter(Ac,"tension",0,kt());Re.addGetterSetter(Ac,"points",[],FE());const _k=[[],[],[-.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]],Sk=[[],[],[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]],Ek=[[1],[1,1],[1,2,1],[1,3,3,1]],K5=(e,t,n)=>{let r,i;const o=n/2;r=0;for(let s=0;s<20;s++)i=o*_k[20][s]+o,r+=Sk[20][s]*kk(e,t,i);return o*r},Z5=(e,t,n)=>{n===void 0&&(n=1);const r=e[0]-2*e[1]+e[2],i=t[0]-2*t[1]+t[2],a=2*e[1]-2*e[0],o=2*t[1]-2*t[0],s=4*(r*r+i*i),u=4*(r*a+i*o),h=a*a+o*o;if(s===0)return n*Math.sqrt(Math.pow(e[2]-e[0],2)+Math.pow(t[2]-t[0],2));const c=u/(2*s),m=h/s,g=n+c,d=m-c*c,y=g*g+d>0?Math.sqrt(g*g+d):0,_=c*c+d>0?Math.sqrt(c*c+d):0,x=c+Math.sqrt(c*c+d)!==0?d*Math.log(Math.abs((g+y)/(c+_))):0;return Math.sqrt(s)/2*(g*y-c*_+x)};function kk(e,t,n){const r=pv(1,n,e),i=pv(1,n,t),a=r*r+i*i;return Math.sqrt(a)}const pv=(e,t,n)=>{const r=n.length-1;let i,a;if(r===0)return 0;if(e===0){a=0;for(let o=0;o<=r;o++)a+=Ek[r][o]*Math.pow(1-t,r-o)*Math.pow(t,o)*n[o];return a}else{i=new Array(r);for(let o=0;o<r;o++)i[o]=r*(n[o+1]-n[o]);return pv(e-1,t,i)}},Q5=(e,t,n)=>{let r=1,i=e/t,a=(e-n(i))/t,o=0;for(;r>.001;){const s=n(i+a),u=Math.abs(e-s)/t;if(u<r)r=u,i+=a;else{const h=n(i-a),c=Math.abs(e-h)/t;c<r?(r=c,i-=a):a/=2}if(o++,o>500)break}return i};let Cl=class Ls extends wt{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Ls.parsePathData(this.data()),this.pathLength=Ls.getPathLength(this.dataArray)}_sceneFunc(t){const n=this.dataArray;t.beginPath();let r=!1;for(let i=0;i<n.length;i++){const a=n[i].command,o=n[i].points;switch(a){case"L":t.lineTo(o[0],o[1]);break;case"M":t.moveTo(o[0],o[1]);break;case"C":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"Q":t.quadraticCurveTo(o[0],o[1],o[2],o[3]);break;case"A":const s=o[0],u=o[1],h=o[2],c=o[3],m=o[4],g=o[5],d=o[6],y=o[7],_=h>c?h:c,x=h>c?1:h/c,b=h>c?c/h:1;t.translate(s,u),t.rotate(d),t.scale(x,b),t.arc(0,0,_,m,m+g,1-y),t.scale(1/x,1/b),t.rotate(-d),t.translate(-s,-u);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){let t=[];this.dataArray.forEach(function(u){if(u.command==="A"){const h=u.points[4],c=u.points[5],m=u.points[4]+c;let g=Math.PI/180;if(Math.abs(h-m)<g&&(g=Math.abs(h-m)),c<0)for(let d=h-g;d>m;d-=g){const y=Ls.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],d,0);t.push(y.x,y.y)}else for(let d=h+g;d<m;d+=g){const y=Ls.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],d,0);t.push(y.x,y.y)}}else if(u.command==="C")for(let h=0;h<=1;h+=.01){const c=Ls.getPointOnCubicBezier(h,u.start.x,u.start.y,u.points[0],u.points[1],u.points[2],u.points[3],u.points[4],u.points[5]);t.push(c.x,c.y)}else t=t.concat(u.points)});let n=t[0],r=t[0],i=t[1],a=t[1],o,s;for(let u=0;u<t.length/2;u++)o=t[u*2],s=t[u*2+1],isNaN(o)||(n=Math.min(n,o),r=Math.max(r,o)),isNaN(s)||(i=Math.min(i,s),a=Math.max(a,s));return{x:n,y:i,width:r-n,height:a-i}}getLength(){return this.pathLength}getPointAtLength(t){return Ls.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,n,r,i){return Math.sqrt((r-t)*(r-t)+(i-n)*(i-n))}static getPathLength(t){let n=0;for(let r=0;r<t.length;++r)n+=t[r].pathLength;return n}static getPointAtLengthOfDataArray(t,n){let r,i=0,a=n.length;if(!a)return null;for(;i<a&&t>n[i].pathLength;)t-=n[i].pathLength,++i;if(i===a)return r=n[i-1].points.slice(-2),{x:r[0],y:r[1]};if(t<.01)return n[i].command==="M"?(r=n[i].points.slice(0,2),{x:r[0],y:r[1]}):{x:n[i].start.x,y:n[i].start.y};const o=n[i],s=o.points;switch(o.command){case"L":return Ls.getPointOnLine(t,o.start.x,o.start.y,s[0],s[1]);case"C":return Ls.getPointOnCubicBezier(Q5(t,Ls.getPathLength(n),_=>K5([o.start.x,s[0],s[2],s[4]],[o.start.y,s[1],s[3],s[5]],_)),o.start.x,o.start.y,s[0],s[1],s[2],s[3],s[4],s[5]);case"Q":return Ls.getPointOnQuadraticBezier(Q5(t,Ls.getPathLength(n),_=>Z5([o.start.x,s[0],s[2]],[o.start.y,s[1],s[3]],_)),o.start.x,o.start.y,s[0],s[1],s[2],s[3]);case"A":const u=s[0],h=s[1],c=s[2],m=s[3],g=s[5],d=s[6];let y=s[4];return y+=g*t/o.pathLength,Ls.getPointOnEllipticalArc(u,h,c,m,y,d)}return null}static getPointOnLine(t,n,r,i,a,o,s){o=o??n,s=s??r;const u=this.getLineLength(n,r,i,a);if(u<1e-10)return{x:n,y:r};if(i===n)return{x:o,y:s+(a>r?t:-t)};const h=(a-r)/(i-n),c=Math.sqrt(t*t/(1+h*h))*(i<n?-1:1),m=h*c;if(Math.abs(s-r-h*(o-n))<1e-10)return{x:o+c,y:s+m};const g=((o-n)*(i-n)+(s-r)*(a-r))/(u*u),d=n+g*(i-n),y=r+g*(a-r),_=this.getLineLength(o,s,d,y),x=Math.sqrt(t*t-_*_),b=Math.sqrt(x*x/(1+h*h))*(i<n?-1:1),S=h*b;return{x:d+b,y:y+S}}static getPointOnCubicBezier(t,n,r,i,a,o,s,u,h){function c(x){return x*x*x}function m(x){return 3*x*x*(1-x)}function g(x){return 3*x*(1-x)*(1-x)}function d(x){return(1-x)*(1-x)*(1-x)}const y=u*c(t)+o*m(t)+i*g(t)+n*d(t),_=h*c(t)+s*m(t)+a*g(t)+r*d(t);return{x:y,y:_}}static getPointOnQuadraticBezier(t,n,r,i,a,o,s){function u(d){return d*d}function h(d){return 2*d*(1-d)}function c(d){return(1-d)*(1-d)}const m=o*u(t)+i*h(t)+n*c(t),g=s*u(t)+a*h(t)+r*c(t);return{x:m,y:g}}static getPointOnEllipticalArc(t,n,r,i,a,o){const s=Math.cos(o),u=Math.sin(o),h={x:r*Math.cos(a),y:i*Math.sin(a)};return{x:t+(h.x*s-h.y*u),y:n+(h.x*u+h.y*s)}}static parsePathData(t){if(!t)return[];let n=t;const r=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(let m=0;m<r.length;m++)n=n.replace(new RegExp(r[m],"g"),"|"+r[m]);const i=n.split("|"),a=[],o=[];let s=0,u=0;const h=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let c;for(let m=1;m<i.length;m++){let g=i[m],d=g.charAt(0);for(g=g.slice(1),o.length=0;c=h.exec(g);)o.push(c[0]);let y=[],_=d==="A"||d==="a"?0:-1;for(let x=0,b=o.length;x<b;x++){const S=o[x];if(S==="00"){y.push(0,0),_>=0&&(_+=2,_>=7&&(_-=7));continue}if(_>=0){if(_===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(S)){y.push(parseInt(S[0],10)),y.push(parseInt(S[1],10)),y.push(parseFloat(S.slice(2))),_+=3,_>=7&&(_-=7);continue}if(S==="11"||S==="10"||S==="01"){y.push(parseInt(S[0],10)),y.push(parseInt(S[1],10)),_+=2,_>=7&&(_-=7);continue}if(S==="0"||S==="1"){y.push(parseInt(S,10)),_+=1,_>=7&&(_-=7);continue}}else if(_===4){if(/^[01]\d+(?:\.\d+)?$/.test(S)){y.push(parseInt(S[0],10)),y.push(parseFloat(S.slice(1))),_+=2,_>=7&&(_-=7);continue}if(S==="0"||S==="1"){y.push(parseInt(S,10)),_+=1,_>=7&&(_-=7);continue}}const k=parseFloat(S);isNaN(k)?y.push(0):y.push(k),_+=1,_>=7&&(_-=7)}else{const k=parseFloat(S);isNaN(k)?y.push(0):y.push(k)}}for(;y.length>0&&!isNaN(y[0]);){let x="",b=[];const S=s,k=u;let E,A,R,O,I,j,D,C,N,$;switch(d){case"l":s+=y.shift(),u+=y.shift(),x="L",b.push(s,u);break;case"L":s=y.shift(),u=y.shift(),b.push(s,u);break;case"m":const G=y.shift(),te=y.shift();if(s+=G,u+=te,x="M",a.length>2&&a[a.length-1].command==="z"){for(let se=a.length-2;se>=0;se--)if(a[se].command==="M"){s=a[se].points[0]+G,u=a[se].points[1]+te;break}}b.push(s,u),d="l";break;case"M":s=y.shift(),u=y.shift(),x="M",b.push(s,u),d="L";break;case"h":s+=y.shift(),x="L",b.push(s,u);break;case"H":s=y.shift(),x="L",b.push(s,u);break;case"v":u+=y.shift(),x="L",b.push(s,u);break;case"V":u=y.shift(),x="L",b.push(s,u);break;case"C":b.push(y.shift(),y.shift(),y.shift(),y.shift()),s=y.shift(),u=y.shift(),b.push(s,u);break;case"c":b.push(s+y.shift(),u+y.shift(),s+y.shift(),u+y.shift()),s+=y.shift(),u+=y.shift(),x="C",b.push(s,u);break;case"S":A=s,R=u,E=a[a.length-1],E.command==="C"&&(A=s+(s-E.points[2]),R=u+(u-E.points[3])),b.push(A,R,y.shift(),y.shift()),s=y.shift(),u=y.shift(),x="C",b.push(s,u);break;case"s":A=s,R=u,E=a[a.length-1],E.command==="C"&&(A=s+(s-E.points[2]),R=u+(u-E.points[3])),b.push(A,R,s+y.shift(),u+y.shift()),s+=y.shift(),u+=y.shift(),x="C",b.push(s,u);break;case"Q":b.push(y.shift(),y.shift()),s=y.shift(),u=y.shift(),b.push(s,u);break;case"q":b.push(s+y.shift(),u+y.shift()),s+=y.shift(),u+=y.shift(),x="Q",b.push(s,u);break;case"T":A=s,R=u,E=a[a.length-1],E.command==="Q"&&(A=s+(s-E.points[0]),R=u+(u-E.points[1])),s=y.shift(),u=y.shift(),x="Q",b.push(A,R,s,u);break;case"t":A=s,R=u,E=a[a.length-1],E.command==="Q"&&(A=s+(s-E.points[0]),R=u+(u-E.points[1])),s+=y.shift(),u+=y.shift(),x="Q",b.push(A,R,s,u);break;case"A":O=y.shift(),I=y.shift(),j=y.shift(),D=y.shift(),C=y.shift(),N=s,$=u,s=y.shift(),u=y.shift(),x="A",b=this.convertEndpointToCenterParameterization(N,$,s,u,D,C,O,I,j);break;case"a":O=y.shift(),I=y.shift(),j=y.shift(),D=y.shift(),C=y.shift(),N=s,$=u,s+=y.shift(),u+=y.shift(),x="A",b=this.convertEndpointToCenterParameterization(N,$,s,u,D,C,O,I,j);break}a.push({command:x||d,points:b,start:{x:S,y:k},pathLength:this.calcLength(S,k,x||d,b)})}(d==="z"||d==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,i){let a,o,s,u;const h=Ls;switch(r){case"L":return h.getLineLength(t,n,i[0],i[1]);case"C":return K5([t,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return Z5([t,i[0],i[2]],[n,i[1],i[3]],1);case"A":a=0;const c=i[4],m=i[5],g=i[4]+m;let d=Math.PI/180;if(Math.abs(c-g)<d&&(d=Math.abs(c-g)),o=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],c,0),m<0)for(u=c-d;u>g;u-=d)s=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=h.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(u=c+d;u<g;u+=d)s=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=h.getLineLength(o.x,o.y,s.x,s.y),o=s;return s=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],g,0),a+=h.getLineLength(o.x,o.y,s.x,s.y),a}return 0}static convertEndpointToCenterParameterization(t,n,r,i,a,o,s,u,h){const c=h*(Math.PI/180),m=Math.cos(c)*(t-r)/2+Math.sin(c)*(n-i)/2,g=-1*Math.sin(c)*(t-r)/2+Math.cos(c)*(n-i)/2,d=m*m/(s*s)+g*g/(u*u);d>1&&(s*=Math.sqrt(d),u*=Math.sqrt(d));let y=Math.sqrt((s*s*(u*u)-s*s*(g*g)-u*u*(m*m))/(s*s*(g*g)+u*u*(m*m)));a===o&&(y*=-1),isNaN(y)&&(y=0);const _=y*s*g/u,x=y*-u*m/s,b=(t+r)/2+Math.cos(c)*_-Math.sin(c)*x,S=(n+i)/2+Math.sin(c)*_+Math.cos(c)*x,k=function(D){return Math.sqrt(D[0]*D[0]+D[1]*D[1])},E=function(D,C){return(D[0]*C[0]+D[1]*C[1])/(k(D)*k(C))},A=function(D,C){return(D[0]*C[1]<D[1]*C[0]?-1:1)*Math.acos(E(D,C))},R=A([1,0],[(m-_)/s,(g-x)/u]),O=[(m-_)/s,(g-x)/u],I=[(-1*m-_)/s,(-1*g-x)/u];let j=A(O,I);return E(O,I)<=-1&&(j=Math.PI),E(O,I)>=1&&(j=0),o===0&&j>0&&(j=j-2*Math.PI),o===1&&j<0&&(j=j+2*Math.PI),[b,S,s,u,R,j,c,o]}};Cl.prototype.className="Path";Cl.prototype._attrsAffectingSize=["data"];Bi(Cl);Re.addGetterSetter(Cl,"data");class Eh extends Ac{_sceneFunc(t){super._sceneFunc(t);const n=Math.PI*2,r=this.points();let i=r;const a=this.tension()!==0&&r.length>4;a&&(i=this.getTensionPoints());const o=this.pointerLength(),s=r.length;let u,h;if(a){const g=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],d=Cl.calcLength(i[i.length-4],i[i.length-3],"C",g),y=Cl.getPointOnQuadraticBezier(Math.min(1,1-o/d),g[0],g[1],g[2],g[3],g[4],g[5]);u=r[s-2]-y.x,h=r[s-1]-y.y}else u=r[s-2]-r[s-4],h=r[s-1]-r[s-3];const c=(Math.atan2(h,u)+n)%n,m=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[s-2],r[s-1]),t.rotate(c),t.moveTo(0,0),t.lineTo(-o,m/2),t.lineTo(-o,-m/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(r[0],r[1]),a?(u=(i[0]+i[2])/2-r[0],h=(i[1]+i[3])/2-r[1]):(u=r[2]-r[0],h=r[3]-r[1]),t.rotate((Math.atan2(-h,-u)+n)%n),t.moveTo(0,0),t.lineTo(-o,m/2),t.lineTo(-o,-m/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){const n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),n=this.pointerWidth()/2;return{x:t.x,y:t.y-n,width:t.width,height:t.height+n*2}}}Eh.prototype.className="Arrow";Bi(Eh);Re.addGetterSetter(Eh,"pointerLength",10,kt());Re.addGetterSetter(Eh,"pointerWidth",10,kt());Re.addGetterSetter(Eh,"pointerAtBeginning",!1);Re.addGetterSetter(Eh,"pointerAtEnding",!0);let Ad=class extends wt{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};Ad.prototype._centroid=!0;Ad.prototype.className="Circle";Ad.prototype._attrsAffectingSize=["radius"];Bi(Ad);Re.addGetterSetter(Ad,"radius",0,kt());class Of extends wt{_sceneFunc(t){const n=this.radiusX(),r=this.radiusY();t.beginPath(),t.save(),n!==r&&t.scale(1,r/n),t.arc(0,0,n,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}Of.prototype.className="Ellipse";Of.prototype._centroid=!0;Of.prototype._attrsAffectingSize=["radiusX","radiusY"];Bi(Of);Re.addComponentsGetterSetter(Of,"radius",["x","y"]);Re.addGetterSetter(Of,"radiusX",0,kt());Re.addGetterSetter(Of,"radiusY",0,kt());let lu=class k8 extends wt{constructor(t){super(t),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",n=>{this._removeImageLoad(n.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",this._loadListener)}_removeImageLoad(t){t&&t.removeEventListener&&t.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const t=!!this.cornerRadius(),n=this.hasShadow();return t&&n?!0:super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),i=this.cornerRadius(),a=this.attrs.image;let o;if(a){const s=this.attrs.cropWidth,u=this.attrs.cropHeight;s&&u?o=[a,this.cropX(),this.cropY(),s,u,0,0,n,r]:o=[a,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(t.beginPath(),i?Ze.drawRoundedRectPath(t,n,r,i):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),a&&(i&&t.clip(),t.drawImage.apply(t,o))}_hitFunc(t){const n=this.width(),r=this.height(),i=this.cornerRadius();t.beginPath(),i?Ze.drawRoundedRectPath(t,n,r,i):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n,r;return(r=(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width)!==null&&r!==void 0?r:0}getHeight(){var t,n,r;return(r=(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height)!==null&&r!==void 0?r:0}static fromURL(t,n,r=null){const i=Ze.createImageElement();i.onload=function(){const a=new k8({image:i});n(a)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};lu.prototype.className="Image";lu.prototype._attrsAffectingSize=["image"];Bi(lu);Re.addGetterSetter(lu,"cornerRadius",0,X0(4));Re.addGetterSetter(lu,"image");Re.addComponentsGetterSetter(lu,"crop",["x","y","width","height"]);Re.addGetterSetter(lu,"cropX",0,kt());Re.addGetterSetter(lu,"cropY",0,kt());Re.addGetterSetter(lu,"cropWidth",0,kt());Re.addGetterSetter(lu,"cropHeight",0,kt());const A8=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],Ak="Change.konva",Pk="none",gv="up",mv="right",vv="down",yv="left",Ok=A8.length;let iy=class extends yd{constructor(t){super(t),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){let n=this,r;const i=function(){n._sync()};for(r=0;r<Ok;r++)t.on(A8[r]+Ak,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let t=this.getText(),n=this.getTag(),r,i,a,o,s,u,h;if(t&&n){switch(r=t.width(),i=t.height(),a=n.pointerDirection(),o=n.pointerWidth(),h=n.pointerHeight(),s=0,u=0,a){case gv:s=r/2,u=-1*h;break;case mv:s=r+o,u=i/2;break;case vv:s=r/2,u=i+h;break;case yv:s=-1*o,u=i/2;break}n.setAttrs({x:-1*s,y:-1*u,width:r,height:i}),t.setAttrs({x:-1*s,y:-1*u})}}};iy.prototype.className="Label";Bi(iy);let kh=class extends wt{_sceneFunc(t){const n=this.width(),r=this.height(),i=this.pointerDirection(),a=this.pointerWidth(),o=this.pointerHeight(),s=this.cornerRadius();let u=0,h=0,c=0,m=0;typeof s=="number"?u=h=c=m=Math.min(s,n/2,r/2):(u=Math.min(s[0]||0,n/2,r/2),h=Math.min(s[1]||0,n/2,r/2),m=Math.min(s[2]||0,n/2,r/2),c=Math.min(s[3]||0,n/2,r/2)),t.beginPath(),t.moveTo(u,0),i===gv&&(t.lineTo((n-a)/2,0),t.lineTo(n/2,-1*o),t.lineTo((n+a)/2,0)),t.lineTo(n-h,0),t.arc(n-h,h,h,Math.PI*3/2,0,!1),i===mv&&(t.lineTo(n,(r-o)/2),t.lineTo(n+a,r/2),t.lineTo(n,(r+o)/2)),t.lineTo(n,r-m),t.arc(n-m,r-m,m,0,Math.PI/2,!1),i===vv&&(t.lineTo((n+a)/2,r),t.lineTo(n/2,r+o),t.lineTo((n-a)/2,r)),t.lineTo(c,r),t.arc(c,r-c,c,Math.PI/2,Math.PI,!1),i===yv&&(t.lineTo(0,(r+o)/2),t.lineTo(-1*a,r/2),t.lineTo(0,(r-o)/2)),t.lineTo(0,u),t.arc(u,u,u,Math.PI,Math.PI*3/2,!1),t.closePath(),t.fillStrokeShape(this)}getSelfRect(){let t=0,n=0,r=this.pointerWidth(),i=this.pointerHeight(),a=this.pointerDirection(),o=this.width(),s=this.height();return a===gv?(n-=i,s+=i):a===vv?s+=i:a===yv?(t-=r*1.5,o+=r):a===mv&&(o+=r*1.5),{x:t,y:n,width:o,height:s}}};kh.prototype.className="Tag";Bi(kh);Re.addGetterSetter(kh,"pointerDirection",Pk);Re.addGetterSetter(kh,"pointerWidth",0,kt());Re.addGetterSetter(kh,"pointerHeight",0,kt());Re.addGetterSetter(kh,"cornerRadius",0,X0(4));let zp=class extends wt{_sceneFunc(t){const n=this.cornerRadius(),r=this.width(),i=this.height();t.beginPath(),n?Ze.drawRoundedRectPath(t,r,i,n):t.rect(0,0,r,i),t.closePath(),t.fillStrokeShape(this)}};zp.prototype.className="Rect";Bi(zp);Re.addGetterSetter(zp,"cornerRadius",0,X0(4));class Cf extends wt{_sceneFunc(t){const n=this._getPoints(),r=this.radius(),i=this.sides(),a=this.cornerRadius();if(t.beginPath(),a)Ze.drawRoundedPolygonPath(t,n,i,r,a);else{t.moveTo(n[0].x,n[0].y);for(let o=1;o<n.length;o++)t.lineTo(n[o].x,n[o].y)}t.closePath(),t.fillStrokeShape(this)}_getPoints(){const t=this.attrs.sides,n=this.attrs.radius||0,r=[];for(let i=0;i<t;i++)r.push({x:n*Math.sin(i*2*Math.PI/t),y:-1*n*Math.cos(i*2*Math.PI/t)});return r}getSelfRect(){const t=this._getPoints();let n=t[0].x,r=t[0].x,i=t[0].y,a=t[0].y;return t.forEach(o=>{n=Math.min(n,o.x),r=Math.max(r,o.x),i=Math.min(i,o.y),a=Math.max(a,o.y)}),{x:n,y:i,width:r-n,height:a-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}Cf.prototype.className="RegularPolygon";Cf.prototype._centroid=!0;Cf.prototype._attrsAffectingSize=["radius"];Bi(Cf);Re.addGetterSetter(Cf,"radius",0,kt());Re.addGetterSetter(Cf,"sides",0,kt());Re.addGetterSetter(Cf,"cornerRadius",0,X0(4));const J5=Math.PI*2;class Ah extends wt{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,J5,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),J5,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}Ah.prototype.className="Ring";Ah.prototype._centroid=!0;Ah.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Bi(Ah);Re.addGetterSetter(Ah,"innerRadius",0,kt());Re.addGetterSetter(Ah,"outerRadius",0,kt());class Yu extends wt{constructor(t){super(t),this._updated=!0,this.anim=new kd(()=>{const n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){const n=this.animation(),r=this.frameIndex(),i=r*4,a=this.animations()[n],o=this.frameOffsets(),s=a[i+0],u=a[i+1],h=a[i+2],c=a[i+3],m=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,h,c),t.closePath(),t.fillStrokeShape(this)),m)if(o){const g=o[n],d=r*2;t.drawImage(m,s,u,h,c,g[d+0],g[d+1],h,c)}else t.drawImage(m,s,u,h,c,0,0,h,c)}_hitFunc(t){const n=this.animation(),r=this.frameIndex(),i=r*4,a=this.animations()[n],o=this.frameOffsets(),s=a[i+2],u=a[i+3];if(t.beginPath(),o){const h=o[n],c=r*2;t.rect(h[c+0],h[c+1],s,u)}else t.rect(0,0,s,u);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const t=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],a=i.length/4;t<a-1?this.frameIndex(t+1):this.frameIndex(0)}}Yu.prototype.className="Sprite";Bi(Yu);Re.addGetterSetter(Yu,"animation");Re.addGetterSetter(Yu,"animations");Re.addGetterSetter(Yu,"frameOffsets");Re.addGetterSetter(Yu,"image");Re.addGetterSetter(Yu,"frameIndex",0,kt());Re.addGetterSetter(Yu,"frameRate",17,kt());Re.backCompat(Yu,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class Lf extends wt{_sceneFunc(t){const n=this.innerRadius(),r=this.outerRadius(),i=this.numPoints();t.beginPath(),t.moveTo(0,0-r);for(let a=1;a<i*2;a++){const o=a%2===0?r:n,s=o*Math.sin(a*Math.PI/i),u=-1*o*Math.cos(a*Math.PI/i);t.lineTo(s,u)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}Lf.prototype.className="Star";Lf.prototype._centroid=!0;Lf.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Bi(Lf);Re.addGetterSetter(Lf,"numPoints",5,kt());Re.addGetterSetter(Lf,"innerRadius",0,kt());Re.addGetterSetter(Lf,"outerRadius",0,kt());function ff(e){return[...e].reduce((t,n,r,i)=>{if(new RegExp("\\p{Emoji}","u").test(n)){const a=i[r+1];a&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(a)?(t.push(n+a),i[r+1]=""):t.push(n)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(n+(i[r+1]||""))?t.push(n+i[r+1]):r>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(n)?t[t.length-1]+=n:n&&t.push(n);return t},[])}const Xh="auto",Ck="center",P8="inherit",Gd="justify",Lk="Change.konva",Nk="2d",eb="-",O8="left",Tk="text",Rk="Text",Mk="top",Ik="bottom",tb="middle",C8="normal",jk="px ",R1=" ",Dk="right",nb="rtl",Fk="word",Bk="char",rb="none",Zg="…",L8=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],zk=L8.length;function Uk(e){return e.split(",").map(t=>{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}let M1;function Qg(){return M1||(M1=Ze.createCanvasElement().getContext(Nk),M1)}function qk(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function $k(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function Hk(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}let yi=class extends wt{constructor(t){super(Hk(t)),this._partialTextX=0,this._partialTextY=0;for(let n=0;n<zk;n++)this.on(L8[n]+Lk,this._setTextData);this._setTextData()}_sceneFunc(t){var n,r;const i=this.textArr,a=i.length;if(!this.text())return;let o=this.padding(),s=this.fontSize(),u=this.lineHeight()*s,h=this.verticalAlign(),c=this.direction(),m=0,g=this.align(),d=this.getWidth(),y=this.letterSpacing(),_=this.charRenderFunc(),x=this.fill(),b=this.textDecoration(),S=b.indexOf("underline")!==-1,k=b.indexOf("line-through")!==-1,E;c=c===P8?t.direction:c;let A=u/2,R=tb;if(!Ot.legacyTextRendering){const O=this.measureSize("M");R="alphabetic";const I=(n=O.fontBoundingBoxAscent)!==null&&n!==void 0?n:O.actualBoundingBoxAscent,j=(r=O.fontBoundingBoxDescent)!==null&&r!==void 0?r:O.actualBoundingBoxDescent;A=(I-j)/2+u/2}for(c===nb&&t.setAttr("direction",c),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",R),t.setAttr("textAlign",O8),h===tb?m=(this.getHeight()-a*u-o*2)/2:h===Ik&&(m=this.getHeight()-a*u-o*2),t.translate(o,m+o),E=0;E<a;E++){let O=0,I=0;const j=i[E],D=j.text,C=j.width,N=j.lastInParagraph;if(t.save(),g===Dk?O+=d-C-o*2:g===Ck&&(O+=(d-C-o*2)/2),S){t.save(),t.beginPath();const G=Ot.legacyTextRendering?Math.round(s/2):Math.round(s/4),te=O,se=A+I+G;t.moveTo(te,se);const ee=g===Gd&&!N?d-o*2:C;t.lineTo(te+Math.round(ee),se),t.lineWidth=s/15;const Q=this._getLinearGradient();t.strokeStyle=Q||x,t.stroke(),t.restore()}const $=O;if(c!==nb&&(y!==0||g===Gd||_)){const G=D.split(" ").length-1,te=ff(D);for(let se=0;se<te.length;se++){const ee=te[se];if(ee===" "&&!N&&g===Gd&&(O+=(d-o*2-C)/G),this._partialTextX=O,this._partialTextY=A+I,this._partialText=ee,_){t.save();const re=i.slice(0,E).reduce((B,F)=>B+ff(F.text).length,0),X=se+re;_({char:ee,index:X,x:O,y:A+I,lineIndex:E,column:se,isLastInLine:N,width:this.measureSize(ee).width,context:t})}t.fillStrokeShape(this),_&&t.restore(),O+=this.measureSize(ee).width+y}}else y!==0&&t.setAttr("letterSpacing",`${y}px`),this._partialTextX=O,this._partialTextY=A+I,this._partialText=D,t.fillStrokeShape(this);if(k){t.save(),t.beginPath();const G=Ot.legacyTextRendering?0:-Math.round(s/4),te=$;t.moveTo(te,A+I+G);const se=g===Gd&&!N?d-o*2:C;t.lineTo(te+Math.round(se),A+I+G),t.lineWidth=s/15;const ee=this._getLinearGradient();t.strokeStyle=ee||x,t.stroke(),t.restore()}t.restore(),a>1&&(A+=u)}}_hitFunc(t){const n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){const n=Ze._isString(t)?t:t==null?"":t+"";return this._setAttr(Tk,n),this}getWidth(){return this.attrs.width===Xh||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===Xh||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return Ze.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var n,r,i,a,o,s,u,h,c,m,g;let d=Qg(),y=this.fontSize(),_;d.save(),d.font=this._getContextFont(),_=d.measureText(t),d.restore();const x=y/100;return{actualBoundingBoxAscent:(n=_.actualBoundingBoxAscent)!==null&&n!==void 0?n:71.58203125*x,actualBoundingBoxDescent:(r=_.actualBoundingBoxDescent)!==null&&r!==void 0?r:0,actualBoundingBoxLeft:(i=_.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*x,actualBoundingBoxRight:(a=_.actualBoundingBoxRight)!==null&&a!==void 0?a:75.732421875*x,alphabeticBaseline:(o=_.alphabeticBaseline)!==null&&o!==void 0?o:0,emHeightAscent:(s=_.emHeightAscent)!==null&&s!==void 0?s:100*x,emHeightDescent:(u=_.emHeightDescent)!==null&&u!==void 0?u:-20*x,fontBoundingBoxAscent:(h=_.fontBoundingBoxAscent)!==null&&h!==void 0?h:91*x,fontBoundingBoxDescent:(c=_.fontBoundingBoxDescent)!==null&&c!==void 0?c:21*x,hangingBaseline:(m=_.hangingBaseline)!==null&&m!==void 0?m:72.80000305175781*x,ideographicBaseline:(g=_.ideographicBaseline)!==null&&g!==void 0?g:-21*x,width:_.width,height:y}}_getContextFont(){return this.fontStyle()+R1+this.fontVariant()+R1+(this.fontSize()+jk)+Uk(this.fontFamily())}_addTextLine(t){this.align()===Gd&&(t=t.trim());const r=this._getTextWidth(t);return this.textArr.push({text:t,width:r,lastInParagraph:!1})}_getTextWidth(t){const n=this.letterSpacing(),r=t.length;return Qg().measureText(t).width+n*r}_setTextData(){let t=this.text().split(`
|
|
24
|
+
`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,a=this.attrs.width,o=this.attrs.height,s=a!==Xh&&a!==void 0,u=o!==Xh&&o!==void 0,h=this.padding(),c=a-h*2,m=o-h*2,g=0,d=this.wrap(),y=d!==rb,_=d!==Bk&&y,x=this.ellipsis();this.textArr=[],Qg().font=this._getContextFont();const b=x?this._getTextWidth(Zg):0;for(let S=0,k=t.length;S<k;++S){let E=t[S],A=this._getTextWidth(E);if(s&&A>c)for(;E.length>0;){let R=0,O=ff(E).length,I="",j=0;for(;R<O;){const D=R+O>>>1,C=ff(E),N=C.slice(0,D+1).join(""),$=this._getTextWidth(N);(x&&u&&g+i>m?$+b:$)<=c?(R=D+1,I=N,j=$):O=D}if(I){if(_){const N=ff(E),$=ff(I),G=N[$.length],te=G===R1||G===eb;let se;if(te&&j<=c)se=$.length;else{const ee=$.lastIndexOf(R1),Q=$.lastIndexOf(eb);se=Math.max(ee,Q)+1}se>0&&(R=se,I=N.slice(0,R).join(""),j=this._getTextWidth(I))}if(I=I.trimRight(),this._addTextLine(I),r=Math.max(r,j),g+=i,this._shouldHandleEllipsis(g)){this._tryToAddEllipsisToLastLine();break}if(E=ff(E).slice(R).join("").trimLeft(),E.length>0&&(A=this._getTextWidth(E),A<=c)){this._addTextLine(E),g+=i,r=Math.max(r,A);break}}else break}else this._addTextLine(E),g+=i,r=Math.max(r,A),this._shouldHandleEllipsis(g)&&S<k-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),u&&g+i>m)break}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(t){const n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,a=i!==Xh&&i!==void 0,o=this.padding(),s=i-o*2;return!(this.wrap()!==rb)||a&&t+r>s}_tryToAddEllipsisToLastLine(){const t=this.attrs.width,n=t!==Xh&&t!==void 0,r=this.padding(),i=t-r*2,a=this.ellipsis(),o=this.textArr[this.textArr.length-1];!o||!a||(n&&(this._getTextWidth(o.text+Zg)<i||(o.text=o.text.slice(0,o.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(o.text+Zg))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const t=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,n=this.hasShadow();return t&&n?!0:super._useBufferCanvas()}};yi.prototype._fillFunc=qk;yi.prototype._strokeFunc=$k;yi.prototype.className=Rk;yi.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];Bi(yi);Re.overWriteSetter(yi,"width",ty());Re.overWriteSetter(yi,"height",ty());Re.addGetterSetter(yi,"direction",P8);Re.addGetterSetter(yi,"fontFamily","Arial");Re.addGetterSetter(yi,"fontSize",12,kt());Re.addGetterSetter(yi,"fontStyle",C8);Re.addGetterSetter(yi,"fontVariant",C8);Re.addGetterSetter(yi,"padding",0,kt());Re.addGetterSetter(yi,"align",O8);Re.addGetterSetter(yi,"verticalAlign",Mk);Re.addGetterSetter(yi,"lineHeight",1,kt());Re.addGetterSetter(yi,"wrap",Fk);Re.addGetterSetter(yi,"ellipsis",!1,su());Re.addGetterSetter(yi,"letterSpacing",0,kt());Re.addGetterSetter(yi,"text","",_h());Re.addGetterSetter(yi,"textDecoration","");Re.addGetterSetter(yi,"charRenderFunc",void 0);const Gk="",N8="normal";function T8(e){e.fillText(this.partialText,0,0)}function R8(e){e.strokeText(this.partialText,0,0)}let Da=class extends wt{constructor(t){super(t),this.dummyCanvas=Ze.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 Cl.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const n=this.pathLength;return t>n?null:Cl.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=Cl.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();const n=this.textDecoration(),r=this.fill(),i=this.fontSize(),a=this.glyphInfo,o=n.indexOf("underline")!==-1,s=n.indexOf("line-through")!==-1;o&&t.beginPath();for(let u=0;u<a.length;u++){t.save();const h=a[u].p0;t.translate(h.x,h.y),t.rotate(a[u].rotation),this.partialText=a[u].text,t.fillStrokeShape(this),o&&(u===0&&t.moveTo(0,i/2+1),t.lineTo(a[u].width,i/2+1)),t.restore()}if(o&&(t.strokeStyle=r,t.lineWidth=i/20,t.stroke()),s){t.beginPath();for(let u=0;u<a.length;u++){t.save();const h=a[u].p0;t.translate(h.x,h.y),t.rotate(a[u].rotation),u===0&&t.moveTo(0,0),t.lineTo(a[u].width,0),t.restore()}t.strokeStyle=r,t.lineWidth=i/20,t.stroke()}t.restore()}_hitFunc(t){t.beginPath();const n=this.glyphInfo;if(n.length>=1){const r=n[0].p0;t.moveTo(r.x,r.y)}for(let r=0;r<n.length;r++){const i=n[r].p1;t.lineTo(i.x,i.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return Ze.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(t){return yi.prototype.setText.call(this,t)}_getContextFont(){return yi.prototype._getContextFont.call(this)}_getTextSize(t){const r=this.dummyCanvas.getContext("2d");r.save(),r.font=this._getContextFont();const i=r.measureText(t);return r.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const t=ff(this.text()),n=[];let r=0;for(let m=0;m<t.length;m++)n.push({char:t[m],width:this._getTextSize(t[m]).width}),r+=n[m].width;const{height:i}=this._getTextSize(this.attrs.text);if(this.textWidth=r,this.textHeight=i,this.glyphInfo=[],!this.attrs.data)return null;const a=this.letterSpacing(),o=this.align(),s=this.kerningFunc(),u=Math.max(this.textWidth+((this.attrs.text||"").length-1)*a,0);let h=0;o==="center"&&(h=Math.max(0,this.pathLength/2-u/2)),o==="right"&&(h=Math.max(0,this.pathLength-u));let c=h;for(let m=0;m<n.length;m++){const g=this._getPointAtLength(c);if(!g)return;const d=n[m].char;let y=n[m].width+a;if(d===" "&&o==="justify"){const E=this.text().split(" ").length-1;y+=(this.pathLength-u)/E}const _=this._getPointAtLength(c+y);if(!_)return;const x=Cl.getLineLength(g.x,g.y,_.x,_.y);let b=0;if(s)try{b=s(n[m-1].char,d)*this.fontSize()}catch{b=0}g.x+=b,_.x+=b,this.textWidth+=b;const S=Cl.getPointOnLine(b+x/2,g.x,g.y,_.x,_.y),k=Math.atan2(_.y-g.y,_.x-g.x);this.glyphInfo.push({transposeX:S.x,transposeY:S.y,text:t[m],rotation:k,p0:g,p1:_,width:x}),c+=y}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const t=[];this.glyphInfo.forEach(function(h){t.push(h.p0.x),t.push(h.p0.y),t.push(h.p1.x),t.push(h.p1.y)});let n=t[0]||0,r=t[0]||0,i=t[1]||0,a=t[1]||0,o,s;for(let h=0;h<t.length/2;h++)o=t[h*2],s=t[h*2+1],n=Math.min(n,o),r=Math.max(r,o),i=Math.min(i,s),a=Math.max(a,s);const u=this.fontSize();return{x:n-u/2,y:i-u/2,width:r-n+u,height:a-i+u}}destroy(){return Ze.releaseCanvas(this.dummyCanvas),super.destroy()}};Da.prototype._fillFunc=T8;Da.prototype._strokeFunc=R8;Da.prototype._fillFuncHit=T8;Da.prototype._strokeFuncHit=R8;Da.prototype.className="TextPath";Da.prototype._attrsAffectingSize=["text","fontSize","data"];Bi(Da);Re.addGetterSetter(Da,"data");Re.addGetterSetter(Da,"fontFamily","Arial");Re.addGetterSetter(Da,"fontSize",12,kt());Re.addGetterSetter(Da,"fontStyle",N8);Re.addGetterSetter(Da,"align","left");Re.addGetterSetter(Da,"letterSpacing",0,kt());Re.addGetterSetter(Da,"textBaseline","middle");Re.addGetterSetter(Da,"fontVariant",N8);Re.addGetterSetter(Da,"text",Gk);Re.addGetterSetter(Da,"textDecoration","");Re.addGetterSetter(Da,"kerningFunc",void 0);const M8="tr-konva",Wk=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${M8}`).join(" "),ib="nodesRect",Vk=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],Yk={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},Xk="ontouchstart"in Ot._global;function Kk(e,t,n){if(e==="rotater")return n;t+=Ze.degToRad(Yk[e]||0);const r=(Ze.radToDeg(t)%360+360)%360;return Ze._inRange(r,315+22.5,360)||Ze._inRange(r,0,22.5)?"ns-resize":Ze._inRange(r,45-22.5,45+22.5)?"nesw-resize":Ze._inRange(r,90-22.5,90+22.5)?"ew-resize":Ze._inRange(r,135-22.5,135+22.5)?"nwse-resize":Ze._inRange(r,180-22.5,180+22.5)?"ns-resize":Ze._inRange(r,225-22.5,225+22.5)?"nesw-resize":Ze._inRange(r,270-22.5,270+22.5)?"ew-resize":Ze._inRange(r,315-22.5,315+22.5)?"nwse-resize":(Ze.error("Transformer has unknown angle for cursor detection: "+r),"pointer")}const S0=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function Zk(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function I8(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return{...e,rotation:e.rotation+t,x:r,y:i}}function Qk(e,t){const n=Zk(e);return I8(e,t,n)}function Jk(e,t,n){let r=t;for(let i=0;i<e.length;i++){const a=Ot.getAngle(e[i]),o=Math.abs(a-t)%(Math.PI*2);Math.min(o,Math.PI*2-o)<n&&(r=a)}return r}let bv=0,tr=class extends yd{constructor(t){super(t),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(Wk,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return Ze.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([t])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return M8+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const n=t.filter(i=>i.isAncestorOf(this)?(Ze.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=t=n,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const a=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(i._attrsAffectingSize.length){const o=i._attrsAffectingSize.map(s=>s+"Change."+this._getEventNamespace()).join(" ");i.on(o,a)}i.on(Vk.map(o=>o+`.${this._getEventNamespace()}`).join(" "),a),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,a),this._proxyDrag(i)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(t){let n;t.on(`dragstart.${this._getEventNamespace()}`,r=>{n=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(r,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=t.getAbsolutePosition(),a=i.x-n.x,o=i.y-n.y;this.nodes().forEach(s=>{if(s===t||s.isDragging())return;const u=s.getAbsolutePosition();s.setAbsolutePosition({x:u.x+a,y:u.y+o}),s.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(ib),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(ib,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){const i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),a=t.getAbsoluteScale(r),o=t.getAbsolutePosition(r),s=i.x*a.x-t.offsetX()*a.x,u=i.y*a.y-t.offsetY()*a.y,h=(Ot.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),c={x:o.x+s*Math.cos(h)+u*Math.sin(-h),y:o.y+u*Math.cos(h)+s*Math.sin(h),width:i.width*a.x,height:i.height*a.y,rotation:h};return I8(c,-Ot.getAngle(n),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const n=[];this.nodes().map(h=>{const c=h.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),m=[{x:c.x,y:c.y},{x:c.x+c.width,y:c.y},{x:c.x+c.width,y:c.y+c.height},{x:c.x,y:c.y+c.height}],g=h.getAbsoluteTransform();m.forEach(function(d){const y=g.point(d);n.push(y)})});const r=new sl;r.rotate(-Ot.getAngle(this.rotation()));let i=1/0,a=1/0,o=-1/0,s=-1/0;n.forEach(function(h){const c=r.point(h);i===void 0&&(i=o=c.x,a=s=c.y),i=Math.min(i,c.x),a=Math.min(a,c.y),o=Math.max(o,c.x),s=Math.max(s,c.y)}),r.invert();const u=r.point({x:i,y:a});return{x:u.x,y:u.y,width:o-i,height:s-a,rotation:Ot.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(),S0.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){const n=new zp({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Xk?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{const i=Ot.getAngle(this.rotation()),a=this.rotateAnchorCursor(),o=Kk(t,i,a);n.getStage().content&&(n.getStage().content.style.cursor=o),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){const t=new wt({name:"back",width:0,height:0,sceneFunc(n,r){const i=r.getParent(),a=i.padding();n.beginPath(),n.rect(-a,-a,r.width()+a*2,r.height()+a*2),n.moveTo(r.width()/2,-a),i.rotateEnabled()&&i.rotateLineVisible()&&n.lineTo(r.width()/2,-i.rotateAnchorOffset()*Ze._sign(r.height())-a),n.fillStrokeShape(r)},hitFunc:(n,r)=>{if(!this.shouldOverdrawWholeArea())return;const i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}});this.add(t),this._proxyDrag(t),t.on("dragstart",n=>{n.cancelBubble=!0}),t.on("dragmove",n=>{n.cancelBubble=!0}),t.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(t){if(this._transforming)return;this._movingAnchorName=t.target.name().split(" ")[0];const n=this._getNodeRect(),r=n.width,i=n.height,a=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/a),this.cos=Math.abs(r/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 o=t.target.getAbsolutePosition(),s=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-o.x,y:s.y-o.y},bv++,this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(u=>{u._fire("transformstart",{evt:t.evt,target:u})})}_handleMouseMove(t){let n,r,i;const a=this.findOne("."+this._movingAnchorName),o=a.getStage();o.setPointersPositions(t);const s=o.getPointerPosition();let u={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const h=a.getAbsolutePosition();this.anchorDragBoundFunc()&&(u=this.anchorDragBoundFunc()(h,u,t)),a.setAbsolutePosition(u);const c=a.getAbsolutePosition();if(h.x===c.x&&h.y===c.y)return;if(this._movingAnchorName==="rotater"){const S=this._getNodeRect();n=a.x()-S.width/2,r=-a.y()+S.height/2;let k=Math.atan2(-r,n)+Math.PI/2;S.height<0&&(k-=Math.PI);const A=Ot.getAngle(this.rotation())+k,R=Ot.getAngle(this.rotationSnapTolerance()),I=Jk(this.rotationSnaps(),A,R)-S.rotation,j=Qk(S,I);this._fitNodesInto(j,t);return}const m=this.shiftBehavior();let g;m==="inverted"?g=this.keepRatio()&&!t.shiftKey:m==="none"?g=this.keepRatio():g=this.keepRatio()||t.shiftKey;let d=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(g){const S=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(S.x-a.x(),2)+Math.pow(S.y-a.y(),2));const k=this.findOne(".top-left").x()>S.x?-1:1,E=this.findOne(".top-left").y()>S.y?-1:1;n=i*this.cos*k,r=i*this.sin*E,this.findOne(".top-left").x(S.x-n),this.findOne(".top-left").y(S.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(a.y());else if(this._movingAnchorName==="top-right"){if(g){const S=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(a.x()-S.x,2)+Math.pow(S.y-a.y(),2));const k=this.findOne(".top-right").x()<S.x?-1:1,E=this.findOne(".top-right").y()>S.y?-1:1;n=i*this.cos*k,r=i*this.sin*E,this.findOne(".top-right").x(S.x+n),this.findOne(".top-right").y(S.y-r)}var y=a.position();this.findOne(".top-left").y(y.y),this.findOne(".bottom-right").x(y.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(a.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(a.x());else if(this._movingAnchorName==="bottom-left"){if(g){const S=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(S.x-a.x(),2)+Math.pow(a.y()-S.y,2));const k=S.x<a.x()?-1:1,E=a.y()<S.y?-1:1;n=i*this.cos*k,r=i*this.sin*E,a.x(S.x-n),a.y(S.y+r)}y=a.position(),this.findOne(".top-left").x(y.x),this.findOne(".bottom-right").y(y.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(a.y());else if(this._movingAnchorName==="bottom-right"){if(g){const S=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};i=Math.sqrt(Math.pow(a.x()-S.x,2)+Math.pow(a.y()-S.y,2));const k=this.findOne(".bottom-right").x()<S.x?-1:1,E=this.findOne(".bottom-right").y()<S.y?-1:1;n=i*this.cos*k,r=i*this.sin*E,this.findOne(".bottom-right").x(S.x+n),this.findOne(".bottom-right").y(S.y+r)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(d=this.centeredScaling()||t.altKey,d){const S=this.findOne(".top-left"),k=this.findOne(".bottom-right"),E=S.x(),A=S.y(),R=this.getWidth()-k.x(),O=this.getHeight()-k.y();k.move({x:-E,y:-A}),S.move({x:R,y:O})}const _=this.findOne(".top-left").getAbsolutePosition();n=_.x,r=_.y;const x=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),b=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:r,width:x,height:b,rotation:Ot.getAngle(this.rotation())},t)}_handleMouseUp(t){this._removeEvents(t)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(t){var n;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const r=this.getNode();bv--,this._fire("transformend",{evt:t,target:r}),(n=this.getLayer())===null||n===void 0||n.batchDraw(),r&&this._nodes.forEach(i=>{var a;i._fire("transformend",{evt:t,target:i}),(a=i.getLayer())===null||a===void 0||a.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(t,n){const r=this._getNodeRect(),i=1;if(Ze._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(Ze._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const a=new sl;if(a.rotate(Ot.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const g=a.point({x:-this.padding()*2,y:0});t.x+=g.x,t.y+=g.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const g=a.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y,t.width+=this.padding()*2}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const g=a.point({x:0,y:-this.padding()*2});t.x+=g.x,t.y+=g.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y,t.height+=this.padding()*2}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const g=a.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y,t.height+=this.padding()*2}if(this.boundBoxFunc()){const g=this.boundBoxFunc()(r,t);g?t=g:Ze.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const o=1e7,s=new sl;s.translate(r.x,r.y),s.rotate(r.rotation),s.scale(r.width/o,r.height/o);const u=new sl,h=t.width/o,c=t.height/o;this.flipEnabled()===!1?(u.translate(t.x,t.y),u.rotate(t.rotation),u.translate(t.width<0?t.width:0,t.height<0?t.height:0),u.scale(Math.abs(h),Math.abs(c))):(u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(h,c));const m=u.multiply(s.invert());this._nodes.forEach(g=>{var d;if(!g.getStage())return;const y=g.getParent().getAbsoluteTransform(),_=g.getTransform().copy();_.translate(g.offsetX(),g.offsetY());const x=new sl;x.multiply(y.copy().invert()).multiply(m).multiply(y).multiply(_);const b=x.decompose();g.setAttrs(b),(d=g.getLayer())===null||d===void 0||d.batchDraw()}),this.rotation(Ze._getRotation(t.rotation)),this._nodes.forEach(g=>{this._fire("transform",{evt:n,target:g}),g._fire("transform",{evt:n,target:g})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,n){this.findOne(t).setAttrs(n)}update(){var t;const n=this._getNodeRect();this.rotation(Ze._getRotation(n.rotation));const r=n.width,i=n.height,a=this.enabledAnchors(),o=this.resizeEnabled(),s=this.padding(),u=this.anchorSize(),h=this.find("._anchor");h.forEach(m=>{m.setAttrs({width:u,height:u,offsetX:u/2,offsetY:u/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:u/2+s,offsetY:u/2+s,visible:o&&a.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:u/2+s,visible:o&&a.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:u/2-s,offsetY:u/2+s,visible:o&&a.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:u/2+s,visible:o&&a.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:u/2-s,visible:o&&a.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:u/2+s,offsetY:u/2-s,visible:o&&a.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:u/2-s,visible:o&&a.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:u/2-s,offsetY:u/2-s,visible:o&&a.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*Ze._sign(i)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(m=>m.draggable()),x:0,y:0});const c=this.anchorStyleFunc();c&&h.forEach(m=>{c(m)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),yd.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Pt.prototype.toObject.call(this)}clone(t){return Pt.prototype.clone.call(this,t)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};tr.isTransforming=()=>bv>0;function eA(e){return e instanceof Array||Ze.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){S0.indexOf(t)===-1&&Ze.warn("Unknown anchor name: "+t+". Available names are: "+S0.join(", "))}),e||[]}tr.prototype.className="Transformer";Bi(tr);Re.addGetterSetter(tr,"enabledAnchors",S0,eA);Re.addGetterSetter(tr,"flipEnabled",!0,su());Re.addGetterSetter(tr,"resizeEnabled",!0);Re.addGetterSetter(tr,"anchorSize",10,kt());Re.addGetterSetter(tr,"rotateEnabled",!0);Re.addGetterSetter(tr,"rotateLineVisible",!0);Re.addGetterSetter(tr,"rotationSnaps",[]);Re.addGetterSetter(tr,"rotateAnchorOffset",50,kt());Re.addGetterSetter(tr,"rotateAnchorCursor","crosshair");Re.addGetterSetter(tr,"rotationSnapTolerance",5,kt());Re.addGetterSetter(tr,"borderEnabled",!0);Re.addGetterSetter(tr,"anchorStroke","rgb(0, 161, 255)");Re.addGetterSetter(tr,"anchorStrokeWidth",1,kt());Re.addGetterSetter(tr,"anchorFill","white");Re.addGetterSetter(tr,"anchorCornerRadius",0,kt());Re.addGetterSetter(tr,"borderStroke","rgb(0, 161, 255)");Re.addGetterSetter(tr,"borderStrokeWidth",1,kt());Re.addGetterSetter(tr,"borderDash");Re.addGetterSetter(tr,"keepRatio",!0);Re.addGetterSetter(tr,"shiftBehavior","default");Re.addGetterSetter(tr,"centeredScaling",!1);Re.addGetterSetter(tr,"ignoreStroke",!1);Re.addGetterSetter(tr,"padding",0,kt());Re.addGetterSetter(tr,"nodes");Re.addGetterSetter(tr,"node");Re.addGetterSetter(tr,"boundBoxFunc");Re.addGetterSetter(tr,"anchorDragBoundFunc");Re.addGetterSetter(tr,"anchorStyleFunc");Re.addGetterSetter(tr,"shouldOverdrawWholeArea",!1);Re.addGetterSetter(tr,"useSingleNodeRotation",!0);Re.backCompat(tr,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class Pc extends wt{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,Ot.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}Pc.prototype.className="Wedge";Pc.prototype._centroid=!0;Pc.prototype._attrsAffectingSize=["radius"];Bi(Pc);Re.addGetterSetter(Pc,"radius",0,kt());Re.addGetterSetter(Pc,"angle",0,kt());Re.addGetterSetter(Pc,"clockwise",!1);Re.backCompat(Pc,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function ab(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const tA=[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],nA=[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 rA(e,t){const n=e.data,r=e.width,i=e.height;let a,o,s,u,h,c,m,g,d,y,_,x,b,S,k,E,A,R,O,I;const j=t+t+1,D=r-1,C=i-1,N=t+1,$=N*(N+1)/2,G=new ab,te=tA[t],se=nA[t];let ee=null,Q=G,re=null,X=null;for(let B=1;B<j;B++)Q=Q.next=new ab,B===N&&(ee=Q);Q.next=G,s=o=0;for(let B=0;B<i;B++){x=b=S=k=u=h=c=m=0,g=N*(E=n[o]),d=N*(A=n[o+1]),y=N*(R=n[o+2]),_=N*(O=n[o+3]),u+=$*E,h+=$*A,c+=$*R,m+=$*O,Q=G;for(let F=0;F<N;F++)Q.r=E,Q.g=A,Q.b=R,Q.a=O,Q=Q.next;for(let F=1;F<N;F++)a=o+((D<F?D:F)<<2),u+=(Q.r=E=n[a])*(I=N-F),h+=(Q.g=A=n[a+1])*I,c+=(Q.b=R=n[a+2])*I,m+=(Q.a=O=n[a+3])*I,x+=E,b+=A,S+=R,k+=O,Q=Q.next;re=G,X=ee;for(let F=0;F<r;F++)n[o+3]=O=m*te>>se,O!==0?(O=255/O,n[o]=(u*te>>se)*O,n[o+1]=(h*te>>se)*O,n[o+2]=(c*te>>se)*O):n[o]=n[o+1]=n[o+2]=0,u-=g,h-=d,c-=y,m-=_,g-=re.r,d-=re.g,y-=re.b,_-=re.a,a=s+((a=F+t+1)<D?a:D)<<2,x+=re.r=n[a],b+=re.g=n[a+1],S+=re.b=n[a+2],k+=re.a=n[a+3],u+=x,h+=b,c+=S,m+=k,re=re.next,g+=E=X.r,d+=A=X.g,y+=R=X.b,_+=O=X.a,x-=E,b-=A,S-=R,k-=O,X=X.next,o+=4;s+=r}for(let B=0;B<r;B++){b=S=k=x=h=c=m=u=0,o=B<<2,g=N*(E=n[o]),d=N*(A=n[o+1]),y=N*(R=n[o+2]),_=N*(O=n[o+3]),u+=$*E,h+=$*A,c+=$*R,m+=$*O,Q=G;for(let z=0;z<N;z++)Q.r=E,Q.g=A,Q.b=R,Q.a=O,Q=Q.next;let F=r;for(let z=1;z<=t;z++)o=F+B<<2,u+=(Q.r=E=n[o])*(I=N-z),h+=(Q.g=A=n[o+1])*I,c+=(Q.b=R=n[o+2])*I,m+=(Q.a=O=n[o+3])*I,x+=E,b+=A,S+=R,k+=O,Q=Q.next,z<C&&(F+=r);o=B,re=G,X=ee;for(let z=0;z<i;z++)a=o<<2,n[a+3]=O=m*te>>se,O>0?(O=255/O,n[a]=(u*te>>se)*O,n[a+1]=(h*te>>se)*O,n[a+2]=(c*te>>se)*O):n[a]=n[a+1]=n[a+2]=0,u-=g,h-=d,c-=y,m-=_,g-=re.r,d-=re.g,y-=re.b,_-=re.a,a=B+((a=z+N)<C?a:C)*r<<2,u+=x+=re.r=n[a],h+=b+=re.g=n[a+1],c+=S+=re.b=n[a+2],m+=k+=re.a=n[a+3],re=re.next,g+=E=X.r,d+=A=X.g,y+=R=X.b,_+=O=X.a,x-=E,b-=A,S-=R,k-=O,X=X.next,o+=r}}const iA=function(t){const n=Math.round(this.blurRadius());n>0&&rA(t,n)};Re.addGetterSetter(Pt,"blurRadius",0,kt(),Re.afterSetFilter);const aA=function(e){const t=this.brightness()*255,n=e.data,r=n.length;for(let i=0;i<r;i+=4)n[i]+=t,n[i+1]+=t,n[i+2]+=t};Re.addGetterSetter(Pt,"brightness",0,kt(),Re.afterSetFilter);const oA=function(e){const t=this.brightness(),n=e.data,r=n.length;for(let i=0;i<r;i+=4)n[i]=Math.min(255,n[i]*t),n[i+1]=Math.min(255,n[i+1]*t),n[i+2]=Math.min(255,n[i+2]*t)},sA=function(e){const t=Math.pow((this.contrast()+100)/100,2),n=e.data,r=n.length;let i=150,a=150,o=150;for(let s=0;s<r;s+=4)i=n[s],a=n[s+1],o=n[s+2],i/=255,i-=.5,i*=t,i+=.5,i*=255,a/=255,a-=.5,a*=t,a+=.5,a*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,i=i<0?0:i>255?255:i,a=a<0?0:a>255?255:a,o=o<0?0:o>255?255:o,n[s]=i,n[s+1]=a,n[s+2]=o};Re.addGetterSetter(Pt,"contrast",0,kt(),Re.afterSetFilter);const lA=function(e){var t,n,r,i,a,o,s,u,h;const c=e.data,m=e.width,g=e.height,d=Math.min(1,Math.max(0,(n=(t=this.embossStrength)===null||t===void 0?void 0:t.call(this))!==null&&n!==void 0?n:.5)),y=Math.min(1,Math.max(0,(i=(r=this.embossWhiteLevel)===null||r===void 0?void 0:r.call(this))!==null&&i!==void 0?i:.5)),x=(s={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[(o=(a=this.embossDirection)===null||a===void 0?void 0:a.call(this))!==null&&o!==void 0?o:"top-left"])!==null&&s!==void 0?s:315,b=!!((h=(u=this.embossBlend)===null||u===void 0?void 0:u.call(this))!==null&&h!==void 0&&h),S=d*10,k=y*255,E=x*Math.PI/180,A=Math.cos(E),R=Math.sin(E),O=128/1020*S,I=new Uint8ClampedArray(c),j=new Float32Array(m*g);for(let G=0,te=0;te<c.length;te+=4,G++)j[G]=.2126*I[te]+.7152*I[te+1]+.0722*I[te+2];const D=[-1,0,1,-2,0,2,-1,0,1],C=[-1,-2,-1,0,0,0,1,2,1],N=[-m-1,-m,-m+1,-1,0,1,m-1,m,m+1],$=G=>G<0?0:G>255?255:G;for(let G=1;G<g-1;G++)for(let te=1;te<m-1;te++){const se=G*m+te;let ee=0,Q=0;ee+=j[se+N[0]]*D[0],Q+=j[se+N[0]]*C[0],ee+=j[se+N[1]]*D[1],Q+=j[se+N[1]]*C[1],ee+=j[se+N[2]]*D[2],Q+=j[se+N[2]]*C[2],ee+=j[se+N[3]]*D[3],Q+=j[se+N[3]]*C[3],ee+=j[se+N[5]]*D[5],Q+=j[se+N[5]]*C[5],ee+=j[se+N[6]]*D[6],Q+=j[se+N[6]]*C[6],ee+=j[se+N[7]]*D[7],Q+=j[se+N[7]]*C[7],ee+=j[se+N[8]]*D[8],Q+=j[se+N[8]]*C[8];const re=A*ee+R*Q,X=$(k+re*O),B=se*4;if(b){const F=X-k;c[B]=$(I[B]+F),c[B+1]=$(I[B+1]+F),c[B+2]=$(I[B+2]+F),c[B+3]=I[B+3]}else c[B]=c[B+1]=c[B+2]=X,c[B+3]=I[B+3]}for(let G=0;G<m;G++){let te=G*4,se=((g-1)*m+G)*4;c[te]=I[te],c[te+1]=I[te+1],c[te+2]=I[te+2],c[te+3]=I[te+3],c[se]=I[se],c[se+1]=I[se+1],c[se+2]=I[se+2],c[se+3]=I[se+3]}for(let G=1;G<g-1;G++){let te=G*m*4,se=(G*m+(m-1))*4;c[te]=I[te],c[te+1]=I[te+1],c[te+2]=I[te+2],c[te+3]=I[te+3],c[se]=I[se],c[se+1]=I[se+1],c[se+2]=I[se+2],c[se+3]=I[se+3]}return e};Re.addGetterSetter(Pt,"embossStrength",.5,kt(),Re.afterSetFilter);Re.addGetterSetter(Pt,"embossWhiteLevel",.5,kt(),Re.afterSetFilter);Re.addGetterSetter(Pt,"embossDirection","top-left",void 0,Re.afterSetFilter);Re.addGetterSetter(Pt,"embossBlend",!1,void 0,Re.afterSetFilter);function Jg(e,t,n,r,i){const a=n-t,o=i-r;if(a===0)return r+o/2;if(o===0)return r;let s=(e-t)/a;return s=o*s+r,s}const uA=function(e){const t=e.data,n=t.length;let r=t[0],i=r,a,o=t[1],s=o,u,h=t[2],c=h,m;const g=this.enhance();if(g===0)return;for(let k=0;k<n;k+=4)a=t[k+0],a<r?r=a:a>i&&(i=a),u=t[k+1],u<o?o=u:u>s&&(s=u),m=t[k+2],m<h?h=m:m>c&&(c=m);i===r&&(i=255,r=0),s===o&&(s=255,o=0),c===h&&(c=255,h=0);let d,y,_,x,b,S;if(g>0)d=i+g*(255-i),y=r-g*(r-0),_=s+g*(255-s),x=o-g*(o-0),b=c+g*(255-c),S=h-g*(h-0);else{const k=(i+r)*.5;d=i+g*(i-k),y=r+g*(r-k);const E=(s+o)*.5;_=s+g*(s-E),x=o+g*(o-E);const A=(c+h)*.5;b=c+g*(c-A),S=h+g*(h-A)}for(let k=0;k<n;k+=4)t[k+0]=Jg(t[k+0],r,i,y,d),t[k+1]=Jg(t[k+1],o,s,x,_),t[k+2]=Jg(t[k+2],h,c,S,b)};Re.addGetterSetter(Pt,"enhance",0,kt(),Re.afterSetFilter);const cA=function(e){const t=e.data,n=t.length;for(let r=0;r<n;r+=4){const i=.34*t[r]+.5*t[r+1]+.16*t[r+2];t[r]=i,t[r+1]=i,t[r+2]=i}};Re.addGetterSetter(Pt,"hue",0,kt(),Re.afterSetFilter);Re.addGetterSetter(Pt,"saturation",0,kt(),Re.afterSetFilter);Re.addGetterSetter(Pt,"luminance",0,kt(),Re.afterSetFilter);const fA=function(e){const t=e.data,n=t.length,r=1,i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o=this.luminance()*127,s=r*i*Math.cos(a*Math.PI/180),u=r*i*Math.sin(a*Math.PI/180),h=.299*r+.701*s+.167*u,c=.587*r-.587*s+.33*u,m=.114*r-.114*s-.497*u,g=.299*r-.299*s-.328*u,d=.587*r+.413*s+.035*u,y=.114*r-.114*s+.293*u,_=.299*r-.3*s+1.25*u,x=.587*r-.586*s-1.05*u,b=.114*r+.886*s-.2*u;let S,k,E,A;for(let R=0;R<n;R+=4)S=t[R+0],k=t[R+1],E=t[R+2],A=t[R+3],t[R+0]=h*S+c*k+m*E+o,t[R+1]=g*S+d*k+y*E+o,t[R+2]=_*S+x*k+b*E+o,t[R+3]=A},hA=function(e){const t=e.data,n=t.length,r=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o=r*i*Math.cos(a*Math.PI/180),s=r*i*Math.sin(a*Math.PI/180),u=.299*r+.701*o+.167*s,h=.587*r-.587*o+.33*s,c=.114*r-.114*o-.497*s,m=.299*r-.299*o-.328*s,g=.587*r+.413*o+.035*s,d=.114*r-.114*o+.293*s,y=.299*r-.3*o+1.25*s,_=.587*r-.586*o-1.05*s,x=.114*r+.886*o-.2*s;for(let b=0;b<n;b+=4){const S=t[b+0],k=t[b+1],E=t[b+2],A=t[b+3];t[b+0]=u*S+h*k+c*E,t[b+1]=m*S+g*k+d*E,t[b+2]=y*S+_*k+x*E,t[b+3]=A}};Re.addGetterSetter(Pt,"hue",0,kt(),Re.afterSetFilter);Re.addGetterSetter(Pt,"saturation",0,kt(),Re.afterSetFilter);Re.addGetterSetter(Pt,"value",0,kt(),Re.afterSetFilter);const dA=function(e){const t=e.data,n=t.length;for(let r=0;r<n;r+=4)t[r]=255-t[r],t[r+1]=255-t[r+1],t[r+2]=255-t[r+2]},pA=function(e,t,n){const r=e.data,i=t.data,a=e.width,o=e.height,s=n.polarCenterX||a/2,u=n.polarCenterY||o/2;let h=Math.sqrt(s*s+u*u),c=a-s,m=o-u;const g=Math.sqrt(c*c+m*m);h=g>h?g:h;const d=o,y=a,_=360/y*Math.PI/180;for(let x=0;x<y;x+=1){const b=Math.sin(x*_),S=Math.cos(x*_);for(let k=0;k<d;k+=1){c=Math.floor(s+h*k/d*S),m=Math.floor(u+h*k/d*b);let E=(m*a+c)*4;const A=r[E+0],R=r[E+1],O=r[E+2],I=r[E+3];E=(x+k*a)*4,i[E+0]=A,i[E+1]=R,i[E+2]=O,i[E+3]=I}}},gA=function(e,t,n){const r=e.data,i=t.data,a=e.width,o=e.height,s=n.polarCenterX||a/2,u=n.polarCenterY||o/2;let h=Math.sqrt(s*s+u*u),c=a-s,m=o-u;const g=Math.sqrt(c*c+m*m);h=g>h?g:h;const d=o,y=a,_=0;let x,b;for(c=0;c<a;c+=1)for(m=0;m<o;m+=1){const S=c-s,k=m-u,E=Math.sqrt(S*S+k*k)*d/h;let A=(Math.atan2(k,S)*180/Math.PI+360+_)%360;A=A*y/360,x=Math.floor(A),b=Math.floor(E);let R=(b*a+x)*4;const O=r[R+0],I=r[R+1],j=r[R+2],D=r[R+3];R=(m*a+c)*4,i[R+0]=O,i[R+1]=I,i[R+2]=j,i[R+3]=D}},mA=function(e){const t=e.width,n=e.height;let r,i,a,o,s,u,h,c,m,g,d=Math.round(this.kaleidoscopePower());const y=Math.round(this.kaleidoscopeAngle()),_=Math.floor(t*(y%360)/360);if(d<1)return;const x=Ze.createCanvasElement();x.width=t,x.height=n;const b=x.getContext("2d").getImageData(0,0,t,n);Ze.releaseCanvas(x),pA(e,b,{polarCenterX:t/2,polarCenterY:n/2});let S=t/Math.pow(2,d);for(;S<=8;)S=S*2,d-=1;S=Math.ceil(S);let k=S,E=0,A=k,R=1;for(_+S>t&&(E=k,A=0,R=-1),i=0;i<n;i+=1)for(r=E;r!==A;r+=R)a=Math.round(r+_)%t,m=(t*i+a)*4,s=b.data[m+0],u=b.data[m+1],h=b.data[m+2],c=b.data[m+3],g=(t*i+r)*4,b.data[g+0]=s,b.data[g+1]=u,b.data[g+2]=h,b.data[g+3]=c;for(i=0;i<n;i+=1)for(k=Math.floor(S),o=0;o<d;o+=1){for(r=0;r<k+1;r+=1)m=(t*i+r)*4,s=b.data[m+0],u=b.data[m+1],h=b.data[m+2],c=b.data[m+3],g=(t*i+k*2-r-1)*4,b.data[g+0]=s,b.data[g+1]=u,b.data[g+2]=h,b.data[g+3]=c;k*=2}gA(b,e,{})};Re.addGetterSetter(Pt,"kaleidoscopePower",2,kt(),Re.afterSetFilter);Re.addGetterSetter(Pt,"kaleidoscopeAngle",0,kt(),Re.afterSetFilter);function I1(e,t,n){let r=(n*e.width+t)*4;const i=[];return i.push(e.data[r++],e.data[r++],e.data[r++],e.data[r++]),i}function Wd(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}function vA(e){const t=[0,0,0];for(let n=0;n<e.length;n++)t[0]+=e[n][0],t[1]+=e[n][1],t[2]+=e[n][2];return t[0]/=e.length,t[1]/=e.length,t[2]/=e.length,t}function yA(e,t){const n=I1(e,0,0),r=I1(e,e.width-1,0),i=I1(e,0,e.height-1),a=I1(e,e.width-1,e.height-1),o=t||10;if(Wd(n,r)<o&&Wd(r,a)<o&&Wd(a,i)<o&&Wd(i,n)<o){const s=vA([r,n,a,i]),u=[];for(let h=0;h<e.width*e.height;h++){const c=Wd(s,[e.data[h*4],e.data[h*4+1],e.data[h*4+2]]);u[h]=c<o?0:255}return u}}function bA(e,t){for(let n=0;n<e.width*e.height;n++)e.data[4*n+3]=t[n]}function wA(e,t,n){const r=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),o=[];for(let s=0;s<n;s++)for(let u=0;u<t;u++){const h=s*t+u;let c=0;for(let m=0;m<i;m++)for(let g=0;g<i;g++){const d=s+m-a,y=u+g-a;if(d>=0&&d<n&&y>=0&&y<t){const _=d*t+y,x=r[m*i+g];c+=e[_]*x}}o[h]=c===2040?255:0}return o}function xA(e,t,n){const r=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),o=[];for(let s=0;s<n;s++)for(let u=0;u<t;u++){const h=s*t+u;let c=0;for(let m=0;m<i;m++)for(let g=0;g<i;g++){const d=s+m-a,y=u+g-a;if(d>=0&&d<n&&y>=0&&y<t){const _=d*t+y,x=r[m*i+g];c+=e[_]*x}}o[h]=c>=1020?255:0}return o}function _A(e,t,n){const r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),o=[];for(let s=0;s<n;s++)for(let u=0;u<t;u++){const h=s*t+u;let c=0;for(let m=0;m<i;m++)for(let g=0;g<i;g++){const d=s+m-a,y=u+g-a;if(d>=0&&d<n&&y>=0&&y<t){const _=d*t+y,x=r[m*i+g];c+=e[_]*x}}o[h]=c}return o}const SA=function(e){const t=this.threshold();let n=yA(e,t);return n&&(n=wA(n,e.width,e.height),n=xA(n,e.width,e.height),n=_A(n,e.width,e.height),bA(e,n)),e};Re.addGetterSetter(Pt,"threshold",0,kt(),Re.afterSetFilter);const EA=function(e){const t=this.noise()*255,n=e.data,r=n.length,i=t/2;for(let a=0;a<r;a+=4)n[a+0]+=i-2*i*Math.random(),n[a+1]+=i-2*i*Math.random(),n[a+2]+=i-2*i*Math.random()};Re.addGetterSetter(Pt,"noise",.2,kt(),Re.afterSetFilter);const kA=function(e){let t=Math.ceil(this.pixelSize()),n=e.width,r=e.height,i=Math.ceil(n/t),a=Math.ceil(r/t),o=e.data;if(t<=0){Ze.error("pixelSize value can not be <= 0");return}for(let s=0;s<i;s+=1)for(let u=0;u<a;u+=1){let h=0,c=0,m=0,g=0;const d=s*t,y=d+t,_=u*t,x=_+t;let b=0;for(let S=d;S<y;S+=1)if(!(S>=n))for(let k=_;k<x;k+=1){if(k>=r)continue;const E=(n*k+S)*4;h+=o[E+0],c+=o[E+1],m+=o[E+2],g+=o[E+3],b+=1}h=h/b,c=c/b,m=m/b,g=g/b;for(let S=d;S<y;S+=1)if(!(S>=n))for(let k=_;k<x;k+=1){if(k>=r)continue;const E=(n*k+S)*4;o[E+0]=h,o[E+1]=c,o[E+2]=m,o[E+3]=g}}};Re.addGetterSetter(Pt,"pixelSize",8,kt(),Re.afterSetFilter);const AA=function(e){const t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t;for(let a=0;a<r;a+=1)n[a]=Math.floor(n[a]/i)*i};Re.addGetterSetter(Pt,"levels",.5,kt(),Re.afterSetFilter);const PA=function(e){const t=e.data,n=t.length,r=this.red(),i=this.green(),a=this.blue();for(let o=0;o<n;o+=4){const s=(.34*t[o]+.5*t[o+1]+.16*t[o+2])/255;t[o]=s*r,t[o+1]=s*i,t[o+2]=s*a,t[o+3]=t[o+3]}};Re.addGetterSetter(Pt,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Re.addGetterSetter(Pt,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Re.addGetterSetter(Pt,"blue",0,i8,Re.afterSetFilter);const OA=function(e){const t=e.data,n=t.length,r=this.red(),i=this.green(),a=this.blue(),o=this.alpha();for(let s=0;s<n;s+=4){const u=1-o;t[s]=r*o+t[s]*u,t[s+1]=i*o+t[s+1]*u,t[s+2]=a*o+t[s+2]*u}};Re.addGetterSetter(Pt,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Re.addGetterSetter(Pt,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Re.addGetterSetter(Pt,"blue",0,i8,Re.afterSetFilter);Re.addGetterSetter(Pt,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});const CA=function(e){const t=e.data,n=t.length;for(let r=0;r<n;r+=4){const i=t[r+0],a=t[r+1],o=t[r+2];t[r+0]=Math.min(255,i*.393+a*.769+o*.189),t[r+1]=Math.min(255,i*.349+a*.686+o*.168),t[r+2]=Math.min(255,i*.272+a*.534+o*.131)}},LA=function(e){const n=e.data;for(let r=0;r<n.length;r+=4){const i=n[r],a=n[r+1],o=n[r+2];.2126*i+.7152*a+.0722*o>=128&&(n[r]=255-i,n[r+1]=255-a,n[r+2]=255-o)}return e},NA=function(e){const t=this.threshold()*255,n=e.data,r=n.length;for(let i=0;i<r;i+=1)n[i]=n[i]<t?0:255};Re.addGetterSetter(Pt,"threshold",.5,kt(),Re.afterSetFilter);const un=hh.Util._assign(hh,{Arc:kc,Arrow:Eh,Circle:Ad,Ellipse:Of,Image:lu,Label:iy,Tag:kh,Line:Ac,Path:Cl,Rect:zp,RegularPolygon:Cf,Ring:Ah,Sprite:Yu,Star:Lf,Text:yi,TextPath:Da,Transformer:tr,Wedge:Pc,Filters:{Blur:iA,Brightness:oA,Brighten:aA,Contrast:sA,Emboss:lA,Enhance:uA,Grayscale:cA,HSL:fA,HSV:hA,Invert:dA,Kaleidoscope:mA,Mask:SA,Noise:EA,Pixelate:kA,Posterize:AA,RGB:PA,RGBA:OA,Sepia:CA,Solarize:LA,Threshold:NA}});var e2={exports:{}};var t2,ob;function TA(){return ob||(ob=1,t2=function(t){var n={},r=Mp(),i=qv(),a=Object.assign;function o(p){for(var v="https://reactjs.org/docs/error-decoder.html?invariant="+p,L=1;L<arguments.length;L++)v+="&args[]="+encodeURIComponent(arguments[L]);return"Minified React error #"+p+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),h=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),y=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),A=Symbol.iterator;function R(p){return p===null||typeof p!="object"?null:(p=A&&p[A]||p["@@iterator"],typeof p=="function"?p:null)}function O(p){if(p==null)return null;if(typeof p=="function")return p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case c:return"Fragment";case h:return"Portal";case g:return"Profiler";case m:return"StrictMode";case x:return"Suspense";case b:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case y:return(p.displayName||"Context")+".Consumer";case d:return(p._context.displayName||"Context")+".Provider";case _:var v=p.render;return p=p.displayName,p||(p=v.displayName||v.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case S:return v=p.displayName||null,v!==null?v:O(p.type)||"Memo";case k:v=p._payload,p=p._init;try{return O(p(v))}catch{}}return null}function I(p){var v=p.type;switch(p.tag){case 24:return"Cache";case 9:return(v.displayName||"Context")+".Consumer";case 10:return(v._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return p=v.render,p=p.displayName||p.name||"",v.displayName||(p!==""?"ForwardRef("+p+")":"ForwardRef");case 7:return"Fragment";case 5:return v;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return O(v);case 8:return v===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 v=="function")return v.displayName||v.name||null;if(typeof v=="string")return v}return null}function j(p){var v=p,L=p;if(p.alternate)for(;v.return;)v=v.return;else{p=v;do v=p,(v.flags&4098)!==0&&(L=v.return),p=v.return;while(p)}return v.tag===3?L:null}function D(p){if(j(p)!==p)throw Error(o(188))}function C(p){var v=p.alternate;if(!v){if(v=j(p),v===null)throw Error(o(188));return v!==p?null:p}for(var L=p,U=v;;){var W=L.return;if(W===null)break;var ae=W.alternate;if(ae===null){if(U=W.return,U!==null){L=U;continue}break}if(W.child===ae.child){for(ae=W.child;ae;){if(ae===L)return D(W),p;if(ae===U)return D(W),v;ae=ae.sibling}throw Error(o(188))}if(L.return!==U.return)L=W,U=ae;else{for(var ke=!1,Ve=W.child;Ve;){if(Ve===L){ke=!0,L=W,U=ae;break}if(Ve===U){ke=!0,U=W,L=ae;break}Ve=Ve.sibling}if(!ke){for(Ve=ae.child;Ve;){if(Ve===L){ke=!0,L=ae,U=W;break}if(Ve===U){ke=!0,U=ae,L=W;break}Ve=Ve.sibling}if(!ke)throw Error(o(189))}}if(L.alternate!==U)throw Error(o(190))}if(L.tag!==3)throw Error(o(188));return L.stateNode.current===L?p:v}function N(p){return p=C(p),p!==null?$(p):null}function $(p){if(p.tag===5||p.tag===6)return p;for(p=p.child;p!==null;){var v=$(p);if(v!==null)return v;p=p.sibling}return null}function G(p){if(p.tag===5||p.tag===6)return p;for(p=p.child;p!==null;){if(p.tag!==4){var v=G(p);if(v!==null)return v}p=p.sibling}return null}var te=Array.isArray,se=t.getPublicInstance,ee=t.getRootHostContext,Q=t.getChildHostContext,re=t.prepareForCommit,X=t.resetAfterCommit,B=t.createInstance,F=t.appendInitialChild,z=t.finalizeInitialChildren,Y=t.prepareUpdate,J=t.shouldSetTextContent,K=t.createTextInstance,ie=t.scheduleTimeout,fe=t.cancelTimeout,ue=t.noTimeout,_e=t.isPrimaryRenderer,Ce=t.supportsMutation,$e=t.supportsPersistence,ze=t.supportsHydration,tt=t.getInstanceFromNode,pe=t.preparePortalMount,ut=t.getCurrentEventPriority,be=t.detachDeletedInstance,ge=t.supportsMicrotasks,xe=t.scheduleMicrotask,Te=t.supportsTestSelectors,Me=t.findFiberRoot,ve=t.getBoundingRect,ye=t.getTextContent,we=t.isHiddenSubtree,je=t.matchAccessibilityRole,Le=t.setFocusIfFocusable,Ye=t.setupIntersectionObserver,lt=t.appendChild,rt=t.appendChildToContainer,ot=t.commitTextUpdate,dt=t.commitMount,Ct=t.commitUpdate,Zt=t.insertBefore,on=t.insertInContainerBefore,an=t.removeChild,We=t.removeChildFromContainer,Be=t.resetTextContent,$t=t.hideInstance,At=t.hideTextInstance,Lt=t.unhideInstance,Tt=t.unhideTextInstance,tn=t.clearContainer,Wt=t.cloneInstance,hn=t.createContainerChildSet,bi=t.appendChildToContainerChildSet,nr=t.finalizeContainerChildren,ei=t.replaceContainerChildren,dr=t.cloneHiddenInstance,Jt=t.cloneHiddenTextInstance,ua=t.canHydrateInstance,Fa=t.canHydrateTextInstance,ti=t.canHydrateSuspenseInstance,Ki=t.isSuspenseInstancePending,Hn=t.isSuspenseInstanceFallback,Or=t.getSuspenseInstanceFallbackErrorDetails,Dr=t.registerSuspenseInstanceRetry,Ea=t.getNextHydratableSibling,Go=t.getFirstHydratableChild,ka=t.getFirstHydratableChildWithinContainer,io=t.getFirstHydratableChildWithinSuspenseInstance,ui=t.hydrateInstance,Aa=t.hydrateTextInstance,Pa=t.hydrateSuspenseInstance,Wo=t.getNextHydratableInstanceAfterSuspenseInstance,zi=t.commitHydratedContainer,ao=t.commitHydratedSuspenseInstance,Fs=t.clearSuspenseBoundary,as=t.clearSuspenseBoundaryFromContainer,fu=t.shouldDeleteUnhydratedTailInstances,If=t.didNotMatchHydratedContainerTextInstance,Cr=t.didNotMatchHydratedTextInstance,hu;function os(p){if(hu===void 0)try{throw Error()}catch(L){var v=L.stack.trim().match(/\n( *(at )?)/);hu=v&&v[1]||""}return`
|
|
25
|
+
`+hu+p}var Oa=!1;function ss(p,v){if(!p||Oa)return"";Oa=!0;var L=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(v)if(v=function(){throw Error()},Object.defineProperty(v.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(v,[])}catch(_t){var U=_t}Reflect.construct(p,[],v)}else{try{v.call()}catch(_t){U=_t}p.call(v.prototype)}else{try{throw Error()}catch(_t){U=_t}p()}}catch(_t){if(_t&&U&&typeof _t.stack=="string"){for(var W=_t.stack.split(`
|
|
26
|
+
`),ae=U.stack.split(`
|
|
27
|
+
`),ke=W.length-1,Ve=ae.length-1;1<=ke&&0<=Ve&&W[ke]!==ae[Ve];)Ve--;for(;1<=ke&&0<=Ve;ke--,Ve--)if(W[ke]!==ae[Ve]){if(ke!==1||Ve!==1)do if(ke--,Ve--,0>Ve||W[ke]!==ae[Ve]){var st=`
|
|
28
|
+
`+W[ke].replace(" at new "," at ");return p.displayName&&st.includes("<anonymous>")&&(st=st.replace("<anonymous>",p.displayName)),st}while(1<=ke&&0<=Ve);break}}}finally{Oa=!1,Error.prepareStackTrace=L}return(p=p?p.displayName||p.name:"")?os(p):""}var Cc=Object.prototype.hasOwnProperty,hl=[],Po=-1;function wi(p){return{current:p}}function pr(p){0>Po||(p.current=hl[Po],hl[Po]=null,Po--)}function wn(p,v){Po++,hl[Po]=p.current,p.current=v}var oo={},Ui=wi(oo),Gn=wi(!1),so=oo;function qi(p,v){var L=p.type.contextTypes;if(!L)return oo;var U=p.stateNode;if(U&&U.__reactInternalMemoizedUnmaskedChildContext===v)return U.__reactInternalMemoizedMaskedChildContext;var W={},ae;for(ae in L)W[ae]=v[ae];return U&&(p=p.stateNode,p.__reactInternalMemoizedUnmaskedChildContext=v,p.__reactInternalMemoizedMaskedChildContext=W),W}function qr(p){return p=p.childContextTypes,p!=null}function ls(){pr(Gn),pr(Ui)}function lo(p,v,L){if(Ui.current!==oo)throw Error(o(168));wn(Ui,v),wn(Gn,L)}function xi(p,v,L){var U=p.stateNode;if(v=v.childContextTypes,typeof U.getChildContext!="function")return L;U=U.getChildContext();for(var W in U)if(!(W in v))throw Error(o(108,I(p)||"Unknown",W));return a({},L,U)}function Ba(p){return p=(p=p.stateNode)&&p.__reactInternalMemoizedMergedChildContext||oo,so=Ui.current,wn(Ui,p),wn(Gn,Gn.current),!0}function du(p,v,L){var U=p.stateNode;if(!U)throw Error(o(169));L?(p=xi(p,v,so),U.__reactInternalMemoizedMergedChildContext=p,pr(Gn),pr(Ui),wn(Ui,p)):pr(Gn),wn(Gn,L)}var Ca=Math.clz32?Math.clz32:pu,Rl=Math.log,us=Math.LN2;function pu(p){return p>>>=0,p===0?32:31-(Rl(p)/us|0)|0}var jn=64,cs=4194304;function Oo(p){switch(p&-p){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 p&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return p&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return p}}function dl(p,v){var L=p.pendingLanes;if(L===0)return 0;var U=0,W=p.suspendedLanes,ae=p.pingedLanes,ke=L&268435455;if(ke!==0){var Ve=ke&~W;Ve!==0?U=Oo(Ve):(ae&=ke,ae!==0&&(U=Oo(ae)))}else ke=L&~W,ke!==0?U=Oo(ke):ae!==0&&(U=Oo(ae));if(U===0)return 0;if(v!==0&&v!==U&&(v&W)===0&&(W=U&-U,ae=v&-v,W>=ae||W===16&&(ae&4194240)!==0))return v;if((U&4)!==0&&(U|=L&16),v=p.entangledLanes,v!==0)for(p=p.entanglements,v&=U;0<v;)L=31-Ca(v),W=1<<L,U|=p[L],v&=~W;return U}function Lc(p,v){switch(p){case 1:case 2:case 4:return v+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 v+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 Nc(p,v){for(var L=p.suspendedLanes,U=p.pingedLanes,W=p.expirationTimes,ae=p.pendingLanes;0<ae;){var ke=31-Ca(ae),Ve=1<<ke,st=W[ke];st===-1?((Ve&L)===0||(Ve&U)!==0)&&(W[ke]=Lc(Ve,v)):st<=v&&(p.expiredLanes|=Ve),ae&=~Ve}}function pl(p){return p=p.pendingLanes&-1073741825,p!==0?p:p&1073741824?1073741824:0}function Ml(){var p=jn;return jn<<=1,(jn&4194240)===0&&(jn=64),p}function ca(p){for(var v=[],L=0;31>L;L++)v.push(p);return v}function za(p,v,L){p.pendingLanes|=v,v!==536870912&&(p.suspendedLanes=0,p.pingedLanes=0),p=p.eventTimes,v=31-Ca(v),p[v]=L}function Ua(p,v){var L=p.pendingLanes&~v;p.pendingLanes=v,p.suspendedLanes=0,p.pingedLanes=0,p.expiredLanes&=v,p.mutableReadLanes&=v,p.entangledLanes&=v,v=p.entanglements;var U=p.eventTimes;for(p=p.expirationTimes;0<L;){var W=31-Ca(L),ae=1<<W;v[W]=0,U[W]=-1,p[W]=-1,L&=~ae}}function qa(p,v){var L=p.entangledLanes|=v;for(p=p.entanglements;L;){var U=31-Ca(L),W=1<<U;W&v|p[U]&v&&(p[U]|=v),L&=~W}}var Ln=0;function cn(p){return p&=-p,1<p?4<p?(p&268435455)!==0?16:536870912:4:1}var Co=i.unstable_scheduleCallback,Tc=i.unstable_cancelCallback,Rc=i.unstable_shouldYield,uo=i.unstable_requestPaint,Er=i.unstable_now,gu=i.unstable_ImmediatePriority,mu=i.unstable_UserBlockingPriority,Bs=i.unstable_NormalPriority,Ku=i.unstable_IdlePriority,$a=null,fa=null;function Ha(p){if(fa&&typeof fa.onCommitFiberRoot=="function")try{fa.onCommitFiberRoot($a,p,void 0,(p.current.flags&128)===128)}catch{}}function vu(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var La=typeof Object.is=="function"?Object.is:vu,co=null,zs=!1,Ga=!1;function gl(p){co===null?co=[p]:co.push(p)}function Il(p){zs=!0,gl(p)}function ci(){if(!Ga&&co!==null){Ga=!0;var p=0,v=Ln;try{var L=co;for(Ln=1;p<L.length;p++){var U=L[p];do U=U(!0);while(U!==null)}co=null,zs=!1}catch(W){throw co!==null&&(co=co.slice(p+1)),Co(gu,ci),W}finally{Ln=v,Ga=!1}}return null}var Wa=[],fo=0,ml=null,fs=0,$r=[],fi=0,ni=null,_i=1,Va="";function q(p,v){Wa[fo++]=fs,Wa[fo++]=ml,ml=p,fs=v}function ce(p,v,L){$r[fi++]=_i,$r[fi++]=Va,$r[fi++]=ni,ni=p;var U=_i;p=Va;var W=32-Ca(U)-1;U&=~(1<<W),L+=1;var ae=32-Ca(v)+W;if(30<ae){var ke=W-W%5;ae=(U&(1<<ke)-1).toString(32),U>>=ke,W-=ke,_i=1<<32-Ca(v)+W|L<<W|U,Va=ae+p}else _i=1<<ae|L<<W|U,Va=p}function Oe(p){p.return!==null&&(q(p,1),ce(p,1,0))}function Ie(p){for(;p===ml;)ml=Wa[--fo],Wa[fo]=null,fs=Wa[--fo],Wa[fo]=null;for(;p===ni;)ni=$r[--fi],$r[fi]=null,Va=$r[--fi],$r[fi]=null,_i=$r[--fi],$r[fi]=null}var He=null,ft=null,pt=!1,Ft=!1,jt=null;function mn(p,v){var L=ts(5,null,null,0);L.elementType="DELETED",L.stateNode=v,L.return=p,v=p.deletions,v===null?(p.deletions=[L],p.flags|=16):v.push(L)}function xn(p,v){switch(p.tag){case 5:return v=ua(v,p.type,p.pendingProps),v!==null?(p.stateNode=v,He=p,ft=Go(v),!0):!1;case 6:return v=Fa(v,p.pendingProps),v!==null?(p.stateNode=v,He=p,ft=null,!0):!1;case 13:if(v=ti(v),v!==null){var L=ni!==null?{id:_i,overflow:Va}:null;return p.memoizedState={dehydrated:v,treeContext:L,retryLane:1073741824},L=ts(18,null,null,0),L.stateNode=v,L.return=p,p.child=L,He=p,ft=null,!0}return!1;default:return!1}}function Dn(p){return(p.mode&1)!==0&&(p.flags&128)===0}function Lr(p){if(pt){var v=ft;if(v){var L=v;if(!xn(p,v)){if(Dn(p))throw Error(o(418));v=Ea(L);var U=He;v&&xn(p,v)?mn(U,L):(p.flags=p.flags&-4097|2,pt=!1,He=p)}}else{if(Dn(p))throw Error(o(418));p.flags=p.flags&-4097|2,pt=!1,He=p}}}function hi(p){for(p=p.return;p!==null&&p.tag!==5&&p.tag!==3&&p.tag!==13;)p=p.return;He=p}function lr(p){if(!ze||p!==He)return!1;if(!pt)return hi(p),pt=!0,!1;if(p.tag!==3&&(p.tag!==5||fu(p.type)&&!J(p.type,p.memoizedProps))){var v=ft;if(v){if(Dn(p))throw Si(),Error(o(418));for(;v;)mn(p,v),v=Ea(v)}}if(hi(p),p.tag===13){if(!ze)throw Error(o(316));if(p=p.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(o(317));ft=Wo(p)}else ft=He?Ea(p.stateNode):null;return!0}function Si(){for(var p=ft;p;)p=Ea(p)}function kr(){ze&&(ft=He=null,Ft=pt=!1)}function Li(p){jt===null?jt=[p]:jt.push(p)}var Us=s.ReactCurrentBatchConfig;function Ya(p,v){if(La(p,v))return!0;if(typeof p!="object"||p===null||typeof v!="object"||v===null)return!1;var L=Object.keys(p),U=Object.keys(v);if(L.length!==U.length)return!1;for(U=0;U<L.length;U++){var W=L[U];if(!Cc.call(v,W)||!La(p[W],v[W]))return!1}return!0}function qs(p){switch(p.tag){case 5:return os(p.type);case 16:return os("Lazy");case 13:return os("Suspense");case 19:return os("SuspenseList");case 0:case 2:case 15:return p=ss(p.type,!1),p;case 11:return p=ss(p.type.render,!1),p;case 1:return p=ss(p.type,!0),p;default:return""}}function Vo(p,v,L){if(p=L.ref,p!==null&&typeof p!="function"&&typeof p!="object"){if(L._owner){if(L=L._owner,L){if(L.tag!==1)throw Error(o(309));var U=L.stateNode}if(!U)throw Error(o(147,p));var W=U,ae=""+p;return v!==null&&v.ref!==null&&typeof v.ref=="function"&&v.ref._stringRef===ae?v.ref:(v=function(ke){var Ve=W.refs;ke===null?delete Ve[ae]:Ve[ae]=ke},v._stringRef=ae,v)}if(typeof p!="string")throw Error(o(284));if(!L._owner)throw Error(o(290,p))}return p}function $s(p,v){throw p=Object.prototype.toString.call(v),Error(o(31,p==="[object Object]"?"object with keys {"+Object.keys(v).join(", ")+"}":p))}function Hs(p){var v=p._init;return v(p._payload)}function vl(p){function v(it,Ke){if(p){var gt=it.deletions;gt===null?(it.deletions=[Ke],it.flags|=16):gt.push(Ke)}}function L(it,Ke){if(!p)return null;for(;Ke!==null;)v(it,Ke),Ke=Ke.sibling;return null}function U(it,Ke){for(it=new Map;Ke!==null;)Ke.key!==null?it.set(Ke.key,Ke):it.set(Ke.index,Ke),Ke=Ke.sibling;return it}function W(it,Ke){return it=Nu(it,Ke),it.index=0,it.sibling=null,it}function ae(it,Ke,gt){return it.index=gt,p?(gt=it.alternate,gt!==null?(gt=gt.index,gt<Ke?(it.flags|=2,Ke):gt):(it.flags|=2,Ke)):(it.flags|=1048576,Ke)}function ke(it){return p&&it.alternate===null&&(it.flags|=2),it}function Ve(it,Ke,gt,Mt){return Ke===null||Ke.tag!==6?(Ke=Kc(gt,it.mode,Mt),Ke.return=it,Ke):(Ke=W(Ke,gt),Ke.return=it,Ke)}function st(it,Ke,gt,Mt){var ln=gt.type;return ln===c?Gt(it,Ke,gt.props.children,Mt,gt.key):Ke!==null&&(Ke.elementType===ln||typeof ln=="object"&&ln!==null&&ln.$$typeof===k&&Hs(ln)===Ke.type)?(Mt=W(Ke,gt.props),Mt.ref=Vo(it,Ke,gt),Mt.return=it,Mt):(Mt=Bh(gt.type,gt.key,gt.props,null,it.mode,Mt),Mt.ref=Vo(it,Ke,gt),Mt.return=it,Mt)}function _t(it,Ke,gt,Mt){return Ke===null||Ke.tag!==4||Ke.stateNode.containerInfo!==gt.containerInfo||Ke.stateNode.implementation!==gt.implementation?(Ke=zh(gt,it.mode,Mt),Ke.return=it,Ke):(Ke=W(Ke,gt.children||[]),Ke.return=it,Ke)}function Gt(it,Ke,gt,Mt,ln){return Ke===null||Ke.tag!==7?(Ke=Ma(gt,it.mode,Mt,ln),Ke.return=it,Ke):(Ke=W(Ke,gt),Ke.return=it,Ke)}function kn(it,Ke,gt){if(typeof Ke=="string"&&Ke!==""||typeof Ke=="number")return Ke=Kc(""+Ke,it.mode,gt),Ke.return=it,Ke;if(typeof Ke=="object"&&Ke!==null){switch(Ke.$$typeof){case u:return gt=Bh(Ke.type,Ke.key,Ke.props,null,it.mode,gt),gt.ref=Vo(it,null,Ke),gt.return=it,gt;case h:return Ke=zh(Ke,it.mode,gt),Ke.return=it,Ke;case k:var Mt=Ke._init;return kn(it,Mt(Ke._payload),gt)}if(te(Ke)||R(Ke))return Ke=Ma(Ke,it.mode,gt,null),Ke.return=it,Ke;$s(it,Ke)}return null}function Rt(it,Ke,gt,Mt){var ln=Ke!==null?Ke.key:null;if(typeof gt=="string"&>!==""||typeof gt=="number")return ln!==null?null:Ve(it,Ke,""+gt,Mt);if(typeof gt=="object"&>!==null){switch(gt.$$typeof){case u:return gt.key===ln?st(it,Ke,gt,Mt):null;case h:return gt.key===ln?_t(it,Ke,gt,Mt):null;case k:return ln=gt._init,Rt(it,Ke,ln(gt._payload),Mt)}if(te(gt)||R(gt))return ln!==null?null:Gt(it,Ke,gt,Mt,null);$s(it,gt)}return null}function Ur(it,Ke,gt,Mt,ln){if(typeof Mt=="string"&&Mt!==""||typeof Mt=="number")return it=it.get(gt)||null,Ve(Ke,it,""+Mt,ln);if(typeof Mt=="object"&&Mt!==null){switch(Mt.$$typeof){case u:return it=it.get(Mt.key===null?gt:Mt.key)||null,st(Ke,it,Mt,ln);case h:return it=it.get(Mt.key===null?gt:Mt.key)||null,_t(Ke,it,Mt,ln);case k:var Tn=Mt._init;return Ur(it,Ke,gt,Tn(Mt._payload),ln)}if(te(Mt)||R(Mt))return it=it.get(gt)||null,Gt(Ke,it,Mt,ln,null);$s(Ke,Mt)}return null}function xr(it,Ke,gt,Mt){for(var ln=null,Tn=null,An=Ke,Zn=Ke=0,na=null;An!==null&&Zn<gt.length;Zn++){An.index>Zn?(na=An,An=null):na=An.sibling;var Vn=Rt(it,An,gt[Zn],Mt);if(Vn===null){An===null&&(An=na);break}p&&An&&Vn.alternate===null&&v(it,An),Ke=ae(Vn,Ke,Zn),Tn===null?ln=Vn:Tn.sibling=Vn,Tn=Vn,An=na}if(Zn===gt.length)return L(it,An),pt&&q(it,Zn),ln;if(An===null){for(;Zn<gt.length;Zn++)An=kn(it,gt[Zn],Mt),An!==null&&(Ke=ae(An,Ke,Zn),Tn===null?ln=An:Tn.sibling=An,Tn=An);return pt&&q(it,Zn),ln}for(An=U(it,An);Zn<gt.length;Zn++)na=Ur(An,it,Zn,gt[Zn],Mt),na!==null&&(p&&na.alternate!==null&&An.delete(na.key===null?Zn:na.key),Ke=ae(na,Ke,Zn),Tn===null?ln=na:Tn.sibling=na,Tn=na);return p&&An.forEach(function(eo){return v(it,eo)}),pt&&q(it,Zn),ln}function So(it,Ke,gt,Mt){var ln=R(gt);if(typeof ln!="function")throw Error(o(150));if(gt=ln.call(gt),gt==null)throw Error(o(151));for(var Tn=ln=null,An=Ke,Zn=Ke=0,na=null,Vn=gt.next();An!==null&&!Vn.done;Zn++,Vn=gt.next()){An.index>Zn?(na=An,An=null):na=An.sibling;var eo=Rt(it,An,Vn.value,Mt);if(eo===null){An===null&&(An=na);break}p&&An&&eo.alternate===null&&v(it,An),Ke=ae(eo,Ke,Zn),Tn===null?ln=eo:Tn.sibling=eo,Tn=eo,An=na}if(Vn.done)return L(it,An),pt&&q(it,Zn),ln;if(An===null){for(;!Vn.done;Zn++,Vn=gt.next())Vn=kn(it,Vn.value,Mt),Vn!==null&&(Ke=ae(Vn,Ke,Zn),Tn===null?ln=Vn:Tn.sibling=Vn,Tn=Vn);return pt&&q(it,Zn),ln}for(An=U(it,An);!Vn.done;Zn++,Vn=gt.next())Vn=Ur(An,it,Zn,Vn.value,Mt),Vn!==null&&(p&&Vn.alternate!==null&&An.delete(Vn.key===null?Zn:Vn.key),Ke=ae(Vn,Ke,Zn),Tn===null?ln=Vn:Tn.sibling=Vn,Tn=Vn);return p&&An.forEach(function(hg){return v(it,hg)}),pt&&q(it,Zn),ln}function El(it,Ke,gt,Mt){if(typeof gt=="object"&>!==null&>.type===c&>.key===null&&(gt=gt.props.children),typeof gt=="object"&>!==null){switch(gt.$$typeof){case u:e:{for(var ln=gt.key,Tn=Ke;Tn!==null;){if(Tn.key===ln){if(ln=gt.type,ln===c){if(Tn.tag===7){L(it,Tn.sibling),Ke=W(Tn,gt.props.children),Ke.return=it,it=Ke;break e}}else if(Tn.elementType===ln||typeof ln=="object"&&ln!==null&&ln.$$typeof===k&&Hs(ln)===Tn.type){L(it,Tn.sibling),Ke=W(Tn,gt.props),Ke.ref=Vo(it,Tn,gt),Ke.return=it,it=Ke;break e}L(it,Tn);break}else v(it,Tn);Tn=Tn.sibling}gt.type===c?(Ke=Ma(gt.props.children,it.mode,Mt,gt.key),Ke.return=it,it=Ke):(Mt=Bh(gt.type,gt.key,gt.props,null,it.mode,Mt),Mt.ref=Vo(it,Ke,gt),Mt.return=it,it=Mt)}return ke(it);case h:e:{for(Tn=gt.key;Ke!==null;){if(Ke.key===Tn)if(Ke.tag===4&&Ke.stateNode.containerInfo===gt.containerInfo&&Ke.stateNode.implementation===gt.implementation){L(it,Ke.sibling),Ke=W(Ke,gt.children||[]),Ke.return=it,it=Ke;break e}else{L(it,Ke);break}else v(it,Ke);Ke=Ke.sibling}Ke=zh(gt,it.mode,Mt),Ke.return=it,it=Ke}return ke(it);case k:return Tn=gt._init,El(it,Ke,Tn(gt._payload),Mt)}if(te(gt))return xr(it,Ke,gt,Mt);if(R(gt))return So(it,Ke,gt,Mt);$s(it,gt)}return typeof gt=="string"&>!==""||typeof gt=="number"?(gt=""+gt,Ke!==null&&Ke.tag===6?(L(it,Ke.sibling),Ke=W(Ke,gt),Ke.return=it,it=Ke):(L(it,Ke),Ke=Kc(gt,it.mode,Mt),Ke.return=it,it=Ke),ke(it)):L(it,Ke)}return El}var ho=vl(!0),Gs=vl(!1),Ei=wi(null),hs=null,Lo=null,jl=null;function Dl(){jl=Lo=hs=null}function ha(p,v,L){_e?(wn(Ei,v._currentValue),v._currentValue=L):(wn(Ei,v._currentValue2),v._currentValue2=L)}function po(p){var v=Ei.current;pr(Ei),_e?p._currentValue=v:p._currentValue2=v}function No(p,v,L){for(;p!==null;){var U=p.alternate;if((p.childLanes&v)!==v?(p.childLanes|=v,U!==null&&(U.childLanes|=v)):U!==null&&(U.childLanes&v)!==v&&(U.childLanes|=v),p===L)break;p=p.return}}function Ws(p,v){hs=p,jl=Lo=null,p=p.dependencies,p!==null&&p.firstContext!==null&&((p.lanes&v)!==0&&(ki=!0),p.firstContext=null)}function Fr(p){var v=_e?p._currentValue:p._currentValue2;if(jl!==p)if(p={context:p,memoizedValue:v,next:null},Lo===null){if(hs===null)throw Error(o(308));Lo=p,hs.dependencies={lanes:0,firstContext:p}}else Lo=Lo.next=p;return v}var Xa=null;function yl(p){Xa===null?Xa=[p]:Xa.push(p)}function Fl(p,v,L,U){var W=v.interleaved;return W===null?(L.next=L,yl(v)):(L.next=W.next,W.next=L),v.interleaved=L,$i(p,U)}function $i(p,v){p.lanes|=v;var L=p.alternate;for(L!==null&&(L.lanes|=v),L=p,p=p.return;p!==null;)p.childLanes|=v,L=p.alternate,L!==null&&(L.childLanes|=v),L=p,p=p.return;return L.tag===3?L.stateNode:null}var Ni=!1;function Na(p){p.updateQueue={baseState:p.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ka(p,v){p=p.updateQueue,v.updateQueue===p&&(v.updateQueue={baseState:p.baseState,firstBaseUpdate:p.firstBaseUpdate,lastBaseUpdate:p.lastBaseUpdate,shared:p.shared,effects:p.effects})}function da(p,v){return{eventTime:p,lane:v,tag:0,payload:null,callback:null,next:null}}function Zi(p,v,L){var U=p.updateQueue;if(U===null)return null;if(U=U.shared,(dn&2)!==0){var W=U.pending;return W===null?v.next=v:(v.next=W.next,W.next=v),U.pending=v,$i(p,L)}return W=U.interleaved,W===null?(v.next=v,yl(U)):(v.next=W.next,W.next=v),U.interleaved=v,$i(p,L)}function To(p,v,L){if(v=v.updateQueue,v!==null&&(v=v.shared,(L&4194240)!==0)){var U=v.lanes;U&=p.pendingLanes,L|=U,v.lanes=L,qa(p,L)}}function ds(p,v){var L=p.updateQueue,U=p.alternate;if(U!==null&&(U=U.updateQueue,L===U)){var W=null,ae=null;if(L=L.firstBaseUpdate,L!==null){do{var ke={eventTime:L.eventTime,lane:L.lane,tag:L.tag,payload:L.payload,callback:L.callback,next:null};ae===null?W=ae=ke:ae=ae.next=ke,L=L.next}while(L!==null);ae===null?W=ae=v:ae=ae.next=v}else W=ae=v;L={baseState:U.baseState,firstBaseUpdate:W,lastBaseUpdate:ae,shared:U.shared,effects:U.effects},p.updateQueue=L;return}p=L.lastBaseUpdate,p===null?L.firstBaseUpdate=v:p.next=v,L.lastBaseUpdate=v}function go(p,v,L,U){var W=p.updateQueue;Ni=!1;var ae=W.firstBaseUpdate,ke=W.lastBaseUpdate,Ve=W.shared.pending;if(Ve!==null){W.shared.pending=null;var st=Ve,_t=st.next;st.next=null,ke===null?ae=_t:ke.next=_t,ke=st;var Gt=p.alternate;Gt!==null&&(Gt=Gt.updateQueue,Ve=Gt.lastBaseUpdate,Ve!==ke&&(Ve===null?Gt.firstBaseUpdate=_t:Ve.next=_t,Gt.lastBaseUpdate=st))}if(ae!==null){var kn=W.baseState;ke=0,Gt=_t=st=null,Ve=ae;do{var Rt=Ve.lane,Ur=Ve.eventTime;if((U&Rt)===Rt){Gt!==null&&(Gt=Gt.next={eventTime:Ur,lane:0,tag:Ve.tag,payload:Ve.payload,callback:Ve.callback,next:null});e:{var xr=p,So=Ve;switch(Rt=v,Ur=L,So.tag){case 1:if(xr=So.payload,typeof xr=="function"){kn=xr.call(Ur,kn,Rt);break e}kn=xr;break e;case 3:xr.flags=xr.flags&-65537|128;case 0:if(xr=So.payload,Rt=typeof xr=="function"?xr.call(Ur,kn,Rt):xr,Rt==null)break e;kn=a({},kn,Rt);break e;case 2:Ni=!0}}Ve.callback!==null&&Ve.lane!==0&&(p.flags|=64,Rt=W.effects,Rt===null?W.effects=[Ve]:Rt.push(Ve))}else Ur={eventTime:Ur,lane:Rt,tag:Ve.tag,payload:Ve.payload,callback:Ve.callback,next:null},Gt===null?(_t=Gt=Ur,st=kn):Gt=Gt.next=Ur,ke|=Rt;if(Ve=Ve.next,Ve===null){if(Ve=W.shared.pending,Ve===null)break;Rt=Ve,Ve=Rt.next,Rt.next=null,W.lastBaseUpdate=Rt,W.shared.pending=null}}while(!0);if(Gt===null&&(st=kn),W.baseState=st,W.firstBaseUpdate=_t,W.lastBaseUpdate=Gt,v=W.shared.interleaved,v!==null){W=v;do ke|=W.lane,W=W.next;while(W!==v)}else ae===null&&(W.shared.lanes=0);Js|=ke,p.lanes=ke,p.memoizedState=kn}}function ri(p,v,L){if(p=v.effects,v.effects=null,p!==null)for(v=0;v<p.length;v++){var U=p[v],W=U.callback;if(W!==null){if(U.callback=null,U=L,typeof W!="function")throw Error(o(191,W));W.call(U)}}}var Yo={},di=wi(Yo),Ta=wi(Yo),Ro=wi(Yo);function pa(p){if(p===Yo)throw Error(o(174));return p}function bl(p,v){wn(Ro,v),wn(Ta,p),wn(di,Yo),p=ee(v),pr(di),wn(di,p)}function Xo(){pr(di),pr(Ta),pr(Ro)}function ps(p){var v=pa(Ro.current),L=pa(di.current);v=Q(L,p.type,v),L!==v&&(wn(Ta,p),wn(di,v))}function gs(p){Ta.current===p&&(pr(di),pr(Ta))}var rr=wi(0);function ms(p){for(var v=p;v!==null;){if(v.tag===13){var L=v.memoizedState;if(L!==null&&(L=L.dehydrated,L===null||Ki(L)||Hn(L)))return v}else if(v.tag===19&&v.memoizedProps.revealOrder!==void 0){if((v.flags&128)!==0)return v}else if(v.child!==null){v.child.return=v,v=v.child;continue}if(v===p)break;for(;v.sibling===null;){if(v.return===null||v.return===p)return null;v=v.return}v.sibling.return=v.return,v=v.sibling}return null}var vs=[];function Vs(){for(var p=0;p<vs.length;p++){var v=vs[p];_e?v._workInProgressVersionPrimary=null:v._workInProgressVersionSecondary=null}vs.length=0}var Nr=s.ReactCurrentDispatcher,ga=s.ReactCurrentBatchConfig,Rn=0,fn=null,Pn=null,Mn=null,Za=!1,Ys=!1,ys=0,Xs=0;function Ti(){throw Error(o(321))}function wl(p,v){if(v===null)return!1;for(var L=0;L<v.length&&L<p.length;L++)if(!La(p[L],v[L]))return!1;return!0}function yu(p,v,L,U,W,ae){if(Rn=ae,fn=v,v.memoizedState=null,v.updateQueue=null,v.lanes=0,Nr.current=p===null||p.memoizedState===null?tc:Hl,p=L(U,W),Ys){ae=0;do{if(Ys=!1,ys=0,25<=ae)throw Error(o(301));ae+=1,Mn=Pn=null,v.updateQueue=null,Nr.current=Ff,p=L(U,W)}while(Ys)}if(Nr.current=Zs,v=Pn!==null&&Pn.next!==null,Rn=0,Mn=Pn=fn=null,Za=!1,v)throw Error(o(300));return p}function Zu(){var p=ys!==0;return ys=0,p}function Qa(){var p={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mn===null?fn.memoizedState=Mn=p:Mn=Mn.next=p,Mn}function Hi(){if(Pn===null){var p=fn.alternate;p=p!==null?p.memoizedState:null}else p=Pn.next;var v=Mn===null?fn.memoizedState:Mn.next;if(v!==null)Mn=v,Pn=p;else{if(p===null)throw Error(o(310));Pn=p,p={memoizedState:Pn.memoizedState,baseState:Pn.baseState,baseQueue:Pn.baseQueue,queue:Pn.queue,next:null},Mn===null?fn.memoizedState=Mn=p:Mn=Mn.next=p}return Mn}function Ko(p,v){return typeof v=="function"?v(p):v}function Qu(p){var v=Hi(),L=v.queue;if(L===null)throw Error(o(311));L.lastRenderedReducer=p;var U=Pn,W=U.baseQueue,ae=L.pending;if(ae!==null){if(W!==null){var ke=W.next;W.next=ae.next,ae.next=ke}U.baseQueue=W=ae,L.pending=null}if(W!==null){ae=W.next,U=U.baseState;var Ve=ke=null,st=null,_t=ae;do{var Gt=_t.lane;if((Rn&Gt)===Gt)st!==null&&(st=st.next={lane:0,action:_t.action,hasEagerState:_t.hasEagerState,eagerState:_t.eagerState,next:null}),U=_t.hasEagerState?_t.eagerState:p(U,_t.action);else{var kn={lane:Gt,action:_t.action,hasEagerState:_t.hasEagerState,eagerState:_t.eagerState,next:null};st===null?(Ve=st=kn,ke=U):st=st.next=kn,fn.lanes|=Gt,Js|=Gt}_t=_t.next}while(_t!==null&&_t!==ae);st===null?ke=U:st.next=Ve,La(U,v.memoizedState)||(ki=!0),v.memoizedState=U,v.baseState=ke,v.baseQueue=st,L.lastRenderedState=U}if(p=L.interleaved,p!==null){W=p;do ae=W.lane,fn.lanes|=ae,Js|=ae,W=W.next;while(W!==p)}else W===null&&(L.lanes=0);return[v.memoizedState,L.dispatch]}function Bl(p){var v=Hi(),L=v.queue;if(L===null)throw Error(o(311));L.lastRenderedReducer=p;var U=L.dispatch,W=L.pending,ae=v.memoizedState;if(W!==null){L.pending=null;var ke=W=W.next;do ae=p(ae,ke.action),ke=ke.next;while(ke!==W);La(ae,v.memoizedState)||(ki=!0),v.memoizedState=ae,v.baseQueue===null&&(v.baseState=ae),L.lastRenderedState=ae}return[ae,U]}function Mc(){}function Ic(p,v){var L=fn,U=Hi(),W=v(),ae=!La(U.memoizedState,W);if(ae&&(U.memoizedState=W,ki=!0),U=U.queue,ql(Fc.bind(null,L,U,p),[p]),U.getSnapshot!==v||ae||Mn!==null&&Mn.memoizedState.tag&1){if(L.flags|=2048,Ri(9,Dc.bind(null,L,U,W,v),void 0,null),Bn===null)throw Error(o(349));(Rn&30)!==0||jc(L,v,W)}return W}function jc(p,v,L){p.flags|=16384,p={getSnapshot:v,value:L},v=fn.updateQueue,v===null?(v={lastEffect:null,stores:null},fn.updateQueue=v,v.stores=[p]):(L=v.stores,L===null?v.stores=[p]:L.push(p))}function Dc(p,v,L,U){v.value=L,v.getSnapshot=U,Bc(v)&&Zo(p)}function Fc(p,v,L){return L(function(){Bc(v)&&Zo(p)})}function Bc(p){var v=p.getSnapshot;p=p.value;try{var L=v();return!La(p,L)}catch{return!0}}function Zo(p){var v=$i(p,1);v!==null&&_a(v,p,1,-1)}function zl(p){var v=Qa();return typeof p=="function"&&(p=p()),v.memoizedState=v.baseState=p,p={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:p},v.queue=p,p=p.dispatch=Nd.bind(null,fn,p),[v.memoizedState,p]}function Ri(p,v,L,U){return p={tag:p,create:v,destroy:L,deps:U,next:null},v=fn.updateQueue,v===null?(v={lastEffect:null,stores:null},fn.updateQueue=v,v.lastEffect=p.next=p):(L=v.lastEffect,L===null?v.lastEffect=p.next=p:(U=L.next,L.next=p,p.next=U,v.lastEffect=p)),p}function mo(){return Hi().memoizedState}function Ul(p,v,L,U){var W=Qa();fn.flags|=p,W.memoizedState=Ri(1|v,L,void 0,U===void 0?null:U)}function Qo(p,v,L,U){var W=Hi();U=U===void 0?null:U;var ae=void 0;if(Pn!==null){var ke=Pn.memoizedState;if(ae=ke.destroy,U!==null&&wl(U,ke.deps)){W.memoizedState=Ri(v,L,ae,U);return}}fn.flags|=p,W.memoizedState=Ri(1|v,L,ae,U)}function jf(p,v){return Ul(8390656,8,p,v)}function ql(p,v){return Qo(2048,8,p,v)}function bu(p,v){return Qo(4,2,p,v)}function gr(p,v){return Qo(4,4,p,v)}function Ju(p,v){if(typeof v=="function")return p=p(),v(p),function(){v(null)};if(v!=null)return p=p(),v.current=p,function(){v.current=null}}function $l(p,v,L){return L=L!=null?L.concat([p]):null,Qo(4,4,Ju.bind(null,v,p),L)}function Ks(){}function wu(p,v){var L=Hi();v=v===void 0?null:v;var U=L.memoizedState;return U!==null&&v!==null&&wl(v,U[1])?U[0]:(L.memoizedState=[p,v],p)}function xu(p,v){var L=Hi();v=v===void 0?null:v;var U=L.memoizedState;return U!==null&&v!==null&&wl(v,U[1])?U[0]:(p=p(),L.memoizedState=[p,v],p)}function _u(p,v,L){return(Rn&21)===0?(p.baseState&&(p.baseState=!1,ki=!0),p.memoizedState=L):(La(L,v)||(L=Ml(),fn.lanes|=L,Js|=L,p.baseState=!0),v)}function zc(p,v){var L=Ln;Ln=L!==0&&4>L?L:4,p(!0);var U=ga.transition;ga.transition={};try{p(!1),v()}finally{Ln=L,ga.transition=U}}function xl(){return Hi().memoizedState}function Nh(p,v,L){var U=Oi(p);if(L={lane:U,action:L,hasEagerState:!1,eagerState:null,next:null},Th(p))Df(v,L);else if(L=Fl(p,v,L,U),L!==null){var W=Ar();_a(L,p,U,W),ec(L,v,U)}}function Nd(p,v,L){var U=Oi(p),W={lane:U,action:L,hasEagerState:!1,eagerState:null,next:null};if(Th(p))Df(v,W);else{var ae=p.alternate;if(p.lanes===0&&(ae===null||ae.lanes===0)&&(ae=v.lastRenderedReducer,ae!==null))try{var ke=v.lastRenderedState,Ve=ae(ke,L);if(W.hasEagerState=!0,W.eagerState=Ve,La(Ve,ke)){var st=v.interleaved;st===null?(W.next=W,yl(v)):(W.next=st.next,st.next=W),v.interleaved=W;return}}catch{}finally{}L=Fl(p,v,W,U),L!==null&&(W=Ar(),_a(L,p,U,W),ec(L,v,U))}}function Th(p){var v=p.alternate;return p===fn||v!==null&&v===fn}function Df(p,v){Ys=Za=!0;var L=p.pending;L===null?v.next=v:(v.next=L.next,L.next=v),p.pending=v}function ec(p,v,L){if((L&4194240)!==0){var U=v.lanes;U&=p.pendingLanes,L|=U,v.lanes=L,qa(p,L)}}var Zs={readContext:Fr,useCallback:Ti,useContext:Ti,useEffect:Ti,useImperativeHandle:Ti,useInsertionEffect:Ti,useLayoutEffect:Ti,useMemo:Ti,useReducer:Ti,useRef:Ti,useState:Ti,useDebugValue:Ti,useDeferredValue:Ti,useTransition:Ti,useMutableSource:Ti,useSyncExternalStore:Ti,useId:Ti,unstable_isNewReconciler:!1},tc={readContext:Fr,useCallback:function(p,v){return Qa().memoizedState=[p,v===void 0?null:v],p},useContext:Fr,useEffect:jf,useImperativeHandle:function(p,v,L){return L=L!=null?L.concat([p]):null,Ul(4194308,4,Ju.bind(null,v,p),L)},useLayoutEffect:function(p,v){return Ul(4194308,4,p,v)},useInsertionEffect:function(p,v){return Ul(4,2,p,v)},useMemo:function(p,v){var L=Qa();return v=v===void 0?null:v,p=p(),L.memoizedState=[p,v],p},useReducer:function(p,v,L){var U=Qa();return v=L!==void 0?L(v):v,U.memoizedState=U.baseState=v,p={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:p,lastRenderedState:v},U.queue=p,p=p.dispatch=Nh.bind(null,fn,p),[U.memoizedState,p]},useRef:function(p){var v=Qa();return p={current:p},v.memoizedState=p},useState:zl,useDebugValue:Ks,useDeferredValue:function(p){return Qa().memoizedState=p},useTransition:function(){var p=zl(!1),v=p[0];return p=zc.bind(null,p[1]),Qa().memoizedState=p,[v,p]},useMutableSource:function(){},useSyncExternalStore:function(p,v,L){var U=fn,W=Qa();if(pt){if(L===void 0)throw Error(o(407));L=L()}else{if(L=v(),Bn===null)throw Error(o(349));(Rn&30)!==0||jc(U,v,L)}W.memoizedState=L;var ae={value:L,getSnapshot:v};return W.queue=ae,jf(Fc.bind(null,U,ae,p),[p]),U.flags|=2048,Ri(9,Dc.bind(null,U,ae,L,v),void 0,null),L},useId:function(){var p=Qa(),v=Bn.identifierPrefix;if(pt){var L=Va,U=_i;L=(U&~(1<<32-Ca(U)-1)).toString(32)+L,v=":"+v+"R"+L,L=ys++,0<L&&(v+="H"+L.toString(32)),v+=":"}else L=Xs++,v=":"+v+"r"+L.toString(32)+":";return p.memoizedState=v},unstable_isNewReconciler:!1},Hl={readContext:Fr,useCallback:wu,useContext:Fr,useEffect:ql,useImperativeHandle:$l,useInsertionEffect:bu,useLayoutEffect:gr,useMemo:xu,useReducer:Qu,useRef:mo,useState:function(){return Qu(Ko)},useDebugValue:Ks,useDeferredValue:function(p){var v=Hi();return _u(v,Pn.memoizedState,p)},useTransition:function(){var p=Qu(Ko)[0],v=Hi().memoizedState;return[p,v]},useMutableSource:Mc,useSyncExternalStore:Ic,useId:xl,unstable_isNewReconciler:!1},Ff={readContext:Fr,useCallback:wu,useContext:Fr,useEffect:ql,useImperativeHandle:$l,useInsertionEffect:bu,useLayoutEffect:gr,useMemo:xu,useReducer:Bl,useRef:mo,useState:function(){return Bl(Ko)},useDebugValue:Ks,useDeferredValue:function(p){var v=Hi();return Pn===null?v.memoizedState=p:_u(v,Pn.memoizedState,p)},useTransition:function(){var p=Bl(Ko)[0],v=Hi().memoizedState;return[p,v]},useMutableSource:Mc,useSyncExternalStore:Ic,useId:xl,unstable_isNewReconciler:!1};function vo(p,v){if(p&&p.defaultProps){v=a({},v),p=p.defaultProps;for(var L in p)v[L]===void 0&&(v[L]=p[L]);return v}return v}function Uc(p,v,L,U){v=p.memoizedState,L=L(U,v),L=L==null?v:a({},v,L),p.memoizedState=L,p.lanes===0&&(p.updateQueue.baseState=L)}var nc={isMounted:function(p){return(p=p._reactInternals)?j(p)===p:!1},enqueueSetState:function(p,v,L){p=p._reactInternals;var U=Ar(),W=Oi(p),ae=da(U,W);ae.payload=v,L!=null&&(ae.callback=L),v=Zi(p,ae,W),v!==null&&(_a(v,p,W,U),To(v,p,W))},enqueueReplaceState:function(p,v,L){p=p._reactInternals;var U=Ar(),W=Oi(p),ae=da(U,W);ae.tag=1,ae.payload=v,L!=null&&(ae.callback=L),v=Zi(p,ae,W),v!==null&&(_a(v,p,W,U),To(v,p,W))},enqueueForceUpdate:function(p,v){p=p._reactInternals;var L=Ar(),U=Oi(p),W=da(L,U);W.tag=2,v!=null&&(W.callback=v),v=Zi(p,W,U),v!==null&&(_a(v,p,U,L),To(v,p,U))}};function Rh(p,v,L,U,W,ae,ke){return p=p.stateNode,typeof p.shouldComponentUpdate=="function"?p.shouldComponentUpdate(U,ae,ke):v.prototype&&v.prototype.isPureReactComponent?!Ya(L,U)||!Ya(W,ae):!0}function Mh(p,v,L){var U=!1,W=oo,ae=v.contextType;return typeof ae=="object"&&ae!==null?ae=Fr(ae):(W=qr(v)?so:Ui.current,U=v.contextTypes,ae=(U=U!=null)?qi(p,W):oo),v=new v(L,ae),p.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=nc,p.stateNode=v,v._reactInternals=p,U&&(p=p.stateNode,p.__reactInternalMemoizedUnmaskedChildContext=W,p.__reactInternalMemoizedMaskedChildContext=ae),v}function qc(p,v,L,U){p=v.state,typeof v.componentWillReceiveProps=="function"&&v.componentWillReceiveProps(L,U),typeof v.UNSAFE_componentWillReceiveProps=="function"&&v.UNSAFE_componentWillReceiveProps(L,U),v.state!==p&&nc.enqueueReplaceState(v,v.state,null)}function Qi(p,v,L,U){var W=p.stateNode;W.props=L,W.state=p.memoizedState,W.refs={},Na(p);var ae=v.contextType;typeof ae=="object"&&ae!==null?W.context=Fr(ae):(ae=qr(v)?so:Ui.current,W.context=qi(p,ae)),W.state=p.memoizedState,ae=v.getDerivedStateFromProps,typeof ae=="function"&&(Uc(p,v,ae,L),W.state=p.memoizedState),typeof v.getDerivedStateFromProps=="function"||typeof W.getSnapshotBeforeUpdate=="function"||typeof W.UNSAFE_componentWillMount!="function"&&typeof W.componentWillMount!="function"||(v=W.state,typeof W.componentWillMount=="function"&&W.componentWillMount(),typeof W.UNSAFE_componentWillMount=="function"&&W.UNSAFE_componentWillMount(),v!==W.state&&nc.enqueueReplaceState(W,W.state,null),go(p,L,W,U),W.state=p.memoizedState),typeof W.componentDidMount=="function"&&(p.flags|=4194308)}function Ji(p,v){try{var L="",U=v;do L+=qs(U),U=U.return;while(U);var W=L}catch(ae){W=`
|
|
29
|
+
Error generating stack: `+ae.message+`
|
|
30
|
+
`+ae.stack}return{value:p,source:v,stack:W,digest:null}}function ma(p,v,L){return{value:p,source:null,stack:L??null,digest:v??null}}function Mo(p,v){try{console.error(v.value)}catch(L){setTimeout(function(){throw L})}}var Su=typeof WeakMap=="function"?WeakMap:Map;function ea(p,v,L){L=da(-1,L),L.tag=3,L.payload={element:null};var U=v.value;return L.callback=function(){Vr||(Vr=!0,Yr=U),Mo(p,v)},L}function Ra(p,v,L){L=da(-1,L),L.tag=3;var U=p.type.getDerivedStateFromError;if(typeof U=="function"){var W=v.value;L.payload=function(){return U(W)},L.callback=function(){Mo(p,v)}}var ae=p.stateNode;return ae!==null&&typeof ae.componentDidCatch=="function"&&(L.callback=function(){Mo(p,v),typeof U!="function"&&(bo===null?bo=new Set([this]):bo.add(this));var ke=v.stack;this.componentDidCatch(v.value,{componentStack:ke!==null?ke:""})}),L}function Ih(p,v,L){var U=p.pingCache;if(U===null){U=p.pingCache=new Su;var W=new Set;U.set(v,W)}else W=U.get(v),W===void 0&&(W=new Set,U.set(v,W));W.has(L)||(W.add(L),p=Kp.bind(null,p,v,L),v.then(p,p))}function jh(p){do{var v;if((v=p.tag===13)&&(v=p.memoizedState,v=v!==null?v.dehydrated!==null:!0),v)return p;p=p.return}while(p!==null);return null}function Qs(p,v,L,U,W){return(p.mode&1)===0?(p===v?p.flags|=65536:(p.flags|=128,L.flags|=131072,L.flags&=-52805,L.tag===1&&(L.alternate===null?L.tag=17:(v=da(-1,1),v.tag=2,Zi(L,v,1))),L.lanes|=1),p):(p.flags|=65536,p.lanes=W,p)}var Eu=s.ReactCurrentOwner,ki=!1;function Mi(p,v,L,U){v.child=p===null?Gs(v,null,L,U):ho(v,p.child,L,U)}function $c(p,v,L,U,W){L=L.render;var ae=v.ref;return Ws(v,W),U=yu(p,v,L,U,ae,W),L=Zu(),p!==null&&!ki?(v.updateQueue=p.updateQueue,v.flags&=-2053,p.lanes&=~W,V(p,v,W)):(pt&&L&&Oe(v),v.flags|=1,Mi(p,v,U,W),v.child)}function bs(p,v,L,U,W){if(p===null){var ae=L.type;return typeof ae=="function"&&!Yc(ae)&&ae.defaultProps===void 0&&L.compare===null&&L.defaultProps===void 0?(v.tag=15,v.type=ae,Io(p,v,ae,U,W)):(p=Bh(L.type,null,U,v,v.mode,W),p.ref=v.ref,p.return=v,v.child=p)}if(ae=p.child,(p.lanes&W)===0){var ke=ae.memoizedProps;if(L=L.compare,L=L!==null?L:Ya,L(ke,U)&&p.ref===v.ref)return V(p,v,W)}return v.flags|=1,p=Nu(ae,U),p.ref=v.ref,p.return=v,v.child=p}function Io(p,v,L,U,W){if(p!==null){var ae=p.memoizedProps;if(Ya(ae,U)&&p.ref===v.ref)if(ki=!1,v.pendingProps=U=ae,(p.lanes&W)!==0)(p.flags&131072)!==0&&(ki=!0);else return v.lanes=p.lanes,V(p,v,W)}return ws(p,v,L,U,W)}function ir(p,v,L){var U=v.pendingProps,W=U.children,ae=p!==null?p.memoizedState:null;if(U.mode==="hidden")if((v.mode&1)===0)v.memoizedState={baseLanes:0,cachePool:null,transitions:null},wn(Jo,gi),gi|=L;else{if((L&1073741824)===0)return p=ae!==null?ae.baseLanes|L:L,v.lanes=v.childLanes=1073741824,v.memoizedState={baseLanes:p,cachePool:null,transitions:null},v.updateQueue=null,wn(Jo,gi),gi|=p,null;v.memoizedState={baseLanes:0,cachePool:null,transitions:null},U=ae!==null?ae.baseLanes:L,wn(Jo,gi),gi|=U}else ae!==null?(U=ae.baseLanes|L,v.memoizedState=null):U=L,wn(Jo,gi),gi|=U;return Mi(p,v,W,L),v.child}function ur(p,v){var L=v.ref;(p===null&&L!==null||p!==null&&p.ref!==L)&&(v.flags|=512,v.flags|=2097152)}function ws(p,v,L,U,W){var ae=qr(L)?so:Ui.current;return ae=qi(v,ae),Ws(v,W),L=yu(p,v,L,U,ae,W),U=Zu(),p!==null&&!ki?(v.updateQueue=p.updateQueue,v.flags&=-2053,p.lanes&=~W,V(p,v,W)):(pt&&U&&Oe(v),v.flags|=1,Mi(p,v,L,W),v.child)}function Gi(p,v,L,U,W){if(qr(L)){var ae=!0;Ba(v)}else ae=!1;if(Ws(v,W),v.stateNode===null)M(p,v),Mh(v,L,U),Qi(v,L,U,W),U=!0;else if(p===null){var ke=v.stateNode,Ve=v.memoizedProps;ke.props=Ve;var st=ke.context,_t=L.contextType;typeof _t=="object"&&_t!==null?_t=Fr(_t):(_t=qr(L)?so:Ui.current,_t=qi(v,_t));var Gt=L.getDerivedStateFromProps,kn=typeof Gt=="function"||typeof ke.getSnapshotBeforeUpdate=="function";kn||typeof ke.UNSAFE_componentWillReceiveProps!="function"&&typeof ke.componentWillReceiveProps!="function"||(Ve!==U||st!==_t)&&qc(v,ke,U,_t),Ni=!1;var Rt=v.memoizedState;ke.state=Rt,go(v,U,ke,W),st=v.memoizedState,Ve!==U||Rt!==st||Gn.current||Ni?(typeof Gt=="function"&&(Uc(v,L,Gt,U),st=v.memoizedState),(Ve=Ni||Rh(v,L,Ve,U,Rt,st,_t))?(kn||typeof ke.UNSAFE_componentWillMount!="function"&&typeof ke.componentWillMount!="function"||(typeof ke.componentWillMount=="function"&&ke.componentWillMount(),typeof ke.UNSAFE_componentWillMount=="function"&&ke.UNSAFE_componentWillMount()),typeof ke.componentDidMount=="function"&&(v.flags|=4194308)):(typeof ke.componentDidMount=="function"&&(v.flags|=4194308),v.memoizedProps=U,v.memoizedState=st),ke.props=U,ke.state=st,ke.context=_t,U=Ve):(typeof ke.componentDidMount=="function"&&(v.flags|=4194308),U=!1)}else{ke=v.stateNode,Ka(p,v),Ve=v.memoizedProps,_t=v.type===v.elementType?Ve:vo(v.type,Ve),ke.props=_t,kn=v.pendingProps,Rt=ke.context,st=L.contextType,typeof st=="object"&&st!==null?st=Fr(st):(st=qr(L)?so:Ui.current,st=qi(v,st));var Ur=L.getDerivedStateFromProps;(Gt=typeof Ur=="function"||typeof ke.getSnapshotBeforeUpdate=="function")||typeof ke.UNSAFE_componentWillReceiveProps!="function"&&typeof ke.componentWillReceiveProps!="function"||(Ve!==kn||Rt!==st)&&qc(v,ke,U,st),Ni=!1,Rt=v.memoizedState,ke.state=Rt,go(v,U,ke,W);var xr=v.memoizedState;Ve!==kn||Rt!==xr||Gn.current||Ni?(typeof Ur=="function"&&(Uc(v,L,Ur,U),xr=v.memoizedState),(_t=Ni||Rh(v,L,_t,U,Rt,xr,st)||!1)?(Gt||typeof ke.UNSAFE_componentWillUpdate!="function"&&typeof ke.componentWillUpdate!="function"||(typeof ke.componentWillUpdate=="function"&&ke.componentWillUpdate(U,xr,st),typeof ke.UNSAFE_componentWillUpdate=="function"&&ke.UNSAFE_componentWillUpdate(U,xr,st)),typeof ke.componentDidUpdate=="function"&&(v.flags|=4),typeof ke.getSnapshotBeforeUpdate=="function"&&(v.flags|=1024)):(typeof ke.componentDidUpdate!="function"||Ve===p.memoizedProps&&Rt===p.memoizedState||(v.flags|=4),typeof ke.getSnapshotBeforeUpdate!="function"||Ve===p.memoizedProps&&Rt===p.memoizedState||(v.flags|=1024),v.memoizedProps=U,v.memoizedState=xr),ke.props=U,ke.state=xr,ke.context=st,U=_t):(typeof ke.componentDidUpdate!="function"||Ve===p.memoizedProps&&Rt===p.memoizedState||(v.flags|=4),typeof ke.getSnapshotBeforeUpdate!="function"||Ve===p.memoizedProps&&Rt===p.memoizedState||(v.flags|=1024),U=!1)}return va(p,v,L,U,ae,W)}function va(p,v,L,U,W,ae){ur(p,v);var ke=(v.flags&128)!==0;if(!U&&!ke)return W&&du(v,L,!1),V(p,v,ae);U=v.stateNode,Eu.current=v;var Ve=ke&&typeof L.getDerivedStateFromError!="function"?null:U.render();return v.flags|=1,p!==null&&ke?(v.child=ho(v,p.child,null,ae),v.child=ho(v,null,Ve,ae)):Mi(p,v,Ve,ae),v.memoizedState=U.state,W&&du(v,L,!0),v.child}function _l(p){var v=p.stateNode;v.pendingContext?lo(p,v.pendingContext,v.pendingContext!==v.context):v.context&&lo(p,v.context,!1),bl(p,v.containerInfo)}function Gl(p,v,L,U,W){return kr(),Li(W),v.flags|=256,Mi(p,v,L,U),v.child}var ya={dehydrated:null,treeContext:null,retryLane:0};function ku(p){return{baseLanes:p,cachePool:null,transitions:null}}function Bf(p,v,L){var U=v.pendingProps,W=rr.current,ae=!1,ke=(v.flags&128)!==0,Ve;if((Ve=ke)||(Ve=p!==null&&p.memoizedState===null?!1:(W&2)!==0),Ve?(ae=!0,v.flags&=-129):(p===null||p.memoizedState!==null)&&(W|=1),wn(rr,W&1),p===null)return Lr(v),p=v.memoizedState,p!==null&&(p=p.dehydrated,p!==null)?((v.mode&1)===0?v.lanes=1:Hn(p)?v.lanes=8:v.lanes=1073741824,null):(ke=U.children,p=U.fallback,ae?(U=v.mode,ae=v.child,ke={mode:"hidden",children:ke},(U&1)===0&&ae!==null?(ae.childLanes=0,ae.pendingProps=ke):ae=Xc(ke,U,0,null),p=Ma(p,U,L,null),ae.return=v,p.return=v,ae.sibling=p,v.child=ae,v.child.memoizedState=ku(L),v.memoizedState=ya,p):rc(v,ke));if(W=p.memoizedState,W!==null&&(Ve=W.dehydrated,Ve!==null))return Dh(p,v,ke,U,Ve,W,L);if(ae){ae=U.fallback,ke=v.mode,W=p.child,Ve=W.sibling;var st={mode:"hidden",children:U.children};return(ke&1)===0&&v.child!==W?(U=v.child,U.childLanes=0,U.pendingProps=st,v.deletions=null):(U=Nu(W,st),U.subtreeFlags=W.subtreeFlags&14680064),Ve!==null?ae=Nu(Ve,ae):(ae=Ma(ae,ke,L,null),ae.flags|=2),ae.return=v,U.return=v,U.sibling=ae,v.child=U,U=ae,ae=v.child,ke=p.child.memoizedState,ke=ke===null?ku(L):{baseLanes:ke.baseLanes|L,cachePool:null,transitions:ke.transitions},ae.memoizedState=ke,ae.childLanes=p.childLanes&~L,v.memoizedState=ya,U}return ae=p.child,p=ae.sibling,U=Nu(ae,{mode:"visible",children:U.children}),(v.mode&1)===0&&(U.lanes=L),U.return=v,U.sibling=null,p!==null&&(L=v.deletions,L===null?(v.deletions=[p],v.flags|=16):L.push(p)),v.child=U,v.memoizedState=null,U}function rc(p,v){return v=Xc({mode:"visible",children:v},p.mode,0,null),v.return=p,p.child=v}function xs(p,v,L,U){return U!==null&&Li(U),ho(v,p.child,null,L),p=rc(v,v.pendingProps.children),p.flags|=2,v.memoizedState=null,p}function Dh(p,v,L,U,W,ae,ke){if(L)return v.flags&256?(v.flags&=-257,U=ma(Error(o(422))),xs(p,v,ke,U)):v.memoizedState!==null?(v.child=p.child,v.flags|=128,null):(ae=U.fallback,W=v.mode,U=Xc({mode:"visible",children:U.children},W,0,null),ae=Ma(ae,W,ke,null),ae.flags|=2,U.return=v,ae.return=v,U.sibling=ae,v.child=U,(v.mode&1)!==0&&ho(v,p.child,null,ke),v.child.memoizedState=ku(ke),v.memoizedState=ya,ae);if((v.mode&1)===0)return xs(p,v,ke,null);if(Hn(W))return U=Or(W).digest,ae=Error(o(419)),U=ma(ae,U,void 0),xs(p,v,ke,U);if(L=(ke&p.childLanes)!==0,ki||L){if(U=Bn,U!==null){switch(ke&-ke){case 4:W=2;break;case 16:W=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:W=32;break;case 536870912:W=268435456;break;default:W=0}W=(W&(U.suspendedLanes|ke))!==0?0:W,W!==0&&W!==ae.retryLane&&(ae.retryLane=W,$i(p,W),_a(U,p,W,-1))}return _o(),U=ma(Error(o(421))),xs(p,v,ke,U)}return Ki(W)?(v.flags|=128,v.child=p.child,v=Qp.bind(null,p),Dr(W,v),null):(p=ae.treeContext,ze&&(ft=io(W),He=v,pt=!0,jt=null,Ft=!1,p!==null&&($r[fi++]=_i,$r[fi++]=Va,$r[fi++]=ni,_i=p.id,Va=p.overflow,ni=v)),v=rc(v,U.children),v.flags|=4096,v)}function _s(p,v,L){p.lanes|=v;var U=p.alternate;U!==null&&(U.lanes|=v),No(p.return,v,L)}function Wl(p,v,L,U,W){var ae=p.memoizedState;ae===null?p.memoizedState={isBackwards:v,rendering:null,renderingStartTime:0,last:U,tail:L,tailMode:W}:(ae.isBackwards=v,ae.rendering=null,ae.renderingStartTime=0,ae.last=U,ae.tail=L,ae.tailMode=W)}function P(p,v,L){var U=v.pendingProps,W=U.revealOrder,ae=U.tail;if(Mi(p,v,U.children,L),U=rr.current,(U&2)!==0)U=U&1|2,v.flags|=128;else{if(p!==null&&(p.flags&128)!==0)e:for(p=v.child;p!==null;){if(p.tag===13)p.memoizedState!==null&&_s(p,L,v);else if(p.tag===19)_s(p,L,v);else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===v)break e;for(;p.sibling===null;){if(p.return===null||p.return===v)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}U&=1}if(wn(rr,U),(v.mode&1)===0)v.memoizedState=null;else switch(W){case"forwards":for(L=v.child,W=null;L!==null;)p=L.alternate,p!==null&&ms(p)===null&&(W=L),L=L.sibling;L=W,L===null?(W=v.child,v.child=null):(W=L.sibling,L.sibling=null),Wl(v,!1,W,L,ae);break;case"backwards":for(L=null,W=v.child,v.child=null;W!==null;){if(p=W.alternate,p!==null&&ms(p)===null){v.child=W;break}p=W.sibling,W.sibling=L,L=W,W=p}Wl(v,!0,L,null,ae);break;case"together":Wl(v,!1,null,null,void 0);break;default:v.memoizedState=null}return v.child}function M(p,v){(v.mode&1)===0&&p!==null&&(p.alternate=null,v.alternate=null,v.flags|=2)}function V(p,v,L){if(p!==null&&(v.dependencies=p.dependencies),Js|=v.lanes,(L&v.childLanes)===0)return null;if(p!==null&&v.child!==p.child)throw Error(o(153));if(v.child!==null){for(p=v.child,L=Nu(p,p.pendingProps),v.child=L,L.return=v;p.sibling!==null;)p=p.sibling,L=L.sibling=Nu(p,p.pendingProps),L.return=v;L.sibling=null}return v.child}function ne(p,v,L){switch(v.tag){case 3:_l(v),kr();break;case 5:ps(v);break;case 1:qr(v.type)&&Ba(v);break;case 4:bl(v,v.stateNode.containerInfo);break;case 10:ha(v,v.type._context,v.memoizedProps.value);break;case 13:var U=v.memoizedState;if(U!==null)return U.dehydrated!==null?(wn(rr,rr.current&1),v.flags|=128,null):(L&v.child.childLanes)!==0?Bf(p,v,L):(wn(rr,rr.current&1),p=V(p,v,L),p!==null?p.sibling:null);wn(rr,rr.current&1);break;case 19:if(U=(L&v.childLanes)!==0,(p.flags&128)!==0){if(U)return P(p,v,L);v.flags|=128}var W=v.memoizedState;if(W!==null&&(W.rendering=null,W.tail=null,W.lastEffect=null),wn(rr,rr.current),U)break;return null;case 22:case 23:return v.lanes=0,ir(p,v,L)}return V(p,v,L)}function le(p){p.flags|=4}function de(p,v){if(p!==null&&p.child===v.child)return!0;if((v.flags&16)!==0)return!1;for(p=v.child;p!==null;){if((p.flags&12854)!==0||(p.subtreeFlags&12854)!==0)return!1;p=p.sibling}return!0}var me,Se,Ee,Pe;if(Ce)me=function(p,v){for(var L=v.child;L!==null;){if(L.tag===5||L.tag===6)F(p,L.stateNode);else if(L.tag!==4&&L.child!==null){L.child.return=L,L=L.child;continue}if(L===v)break;for(;L.sibling===null;){if(L.return===null||L.return===v)return;L=L.return}L.sibling.return=L.return,L=L.sibling}},Se=function(){},Ee=function(p,v,L,U,W){if(p=p.memoizedProps,p!==U){var ae=v.stateNode,ke=pa(di.current);L=Y(ae,L,p,U,W,ke),(v.updateQueue=L)&&le(v)}},Pe=function(p,v,L,U){L!==U&&le(v)};else if($e){me=function(p,v,L,U){for(var W=v.child;W!==null;){if(W.tag===5){var ae=W.stateNode;L&&U&&(ae=dr(ae,W.type,W.memoizedProps,W)),F(p,ae)}else if(W.tag===6)ae=W.stateNode,L&&U&&(ae=Jt(ae,W.memoizedProps,W)),F(p,ae);else if(W.tag!==4){if(W.tag===22&&W.memoizedState!==null)ae=W.child,ae!==null&&(ae.return=W),me(p,W,!0,!0);else if(W.child!==null){W.child.return=W,W=W.child;continue}}if(W===v)break;for(;W.sibling===null;){if(W.return===null||W.return===v)return;W=W.return}W.sibling.return=W.return,W=W.sibling}};var De=function(p,v,L,U){for(var W=v.child;W!==null;){if(W.tag===5){var ae=W.stateNode;L&&U&&(ae=dr(ae,W.type,W.memoizedProps,W)),bi(p,ae)}else if(W.tag===6)ae=W.stateNode,L&&U&&(ae=Jt(ae,W.memoizedProps,W)),bi(p,ae);else if(W.tag!==4){if(W.tag===22&&W.memoizedState!==null)ae=W.child,ae!==null&&(ae.return=W),De(p,W,!0,!0);else if(W.child!==null){W.child.return=W,W=W.child;continue}}if(W===v)break;for(;W.sibling===null;){if(W.return===null||W.return===v)return;W=W.return}W.sibling.return=W.return,W=W.sibling}};Se=function(p,v){var L=v.stateNode;if(!de(p,v)){p=L.containerInfo;var U=hn(p);De(U,v,!1,!1),L.pendingChildren=U,le(v),nr(p,U)}},Ee=function(p,v,L,U,W){var ae=p.stateNode,ke=p.memoizedProps;if((p=de(p,v))&&ke===U)v.stateNode=ae;else{var Ve=v.stateNode,st=pa(di.current),_t=null;ke!==U&&(_t=Y(Ve,L,ke,U,W,st)),p&&_t===null?v.stateNode=ae:(ae=Wt(ae,_t,L,ke,U,v,p,Ve),z(ae,L,U,W,st)&&le(v),v.stateNode=ae,p?le(v):me(ae,v,!1,!1))}},Pe=function(p,v,L,U){L!==U?(p=pa(Ro.current),L=pa(di.current),v.stateNode=K(U,p,L,v),le(v)):v.stateNode=p.stateNode}}else Se=function(){},Ee=function(){},Pe=function(){};function Je(p,v){if(!pt)switch(p.tailMode){case"hidden":v=p.tail;for(var L=null;v!==null;)v.alternate!==null&&(L=v),v=v.sibling;L===null?p.tail=null:L.sibling=null;break;case"collapsed":L=p.tail;for(var U=null;L!==null;)L.alternate!==null&&(U=L),L=L.sibling;U===null?v||p.tail===null?p.tail=null:p.tail.sibling=null:U.sibling=null}}function Ae(p){var v=p.alternate!==null&&p.alternate.child===p.child,L=0,U=0;if(v)for(var W=p.child;W!==null;)L|=W.lanes|W.childLanes,U|=W.subtreeFlags&14680064,U|=W.flags&14680064,W.return=p,W=W.sibling;else for(W=p.child;W!==null;)L|=W.lanes|W.childLanes,U|=W.subtreeFlags,U|=W.flags,W.return=p,W=W.sibling;return p.subtreeFlags|=U,p.childLanes=L,v}function qe(p,v,L){var U=v.pendingProps;switch(Ie(v),v.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ae(v),null;case 1:return qr(v.type)&&ls(),Ae(v),null;case 3:return L=v.stateNode,Xo(),pr(Gn),pr(Ui),Vs(),L.pendingContext&&(L.context=L.pendingContext,L.pendingContext=null),(p===null||p.child===null)&&(lr(v)?le(v):p===null||p.memoizedState.isDehydrated&&(v.flags&256)===0||(v.flags|=1024,jt!==null&&(ic(jt),jt=null))),Se(p,v),Ae(v),null;case 5:gs(v),L=pa(Ro.current);var W=v.type;if(p!==null&&v.stateNode!=null)Ee(p,v,W,U,L),p.ref!==v.ref&&(v.flags|=512,v.flags|=2097152);else{if(!U){if(v.stateNode===null)throw Error(o(166));return Ae(v),null}if(p=pa(di.current),lr(v)){if(!ze)throw Error(o(175));p=ui(v.stateNode,v.type,v.memoizedProps,L,p,v,!Ft),v.updateQueue=p,p!==null&&le(v)}else{var ae=B(W,U,L,p,v);me(ae,v,!1,!1),v.stateNode=ae,z(ae,W,U,L,p)&&le(v)}v.ref!==null&&(v.flags|=512,v.flags|=2097152)}return Ae(v),null;case 6:if(p&&v.stateNode!=null)Pe(p,v,p.memoizedProps,U);else{if(typeof U!="string"&&v.stateNode===null)throw Error(o(166));if(p=pa(Ro.current),L=pa(di.current),lr(v)){if(!ze)throw Error(o(176));if(p=v.stateNode,L=v.memoizedProps,(U=Aa(p,L,v,!Ft))&&(W=He,W!==null))switch(W.tag){case 3:If(W.stateNode.containerInfo,p,L,(W.mode&1)!==0);break;case 5:Cr(W.type,W.memoizedProps,W.stateNode,p,L,(W.mode&1)!==0)}U&&le(v)}else v.stateNode=K(U,p,L,v)}return Ae(v),null;case 13:if(pr(rr),U=v.memoizedState,p===null||p.memoizedState!==null&&p.memoizedState.dehydrated!==null){if(pt&&ft!==null&&(v.mode&1)!==0&&(v.flags&128)===0)Si(),kr(),v.flags|=98560,W=!1;else if(W=lr(v),U!==null&&U.dehydrated!==null){if(p===null){if(!W)throw Error(o(318));if(!ze)throw Error(o(344));if(W=v.memoizedState,W=W!==null?W.dehydrated:null,!W)throw Error(o(317));Pa(W,v)}else kr(),(v.flags&128)===0&&(v.memoizedState=null),v.flags|=4;Ae(v),W=!1}else jt!==null&&(ic(jt),jt=null),W=!0;if(!W)return v.flags&65536?v:null}return(v.flags&128)!==0?(v.lanes=L,v):(L=U!==null,L!==(p!==null&&p.memoizedState!==null)&&L&&(v.child.flags|=8192,(v.mode&1)!==0&&(p===null||(rr.current&1)!==0?mr===0&&(mr=3):_o())),v.updateQueue!==null&&(v.flags|=4),Ae(v),null);case 4:return Xo(),Se(p,v),p===null&&pe(v.stateNode.containerInfo),Ae(v),null;case 10:return po(v.type._context),Ae(v),null;case 17:return qr(v.type)&&ls(),Ae(v),null;case 19:if(pr(rr),W=v.memoizedState,W===null)return Ae(v),null;if(U=(v.flags&128)!==0,ae=W.rendering,ae===null)if(U)Je(W,!1);else{if(mr!==0||p!==null&&(p.flags&128)!==0)for(p=v.child;p!==null;){if(ae=ms(p),ae!==null){for(v.flags|=128,Je(W,!1),p=ae.updateQueue,p!==null&&(v.updateQueue=p,v.flags|=4),v.subtreeFlags=0,p=L,L=v.child;L!==null;)U=L,W=p,U.flags&=14680066,ae=U.alternate,ae===null?(U.childLanes=0,U.lanes=W,U.child=null,U.subtreeFlags=0,U.memoizedProps=null,U.memoizedState=null,U.updateQueue=null,U.dependencies=null,U.stateNode=null):(U.childLanes=ae.childLanes,U.lanes=ae.lanes,U.child=ae.child,U.subtreeFlags=0,U.deletions=null,U.memoizedProps=ae.memoizedProps,U.memoizedState=ae.memoizedState,U.updateQueue=ae.updateQueue,U.type=ae.type,W=ae.dependencies,U.dependencies=W===null?null:{lanes:W.lanes,firstContext:W.firstContext}),L=L.sibling;return wn(rr,rr.current&1|2),v.child}p=p.sibling}W.tail!==null&&Er()>Ou&&(v.flags|=128,U=!0,Je(W,!1),v.lanes=4194304)}else{if(!U)if(p=ms(ae),p!==null){if(v.flags|=128,U=!0,p=p.updateQueue,p!==null&&(v.updateQueue=p,v.flags|=4),Je(W,!0),W.tail===null&&W.tailMode==="hidden"&&!ae.alternate&&!pt)return Ae(v),null}else 2*Er()-W.renderingStartTime>Ou&&L!==1073741824&&(v.flags|=128,U=!0,Je(W,!1),v.lanes=4194304);W.isBackwards?(ae.sibling=v.child,v.child=ae):(p=W.last,p!==null?p.sibling=ae:v.child=ae,W.last=ae)}return W.tail!==null?(v=W.tail,W.rendering=v,W.tail=v.sibling,W.renderingStartTime=Er(),v.sibling=null,p=rr.current,wn(rr,U?p&1|2:p&1),v):(Ae(v),null);case 22:case 23:return Lu(),L=v.memoizedState!==null,p!==null&&p.memoizedState!==null!==L&&(v.flags|=8192),L&&(v.mode&1)!==0?(gi&1073741824)!==0&&(Ae(v),Ce&&v.subtreeFlags&6&&(v.flags|=8192)):Ae(v),null;case 24:return null;case 25:return null}throw Error(o(156,v.tag))}function Qe(p,v){switch(Ie(v),v.tag){case 1:return qr(v.type)&&ls(),p=v.flags,p&65536?(v.flags=p&-65537|128,v):null;case 3:return Xo(),pr(Gn),pr(Ui),Vs(),p=v.flags,(p&65536)!==0&&(p&128)===0?(v.flags=p&-65537|128,v):null;case 5:return gs(v),null;case 13:if(pr(rr),p=v.memoizedState,p!==null&&p.dehydrated!==null){if(v.alternate===null)throw Error(o(340));kr()}return p=v.flags,p&65536?(v.flags=p&-65537|128,v):null;case 19:return pr(rr),null;case 4:return Xo(),null;case 10:return po(v.type._context),null;case 22:case 23:return Lu(),null;case 24:return null;default:return null}}var ht=!1,Xe=!1,ct=typeof WeakSet=="function"?WeakSet:Set,Ue=null;function mt(p,v){var L=p.ref;if(L!==null)if(typeof L=="function")try{L(null)}catch(U){Kr(p,v,U)}else L.current=null}function vt(p,v,L){try{L()}catch(U){Kr(p,v,U)}}var Yt=!1;function zt(p,v){for(re(p.containerInfo),Ue=v;Ue!==null;)if(p=Ue,v=p.child,(p.subtreeFlags&1028)!==0&&v!==null)v.return=p,Ue=v;else for(;Ue!==null;){p=Ue;try{var L=p.alternate;if((p.flags&1024)!==0)switch(p.tag){case 0:case 11:case 15:break;case 1:if(L!==null){var U=L.memoizedProps,W=L.memoizedState,ae=p.stateNode,ke=ae.getSnapshotBeforeUpdate(p.elementType===p.type?U:vo(p.type,U),W);ae.__reactInternalSnapshotBeforeUpdate=ke}break;case 3:Ce&&tn(p.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Ve){Kr(p,p.return,Ve)}if(v=p.sibling,v!==null){v.return=p.return,Ue=v;break}Ue=p.return}return L=Yt,Yt=!1,L}function vn(p,v,L){var U=v.updateQueue;if(U=U!==null?U.lastEffect:null,U!==null){var W=U=U.next;do{if((W.tag&p)===p){var ae=W.destroy;W.destroy=void 0,ae!==void 0&&vt(v,L,ae)}W=W.next}while(W!==U)}}function Ut(p,v){if(v=v.updateQueue,v=v!==null?v.lastEffect:null,v!==null){var L=v=v.next;do{if((L.tag&p)===p){var U=L.create;L.destroy=U()}L=L.next}while(L!==v)}}function Nn(p){var v=p.ref;if(v!==null){var L=p.stateNode;switch(p.tag){case 5:p=se(L);break;default:p=L}typeof v=="function"?v(p):v.current=p}}function Hr(p){var v=p.alternate;v!==null&&(p.alternate=null,Hr(v)),p.child=null,p.deletions=null,p.sibling=null,p.tag===5&&(v=p.stateNode,v!==null&&be(v)),p.stateNode=null,p.return=null,p.dependencies=null,p.memoizedProps=null,p.memoizedState=null,p.pendingProps=null,p.stateNode=null,p.updateQueue=null}function _n(p){return p.tag===5||p.tag===3||p.tag===4}function Bt(p){e:for(;;){for(;p.sibling===null;){if(p.return===null||_n(p.return))return null;p=p.return}for(p.sibling.return=p.return,p=p.sibling;p.tag!==5&&p.tag!==6&&p.tag!==18;){if(p.flags&2||p.child===null||p.tag===4)continue e;p.child.return=p,p=p.child}if(!(p.flags&2))return p.stateNode}}function Et(p,v,L){var U=p.tag;if(U===5||U===6)p=p.stateNode,v?on(L,p,v):rt(L,p);else if(U!==4&&(p=p.child,p!==null))for(Et(p,v,L),p=p.sibling;p!==null;)Et(p,v,L),p=p.sibling}function Gr(p,v,L){var U=p.tag;if(U===5||U===6)p=p.stateNode,v?Zt(L,p,v):lt(L,p);else if(U!==4&&(p=p.child,p!==null))for(Gr(p,v,L),p=p.sibling;p!==null;)Gr(p,v,L),p=p.sibling}var Ht=null,yn=!1;function Fn(p,v,L){for(L=L.child;L!==null;)Ai(p,v,L),L=L.sibling}function Ai(p,v,L){if(fa&&typeof fa.onCommitFiberUnmount=="function")try{fa.onCommitFiberUnmount($a,L)}catch{}switch(L.tag){case 5:Xe||mt(L,v);case 6:if(Ce){var U=Ht,W=yn;Ht=null,Fn(p,v,L),Ht=U,yn=W,Ht!==null&&(yn?We(Ht,L.stateNode):an(Ht,L.stateNode))}else Fn(p,v,L);break;case 18:Ce&&Ht!==null&&(yn?as(Ht,L.stateNode):Fs(Ht,L.stateNode));break;case 4:Ce?(U=Ht,W=yn,Ht=L.stateNode.containerInfo,yn=!0,Fn(p,v,L),Ht=U,yn=W):($e&&(U=L.stateNode.containerInfo,W=hn(U),ei(U,W)),Fn(p,v,L));break;case 0:case 11:case 14:case 15:if(!Xe&&(U=L.updateQueue,U!==null&&(U=U.lastEffect,U!==null))){W=U=U.next;do{var ae=W,ke=ae.destroy;ae=ae.tag,ke!==void 0&&((ae&2)!==0||(ae&4)!==0)&&vt(L,v,ke),W=W.next}while(W!==U)}Fn(p,v,L);break;case 1:if(!Xe&&(mt(L,v),U=L.stateNode,typeof U.componentWillUnmount=="function"))try{U.props=L.memoizedProps,U.state=L.memoizedState,U.componentWillUnmount()}catch(Ve){Kr(L,v,Ve)}Fn(p,v,L);break;case 21:Fn(p,v,L);break;case 22:L.mode&1?(Xe=(U=Xe)||L.memoizedState!==null,Fn(p,v,L),Xe=U):Fn(p,v,L);break;default:Fn(p,v,L)}}function pi(p){var v=p.updateQueue;if(v!==null){p.updateQueue=null;var L=p.stateNode;L===null&&(L=p.stateNode=new ct),v.forEach(function(U){var W=ug.bind(null,p,U);L.has(U)||(L.add(U),U.then(W,W))})}}function Wn(p,v){var L=v.deletions;if(L!==null)for(var U=0;U<L.length;U++){var W=L[U];try{var ae=p,ke=v;if(Ce){var Ve=ke;e:for(;Ve!==null;){switch(Ve.tag){case 5:Ht=Ve.stateNode,yn=!1;break e;case 3:Ht=Ve.stateNode.containerInfo,yn=!0;break e;case 4:Ht=Ve.stateNode.containerInfo,yn=!0;break e}Ve=Ve.return}if(Ht===null)throw Error(o(160));Ai(ae,ke,W),Ht=null,yn=!1}else Ai(ae,ke,W);var st=W.alternate;st!==null&&(st.return=null),W.return=null}catch(_t){Kr(W,v,_t)}}if(v.subtreeFlags&12854)for(v=v.child;v!==null;)Pi(v,p),v=v.sibling}function Pi(p,v){var L=p.alternate,U=p.flags;switch(p.tag){case 0:case 11:case 14:case 15:if(Wn(v,p),wr(p),U&4){try{vn(3,p,p.return),Ut(3,p)}catch(Rt){Kr(p,p.return,Rt)}try{vn(5,p,p.return)}catch(Rt){Kr(p,p.return,Rt)}}break;case 1:Wn(v,p),wr(p),U&512&&L!==null&&mt(L,L.return);break;case 5:if(Wn(v,p),wr(p),U&512&&L!==null&&mt(L,L.return),Ce){if(p.flags&32){var W=p.stateNode;try{Be(W)}catch(Rt){Kr(p,p.return,Rt)}}if(U&4&&(W=p.stateNode,W!=null)){var ae=p.memoizedProps;if(L=L!==null?L.memoizedProps:ae,U=p.type,v=p.updateQueue,p.updateQueue=null,v!==null)try{Ct(W,v,U,L,ae,p)}catch(Rt){Kr(p,p.return,Rt)}}}break;case 6:if(Wn(v,p),wr(p),U&4&&Ce){if(p.stateNode===null)throw Error(o(162));W=p.stateNode,ae=p.memoizedProps,L=L!==null?L.memoizedProps:ae;try{ot(W,L,ae)}catch(Rt){Kr(p,p.return,Rt)}}break;case 3:if(Wn(v,p),wr(p),U&4){if(Ce&&ze&&L!==null&&L.memoizedState.isDehydrated)try{zi(v.containerInfo)}catch(Rt){Kr(p,p.return,Rt)}if($e){W=v.containerInfo,ae=v.pendingChildren;try{ei(W,ae)}catch(Rt){Kr(p,p.return,Rt)}}}break;case 4:if(Wn(v,p),wr(p),U&4&&$e){ae=p.stateNode,W=ae.containerInfo,ae=ae.pendingChildren;try{ei(W,ae)}catch(Rt){Kr(p,p.return,Rt)}}break;case 13:Wn(v,p),wr(p),W=p.child,W.flags&8192&&(ae=W.memoizedState!==null,W.stateNode.isHidden=ae,!ae||W.alternate!==null&&W.alternate.memoizedState!==null||(Pu=Er())),U&4&&pi(p);break;case 22:var ke=L!==null&&L.memoizedState!==null;if(p.mode&1?(Xe=(L=Xe)||ke,Wn(v,p),Xe=L):Wn(v,p),wr(p),U&8192){if(L=p.memoizedState!==null,(p.stateNode.isHidden=L)&&!ke&&(p.mode&1)!==0)for(Ue=p,U=p.child;U!==null;){for(v=Ue=U;Ue!==null;){ke=Ue;var Ve=ke.child;switch(ke.tag){case 0:case 11:case 14:case 15:vn(4,ke,ke.return);break;case 1:mt(ke,ke.return);var st=ke.stateNode;if(typeof st.componentWillUnmount=="function"){var _t=ke,Gt=ke.return;try{var kn=_t;st.props=kn.memoizedProps,st.state=kn.memoizedState,st.componentWillUnmount()}catch(Rt){Kr(_t,Gt,Rt)}}break;case 5:mt(ke,ke.return);break;case 22:if(ke.memoizedState!==null){Tr(v);continue}}Ve!==null?(Ve.return=ke,Ue=Ve):Tr(v)}U=U.sibling}if(Ce){e:if(U=null,Ce)for(v=p;;){if(v.tag===5){if(U===null){U=v;try{W=v.stateNode,L?$t(W):Lt(v.stateNode,v.memoizedProps)}catch(Rt){Kr(p,p.return,Rt)}}}else if(v.tag===6){if(U===null)try{ae=v.stateNode,L?At(ae):Tt(ae,v.memoizedProps)}catch(Rt){Kr(p,p.return,Rt)}}else if((v.tag!==22&&v.tag!==23||v.memoizedState===null||v===p)&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===p)break e;for(;v.sibling===null;){if(v.return===null||v.return===p)break e;U===v&&(U=null),v=v.return}U===v&&(U=null),v.sibling.return=v.return,v=v.sibling}}}break;case 19:Wn(v,p),wr(p),U&4&&pi(p);break;case 21:break;default:Wn(v,p),wr(p)}}function wr(p){var v=p.flags;if(v&2){try{if(Ce){e:{for(var L=p.return;L!==null;){if(_n(L)){var U=L;break e}L=L.return}throw Error(o(160))}switch(U.tag){case 5:var W=U.stateNode;U.flags&32&&(Be(W),U.flags&=-33);var ae=Bt(p);Gr(p,ae,W);break;case 3:case 4:var ke=U.stateNode.containerInfo,Ve=Bt(p);Et(p,Ve,ke);break;default:throw Error(o(161))}}}catch(st){Kr(p,p.return,st)}p.flags&=-3}v&4096&&(p.flags&=-4097)}function Br(p,v,L){Ue=p,In(p)}function In(p,v,L){for(var U=(p.mode&1)!==0;Ue!==null;){var W=Ue,ae=W.child;if(W.tag===22&&U){var ke=W.memoizedState!==null||ht;if(!ke){var Ve=W.alternate,st=Ve!==null&&Ve.memoizedState!==null||Xe;Ve=ht;var _t=Xe;if(ht=ke,(Xe=st)&&!_t)for(Ue=W;Ue!==null;)ke=Ue,st=ke.child,ke.tag===22&&ke.memoizedState!==null?Xn(W):st!==null?(st.return=ke,Ue=st):Xn(W);for(;ae!==null;)Ue=ae,In(ae),ae=ae.sibling;Ue=W,ht=Ve,Xe=_t}Yn(p)}else(W.subtreeFlags&8772)!==0&&ae!==null?(ae.return=W,Ue=ae):Yn(p)}}function Yn(p){for(;Ue!==null;){var v=Ue;if((v.flags&8772)!==0){var L=v.alternate;try{if((v.flags&8772)!==0)switch(v.tag){case 0:case 11:case 15:Xe||Ut(5,v);break;case 1:var U=v.stateNode;if(v.flags&4&&!Xe)if(L===null)U.componentDidMount();else{var W=v.elementType===v.type?L.memoizedProps:vo(v.type,L.memoizedProps);U.componentDidUpdate(W,L.memoizedState,U.__reactInternalSnapshotBeforeUpdate)}var ae=v.updateQueue;ae!==null&&ri(v,ae,U);break;case 3:var ke=v.updateQueue;if(ke!==null){if(L=null,v.child!==null)switch(v.child.tag){case 5:L=se(v.child.stateNode);break;case 1:L=v.child.stateNode}ri(v,ke,L)}break;case 5:var Ve=v.stateNode;L===null&&v.flags&4&&dt(Ve,v.type,v.memoizedProps,v);break;case 6:break;case 4:break;case 12:break;case 13:if(ze&&v.memoizedState===null){var st=v.alternate;if(st!==null){var _t=st.memoizedState;if(_t!==null){var Gt=_t.dehydrated;Gt!==null&&ao(Gt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Xe||v.flags&512&&Nn(v)}catch(kn){Kr(v,v.return,kn)}}if(v===p){Ue=null;break}if(L=v.sibling,L!==null){L.return=v.return,Ue=L;break}Ue=v.return}}function Tr(p){for(;Ue!==null;){var v=Ue;if(v===p){Ue=null;break}var L=v.sibling;if(L!==null){L.return=v.return,Ue=L;break}Ue=v.return}}function Xn(p){for(;Ue!==null;){var v=Ue;try{switch(v.tag){case 0:case 11:case 15:var L=v.return;try{Ut(4,v)}catch(st){Kr(v,L,st)}break;case 1:var U=v.stateNode;if(typeof U.componentDidMount=="function"){var W=v.return;try{U.componentDidMount()}catch(st){Kr(v,W,st)}}var ae=v.return;try{Nn(v)}catch(st){Kr(v,ae,st)}break;case 5:var ke=v.return;try{Nn(v)}catch(st){Kr(v,ke,st)}}}catch(st){Kr(v,v.return,st)}if(v===p){Ue=null;break}var Ve=v.sibling;if(Ve!==null){Ve.return=v.return,Ue=Ve;break}Ue=v.return}}var Rr=0,Mr=1,ar=2,Ii=3,Jn=4;if(typeof Symbol=="function"&&Symbol.for){var er=Symbol.for;Rr=er("selector.component"),Mr=er("selector.has_pseudo_class"),ar=er("selector.role"),Ii=er("selector.test_id"),Jn=er("selector.text")}function ii(p){var v=tt(p);if(v!=null){if(typeof v.memoizedProps["data-testname"]!="string")throw Error(o(364));return v}if(p=Me(p),p===null)throw Error(o(362));return p.stateNode.current}function ji(p,v){switch(v.$$typeof){case Rr:if(p.type===v.value)return!0;break;case Mr:e:{v=v.value,p=[p,0];for(var L=0;L<p.length;){var U=p[L++],W=p[L++],ae=v[W];if(U.tag!==5||!we(U)){for(;ae!=null&&ji(U,ae);)W++,ae=v[W];if(W===v.length){v=!0;break e}else for(U=U.child;U!==null;)p.push(U,W),U=U.sibling}}v=!1}return v;case ar:if(p.tag===5&&je(p.stateNode,v.value))return!0;break;case Jn:if((p.tag===5||p.tag===6)&&(p=ye(p),p!==null&&0<=p.indexOf(v.value)))return!0;break;case Ii:if(p.tag===5&&(p=p.memoizedProps["data-testname"],typeof p=="string"&&p.toLowerCase()===v.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function ba(p){switch(p.$$typeof){case Rr:return"<"+(O(p.value)||"Unknown")+">";case Mr:return":has("+(ba(p)||"")+")";case ar:return'[role="'+p.value+'"]';case Jn:return'"'+p.value+'"';case Ii:return'[data-testname="'+p.value+'"]';default:throw Error(o(365))}}function ai(p,v){var L=[];p=[p,0];for(var U=0;U<p.length;){var W=p[U++],ae=p[U++],ke=v[ae];if(W.tag!==5||!we(W)){for(;ke!=null&&ji(W,ke);)ae++,ke=v[ae];if(ae===v.length)L.push(W);else for(W=W.child;W!==null;)p.push(W,ae),W=W.sibling}}return L}function Wr(p,v){if(!Te)throw Error(o(363));p=ii(p),p=ai(p,v),v=[],p=Array.from(p);for(var L=0;L<p.length;){var U=p[L++];if(U.tag===5)we(U)||v.push(U.stateNode);else for(U=U.child;U!==null;)p.push(U),U=U.sibling}return v}var wa=Math.ceil,or=s.ReactCurrentDispatcher,Wi=s.ReactCurrentOwner,Kn=s.ReactCurrentBatchConfig,dn=0,Bn=null,On=null,zr=0,gi=0,Jo=wi(0),mr=0,Au=null,Js=0,vr=0,yo=0,Vl=null,xa=null,Pu=0,Ou=1/0,Vi=null;function cr(){Ou=Er()+500}var Vr=!1,Yr=null,bo=null,jo=!1,wo=null,Hc=0,Xr=0,Cu=null,Sl=-1,xo=0;function Ar(){return(dn&6)!==0?Er():Sl!==-1?Sl:Sl=Er()}function Oi(p){return(p.mode&1)===0?1:(dn&2)!==0&&zr!==0?zr&-zr:Us.transition!==null?(xo===0&&(xo=Ml()),xo):(p=Ln,p!==0?p:ut())}function _a(p,v,L,U){if(50<Xr)throw Xr=0,Cu=null,Error(o(185));za(p,L,U),((dn&2)===0||p!==Bn)&&(p===Bn&&((dn&2)===0&&(vr|=L),mr===4&&Ss(p,zr)),ta(p,U),L===1&&dn===0&&(v.mode&1)===0&&(cr(),zs&&ci()))}function ta(p,v){var L=p.callbackNode;Nc(p,v);var U=dl(p,p===Bn?zr:0);if(U===0)L!==null&&Tc(L),p.callbackNode=null,p.callbackPriority=0;else if(v=U&-U,p.callbackPriority!==v){if(L!=null&&Tc(L),v===1)p.tag===0?Il(zf.bind(null,p)):gl(zf.bind(null,p)),ge?xe(function(){(dn&6)===0&&ci()}):Co(gu,ci),L=null;else{switch(cn(U)){case 1:L=gu;break;case 4:L=mu;break;case 16:L=Bs;break;case 536870912:L=Ku;break;default:L=Bs}L=Rd(L,el.bind(null,p))}p.callbackPriority=v,p.callbackNode=L}}function el(p,v){if(Sl=-1,xo=0,(dn&6)!==0)throw Error(o(327));var L=p.callbackNode;if(Xl()&&p.callbackNode!==L)return null;var U=dl(p,p===Bn?zr:0);if(U===0)return null;if((U&30)!==0||(U&p.expiredLanes)!==0||v)v=ks(p,U);else{v=U;var W=dn;dn|=2;var ae=Es();(Bn!==p||zr!==v)&&(Vi=null,cr(),es(p,v));do try{Vc();break}catch(Ve){Ja(p,Ve)}while(!0);Dl(),or.current=ae,dn=W,On!==null?v=0:(Bn=null,zr=0,v=mr)}if(v!==0){if(v===2&&(W=pl(p),W!==0&&(U=W,v=Gc(p,W))),v===1)throw L=Au,es(p,0),Ss(p,U),ta(p,Er()),L;if(v===6)Ss(p,U);else{if(W=p.current.alternate,(U&30)===0&&!Fh(W)&&(v=ks(p,U),v===2&&(ae=pl(p),ae!==0&&(U=ae,v=Gc(p,ae))),v===1))throw L=Au,es(p,0),Ss(p,U),ta(p,Er()),L;switch(p.finishedWork=W,p.finishedLanes=U,v){case 0:case 1:throw Error(o(345));case 2:As(p,xa,Vi);break;case 3:if(Ss(p,U),(U&130023424)===U&&(v=Pu+500-Er(),10<v)){if(dl(p,0)!==0)break;if(W=p.suspendedLanes,(W&U)!==U){Ar(),p.pingedLanes|=p.suspendedLanes&W;break}p.timeoutHandle=ie(As.bind(null,p,xa,Vi),v);break}As(p,xa,Vi);break;case 4:if(Ss(p,U),(U&4194240)===U)break;for(v=p.eventTimes,W=-1;0<U;){var ke=31-Ca(U);ae=1<<ke,ke=v[ke],ke>W&&(W=ke),U&=~ae}if(U=W,U=Er()-U,U=(120>U?120:480>U?480:1080>U?1080:1920>U?1920:3e3>U?3e3:4320>U?4320:1960*wa(U/1960))-U,10<U){p.timeoutHandle=ie(As.bind(null,p,xa,Vi),U);break}As(p,xa,Vi);break;case 5:As(p,xa,Vi);break;default:throw Error(o(329))}}}return ta(p,Er()),p.callbackNode===L?el.bind(null,p):null}function Gc(p,v){var L=Vl;return p.current.memoizedState.isDehydrated&&(es(p,v).flags|=256),p=ks(p,v),p!==2&&(v=xa,xa=L,v!==null&&ic(v)),p}function ic(p){xa===null?xa=p:xa.push.apply(xa,p)}function Fh(p){for(var v=p;;){if(v.flags&16384){var L=v.updateQueue;if(L!==null&&(L=L.stores,L!==null))for(var U=0;U<L.length;U++){var W=L[U],ae=W.getSnapshot;W=W.value;try{if(!La(ae(),W))return!1}catch{return!1}}}if(L=v.child,v.subtreeFlags&16384&&L!==null)L.return=v,v=L;else{if(v===p)break;for(;v.sibling===null;){if(v.return===null||v.return===p)return!0;v=v.return}v.sibling.return=v.return,v=v.sibling}}return!0}function Ss(p,v){for(v&=~yo,v&=~vr,p.suspendedLanes|=v,p.pingedLanes&=~v,p=p.expirationTimes;0<v;){var L=31-Ca(v),U=1<<L;p[L]=-1,v&=~U}}function zf(p){if((dn&6)!==0)throw Error(o(327));Xl();var v=dl(p,0);if((v&1)===0)return ta(p,Er()),null;var L=ks(p,v);if(p.tag!==0&&L===2){var U=pl(p);U!==0&&(v=U,L=Gc(p,U))}if(L===1)throw L=Au,es(p,0),Ss(p,v),ta(p,Er()),L;if(L===6)throw Error(o(345));return p.finishedWork=p.current.alternate,p.finishedLanes=v,As(p,xa,Vi),ta(p,Er()),null}function Yl(p){wo!==null&&wo.tag===0&&(dn&6)===0&&Xl();var v=dn;dn|=1;var L=Kn.transition,U=Ln;try{if(Kn.transition=null,Ln=1,p)return p()}finally{Ln=U,Kn.transition=L,dn=v,(dn&6)===0&&ci()}}function Lu(){gi=Jo.current,pr(Jo)}function es(p,v){p.finishedWork=null,p.finishedLanes=0;var L=p.timeoutHandle;if(L!==ue&&(p.timeoutHandle=ue,fe(L)),On!==null)for(L=On.return;L!==null;){var U=L;switch(Ie(U),U.tag){case 1:U=U.type.childContextTypes,U!=null&&ls();break;case 3:Xo(),pr(Gn),pr(Ui),Vs();break;case 5:gs(U);break;case 4:Xo();break;case 13:pr(rr);break;case 19:pr(rr);break;case 10:po(U.type._context);break;case 22:case 23:Lu()}L=L.return}if(Bn=p,On=p=Nu(p.current,null),zr=gi=v,mr=0,Au=null,yo=vr=Js=0,xa=Vl=null,Xa!==null){for(v=0;v<Xa.length;v++)if(L=Xa[v],U=L.interleaved,U!==null){L.interleaved=null;var W=U.next,ae=L.pending;if(ae!==null){var ke=ae.next;ae.next=W,U.next=ke}L.pending=U}Xa=null}return p}function Ja(p,v){do{var L=On;try{if(Dl(),Nr.current=Zs,Za){for(var U=fn.memoizedState;U!==null;){var W=U.queue;W!==null&&(W.pending=null),U=U.next}Za=!1}if(Rn=0,Mn=Pn=fn=null,Ys=!1,ys=0,Wi.current=null,L===null||L.return===null){mr=1,Au=v,On=null;break}e:{var ae=p,ke=L.return,Ve=L,st=v;if(v=zr,Ve.flags|=32768,st!==null&&typeof st=="object"&&typeof st.then=="function"){var _t=st,Gt=Ve,kn=Gt.tag;if((Gt.mode&1)===0&&(kn===0||kn===11||kn===15)){var Rt=Gt.alternate;Rt?(Gt.updateQueue=Rt.updateQueue,Gt.memoizedState=Rt.memoizedState,Gt.lanes=Rt.lanes):(Gt.updateQueue=null,Gt.memoizedState=null)}var Ur=jh(ke);if(Ur!==null){Ur.flags&=-257,Qs(Ur,ke,Ve,ae,v),Ur.mode&1&&Ih(ae,_t,v),v=Ur,st=_t;var xr=v.updateQueue;if(xr===null){var So=new Set;So.add(st),v.updateQueue=So}else xr.add(st);break e}else{if((v&1)===0){Ih(ae,_t,v),_o();break e}st=Error(o(426))}}else if(pt&&Ve.mode&1){var El=jh(ke);if(El!==null){(El.flags&65536)===0&&(El.flags|=256),Qs(El,ke,Ve,ae,v),Li(Ji(st,Ve));break e}}ae=st=Ji(st,Ve),mr!==4&&(mr=2),Vl===null?Vl=[ae]:Vl.push(ae),ae=ke;do{switch(ae.tag){case 3:ae.flags|=65536,v&=-v,ae.lanes|=v;var it=ea(ae,st,v);ds(ae,it);break e;case 1:Ve=st;var Ke=ae.type,gt=ae.stateNode;if((ae.flags&128)===0&&(typeof Ke.getDerivedStateFromError=="function"||gt!==null&&typeof gt.componentDidCatch=="function"&&(bo===null||!bo.has(gt)))){ae.flags|=65536,v&=-v,ae.lanes|=v;var Mt=Ra(ae,Ve,v);ds(ae,Mt);break e}}ae=ae.return}while(ae!==null)}ac(L)}catch(ln){v=ln,On===L&&L!==null&&(On=L=L.return);continue}break}while(!0)}function Es(){var p=or.current;return or.current=Zs,p===null?Zs:p}function _o(){(mr===0||mr===3||mr===2)&&(mr=4),Bn===null||(Js&268435455)===0&&(vr&268435455)===0||Ss(Bn,zr)}function ks(p,v){var L=dn;dn|=2;var U=Es();(Bn!==p||zr!==v)&&(Vi=null,es(p,v));do try{Wc();break}catch(W){Ja(p,W)}while(!0);if(Dl(),dn=L,or.current=U,On!==null)throw Error(o(261));return Bn=null,zr=0,mr}function Wc(){for(;On!==null;)Uf(On)}function Vc(){for(;On!==null&&!Rc();)Uf(On)}function Uf(p){var v=Jp(p.alternate,p,gi);p.memoizedProps=p.pendingProps,v===null?ac(p):On=v,Wi.current=null}function ac(p){var v=p;do{var L=v.alternate;if(p=v.return,(v.flags&32768)===0){if(L=qe(L,v,gi),L!==null){On=L;return}}else{if(L=Qe(L,v),L!==null){L.flags&=32767,On=L;return}if(p!==null)p.flags|=32768,p.subtreeFlags=0,p.deletions=null;else{mr=6,On=null;return}}if(v=v.sibling,v!==null){On=v;return}On=v=p}while(v!==null);mr===0&&(mr=5)}function As(p,v,L){var U=Ln,W=Kn.transition;try{Kn.transition=null,Ln=1,Xp(p,v,L,U)}finally{Kn.transition=W,Ln=U}return null}function Xp(p,v,L,U){do Xl();while(wo!==null);if((dn&6)!==0)throw Error(o(327));L=p.finishedWork;var W=p.finishedLanes;if(L===null)return null;if(p.finishedWork=null,p.finishedLanes=0,L===p.current)throw Error(o(177));p.callbackNode=null,p.callbackPriority=0;var ae=L.lanes|L.childLanes;if(Ua(p,ae),p===Bn&&(On=Bn=null,zr=0),(L.subtreeFlags&2064)===0&&(L.flags&2064)===0||jo||(jo=!0,Rd(Bs,function(){return Xl(),null})),ae=(L.flags&15990)!==0,(L.subtreeFlags&15990)!==0||ae){ae=Kn.transition,Kn.transition=null;var ke=Ln;Ln=1;var Ve=dn;dn|=4,Wi.current=null,zt(p,L),Pi(L,p),X(p.containerInfo),p.current=L,Br(L),uo(),dn=Ve,Ln=ke,Kn.transition=ae}else p.current=L;if(jo&&(jo=!1,wo=p,Hc=W),ae=p.pendingLanes,ae===0&&(bo=null),Ha(L.stateNode),ta(p,Er()),v!==null)for(U=p.onRecoverableError,L=0;L<v.length;L++)W=v[L],U(W.value,{componentStack:W.stack,digest:W.digest});if(Vr)throw Vr=!1,p=Yr,Yr=null,p;return(Hc&1)!==0&&p.tag!==0&&Xl(),ae=p.pendingLanes,(ae&1)!==0?p===Cu?Xr++:(Xr=0,Cu=p):Xr=0,ci(),null}function Xl(){if(wo!==null){var p=cn(Hc),v=Kn.transition,L=Ln;try{if(Kn.transition=null,Ln=16>p?16:p,wo===null)var U=!1;else{if(p=wo,wo=null,Hc=0,(dn&6)!==0)throw Error(o(331));var W=dn;for(dn|=4,Ue=p.current;Ue!==null;){var ae=Ue,ke=ae.child;if((Ue.flags&16)!==0){var Ve=ae.deletions;if(Ve!==null){for(var st=0;st<Ve.length;st++){var _t=Ve[st];for(Ue=_t;Ue!==null;){var Gt=Ue;switch(Gt.tag){case 0:case 11:case 15:vn(8,Gt,ae)}var kn=Gt.child;if(kn!==null)kn.return=Gt,Ue=kn;else for(;Ue!==null;){Gt=Ue;var Rt=Gt.sibling,Ur=Gt.return;if(Hr(Gt),Gt===_t){Ue=null;break}if(Rt!==null){Rt.return=Ur,Ue=Rt;break}Ue=Ur}}}var xr=ae.alternate;if(xr!==null){var So=xr.child;if(So!==null){xr.child=null;do{var El=So.sibling;So.sibling=null,So=El}while(So!==null)}}Ue=ae}}if((ae.subtreeFlags&2064)!==0&&ke!==null)ke.return=ae,Ue=ke;else e:for(;Ue!==null;){if(ae=Ue,(ae.flags&2048)!==0)switch(ae.tag){case 0:case 11:case 15:vn(9,ae,ae.return)}var it=ae.sibling;if(it!==null){it.return=ae.return,Ue=it;break e}Ue=ae.return}}var Ke=p.current;for(Ue=Ke;Ue!==null;){ke=Ue;var gt=ke.child;if((ke.subtreeFlags&2064)!==0&>!==null)gt.return=ke,Ue=gt;else e:for(ke=Ke;Ue!==null;){if(Ve=Ue,(Ve.flags&2048)!==0)try{switch(Ve.tag){case 0:case 11:case 15:Ut(9,Ve)}}catch(ln){Kr(Ve,Ve.return,ln)}if(Ve===ke){Ue=null;break e}var Mt=Ve.sibling;if(Mt!==null){Mt.return=Ve.return,Ue=Mt;break e}Ue=Ve.return}}if(dn=W,ci(),fa&&typeof fa.onPostCommitFiberRoot=="function")try{fa.onPostCommitFiberRoot($a,p)}catch{}U=!0}return U}finally{Ln=L,Kn.transition=v}}return!1}function Td(p,v,L){v=Ji(L,v),v=ea(p,v,1),p=Zi(p,v,1),v=Ar(),p!==null&&(za(p,1,v),ta(p,v))}function Kr(p,v,L){if(p.tag===3)Td(p,p,L);else for(;v!==null;){if(v.tag===3){Td(v,p,L);break}else if(v.tag===1){var U=v.stateNode;if(typeof v.type.getDerivedStateFromError=="function"||typeof U.componentDidCatch=="function"&&(bo===null||!bo.has(U))){p=Ji(L,p),p=Ra(v,p,1),v=Zi(v,p,1),p=Ar(),v!==null&&(za(v,1,p),ta(v,p));break}}v=v.return}}function Kp(p,v,L){var U=p.pingCache;U!==null&&U.delete(v),v=Ar(),p.pingedLanes|=p.suspendedLanes&L,Bn===p&&(zr&L)===L&&(mr===4||mr===3&&(zr&130023424)===zr&&500>Er()-Pu?es(p,0):yo|=L),ta(p,v)}function Zp(p,v){v===0&&((p.mode&1)===0?v=1:(v=cs,cs<<=1,(cs&130023424)===0&&(cs=4194304)));var L=Ar();p=$i(p,v),p!==null&&(za(p,v,L),ta(p,L))}function Qp(p){var v=p.memoizedState,L=0;v!==null&&(L=v.retryLane),Zp(p,L)}function ug(p,v){var L=0;switch(p.tag){case 13:var U=p.stateNode,W=p.memoizedState;W!==null&&(L=W.retryLane);break;case 19:U=p.stateNode;break;default:throw Error(o(314))}U!==null&&U.delete(v),Zp(p,L)}var Jp;Jp=function(p,v,L){if(p!==null)if(p.memoizedProps!==v.pendingProps||Gn.current)ki=!0;else{if((p.lanes&L)===0&&(v.flags&128)===0)return ki=!1,ne(p,v,L);ki=(p.flags&131072)!==0}else ki=!1,pt&&(v.flags&1048576)!==0&&ce(v,fs,v.index);switch(v.lanes=0,v.tag){case 2:var U=v.type;M(p,v),p=v.pendingProps;var W=qi(v,Ui.current);Ws(v,L),W=yu(null,v,U,p,W,L);var ae=Zu();return v.flags|=1,typeof W=="object"&&W!==null&&typeof W.render=="function"&&W.$$typeof===void 0?(v.tag=1,v.memoizedState=null,v.updateQueue=null,qr(U)?(ae=!0,Ba(v)):ae=!1,v.memoizedState=W.state!==null&&W.state!==void 0?W.state:null,Na(v),W.updater=nc,v.stateNode=W,W._reactInternals=v,Qi(v,U,p,L),v=va(null,v,U,!0,ae,L)):(v.tag=0,pt&&ae&&Oe(v),Mi(null,v,W,L),v=v.child),v;case 16:U=v.elementType;e:{switch(M(p,v),p=v.pendingProps,W=U._init,U=W(U._payload),v.type=U,W=v.tag=cg(U),p=vo(U,p),W){case 0:v=ws(null,v,U,p,L);break e;case 1:v=Gi(null,v,U,p,L);break e;case 11:v=$c(null,v,U,p,L);break e;case 14:v=bs(null,v,U,vo(U.type,p),L);break e}throw Error(o(306,U,""))}return v;case 0:return U=v.type,W=v.pendingProps,W=v.elementType===U?W:vo(U,W),ws(p,v,U,W,L);case 1:return U=v.type,W=v.pendingProps,W=v.elementType===U?W:vo(U,W),Gi(p,v,U,W,L);case 3:e:{if(_l(v),p===null)throw Error(o(387));U=v.pendingProps,ae=v.memoizedState,W=ae.element,Ka(p,v),go(v,U,null,L);var ke=v.memoizedState;if(U=ke.element,ze&&ae.isDehydrated)if(ae={element:U,isDehydrated:!1,cache:ke.cache,pendingSuspenseBoundaries:ke.pendingSuspenseBoundaries,transitions:ke.transitions},v.updateQueue.baseState=ae,v.memoizedState=ae,v.flags&256){W=Ji(Error(o(423)),v),v=Gl(p,v,U,L,W);break e}else if(U!==W){W=Ji(Error(o(424)),v),v=Gl(p,v,U,L,W);break e}else for(ze&&(ft=ka(v.stateNode.containerInfo),He=v,pt=!0,jt=null,Ft=!1),L=Gs(v,null,U,L),v.child=L;L;)L.flags=L.flags&-3|4096,L=L.sibling;else{if(kr(),U===W){v=V(p,v,L);break e}Mi(p,v,U,L)}v=v.child}return v;case 5:return ps(v),p===null&&Lr(v),U=v.type,W=v.pendingProps,ae=p!==null?p.memoizedProps:null,ke=W.children,J(U,W)?ke=null:ae!==null&&J(U,ae)&&(v.flags|=32),ur(p,v),Mi(p,v,ke,L),v.child;case 6:return p===null&&Lr(v),null;case 13:return Bf(p,v,L);case 4:return bl(v,v.stateNode.containerInfo),U=v.pendingProps,p===null?v.child=ho(v,null,U,L):Mi(p,v,U,L),v.child;case 11:return U=v.type,W=v.pendingProps,W=v.elementType===U?W:vo(U,W),$c(p,v,U,W,L);case 7:return Mi(p,v,v.pendingProps,L),v.child;case 8:return Mi(p,v,v.pendingProps.children,L),v.child;case 12:return Mi(p,v,v.pendingProps.children,L),v.child;case 10:e:{if(U=v.type._context,W=v.pendingProps,ae=v.memoizedProps,ke=W.value,ha(v,U,ke),ae!==null)if(La(ae.value,ke)){if(ae.children===W.children&&!Gn.current){v=V(p,v,L);break e}}else for(ae=v.child,ae!==null&&(ae.return=v);ae!==null;){var Ve=ae.dependencies;if(Ve!==null){ke=ae.child;for(var st=Ve.firstContext;st!==null;){if(st.context===U){if(ae.tag===1){st=da(-1,L&-L),st.tag=2;var _t=ae.updateQueue;if(_t!==null){_t=_t.shared;var Gt=_t.pending;Gt===null?st.next=st:(st.next=Gt.next,Gt.next=st),_t.pending=st}}ae.lanes|=L,st=ae.alternate,st!==null&&(st.lanes|=L),No(ae.return,L,v),Ve.lanes|=L;break}st=st.next}}else if(ae.tag===10)ke=ae.type===v.type?null:ae.child;else if(ae.tag===18){if(ke=ae.return,ke===null)throw Error(o(341));ke.lanes|=L,Ve=ke.alternate,Ve!==null&&(Ve.lanes|=L),No(ke,L,v),ke=ae.sibling}else ke=ae.child;if(ke!==null)ke.return=ae;else for(ke=ae;ke!==null;){if(ke===v){ke=null;break}if(ae=ke.sibling,ae!==null){ae.return=ke.return,ke=ae;break}ke=ke.return}ae=ke}Mi(p,v,W.children,L),v=v.child}return v;case 9:return W=v.type,U=v.pendingProps.children,Ws(v,L),W=Fr(W),U=U(W),v.flags|=1,Mi(p,v,U,L),v.child;case 14:return U=v.type,W=vo(U,v.pendingProps),W=vo(U.type,W),bs(p,v,U,W,L);case 15:return Io(p,v,v.type,v.pendingProps,L);case 17:return U=v.type,W=v.pendingProps,W=v.elementType===U?W:vo(U,W),M(p,v),v.tag=1,qr(U)?(p=!0,Ba(v)):p=!1,Ws(v,L),Mh(v,U,W),Qi(v,U,W,L),va(null,v,U,!0,p,L);case 19:return P(p,v,L);case 22:return ir(p,v,L)}throw Error(o(156,v.tag))};function Rd(p,v){return Co(p,v)}function e1(p,v,L,U){this.tag=p,this.key=L,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=v,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=U,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ts(p,v,L,U){return new e1(p,v,L,U)}function Yc(p){return p=p.prototype,!(!p||!p.isReactComponent)}function cg(p){if(typeof p=="function")return Yc(p)?1:0;if(p!=null){if(p=p.$$typeof,p===_)return 11;if(p===S)return 14}return 2}function Nu(p,v){var L=p.alternate;return L===null?(L=ts(p.tag,v,p.key,p.mode),L.elementType=p.elementType,L.type=p.type,L.stateNode=p.stateNode,L.alternate=p,p.alternate=L):(L.pendingProps=v,L.type=p.type,L.flags=0,L.subtreeFlags=0,L.deletions=null),L.flags=p.flags&14680064,L.childLanes=p.childLanes,L.lanes=p.lanes,L.child=p.child,L.memoizedProps=p.memoizedProps,L.memoizedState=p.memoizedState,L.updateQueue=p.updateQueue,v=p.dependencies,L.dependencies=v===null?null:{lanes:v.lanes,firstContext:v.firstContext},L.sibling=p.sibling,L.index=p.index,L.ref=p.ref,L}function Bh(p,v,L,U,W,ae){var ke=2;if(U=p,typeof p=="function")Yc(p)&&(ke=1);else if(typeof p=="string")ke=5;else e:switch(p){case c:return Ma(L.children,W,ae,v);case m:ke=8,W|=8;break;case g:return p=ts(12,L,v,W|2),p.elementType=g,p.lanes=ae,p;case x:return p=ts(13,L,v,W),p.elementType=x,p.lanes=ae,p;case b:return p=ts(19,L,v,W),p.elementType=b,p.lanes=ae,p;case E:return Xc(L,W,ae,v);default:if(typeof p=="object"&&p!==null)switch(p.$$typeof){case d:ke=10;break e;case y:ke=9;break e;case _:ke=11;break e;case S:ke=14;break e;case k:ke=16,U=null;break e}throw Error(o(130,p==null?p:typeof p,""))}return v=ts(ke,L,v,W),v.elementType=p,v.type=U,v.lanes=ae,v}function Ma(p,v,L,U){return p=ts(7,p,U,v),p.lanes=L,p}function Xc(p,v,L,U){return p=ts(22,p,U,v),p.elementType=E,p.lanes=L,p.stateNode={isHidden:!1},p}function Kc(p,v,L){return p=ts(6,p,null,v),p.lanes=L,p}function zh(p,v,L){return v=ts(4,p.children!==null?p.children:[],p.key,v),v.lanes=L,v.stateNode={containerInfo:p.containerInfo,pendingChildren:null,implementation:p.implementation},v}function t1(p,v,L,U,W){this.tag=v,this.containerInfo=p,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ue,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ca(0),this.expirationTimes=ca(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ca(0),this.identifierPrefix=U,this.onRecoverableError=W,ze&&(this.mutableSourceEagerHydrationData=null)}function Md(p,v,L,U,W,ae,ke,Ve,st){return p=new t1(p,v,L,Ve,st),v===1?(v=1,ae===!0&&(v|=8)):v=0,ae=ts(3,null,null,v),p.current=ae,ae.stateNode=p,ae.memoizedState={element:U,isDehydrated:L,cache:null,transitions:null,pendingSuspenseBoundaries:null},Na(ae),p}function Uh(p){if(!p)return oo;p=p._reactInternals;e:{if(j(p)!==p||p.tag!==1)throw Error(o(170));var v=p;do{switch(v.tag){case 3:v=v.stateNode.context;break e;case 1:if(qr(v.type)){v=v.stateNode.__reactInternalMemoizedMergedChildContext;break e}}v=v.return}while(v!==null);throw Error(o(171))}if(p.tag===1){var L=p.type;if(qr(L))return xi(p,L,v)}return v}function oc(p){var v=p._reactInternals;if(v===void 0)throw typeof p.render=="function"?Error(o(188)):(p=Object.keys(p).join(","),Error(o(268,p)));return p=N(v),p===null?null:p.stateNode}function qh(p,v){if(p=p.memoizedState,p!==null&&p.dehydrated!==null){var L=p.retryLane;p.retryLane=L!==0&&L<v?L:v}}function Zc(p,v){qh(p,v),(p=p.alternate)&&qh(p,v)}function fg(p){return p=N(p),p===null?null:p.stateNode}function n1(){return null}return n.attemptContinuousHydration=function(p){if(p.tag===13){var v=$i(p,134217728);if(v!==null){var L=Ar();_a(v,p,134217728,L)}Zc(p,134217728)}},n.attemptDiscreteHydration=function(p){if(p.tag===13){var v=$i(p,1);if(v!==null){var L=Ar();_a(v,p,1,L)}Zc(p,1)}},n.attemptHydrationAtCurrentPriority=function(p){if(p.tag===13){var v=Oi(p),L=$i(p,v);if(L!==null){var U=Ar();_a(L,p,v,U)}Zc(p,v)}},n.attemptSynchronousHydration=function(p){switch(p.tag){case 3:var v=p.stateNode;if(v.current.memoizedState.isDehydrated){var L=Oo(v.pendingLanes);L!==0&&(qa(v,L|1),ta(v,Er()),(dn&6)===0&&(cr(),ci()))}break;case 13:Yl(function(){var U=$i(p,1);if(U!==null){var W=Ar();_a(U,p,1,W)}}),Zc(p,1)}},n.batchedUpdates=function(p,v){var L=dn;dn|=1;try{return p(v)}finally{dn=L,dn===0&&(cr(),zs&&ci())}},n.createComponentSelector=function(p){return{$$typeof:Rr,value:p}},n.createContainer=function(p,v,L,U,W,ae,ke){return Md(p,v,!1,null,L,U,W,ae,ke)},n.createHasPseudoClassSelector=function(p){return{$$typeof:Mr,value:p}},n.createHydrationContainer=function(p,v,L,U,W,ae,ke,Ve,st){return p=Md(L,U,!0,p,W,ae,ke,Ve,st),p.context=Uh(null),L=p.current,U=Ar(),W=Oi(L),ae=da(U,W),ae.callback=v??null,Zi(L,ae,W),p.current.lanes=W,za(p,W,U),ta(p,U),p},n.createPortal=function(p,v,L){var U=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:U==null?null:""+U,children:p,containerInfo:v,implementation:L}},n.createRoleSelector=function(p){return{$$typeof:ar,value:p}},n.createTestNameSelector=function(p){return{$$typeof:Ii,value:p}},n.createTextSelector=function(p){return{$$typeof:Jn,value:p}},n.deferredUpdates=function(p){var v=Ln,L=Kn.transition;try{return Kn.transition=null,Ln=16,p()}finally{Ln=v,Kn.transition=L}},n.discreteUpdates=function(p,v,L,U,W){var ae=Ln,ke=Kn.transition;try{return Kn.transition=null,Ln=1,p(v,L,U,W)}finally{Ln=ae,Kn.transition=ke,dn===0&&cr()}},n.findAllNodes=Wr,n.findBoundingRects=function(p,v){if(!Te)throw Error(o(363));v=Wr(p,v),p=[];for(var L=0;L<v.length;L++)p.push(ve(v[L]));for(v=p.length-1;0<v;v--){L=p[v];for(var U=L.x,W=U+L.width,ae=L.y,ke=ae+L.height,Ve=v-1;0<=Ve;Ve--)if(v!==Ve){var st=p[Ve],_t=st.x,Gt=_t+st.width,kn=st.y,Rt=kn+st.height;if(U>=_t&&ae>=kn&&W<=Gt&&ke<=Rt){p.splice(v,1);break}else if(U!==_t||L.width!==st.width||Rt<ae||kn>ke){if(!(ae!==kn||L.height!==st.height||Gt<U||_t>W)){_t>U&&(st.width+=_t-U,st.x=U),Gt<W&&(st.width=W-_t),p.splice(v,1);break}}else{kn>ae&&(st.height+=kn-ae,st.y=ae),Rt<ke&&(st.height=ke-kn),p.splice(v,1);break}}}return p},n.findHostInstance=oc,n.findHostInstanceWithNoPortals=function(p){return p=C(p),p=p!==null?G(p):null,p===null?null:p.stateNode},n.findHostInstanceWithWarning=function(p){return oc(p)},n.flushControlled=function(p){var v=dn;dn|=1;var L=Kn.transition,U=Ln;try{Kn.transition=null,Ln=1,p()}finally{Ln=U,Kn.transition=L,dn=v,dn===0&&(cr(),ci())}},n.flushPassiveEffects=Xl,n.flushSync=Yl,n.focusWithin=function(p,v){if(!Te)throw Error(o(363));for(p=ii(p),v=ai(p,v),v=Array.from(v),p=0;p<v.length;){var L=v[p++];if(!we(L)){if(L.tag===5&&Le(L.stateNode))return!0;for(L=L.child;L!==null;)v.push(L),L=L.sibling}}return!1},n.getCurrentUpdatePriority=function(){return Ln},n.getFindAllNodesFailureDescription=function(p,v){if(!Te)throw Error(o(363));var L=0,U=[];p=[ii(p),0];for(var W=0;W<p.length;){var ae=p[W++],ke=p[W++],Ve=v[ke];if((ae.tag!==5||!we(ae))&&(ji(ae,Ve)&&(U.push(ba(Ve)),ke++,ke>L&&(L=ke)),ke<v.length))for(ae=ae.child;ae!==null;)p.push(ae,ke),ae=ae.sibling}if(L<v.length){for(p=[];L<v.length;L++)p.push(ba(v[L]));return`findAllNodes was able to match part of the selector:
|
|
31
|
+
`+(U.join(" > ")+`
|
|
32
|
+
|
|
33
|
+
No matching component was found for:
|
|
34
|
+
`)+p.join(" > ")}return null},n.getPublicRootInstance=function(p){if(p=p.current,!p.child)return null;switch(p.child.tag){case 5:return se(p.child.stateNode);default:return p.child.stateNode}},n.injectIntoDevTools=function(p){if(p={bundleType:p.bundleType,version:p.version,rendererPackageName:p.rendererPackageName,rendererConfig:p.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:fg,findFiberByHostInstance:p.findFiberByHostInstance||n1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")p=!1;else{var v=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(v.isDisabled||!v.supportsFiber)p=!0;else{try{$a=v.inject(p),fa=v}catch{}p=!!v.checkDCE}}return p},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(p,v,L,U){if(!Te)throw Error(o(363));p=Wr(p,v);var W=Ye(p,L,U).disconnect;return{disconnect:function(){W()}}},n.registerMutableSourceForHydration=function(p,v){var L=v._getVersion;L=L(v._source),p.mutableSourceEagerHydrationData==null?p.mutableSourceEagerHydrationData=[v,L]:p.mutableSourceEagerHydrationData.push(v,L)},n.runWithPriority=function(p,v){var L=Ln;try{return Ln=p,v()}finally{Ln=L}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(p,v,L,U){var W=v.current,ae=Ar(),ke=Oi(W);return L=Uh(L),v.context===null?v.context=L:v.pendingContext=L,v=da(ae,ke),v.payload={element:p},U=U===void 0?null:U,U!==null&&(v.callback=U),p=Zi(W,v,ke),p!==null&&(_a(p,W,ke,ae),To(p,W,ke)),ke},n}),t2}var sb;function RA(){return sb||(sb=1,e2.exports=TA()),e2.exports}var MA=RA();const IA=yh(MA);var n2={exports:{}},of={};var lb;function jA(){return lb||(lb=1,of.ConcurrentRoot=1,of.ContinuousEventPriority=4,of.DefaultEventPriority=16,of.DiscreteEventPriority=1,of.IdleEventPriority=536870912,of.LegacyRoot=0),of}var ub;function DA(){return ub||(ub=1,n2.exports=jA()),n2.exports}var j8=DA();const cb={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let fb=!1,hb=!1;const ay=".react-konva-event",FA=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
|
|
35
|
+
Position of a node will be changed during drag&drop, so you should update state of the react app as well.
|
|
36
|
+
Consider to add onDragMove or onDragEnd events.
|
|
37
|
+
For more info see: https://github.com/konvajs/react-konva/issues/256
|
|
38
|
+
`,BA=`ReactKonva: You are using "zIndex" attribute for a Konva node.
|
|
39
|
+
react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
|
|
40
|
+
For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
41
|
+
`,zA={};function Z0(e,t,n=zA){if(!fb&&"zIndex"in t&&(console.warn(BA),fb=!0),!hb&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(FA),hb=!0)}for(var a in n)if(!cb[a]){var o=a.slice(0,2)==="on",s=n[a]!==t[a];if(o&&s){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e.off(u,n[a])}var h=!t.hasOwnProperty(a);h&&e.setAttr(a,void 0)}var c=t._useStrictMode,m={},g=!1;const d={};for(var a in t)if(!cb[a]){var o=a.slice(0,2)==="on",y=n[a]!==t[a];if(o&&y){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),t[a]&&(d[u]=t[a])}!o&&(t[a]!==n[a]||c&&t[a]!==e.getAttr(a))&&(g=!0,m[a]=t[a])}g&&(e.setAttrs(m),Nf(e));for(var u in d)e.on(u+ay,d[u])}function Nf(e){if(!Ot.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}var r2=qv();const D8={},UA={};hh.Node.prototype._applyProps=Z0;function qA(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),Nf(e)}function $A(e,t,n){let r=hh[e];r||(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`),r=hh.Group);const i={},a={};for(var o in t){var s=o.slice(0,2)==="on";s?a[o]=t[o]:i[o]=t[o]}const u=new r(i);return Z0(u,a),u}function HA(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function GA(e,t,n){return!1}function WA(e){return e}function VA(){return null}function YA(){return null}function XA(e,t,n,r){return UA}function KA(){}function ZA(e){}function QA(e,t){return!1}function JA(){return D8}function eP(){return D8}const tP=setTimeout,nP=clearTimeout,rP=-1;function iP(e,t){return!1}const aP=!1,oP=!0,sP=!0;function lP(e,t){t.parent===e?t.moveToTop():e.add(t),Nf(e)}function uP(e,t){t.parent===e?t.moveToTop():e.add(t),Nf(e)}function F8(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),Nf(e)}function cP(e,t,n){F8(e,t,n)}function fP(e,t){t.destroy(),t.off(ay),Nf(e)}function hP(e,t){t.destroy(),t.off(ay),Nf(e)}function dP(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function pP(e,t,n){}function gP(e,t,n,r,i){Z0(e,i,r)}function mP(e){e.hide(),Nf(e)}function vP(e){}function yP(e,t){(t.visible==null||t.visible)&&e.show()}function bP(e,t){}function wP(e){}function xP(){}const _P=()=>j8.DefaultEventPriority,SP=Object.freeze(Object.defineProperty({__proto__:null,appendChild:lP,appendChildToContainer:uP,appendInitialChild:qA,cancelTimeout:nP,clearContainer:wP,commitMount:pP,commitTextUpdate:dP,commitUpdate:gP,createInstance:$A,createTextInstance:HA,detachDeletedInstance:xP,finalizeInitialChildren:GA,getChildHostContext:eP,getCurrentEventPriority:_P,getPublicInstance:WA,getRootHostContext:JA,hideInstance:mP,hideTextInstance:vP,idlePriority:r2.unstable_IdlePriority,insertBefore:F8,insertInContainerBefore:cP,isPrimaryRenderer:aP,noTimeout:rP,now:r2.unstable_now,prepareForCommit:VA,preparePortalMount:YA,prepareUpdate:XA,removeChild:fP,removeChildFromContainer:hP,resetAfterCommit:KA,resetTextContent:ZA,run:r2.unstable_runWithPriority,scheduleTimeout:tP,shouldDeprioritizeSubtree:QA,shouldSetTextContent:iP,supportsMutation:sP,unhideInstance:yP,unhideTextInstance:bP,warnsIfNotActing:oP},Symbol.toStringTag,{value:"Module"}));var EP=Object.defineProperty,kP=Object.defineProperties,AP=Object.getOwnPropertyDescriptors,db=Object.getOwnPropertySymbols,PP=Object.prototype.hasOwnProperty,OP=Object.prototype.propertyIsEnumerable,pb=(e,t,n)=>t in e?EP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gb=(e,t)=>{for(var n in t||(t={}))PP.call(t,n)&&pb(e,n,t[n]);if(db)for(var n of db(t))OP.call(t,n)&&pb(e,n,t[n]);return e},CP=(e,t)=>kP(e,AP(t)),mb,vb;typeof window<"u"&&((mb=window.document)!=null&&mb.createElement||((vb=window.navigator)==null?void 0:vb.product)==="ReactNative")?Di.useLayoutEffect:Di.useEffect;function B8(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=e.child;for(;r;){const i=B8(r,t,n);if(i)return i;r=r.sibling}}function z8(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const yb=console.error;console.error=function(){const e=[...arguments].join("");if(e?.startsWith("Warning:")&&e.includes("useContext")){console.error=yb;return}return yb.apply(this,arguments)};const oy=z8(Di.createContext(null));class U8 extends Di.Component{render(){return Di.createElement(oy.Provider,{value:this._reactInternals},this.props.children)}}function LP(){const e=Di.useContext(oy);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=Di.useId();return Di.useMemo(()=>{for(const r of[e,e?.alternate]){if(!r)continue;const i=B8(r,!1,a=>{let o=a.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}});if(i)return i}},[e,t])}function NP(){const e=LP(),[t]=Di.useState(()=>new Map);t.clear();let n=e;for(;n;){if(n.type&&typeof n.type=="object"){const i=n.type._context===void 0&&n.type.Provider===n.type?n.type:n.type._context;i&&i!==oy&&!t.has(i)&&t.set(i,Di.useContext(z8(i)))}n=n.return}return t}function q8(){const e=NP();return Di.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>Di.createElement(t,null,Di.createElement(n.Provider,CP(gb({},r),{value:e.get(n)}))),t=>Di.createElement(U8,gb({},t))),[e])}function TP(e){const t=oe.useRef({});return oe.useLayoutEffect(()=>{t.current=e}),oe.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const RP=e=>{const t=oe.useRef(null),n=oe.useRef(null),r=oe.useRef(null),i=TP(e),a=q8(),o=s=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(s):u.current=s)};return oe.useLayoutEffect(()=>(n.current=new hh.Stage({width:e.width,height:e.height,container:t.current}),o(n.current),r.current=ip.createContainer(n.current,j8.LegacyRoot,!1,null),ip.updateContainer(oe.createElement(a,{},e.children),r.current),()=>{hh.isBrowser&&(o(null),ip.updateContainer(null,r.current,null),n.current.destroy())}),[]),oe.useLayoutEffect(()=>{o(n.current),Z0(n.current,e,i),ip.updateContainer(oe.createElement(a,{},e.children),r.current,null)}),oe.createElement("div",{ref:t,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},MP="Layer",hr="Group",E0="Label",Pr="Rect",IP="Circle",yc="Line",ju="Image",Uu="Text",jP="TextPath",sy="Arc",k0="Tag",Ep="Path",kp="Transformer",ip=IA(SP);ip.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:oe.version,rendererPackageName:"react-konva"});const DP=oe.forwardRef((e,t)=>oe.createElement(U8,{},oe.createElement(RP,{...e,forwardedRef:t})));var i2,bb;function FP(){if(bb)return i2;bb=1;var e=Mp();return i2=function(n,r,i){const a=e.useRef("loading"),o=e.useRef(),[s,u]=e.useState(0),h=e.useRef(),c=e.useRef(),m=e.useRef();return(h.current!==n||c.current!==r||m.current!==i)&&(a.current="loading",o.current=void 0,h.current=n,c.current=r,m.current=i),e.useLayoutEffect(function(){if(!n)return;var g=document.createElement("img");function d(){g.decode().catch(()=>{}).finally(()=>{a.current="loaded",o.current=g,u(Math.random())})}function y(){a.current="failed",o.current=void 0,u(Math.random())}return g.addEventListener("load",d),g.addEventListener("error",y),r&&(g.crossOrigin=r),i&&(g.referrerPolicy=i),g.src=n,function(){g.removeEventListener("load",d),g.removeEventListener("error",y)}},[n,r,i]),[o.current,a.current]},i2}var BP=FP();const ly=yh(BP);var zP=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const UP=e=>{const t=window.getComputedStyle(e).position;return!(t==="absolute"||t==="relative")};function qP(e=()=>{}){const t=oe.useRef(e);return t.current=e,oe.useCallback((...n)=>t.current.apply(null,n),[])}const A0=({children:e,groupProps:t,divProps:n,transform:r,transformFunc:i,parentNodeFunc:a})=>{const o=q8(),s=oe.useRef(null),[u]=oe.useState(()=>document.createElement("div")),h=oe.useMemo(()=>i6.createRoot(u),[u]),c=r??!0,m=qP(()=>{if(c&&s.current){let x=s.current.getAbsoluteTransform().decompose();i&&(x=i(x)),u.style.position="absolute",u.style.zIndex="10",u.style.top="0px",u.style.left="0px",u.style.transform=`translate(${x.x}px, ${x.y}px) rotate(${x.rotation}deg) scaleX(${x.scaleX}) scaleY(${x.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 g=n||{},{style:d}=g,y=zP(g,["style"]);Object.assign(u.style,d),Object.assign(u,y)});return oe.useLayoutEffect(()=>{var g;const d=s.current;if(!d)return;const y=a?a({stage:d.getStage()}):(g=d.getStage())===null||g===void 0?void 0:g.container();if(y)return y.appendChild(u),c&&UP(y)&&(y.style.position="relative"),d.on("absoluteTransformChange",m),m(),()=>{var _;d.off("absoluteTransformChange",m),(_=u.parentNode)===null||_===void 0||_.removeChild(u)}},[c,a]),oe.useLayoutEffect(()=>{m()},[n,i]),oe.useLayoutEffect(()=>{queueMicrotask(()=>{n8.flushSync(()=>{h.render(oe.createElement(o,null,e))})})}),oe.useLayoutEffect(()=>()=>{setTimeout(()=>{h.unmount()})},[]),oe.createElement(hr,Object.assign({ref:s},t))},uy=({selector:e,enabled:t,children:n})=>{const r=oe.useRef(null),i=oe.useRef(null),a=oe.useRef(null),o=t??!0;return oe.useLayoutEffect(()=>{if(!r.current||!i.current)return;a.current=i.current;const u=r.current.getStage().findOne(e);o&&u?i.current.moveTo(u):i.current.moveTo(r.current);const h=r.current.getLayer();if(h&&(h.batchDraw(),u)){const c=u.getLayer();if(!c)return;c.batchDraw()}},[e,o]),oe.useEffect(()=>()=>{var s;(s=a.current)===null||s===void 0||s.destroy()},[]),oe.createElement(hr,{name:"_outer_portal",ref:r},oe.createElement(hr,{name:"_inner_portal",ref:i},n))};function $8(e,t,n){const r=t-1,i=n[G8(r,n.length)];return i.marker!=="Z"?i:$8(e,r,n)}function H8(e,t,n){const r=t+1,i=n[G8(r,n.length)];return i.marker==="Z"?H8(e,r,n):i}function $P(e,t,n){let r=n[t-1]||{values:{x:0,y:0}};if(e.marker===e.marker.toLowerCase())switch(e.marker=e.marker.toUpperCase(),e.marker){case"M":e.values.x+=r.values.x,e.values.y+=r.values.y;break;case"L":case"A":e.values.x+=r.values.x,e.values.y+=r.values.y;break;case"H":e.marker="L",e.values.x+=r.values.x,e.values.y=r.values.y;break;case"V":e.marker="L",e.values.x=r.values.x,e.values.y+=r.values.y;break;case"C":e.values.x+=r.values.x,e.values.y+=r.values.y,e.values.x1+=r.values.x,e.values.y1+=r.values.y,e.values.x2+=r.values.x,e.values.y2+=r.values.y;break;case"S":e.values.x+=r.values.x,e.values.y+=r.values.y,e.values.x2+=r.values.x,e.values.y2+=r.values.y;break;case"Q":e.values.x+=r.values.x,e.values.y+=r.values.y,e.values.x1+=r.values.x,e.values.y1+=r.values.y;break;case"T":e.values.x+=r.values.x,e.values.y+=r.values.y;break}else if(e.marker===e.marker.toUpperCase())switch(e.marker){case"H":e.marker="L",e.values.y=r.values.y;break;case"V":e.marker="L",e.values.x=r.values.x;break}if(e.marker==="Z"){let i=function(o,s){return o[s].marker==="M"?o[s]:i(o,s-1)},a=i(n,t);e.values.x=a.values.x,e.values.y=a.values.y}return e}function HP(e,t){const n=[];switch(e.toUpperCase()){case"M":for(let r=0;r<t.length;r+=2){let i;e===e.toUpperCase()?i=r===0?"M":"L":i=r===0?"m":"l",n.push({marker:i,values:{x:t[r],y:t[r+1]}})}break;case"L":for(let r=0;r<t.length;r+=2)n.push({marker:e,values:{x:t[r],y:t[r+1]}});break;case"H":for(let r=0;r<t.length;r++)n.push({marker:e,values:{x:t[r],y:0}});break;case"V":for(let r=0;r<t.length;r++)n.push({marker:e,values:{x:0,y:t[r]}});break;case"C":for(let r=0;r<t.length;r+=6)n.push({marker:e,values:{x1:t[r],y1:t[r+1],x2:t[r+2],y2:t[r+3],x:t[r+4],y:t[r+5]}});break;case"S":for(let r=0;r<t.length;r+=4)n.push({marker:e,values:{x2:t[r],y2:t[r+1],x:t[r+2],y:t[r+3]}});break;case"Q":for(let r=0;r<t.length;r+=4)n.push({marker:e,values:{x1:t[r],y1:t[r+1],x:t[r+2],y:t[r+3]}});break;case"T":for(let r=0;r<t.length;r+=2)n.push({marker:e,values:{x:t[r],y:t[r+1]}});break;case"A":for(let r=0;r<t.length;r+=7)n.push({marker:e,values:{radiusX:t[r],radiusY:t[r+1],rotation:t[r+2],largeArc:t[r+3],sweep:t[r+4],x:t[r+5],y:t[r+6]}});break;case"Z":n.push({marker:e,values:{x:0,y:0}});break}return n}function G8(e,t){return(e%t+t)%t}function GP(e,t,n){if(t!==0&&e.marker==="L"){let r=n[t-1];["x","y"].every(a=>Math.round(Math.abs(r.values[a]-e.values[a]))===0)&&(e.overlap=!0)}return e}function wv(e,t){const n=["x","y"].every(r=>Math.round(Math.abs(e[t].values[r]-e[0].values[r]))===0);e[t].marker==="L"&&n&&(e[t].overlap=!0,wv(e,t-1)),e[t].marker==="Z"&&wv(e,t-1)}function WP(e,t,n){const r=xb(e.values,n.values),i=xb(t.values,e.values);return Math.min(i,r)}function wb(e,t){return Math.atan2(t.x-e.x,t.y-e.y)}function xb(e,t){const n=e.x-t.x,r=e.y-t.y;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2))}function _b(e,t){return Math.sin(e)*t}function Sb(e,t){return Math.cos(e)*t}function Eb(e,t){const n=t/Math.tan(e);return n===1/0||n===-1/0||isNaN(n)?t:n}function VP(e,t){return t*Math.tan(e)}function YP(e,t){let n,r=0,i=e*(180/Math.PI);return i<0&&i>=-180||i>180&&i<360?n=Eb(e/2,-t):(n=Eb(e/2,t),r=1,n===1/0&&(n=t)),{offset:n,sweepFlag:r}}function XP(e){const t=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map(n=>{let r="";if(n.marker!=="Z"){const i=Object.keys(n.values);r=t.filter(a=>i.indexOf(a)!==-1).map(a=>n.values[a]).join()}return`${n.marker}${r}`}).join("").trim()}function kb(e){const t=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,n=/-?[0-9]*\.?\d+/g;return[...e.matchAll(t)].map(r=>({marker:r[0],index:r.index})).reduceRight((r,i)=>{const a=e.substring(i.index,r.length?r[r.length-1].index:e.length);return r.concat([{marker:i.marker,index:i.index,chunk:a.length>0?a.substr(1,a.length-1):a}])},[]).reverse().flatMap(r=>{const i=r.chunk.match(n),a=i?i.map(parseFloat):[];return HP(r.marker,a)}).map($P)}function Ab(e,t,n){let r=[],i=[];return e.forEach(a=>{a.marker==="M"&&r.push([]),r[r.length-1].push(a)}),r.forEach(a=>{a.map(GP),wv(a,a.length-1);const o=a[a.length-1].marker=="Z";a.filter(s=>!s.overlap).map((s,u,h)=>{const m=$8(s,u,h),g=H8(s,u,h),d=wb(s.values,m.values),y=wb(s.values,g.values),_=y-d,x=_*(180/Math.PI),b=WP(s,m,g),S=Math.abs(VP(_/2,b/2)),k=Math.min(t,S),E=YP(_,k),A=E.offset,R=E.sweepFlag,O=(u==0||u==h.length-1)&&!o;switch(s.marker){case"M":case"L":const I=[s.values.x+_b(d,A),s.values.y+Sb(d,A)],j=[s.values.x+_b(y,A),s.values.y+Sb(y,A)];O?i.push({marker:s.marker,values:s.values}):i.push({marker:s.marker,values:{x:parseFloat(I[0].toFixed(3)),y:parseFloat(I[1].toFixed(3))}}),!O&&(g.marker==="L"||g.marker==="M")&&i.push({marker:"A",radius:k,values:{radiusX:parseFloat(k.toFixed(3)),radiusY:parseFloat(k.toFixed(3)),rotation:x,largeArc:0,sweep:R,x:parseFloat(j[0].toFixed(3)),y:parseFloat(j[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":i.push({marker:s.marker,values:s.values});break}})}),{path:XP(i),commands:i}}var j1={},Pb;function KP(){if(Pb)return j1;Pb=1;var e=e||{};e.stringify=(function(){var t={"visit_linear-gradient":function(n){return t.visit_gradient(n)},"visit_repeating-linear-gradient":function(n){return t.visit_gradient(n)},"visit_radial-gradient":function(n){return t.visit_gradient(n)},"visit_repeating-radial-gradient":function(n){return t.visit_gradient(n)},visit_gradient:function(n){var r=t.visit(n.orientation);return r&&(r+=", "),n.type+"("+r+t.visit(n.colorStops)+")"},visit_shape:function(n){var r=n.value,i=t.visit(n.at),a=t.visit(n.style);return a&&(r+=" "+a),i&&(r+=" at "+i),r},"visit_default-radial":function(n){var r="",i=t.visit(n.at);return i&&(r+=i),r},"visit_extent-keyword":function(n){var r=n.value,i=t.visit(n.at);return i&&(r+=" at "+i),r},"visit_position-keyword":function(n){return n.value},visit_position:function(n){return t.visit(n.value.x)+" "+t.visit(n.value.y)},"visit_%":function(n){return n.value+"%"},visit_em:function(n){return n.value+"em"},visit_px:function(n){return n.value+"px"},visit_calc:function(n){return"calc("+n.value+")"},visit_literal:function(n){return t.visit_color(n.value,n)},visit_hex:function(n){return t.visit_color("#"+n.value,n)},visit_rgb:function(n){return t.visit_color("rgb("+n.value.join(", ")+")",n)},visit_rgba:function(n){return t.visit_color("rgba("+n.value.join(", ")+")",n)},visit_hsl:function(n){return t.visit_color("hsl("+n.value[0]+", "+n.value[1]+"%, "+n.value[2]+"%)",n)},visit_hsla:function(n){return t.visit_color("hsla("+n.value[0]+", "+n.value[1]+"%, "+n.value[2]+"%, "+n.value[3]+")",n)},visit_var:function(n){return t.visit_color("var("+n.value+")",n)},visit_color:function(n,r){var i=n,a=t.visit(r.length);return a&&(i+=" "+a),i},visit_angular:function(n){return n.value+"deg"},visit_directional:function(n){return"to "+n.value},visit_array:function(n){var r="",i=n.length;return n.forEach(function(a,o){r+=t.visit(a),o<i-1&&(r+=", ")}),r},visit_object:function(n){return n.width&&n.height?t.visit(n.width)+" "+t.visit(n.height):""},visit:function(n){if(!n)return"";if(n instanceof Array)return t.visit_array(n);if(typeof n=="object"&&!n.type)return t.visit_object(n);if(n.type){var r=t["visit_"+n.type];if(r)return r(n);throw Error("Missing visitor visit_"+n.type)}else throw Error("Invalid node.")}};return function(n){return t.visit(n)}})();var e=e||{};return e.parse=(function(){var t={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,radianValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))rad/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,varColor:/^var/i,calcValue:/^calc/i,variableName:/^(--[a-zA-Z0-9-,\s\#]+)/,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,hslColor:/^hsl/i,hslaColor:/^hsla/i},n="";function r(z){var Y=new Error(n+": "+z);throw Y.source=n,Y}function i(){var z=a();return n.length>0&&r("Invalid input not EOF"),z}function a(){return E(o)}function o(){return s("linear-gradient",t.linearGradient,h)||s("repeating-linear-gradient",t.repeatingLinearGradient,h)||s("radial-gradient",t.radialGradient,g)||s("repeating-radial-gradient",t.repeatingRadialGradient,g)}function s(z,Y,J){return u(Y,function(K){var ie=J();return ie&&(B(t.comma)||r("Missing comma before color stops")),{type:z,orientation:ie,colorStops:E(A)}})}function u(z,Y){var J=B(z);if(J){B(t.startCall)||r("Missing (");var K=Y(J);return B(t.endCall)||r("Missing )"),K}}function h(){var z=c();if(z)return z;var Y=X("position-keyword",t.positionKeywords,1);return Y?{type:"directional",value:Y.value}:m()}function c(){return X("directional",t.sideOrCorner,1)}function m(){return X("angular",t.angleValue,1)||X("angular",t.radianValue,1)}function g(){var z,Y=d(),J;return Y&&(z=[],z.push(Y),J=n,B(t.comma)&&(Y=d(),Y?z.push(Y):n=J)),z}function d(){var z=y()||_();if(z)z.at=b();else{var Y=x();if(Y){z=Y;var J=b();J&&(z.at=J)}else{var K=b();if(K)z={type:"default-radial",at:K};else{var ie=S();ie&&(z={type:"default-radial",at:ie})}}}return z}function y(){var z=X("shape",/^(circle)/i,0);return z&&(z.style=re()||x()),z}function _(){var z=X("shape",/^(ellipse)/i,0);return z&&(z.style=S()||se()||x()),z}function x(){return X("extent-keyword",t.extentKeywords,1)}function b(){if(X("position",/^at/,0)){var z=S();return z||r("Missing positioning value"),z}}function S(){var z=k();if(z.x||z.y)return{type:"position",value:z}}function k(){return{x:se(),y:se()}}function E(z){var Y=z(),J=[];if(Y)for(J.push(Y);B(t.comma);)Y=z(),Y?J.push(Y):r("One extra comma");return J}function A(){var z=R();return z||r("Expected color definition"),z.length=se(),z}function R(){return I()||$()||N()||D()||j()||C()||O()}function O(){return X("literal",t.literalColor,0)}function I(){return X("hex",t.hexColor,1)}function j(){return u(t.rgbColor,function(){return{type:"rgb",value:E(te)}})}function D(){return u(t.rgbaColor,function(){return{type:"rgba",value:E(te)}})}function C(){return u(t.varColor,function(){return{type:"var",value:G()}})}function N(){return u(t.hslColor,function(){var z=B(t.percentageValue);z&&r("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");var Y=te();B(t.comma);var J=B(t.percentageValue),K=J?J[1]:null;B(t.comma),J=B(t.percentageValue);var ie=J?J[1]:null;return(!K||!ie)&&r("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[Y,K,ie]}})}function $(){return u(t.hslaColor,function(){var z=te();B(t.comma);var Y=B(t.percentageValue),J=Y?Y[1]:null;B(t.comma),Y=B(t.percentageValue);var K=Y?Y[1]:null;B(t.comma);var ie=te();return(!J||!K)&&r("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[z,J,K,ie]}})}function G(){return B(t.variableName)[1]}function te(){return B(t.number)[1]}function se(){return X("%",t.percentageValue,1)||ee()||Q()||re()}function ee(){return X("position-keyword",t.positionKeywords,1)}function Q(){return u(t.calcValue,function(){for(var z=1,Y=0;z>0&&Y<n.length;){var J=n.charAt(Y);J==="("?z++:J===")"&&z--,Y++}z>0&&r("Missing closing parenthesis in calc() expression");var K=n.substring(0,Y-1);return F(Y-1),{type:"calc",value:K}})}function re(){return X("px",t.pixelValue,1)||X("em",t.emValue,1)}function X(z,Y,J){var K=B(Y);if(K)return{type:z,value:K[J]}}function B(z){var Y,J;return J=/^[\n\r\t\s]+/.exec(n),J&&F(J[0].length),Y=z.exec(n),Y&&F(Y[0].length),Y}function F(z){n=n.substr(z)}return function(z){return n=z.toString().trim(),n.endsWith(";")&&(n=n.slice(0,-1)),i()}})(),j1.parse=e.parse,j1.stringify=e.stringify,j1}var ZP=KP();const QP=yh(ZP),la=e=>e.indexOf("linear-gradient")>=0,JP=e=>e.type==="hex"?"#"+e.value:e.type==="literal"?e.value:`${e.type}(${e.value.join(",")})`,Up=e=>{if(!la(e))return{rotation:0,stops:[{offset:0,color:e},{offset:1,color:e}]};const t=QP.parse(e)[0];return{rotation:parseFloat(t.orientation.value),stops:t.colorStops.map((n,r)=>({color:JP(n),offset:n.length?parseFloat(n.length.value)/100:r/(t.colorStops.length-1)}))}},Gu=(e,t=e.fill,n="fill")=>oe.useMemo(()=>{if(!la(t))return{[n]:t};const{stops:r,rotation:i}=Up(t),a=e.a.width/2,o=e.a.height/2,s=(i%180+180)%180,u=s>45&&s<135?e.a.width:e.a.height,h=un.Util.degToRad(i)-Math.PI/2,c=[];return r.forEach(({offset:m,color:g})=>{c.push(m,g)}),n==="fill"?{fillLinearGradientStartPointX:a-u/2*Math.cos(h),fillLinearGradientStartPointY:o-u/2*Math.sin(h),fillLinearGradientColorStops:c,fillLinearGradientEndPointX:a+u/2*Math.cos(h),fillLinearGradientEndPointY:o+u/2*Math.sin(h),fill:r[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:a-u/2*Math.cos(h),strokeLinearGradientStartPointY:o-u/2*Math.sin(h),strokeLinearGradientColorStops:c,strokeLinearGradientEndPointX:a+u/2*Math.cos(h),strokeLinearGradientEndPointY:o+u/2*Math.sin(h)}},[t,e.width,e.height]);let P0=!1;const eO=(e=!P0)=>{P0=e},tO=()=>P0;function qp(e,t){const n=oe.useRef();oe.useLayoutEffect(()=>{n.current&&n.current.destroy()},[t]),oe.useLayoutEffect(()=>{if(!P0)return;const r=e.current.opacity();return r?(e.current.opacity(0),n.current=new un.Tween({node:e.current,opacity:r,onFinish:()=>{var i;(i=n.current)===null||i===void 0||i.destroy()}}),n.current.play(),()=>{var i;(i=n.current)===null||i===void 0||i.destroy()}):void 0},[])}let O0=0,xv=[],W8=3e4;const nO=e=>{W8=e};let V8=6e3;const rO=e=>{V8=e},iO=()=>V8;function dh(e){O0+=1;let t=!1,n=!1;const r=setTimeout(()=>{t||($p(`Timeout loading asset ${e}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",e),t=!0,Ob())},W8);return()=>{n?console.error("Finish called twice! That is not expected. id: ",e):(n=!0,t||(clearTimeout(r),Ob()))}}function Ob(){O0-=1,O0===0&&(xv.forEach(e=>e()),xv=[])}function aO(){return new Promise(e=>{return t=()=>{tO()?setTimeout(e,300):e(!0)},void(O0===0?t():xv.push(t));var t})}let Y8=[];function oO(e){Y8.push(e)}function $p(e){Y8.forEach(t=>t(e))}Qn(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]);Qn({value:!1});const cy=Qn([]);function sO(e){cy.push(e)}var _v="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1";let dc;function D1(e,t="sans-serif",n="normal",r="normal"){dc||(dc=document.createElement("canvas"));var i=dc.getContext("2d");return i.font=`${n} ${r} 40px '${e}', ${t}`,i.measureText(_v).width}const dp={Arial:!0},Cb=e=>Object.keys(dp).some(t=>t.startsWith(e+"_"))||!!dp[e];async function lO(e,t,n,r=""){var i;const a=`${e}_${t}_${n}`;if(dp[a])return;const o=!!(!((i=document.fonts)===null||i===void 0)&&i.load),s=(function(m="normal",g="normal"){dc||(dc=document.createElement("canvas"));var d=dc.getContext("2d");return d.font=`${m} ${g} 40px sans-serif`,d.measureText(_v).width})(t,n);if(o)try{if(await document.fonts.load(`${t} ${n} 16px '${e}'`),s!==D1(e,"sans-serif",t,n))return void(dp[a]=!0)}catch{}const u=(function(m="normal",g="normal"){dc||(dc=document.createElement("canvas"));var d=dc.getContext("2d");return d.font=`${m} ${g} 40px serif`,d.measureText(_v).width})(t,n),h=D1(e,"sans-serif",t,n),c=Math.min(6e3,iO())/60;for(let m=0;m<c;m++){const g=D1(e,"sans-serif",t,n),d=D1(e,"serif",t,n);if(g!==h||g!==s||d!==u)return await new Promise(y=>setTimeout(y,100)),void(dp[a]=!0);await new Promise(y=>setTimeout(y,60))}console.warn(`Timeout for loading font "${e}". Looks like polotno can't load it. Is it a correct font family?`),$p(`Timeout for loading font "${e}"`)}const Lb={};let X8="400,400italic,700,700italic";function uO(){return X8}function K8(e){return`https://fonts.googleapis.com/css?family=${e.replace(/ /g,"+")}:${X8}`}function cO(e){if(Lb[e])return;const t=K8(e),n=document.createElement("link");n.type="text/css",n.href=t,n.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(n),Lb[e]=!0}const Nb={};let Yf;function fO(e){const t=e.fontFamily;if(Nb[t]||!e.url&&!e.styles)return;const n=e.styles||(e.url?[{src:`url("${e.url}")`}]:[]),r=(Yf||(Yf=document.getElementById("polotno-font-style"),Yf||(Yf=document.createElement("style"),Yf.id="polotno-font-style",document.head.appendChild(Yf)),Yf)).sheet;n.forEach(i=>{r.insertRule(`
|
|
42
|
+
@font-face{
|
|
43
|
+
font-family:'${t}';
|
|
44
|
+
src:${i.src};
|
|
45
|
+
font-style:${i.fontStyle||"normal"};
|
|
46
|
+
font-weight:${i.fontWeight||"normal"};
|
|
47
|
+
font-display:swap; /* optional but recommended */
|
|
48
|
+
}`,r.cssRules.length)}),Nb[e.fontFamily]=!0}const Ir=Qn({imageDownScalingEnabled:!0,removeBackgroundEnabled:!1,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",textSplitAllowed:!1,animationsEnabled:!1,aiTextEnabled:!1,autoDeleteEmptyText:!0}),hO=typeof window<"u"&&window.location.hostname==="localhost",dO=typeof process<"u"&&!1,Z8=hO||dO,pO=Un(e=>{Ir.textVerticalResizeEnabled=e}),Q8=Un(e=>{Ir.removeBackgroundEnabled=e});Un(e=>{Z8&&console.warn("useRemoveBackground is deprecated. Use setRemoveBackgroundEnabled instead."),Q8(e)});Un(e=>{Ir.aiTextEnabled=e});Un(e=>{Z8&&console.warn("useHtmlTextRender is deprecated. Use setRichTextEnabled instead."),Ir.htmlRenderEnabled=e});const gO=Un(e=>{Ir.htmlRenderEnabled=e}),mO=Un(e=>{Ir.imageDownScalingEnabled=e});Un(e=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),mO(e)});Un(e=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),Ir.textOverflow="change-font-size"});const J8=Un(e=>{Ir.textOverflow=e}),vO=Un(e=>{Ir.textSplitAllowed=e});Un(e=>{Ir.animationsEnabled=e});Un(e=>{Ir.autoDeleteEmptyText=e});function $o(e=""){return(e.match(/<\/p>/gi)||[]).length>1&&(e=e.replace(/<\/p>/gi,(t,n,r)=>(r.slice(n+t.length).match(/<\/p>/gi)||[]).length>0?`
|
|
49
|
+
`:t)),e.replace(/(<([^>]+)>)/gi,"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/ /g," ")}function Tb(e){return e?/<[a-z][a-z0-9]*(\s[^>]*)?>[^<]*<\/[a-z][a-z0-9]*>/i.test(e)?e=(e=e.replace(/<(?![a-z/!])/gi,"<")).replace(/([^a-z0-9"'\s/])>/gi,"$1>"):e.replace(/</g,"<").replace(/>/g,">"):""}const yO={fontSize:14,fontFamily:"Roboto",fontWeight:"normal",fontStyle:"normal",lineHeight:1.2,letterSpacing:0,textTransform:"none",textDecoration:"",align:"center",fill:"black",stroke:"black",strokeWidth:0,curveEnabled:!1,curvePower:.5};function e7(e){return Object.assign(Object.assign({},yO),e)}function bO(e){var t="֑-߿יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+t+"]*?["+t+"]").test(e)}function Ap(e){return(function(t){t=t.replace(/\s/g,"");let n=0;for(var r=0;r<t.length;r++)bO(t[r])&&(n+=1);return n>t.length/2})(e)?"rtl":"ltr"}function ph(e,t,n,r){const i=Math.max(-.9999,Math.min(.9999,n));if(Math.abs(i)<1e-4)return`M 0 ${t/2} L ${e} ${t/2}`;const a=5*r/(2*Math.abs(i))-r,o=e/2;if(i>0){const s=2*a+r/2;return[`M ${o} ${s}`,`A ${a} ${a} 0 1 1 ${o} ${s-2*a}`,`A ${a} ${a} 0 1 1 ${o} ${s}`].join(" ")}{const s=-(2*a-Math.round(t))-r/2;return[`M ${o} ${s}`,`A ${a} ${a} 0 1 0 ${o} ${s+2*a}`,`A ${a} ${a} 0 1 0 ${o} ${s}`].join(" ")}}function ad(e,t,n,r){if(!la(e))return"";const{stops:i,rotation:a}=Up(e),o=a*Math.PI/180;return`<linearGradient id="${t}" x1="${100*(.5-.5*Math.sin(o))}%" y1="${100*(.5+.5*Math.cos(o))}%" x2="${100*(.5+.5*Math.sin(o))}%" y2="${100*(.5-.5*Math.cos(o))}%">${i.map(({offset:s,color:u})=>`<stop offset="${100*s}%" stop-color="${u}" />`).join("")}</linearGradient>`}function wO(e){var t,n,r,i,a,o;const s=e.a?e.a:e,u=e7(e),h=new un.TextPath({data:ph((t=s.width)!==null&&t!==void 0?t:u.width,(r=(n=s.height)!==null&&n!==void 0?n:u.height)!==null&&r!==void 0?r:0,u.curvePower,(i=s.fontSize)!==null&&i!==void 0?i:u.fontSize),align:"center",textBaseline:"middle",text:$o(u.text),fontSize:(a=s.fontSize)!==null&&a!==void 0?a:u.fontSize,fontFamily:u.fontFamily,fontWeight:u.fontWeight,fontStyle:u.fontStyle,letterSpacing:u.letterSpacing*((o=s.fontSize)!==null&&o!==void 0?o:u.fontSize),fill:u.fill}),c=h.getSelfRect().height;return h.destroy(),c}function a2(e,{fontFamily:t="",color:n="black",forEditor:r=!1}={}){const i=e7(e),a=t||i.fontFamily,o=la(i.fill),s=la(i.stroke),u=g=>`
|
|
50
|
+
background-image: ${g};
|
|
51
|
+
background-size: 100% 100%;
|
|
52
|
+
background-repeat: repeat;
|
|
53
|
+
-webkit-background-clip: text;
|
|
54
|
+
-moz-background-clip: text;
|
|
55
|
+
background-clip: text;
|
|
56
|
+
-webkit-text-fill-color: transparent;
|
|
57
|
+
color: transparent
|
|
58
|
+
`.trim();let h=`color: ${n||i.fill}`,c="";s&&i.strokeWidth?(h=`color: ${n||i.fill}; ${u(i.stroke)}`,c=`-webkit-text-stroke: ${i.strokeWidth}px transparent`):o&&(h=u(i.fill));const m=["white-space: pre-wrap","word-break: break-word",`width: ${Math.round(i.width||100)}px`,h,`font-size: ${i.fontSize}px`,`font-family: '${a}'`,`text-align: ${i.align}`,`text-transform: ${i.textTransform}`,i.textDecoration?`text-decoration: ${i.textDecoration}; text-decoration-color: ${n||i.fill}; text-decoration-layer: over`:"",i.lineHeight?`line-height: ${i.lineHeight}`:"",i.letterSpacing?`letter-spacing: ${i.letterSpacing*i.fontSize}px`:"",i.fontStyle?`font-style: ${i.fontStyle}`:"",i.fontWeight?`font-weight: ${i.fontWeight}`:"",c||(i.strokeWidth?`-webkit-text-stroke: ${i.strokeWidth}px ${i.stroke}`:""),i.strokeWidth&&!s?"paint-order: stroke fill":""].filter(Boolean).join("; ");if(i.curveEnabled){const g=wO(e),d=Math.round(i.width||100),y=ph(d,g,i.curvePower,i.fontSize),_=$o(i.text).replace(/\\n/g," "),x=`curve-${i.id||"temp"}`,b=i.strokeWidth&&(s||o&&!s);let S=`<svg xmlns="http://www.w3.org/2000/svg" width="${d}" height="${g}">
|
|
59
|
+
<defs>
|
|
60
|
+
<path id="${x}" d="${y}" fill="none" />`;if(o){const k=`curve-fill-grad-${i.id||"temp"}`;S+=ad(i.fill,k)}if(s&&i.strokeWidth){const k=`curve-stroke-grad-${i.id||"temp"}`;S+=ad(i.stroke,k)}if(S+="</defs>",b){const k=`
|
|
61
|
+
font-family="'${a}'"
|
|
62
|
+
font-size="${i.fontSize}"
|
|
63
|
+
font-weight="${i.fontWeight}"
|
|
64
|
+
font-style="${i.fontStyle}"
|
|
65
|
+
text-anchor="middle"
|
|
66
|
+
dominant-baseline="central"
|
|
67
|
+
letter-spacing="${i.letterSpacing*i.fontSize}px"${i.textDecoration?` text-decoration="${i.textDecoration}"`:""}`,E=s?`url(#curve-stroke-grad-${i.id||"temp"})`:i.stroke;S+=`
|
|
68
|
+
<text ${k} fill="${E}" stroke="${E}" stroke-width="${i.strokeWidth}">
|
|
69
|
+
<textPath href="#${x}" startOffset="50%">${_}</textPath>
|
|
70
|
+
</text>`,S+=`
|
|
71
|
+
<text ${k} fill="${o?`url(#curve-fill-grad-${i.id||"temp"})`:n}">
|
|
72
|
+
<textPath href="#${x}" startOffset="50%">${_}</textPath>
|
|
73
|
+
</text>`}else{const k=o?`url(#curve-fill-grad-${i.id||"temp"})`:n,E=s?`url(#curve-stroke-grad-${i.id||"temp"})`:i.stroke;S+=`
|
|
74
|
+
<text
|
|
75
|
+
font-family="'${a}'"
|
|
76
|
+
font-size="${i.fontSize}"
|
|
77
|
+
font-weight="${i.fontWeight}"
|
|
78
|
+
font-style="${i.fontStyle}"
|
|
79
|
+
fill="${k}"
|
|
80
|
+
text-anchor="middle"
|
|
81
|
+
dominant-baseline="central"
|
|
82
|
+
letter-spacing="${i.letterSpacing*i.fontSize}px"${i.textDecoration?` text-decoration="${i.textDecoration}"`:""}${i.strokeWidth?` stroke="${E}" stroke-width="${i.strokeWidth}" paint-order="stroke fill"`:""}>
|
|
83
|
+
<textPath href="#${x}" startOffset="50%">${_}</textPath>
|
|
84
|
+
</text>`}return S+="</svg>",S}if(i.strokeWidth&&(s||o&&!s)&&!r){const g=Tb(i.text).replace(/\n/g,"<br/>"),d=Math.round(i.width||100),y=["white-space: pre-wrap","word-break: break-word",`width: ${d}px`,`font-size: ${i.fontSize}px`,`font-family: '${a}'`,`text-align: ${i.align}`,`text-transform: ${i.textTransform}`,i.textDecoration?`text-decoration: ${i.textDecoration}; text-decoration-color: ${n||i.fill}; text-decoration-layer: over`:"",i.lineHeight?`line-height: ${i.lineHeight}`:"",i.letterSpacing?`letter-spacing: ${i.letterSpacing*i.fontSize}px`:"",i.fontStyle?`font-style: ${i.fontStyle}`:"",i.fontWeight?`font-weight: ${i.fontWeight}`:""].filter(Boolean).join("; ");let _;return _=s?`${y}; ${u(i.stroke)}; -webkit-text-stroke: ${i.strokeWidth}px transparent`:`${y}; color: transparent; -webkit-text-stroke: ${i.strokeWidth}px ${i.stroke}`,`
|
|
85
|
+
<div style="position: relative; width: ${d}px;">
|
|
86
|
+
<div style="${_}; position: absolute; top: 0; left: 0; pointer-events: none;" aria-hidden="true">${g}</div>
|
|
87
|
+
<div style="${y}; ${o?u(i.fill):`color: ${n||i.fill}`}; position: relative;" contentEditable dir="${Ap($o(i.text))}">${g}</div>
|
|
88
|
+
</div>
|
|
89
|
+
`}return`<div style="${m}" contentEditable dir="${Ap($o(i.text))}">${Tb(i.text).replace(/\n/g,"</br>")}</div>`}function xO({fontFamily:e,fontSize:t,lineHeight:n}){if(typeof n=="number")return n;const r=document.createElement("div");r.style.fontFamily=e,r.style.fontSize=t+"px",r.style.lineHeight=n,r.innerText="Test text",document.body.appendChild(r);const i=r.offsetHeight;return document.body.removeChild(r),i/t}const _O={warm:e=>t=>{const n=t.data;e=Math.max(0,Math.min(1,e));for(let r=0;r<n.length;r+=4)n[r]=Math.min(n[r]+30*e,255),n[r+1]=Math.min(n[r+1]+15*e,255);return t},cold:e=>t=>{const n=t.data;e=Math.max(0,Math.min(1,e));for(let r=0;r<n.length;r+=4)n[r]=Math.min(n[r]-15*e,255),n[r+1]=Math.min(n[r+1]-10*e,255),n[r+2]=Math.min(n[r+2]+15*e,255);return t},natural:e=>t=>{const n=t.data;e=Math.max(0,Math.min(1,e));for(let r=0;r<n.length;r+=4){n[r]=Math.min(n[r]*(1+.1*e),255),n[r+1]=Math.min(n[r+1]*(1+.1*e),255),n[r+2]=Math.min(n[r+2]*(1+.1*e),255);const i=(n[r]+n[r+1]+n[r+2])/3;n[r]=Math.min((n[r]-i)*(1+.2*e)+i,255),n[r+1]=Math.min((n[r+1]-i)*(1+.2*e)+i,255),n[r+2]=Math.min((n[r+2]-i)*(1+.2*e)+i,255)}return t},temperature:e=>t=>{const n=t.data;e=Math.max(-1,Math.min(1,e));for(let r=0;r<n.length;r+=4){const i=n[r],a=(n[r+1],n[r+2]);n[r]=Math.min(Math.max(i+15*e,0),255),n[r+2]=Math.min(Math.max(a-15*e,0),255)}return t},contrast:e=>t=>{const n=t.data,r=100*(e=Math.max(-1,Math.min(1,e))),i=259*(r+255)/(255*(259-r));for(let a=0;a<n.length;a+=4)n[a]=Math.min(Math.max(i*(n[a]-128)+128,0),255),n[a+1]=Math.min(Math.max(i*(n[a+1]-128)+128,0),255),n[a+2]=Math.min(Math.max(i*(n[a+2]-128)+128,0),255);return t},shadows:e=>t=>{const n=t.data;e=Math.max(-1,Math.min(1,e));for(let r=0;r<n.length;r+=4){const i=(n[r]+n[r+1]+n[r+2])/3;if(i<128){const a=1+e*(1-i/128)*2;n[r]=Math.min(Math.max(n[r]*a,0),255),n[r+1]=Math.min(Math.max(n[r+1]*a,0),255),n[r+2]=Math.min(Math.max(n[r+2]*a,0),255)}}return t},white:e=>t=>{const n=t.data;e=Math.max(-1,Math.min(1,e));for(let r=0;r<n.length;r+=4){const i=n[r],a=n[r+1],o=n[r+2],s=(i+a+o)/3;if(s>128){const u=1+e*((s-128)/127);n[r]=Math.min(Math.max(i*u,0),255),n[r+1]=Math.min(Math.max(a*u,0),255),n[r+2]=Math.min(Math.max(o*u,0),255)}}return t},black:e=>t=>{const n=t.data;e=Math.max(-1,Math.min(1,e));for(let r=0;r<n.length;r+=4){const i=n[r],a=n[r+1],o=n[r+2],s=(i+a+o)/3;if(s<128){const u=1+e*((128-s)/128);n[r]=Math.min(Math.max(i*u,0),255),n[r+1]=Math.min(Math.max(a*u,0),255),n[r+2]=Math.min(Math.max(o*u,0),255)}}return t},vibrance:e=>t=>{const n=t.data;e=Math.max(-1,Math.min(1,e));for(let r=0;r<n.length;r+=4){const i=n[r],a=n[r+1],o=n[r+2],s=Math.max(i,a,o),u=e<0?(1-(s===0?0:(s-(i+a+o)/3)/s))*e*1.5:.5*e;n[r]=Math.min(Math.max(i-(s-i)*u,0),255),n[r+1]=Math.min(Math.max(a-(s-a)*u,0),255),n[r+2]=Math.min(Math.max(o-(s-o)*u,0),255)}return t},saturation:e=>t=>{const n=t.data;e=Math.max(-1,Math.min(1,e));for(let r=0;r<n.length;r+=4){const i=n[r],a=n[r+1],o=n[r+2],s=.2126*i+.7152*a+.0722*o;n[r]=Math.min(Math.max(s+(i-s)*(1+e),0),255),n[r+1]=Math.min(Math.max(s+(a-s)*(1+e),0),255),n[r+2]=Math.min(Math.max(s+(o-s)*(1+e),0),255)}return t}};function Rs(e,t){var n;const r={filters:[]},i={};t.brightnessEnabled&&(r.filters.push(un.Filters.Brighten),r.brightness=t.brightness),t.blurEnabled&&(r.filters.push(un.Filters.Blur),r.blurRadius=t.blurRadius,t.type==="text"&&t.lineHeight<1&&(i.offset=t.fontSize)),t.sepiaEnabled&&r.filters.push(un.Filters.Sepia),t.grayscaleEnabled&&r.filters.push(un.Filters.Grayscale),t.filters.forEach((a,o)=>{const s=_O[o];s&&r.filters.push(s(a.intensity))}),e.setAttrs(r),r.filters.length?e.cache(Object.assign(Object.assign({},i),{pixelRatio:t.store._elementsPixelRatio})):e.clearCache(),(n=e.getLayer())===null||n===void 0||n.batchDraw()}const Tf=()=>"ontouchstart"in window||navigator.maxTouchPoints>0;var Rb={},t7="warn";function SO(e){t7=e}function EO(){return t7}var ja;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(ja||(ja={}));var Sv=function(e,t){return Sv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Sv(e,t)};function li(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Sv(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Wu=function(){return Wu=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Wu.apply(this,arguments)};function kO(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function pp(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Sf(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function gh(e,t,n){if(arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function n7(e){return $n(e).type}function r7(e,t){return $n(e).onSnapshot(t)}function Mb(e,t){$n(e).applyPatches(h7(t))}function Ev(e,t){return $n(e).applySnapshot(t)}function bc(e,t){t===void 0&&(t=!0);var n=$n(e);return t?n.snapshot:n.type.getSnapshot(n,!1)}function F1(e,t){for(var n=$n(e).parent;n;){if(t.is(n.storedValue))return!0;n=n.parent}return!1}function Qf(e,t){for(var n=$n(e).parent;n;){if(t.is(n.storedValue))return n.storedValue;n=n.parent}throw new rn("Failed to find the parent of ".concat($n(e)," of a given type"))}function AO(e){return $n(e).root.storedValue}function PO(e){return $n(e).path}function OO(e,t){var n=XO($n(e),t);return n?n.value:void 0}function CO(e){return $n(e).identifier}function ih(e){return $n(e).detach(),e}function o2(e){var t=$n(e);t.isRoot?t.die():t.parent.removeChild(t.subpath)}function Ib(e){return $n(e).observableIsAlive}var i7=(function(){function e(t,n,r,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:Ao.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=i,this.baseSetParent(n,r)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(t){var n=this.isAlive;this._state=t;var r=this.isAlive;this.aliveAtom&&n!==r&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._hookSubscribers&&this._hookSubscribers.emit(t,this,t)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this._hookSubscribers||(this._hookSubscribers=new g7),this._hookSubscribers.register(t,n)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){this._parent=t,this._subpath=n,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.pathAtom||(this.pathAtom=g0("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?oh(this._subpath):""),this.parent.getEscapedPath(t)+"/"+this._escapedSubpath):""}}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAlive",{get:function(){return this.state!==Ao.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===Ao.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=g0("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.state===Ao.CREATED){if(this.parent){if(this.parent.state!==Ao.FINALIZED)return;this.fireHook(ja.afterAttach)}this.state=Ao.FINALIZED,t&&t()}}}),Object.defineProperty(e.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=Ao.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(ja.beforeDestroy)}}),e})(),Pp=(function(e){li(t,e);function t(n,r,i,a,o){var s=e.call(this,n,r,i,a)||this;try{s.storedValue=n.createNewInstance(o)}catch(u){throw s.state=Ao.DEAD,u}return s.state=Ao.CREATED,s.finalizeCreation(),s}return Object.defineProperty(t.prototype,"root",{get:function(){if(!this.parent)throw new rn("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this.parent!==n,a=this.subpath!==r;!i&&!a||(this.environment=void 0,this.baseSetParent(this.parent,r))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(n).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Ao.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.fireInternalHook(n)}}),t})(i7);Pp.prototype.die=Un(Pp.prototype.die);var LO=1,eu;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(eu||(eu={}));var rl;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(rl||(rl={}));var NO={onError:function(e){throw e}},Ms=(function(e){li(t,e);function t(n,r,i,a,o){var s=e.call(this,n,r,i,a)||this;if(Object.defineProperty(s,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++LO}),Object.defineProperty(s,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(s,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(s,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:eu.UNINITIALIZED}),Object.defineProperty(s,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),s._snapshotComputed=bh(function(){return s.getSnapshot()}),s.unbox=s.unbox.bind(s),s._initialSnapshot=o,s.identifierAttribute=n.identifierAttribute,r||(s.identifierCache=new WO),s._childNodes=n.initializeChildNodes(s,s._initialSnapshot),s.identifier=null,s.unnormalizedIdentifier=null,s.identifierAttribute&&s._initialSnapshot){var u=s._initialSnapshot[s.identifierAttribute];if(u===void 0){var h=s._childNodes[s.identifierAttribute];h&&(u=h.value)}if(typeof u!="string"&&typeof u!="number")throw new rn("Instance identifier '".concat(s.identifierAttribute,"' for type '").concat(s.type.name,"' must be a string or a number"));s.identifier=Hp(u),s.unnormalizedIdentifier=u}return r?r.root.identifierCache.addNodeToCache(s):s.identifierCache.addNodeToCache(s),s}return Object.defineProperty(t.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.createObservableInstanceIfNeeded(),this._applyPatches(n)}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.createObservableInstanceIfNeeded(),this._applySnapshot(n)}}),Object.defineProperty(t.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(n){n===void 0&&(n=!0),this._observableInstanceState===eu.UNINITIALIZED&&this.createObservableInstance(n)}}),Object.defineProperty(t.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r,i,a,o;n===void 0&&(n=!0),this._observableInstanceState=eu.CREATING;for(var s=[],u=this.parent;u&&u._observableInstanceState===eu.UNINITIALIZED;)s.unshift(u),u=u.parent;try{for(var h=pp(s),c=h.next();!c.done;c=h.next()){var m=c.value;m.createObservableInstanceIfNeeded(!1)}}catch(_){r={error:_}}finally{try{c&&!c.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}var g=this.type;try{this.storedValue=g.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,g.finalizeNewInstance(this,this.storedValue)}catch(_){throw this.state=Ao.DEAD,_}finally{this._isRunningAction=!1}if(this._observableInstanceState=eu.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=xd,this.state=Ao.CREATED,n){this.fireHook(ja.afterCreate),this.finalizeCreation();try{for(var d=pp(s.reverse()),y=d.next();!y.done;y=d.next()){var m=y.value;m.fireHook(ja.afterCreate),m.finalizeCreation()}}catch(_){a={error:_}}finally{try{y&&!y.done&&(o=d.return)&&o.call(d)}finally{if(a)throw a.error}}}}}),Object.defineProperty(t.prototype,"root",{get:function(){var n=this.parent;return n?n.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(ja.beforeDetach);var n=this.state;this.state=Ao.DETACHING;var r=this.root,i=r.environment,a=r.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=a}finally{this.state=n}}}}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=n!==this.parent,a=r!==this.subpath;!i&&!a||(i?(this.environment=void 0,n.root.identifierCache.mergeCache(this),this.baseSetParent(n,r),this.fireHook(ja.afterAttach)):a&&this.baseSetParent(this.parent,r))}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this;this.fireInternalHook(n);var i=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[n];typeof i=="function"&&(mc?mc(function(){i.apply(r.storedValue)}):i.apply(this.storedValue))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===eu.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(t.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var n=this.type,r=this._childNodes,i=this._initialSnapshot;this._cachedInitialSnapshot=n.processInitialSnapshot(r,i),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(t.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(t.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=EO();if(!this.isAlive&&r!=="ignore"){var i=this._getAssertAliveError(n);switch(r){case"error":throw new rn(i);case"warn":aC(i)}}}}),Object.defineProperty(t.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.getEscapedPath(!1)||this.pathUponDeath||"",i=n.subpath&&oh(n.subpath)||"",a=n.actionContext||MO();a&&a.type!=="action"&&a.parentActionEvent&&(a=a.parentActionEvent);var o="";if(a&&a.name!=null){var s=a&&a.context&&PO(a.context)||r;o="".concat(s,".").concat(a.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(r,"', Subpath: '").concat(i,"', Action: '").concat(o,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.assertAlive({subpath:n}),this._autoUnbox=!1;try{return this._observableInstanceState===eu.CREATED?this.type.getChildNode(this,n):this._childNodes[n]}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(xd),this._autoUnbox=!1;try{return this._observableInstanceState===eu.CREATED?this.type.getChildren(this):c7(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.type.getChildType(n)}}),Object.defineProperty(t.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(this.assertAlive(n),!this.isRunningAction()&&this.isProtected)throw new rn("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.type.removeChild(this,n)}}),Object.defineProperty(t.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n&&(this.assertAlive({subpath:n.subpath||n.subpathUponDeath}),this._autoUnbox?n.value:n)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=(this.isAlive?this.path:this.pathUponDeath)||"<root>",r=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(n).concat(r).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this;this.baseFinalizeCreation(function(){var r,i;try{for(var a=pp(n.getChildren()),o=a.next();!o.done;o=a.next()){var s=o.value;s.finalizeCreation()}}catch(u){r={error:u}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}n.fireInternalHook(ja.afterCreationFinalization)})}}),Object.defineProperty(t.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new rn("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(t.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this;this._applyPatches=Op(this.storedValue,"@APPLY_PATCHES",function(r){r.forEach(function(i){if(!i.path){n.type.applySnapshot(n,i.value);return}var a=m7(i.path),o=u7(n,a.slice(0,-1));o.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=Op(this.storedValue,"@APPLY_SNAPSHOT",function(r){if(r!==n.snapshot)return n.type.applySnapshot(n,r)}),ah(this.storedValue,"$treenode",this),ah(this.storedValue,"toJSON",YO)}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Ao.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==eu.UNINITIALIZED&&(this.getChildren().forEach(function(n){n.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(rl.Dispose),this._internalEventsClear(rl.Dispose))}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(r){r.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var n=this.snapshot;this._snapshotUponDeath=n,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._addSnapshotReaction(),this._internalEventsRegister(rl.Snapshot,n)}}),Object.defineProperty(t.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this._internalEventsEmit(rl.Snapshot,n)}}),Object.defineProperty(t.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._internalEventsRegister(rl.Patch,n)}}),Object.defineProperty(t.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(this._internalEventsHasSubscribers(rl.Patch)){var i=r.path.substr(this.path.length)+(n.path?"/"+n.path:""),a=tC({},n,{path:i}),o=Sf(sC(a),2),s=o[0],u=o[1];this._internalEventsEmit(rl.Patch,s,u)}this.parent&&this.parent.emitPatch(n,r)}}),Object.defineProperty(t.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._internalEventsHas(rl.Dispose,n)}}),Object.defineProperty(t.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(!this.hasDisposer(n)){this._internalEventsRegister(rl.Dispose,n,!0);return}throw new rn("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(t.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(!this._internalEventsHas(rl.Dispose,n))throw new rn("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(rl.Dispose,n)}}),Object.defineProperty(t.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(this.middlewares){var r=this.middlewares.indexOf(n);r>=0&&this.middlewares.splice(r,1)}}}),Object.defineProperty(t.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this;r===void 0&&(r=!0);var a={handler:n,includeHooks:r};return this.middlewares?this.middlewares.push(a):this.middlewares=[a],function(){i.removeMiddleware(a)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){this.assertWritable({subpath:n}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,n,r)}}),Object.defineProperty(t.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this;if(!this._hasSnapshotReaction){var r=D6(function(){return n.snapshot},function(i){return n.emitSnapshot(i)},NO);this.addDisposer(r),this._hasSnapshotReaction=!0}}}),Object.defineProperty(t.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return!!this._internalEvents&&this._internalEvents.hasSubscribers(n)}}),Object.defineProperty(t.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i){return i===void 0&&(i=!1),this._internalEvents||(this._internalEvents=new g7),this._internalEvents.register(n,r,i)}}),Object.defineProperty(t.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return!!this._internalEvents&&this._internalEvents.has(n,r)}}),Object.defineProperty(t.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){this._internalEvents&&this._internalEvents.unregister(n,r)}}),Object.defineProperty(t.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(n){for(var r,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];this._internalEvents&&(r=this._internalEvents).emit.apply(r,gh([n],Sf(i),!1))}}),Object.defineProperty(t.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this._internalEvents&&this._internalEvents.clear(n)}}),Object.defineProperty(t.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),t})(i7);Ms.prototype.createObservableInstance=Un(Ms.prototype.createObservableInstance);Ms.prototype.detach=Un(Ms.prototype.detach);Ms.prototype.die=Un(Ms.prototype.die);var a7,sr;(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"})(sr||(sr={}));var o7="cannotDetermine",TO=Symbol("$type"),Sc=(function(){function e(t){Object.defineProperty(this,a7,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=t}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return _c(this,t),this.instantiate(null,"",n,t).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){throw new rn("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var r=l7(t);if(r){var i=n7(t);return this.isAssignableFrom(i)?Is():js(n,t)}return this.isValidSnapshot(t,n)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.validate(t,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw new rn("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 rn("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 rn("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 rn("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})();a7=TO;Sc.prototype.create=Un(Sc.prototype.create);var bd=(function(e){li(t,e);function t(n){var r=e.call(this,n)||this;return Object.defineProperty(r,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r}return Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return n===void 0&&(n=this.getDefaultSnapshot()),e.prototype.create.call(this,n,r)}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.createObservableInstanceIfNeeded(),n.storedValue}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return!n.identifierAttribute||n.identifier===Hp(r[n.identifierAttribute])}}),Object.defineProperty(t.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return n.isDetaching?!1:n.snapshot===r||Fi(r)&&$n(r)===n?!0:n.type===this&&d7(r)&&!Fi(r)&&this.isMatchingSnapshotId(n,r)?(n.applySnapshot(r),!0):!1}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=this.tryToReconcileNode(n,r);if(o)return n.setParent(i,a),n;if(n.die(),Fi(r)&&this.isAssignableFrom(n7(r))){var s=$n(r);return s.setParent(i,a),s}return this.instantiate(i,a,void 0,r)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t})(Sc);bd.prototype.create=Un(bd.prototype.create);var Ph=(function(e){li(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.storedValue}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.storedValue}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){if(!n.isDetaching&&n.type===this&&n.storedValue===r)return n;var o=this.instantiate(i,a,void 0,r);return n.die(),o}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t})(Sc);function Ec(e){return typeof e=="object"&&e&&e.isType===!0}var RO=1,gp;function MO(){return gp}function IO(){return RO++}function jO(e,t){var n=$n(e.context);e.type==="action"&&n.assertAlive({actionContext:e});var r=n._isRunningAction;n._isRunningAction=!0;var i=gp;gp=e;try{return BO(n,e,t)}finally{gp=i,n._isRunningAction=r}}function DO(e){if(e)return e.type==="action"?e:e.parentActionEvent}function Op(e,t,n){var r=function(){var i=IO(),a=gp,o=DO(a);return jO({type:"action",name:t,id:i,args:iC(arguments),context:e,tree:AO(e),rootId:a?a.rootId:i,parentId:a?a.id:0,allParentIds:a?gh(gh([],Sf(a.allParentIds),!1),[a.id],!1):[],parentEvent:a,parentActionEvent:o},n)};return r._isMSTAction=!0,r._isFlowAction=n._isFlowAction,r}var FO=(function(){function e(t,n){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),n.$mst_middleware&&this.middlewares.push(n.$mst_middleware);for(var r=t;r;)r.middlewares&&this.middlewares.push(r.middlewares),r=r.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.middlewares[this.arrayIndex];if(t){var n=t[this.inArrayIndex++];return n||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e})();function BO(e,t,n){var r=new FO(e,n);if(r.isEmpty)return Un(n).apply(null,t.args);var i=null;function a(o){var s=r.getNextMiddleware(),u=s&&s.handler;if(!u)return Un(n).apply(null,o.args);if(!s.includeHooks&&ja[o.name])return a(o);function h(m,g){i=a(m),g&&(i=g(i))}function c(m){i=m}return u(o,h,c),i}return a(t)}function zO(e){try{return JSON.stringify(e)}catch(t){return"<Unserializable: ".concat(t,">")}}function s7(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):Fi(e)?"<".concat(e,">"):"`".concat(zO(e),"`")}function UO(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function qO(e){var t=e.value,n=e.context[e.context.length-1].type,r=e.context.map(function(s){var u=s.path;return u}).filter(function(s){return s.length>0}).join("/"),i=r.length>0?'at path "/'.concat(r,'" '):"",a=Fi(t)?"value of type ".concat($n(t).type.name,":"):Cp(t)?"value":"snapshot",o=n&&Fi(t)&&n.is($n(t).snapshot);return"".concat(i).concat(a," ").concat(s7(t)," is not assignable ").concat(n?"to type: `".concat(n.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(n?PC(n)||Cp(t)?".":", expected an instance of `".concat(n.name,"` or a snapshot like `").concat(n.describe(),"` instead.")+(o?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function fy(e,t,n){return e.concat([{path:t,type:n}])}function Is(){return wd}function js(e,t,n){return[{context:e,value:t,message:n}]}function Q0(e){return e.reduce(function(t,n){return t.concat(n)},[])}function _c(e,t){oC()&&$O(e,t)}function $O(e,t){var n=e.validate(t,[{path:"",type:e}]);if(n.length>0)throw new rn(HO(e,t,n))}function HO(e,t,n){if(n.length!==0)return"Error while converting ".concat(UO(s7(t))," to `").concat(e.name,`\`:
|
|
90
|
+
|
|
91
|
+
`)+n.map(qO).join(`
|
|
92
|
+
`)}var GO=0,WO=(function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:GO++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:Qn.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:Qn.map()})}return Object.defineProperty(e.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.lastCacheModificationPerId.get(t);this.lastCacheModificationPerId.set(t,n===void 0?1:n+1)}}),Object.defineProperty(e.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.lastCacheModificationPerId.get(t)||0;return"".concat(this.cacheId,"-").concat(n)}}),Object.defineProperty(e.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(n===void 0&&(n=!0),t.identifierAttribute){var r=t.identifier;this.cache.has(r)||this.cache.set(r,Qn.array([],J0));var i=this.cache.get(r);if(i.indexOf(t)!==-1)throw new rn("Already registered");i.push(t),n&&this.updateLastCacheModificationPerId(r)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;H6(t.identifierCache.cache).forEach(function(r){return r.forEach(function(i){n.addNodeToCache(i)})})}}),Object.defineProperty(e.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.identifierAttribute){var n=t.identifier,r=this.cache.get(n);r&&(r.remove(t),r.length||this.cache.delete(n),this.updateLastCacheModificationPerId(t.identifier))}}}),Object.defineProperty(e.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,r=new e,i=t.path+"/";return OS(this.cache).forEach(function(a){for(var o=Sf(a,2),s=o[0],u=o[1],h=!1,c=u.length-1;c>=0;c--){var m=u[c];(m===t||m.path.indexOf(i)===0)&&(r.addNodeToCache(m,!1),u.splice(c,1),u.length||n.cache.delete(s),h=!0)}h&&n.updateLastCacheModificationPerId(s)}),r}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var r=this.cache.get(n);return r?r.some(function(i){return t.isAssignableFrom(i.type)}):!1}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var r=this.cache.get(n);if(!r)return null;var i=r.filter(function(a){return t.isAssignableFrom(a.type)});switch(i.length){case 0:return null;case 1:return i[0];default:throw new rn("Cannot resolve a reference to type '".concat(t.name,"' with id: '").concat(n,"' unambigously, there are multiple candidates: ").concat(i.map(function(a){return a.path}).join(", ")))}}}),e})();function hy(e,t,n,r,i){var a=l7(i);if(a){if(a.parent)throw new rn("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(t?t.path:"","/").concat(n,"', but it lives already at '").concat(a.path,"'"));return t&&a.setParent(t,n),a}return new Ms(e,t,n,r,i)}function Rf(e,t,n,r,i){return new Pp(e,t,n,r,i)}function VO(e){return e instanceof Pp||e instanceof Ms}var Ao;(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"})(Ao||(Ao={}));function Fi(e){return!!(e&&e.$treenode)}function $n(e){if(!Fi(e))throw new rn("Value ".concat(e," is no MST Node"));return e.$treenode}function l7(e){return e&&e.$treenode||null}function YO(){return $n(this).snapshot}function XO(e,t,n){return n===void 0&&(n=!0),u7(e,m7(t),n)}function u7(e,t,n){n===void 0&&(n=!0);var r=e;try{for(var i=0;i<t.length;i++){var a=t[i];if(a===".."){if(r=r.parent,r)continue}else{if(a===".")continue;if(r){if(r instanceof Pp){var o=r.value;Fi(o)&&(r=$n(o))}if(r instanceof Ms){var s=r.getChildType(a);if(s&&(r=r.getChildNode(a),r))continue}}}throw new rn("Could not resolve '".concat(a,"' in path '").concat(jb(t.slice(0,i))||"/","' while resolving '").concat(jb(t),"'"))}}catch(u){if(!n)return;throw u}return r}function c7(e){if(!e)return wd;var t=Object.keys(e);if(!t.length)return wd;var n=new Array(t.length);return t.forEach(function(r,i){n[i]=e[r]}),n}var KO=Object.toString(),wd=Object.freeze([]),xd=Object.freeze({}),J0=eS().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(J0);var rn=(function(e){li(t,e);function t(n){return n===void 0&&(n="Illegal state"),e.call(this,"[mobx-state-tree] ".concat(n))||this}return t})(Error);function ZO(e){return e}var QO=Number.isInteger;function JO(e){return Number(e)===e&&e%1!==0}function eC(e){return Number.isFinite(e)}function f7(e){return Array.isArray(e)||Vu(e)}function h7(e){return e?f7(e)?e:[e]:wd}function tC(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++){var i=t[r];for(var a in i)e[a]=i[a]}return e}function od(e){var t;if(e===null||typeof e!="object")return!1;var n=Object.getPrototypeOf(e);return n==null?!0:((t=n.constructor)===null||t===void 0?void 0:t.toString())===KO}function d7(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function Cp(e,t){return t===void 0&&(t=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||t&&e instanceof Date}function p7(e){return typeof e!="function"}function nC(e,t,n){ou(e)?W6(e,t,n):Object.defineProperty(e,t,n)}function ah(e,t,n){nC(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}var rC=(function(){function e(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var r=this;return n===void 0&&(n=!1),n?this.handlers.unshift(t):this.handlers.push(t),function(){r.unregister(t)}}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.handlers.indexOf(t)>=0}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.handlers.indexOf(t);n>=0&&this.handlers.splice(n,1)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=this.handlers.slice();r.forEach(function(i){return i.apply(void 0,gh([],Sf(t),!1))})}}),e})(),g7=(function(){function e(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.eventHandlers&&this.eventHandlers[t];return!!n&&n.hasSubscribers}}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,r){r===void 0&&(r=!1),this.eventHandlers||(this.eventHandlers={});var i=this.eventHandlers[t];return i||(i=this.eventHandlers[t]=new rC),i.register(n,r)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var r=this.eventHandlers&&this.eventHandlers[t];return!!r&&r.has(n)}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var r=this.eventHandlers&&this.eventHandlers[t];r&&r.unregister(n)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.eventHandlers&&delete this.eventHandlers[t]}}),Object.defineProperty(e.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){for(var n,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var a=this.eventHandlers&&this.eventHandlers[t];a&&(n=a).emit.apply(n,gh([],Sf(r),!1))}}),e})();function iC(e){for(var t=new Array(e.length),n=0;n<e.length;n++)t[n]=e[n];return t}function s2(e,t){return e.indexOf(t)===0}function aC(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function oC(){return typeof process<"u"&&Rb&&Rb.ENABLE_TYPE_CHECK==="true"}function sC(e){if(!("oldValue"in e))throw new rn("Patches without `oldValue` field cannot be inversed");return[lC(e),uC(e)]}function lC(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 uC(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 cC(e){return typeof e=="number"}function oh(e){return cC(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function fC(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function jb(e){if(e.length===0)return"";var t=function(n){return n.map(oh).join("/")};return e[0]==="."||e[0]===".."?t(e):"/"+t(e)}function m7(e){var t=e.split("/").map(fC),n=e===""||e==="."||e===".."||s2(e,"/")||s2(e,"./")||s2(e,"../");if(!n)throw new rn("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return t[0]===""&&t.shift(),t}var l2=Symbol("$preProcessorFailed"),hC=(function(e){li(t,e);function t(n,r,i){var a=e.call(this,i||n.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:r}),a}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|sr.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(t.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._processors.preProcessor?this._processors.preProcessor.call(null,n):n}}),Object.defineProperty(t.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(n){try{return this.preProcessSnapshot(n)}catch{return l2}}}),Object.defineProperty(t.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return this._processors.postProcessor?this._processors.postProcessor.call(null,n,r.storedValue):n}}),Object.defineProperty(t.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this;dC(n.type,this,"create"),n instanceof Ms&&(n.hasSnapshotPostProcessor=!!this._processors.postProcessor);var i=n.getSnapshot;n.getSnapshot=function(){return r.postProcessSnapshot(i.call(n),n)},RC(this._subtype)||(n.getReconciliationType=function(){return r})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=Fi(a)?a:this.preProcessSnapshot(a),s=this._subtype.instantiate(n,r,i,o);return this._fixNode(s),s}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=this._subtype.reconcile(n,Fi(r)?r:this.preProcessSnapshot(r),i,a);return o!==n&&this._fixNode(o),o}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){r===void 0&&(r=!0);var i=this._subtype.getSnapshot(n);return r?this.postProcessSnapshot(i,n):i}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this.preProcessSnapshotSafe(n);return i===l2?js(r,n,"Failed to preprocess value"):this._subtype.validate(i,r)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(t.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=Ec(n)?this._subtype:Fi(n)?n:this.preProcessSnapshotSafe(n);return r===l2?!1:this._subtype.validate(r,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._subtype.isAssignableFrom(n)}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(!(this._subtype instanceof bd))return!1;var i=this.preProcessSnapshot(r);return this._subtype.isMatchingSnapshotId(n,i)}}),t})(Sc);function dC(e,t){for(var n,r,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var o=pp(i),s=o.next();!s.done;s=o.next()){var u=s.value;e[u]=t[u].bind(t)}}catch(h){n={error:h}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}function pC(e,t,n){return new hC(e,t,n)}var Db="Map.put can only be used to store complex values that have an identifier type attribute";function v7(e,t){var n,r,i=e.getSubTypes();if(i===o7)return!1;if(i){var a=h7(i);try{for(var o=pp(a),s=o.next();!s.done;s=o.next()){var u=s.value;if(!v7(u,t))return!1}}catch(h){n={error:h}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}return e instanceof Lp&&t.push(e),!0}var df;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(df||(df={}));var gC=(function(e){li(t,e);function t(n,r){return e.call(this,n,Qn.ref.enhancer,r)||this}return Object.defineProperty(t.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return e.prototype.get.call(this,""+n)}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return e.prototype.has.call(this,""+n)}}),Object.defineProperty(t.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return e.prototype.delete.call(this,""+n)}}),Object.defineProperty(t.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return e.prototype.set.call(this,""+n,r)}}),Object.defineProperty(t.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(!n)throw new rn("Map.put cannot be used to set empty values");if(Fi(n)){var r=$n(n);if(r.identifier===null)throw new rn(Db);return this.set(r.identifier,n),n}else if(d7(n)){var i=$n(this),a=i.type;if(a.identifierMode!==df.YES)throw new rn(Db);var o=a.mapIdentifierAttribute,s=n[o];if(!dy(s)){var u=this.put(a.getChildType().create(n,i.environment));return this.put(bc(u))}var h=Hp(s);return this.set(h,n),this.get(h)}else throw new rn("Map.put can only be used to store complex values")}}),t})(Kv),C0=(function(e){li(t,e);function t(n,r,i){i===void 0&&(i=[]);var a=e.call(this,n)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:df.UNKNOWN}),Object.defineProperty(a,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:sr.Map}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a._determineIdentifierMode(),a.hookInitializers=i,a}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.hookInitializers.length>0?this.hookInitializers.concat(n):[n];return new t(this.name,this._subType,r)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return this._determineIdentifierMode(),hy(this,n,r,i,a)}}),Object.defineProperty(t.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===df.UNKNOWN){var n=[];if(v7(this._subType,n)){var r=n.reduce(function(i,a){if(!a.identifierAttribute)return i;if(i&&i!==a.identifierAttribute)throw new rn("The objects in a map should all have the same identifier attribute, expected '".concat(i,"', but child of type '").concat(a.name,"' declared attribute '").concat(a.identifierAttribute,"' as identifier"));return a.identifierAttribute},void 0);r?(this.identifierMode=df.YES,this.mapIdentifierAttribute=r):this.identifierMode=df.NO}}}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){r===void 0&&(r={});var i=n.type._subType,a={};return Object.keys(r).forEach(function(o){a[o]=i.instantiate(n,o,void 0,r[o])}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return new gC(n,this.name)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){q6(r,n.unbox);var i=n.type;i.hookInitializers.forEach(function(a){var o=a(r);Object.keys(o).forEach(function(s){var u=o[s],h=Op(r,s,u);ah(r,s,h)})}),Vv(r,this.willChange),Yv(r,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return H6(n.storedValue)}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=n.storedValue.get(""+r);if(!i)throw new rn("Not a child "+r);return i}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=$n(n.object),i=n.name;r.assertWritable({subpath:i});var a=r.type,o=a._subType;switch(n.type){case"update":{var s=n.newValue,u=n.object.get(i);if(s===u)return null;_c(o,s),n.newValue=o.reconcile(r.getChildNode(i),n.newValue,r,i),a.processIdentifier(i,n.newValue)}break;case"add":_c(o,n.newValue),n.newValue=o.instantiate(r,i,void 0,n.newValue),a.processIdentifier(i,n.newValue);break}return n}}),Object.defineProperty(t.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(this.identifierMode===df.YES&&r instanceof Ms){var i=r.identifier;if(i!==n)throw new rn("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(i,"', but expected: '").concat(n,"'"))}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r={};return n.getChildren().forEach(function(i){r[i.subpath]=i.snapshot}),r}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r={};return Object.keys(n).forEach(function(i){r[i]=n[i].getSnapshot()}),r}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=$n(n.object);switch(n.type){case"update":return void r.emitPatch({op:"replace",path:oh(n.name),value:n.newValue.snapshot,oldValue:n.oldValue?n.oldValue.snapshot:void 0},r);case"add":return void r.emitPatch({op:"add",path:oh(n.name),value:n.newValue.snapshot,oldValue:void 0},r);case"delete":var i=n.oldValue.snapshot;return n.oldValue.die(),void r.emitPatch({op:"remove",path:oh(n.name),oldValue:i},r)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i){var a=n.storedValue;switch(i.op){case"add":case"replace":a.set(r,i.value);break;case"remove":a.delete(r);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){_c(this,r);var i=n.storedValue,a={};if(Array.from(i.keys()).forEach(function(s){a[s]=!1}),r)for(var o in r)i.set(o,r[o]),a[""+o]=!0;Object.keys(a).forEach(function(s){a[s]===!1&&i.delete(s)})}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this;return od(n)?Q0(Object.keys(n).map(function(a){return i._subType.validate(n[a],fy(r,a,i._subType))})):js(r,n,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return xd}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){n.storedValue.delete(r)}}),t})(bd);C0.prototype.applySnapshot=Un(C0.prototype.applySnapshot);function mC(e){return new C0("Map<string, ".concat(e.name,">"),e)}var L0=(function(e){li(t,e);function t(n,r,i){i===void 0&&(i=[]);var a=e.call(this,n)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:sr.Array}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a.hookInitializers=i,a}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.hookInitializers.length>0?this.hookInitializers.concat(n):[n];return new t(this.name,this._subType,r)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return hy(this,n,r,i,a)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){r===void 0&&(r=[]);var i=n.type._subType,a={};return r.forEach(function(o,s){var u=""+s;a[u]=i.instantiate(n,u,void 0,o)}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=Wu(Wu({},J0),{name:this.name});return Qn.array(c7(n),r)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){Hu(r).dehancer=n.unbox;var i=n.type;i.hookInitializers.forEach(function(a){var o=a(r);Object.keys(o).forEach(function(s){var u=o[s],h=Op(r,s,u);ah(r,s,h)})}),Vv(r,this.willChange),Yv(r,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.storedValue.slice()}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=Number(r);if(i<n.storedValue.length)return n.storedValue[i];throw new rn("Not a child: "+r)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=$n(n.object);r.assertWritable({subpath:""+n.index});var i=r.type._subType,a=r.getChildren();switch(n.type){case"update":{if(n.newValue===n.object[n.index])return null;var o=Fb(r,i,[a[n.index]],[n.newValue],[n.index]);if(!o)return null;n.newValue=o[0]}break;case"splice":{var s=n.index,u=n.removedCount,h=n.added,c=Fb(r,i,a.slice(s,s+u),h,h.map(function(g,d){return s+d}));if(!c)return null;n.added=c;for(var m=s+u;m<a.length;m++)a[m].setParent(r,""+(m+h.length-u))}break}return n}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.getChildren().map(function(r){return r.snapshot})}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=[];return Object.keys(n).forEach(function(i){r.push(n[i].getSnapshot())}),r}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=$n(n.object);switch(n.type){case"update":return void r.emitPatch({op:"replace",path:""+n.index,value:n.newValue.snapshot,oldValue:n.oldValue?n.oldValue.snapshot:void 0},r);case"splice":if(n.removedCount&&n.addedCount===n.object.length)return void r.emitPatch({op:"replace",path:"",value:r.snapshot,oldValue:n.removed.map(function(a){return a.snapshot})},r);for(var i=n.removedCount-1;i>=0;i--)r.emitPatch({op:"remove",path:""+(n.index+i),oldValue:n.removed[i].snapshot},r);for(var i=0;i<n.addedCount;i++)r.emitPatch({op:"add",path:""+(n.index+i),value:n.added[i].snapshot,oldValue:void 0},r);return}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i){var a=n.storedValue,o=r==="-"?a.length:Number(r);switch(i.op){case"replace":a[o]=i.value;break;case"add":a.splice(o,0,i.value);break;case"remove":a.splice(o,1);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){_c(this,r);var i=n.storedValue;i.replace(r)}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this;return f7(n)?Q0(n.map(function(a,o){return i._subType.validate(a,fy(r,""+o,i._subType))})):js(r,n,"Value is not an array")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return wd}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){n.storedValue.splice(Number(r),1)}}),t})(bd);L0.prototype.applySnapshot=Un(L0.prototype.applySnapshot);function vC(e){return new L0("".concat(e.name,"[]"),e)}function Fb(e,t,n,r,i){for(var a=!0,o=0;;o++){var s=o<=r.length-1,u=n[o],h=s?r[o]:void 0,c=""+i[o];if(VO(h)&&(h=h.storedValue),!u&&!s)break;if(!s)a=!1,n.splice(o,1),u instanceof Ms&&u.createObservableInstanceIfNeeded(),u.die(),o--;else if(u)if(Bb(u,h))n[o]=u2(t,e,c,h,u);else{for(var g=void 0,d=o;d<n.length;d++)if(Bb(n[d],h)){g=n.splice(d,1)[0];break}a=!1;var m=u2(t,e,c,h,g);n.splice(o,0,m)}else{if(Fi(h)&&$n(h).parent===e)throw new rn("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(c,"', but it lives already at '").concat($n(h).path,"'"));a=!1;var m=u2(t,e,c,h);n.splice(o,0,m)}}return a?null:n}function u2(e,t,n,r,i){_c(e,r);function a(){if(Fi(r)){var s=$n(r);if(s.assertAlive(xd),s.parent!==null&&s.parent===t)return s.setParent(t,n),s}return i?e.reconcile(i,r,t,n):e.instantiate(t,n,void 0,r)}var o=a();return i&&i!==o&&(i instanceof Ms&&i.createObservableInstanceIfNeeded(),i.die()),o}function Bb(e,t){if(!e.isAlive)return!1;if(Fi(t)){var n=$n(t);return n.isAlive&&n===e}if(e.snapshot===t)return!0;if(!(e instanceof Ms))return!1;var r=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&od(t)&&r.is(t)&&r.isMatchingSnapshotId(e,t)}var zb="preProcessSnapshot",Ub="postProcessSnapshot";function yC(){return $n(this).toString()}var qb={name:"AnonymousModel",properties:{},initializers:wd};function bC(e){var t=Object.keys(e),n=new Set;return t.forEach(function(r){if(n.has(r))throw new rn("".concat(r," is declared twice in the model. Model should not contain the same keys"));n.add(r)}),t.reduce(function(r,i){if(i in ja)throw new rn("Hook '".concat(i,"' was defined as property. Hooks should be defined as part of the actions"));var a=Object.getOwnPropertyDescriptor(e,i);if("get"in a)throw new rn("Getters are not supported as properties. Please use views instead");var o=a.value;if(o==null)throw new rn("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(Cp(o))r[i]=sh(AC(o),o);else if(o instanceof C0)r[i]=sh(o,{});else if(o instanceof L0)r[i]=sh(o,[]);else if(!Ec(o))throw new rn("Invalid type definition for property '".concat(i,"', cannot infer a type from a value like '").concat(o,"' (").concat(typeof o,")"));return r},Wu({},e))}var Lp=(function(e){li(t,e);function t(n){var r=e.call(this,n.name||qb.name)||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:sr.Object}),Object.defineProperty(r,"initializers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"preProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"postProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"propertyNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"named",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return r.cloneAndEnhance({name:i})}}),Object.defineProperty(r,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return r.cloneAndEnhance({properties:i})}}),Object.defineProperty(r,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var a=r.preProcessor;return a?r.cloneAndEnhance({preProcessor:function(o){return a(i(o))}}):r.cloneAndEnhance({preProcessor:i})}}),Object.defineProperty(r,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var a=r.postProcessor;return a?r.cloneAndEnhance({postProcessor:function(o){return i(a(o))}}):r.cloneAndEnhance({postProcessor:i})}}),Object.assign(r,qb,n),r.properties=bC(r.properties),r.properties,r.propertyNames=Object.keys(r.properties),r.identifierAttribute=r._getIdentifierAttribute(),r}return Object.defineProperty(t.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=void 0;return this.forAllProps(function(r,i){if(i.flags&sr.Identifier){if(n)throw new rn("Cannot define property '".concat(r,"' as object identifier, property '").concat(n,"' is already defined as identifier property"));n=r}}),n}}),Object.defineProperty(t.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return new t({name:n.name||this.name,properties:Object.assign({},this.properties,n.properties),initializers:this.initializers.concat(n.initializers||[]),preProcessor:n.preProcessor||this.preProcessor,postProcessor:n.postProcessor||this.postProcessor})}}),Object.defineProperty(t.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this,i=function(a){return r.instantiateActions(a,n(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this;if(!od(r))throw new rn("actions initializer should return a plain object containing actions");Object.getOwnPropertyNames(r).forEach(function(a){if(a in i.properties)throw new rn("'".concat(a,"' is a property and cannot be declared as an action"));if(a===zb)throw new rn("Cannot define action '".concat(zb,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(a===Ub)throw new rn("Cannot define action '".concat(Ub,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var o=r[a],s=n[a];if(a in ja&&s){var u=o;o=function(){s.apply(null,arguments),u.apply(null,arguments)}}var h=o.$mst_middleware,c=o.bind(r);c._isFlowAction=o._isFlowAction||!1,c.$mst_middleware=h;var m=Op(n,a,c);r[a]=m,ah(n,a,m)})}}),Object.defineProperty(t.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this;if(typeof n!="function")throw new rn("You passed an ".concat(typeof n," to volatile state as an argument, when function is expected"));var i=function(a){return r.instantiateVolatileState(a,n(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this;if(!od(r))throw new rn("volatile state initializer should return a plain object containing state");Object.getOwnPropertyNames(r).forEach(function(a){if(a in i.properties)throw new rn("'".concat(a,"' is a property and cannot be declared as volatile state"));G6(n,a,r[a])})}}),Object.defineProperty(t.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this,i=function(a){var o=n(a),s=o.actions,u=o.views,h=o.state,c=kO(o,["actions","views","state"]);for(var m in c)throw new rn("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(m,"'"));return h&&r.instantiateVolatileState(a,h),u&&r.instantiateViews(a,u),s&&r.instantiateActions(a,s),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this,i=function(a){return r.instantiateViews(a,n(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this;if(!od(r))throw new rn("views initializer should return a plain object containing views");Object.getOwnPropertyNames(r).forEach(function(a){var o;if(a in i.properties)throw new rn("'".concat(a,"' is a property and cannot be declared as a view"));var s=Object.getOwnPropertyDescriptor(r,a);if("get"in s)W6(n,a,s),Y6(n,(o={},o[a]=bh,o));else if(typeof s.value=="function")ah(n,a,s.value);else throw new rn("A view member should either be a function or getter based property")})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=Fi(a)?a:this.applySnapshotPreProcessor(a);return hy(this,n,r,i,o)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){r===void 0&&(r={});var i=n.type,a={};return i.forAllProps(function(o,s){a[o]=s.instantiate(n,o,void 0,r[o])}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=Wu(Wu({},J0),{name:this.name});return Qn.object(n,xd,r)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){ah(r,"toString",yC),this.forAllProps(function(i){q6(r,i,n.unbox)}),this.initializers.reduce(function(i,a){return a(i)},r),Vv(r,this.willChange),Yv(r,this.didChange)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=n,i=$n(r.object),a=r.name;i.assertWritable({subpath:a});var o=i.type.properties[a];return o&&(_c(o,r.newValue),r.newValue=o.reconcile(i.getChildNode(a),r.newValue,i,a)),r}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=n,i=$n(r.object),a=i.type.properties[r.name];if(a){var o=r.oldValue?r.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:oh(r.name),value:r.newValue.snapshot,oldValue:o},i)}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this,i=[];return this.forAllProps(function(a){i.push(r.getChildNode(n,a))}),i}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i;if(!(r in this.properties))throw new rn("Not a value property: "+r);var a=Hu(n.storedValue,r),o=(i=a.raw)===null||i===void 0?void 0:i.call(a);if(!o)throw new rn("Node not available for property "+r);return o}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this;r===void 0&&(r=!0);var a={};return this.forAllProps(function(o,s){var u=vd(n.storedValue,o);u.reportObserved(),a[o]=i.getChildNode(n,o).snapshot}),r?this.applySnapshotPostProcessor(a):a}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r={};return Object.keys(n).forEach(function(i){r[i]=n[i].getSnapshot()}),this.applySnapshotPostProcessor(r)}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i){if(!(i.op==="replace"||i.op==="add"))throw new rn("object does not support operation ".concat(i.op));n.storedValue[r]=i.value}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){_c(this,r);var i=this.applySnapshotPreProcessor(r);this.forAllProps(function(a){n.storedValue[a]=i[a]})}}),Object.defineProperty(t.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.preProcessor;return r?r.call(null,n):n}}),Object.defineProperty(t.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.postProcessor;return r?r.call(null,n):n}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.properties[n]}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this,a=this.applySnapshotPreProcessor(n);return od(a)?Q0(this.propertyNames.map(function(o){return i.properties[o].validate(a[o],fy(r,o,i.properties[o]))})):js(r,a,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this;this.propertyNames.forEach(function(i){return n(i,r.properties[i])})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this;return"{ "+this.propertyNames.map(function(r){return r+": "+n.properties[r].describe()}).join("; ")+" }"}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return xd}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){n.storedValue[r]=void 0}}),t})(bd);Lp.prototype.applySnapshot=Un(Lp.prototype.applySnapshot);function wC(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=typeof e[0]=="string"?e.shift():"AnonymousModel",r=e.shift()||{};return new Lp({name:n,properties:r})}function xC(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=typeof e[0]=="string",r=n?e[0]:"AnonymousModel";return n&&e.shift(),e.reduce(function(i,a){return i.cloneAndEnhance({name:i.name+"_"+a.name,properties:a.properties,initializers:a.initializers,preProcessor:function(o){return a.applySnapshotPreProcessor(i.applySnapshotPreProcessor(o))},postProcessor:function(o){return a.applySnapshotPostProcessor(i.applySnapshotPostProcessor(o))}})}).named(r)}function _C(e){return Ec(e)&&(e.flags&sr.Object)>0}var Oc=(function(e){li(t,e);function t(n,r,i,a){a===void 0&&(a=ZO);var o=e.call(this,n)||this;return Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"checker",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:a}),o.flags=r,o}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return Rf(this,n,r,i,a)}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.initializer(n)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(Cp(n)&&this.checker(n))return Is();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return js(r,n,"Value is not a ".concat(i))}}),t})(Ph),y7=new Oc("string",sr.String,function(e){return typeof e=="string"}),b7=new Oc("number",sr.Number,function(e){return typeof e=="number"}),SC=new Oc("integer",sr.Integer,function(e){return QO(e)}),EC=new Oc("float",sr.Float,function(e){return JO(e)}),kC=new Oc("finite",sr.Finite,function(e){return eC(e)}),w7=new Oc("boolean",sr.Boolean,function(e){return typeof e=="boolean"}),x7=new Oc("null",sr.Null,function(e){return e===null}),_7=new Oc("undefined",sr.Undefined,function(e){return e===void 0}),S7=new Oc("Date",sr.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});S7.getSnapshot=function(e){return e.storedValue.getTime()};var E7=S7;function AC(e){switch(typeof e){case"string":return y7;case"number":return b7;case"boolean":return w7;case"object":if(e instanceof Date)return E7}throw new rn("Cannot determine primitive type from value "+e)}function PC(e){return Ec(e)&&(e.flags&(sr.String|sr.Number|sr.Integer|sr.Boolean|sr.Date))>0}var OC=(function(e){li(t,e);function t(n){var r=e.call(this,JSON.stringify(n))||this;return Object.defineProperty(r,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:sr.Literal}),r.value=n,r}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return Rf(this,n,r,i,a)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return Cp(n)&&n===this.value?Is():js(r,n,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),t})(Ph);function k7(e){return new OC(e)}var CC=(function(e){li(t,e);function t(n,r,i,a){var o=e.call(this,n)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"_message",{enumerable:!0,configurable:!0,writable:!0,value:a}),o}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|sr.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return this._subtype.instantiate(n,r,i,a)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._subtype.isAssignableFrom(n)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this._subtype.validate(n,r);if(i.length>0)return i;var a=Fi(n)?$n(n).snapshot:n;return this._predicate(a)?Is():js(r,n,this._message(n))}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return this._subtype.reconcile(n,r,i,a)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t})(Sc);function LC(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=typeof e[0]=="string"?e.shift():Ec(e[0])?e[0].name:null,r=e[0],i=e[1],a=e[2]?e[2]:function(o){return"Value does not respect the refinement predicate"};return new CC(n,r,i,a)}function NC(e,t){var n=typeof e=="string"?t:e,r=eg.apply(void 0,gh([],Sf(n.map(function(i){return k7(""+i)})),!1));return typeof e=="string"&&(r.name=e),r}var TC=(function(e){li(t,e);function t(n,r,i){var a=e.call(this,n)||this;return Object.defineProperty(a,"_types",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),i=Wu({eager:!0,dispatcher:void 0},i),a._dispatcher=i.dispatcher,i.eager||(a._eager=!1),a}return Object.defineProperty(t.prototype,"flags",{get:function(){var n=sr.Union;return this._types.forEach(function(r){n|=r.flags}),n},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._types.some(function(r){return r.isAssignableFrom(n)})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(n){return n.describe()}).join(" | ")+")"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=this.determineType(a,void 0);if(!o)throw new rn("No matching type for union "+this.describe());return o.instantiate(n,r,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=this.determineType(r,n.getReconciliationType());if(!o)throw new rn("No matching type for union "+this.describe());return o.reconcile(n,r,i,a)}}),Object.defineProperty(t.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return this._dispatcher?this._dispatcher(n):r?r.is(n)?r:this._types.filter(function(i){return i!==r}).find(function(i){return i.is(n)}):this._types.find(function(i){return i.is(n)})}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(this._dispatcher)return this._dispatcher(n).validate(n,r);for(var i=[],a=0,o=0;o<this._types.length;o++){var s=this._types[o],u=s.validate(n,r);if(u.length===0){if(this._eager)return Is();a++}else i.push(u)}return a===1?Is():js(r,n,"No type is applicable for the union").concat(Q0(i))}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),t})(Sc);function eg(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Ec(e)?void 0:e,i=Ec(e)?gh([e],Sf(t),!1):t,a="("+i.map(function(o){return o.name}).join(" | ")+")";return new TC(a,i,r)}function RC(e){return Ec(e)&&(e.flags&sr.Union)>0}var MC=(function(e){li(t,e);function t(n,r,i){var a=e.call(this,n.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:i}),a}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|sr.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){if(this.optionalValues.indexOf(a)>=0){var o=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(n,r,i,o)}return this._subtype.instantiate(n,r,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return this._subtype.reconcile(n,this.optionalValues.indexOf(r)<0&&this._subtype.is(r)?r:this.getDefaultInstanceOrSnapshot(),i,a)}}),Object.defineProperty(t.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&_c(this,n),n}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return this.optionalValues.indexOf(n)>=0?Is():this._subtype.validate(n,r)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._subtype.isAssignableFrom(n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t})(Sc);function IC(e,t){if(typeof t!="function"&&Fi(t))throw new rn("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function sh(e,t,n){return IC(e,t),new MC(e,t,n||jC)}var jC=[void 0],DC=sh(_7,void 0),FC=sh(x7,null);function A7(e){return eg(e,DC)}function BC(e){return eg(e,FC)}var zC=(function(e){li(t,e);function t(n,r){var i=e.call(this,n)||this;return Object.defineProperty(i,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),i}return Object.defineProperty(t.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|sr.Late},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(!this._subType){var r=void 0;try{r=this._definition()}catch(i){if(i instanceof ReferenceError)r=void 0;else throw i}if(n&&r===void 0)throw new rn("Late type seems to be used too early, the definition (still) returns undefined");r&&(this._subType=r)}return this._subType}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return this.getSubType(!0).instantiate(n,r,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return this.getSubType(!0).reconcile(n,r,i,a)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this.getSubType(!1);return n?n.name:"<uknown late type>"}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this.getSubType(!1);return i?i.validate(n,r):Is()}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.getSubType(!1);return r?r.isAssignableFrom(n):!1}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this.getSubType(!1);return n||o7}}),t})(Sc);function UC(e,t){var n=typeof e=="string"?e:"late(".concat(e.toString(),")"),r=typeof e=="string"?t:e;return new zC(n,r)}function qC(e,t){return new $C(e,t)}var $C=(function(e){li(t,e);function t(n,r){var i=e.call(this,n)||this;return Object.defineProperty(i,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:sr.Lazy}),Object.defineProperty(i,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:Qn.array()}),b5(function(){return i.pendingNodeList.length>0&&i.pendingNodeList.some(function(a){return a.isAlive&&i.options.shouldLoadPredicate(a.parent?a.parent.value:null)})},function(){i.options.loadType().then(Un(function(a){i.loadedType=a,i.pendingNodeList.forEach(function(o){o.parent&&i.loadedType&&o.parent.applyPatches([{op:"replace",path:"/".concat(o.subpath),value:o.snapshot}])})}))}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=this;if(this.loadedType)return this.loadedType.instantiate(n,r,i,a);var s=Rf(this,n,r,i,a);return this.pendingNodeList.push(s),b5(function(){return!s.isAlive},function(){return o.pendingNodeList.splice(o.pendingNodeList.indexOf(s),1)}),s}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return this.loadedType?this.loadedType.validate(n,r):p7(n)?Is():js(r,n,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return this.loadedType?(n.die(),this.loadedType.instantiate(i,a,i.environment,r)):e.prototype.reconcile.call(this,n,r,i,a)}}),t})(Ph),P7=(function(e){li(t,e);function t(n){var r=e.call(this,n?"frozen(".concat(n.name,")"):"frozen")||this;return Object.defineProperty(r,"subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:sr.Frozen}),r}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return Rf(this,n,r,i,a)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return p7(n)?this.subType?this.subType.validate(n,r):Is():js(r,n,"Value is not serializable and cannot be frozen")}}),t})(Ph),$b=new P7;function HC(e){return arguments.length===0?$b:Ec(e)?new P7(e):sh($b,e)}function GC(e){switch(e){case ja.beforeDestroy:return"destroy";case ja.beforeDetach:return"detach";default:return}}var WC=(function(){function e(t,n){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolvedReference",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),dy(t))this.identifier=t;else if(Fi(t)){var r=$n(t);if(!r.identifierAttribute)throw new rn("Can only store references with a defined identifier attribute.");var i=r.unnormalizedIdentifier;if(i==null)throw new rn("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw new rn("Can only store references to tree nodes or identifiers, got: '".concat(t,"'"))}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=Hp(this.identifier),r=t.root,i=r.identifierCache.getLastCacheModificationPerId(n);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==i){var a=this.targetType,o=r.identifierCache.resolve(a,n);if(!o)throw new VC("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(t.path,")"));this.resolvedReference={node:o,lastCacheModification:i}}}}),Object.defineProperty(e.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e})(),VC=(function(e){li(t,e);function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return t})(Error),O7=(function(e){li(t,e);function t(n,r){var i=e.call(this,"reference(".concat(n.name,")"))||this;return Object.defineProperty(i,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:sr.Reference}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.targetType.isAssignableFrom(n)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return dy(n)?Is():js(r,n,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(t.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=r.parent;if(!(!o||!o.isAlive)){var s=o.storedValue;s&&this.onInvalidated({cause:n,parent:s,invalidTarget:a?a.storedValue:void 0,invalidId:i,replaceRef:function(u){Mb(r.root.storedValue,{op:"replace",value:u,path:r.path})},removeRef:function(){_C(o.type)?this.replaceRef(void 0):Mb(r.root.storedValue,{op:"remove",path:r.path})}})}}}),Object.defineProperty(t.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this,a=this.getValue(n);if(a){var o=$n(a),s=function(c,m){var g=GC(m);g&&i.fireInvalidated(g,n,r,o)},u=o.registerHook(ja.beforeDetach,s),h=o.registerHook(ja.beforeDestroy,s);return function(){u(),h()}}}}),Object.defineProperty(t.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i){var a=this;if(this.onInvalidated){var o;n.registerHook(ja.beforeDestroy,function(){o&&o()});var s=function(u){o&&o();var h=n.parent,c=h&&h.storedValue;if(h&&h.isAlive&&c){var m=void 0;i?m=!!i.get(r,c):m=n.root.identifierCache.has(a.targetType,Hp(r)),m?o=a.addTargetNodeWatcher(n,r):u||a.fireInvalidated("invalidSnapshotReference",n,r,null)}};n.state===Ao.FINALIZED?s(!0):(n.isRoot||n.root.registerHook(ja.afterCreationFinalization,function(){n.parent&&n.parent.createObservableInstanceIfNeeded()}),n.registerHook(ja.afterAttach,function(){s(!1)}))}}}),t})(Ph),YC=(function(e){li(t,e);function t(n,r){return e.call(this,n,r)||this}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(n.isAlive){var r=n.storedValue;return r.resolvedValue}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=n.storedValue;return r.identifier}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=Fi(a)?CO(a):a,s=new WC(a,this.targetType),u=Rf(this,n,r,i,s);return s.node=u,this.watchTargetNodeForInvalidations(u,o,void 0),u}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){if(!n.isDetaching&&n.type===this){var o=Fi(r),s=n.storedValue;if(!o&&s.identifier===r||o&&s.resolvedValue===r)return n.setParent(i,a),n}var u=this.instantiate(i,a,void 0,r);return n.die(),u}}),t})(O7),XC=(function(e){li(t,e);function t(n,r,i){var a=e.call(this,n,i)||this;return Object.defineProperty(a,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),a}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(n.isAlive){var r=this.options.get(n.storedValue,n.parent?n.parent.storedValue:null);return r}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.storedValue}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=Fi(a)?this.options.set(a,n?n.storedValue:null):a,s=Rf(this,n,r,i,o);return this.watchTargetNodeForInvalidations(s,o,this.options),s}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=Fi(r)?this.options.set(r,n?n.storedValue:null):r;if(!n.isDetaching&&n.type===this&&n.storedValue===o)return n.setParent(i,a),n;var s=this.instantiate(i,a,void 0,o);return n.die(),s}}),t})(O7);function C7(e,t){var n=t||void 0,r=t?t.onInvalidated:void 0;return n&&(n.get||n.set)?new XC(e,{get:n.get,set:n.set},r):new YC(e,r)}function KC(e,t){var n=C7(e,Wu(Wu({},t),{onInvalidated:function(r){t&&t.onInvalidated&&t.onInvalidated(r),r.removeRef()}}));return t&&t.acceptsUndefined===!1?n:A7(n)}var L7=(function(e){li(t,e);function t(n,r){var i=e.call(this,n)||this;return Object.defineProperty(i,"validType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:sr.Identifier}),i}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){if(!n||!(n.type instanceof Lp))throw new rn("Identifier types can only be instantiated as direct child of a model type");return Rf(this,n,r,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){if(n.storedValue!==r)throw new rn("Tried to change identifier from '".concat(n.storedValue,"' to '").concat(r,"'. Changing identifiers is not allowed."));return n.setParent(i,a),n}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return typeof n!==this.validType?js(r,n,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):Is()}}),t})(Ph),ZC=(function(e){li(t,e);function t(){var n=e.call(this,"identifier","string")||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:sr.Identifier}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),t})(L7),QC=(function(e){li(t,e);function t(){return e.call(this,"identifierNumber","number")||this}return Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.storedValue}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),t})(L7),JC=new ZC,eL=new QC;function Hp(e){return""+e}function dy(e){return typeof e=="string"||typeof e=="number"}function tL(e){return new nL(e)}var nL=(function(e){li(t,e);function t(n){var r=e.call(this,n.name)||this;return Object.defineProperty(r,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:sr.Custom}),r}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(this.options.isTargetType(n))return Is();var i=this.options.getValidationMessage(n);return i?js(r,n,"Invalid value for type '".concat(this.name,"': ").concat(i)):Is()}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.options.toSnapshot(n.storedValue)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=this.options.isTargetType(a)?a:this.options.fromSnapshot(a,n&&n.root.environment);return Rf(this,n,r,i,o)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=!this.options.isTargetType(r);if(!n.isDetaching){var s=n.type===this&&(o?r===n.snapshot:r===n.storedValue);if(s)return n.setParent(i,a),n}var u=o?this.options.fromSnapshot(r,i.root.environment):r,h=this.instantiate(i,a,void 0,u);return n.die(),h}}),t})(Ph),Dt={enumeration:NC,model:wC,compose:xC,custom:tL,reference:C7,safeReference:KC,union:eg,optional:sh,literal:k7,maybe:A7,maybeNull:BC,refinement:LC,string:y7,boolean:w7,number:b7,integer:SC,float:EC,finite:kC,Date:E7,map:mC,array:vC,frozen:HC,identifier:JC,identifierNumber:eL,late:UC,lazy:qC,undefined:_7,null:x7,snapshotProcessor:pC};function N7({oldText:e,newText:t,element:n}){if(!(t.length/Math.max(20,e.length)>=4))return n.fontSize;const r=n.width*n.page.computedHeight/t.length,i=1.5*Math.sqrt(r),a=n.fontSize;return Math.min(a,Math.max(5,Math.round(i)))}function rL(e){try{const{stops:t}=Up(e);if(t.length===0)return 127.5;let n=0,r=0;for(const i of t)try{const a=un.Util.colorToRGBA(i.color);if(a.a<.5)continue;n+=(299*a.r+587*a.g+114*a.b)/1e3,r++}catch{continue}return r===0?127.5:n/r}catch(t){return console.warn("Error calculating gradient brightness:",t),127.5}}function Hb(e){if(la(e))return rL(e);const{r:t,g:n,b:r}=un.Util.colorToRGBA(e);return(299*t+587*n+114*r)/1e3}function T7(e){const{outlineSize:t,outlineColor:n}=(function(a){const o=a.strokeWidth||0;return o>0?{outlineSize:o,outlineColor:a.stroke}:{outlineSize:a.shadowEnabled&&a.shadowBlur>0&&a.shadowOpacity>.1?a.shadowBlur*a.shadowOpacity:0,outlineColor:a.shadowColor}})(e);if(t<.001)return e.fill;const r=Hb(e.fill),i=Hb(n);return Math.abs(r-i)>=50?n:e.fill}let Xf;function iL(){return Xf||(Xf=document.getElementById("polotno-text-style"),Xf||(Xf=document.createElement("style"),Xf.id="polotno-text-style",document.head.appendChild(Xf)),Xf)}un._fixTextRendering=!0;const Gb={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal",textTransform:"none"},aL=Qr(({textNodeRef:e,element:t,onBlur:n,selectAll:r,cursorPosition:i})=>{const[a,o]=oe.useState(Gb),s=e.current;oe.useLayoutEffect(()=>{const g={};g.width=s.width()-2*s.padding()+"px",g.height=s.height()-2*s.padding()+s.fontSize()*s.lineHeight()+"px",g.fontSize=s.fontSize()+"px",g.lineHeight=s.lineHeight()+.01,g.fontFamily=s.fontFamily(),g.textAlign=s.align(),g.color=s.fill(),g.fontWeight=t.fontWeight,g.fontStyle=t.fontStyle,g.letterSpacing=t.letterSpacing+"em",g.opacity=Math.max(t.a.opacity,.2),g.textTransform=t.textTransform,g.caretColor=T7(t);const d=`
|
|
93
|
+
.polotno-input::placeholder {
|
|
94
|
+
color: ${a.color};
|
|
95
|
+
opacity: 0.6;
|
|
96
|
+
}
|
|
97
|
+
`,y=iL();y.innerHTML="",y.appendChild(document.createTextNode(d)),JSON.stringify(g)!==JSON.stringify(a)&&o(g)});const u=oe.useRef(null);if(oe.useLayoutEffect(()=>{var g;const d=u.current;if(!d)return;(g=u.current)===null||g===void 0||g.focus();const y=i||d.value.length;d.selectionStart=d.selectionEnd=y,r&&(d?.select(),document.execCommand("selectAll",!1,null))},[]),oe.useEffect(()=>{window.addEventListener("blur",n);const g=d=>{var y;!((y=u.current)===null||y===void 0)&&y.contains(d.target)||n()};return window.addEventListener("touchstart",g),()=>{window.removeEventListener("blur",n),window.removeEventListener("touchstart",g)}},[]),!s)return null;let h=0;const c=s.textArr.length*s.lineHeight()*s.fontSize();t.verticalAlign==="middle"&&(h=(t.a.height-c)/2),t.verticalAlign==="bottom"&&(h=t.a.height-c);const m=$o(t.text);return oe.createElement("textarea",{className:"polotno-input",ref:u,dir:Ap(m),style:Object.assign(Object.assign(Object.assign({},Gb),a),{paddingTop:h+"px"}),value:m,onChange:g=>{const d=N7({oldText:t.text,newText:g.target.value,element:t});t.set({text:g.target.value,fontSize:d})},placeholder:t.placeholder,onBlur:n})}),oL=e=>oe.createElement(A0,null,oe.createElement(aL,Object.assign({},e))),R7=(e,t)=>{const[n,r]=oe.useReducer(o=>o+1,0),i=oe.useRef(Cb(t)),a=oe.useRef(null);return oe.useLayoutEffect(()=>{if(i.current=Cb(t),i.current)return;let o=!0;return(async()=>{i.current=!1,r();const s=dh(`text ${t}`);await e.loadFont(t),o?(a.current=s,i.current=!0,r()):s()})(),()=>{a.current&&(a.current(),a.current=null),o=!1}},[t]),oe.useEffect(()=>{i.current&&setTimeout(()=>{a.current&&(a.current(),a.current=null)})},[i.current]),[i.current]},M7=({fontLoaded:e,fontFamily:t,fontSize:n,lineHeight:r})=>oe.useMemo(()=>xO({fontFamily:t,fontSize:n,lineHeight:r}),[e,t,n,r]);function N0(e){const t=oe.useRef(e),n=oe.useRef(e);return oe.useMemo(()=>{n.current=t.current,t.current=e},[e]),n.current}const sL=Qr(({element:e,store:t})=>{const n=oe.useRef(null),r=oe.useRef(null),i=oe.useRef(null),{editorEnabled:a,selectAll:o}=(ee=>{const[Q,re]=oe.useState(!1),X=oe.useRef(!1);return oe.useEffect(()=>{var B=!0;return setTimeout(()=>{B&&(ee._editModeEnabled&&(X.current=!0),re(!0),setTimeout(()=>{X.current=!1},50))},50),()=>{B=!1}},[]),{editorEnabled:Q&&ee._editModeEnabled,selectAll:X.current}})(e),[s,u]=oe.useState(!1),h=oe.useRef(e.a.height),c=t.selectedShapes.indexOf(e)>=0&&e.selectable,m=N0(c),{textVerticalResizeEnabled:g}=Ir,d=Ir.autoDeleteEmptyText,y=N0(e.fontFamily),[_,x]=oe.useState([]);oe.useEffect(()=>{var ee,Q;const re=(Q=(ee=n.current)===null||ee===void 0?void 0:ee.textArr)!==null&&Q!==void 0?Q:[];JSON.stringify(re)!==JSON.stringify(_)&&x(re)}),oe.useEffect(()=>{if(e.a.width)return;const ee=n.current;ee.width(600),e.set({width:1.4*ee.getTextWidth()})},[]),oe.useEffect(()=>{m&&!c&&d&&e.text===""&&e.removable&&!e.placeholder&&t.deleteElements([e.id])},[d,e.placeholder,e.removable,e.text,c,m]),oe.useLayoutEffect(()=>$u(()=>{const ee=n.current;Rs(ee,e)}));const[b]=R7(t,e.fontFamily);let S=$o(e.text);e.textTransform==="uppercase"&&(S=S.toUpperCase());const k=()=>{if(e.curveEnabled){const re=r.current;return re.getSelfRect().height||re.fontSize()}const ee=n.current.clone({height:void 0}),Q=Math.ceil(ee.fontSize()*ee.lineHeight()*ee.textArr.length+1);return ee.destroy(),Q};oe.useLayoutEffect(()=>{if(!b)return;const{textOverflow:ee,textSplitAllowed:Q}=Ir,re=(X,...B)=>{const F=dh(`text ${e.id} before ignore`);t.history.ignore(X,...B).then(()=>{F()})};if(!e.a.height){const X=k();return void re(()=>{e.set({height:X})})}if(!t.isPlaying)if(ee!=="change-font-size"||s){if(ee==="resize"){const X=k();g&&e.a.height<X&&!s&&re(()=>{var B;Ib(e)&&e.set({height:X}),(B=n.current)===null||B===void 0||B.height(X)},!1,!0),g||e.a.height===X||s||re(()=>{var B;Ib(e)&&e.set({height:X}),(B=n.current)===null||B===void 0||B.height(X)},!1,!0)}}else{const X=(function(F,z,Y=!1){const J=F.fontSize(),K=F.height(),ie=$o(z.text);let fe=z.a.fontSize;F.height(void 0);const ue=Math.round(2*z.a.fontSize)-1;for(let _e=1;_e<ue;_e++){const Ce=z.a.height&&F.height()>z.a.height;let $e=ie.split(`
|
|
98
|
+
`).join(" ").split(/[\s-]+/).reduce((pe,ut)=>(ut=ut.toLowerCase(),/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(ut)?pe.concat(ut.split("")):pe.concat(ut)),[]),ze=F.textArr.map(pe=>pe.text.toLowerCase()).join(";");const tt=$e.find(pe=>!ze.includes(pe)||(ze=ze.replace(pe,""),!1));if(!(Ce||tt&&!Y))break;fe-=.5,F.fontSize(fe)}return F.fontSize(J),F.height(K),fe})(n.current,e,Q);if(X!==e.a.fontSize)return void re(()=>{e.set({fontSize:X})},!1,!0);const B=k();e.a.height===B||g||re(()=>{e.set({height:B})},!1,!0)}}),oe.useLayoutEffect(()=>{var ee;if(b&&e.curveEnabled){const Q=(ee=r.current)===null||ee===void 0?void 0:ee.getSelfRect().width;if(Q){const re=Q-e.a.width,X=e.a.rotation*Math.PI/180,B=-re/2*Math.cos(X),F=-re/2*Math.sin(X);e.set({width:Q,x:e.a.x+B,y:e.a.y+F})}}},[b,e.curveEnabled,e.curvePower,e.text,e.fontSize,e.fontFamily,e.fontWeight,e.fontStyle,e.letterSpacing]),oe.useLayoutEffect(()=>{const ee=n.current;ee&&(ee.width(ee.width()+1e-8),ee.width(ee.width()-1e-8),ee._setTextData(),Rs(ee,e))},[b]);const E=oe.useRef(null),A=oe.useRef(0),R=ee=>{ee.evt.preventDefault(),t.selectedShapes.find(re=>re===e)&&e.contentEditable&&(A.current=(function(re){var X;const B=re.target,F=(function(fe){var ue=fe.getAbsoluteTransform().copy();ue.invert();var _e=fe.getStage().getPointerPosition();return ue.point(_e)})(B),z=B.textArr,Y=Math.floor(F.y/(B.fontSize()*B.lineHeight())),J=z.slice(0,Y).reduce((fe,ue)=>fe+ue.text.length,Y),K=(X=z[Y])!==null&&X!==void 0?X:z[0];let ie=0;return B.align()==="right"?ie=B.width()-K.width:B.align()==="center"&&(ie=B.width()/2-K.width/2),J+Math.round((F.x-ie)/K.width*K.text.length)})(ee),e.toggleEditMode())},O=!S&&e.placeholder?.6:e.a.opacity;qp(n,O);const I=M7({fontLoaded:b,fontFamily:e.fontFamily,fontSize:e.a.fontSize,lineHeight:e.lineHeight}),j=e.selectable||t.role==="admin",D=Gu(e),C=Gu(e,e.stroke,"stroke"),N=oe.useMemo(()=>e.backgroundEnabled?e.curveEnabled?(function({width:ee,height:Q,padding:re=0,cornerRadius:X=0}){const B=-re,F=-re,z=ee+re,Y=Q+re,J=kb(`M ${B} ${F} L ${z} ${F} L ${z} ${Y} L ${B} ${Y} Z`);return Ab(J,X).path})({width:e.a.width,height:e.a.height,cornerRadius:e.backgroundCornerRadius*(e.a.fontSize*I*.5),padding:e.backgroundPadding*(e.a.fontSize*I*.5)}):(function({lines:ee,lineHeight:Q,width:re,align:X="left",padding:B=0,cornerRadius:F=0}){var z;ee.forEach((ie,fe)=>{ie.cx=re/2,X==="right"?ie.cx=re-ie.width/2:X==="left"&&(ie.cx=ie.width/2),X!=="justify"||ie.lastInParagraph||(ie.width=re),X==="justify"&&(ie.cx=ie.width/2)});let Y=`M ${(z=ee[0])===null||z===void 0?void 0:z.cx} ${-B}`;ee.forEach((ie,fe)=>{const{cx:ue}=ie,_e=ee[fe-1];_e&&_e.width>ie.width?Y+=` L ${ue+ie.width/2+B} ${fe*Q+B}`:Y+=` L ${ue+ie.width/2+B} ${fe*Q-B}`;const Ce=ee[fe+1];Ce&&Ce.width>ie.width?Y+=` L ${ue+ie.width/2+B} ${(fe+1)*Q-B}`:Y+=` L ${ue+ie.width/2+B} ${(fe+1)*Q+B}`});for(var J=ee.length-1;J>=0;J--){const ie=ee[J],{cx:fe}=ie,ue=ee[J+1];ue&&ue.width>ie.width?Y+=` L ${fe-ie.width/2-B} ${(J+1)*Q-B}`:Y+=` L ${fe-ie.width/2-B} ${(J+1)*Q+B}`;const _e=ee[J-1];_e&&_e.width>ie.width?Y+=` L ${fe-ie.width/2-B} ${J*Q+B}`:Y+=` L ${fe-ie.width/2-B} ${J*Q-B}`}Y+=" Z";const K=kb(Y);return Ab(K,F).path})({lines:JSON.parse(JSON.stringify(_)),cornerRadius:e.backgroundCornerRadius*(e.a.fontSize*I*.5),lineHeight:I*e.a.fontSize,padding:e.backgroundPadding*(e.a.fontSize*I*.5),width:e.a.width,align:e.align}):"",[e.backgroundEnabled,e.curveEnabled,e.backgroundCornerRadius,e.a.fontSize,e.a.height,I,e.backgroundPadding,e.a.width,e.align,_]),$=Tf();let G=0;e.curveEnabled||(e.verticalAlign==="middle"?G=(e.a.height-_.length*I*e.a.fontSize)/2:e.verticalAlign==="bottom"&&(G=e.a.height-_.length*I*e.a.fontSize));const te=e.curveEnabled?ph(e.a.width,e.a.height,e.curvePower,e.a.fontSize):"",se=b?'"'+e.fontFamily+'"':y===e.fontFamily?"Arial":'"'+y+'"';return oe.createElement(oe.Fragment,null,oe.createElement(Ep,{ref:i,x:e.a.x,y:e.a.y,rotation:e.a.rotation,hideInExport:!e.showInExport,listening:!1,visible:e.backgroundEnabled,opacity:e.backgroundOpacity*O,data:N,fill:e.backgroundColor,offsetY:-G}),oe.createElement(Ep,{data:te,stroke:"red",strokeWidth:1,x:e.a.x,y:e.a.y,rotation:e.a.rotation,visible:!1}),oe.createElement(jP,Object.assign({ref:r,visible:e.curveEnabled,data:te,text:S||e.placeholder,listening:!1,align:"center",textBaseline:"middle"},D,C,{strokeWidth:e.strokeWidth,lineJoin:"round",fillAfterStrokeEnabled:!0,fontSize:e.a.fontSize,fontFamily:`"${e.fontFamily}", "${y}"`,fontStyle:e.fontStyle+" "+e.fontWeight,textDecoration:e.textDecoration.trim(),letterSpacing:e.letterSpacing*e.a.fontSize,x:e.a.x,y:e.a.y,rotation:e.a.rotation,opacity:e._editModeEnabled?.3:O,hideInExport:!e.showInExport,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity})),oe.createElement(Uu,Object.assign({ref:n,id:e.id,name:"element",hideInExport:!e.showInExport,editModeEnabled:e._editModeEnabled,x:e.a.x,y:e.a.y,rotation:e.a.rotation,width:e.a.width,height:e.a.height,text:S||e.placeholder,direction:Ap(S)},D,C,{lineJoin:"round",strokeWidth:e.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:e.a.fontSize,fontFamily:se,fontStyle:e.fontStyle+" "+e.fontWeight,textDecoration:e.textDecoration,align:e.align,verticalAlign:e.verticalAlign,draggable:$?e.draggable&&c:e.draggable,preventDefault:!$||c,opacity:e.curveEnabled?0:O,visible:!e._editModeEnabled,ellipsis:Ir.textOverflow==="ellipsis",shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,lineHeight:I,letterSpacing:e.letterSpacing*e.a.fontSize,listening:j,onDragMove:ee=>{e.set({x:ee.target.x(),y:ee.target.y()})},onDragEnd:ee=>{e.set({x:ee.target.x(),y:ee.target.y()})},onClick:R,onTap:R,onTransformStart:()=>{u(!0),h.current=n.current.height()},onTransform:ee=>{var Q,re,X;const B=ee.target;(Q=i.current)===null||Q===void 0||Q.setAttrs({x:B.x(),y:B.y(),rotation:B.rotation(),scale:B.scale()});const F=((re=B.getStage())===null||re===void 0?void 0:re.findOne("Transformer")).getActiveAnchor();if(F==="middle-left"||F==="middle-right"){const Y=B.scaleX(),J=B.width()*Y,K=e.a.fontSize;let ie=J;J<K&&(ie=K,E.current&&B.position(E.current)),B.width(ie),B.scaleX(1),B.scaleY(1);const fe=k();if(Ir.textOverflow!=="ellipsis"){const _e=Math.max(fe,h.current);B.height(_e),e.set({height:B.height()})}const ue=Ir.textVerticalResizeEnabled?Math.max(fe,h.current):k();e.set({x:B.x(),width:B.width(),rotation:B.rotation(),height:ue}),Rs(B,e)}if(F==="top-center"||F==="bottom-center"){let Y=Ir.textOverflow==="resize"?k():I*e.a.fontSize;ee.target.height(Math.max(Y,ee.target.height()*ee.target.scaleY())),ee.target.scaleY(1)}E.current=ee.target.position();const z=ee.target.scaleX();(X=i.current)===null||X===void 0||X.setAttrs({scaleX:1,scaleY:1}),ee.target.scaleX(1),ee.target.scaleY(1),e.set({fontSize:e.a.fontSize*z,width:ee.target.width()*z,x:ee.target.x(),y:ee.target.y(),rotation:ee.target.rotation(),height:ee.target.height()*z,shadowBlur:e.shadowBlur*z,shadowOffsetX:e.shadowOffsetX*z,shadowOffsetY:e.shadowOffsetY*z,strokeWidth:e.strokeWidth*z})},onTransformEnd:ee=>{var Q;const re=ee.target.scaleX();ee.target.scaleX(1),ee.target.scaleY(1),e.set({fontSize:Math.round(e.a.fontSize*re),width:Math.ceil(ee.target.width()*re),x:ee.target.x(),y:ee.target.y(),rotation:ee.target.rotation(),height:ee.target.height()*re,shadowBlur:e.shadowBlur*re,shadowOffsetX:e.shadowOffsetX*re,shadowOffsetY:e.shadowOffsetY*re,strokeWidth:e.strokeWidth*re}),(Q=i.current)===null||Q===void 0||Q.setAttrs({scaleX:1,scaleY:1}),u(!1)}})),a&&oe.createElement(hr,{x:e.a.x,y:e.a.y,rotation:e.a.rotation},oe.createElement(oL,{textNodeRef:n,element:e,selectAll:o,cursorPosition:A.current,onBlur:()=>{e.toggleEditMode(!1)}})))});var c2={exports:{}},f2={exports:{}},Wb;function py(){return Wb||(Wb=1,(function(e,t){e.exports=n;function n(i){return r.bind(null,i)}function r(i){var a=[].slice.call(arguments,1);a.unshift("["+i+"]"),process.stderr.write(a.join(" ")+`
|
|
99
|
+
`)}})(f2)),f2.exports}var Vb;function I7(){return Vb||(Vb=1,(function(e,t){py()("lex"),e.exports=n;function n(r){var i="",a,o=0,s=-1,u=0,h=1,c="before-selector",m=[c],g={},d=[],y=["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 _(){return I(),r[s]}function x(ee){return ee?m[m.length-1-ee]:c}function b(ee){var Q=s+1;return ee===r.slice(Q,Q+ee.length)}function S(ee){var Q=r.slice(s).indexOf(ee);return Q>0?Q:!1}function k(ee){return ee===E(1)}function E(ee){return r[s+(ee||1)]}function A(){var ee=m.pop();return c=m[m.length-1],ee}function R(ee){return c=ee,m.push(c),m.length}function O(ee){var Q=c;return m[m.length-1]=c=ee,Q}function I(ee){if((ee||1)==1)r[s]==`
|
|
100
|
+
`?(h++,o=1):o++,s++;else{var Q=r.slice(s,s+ee).split(`
|
|
101
|
+
`);Q.length>1&&(h+=Q.length-1,o=1),o+=Q[Q.length-1].length,s=s+ee}}function j(){g.end={line:h,col:o},d.push(g),i="",g={}}function D(ee){g={type:ee,start:{line:h,col:o}}}for(;a=_();)switch(a){case" ":switch(x()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":i+=a;break}break;case`
|
|
102
|
+
`:case" ":case"\r":case"\f":switch(x()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":i+=a;break;case"at-value":a===`
|
|
103
|
+
`&&(g.value=i.trim(),j(),A());break}break;case":":switch(x()){case"name":g.name=i.trim(),i="",O("before-value");break;case"before-selector":i+=a,D("selector"),R("selector");break;case"before-value":O("value"),i+=a;break;default:i+=a;break}break;case";":switch(x()){case"name":case"before-value":case"value":i.trim().length>0&&(g.value=i.trim(),j()),O("before-name");break;case"value-paren":i+=a;break;case"at-value":g.value=i.trim(),j(),A();break;case"before-name":break;default:i+=a;break}break;case"{":switch(x()){case"selector":if(E(-1)==="\\"){i+=a;break}g.text=i.trim(),j(),O("before-name"),u=u+1;break;case"at-group":switch(g.name=i.trim(),g.type){case"font-face":case"viewport":case"page":R("before-name");break;default:R("before-selector")}j(),u=u+1;break;case"name":case"at-rule":g.name=i.trim(),j(),R("before-name"),u=u+1;break;case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":O("value"),i+=a;break}break;case"}":switch(x()){case"before-name":case"name":case"before-value":case"value":i&&(g.value=i.trim()),g.name&&g.value&&j(),D("end"),j(),A(),x()==="at-group"&&(D("at-group-end"),j(),A()),u>0&&(u=u-1);break;case"at-group":case"before-selector":case"selector":if(E(-1)==="\\"){i+=a;break}u>0&&x(1)==="at-group"&&(D("at-group-end"),j()),u>1&&A(),u>0&&(u=u-1);break;case"double-string":case"single-string":case"comment":i+=a;break}break;case'"':case"'":switch(x()){case"double-string":a==='"'&&E(-1)!=="\\"&&A();break;case"single-string":a==="'"&&E(-1)!=="\\"&&A();break;case"before-at-value":O("at-value"),R(a==='"'?"double-string":"single-string");break;case"before-value":O("value"),R(a==='"'?"double-string":"single-string");break;case"comment":break;default:E(-1)!=="\\"&&R(a==='"'?"double-string":"single-string")}i+=a;break;case"/":switch(x()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":case"selector":case"name":case"value":if(k("*")){var C=S("*/");C&&I(C+1)}else x()=="before-value"&&O("value"),i+=a;break;default:k("*")?(D("comment"),R("comment"),I()):i+=a;break}break;case"*":switch(x()){case"comment":k("/")?(g.text=i,I(),j(),A()):i+=a;break;case"before-selector":i+=a,D("selector"),R("selector");break;case"before-value":O("value"),i+=a;break;default:i+=a}break;case"@":switch(x()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":O("value"),i+=a;break;default:for(var N=!1,$,G,te=0,se=y.length;!N&&te<se;++te)G=y[te],$=G.name||G,b($)&&(N=!0,D($),R(G.state||"at-group"),I($.length),G.prefix&&(g.prefix=G.prefix),G.type&&(g.type=G.type));N||(i+=a);break}break;case"(":switch(x()){case"value":R("value-paren");break;case"before-value":O("value");break}i+=a;break;case")":switch(x()){case"value-paren":A();break;case"before-value":O("value");break}i+=a;break;default:switch(x()){case"before-selector":D("selector"),R("selector");break;case"before-name":D("property"),O("name");break;case"before-value":O("value");break;case"before-at-value":O("at-value");break}i+=a;break}return d}})(c2)),c2.exports}var h2={exports:{}},Yb;function lL(){return Yb||(Yb=1,(function(e,t){py()("parse");var n=I7();e.exports=s;var r,i,a,o;function s(A,R){R||(R={}),r=!!R.comments,a=!!R.position,i=0,o=Array.isArray(A)?A.slice():n(A);for(var O,I=[],j;j=h();)O=b(j),O&&I.push(O);return{type:"stylesheet",stylesheet:{rules:I}}}function u(A,R){R||(R={});for(var O,I=["type","name","value"],j={},D=0;D<I.length;++D)O=I[D],A[O]&&(j[O]=R[O]||A[O]);for(I=Object.keys(R),D=0;D<I.length;++D)O=I[D],j[O]||(j[O]=R[O]);return a&&(j.position={start:A.start,end:A.end}),j}function h(){var A=o.shift();return A}function c(A){i=i+1;var R={};switch(A.type){case"font-face":case"viewport":R.declarations=k();break;case"page":R.prefix=A.prefix,R.declarations=k();break;default:R.prefix=A.prefix,R.rules=E()}return u(A,R)}function m(A){return u(A)}function g(A){return u(A)}function d(A){return u(A,{text:A.text})}function y(A){return u(A)}function _(A){return u(A)}function x(A){function R(O){return O.trim()}return u(A,{type:"rule",selectors:A.text.split(",").map(R),declarations:k()})}function b(A){switch(A.type){case"property":return _(A);case"selector":return x(A);case"at-group-end":i=i-1;return;case"media":case"keyframes":return c(A);case"comment":if(r)return d(A);break;case"charset":return g(A);case"import":return m(A);case"namespace":return y(A);case"font-face":case"supports":case"viewport":case"document":case"page":return c(A)}}function S(A){for(var R,O=[],I;(I=h())&&A&&A(I);)R=b(I),R&&O.push(R);return I&&I.type!=="end"&&o.unshift(I),O}function k(){return S(function(A){return A.type==="property"||A.type==="comment"})}function E(){return S(function(){return i})}})(h2)),h2.exports}var d2={exports:{}},Xb;function uL(){return Xb||(Xb=1,(function(e,t){py()("stringify");var n,r,i,a,o,s;e.exports=u;function u(E,A){A||(A={}),i=A.indentation||"",r=!!A.compress,n=!!A.comments,a=1,r?o=s="":(o=`
|
|
104
|
+
`,s=" ");var R=y(E.stylesheet.rules,S).join(`
|
|
105
|
+
`).trim();return R}function h(E){if(E){a+=E;return}return r?"":Array(a).join(i||"")}function c(E){return"@"+E.type+" "+E.value+";"+o}function m(E){var A="",R=E.prefix||"";E.name&&(A=" "+E.name);var O=E.type!=="page";return"@"+R+E.type+A+s+_(E,O)+o}function g(E){return n?"/*"+(E.text||"")+"*/"+o:""}function d(E){var A;return E.selectors?A=E.selectors.join(","+o):(A="@"+E.type,A+=E.name?" "+E.name:""),h()+A+s+_(E)+o}function y(E,A){return E.reduce(function(R,O){var I=O.type==="comment"?g(O):A(O);return I&&R.push(I),R},[])}function _(E,A){var R=E.declarations,O=b;return E.rules&&(R=E.rules,O=d),R=x(R,O),R&&(R=o+R+(A?"":o)),"{"+R+h()+"}"}function x(E,A){if(!E)return"";h(1);var R=y(E,A);return h(-1),R.length?R.join(o):""}function b(E){if(E.type==="property")return k(E)}function S(E){switch(E.type){case"rule":return d(E);case"media":case"keyframes":return m(E);case"comment":return g(E);case"import":case"charset":case"namespace":return c(E);case"font-face":case"supports":case"viewport":case"document":case"page":return m(E)}}function k(E){var A=E.name?E.name+":"+s:"";return h()+A+E.value+";"}})(d2)),d2.exports}var p2,Kb;function cL(){return Kb||(Kb=1,p2={lex:I7(),parse:lL(),stringify:uL()}),p2}var fL=cL();const hL=yh(fL);function dL(e){for(;e.parentNode;){if(e.nodeName==="defs")return!0;e=e.parentNode}return!1}function pL(e){const t={};return e.querySelectorAll("style").forEach(n=>{const r=hL.parse(n.textContent).stylesheet.rules;for(let i of r)i.selectors&&i.selectors.forEach(a=>{const o=t[a]||{};i.declarations.forEach(s=>{o[s.name]=s.value}),t[a]=o})}),t}function j7(e,t){var n;const r={fill:"",stroke:""},i=((n=e.getAttribute("class"))===null||n===void 0?void 0:n.split(" "))||[],a=e.getAttribute("id");let o={};if(a&&t[`#${a}`]?o=t[`#${a}`]:i.forEach(s=>{t[`.${s}`]&&(o=Object.assign(Object.assign({},o),t[`.${s}`]))}),t[e.nodeName]&&(o=Object.assign(Object.assign({},o),t[e.nodeName])),e.getAttribute("fill")&&e.getAttribute("fill")!=="none"?r.fill=e.getAttribute("fill"):o.fill&&o.fill!=="none"&&(r.fill=o.fill),e.getAttribute("stroke")&&e.getAttribute("stroke")!=="none"?r.stroke=e.getAttribute("stroke"):o.stroke&&o.stroke!=="none"&&(r.stroke=o.stroke),!r.fill&&e.style.fill&&e.style.fill!=="none"&&(r.fill=e.style.fill),!r.stroke&&e.style.stroke&&e.style.stroke!=="none"&&(r.stroke=e.style.stroke),!r.stroke&&!r.fill){const s=e.ownerSVGElement,u=s&&s!==e&&j7(s,t);u?.fill==="currentColor"||u?.stroke==="currentColor"||(r.fill="black")}return r}const gL=["path","rect","circle","line","polygon","polyline","ellipse","text"];function mL(e){for(var t=[],n=e.getElementsByTagName("*"),r=0,i=n.length;r<i;r++){const a=n[r];dL(a)||(a.getAttribute("fill")!==null&&t.push(a),(a.getAttribute("stroke")!==null||a.style&&a.style.fill||gL.indexOf(a.nodeName)>=0)&&t.push(a))}return t}async function Zb(e){const t=await fetch(e);return Mf(await t.text())}async function Gp(e){return await(await fetch(e,{mode:"cors"})).text()}function Mf(e){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(e)))}function gy(e){var t=new DOMParser().parseFromString(e,"image/svg+xml");const n=t.documentElement.getAttribute("viewBox"),[r,i,a,o]=n?.split(" ")||[],s=t.documentElement.getAttribute("width");!s&&t.documentElement.setAttribute("width",a+"px");const u=t.documentElement.getAttribute("height");if((!u||u.indexOf("%")>=0)&&t.documentElement.setAttribute("height",o+"px"),s&&s.indexOf("%")>=0&&u&&u.indexOf("%")===-1){const h=parseFloat(u)/parseFloat(o);t.documentElement.setAttribute("width",h*parseFloat(a)+"px")}if(u&&u.indexOf("%")>=0&&s&&s.indexOf("%")===-1){const h=parseFloat(s)/parseFloat(a);t.documentElement.setAttribute("height",h*parseFloat(o)+"px")}return s==="100%"&&u==="100%"&&(t.documentElement.setAttribute("width",a+"px"),t.documentElement.setAttribute("height",o+"px")),new XMLSerializer().serializeToString(t)}const vL=(e,t)=>{if(!e||!t)return!1;if(t==="currentColor"&&e==="black")return!0;const n=un.Util.colorToRGBA(e),r=un.Util.colorToRGBA(t);return n&&r?n.r===r.r&&n.g===r.g&&n.b===r.b&&n.a===r.a:void 0};function my(e,t){var n=new DOMParser().parseFromString(e,"image/svg+xml");const r=mL(n),i=Array.from(t.keys()),a=pL(n);return r.forEach(o=>{const{fill:s,stroke:u}=j7(o,a);[{prop:"fill",color:s},{prop:"stroke",color:u}].forEach(({prop:h,color:c})=>{const m=i.find(g=>vL(g,c));if(m){const g=t.get(m);if(la(g)){const{rotation:d,stops:y}=Up(g),_=y.map(b=>({offset:100*b.offset+"%","stop-color":b.color})),x="color"+Math.round(1e8*Math.random());(function(b,S,k,E){var A=b.namespaceURI,R=document.createElementNS(A,"linearGradient");const O=un.Util.degToRad(k+90),I=(Math.cos(O)+1)/2,j=(Math.sin(O)+1)/2,D=(Math.cos(O+Math.PI)+1)/2,C=(Math.sin(O+Math.PI)+1)/2;R.setAttribute("x1",100*I+"%"),R.setAttribute("y1",100*j+"%"),R.setAttribute("x2",100*D+"%"),R.setAttribute("y2",100*C+"%"),R.setAttribute("gradientUnits","userSpaceOnUse"),R.setAttribute("id",S);for(var N=0;N<E.length;N++){var $=E[N],G=document.createElementNS(A,"stop");for(var te in $)$.hasOwnProperty(te)&&G.setAttribute(te,$[te]);R.appendChild(G)}(b.querySelector("defs")||b.insertBefore(document.createElementNS(A,"defs"),b.firstChild)).appendChild(R)})(n.children[0],x,d,_),o.style[h]=null,o.setAttribute(h,`url('#${x}')`)}else o.style[h]=t.get(m)}})}),Mf(new XMLSerializer().serializeToString(n))}const vy=(e,t,n)=>{let r=t,i=n,a=1;for(;r>0&&i>0;){e.width=r,e.height=i;const o=e.getContext("2d");if(!o)return;if(o.fillStyle="rgba(0,0,0,0.1)",o.fillRect(0,0,1,1),o.getImageData(0,0,1,1).data[3]!==0)return void o.clearRect(0,0,e.width,e.height);if(a*=.9,r=Math.floor(t*a),i=Math.floor(n*a),r=Math.max(r,1),i=Math.max(i,1),r<=1&&i<=1)return e.width=1,void(e.height=1)}},kv=(e,t=100,n=!1,r)=>{const i=oe.useRef(r??e),[,a]=oe.useReducer(u=>u+1,0),o=oe.useCallback(u=>{i.current!==u&&(i.current=u,a())},[i]),s=oe.useRef(null);return e===n&&(s.current&&(clearTimeout(s.current),s.current=null),i.current=n),oe.useEffect(()=>(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{o(e),s.current=null},t),()=>{s.current&&clearTimeout(s.current)}),[e,t,n]),[i.current,o]};function rh(){return document.createElement("canvas")}const D7=e=>e.indexOf("data:image/svg+xml")>=0||e.indexOf(".svg")>=0,Qb=e=>{const[t,n]=oe.useState(e);return oe.useEffect(()=>{(async()=>{const r=await(async function(i){if(!D7(i))return i;const a=await Gp(i),o=gy(a);return Mf(o)})(e);r!==t&&n(r)})()},[e]),t};function Jb(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}const yL={boundBoxFunc:(e,t)=>t.width<5||t.height<5?e:t,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2},bL={boundBoxFunc:(e,t)=>t.width<5||t.height<5?e:t,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2},e3=(e,t,n)=>Math.max(t,Math.min(n,e)),wL=(e,t,n,r,i=0,a=!1,o=!0)=>{const s=Math.floor(e3(e.a.width*r,1,1e4)),u=Math.floor(e3(e.a.height*r,1,1e4)),h=Math.min(i*r,s/2,u/2),c=Math.max(e.a.width/n.width,e.a.height/n.height)*r,m=e.page._exportingOrRendering&&Ir.imageDownScalingEnabled&&c<1&&!a,g=n.x===0&&n.y===0&&n.width===t?.width&&n.height===t?.height,d=oe.useMemo(()=>{if(t&&t.width&&t.height)return g&&h===0&&!m?void 0:rh()},[t,h,m,g]);return oe.useLayoutEffect(()=>{if(!d||!t)return;vy(d,s,u);const y=d.getContext("2d");if(!y)return;h&&(y.beginPath(),y.moveTo(h,0),y.lineTo(s-h,0),y.arc(s-h,h,h,3*Math.PI/2,0,!1),y.lineTo(s,u-h),y.arc(s-h,u-h,h,0,Math.PI/2,!1),y.lineTo(h,u),y.arc(h,u-h,h,Math.PI/2,Math.PI,!1),y.lineTo(0,h),y.arc(h,h,h,Math.PI,3*Math.PI/2,!1),y.clip());const _=m?(function(b,S){var k,E;const A=rh();A.width=b.width,A.height=b.height;const R=Math.max(1,Math.floor(A.width*S)),O=Math.max(1,Math.floor(A.height*S));(k=A.getContext("2d"))===null||k===void 0||k.drawImage(b,0,0,A.width,A.height);const I=(function(j,D,C,N,$,G,te){for(var se=new ImageData(D,C),ee=new Int32Array(j.data.buffer),Q=j.width,re=new Int32Array(se.data.buffer),X=se.width,B=D/G,F=C/te,z=Math.round(1/B),Y=Math.round(1/F),J=z*Y,K=0;K<se.height;K++)for(var ie=0;ie<X;ie++){for(var fe=0+Math.round(ie/B)+(0+Math.round(K/F))*Q,ue=0,_e=0,Ce=0,$e=0,ze=0;ze<Y;ze++)for(var tt=0;tt<z;tt++){var pe=ee[fe+tt+ze*Q];ue+=pe<<24>>>24,_e+=pe<<16>>>24,Ce+=pe<<8>>>24,$e+=pe>>>24}ue=Math.round(ue/J),_e=Math.round(_e/J),Ce=Math.round(Ce/J),$e=Math.round($e/J),re[ie+K*X]=$e<<24|Ce<<16|_e<<8|ue}return se})(A.getContext("2d").getImageData(0,0,A.width,A.height),R,O,0,0,A.width,A.height);return A.width=R,A.height=O,(E=A.getContext("2d"))===null||E===void 0||E.putImageData(I,0,0),A})(t,c):t,x=m?{x:Math.floor(n.x*c),y:Math.floor(n.y*c),width:Math.floor(n.width*c),height:Math.floor(n.height*c)}:n;y.drawImage(_,x.x,x.y,x.width,x.height,0,0,d.width,d.height)},[d,e.a.width,e.a.height,n.x,n.y,n.width,n.height,i,r,a,e.page._exportingOrRendering,m]),oe.useEffect(()=>()=>{d&&d.nodeName==="CANVAS"&&un.Util.releaseCanvas(d)},[d]),d||t},xL=rh(),_L=Qr(({element:e})=>{const t=Math.min(30,e.a.width/4,e.a.height/4),n=oe.useRef(null);return oe.useEffect(()=>{const r=n.current;if(!r)return;const i=new un.Animation(a=>{r.rotate((a?.timeDiff||0)/2)},r.getLayer());return i.start(),()=>{i.stop()}}),oe.createElement(hr,{x:e.x,y:e.y,rotation:e.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},oe.createElement(Pr,{width:e.a.width,height:e.a.height,fill:"rgba(124, 173, 212, 0.8)"}),oe.createElement(sy,{ref:n,x:e.a.width/2,y:e.a.height/2,fill:"white",outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270}))}),SL=Qr(({element:e})=>{const t=Math.max(10,Math.min(30,e.a.width/25));return oe.createElement(hr,{x:e.x,y:e.y,rotation:e.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},oe.createElement(Pr,{width:e.a.width,height:e.a.height,fill:"rgba(223, 102, 102, 0.8)"}),oe.createElement(Uu,{text:"Can not load the image...",fontSize:t,width:e.a.width,height:e.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let g2=ly;const mp=(e,t="",n="")=>{const r=oe.useRef(),i=()=>{var a;(a=r.current)===null||a===void 0||a.call(r),r.current=void 0};oe.useEffect(()=>i,[]),oe.useLayoutEffect(()=>{const a=t.slice(0,200),o=`image with id ${n} url: ${a}`;e!=="loading"||r.current||(r.current=dh(o)),e!=="loading"&&i(),e==="failed"&&$p(o)},[e])},t3=Qr(({element:e,store:t})=>{var n;const[r,i]=oe.useState(!1),a=oe.useRef(null),o=oe.useRef(null),s=t.selectedShapes.indexOf(e)>=0&&e.selectable,[u,h]=(be=>{const[ge,xe]=oe.useReducer(we=>we+1,0),Te=oe.useRef("loading"),Me=oe.useRef(be.src),ve=oe.useRef(be.src);ve.current!==be.src&&(ve.current=be.src,Te.current="loading");const ye=oe.useMemo(()=>D7(be.src)||be.type==="svg",[be.src,be.type]);return oe.useEffect(()=>{if(!ye||!be.src)return;let we=!1;return(async()=>{Te.current="loading",xe();const je=await Gp(be.src),Le=gy(je);let Ye;Ye=be.colorsReplace?my(Le,be.colorsReplace||new Map):Mf(Le),we||(Me.current=Ye,Te.current="loaded",xe())})(),()=>{we=!0}},[be.src,JSON.stringify(be.colorsReplace)]),ye?[Me.current,Te.current]:[be.src,"loaded"]})(e),[c,m]=g2(u,"anonymous"),g=e.type!=="svg"||h==="loaded"?m:"loading";mp(g,e.src,e.id);const d=e.page._exportingOrRendering?1:Math.max(1,t.scale),y=t._elementsPixelRatio*d,_=(({image:be,status:ge,type:xe})=>{const Te=oe.useRef();return oe.useEffect(()=>{Te.current=be||Te.current},[be]),ge!=="failed"||ge!=="failed"&&xe==="svg"?Te.current:void 0})({image:c,status:m,type:e.type}),x=((be,ge,xe)=>{const Te=oe.useMemo(()=>{var Me,ve;const{flipX:ye,flipY:we}=be,je=be.type==="svg"||be.src.indexOf("data:image/svg+xml")>=0||be.src.indexOf(".svg")>=0,Le=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,Ye=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||Le)&&je||be.maskSrc;if(!ye&&!we&&!Ye)return ge;if(!ge||!ge.width||!ge.height)return null;const lt=rh();let rt=1;be.type==="svg"&&(rt=Math.max(be.a.width/ge.width*xe,be.a.height/ge.height*xe)),vy(lt,Math.max(ge.width*rt,1),Math.max(ge.height*rt,1));let ot=ye?-lt.width:0,dt=we?-lt.height:0;return(Me=lt.getContext("2d"))===null||Me===void 0||Me.scale(ye?-1:1,we?-1:1),(ve=lt.getContext("2d"))===null||ve===void 0||ve.drawImage(ge,ot,dt,lt.width,lt.height),lt},[be.maskSrc,be.flipX,be.flipY,ge,be.a.width,be.a.height,xe]);return oe.useEffect(()=>()=>{Te&&Te.nodeName==="CANVAS"&&un.Util.releaseCanvas(Te)},[Te]),Te})(e,c||_,y),b=((be,ge)=>{const xe=Qb(be.maskSrc||""),[Te,Me]=g2(xe,"anonymous");return mp(xe?Me:"loaded",xe||"",be.id),oe.useMemo(()=>{if(!Te||!ge||!ge.width||!ge.height)return ge;const ve=rh();ve.width=Math.max(ge.width,1),ve.height=Math.max(ge.height,1);const ye=ve.getContext("2d");if(!ye)return ge;ye.drawImage(ge,0,0),ye.globalCompositeOperation="source-in";const we=(function(je,Le){const Ye=Le.width/Le.height;let lt,rt;return Ye>=je.width/je.height?(lt=je.width,rt=je.width/Ye):(lt=je.height*Ye,rt=je.height),{x:(je.width-lt)/2,y:(je.height-rt)/2,width:lt,height:rt}})(Te,be);return ye.drawImage(Te,we.x,we.y,we.width,we.height,0,0,ge.width,ge.height),ve},[ge,Te,be.a.width,be.a.height])})(e,x)||xL;let{cropX:S,cropY:k,cropWidth:E,cropHeight:A}=e.a;m!=="loaded"&&(S=k=0,E=A=1);const R=b.width*E,O=b.height*A,I=e.a.width/e.a.height;let j,D;const C=R/O,N=e.stretchEnabled;N?(j=R,D=O):I>=C?(j=R,D=R/I):(j=O*I,D=O);const $={x:b.width*S,y:b.height*k,width:j,height:D},G=(n=e.cornerRadius)!==null&&n!==void 0?n:0,te=e.page._exportingOrRendering?1:Math.min(2,t.scale),se=t._elementsPixelRatio*te;let ee=((be,ge,xe,Te)=>{const Me=Qb(be.clipSrc||""),[ve,ye]=g2(Me,"anonymous"),we=be.clipSrc?ye:"loaded";mp(we,be.clipSrc,be.id);const je=oe.useMemo(()=>{if(ge&&ve)return rh()},[ge,ve]);return oe.useLayoutEffect(()=>{var Le;if(!ve||!ge||!ge.width||!ge.height||!ve||!ve.width||!ve.height||!je)return;const Ye=rh(),lt=Math.max(be.a.width/ve.width*xe,be.a.height/ve.height*xe);Ye.width=Math.max(ve.width*lt,1),Ye.height=Math.max(ve.height*lt,1),(Le=Ye.getContext("2d"))===null||Le===void 0||Le.drawImage(ve,0,0,Ye.width,Ye.height),je.width=Math.max(ge.width,1),je.height=Math.max(ge.height,1);const rt=je.getContext("2d");rt&&(rt.save(),rt.drawImage(Ye,0,0,ge.width,ge.height),un.Util.releaseCanvas(Ye),rt.globalCompositeOperation="source-in",rt.drawImage(ge,0,0,je.width,je.height),rt.restore())},[je,ge,ve,be.a.width,be.a.height,xe,...Te]),be.clipSrc&&ve?je:ge})(e,wL(e,b,$,se,G,r||e._cropModeEnabled||e.type==="svg",!0),se,[$,G,se]);const Q=Math.max(e.a.width/j,e.a.height/D);oe.useEffect(()=>{var be;if(!e._cropModeEnabled)return;const ge=(be=a.current)===null||be===void 0?void 0:be.getStage();function xe(Me){e._cropModeEnabled&&Me.target!==o.current&&e.toggleCropMode(!1)}function Te(Me){e._cropModeEnabled&&Me.target.parentNode!==ge.content&&e.toggleCropMode(!1)}return document.body.addEventListener("click",Te),ge?.on("click",xe),ge?.on("tap",xe),()=>{document.body.removeEventListener("click",Te),document.body.removeEventListener("touchstart",Te),ge?.off("click",xe),ge?.off("click",xe)}},[e._cropModeEnabled]),oe.useLayoutEffect(()=>{if(!r&&!e._cropModeEnabled)return Rs(a.current,e),$u(()=>{Rs(a.current,e)},{delay:100})},[ee,e.page._exportingOrRendering,r,E,A,e._cropModeEnabled]),oe.useLayoutEffect(()=>{var be;r||e._cropModeEnabled?(be=a.current)===null||be===void 0||be.clearCache():Rs(a.current,e)},[r,e.a.width,e.a.height,e._cropModeEnabled]),oe.useEffect(()=>{Rs(a.current,e)},[e.shadowEnabled,e.shadowBlur,e.cornerRadius,e.shadowColor,e.shadowOffsetX,e.shadowOffsetY,e.shadowOpacity]);const re=oe.useRef(null),X=oe.useRef(null),B=oe.useRef(null);oe.useLayoutEffect(()=>{e._cropModeEnabled&&(X.current.nodes([re.current]),B.current.nodes([o.current]))},[e._cropModeEnabled]);var F=oe.useRef(null),z=oe.useRef(0),Y=oe.useRef(!1);const J=be=>{var ge;((ge=be.evt.touches)===null||ge===void 0?void 0:ge.length)>2&&be.target.stopDrag(),Math.round(be.target.x())>0&&(be.target.x(0),be.target.scaleX(1)),Math.round(be.target.y())>0&&(be.target.y(0),be.target.scaleY(1));const xe=be.target.width()*be.target.scaleX(),Te=be.target.height()*be.target.scaleY(),Me=Math.min(1,j/xe),ve=Math.min(1,D/Te),ye=1-Me,we=Math.min(ye,Math.max(0,Math.round(-be.target.x())/xe)),je=1-ve,Le=Math.min(je,Math.max(0,Math.round(-be.target.y())/Te));be.target.setAttrs({x:-we*b.width,y:-Le*b.height,scaleX:1,scaleY:1}),e.set({cropX:we,cropY:Le,cropWidth:Me,cropHeight:ve})},K=()=>{e.type!=="svg"&&e.contentEditable&&(e.stretchEnabled||setTimeout(()=>{e.toggleCropMode(!0)}))},ie=e.type==="svg"&&_,fe=m==="loading"&&!ie,[ue]=kv(fe,100,!1,!1),_e=m==="failed",Ce=!ue&&!_e,$e=oe.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),ze=Ce?e.a.opacity:0;qp(a,ze);const tt=e.selectable||t.role==="admin",pe=Tf(),ut=Gu(e,e.borderColor,"stroke");return oe.createElement(oe.Fragment,null,ue&&oe.createElement(_L,{element:e}),_e&&oe.createElement(SL,{element:e}),oe.createElement(ju,{ref:a,name:"element",id:e.id,image:ee,x:e.a.x,y:e.a.y,width:e.a.width||1,height:e.a.height||1,rotation:e.a.rotation,opacity:ze,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:$,listening:tt,draggable:pe?e.draggable&&s:e.draggable,preventDefault:!pe||s,hideInExport:!e.showInExport,onDragMove:be=>{e.set({x:be.target.x(),y:be.target.y()})},onDragEnd:be=>{e.set({x:be.target.x(),y:be.target.y()})},onDblClick:K,onDblTap:K,onTransformStart:()=>{i(!0),$e.current={cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight}},onTransform:be=>{var ge;const xe=be.currentTarget,Te=Math.abs(xe.scaleX()-1)<1e-7?1:xe.scaleX(),Me=Math.abs(xe.scaleY()-1)<1e-7?1:xe.scaleY();xe.scaleX(1),xe.scaleY(1);const ve=(ge=be.target.getStage())===null||ge===void 0?void 0:ge.findOne("Transformer"),ye=1-j/b.width,we=Math.min(ye,Math.max(0,e.cropX)),je=1-D/b.height,Le=Math.min(je,Math.max(0,e.cropY)),Ye=ve.getActiveAnchor(),lt=!(Ye.indexOf("middle")>=0||Ye.indexOf("center")>=0),rt=!lt&&Te<1&&$e.current.cropHeight>D/b.height;let ot=lt?e.cropWidth:e.cropWidth*Te;rt&&(ot=e.cropWidth);const dt=!lt&&Me<1&&$e.current.cropWidth>j/b.width;let Ct=lt?e.cropHeight:e.cropHeight*Me;dt&&(Ct=e.cropHeight),N&&(ot=e.cropWidth,Ct=e.cropHeight),e.set({cropX:we,cropY:Le,x:xe.x(),y:xe.y(),width:xe.width()*Te,height:xe.height()*Me,rotation:be.target.rotation(),cropWidth:Math.min(ot,1-we),cropHeight:Math.min(Ct,1-Le)})},onTransformEnd:be=>{const ge=be.currentTarget;e.set({width:ge.width(),height:ge.height(),x:ge.x(),y:ge.y(),rotation:be.target.rotation(),cropWidth:j/b.width,cropHeight:D/b.height}),i(!1)}}),oe.createElement(Pr,Object.assign({x:e.x,y:e.y,width:Math.max(e.a.width-e.borderSize,0),height:Math.max(e.a.height-e.borderSize,0),opacity:ze,offsetX:-e.borderSize/2,offsetY:-e.borderSize/2},ut,{strokeWidth:e.borderSize,listening:!1,visible:!!e.borderSize,rotation:e.rotation,cornerRadius:Math.max(0,G-e.borderSize),hideInExport:!e.showInExport})),e._cropModeEnabled&&oe.createElement(uy,{selector:".page-abs-container",enabled:!0},oe.createElement(Pr,{x:-window.innerWidth/t.scale,y:-window.innerWidth/t.scale,width:window.innerWidth/t.scale*3,height:window.innerWidth/t.scale*3,fill:"rgba(0,0,0,0.3)"}),oe.createElement(ju,{listening:!1,image:ee,x:e.x,y:e.y,width:e.a.width,height:e.a.height,rotation:e.rotation,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur}),oe.createElement(hr,{x:e.x,y:e.y,rotation:e.rotation,scaleX:Q,scaleY:Q},oe.createElement(ju,{image:b,ref:o,opacity:.4,draggable:!0,x:-e.cropX*b.width,y:-e.cropY*b.height,onDragMove:J,onTransform:J,onTouchMove:be=>{be.evt.preventDefault();const ge=be.target.getStage().getPointersPositions();var xe=ge[0],Te=ge[1];const Me=be.target;if(xe&&!Te&&!Me.isDragging()&&Y.current&&(Me.startDrag(),Y.current=!1),xe&&Te){un.hitOnDragEnabled=!0,Me.isDragging()&&(Y.current=!0,Me.stopDrag());const dt=be.target.getAbsoluteTransform().copy();dt.invert();var ve={x:xe.x,y:xe.y},ye={x:Te.x,y:Te.y};if(!F.current)return void(F.current=Jb(ve,ye));var we=Jb(ve,ye),je=(function(an,We){return Math.sqrt(Math.pow(We.x-an.x,2)+Math.pow(We.y-an.y,2))})(ve,ye);z.current||(z.current=je);const Ct=Me.position();var Le={x:we.x-Ct.x,y:we.y-Ct.y},Ye=je/z.current;Me.scaleX(Ye),Me.scaleY(Ye);const Zt=dt.point(we),on=dt.point(F.current);var lt=Zt.x-on.x,rt=Zt.y-on.y,ot={x:Math.min(0,we.x-Le.x*Ye+lt),y:Math.min(0,we.y-Le.y*Ye+rt)};Me.position(ot),z.current=je,F.current=we,J(be)}},onTouchEnd:be=>{z.current=0,F.current=null,un.hitOnDragEnabled=!1}}),oe.createElement(kp,Object.assign({ref:B},bL)),oe.createElement(Pr,{width:j,height:D,ref:re,listening:!1,onTransform:be=>{if(e.cropX<Math.abs(be.target.x()/b.width)&&be.target.x()<0&&e.cropX>0){const je=(e.cropWidth+e.cropX)*b.width;be.target.scaleX(1),be.target.width(je)}if(e.cropY<Math.abs(be.target.y()/b.height)&&be.target.y()<0&&e.cropY>0){const je=(e.cropHeight+e.cropY)*b.height;be.target.scaleY(1),be.target.height(je)}be.target.x()<-e.cropX*b.width-1e-9&&(be.target.x(-e.cropX*b.width),be.target.scaleX(1)),be.target.y()<-e.cropY*b.height-1e-9&&(be.target.y(-e.cropY*b.height),be.target.scaleY(1));const ge=Math.min(1,Math.max(0,e.cropX+be.target.x()/b.width)),xe=Math.min(1,Math.max(0,be.target.y()/b.height+e.cropY)),Te=be.target.width()*be.target.scaleX(),Me=be.target.height()*be.target.scaleY(),ve=Math.min(1-ge,Te/b.width),ye=Math.min(1-xe,Me/b.height),we=be.target.getAbsolutePosition(be.target.getParent().getParent());be.target.scale({x:1,y:1}),be.target.position({x:0,y:0}),e.set({x:we.x,y:we.y,cropX:ge,cropY:xe,cropWidth:ve,cropHeight:ye,width:Math.min(Te*Q,b.width*(1-ge)*Q),height:Math.min(Me*Q,b.height*(1-xe)*Q)})}}),oe.createElement(kp,Object.assign({ref:X},yL,{visible:e.resizable})))))});var r0={exports:{}};var EL=r0.exports,n3;function kL(){return n3||(n3=1,(function(e,t){(function(r,i){e.exports=i()})(typeof self<"u"?self:EL,function(){return(function(n){var r={};function i(a){if(r[a])return r[a].exports;var o=r[a]={i:a,l:!1,exports:{}};return n[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=n,i.c=r,i.d=function(a,o,s){i.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:s})},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},i.p="",i(i.s=109)})([(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(17),o=i(18),s=i(19),u=i(45),h=i(46),c=i(47),m=i(48),g=i(49),d=i(12),y=i(32),_=i(33),x=i(31),b=i(1),S={Scope:b.Scope,create:b.create,find:b.find,query:b.query,register:b.register,Container:a.default,Format:o.default,Leaf:s.default,Embed:m.default,Scroll:u.default,Block:c.default,Inline:h.default,Text:g.default,Attributor:{Attribute:d.default,Class:y.default,Style:_.default,Store:x.default}};r.default=S}),(function(n,r,i){var a=this&&this.__extends||(function(){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,S){b.__proto__=S}||function(b,S){for(var k in S)S.hasOwnProperty(k)&&(b[k]=S[k])};return function(b,S){x(b,S);function k(){this.constructor=b}b.prototype=S===null?Object.create(S):(k.prototype=S.prototype,new k)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=(function(x){a(b,x);function b(S){var k=this;return S="[Parchment] "+S,k=x.call(this,S)||this,k.message=S,k.name=k.constructor.name,k}return b})(Error);r.ParchmentError=o;var s={},u={},h={},c={};r.DATA_KEY="__blot";var m;(function(x){x[x.TYPE=3]="TYPE",x[x.LEVEL=12]="LEVEL",x[x.ATTRIBUTE=13]="ATTRIBUTE",x[x.BLOT=14]="BLOT",x[x.INLINE=7]="INLINE",x[x.BLOCK=11]="BLOCK",x[x.BLOCK_BLOT=10]="BLOCK_BLOT",x[x.INLINE_BLOT=6]="INLINE_BLOT",x[x.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",x[x.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",x[x.ANY=15]="ANY"})(m=r.Scope||(r.Scope={}));function g(x,b){var S=y(x);if(S==null)throw new o("Unable to create "+x+" blot");var k=S,E=x instanceof Node||x.nodeType===Node.TEXT_NODE?x:k.create(b);return new k(E,b)}r.create=g;function d(x,b){return b===void 0&&(b=!1),x==null?null:x[r.DATA_KEY]!=null?x[r.DATA_KEY].blot:b?d(x.parentNode,b):null}r.find=d;function y(x,b){b===void 0&&(b=m.ANY);var S;if(typeof x=="string")S=c[x]||s[x];else if(x instanceof Text||x.nodeType===Node.TEXT_NODE)S=c.text;else if(typeof x=="number")x&m.LEVEL&m.BLOCK?S=c.block:x&m.LEVEL&m.INLINE&&(S=c.inline);else if(x instanceof HTMLElement){var k=(x.getAttribute("class")||"").split(/\s+/);for(var E in k)if(S=u[k[E]],S)break;S=S||h[x.tagName]}return S==null?null:b&m.LEVEL&S.scope&&b&m.TYPE&S.scope?S:null}r.query=y;function _(){for(var x=[],b=0;b<arguments.length;b++)x[b]=arguments[b];if(x.length>1)return x.map(function(E){return _(E)});var S=x[0];if(typeof S.blotName!="string"&&typeof S.attrName!="string")throw new o("Invalid definition");if(S.blotName==="abstract")throw new o("Cannot register abstract class");if(c[S.blotName||S.attrName]=S,typeof S.keyName=="string")s[S.keyName]=S;else if(S.className!=null&&(u[S.className]=S),S.tagName!=null){Array.isArray(S.tagName)?S.tagName=S.tagName.map(function(E){return E.toUpperCase()}):S.tagName=S.tagName.toUpperCase();var k=Array.isArray(S.tagName)?S.tagName:[S.tagName];k.forEach(function(E){(h[E]==null||S.className==null)&&(h[E]=S)})}return S}r.register=_}),(function(n,r,i){var a=i(51),o=i(11),s=i(3),u=i(20),h="\0",c=function(m){Array.isArray(m)?this.ops=m:m!=null&&Array.isArray(m.ops)?this.ops=m.ops:this.ops=[]};c.prototype.insert=function(m,g){var d={};return m.length===0?this:(d.insert=m,g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(d.attributes=g),this.push(d))},c.prototype.delete=function(m){return m<=0?this:this.push({delete:m})},c.prototype.retain=function(m,g){if(m<=0)return this;var d={retain:m};return g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(d.attributes=g),this.push(d)},c.prototype.push=function(m){var g=this.ops.length,d=this.ops[g-1];if(m=s(!0,{},m),typeof d=="object"){if(typeof m.delete=="number"&&typeof d.delete=="number")return this.ops[g-1]={delete:d.delete+m.delete},this;if(typeof d.delete=="number"&&m.insert!=null&&(g-=1,d=this.ops[g-1],typeof d!="object"))return this.ops.unshift(m),this;if(o(m.attributes,d.attributes)){if(typeof m.insert=="string"&&typeof d.insert=="string")return this.ops[g-1]={insert:d.insert+m.insert},typeof m.attributes=="object"&&(this.ops[g-1].attributes=m.attributes),this;if(typeof m.retain=="number"&&typeof d.retain=="number")return this.ops[g-1]={retain:d.retain+m.retain},typeof m.attributes=="object"&&(this.ops[g-1].attributes=m.attributes),this}}return g===this.ops.length?this.ops.push(m):this.ops.splice(g,0,m),this},c.prototype.chop=function(){var m=this.ops[this.ops.length-1];return m&&m.retain&&!m.attributes&&this.ops.pop(),this},c.prototype.filter=function(m){return this.ops.filter(m)},c.prototype.forEach=function(m){this.ops.forEach(m)},c.prototype.map=function(m){return this.ops.map(m)},c.prototype.partition=function(m){var g=[],d=[];return this.forEach(function(y){var _=m(y)?g:d;_.push(y)}),[g,d]},c.prototype.reduce=function(m,g){return this.ops.reduce(m,g)},c.prototype.changeLength=function(){return this.reduce(function(m,g){return g.insert?m+u.length(g):g.delete?m-g.delete:m},0)},c.prototype.length=function(){return this.reduce(function(m,g){return m+u.length(g)},0)},c.prototype.slice=function(m,g){m=m||0,typeof g!="number"&&(g=1/0);for(var d=[],y=u.iterator(this.ops),_=0;_<g&&y.hasNext();){var x;_<m?x=y.next(m-_):(x=y.next(g-_),d.push(x)),_+=u.length(x)}return new c(d)},c.prototype.compose=function(m){var g=u.iterator(this.ops),d=u.iterator(m.ops),y=[],_=d.peek();if(_!=null&&typeof _.retain=="number"&&_.attributes==null){for(var x=_.retain;g.peekType()==="insert"&&g.peekLength()<=x;)x-=g.peekLength(),y.push(g.next());_.retain-x>0&&d.next(_.retain-x)}for(var b=new c(y);g.hasNext()||d.hasNext();)if(d.peekType()==="insert")b.push(d.next());else if(g.peekType()==="delete")b.push(g.next());else{var S=Math.min(g.peekLength(),d.peekLength()),k=g.next(S),E=d.next(S);if(typeof E.retain=="number"){var A={};typeof k.retain=="number"?A.retain=S:A.insert=k.insert;var R=u.attributes.compose(k.attributes,E.attributes,typeof k.retain=="number");if(R&&(A.attributes=R),b.push(A),!d.hasNext()&&o(b.ops[b.ops.length-1],A)){var O=new c(g.rest());return b.concat(O).chop()}}else typeof E.delete=="number"&&typeof k.retain=="number"&&b.push(E)}return b.chop()},c.prototype.concat=function(m){var g=new c(this.ops.slice());return m.ops.length>0&&(g.push(m.ops[0]),g.ops=g.ops.concat(m.ops.slice(1))),g},c.prototype.diff=function(m,g){if(this.ops===m.ops)return new c;var d=[this,m].map(function(S){return S.map(function(k){if(k.insert!=null)return typeof k.insert=="string"?k.insert:h;var E=S===m?"on":"with";throw new Error("diff() called "+E+" non-document")}).join("")}),y=new c,_=a(d[0],d[1],g),x=u.iterator(this.ops),b=u.iterator(m.ops);return _.forEach(function(S){for(var k=S[1].length;k>0;){var E=0;switch(S[0]){case a.INSERT:E=Math.min(b.peekLength(),k),y.push(b.next(E));break;case a.DELETE:E=Math.min(k,x.peekLength()),x.next(E),y.delete(E);break;case a.EQUAL:E=Math.min(x.peekLength(),b.peekLength(),k);var A=x.next(E),R=b.next(E);o(A.insert,R.insert)?y.retain(E,u.attributes.diff(A.attributes,R.attributes)):y.push(R).delete(E);break}k-=E}}),y.chop()},c.prototype.eachLine=function(m,g){g=g||`
|
|
106
|
+
`;for(var d=u.iterator(this.ops),y=new c,_=0;d.hasNext();){if(d.peekType()!=="insert")return;var x=d.peek(),b=u.length(x)-d.peekLength(),S=typeof x.insert=="string"?x.insert.indexOf(g,b)-b:-1;if(S<0)y.push(d.next());else if(S>0)y.push(d.next(S));else{if(m(y,d.next(1).attributes||{},_)===!1)return;_+=1,y=new c}}y.length()>0&&m(y,{},_)},c.prototype.transform=function(m,g){if(g=!!g,typeof m=="number")return this.transformPosition(m,g);for(var d=u.iterator(this.ops),y=u.iterator(m.ops),_=new c;d.hasNext()||y.hasNext();)if(d.peekType()==="insert"&&(g||y.peekType()!=="insert"))_.retain(u.length(d.next()));else if(y.peekType()==="insert")_.push(y.next());else{var x=Math.min(d.peekLength(),y.peekLength()),b=d.next(x),S=y.next(x);if(b.delete)continue;S.delete?_.push(S):_.retain(x,u.attributes.transform(b.attributes,S.attributes,g))}return _.chop()},c.prototype.transformPosition=function(m,g){g=!!g;for(var d=u.iterator(this.ops),y=0;d.hasNext()&&y<=m;){var _=d.peekLength(),x=d.peekType();if(d.next(),x==="delete"){m-=Math.min(_,m-y);continue}else x==="insert"&&(y<m||!g)&&(m+=_);y+=_}return m},n.exports=c}),(function(n,r){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u=function(d){return typeof Array.isArray=="function"?Array.isArray(d):a.call(d)==="[object Array]"},h=function(d){if(!d||a.call(d)!=="[object Object]")return!1;var y=i.call(d,"constructor"),_=d.constructor&&d.constructor.prototype&&i.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!y&&!_)return!1;var x;for(x in d);return typeof x>"u"||i.call(d,x)},c=function(d,y){o&&y.name==="__proto__"?o(d,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):d[y.name]=y.newValue},m=function(d,y){if(y==="__proto__")if(i.call(d,y)){if(s)return s(d,y).value}else return;return d[y]};n.exports=function g(){var d,y,_,x,b,S,k=arguments[0],E=1,A=arguments.length,R=!1;for(typeof k=="boolean"&&(R=k,k=arguments[1]||{},E=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});E<A;++E)if(d=arguments[E],d!=null)for(y in d)_=m(k,y),x=m(d,y),k!==x&&(R&&x&&(h(x)||(b=u(x)))?(b?(b=!1,S=_&&u(_)?_:[]):S=_&&h(_)?_:{},c(k,{name:y,newValue:g(R,S,x)})):typeof x<"u"&&c(k,{name:y,newValue:x}));return k}}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BlockEmbed=r.bubbleFormats=void 0;var a=(function(){function C(N,$){for(var G=0;G<$.length;G++){var te=$[G];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(N,te.key,te)}}return function(N,$,G){return $&&C(N.prototype,$),G&&C(N,G),N}})(),o=function C(N,$,G){N===null&&(N=Function.prototype);var te=Object.getOwnPropertyDescriptor(N,$);if(te===void 0){var se=Object.getPrototypeOf(N);return se===null?void 0:C(se,$,G)}else{if("value"in te)return te.value;var ee=te.get;return ee===void 0?void 0:ee.call(G)}},s=i(3),u=k(s),h=i(2),c=k(h),m=i(0),g=k(m),d=i(16),y=k(d),_=i(6),x=k(_),b=i(7),S=k(b);function k(C){return C&&C.__esModule?C:{default:C}}function E(C,N){if(!(C instanceof N))throw new TypeError("Cannot call a class as a function")}function A(C,N){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N&&(typeof N=="object"||typeof N=="function")?N:C}function R(C,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);C.prototype=Object.create(N&&N.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(C,N):C.__proto__=N)}var O=1,I=(function(C){R(N,C);function N(){return E(this,N),A(this,(N.__proto__||Object.getPrototypeOf(N)).apply(this,arguments))}return a(N,[{key:"attach",value:function(){o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"attach",this).call(this),this.attributes=new g.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new c.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(G,te){var se=g.default.query(G,g.default.Scope.BLOCK_ATTRIBUTE);se!=null&&this.attributes.attribute(se,te)}},{key:"formatAt",value:function(G,te,se,ee){this.format(se,ee)}},{key:"insertAt",value:function(G,te,se){if(typeof te=="string"&&te.endsWith(`
|
|
107
|
+
`)){var ee=g.default.create(j.blotName);this.parent.insertBefore(ee,G===0?this:this.next),ee.insertAt(0,te.slice(0,-1))}else o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"insertAt",this).call(this,G,te,se)}}]),N})(g.default.Embed);I.scope=g.default.Scope.BLOCK_BLOT;var j=(function(C){R(N,C);function N($){E(this,N);var G=A(this,(N.__proto__||Object.getPrototypeOf(N)).call(this,$));return G.cache={},G}return a(N,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(g.default.Leaf).reduce(function(G,te){return te.length()===0?G:G.insert(te.value(),D(te))},new c.default).insert(`
|
|
108
|
+
`,D(this))),this.cache.delta}},{key:"deleteAt",value:function(G,te){o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"deleteAt",this).call(this,G,te),this.cache={}}},{key:"formatAt",value:function(G,te,se,ee){te<=0||(g.default.query(se,g.default.Scope.BLOCK)?G+te===this.length()&&this.format(se,ee):o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"formatAt",this).call(this,G,Math.min(te,this.length()-G-1),se,ee),this.cache={})}},{key:"insertAt",value:function(G,te,se){if(se!=null)return o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"insertAt",this).call(this,G,te,se);if(te.length!==0){var ee=te.split(`
|
|
109
|
+
`),Q=ee.shift();Q.length>0&&(G<this.length()-1||this.children.tail==null?o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"insertAt",this).call(this,Math.min(G,this.length()-1),Q):this.children.tail.insertAt(this.children.tail.length(),Q),this.cache={});var re=this;ee.reduce(function(X,B){return re=re.split(X,!0),re.insertAt(0,B),B.length},G+Q.length)}}},{key:"insertBefore",value:function(G,te){var se=this.children.head;o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"insertBefore",this).call(this,G,te),se instanceof y.default&&se.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"length",this).call(this)+O),this.cache.length}},{key:"moveChildren",value:function(G,te){o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"moveChildren",this).call(this,G,te),this.cache={}}},{key:"optimize",value:function(G){o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"optimize",this).call(this,G),this.cache={}}},{key:"path",value:function(G){return o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"path",this).call(this,G,!0)}},{key:"removeChild",value:function(G){o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"removeChild",this).call(this,G),this.cache={}}},{key:"split",value:function(G){var te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(te&&(G===0||G>=this.length()-O)){var se=this.clone();return G===0?(this.parent.insertBefore(se,this),this):(this.parent.insertBefore(se,this.next),se)}else{var ee=o(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"split",this).call(this,G,te);return this.cache={},ee}}}]),N})(g.default.Block);j.blotName="block",j.tagName="P",j.defaultChild="break",j.allowedChildren=[x.default,g.default.Embed,S.default];function D(C){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return C==null||(typeof C.formats=="function"&&(N=(0,u.default)(N,C.formats())),C.parent==null||C.parent.blotName=="scroll"||C.parent.statics.scope!==C.statics.scope)?N:D(C.parent,N)}r.bubbleFormats=D,r.BlockEmbed=I,r.default=j}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.overload=r.expandConfig=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(re){return typeof re}:function(re){return re&&typeof Symbol=="function"&&re.constructor===Symbol&&re!==Symbol.prototype?"symbol":typeof re},o=(function(){function re(X,B){var F=[],z=!0,Y=!1,J=void 0;try{for(var K=X[Symbol.iterator](),ie;!(z=(ie=K.next()).done)&&(F.push(ie.value),!(B&&F.length===B));z=!0);}catch(fe){Y=!0,J=fe}finally{try{!z&&K.return&&K.return()}finally{if(Y)throw J}}return F}return function(X,B){if(Array.isArray(X))return X;if(Symbol.iterator in Object(X))return re(X,B);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),s=(function(){function re(X,B){for(var F=0;F<B.length;F++){var z=B[F];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(X,z.key,z)}}return function(X,B,F){return B&&re(X.prototype,B),F&&re(X,F),X}})();i(50);var u=i(2),h=D(u),c=i(14),m=D(c),g=i(8),d=D(g),y=i(9),_=D(y),x=i(0),b=D(x),S=i(15),k=D(S),E=i(3),A=D(E),R=i(10),O=D(R),I=i(34),j=D(I);function D(re){return re&&re.__esModule?re:{default:re}}function C(re,X,B){return X in re?Object.defineProperty(re,X,{value:B,enumerable:!0,configurable:!0,writable:!0}):re[X]=B,re}function N(re,X){if(!(re instanceof X))throw new TypeError("Cannot call a class as a function")}var $=(0,O.default)("quill"),G=(function(){s(re,null,[{key:"debug",value:function(B){B===!0&&(B="log"),O.default.level(B)}},{key:"find",value:function(B){return B.__quill||b.default.find(B)}},{key:"import",value:function(B){return this.imports[B]==null&&$.error("Cannot import "+B+". Are you sure it was registered?"),this.imports[B]}},{key:"register",value:function(B,F){var z=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof B!="string"){var J=B.attrName||B.blotName;typeof J=="string"?this.register("formats/"+J,B,F):Object.keys(B).forEach(function(K){z.register(K,B[K],F)})}else this.imports[B]!=null&&!Y&&$.warn("Overwriting "+B+" with",F),this.imports[B]=F,(B.startsWith("blots/")||B.startsWith("formats/"))&&F.blotName!=="abstract"?b.default.register(F):B.startsWith("modules")&&typeof F.register=="function"&&F.register()}}]);function re(X){var B=this,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(N(this,re),this.options=te(X,F),this.container=this.options.container,this.container==null)return $.error("Invalid Quill container",X);this.options.debug&&re.debug(this.options.debug);var z=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=b.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new m.default(this.scroll),this.selection=new k.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(J){J===d.default.events.TEXT_CHANGE&&B.root.classList.toggle("ql-blank",B.editor.isBlank())}),this.emitter.on(d.default.events.SCROLL_UPDATE,function(J,K){var ie=B.selection.lastRange,fe=ie&&ie.length===0?ie.index:void 0;se.call(B,function(){return B.editor.update(null,K,fe)},J)});var Y=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+z+"<p><br></p></div>");this.setContents(Y),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return s(re,[{key:"addContainer",value:function(B){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof B=="string"){var z=B;B=document.createElement("div"),B.classList.add(z)}return this.container.insertBefore(B,F),B}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(B,F,z){var Y=this,J=ee(B,F,z),K=o(J,4);return B=K[0],F=K[1],z=K[3],se.call(this,function(){return Y.editor.deleteText(B,F)},z,B,-1*F)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(B),this.container.classList.toggle("ql-disabled",!B)}},{key:"focus",value:function(){var B=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=B,this.scrollIntoView()}},{key:"format",value:function(B,F){var z=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:d.default.sources.API;return se.call(this,function(){var J=z.getSelection(!0),K=new h.default;if(J==null)return K;if(b.default.query(B,b.default.Scope.BLOCK))K=z.editor.formatLine(J.index,J.length,C({},B,F));else{if(J.length===0)return z.selection.format(B,F),K;K=z.editor.formatText(J.index,J.length,C({},B,F))}return z.setSelection(J,d.default.sources.SILENT),K},Y)}},{key:"formatLine",value:function(B,F,z,Y,J){var K=this,ie=void 0,fe=ee(B,F,z,Y,J),ue=o(fe,4);return B=ue[0],F=ue[1],ie=ue[2],J=ue[3],se.call(this,function(){return K.editor.formatLine(B,F,ie)},J,B,0)}},{key:"formatText",value:function(B,F,z,Y,J){var K=this,ie=void 0,fe=ee(B,F,z,Y,J),ue=o(fe,4);return B=ue[0],F=ue[1],ie=ue[2],J=ue[3],se.call(this,function(){return K.editor.formatText(B,F,ie)},J,B,0)}},{key:"getBounds",value:function(B){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,z=void 0;typeof B=="number"?z=this.selection.getBounds(B,F):z=this.selection.getBounds(B.index,B.length);var Y=this.container.getBoundingClientRect();return{bottom:z.bottom-Y.top,height:z.height,left:z.left-Y.left,right:z.right-Y.left,top:z.top-Y.top,width:z.width}}},{key:"getContents",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-B,z=ee(B,F),Y=o(z,2);return B=Y[0],F=Y[1],this.editor.getContents(B,F)}},{key:"getFormat",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof B=="number"?this.editor.getFormat(B,F):this.editor.getFormat(B.index,B.length)}},{key:"getIndex",value:function(B){return B.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(B){return this.scroll.leaf(B)}},{key:"getLine",value:function(B){return this.scroll.line(B)}},{key:"getLines",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof B!="number"?this.scroll.lines(B.index,B.length):this.scroll.lines(B,F)}},{key:"getModule",value:function(B){return this.theme.modules[B]}},{key:"getSelection",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return B&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-B,z=ee(B,F),Y=o(z,2);return B=Y[0],F=Y[1],this.editor.getText(B,F)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(B,F,z){var Y=this,J=arguments.length>3&&arguments[3]!==void 0?arguments[3]:re.sources.API;return se.call(this,function(){return Y.editor.insertEmbed(B,F,z)},J,B)}},{key:"insertText",value:function(B,F,z,Y,J){var K=this,ie=void 0,fe=ee(B,0,z,Y,J),ue=o(fe,4);return B=ue[0],ie=ue[2],J=ue[3],se.call(this,function(){return K.editor.insertText(B,F,ie)},J,B,F.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(B,F,z){this.clipboard.dangerouslyPasteHTML(B,F,z)}},{key:"removeFormat",value:function(B,F,z){var Y=this,J=ee(B,F,z),K=o(J,4);return B=K[0],F=K[1],z=K[3],se.call(this,function(){return Y.editor.removeFormat(B,F)},z,B)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(B){var F=this,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API;return se.call(this,function(){B=new h.default(B);var Y=F.getLength(),J=F.editor.deleteText(0,Y),K=F.editor.applyDelta(B),ie=K.ops[K.ops.length-1];ie!=null&&typeof ie.insert=="string"&&ie.insert[ie.insert.length-1]===`
|
|
110
|
+
`&&(F.editor.deleteText(F.getLength()-1,1),K.delete(1));var fe=J.compose(K);return fe},z)}},{key:"setSelection",value:function(B,F,z){if(B==null)this.selection.setRange(null,F||re.sources.API);else{var Y=ee(B,F,z),J=o(Y,4);B=J[0],F=J[1],z=J[3],this.selection.setRange(new S.Range(B,F),z),z!==d.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(B){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API,z=new h.default().insert(B);return this.setContents(z,F)}},{key:"update",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:d.default.sources.USER,F=this.scroll.update(B);return this.selection.update(B),F}},{key:"updateContents",value:function(B){var F=this,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d.default.sources.API;return se.call(this,function(){return B=new h.default(B),F.editor.applyDelta(B,z)},z,!0)}}]),re})();G.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},G.events=d.default.events,G.sources=d.default.sources,G.version="1.3.7",G.imports={delta:h.default,parchment:b.default,"core/module":_.default,"core/theme":j.default};function te(re,X){if(X=(0,A.default)(!0,{container:re,modules:{clipboard:!0,keyboard:!0,history:!0}},X),!X.theme||X.theme===G.DEFAULTS.theme)X.theme=j.default;else if(X.theme=G.import("themes/"+X.theme),X.theme==null)throw new Error("Invalid theme "+X.theme+". Did you register it?");var B=(0,A.default)(!0,{},X.theme.DEFAULTS);[B,X].forEach(function(Y){Y.modules=Y.modules||{},Object.keys(Y.modules).forEach(function(J){Y.modules[J]===!0&&(Y.modules[J]={})})});var F=Object.keys(B.modules).concat(Object.keys(X.modules)),z=F.reduce(function(Y,J){var K=G.import("modules/"+J);return K==null?$.error("Cannot load "+J+" module. Are you sure you registered it?"):Y[J]=K.DEFAULTS||{},Y},{});return X.modules!=null&&X.modules.toolbar&&X.modules.toolbar.constructor!==Object&&(X.modules.toolbar={container:X.modules.toolbar}),X=(0,A.default)(!0,{},G.DEFAULTS,{modules:z},B,X),["bounds","container","scrollingContainer"].forEach(function(Y){typeof X[Y]=="string"&&(X[Y]=document.querySelector(X[Y]))}),X.modules=Object.keys(X.modules).reduce(function(Y,J){return X.modules[J]&&(Y[J]=X.modules[J]),Y},{}),X}function se(re,X,B,F){if(this.options.strict&&!this.isEnabled()&&X===d.default.sources.USER)return new h.default;var z=B==null?null:this.getSelection(),Y=this.editor.delta,J=re();if(z!=null&&(B===!0&&(B=z.index),F==null?z=Q(z,J,X):F!==0&&(z=Q(z,B,F,X)),this.setSelection(z,d.default.sources.SILENT)),J.length()>0){var K,ie=[d.default.events.TEXT_CHANGE,J,Y,X];if((K=this.emitter).emit.apply(K,[d.default.events.EDITOR_CHANGE].concat(ie)),X!==d.default.sources.SILENT){var fe;(fe=this.emitter).emit.apply(fe,ie)}}return J}function ee(re,X,B,F,z){var Y={};return typeof re.index=="number"&&typeof re.length=="number"?typeof X!="number"?(z=F,F=B,B=X,X=re.length,re=re.index):(X=re.length,re=re.index):typeof X!="number"&&(z=F,F=B,B=X,X=0),(typeof B>"u"?"undefined":a(B))==="object"?(Y=B,z=F):typeof B=="string"&&(F!=null?Y[B]=F:z=B),z=z||d.default.sources.API,[re,X,Y,z]}function Q(re,X,B,F){if(re==null)return null;var z=void 0,Y=void 0;if(X instanceof h.default){var J=[re.index,re.index+re.length].map(function(ue){return X.transformPosition(ue,F!==d.default.sources.USER)}),K=o(J,2);z=K[0],Y=K[1]}else{var ie=[re.index,re.index+re.length].map(function(ue){return ue<X||ue===X&&F===d.default.sources.USER?ue:B>=0?ue+B:Math.max(X,ue+B)}),fe=o(ie,2);z=fe[0],Y=fe[1]}return new S.Range(z,Y-z)}r.expandConfig=te,r.overload=ee,r.default=G}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function x(b,S){for(var k=0;k<S.length;k++){var E=S[k];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(b,E.key,E)}}return function(b,S,k){return S&&x(b.prototype,S),k&&x(b,k),b}})(),o=function x(b,S,k){b===null&&(b=Function.prototype);var E=Object.getOwnPropertyDescriptor(b,S);if(E===void 0){var A=Object.getPrototypeOf(b);return A===null?void 0:x(A,S,k)}else{if("value"in E)return E.value;var R=E.get;return R===void 0?void 0:R.call(k)}},s=i(7),u=m(s),h=i(0),c=m(h);function m(x){return x&&x.__esModule?x:{default:x}}function g(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function d(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function y(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var _=(function(x){y(b,x);function b(){return g(this,b),d(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"formatAt",value:function(k,E,A,R){if(b.compare(this.statics.blotName,A)<0&&c.default.query(A,c.default.Scope.BLOT)){var O=this.isolate(k,E);R&&O.wrap(A,R)}else o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"formatAt",this).call(this,k,E,A,R)}},{key:"optimize",value:function(k){if(o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"optimize",this).call(this,k),this.parent instanceof b&&b.compare(this.statics.blotName,this.parent.statics.blotName)>0){var E=this.parent.isolate(this.offset(),this.length());this.moveChildren(E),E.wrap(this)}}}],[{key:"compare",value:function(k,E){var A=b.order.indexOf(k),R=b.order.indexOf(E);return A>=0||R>=0?A-R:k===E?0:k<E?-1:1}}]),b})(c.default.Inline);_.allowedChildren=[_,c.default.Embed,u.default],_.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],r.default=_}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(0),o=s(a);function s(g){return g&&g.__esModule?g:{default:g}}function u(g,d){if(!(g instanceof d))throw new TypeError("Cannot call a class as a function")}function h(g,d){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:g}function c(g,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);g.prototype=Object.create(d&&d.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(g,d):g.__proto__=d)}var m=(function(g){c(d,g);function d(){return u(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d})(o.default.Text);r.default=m}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function S(k,E){for(var A=0;A<E.length;A++){var R=E[A];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(k,R.key,R)}}return function(k,E,A){return E&&S(k.prototype,E),A&&S(k,A),k}})(),o=function S(k,E,A){k===null&&(k=Function.prototype);var R=Object.getOwnPropertyDescriptor(k,E);if(R===void 0){var O=Object.getPrototypeOf(k);return O===null?void 0:S(O,E,A)}else{if("value"in R)return R.value;var I=R.get;return I===void 0?void 0:I.call(A)}},s=i(54),u=m(s),h=i(10),c=m(h);function m(S){return S&&S.__esModule?S:{default:S}}function g(S,k){if(!(S instanceof k))throw new TypeError("Cannot call a class as a function")}function d(S,k){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:S}function y(S,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);S.prototype=Object.create(k&&k.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(S,k):S.__proto__=k)}var _=(0,c.default)("quill:events"),x=["selectionchange","mousedown","mouseup","click"];x.forEach(function(S){document.addEventListener(S,function(){for(var k=arguments.length,E=Array(k),A=0;A<k;A++)E[A]=arguments[A];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(R){if(R.__quill&&R.__quill.emitter){var O;(O=R.__quill.emitter).handleDOM.apply(O,E)}})})});var b=(function(S){y(k,S);function k(){g(this,k);var E=d(this,(k.__proto__||Object.getPrototypeOf(k)).call(this));return E.listeners={},E.on("error",_.error),E}return a(k,[{key:"emit",value:function(){_.log.apply(_,arguments),o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(A){for(var R=arguments.length,O=Array(R>1?R-1:0),I=1;I<R;I++)O[I-1]=arguments[I];(this.listeners[A.type]||[]).forEach(function(j){var D=j.node,C=j.handler;(A.target===D||D.contains(A.target))&&C.apply(void 0,[A].concat(O))})}},{key:"listenDOM",value:function(A,R,O){this.listeners[A]||(this.listeners[A]=[]),this.listeners[A].push({node:R,handler:O})}}]),k})(u.default);b.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"},b.sources={API:"api",SILENT:"silent",USER:"user"},r.default=b}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});function a(s,u){if(!(s instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function s(u){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};a(this,s),this.quill=u,this.options=h};o.DEFAULTS={},r.default=o}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=["error","warn","log","info"],o="warn";function s(h){if(a.indexOf(h)<=a.indexOf(o)){for(var c,m=arguments.length,g=Array(m>1?m-1:0),d=1;d<m;d++)g[d-1]=arguments[d];(c=console)[h].apply(c,g)}}function u(h){return a.reduce(function(c,m){return c[m]=s.bind(console,m,h),c},{})}s.level=u.level=function(h){o=h},r.default=u}),(function(n,r,i){var a=Array.prototype.slice,o=i(52),s=i(53),u=n.exports=function(g,d,y){return y||(y={}),g===d?!0:g instanceof Date&&d instanceof Date?g.getTime()===d.getTime():!g||!d||typeof g!="object"&&typeof d!="object"?y.strict?g===d:g==d:m(g,d,y)};function h(g){return g==null}function c(g){return!(!g||typeof g!="object"||typeof g.length!="number"||typeof g.copy!="function"||typeof g.slice!="function"||g.length>0&&typeof g[0]!="number")}function m(g,d,y){var _,x;if(h(g)||h(d)||g.prototype!==d.prototype)return!1;if(s(g))return s(d)?(g=a.call(g),d=a.call(d),u(g,d,y)):!1;if(c(g)){if(!c(d)||g.length!==d.length)return!1;for(_=0;_<g.length;_++)if(g[_]!==d[_])return!1;return!0}try{var b=o(g),S=o(d)}catch{return!1}if(b.length!=S.length)return!1;for(b.sort(),S.sort(),_=b.length-1;_>=0;_--)if(b[_]!=S[_])return!1;for(_=b.length-1;_>=0;_--)if(x=b[_],!u(g[x],d[x],y))return!1;return typeof g==typeof d}}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(1),o=(function(){function s(u,h,c){c===void 0&&(c={}),this.attrName=u,this.keyName=h;var m=a.Scope.TYPE&a.Scope.ATTRIBUTE;c.scope!=null?this.scope=c.scope&a.Scope.LEVEL|m:this.scope=a.Scope.ATTRIBUTE,c.whitelist!=null&&(this.whitelist=c.whitelist)}return s.keys=function(u){return[].map.call(u.attributes,function(h){return h.name})},s.prototype.add=function(u,h){return this.canAdd(u,h)?(u.setAttribute(this.keyName,h),!0):!1},s.prototype.canAdd=function(u,h){var c=a.query(u,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return c==null?!1:this.whitelist==null?!0:typeof h=="string"?this.whitelist.indexOf(h.replace(/["']/g,""))>-1:this.whitelist.indexOf(h)>-1},s.prototype.remove=function(u){u.removeAttribute(this.keyName)},s.prototype.value=function(u){var h=u.getAttribute(this.keyName);return this.canAdd(u,h)&&h?h:""},s})();r.default=o}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.Code=void 0;var a=(function(){function I(j,D){var C=[],N=!0,$=!1,G=void 0;try{for(var te=j[Symbol.iterator](),se;!(N=(se=te.next()).done)&&(C.push(se.value),!(D&&C.length===D));N=!0);}catch(ee){$=!0,G=ee}finally{try{!N&&te.return&&te.return()}finally{if($)throw G}}return C}return function(j,D){if(Array.isArray(j))return j;if(Symbol.iterator in Object(j))return I(j,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function I(j,D){for(var C=0;C<D.length;C++){var N=D[C];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(j,N.key,N)}}return function(j,D,C){return D&&I(j.prototype,D),C&&I(j,C),j}})(),s=function I(j,D,C){j===null&&(j=Function.prototype);var N=Object.getOwnPropertyDescriptor(j,D);if(N===void 0){var $=Object.getPrototypeOf(j);return $===null?void 0:I($,D,C)}else{if("value"in N)return N.value;var G=N.get;return G===void 0?void 0:G.call(C)}},u=i(2),h=S(u),c=i(0),m=S(c),g=i(4),d=S(g),y=i(6),_=S(y),x=i(7),b=S(x);function S(I){return I&&I.__esModule?I:{default:I}}function k(I,j){if(!(I instanceof j))throw new TypeError("Cannot call a class as a function")}function E(I,j){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j&&(typeof j=="object"||typeof j=="function")?j:I}function A(I,j){if(typeof j!="function"&&j!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof j);I.prototype=Object.create(j&&j.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),j&&(Object.setPrototypeOf?Object.setPrototypeOf(I,j):I.__proto__=j)}var R=(function(I){A(j,I);function j(){return k(this,j),E(this,(j.__proto__||Object.getPrototypeOf(j)).apply(this,arguments))}return j})(_.default);R.blotName="code",R.tagName="CODE";var O=(function(I){A(j,I);function j(){return k(this,j),E(this,(j.__proto__||Object.getPrototypeOf(j)).apply(this,arguments))}return o(j,[{key:"delta",value:function(){var C=this,N=this.domNode.textContent;return N.endsWith(`
|
|
111
|
+
`)&&(N=N.slice(0,-1)),N.split(`
|
|
112
|
+
`).reduce(function($,G){return $.insert(G).insert(`
|
|
113
|
+
`,C.formats())},new h.default)}},{key:"format",value:function(C,N){if(!(C===this.statics.blotName&&N)){var $=this.descendant(b.default,this.length()-1),G=a($,1),te=G[0];te?.deleteAt(te.length()-1,1),s(j.prototype.__proto__||Object.getPrototypeOf(j.prototype),"format",this).call(this,C,N)}}},{key:"formatAt",value:function(C,N,$,G){if(N!==0&&!(m.default.query($,m.default.Scope.BLOCK)==null||$===this.statics.blotName&&G===this.statics.formats(this.domNode))){var te=this.newlineIndex(C);if(!(te<0||te>=C+N)){var se=this.newlineIndex(C,!0)+1,ee=te-se+1,Q=this.isolate(se,ee),re=Q.next;Q.format($,G),re instanceof j&&re.formatAt(0,C-se+N-ee,$,G)}}}},{key:"insertAt",value:function(C,N,$){if($==null){var G=this.descendant(b.default,C),te=a(G,2),se=te[0],ee=te[1];se.insertAt(ee,N)}}},{key:"length",value:function(){var C=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
|
|
114
|
+
`)?C:C+1}},{key:"newlineIndex",value:function(C){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(N)return this.domNode.textContent.slice(0,C).lastIndexOf(`
|
|
115
|
+
`);var $=this.domNode.textContent.slice(C).indexOf(`
|
|
116
|
+
`);return $>-1?C+$:-1}},{key:"optimize",value:function(C){this.domNode.textContent.endsWith(`
|
|
117
|
+
`)||this.appendChild(m.default.create("text",`
|
|
118
|
+
`)),s(j.prototype.__proto__||Object.getPrototypeOf(j.prototype),"optimize",this).call(this,C);var N=this.next;N!=null&&N.prev===this&&N.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===N.statics.formats(N.domNode)&&(N.optimize(C),N.moveChildren(this),N.remove())}},{key:"replace",value:function(C){s(j.prototype.__proto__||Object.getPrototypeOf(j.prototype),"replace",this).call(this,C),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(N){var $=m.default.find(N);$==null?N.parentNode.removeChild(N):$ instanceof m.default.Embed?$.remove():$.unwrap()})}}],[{key:"create",value:function(C){var N=s(j.__proto__||Object.getPrototypeOf(j),"create",this).call(this,C);return N.setAttribute("spellcheck",!1),N}},{key:"formats",value:function(){return!0}}]),j})(d.default);O.blotName="code-block",O.tagName="PRE",O.TAB=" ",r.Code=R,r.default=O}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(re){return typeof re}:function(re){return re&&typeof Symbol=="function"&&re.constructor===Symbol&&re!==Symbol.prototype?"symbol":typeof re},o=(function(){function re(X,B){var F=[],z=!0,Y=!1,J=void 0;try{for(var K=X[Symbol.iterator](),ie;!(z=(ie=K.next()).done)&&(F.push(ie.value),!(B&&F.length===B));z=!0);}catch(fe){Y=!0,J=fe}finally{try{!z&&K.return&&K.return()}finally{if(Y)throw J}}return F}return function(X,B){if(Array.isArray(X))return X;if(Symbol.iterator in Object(X))return re(X,B);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),s=(function(){function re(X,B){for(var F=0;F<B.length;F++){var z=B[F];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(X,z.key,z)}}return function(X,B,F){return B&&re(X.prototype,B),F&&re(X,F),X}})(),u=i(2),h=N(u),c=i(20),m=N(c),g=i(0),d=N(g),y=i(13),_=N(y),x=i(24),b=N(x),S=i(4),k=N(S),E=i(16),A=N(E),R=i(21),O=N(R),I=i(11),j=N(I),D=i(3),C=N(D);function N(re){return re&&re.__esModule?re:{default:re}}function $(re,X,B){return X in re?Object.defineProperty(re,X,{value:B,enumerable:!0,configurable:!0,writable:!0}):re[X]=B,re}function G(re,X){if(!(re instanceof X))throw new TypeError("Cannot call a class as a function")}var te=/^[ -~]*$/,se=(function(){function re(X){G(this,re),this.scroll=X,this.delta=this.getDelta()}return s(re,[{key:"applyDelta",value:function(B){var F=this,z=!1;this.scroll.update();var Y=this.scroll.length();return this.scroll.batchStart(),B=Q(B),B.reduce(function(J,K){var ie=K.retain||K.delete||K.insert.length||1,fe=K.attributes||{};if(K.insert!=null){if(typeof K.insert=="string"){var ue=K.insert;ue.endsWith(`
|
|
119
|
+
`)&&z&&(z=!1,ue=ue.slice(0,-1)),J>=Y&&!ue.endsWith(`
|
|
120
|
+
`)&&(z=!0),F.scroll.insertAt(J,ue);var _e=F.scroll.line(J),Ce=o(_e,2),$e=Ce[0],ze=Ce[1],tt=(0,C.default)({},(0,S.bubbleFormats)($e));if($e instanceof k.default){var pe=$e.descendant(d.default.Leaf,ze),ut=o(pe,1),be=ut[0];tt=(0,C.default)(tt,(0,S.bubbleFormats)(be))}fe=m.default.attributes.diff(tt,fe)||{}}else if(a(K.insert)==="object"){var ge=Object.keys(K.insert)[0];if(ge==null)return J;F.scroll.insertAt(J,ge,K.insert[ge])}Y+=ie}return Object.keys(fe).forEach(function(xe){F.scroll.formatAt(J,ie,xe,fe[xe])}),J+ie},0),B.reduce(function(J,K){return typeof K.delete=="number"?(F.scroll.deleteAt(J,K.delete),J):J+(K.retain||K.insert.length||1)},0),this.scroll.batchEnd(),this.update(B)}},{key:"deleteText",value:function(B,F){return this.scroll.deleteAt(B,F),this.update(new h.default().retain(B).delete(F))}},{key:"formatLine",value:function(B,F){var z=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(Y).forEach(function(J){if(!(z.scroll.whitelist!=null&&!z.scroll.whitelist[J])){var K=z.scroll.lines(B,Math.max(F,1)),ie=F;K.forEach(function(fe){var ue=fe.length();if(!(fe instanceof _.default))fe.format(J,Y[J]);else{var _e=B-fe.offset(z.scroll),Ce=fe.newlineIndex(_e+ie)-_e+1;fe.formatAt(_e,Ce,J,Y[J])}ie-=ue})}}),this.scroll.optimize(),this.update(new h.default().retain(B).retain(F,(0,O.default)(Y)))}},{key:"formatText",value:function(B,F){var z=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(Y).forEach(function(J){z.scroll.formatAt(B,F,J,Y[J])}),this.update(new h.default().retain(B).retain(F,(0,O.default)(Y)))}},{key:"getContents",value:function(B,F){return this.delta.slice(B,B+F)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(B,F){return B.concat(F.delta())},new h.default)}},{key:"getFormat",value:function(B){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,z=[],Y=[];F===0?this.scroll.path(B).forEach(function(K){var ie=o(K,1),fe=ie[0];fe instanceof k.default?z.push(fe):fe instanceof d.default.Leaf&&Y.push(fe)}):(z=this.scroll.lines(B,F),Y=this.scroll.descendants(d.default.Leaf,B,F));var J=[z,Y].map(function(K){if(K.length===0)return{};for(var ie=(0,S.bubbleFormats)(K.shift());Object.keys(ie).length>0;){var fe=K.shift();if(fe==null)return ie;ie=ee((0,S.bubbleFormats)(fe),ie)}return ie});return C.default.apply(C.default,J)}},{key:"getText",value:function(B,F){return this.getContents(B,F).filter(function(z){return typeof z.insert=="string"}).map(function(z){return z.insert}).join("")}},{key:"insertEmbed",value:function(B,F,z){return this.scroll.insertAt(B,F,z),this.update(new h.default().retain(B).insert($({},F,z)))}},{key:"insertText",value:function(B,F){var z=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return F=F.replace(/\r\n/g,`
|
|
121
|
+
`).replace(/\r/g,`
|
|
122
|
+
`),this.scroll.insertAt(B,F),Object.keys(Y).forEach(function(J){z.scroll.formatAt(B,F.length,J,Y[J])}),this.update(new h.default().retain(B).insert(F,(0,O.default)(Y)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var B=this.scroll.children.head;return B.statics.blotName!==k.default.blotName||B.children.length>1?!1:B.children.head instanceof A.default}},{key:"removeFormat",value:function(B,F){var z=this.getText(B,F),Y=this.scroll.line(B+F),J=o(Y,2),K=J[0],ie=J[1],fe=0,ue=new h.default;K!=null&&(K instanceof _.default?fe=K.newlineIndex(ie)-ie+1:fe=K.length()-ie,ue=K.delta().slice(ie,ie+fe-1).insert(`
|
|
123
|
+
`));var _e=this.getContents(B,F+fe),Ce=_e.diff(new h.default().insert(z).concat(ue)),$e=new h.default().retain(B).concat(Ce);return this.applyDelta($e)}},{key:"update",value:function(B){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,Y=this.delta;if(F.length===1&&F[0].type==="characterData"&&F[0].target.data.match(te)&&d.default.find(F[0].target)){var J=d.default.find(F[0].target),K=(0,S.bubbleFormats)(J),ie=J.offset(this.scroll),fe=F[0].oldValue.replace(b.default.CONTENTS,""),ue=new h.default().insert(fe),_e=new h.default().insert(J.value()),Ce=new h.default().retain(ie).concat(ue.diff(_e,z));B=Ce.reduce(function($e,ze){return ze.insert?$e.insert(ze.insert,K):$e.push(ze)},new h.default),this.delta=Y.compose(B)}else this.delta=this.getDelta(),(!B||!(0,j.default)(Y.compose(B),this.delta))&&(B=Y.diff(this.delta,z));return B}}]),re})();function ee(re,X){return Object.keys(X).reduce(function(B,F){return re[F]==null||(X[F]===re[F]?B[F]=X[F]:Array.isArray(X[F])?X[F].indexOf(re[F])<0&&(B[F]=X[F].concat([re[F]])):B[F]=[X[F],re[F]]),B},{})}function Q(re){return re.reduce(function(X,B){if(B.insert===1){var F=(0,O.default)(B.attributes);return delete F.image,X.insert({image:B.attributes.image},F)}if(B.attributes!=null&&(B.attributes.list===!0||B.attributes.bullet===!0)&&(B=(0,O.default)(B),B.attributes.list?B.attributes.list="ordered":(B.attributes.list="bullet",delete B.attributes.bullet)),typeof B.insert=="string"){var z=B.insert.replace(/\r\n/g,`
|
|
124
|
+
`).replace(/\r/g,`
|
|
125
|
+
`);return X.insert(z,B.attributes)}return X.push(B)},new h.default)}r.default=se}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.Range=void 0;var a=(function(){function I(j,D){var C=[],N=!0,$=!1,G=void 0;try{for(var te=j[Symbol.iterator](),se;!(N=(se=te.next()).done)&&(C.push(se.value),!(D&&C.length===D));N=!0);}catch(ee){$=!0,G=ee}finally{try{!N&&te.return&&te.return()}finally{if($)throw G}}return C}return function(j,D){if(Array.isArray(j))return j;if(Symbol.iterator in Object(j))return I(j,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function I(j,D){for(var C=0;C<D.length;C++){var N=D[C];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(j,N.key,N)}}return function(j,D,C){return D&&I(j.prototype,D),C&&I(j,C),j}})(),s=i(0),u=b(s),h=i(21),c=b(h),m=i(11),g=b(m),d=i(8),y=b(d),_=i(10),x=b(_);function b(I){return I&&I.__esModule?I:{default:I}}function S(I){if(Array.isArray(I)){for(var j=0,D=Array(I.length);j<I.length;j++)D[j]=I[j];return D}else return Array.from(I)}function k(I,j){if(!(I instanceof j))throw new TypeError("Cannot call a class as a function")}var E=(0,x.default)("quill:selection"),A=function I(j){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;k(this,I),this.index=j,this.length=D},R=(function(){function I(j,D){var C=this;k(this,I),this.emitter=D,this.scroll=j,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=u.default.create("cursor",this),this.lastRange=this.savedRange=new A(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){C.mouseDown||setTimeout(C.update.bind(C,y.default.sources.USER),1)}),this.emitter.on(y.default.events.EDITOR_CHANGE,function(N,$){N===y.default.events.TEXT_CHANGE&&$.length()>0&&C.update(y.default.sources.SILENT)}),this.emitter.on(y.default.events.SCROLL_BEFORE_UPDATE,function(){if(C.hasFocus()){var N=C.getNativeRange();N!=null&&N.start.node!==C.cursor.textNode&&C.emitter.once(y.default.events.SCROLL_UPDATE,function(){try{C.setNativeRange(N.start.node,N.start.offset,N.end.node,N.end.offset)}catch{}})}}),this.emitter.on(y.default.events.SCROLL_OPTIMIZE,function(N,$){if($.range){var G=$.range,te=G.startNode,se=G.startOffset,ee=G.endNode,Q=G.endOffset;C.setNativeRange(te,se,ee,Q)}}),this.update(y.default.sources.SILENT)}return o(I,[{key:"handleComposition",value:function(){var D=this;this.root.addEventListener("compositionstart",function(){D.composing=!0}),this.root.addEventListener("compositionend",function(){if(D.composing=!1,D.cursor.parent){var C=D.cursor.restore();if(!C)return;setTimeout(function(){D.setNativeRange(C.startNode,C.startOffset,C.endNode,C.endOffset)},1)}})}},{key:"handleDragging",value:function(){var D=this;this.emitter.listenDOM("mousedown",document.body,function(){D.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){D.mouseDown=!1,D.update(y.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(D,C){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[D])){this.scroll.update();var N=this.getNativeRange();if(!(N==null||!N.native.collapsed||u.default.query(D,u.default.Scope.BLOCK))){if(N.start.node!==this.cursor.textNode){var $=u.default.find(N.start.node,!1);if($==null)return;if($ instanceof u.default.Leaf){var G=$.split(N.start.offset);$.parent.insertBefore(this.cursor,G)}else $.insertBefore(this.cursor,N.start.node);this.cursor.attach()}this.cursor.format(D,C),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(D){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,N=this.scroll.length();D=Math.min(D,N-1),C=Math.min(D+C,N-1)-D;var $=void 0,G=this.scroll.leaf(D),te=a(G,2),se=te[0],ee=te[1];if(se==null)return null;var Q=se.position(ee,!0),re=a(Q,2);$=re[0],ee=re[1];var X=document.createRange();if(C>0){X.setStart($,ee);var B=this.scroll.leaf(D+C),F=a(B,2);if(se=F[0],ee=F[1],se==null)return null;var z=se.position(ee,!0),Y=a(z,2);return $=Y[0],ee=Y[1],X.setEnd($,ee),X.getBoundingClientRect()}else{var J="left",K=void 0;return $ instanceof Text?(ee<$.data.length?(X.setStart($,ee),X.setEnd($,ee+1)):(X.setStart($,ee-1),X.setEnd($,ee),J="right"),K=X.getBoundingClientRect()):(K=se.domNode.getBoundingClientRect(),ee>0&&(J="right")),{bottom:K.top+K.height,height:K.height,left:K[J],right:K[J],top:K.top,width:0}}}},{key:"getNativeRange",value:function(){var D=document.getSelection();if(D==null||D.rangeCount<=0)return null;var C=D.getRangeAt(0);if(C==null)return null;var N=this.normalizeNative(C);return E.info("getNativeRange",N),N}},{key:"getRange",value:function(){var D=this.getNativeRange();if(D==null)return[null,null];var C=this.normalizedToRange(D);return[C,D]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(D){var C=this,N=[[D.start.node,D.start.offset]];D.native.collapsed||N.push([D.end.node,D.end.offset]);var $=N.map(function(se){var ee=a(se,2),Q=ee[0],re=ee[1],X=u.default.find(Q,!0),B=X.offset(C.scroll);return re===0?B:X instanceof u.default.Container?B+X.length():B+X.index(Q,re)}),G=Math.min(Math.max.apply(Math,S($)),this.scroll.length()-1),te=Math.min.apply(Math,[G].concat(S($)));return new A(te,G-te)}},{key:"normalizeNative",value:function(D){if(!O(this.root,D.startContainer)||!D.collapsed&&!O(this.root,D.endContainer))return null;var C={start:{node:D.startContainer,offset:D.startOffset},end:{node:D.endContainer,offset:D.endOffset},native:D};return[C.start,C.end].forEach(function(N){for(var $=N.node,G=N.offset;!($ instanceof Text)&&$.childNodes.length>0;)if($.childNodes.length>G)$=$.childNodes[G],G=0;else if($.childNodes.length===G)$=$.lastChild,G=$ instanceof Text?$.data.length:$.childNodes.length+1;else break;N.node=$,N.offset=G}),C}},{key:"rangeToNative",value:function(D){var C=this,N=D.collapsed?[D.index]:[D.index,D.index+D.length],$=[],G=this.scroll.length();return N.forEach(function(te,se){te=Math.min(G-1,te);var ee=void 0,Q=C.scroll.leaf(te),re=a(Q,2),X=re[0],B=re[1],F=X.position(B,se!==0),z=a(F,2);ee=z[0],B=z[1],$.push(ee,B)}),$.length<2&&($=$.concat($)),$}},{key:"scrollIntoView",value:function(D){var C=this.lastRange;if(C!=null){var N=this.getBounds(C.index,C.length);if(N!=null){var $=this.scroll.length()-1,G=this.scroll.line(Math.min(C.index,$)),te=a(G,1),se=te[0],ee=se;if(C.length>0){var Q=this.scroll.line(Math.min(C.index+C.length,$)),re=a(Q,1);ee=re[0]}if(!(se==null||ee==null)){var X=D.getBoundingClientRect();N.top<X.top?D.scrollTop-=X.top-N.top:N.bottom>X.bottom&&(D.scrollTop+=N.bottom-X.bottom)}}}}},{key:"setNativeRange",value:function(D,C){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:D,$=arguments.length>3&&arguments[3]!==void 0?arguments[3]:C,G=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(E.info("setNativeRange",D,C,N,$),!(D!=null&&(this.root.parentNode==null||D.parentNode==null||N.parentNode==null))){var te=document.getSelection();if(te!=null)if(D!=null){this.hasFocus()||this.root.focus();var se=(this.getNativeRange()||{}).native;if(se==null||G||D!==se.startContainer||C!==se.startOffset||N!==se.endContainer||$!==se.endOffset){D.tagName=="BR"&&(C=[].indexOf.call(D.parentNode.childNodes,D),D=D.parentNode),N.tagName=="BR"&&($=[].indexOf.call(N.parentNode.childNodes,N),N=N.parentNode);var ee=document.createRange();ee.setStart(D,C),ee.setEnd(N,$),te.removeAllRanges(),te.addRange(ee)}}else te.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(D){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y.default.sources.API;if(typeof C=="string"&&(N=C,C=!1),E.info("setRange",D),D!=null){var $=this.rangeToNative(D);this.setNativeRange.apply(this,S($).concat([C]))}else this.setNativeRange(null);this.update(N)}},{key:"update",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y.default.sources.USER,C=this.lastRange,N=this.getRange(),$=a(N,2),G=$[0],te=$[1];if(this.lastRange=G,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,g.default)(C,this.lastRange)){var se;!this.composing&&te!=null&&te.native.collapsed&&te.start.node!==this.cursor.textNode&&this.cursor.restore();var ee=[y.default.events.SELECTION_CHANGE,(0,c.default)(this.lastRange),(0,c.default)(C),D];if((se=this.emitter).emit.apply(se,[y.default.events.EDITOR_CHANGE].concat(ee)),D!==y.default.sources.SILENT){var Q;(Q=this.emitter).emit.apply(Q,ee)}}}}]),I})();function O(I,j){try{j.parentNode}catch{return!1}return j instanceof Text&&(j=j.parentNode),I.contains(j)}r.Range=A,r.default=R}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function y(_,x){for(var b=0;b<x.length;b++){var S=x[b];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(_,S.key,S)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}})(),o=function y(_,x,b){_===null&&(_=Function.prototype);var S=Object.getOwnPropertyDescriptor(_,x);if(S===void 0){var k=Object.getPrototypeOf(_);return k===null?void 0:y(k,x,b)}else{if("value"in S)return S.value;var E=S.get;return E===void 0?void 0:E.call(b)}},s=i(0),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function c(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function m(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function g(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var d=(function(y){g(_,y);function _(){return c(this,_),m(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"insertInto",value:function(b,S){b.children.length===0?o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertInto",this).call(this,b,S):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),_})(u.default.Embed);d.blotName="break",d.tagName="BR",r.default=d}),(function(n,r,i){var a=this&&this.__extends||(function(){var m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,d){g.__proto__=d}||function(g,d){for(var y in d)d.hasOwnProperty(y)&&(g[y]=d[y])};return function(g,d){m(g,d);function y(){this.constructor=g}g.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(44),s=i(30),u=i(1),h=(function(m){a(g,m);function g(d){var y=m.call(this,d)||this;return y.build(),y}return g.prototype.appendChild=function(d){this.insertBefore(d)},g.prototype.attach=function(){m.prototype.attach.call(this),this.children.forEach(function(d){d.attach()})},g.prototype.build=function(){var d=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(y){try{var _=c(y);d.insertBefore(_,d.children.head||void 0)}catch(x){if(x instanceof u.ParchmentError)return;throw x}})},g.prototype.deleteAt=function(d,y){if(d===0&&y===this.length())return this.remove();this.children.forEachAt(d,y,function(_,x,b){_.deleteAt(x,b)})},g.prototype.descendant=function(d,y){var _=this.children.find(y),x=_[0],b=_[1];return d.blotName==null&&d(x)||d.blotName!=null&&x instanceof d?[x,b]:x instanceof g?x.descendant(d,b):[null,-1]},g.prototype.descendants=function(d,y,_){y===void 0&&(y=0),_===void 0&&(_=Number.MAX_VALUE);var x=[],b=_;return this.children.forEachAt(y,_,function(S,k,E){(d.blotName==null&&d(S)||d.blotName!=null&&S instanceof d)&&x.push(S),S instanceof g&&(x=x.concat(S.descendants(d,k,b))),b-=E}),x},g.prototype.detach=function(){this.children.forEach(function(d){d.detach()}),m.prototype.detach.call(this)},g.prototype.formatAt=function(d,y,_,x){this.children.forEachAt(d,y,function(b,S,k){b.formatAt(S,k,_,x)})},g.prototype.insertAt=function(d,y,_){var x=this.children.find(d),b=x[0],S=x[1];if(b)b.insertAt(S,y,_);else{var k=_==null?u.create("text",y):u.create(y,_);this.appendChild(k)}},g.prototype.insertBefore=function(d,y){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(_){return d instanceof _}))throw new u.ParchmentError("Cannot insert "+d.statics.blotName+" into "+this.statics.blotName);d.insertInto(this,y)},g.prototype.length=function(){return this.children.reduce(function(d,y){return d+y.length()},0)},g.prototype.moveChildren=function(d,y){this.children.forEach(function(_){d.insertBefore(_,y)})},g.prototype.optimize=function(d){if(m.prototype.optimize.call(this,d),this.children.length===0)if(this.statics.defaultChild!=null){var y=u.create(this.statics.defaultChild);this.appendChild(y),y.optimize(d)}else this.remove()},g.prototype.path=function(d,y){y===void 0&&(y=!1);var _=this.children.find(d,y),x=_[0],b=_[1],S=[[this,d]];return x instanceof g?S.concat(x.path(b,y)):(x!=null&&S.push([x,b]),S)},g.prototype.removeChild=function(d){this.children.remove(d)},g.prototype.replace=function(d){d instanceof g&&d.moveChildren(this),m.prototype.replace.call(this,d)},g.prototype.split=function(d,y){if(y===void 0&&(y=!1),!y){if(d===0)return this;if(d===this.length())return this.next}var _=this.clone();return this.parent.insertBefore(_,this.next),this.children.forEachAt(d,this.length(),function(x,b,S){x=x.split(b,y),_.appendChild(x)}),_},g.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},g.prototype.update=function(d,y){var _=this,x=[],b=[];d.forEach(function(S){S.target===_.domNode&&S.type==="childList"&&(x.push.apply(x,S.addedNodes),b.push.apply(b,S.removedNodes))}),b.forEach(function(S){if(!(S.parentNode!=null&&S.tagName!=="IFRAME"&&document.body.compareDocumentPosition(S)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var k=u.find(S);k!=null&&(k.domNode.parentNode==null||k.domNode.parentNode===_.domNode)&&k.detach()}}),x.filter(function(S){return S.parentNode==_.domNode}).sort(function(S,k){return S===k?0:S.compareDocumentPosition(k)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(S){var k=null;S.nextSibling!=null&&(k=u.find(S.nextSibling));var E=c(S);(E.next!=k||E.next==null)&&(E.parent!=null&&E.parent.removeChild(_),_.insertBefore(E,k||void 0))})},g})(s.default);function c(m){var g=u.find(m);if(g==null)try{g=u.create(m)}catch{g=u.create(u.Scope.INLINE),[].slice.call(m.childNodes).forEach(function(y){g.domNode.appendChild(y)}),m.parentNode&&m.parentNode.replaceChild(g.domNode,m),g.attach()}return g}r.default=h}),(function(n,r,i){var a=this&&this.__extends||(function(){var m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,d){g.__proto__=d}||function(g,d){for(var y in d)d.hasOwnProperty(y)&&(g[y]=d[y])};return function(g,d){m(g,d);function y(){this.constructor=g}g.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(12),s=i(31),u=i(17),h=i(1),c=(function(m){a(g,m);function g(d){var y=m.call(this,d)||this;return y.attributes=new s.default(y.domNode),y}return g.formats=function(d){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return d.tagName.toLowerCase()},g.prototype.format=function(d,y){var _=h.query(d);_ instanceof o.default?this.attributes.attribute(_,y):y&&_!=null&&(d!==this.statics.blotName||this.formats()[d]!==y)&&this.replaceWith(d,y)},g.prototype.formats=function(){var d=this.attributes.values(),y=this.statics.formats(this.domNode);return y!=null&&(d[this.statics.blotName]=y),d},g.prototype.replaceWith=function(d,y){var _=m.prototype.replaceWith.call(this,d,y);return this.attributes.copy(_),_},g.prototype.update=function(d,y){var _=this;m.prototype.update.call(this,d,y),d.some(function(x){return x.target===_.domNode&&x.type==="attributes"})&&this.attributes.build()},g.prototype.wrap=function(d,y){var _=m.prototype.wrap.call(this,d,y);return _ instanceof g&&_.statics.scope===this.statics.scope&&this.attributes.move(_),_},g})(u.default);r.default=c}),(function(n,r,i){var a=this&&this.__extends||(function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,m){c.__proto__=m}||function(c,m){for(var g in m)m.hasOwnProperty(g)&&(c[g]=m[g])};return function(c,m){h(c,m);function g(){this.constructor=c}c.prototype=m===null?Object.create(m):(g.prototype=m.prototype,new g)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(30),s=i(1),u=(function(h){a(c,h);function c(){return h!==null&&h.apply(this,arguments)||this}return c.value=function(m){return!0},c.prototype.index=function(m,g){return this.domNode===m||this.domNode.compareDocumentPosition(m)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(g,1):-1},c.prototype.position=function(m,g){var d=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return m>0&&(d+=1),[this.parent.domNode,d]},c.prototype.value=function(){var m;return m={},m[this.statics.blotName]=this.statics.value(this.domNode)||!0,m},c.scope=s.Scope.INLINE_BLOT,c})(o.default);r.default=u}),(function(n,r,i){var a=i(11),o=i(3),s={attributes:{compose:function(h,c,m){typeof h!="object"&&(h={}),typeof c!="object"&&(c={});var g=o(!0,{},c);m||(g=Object.keys(g).reduce(function(y,_){return g[_]!=null&&(y[_]=g[_]),y},{}));for(var d in h)h[d]!==void 0&&c[d]===void 0&&(g[d]=h[d]);return Object.keys(g).length>0?g:void 0},diff:function(h,c){typeof h!="object"&&(h={}),typeof c!="object"&&(c={});var m=Object.keys(h).concat(Object.keys(c)).reduce(function(g,d){return a(h[d],c[d])||(g[d]=c[d]===void 0?null:c[d]),g},{});return Object.keys(m).length>0?m:void 0},transform:function(h,c,m){if(typeof h!="object")return c;if(typeof c=="object"){if(!m)return c;var g=Object.keys(c).reduce(function(d,y){return h[y]===void 0&&(d[y]=c[y]),d},{});return Object.keys(g).length>0?g:void 0}}},iterator:function(h){return new u(h)},length:function(h){return typeof h.delete=="number"?h.delete:typeof h.retain=="number"?h.retain:typeof h.insert=="string"?h.insert.length:1}};function u(h){this.ops=h,this.index=0,this.offset=0}u.prototype.hasNext=function(){return this.peekLength()<1/0},u.prototype.next=function(h){h||(h=1/0);var c=this.ops[this.index];if(c){var m=this.offset,g=s.length(c);if(h>=g-m?(h=g-m,this.index+=1,this.offset=0):this.offset+=h,typeof c.delete=="number")return{delete:h};var d={};return c.attributes&&(d.attributes=c.attributes),typeof c.retain=="number"?d.retain=h:typeof c.insert=="string"?d.insert=c.insert.substr(m,h):d.insert=c.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]?s.length(this.ops[this.index])-this.offset:1/0},u.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},u.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var h=this.offset,c=this.index,m=this.next(),g=this.ops.slice(this.index);return this.offset=h,this.index=c,[m].concat(g)}else return[]},n.exports=s}),(function(n,r){var i=(function(){function a(_,x){return x!=null&&_ instanceof x}var o;try{o=Map}catch{o=function(){}}var s;try{s=Set}catch{s=function(){}}var u;try{u=Promise}catch{u=function(){}}function h(_,x,b,S,k){typeof x=="object"&&(b=x.depth,S=x.prototype,k=x.includeNonEnumerable,x=x.circular);var E=[],A=[],R=typeof Buffer<"u";typeof x>"u"&&(x=!0),typeof b>"u"&&(b=1/0);function O(I,j){if(I===null)return null;if(j===0)return I;var D,C;if(typeof I!="object")return I;if(a(I,o))D=new o;else if(a(I,s))D=new s;else if(a(I,u))D=new u(function(X,B){I.then(function(F){X(O(F,j-1))},function(F){B(O(F,j-1))})});else if(h.__isArray(I))D=[];else if(h.__isRegExp(I))D=new RegExp(I.source,y(I)),I.lastIndex&&(D.lastIndex=I.lastIndex);else if(h.__isDate(I))D=new Date(I.getTime());else{if(R&&Buffer.isBuffer(I))return Buffer.allocUnsafe?D=Buffer.allocUnsafe(I.length):D=new Buffer(I.length),I.copy(D),D;a(I,Error)?D=Object.create(I):typeof S>"u"?(C=Object.getPrototypeOf(I),D=Object.create(C)):(D=Object.create(S),C=S)}if(x){var N=E.indexOf(I);if(N!=-1)return A[N];E.push(I),A.push(D)}a(I,o)&&I.forEach(function(X,B){var F=O(B,j-1),z=O(X,j-1);D.set(F,z)}),a(I,s)&&I.forEach(function(X){var B=O(X,j-1);D.add(B)});for(var $ in I){var G;C&&(G=Object.getOwnPropertyDescriptor(C,$)),!(G&&G.set==null)&&(D[$]=O(I[$],j-1))}if(Object.getOwnPropertySymbols)for(var te=Object.getOwnPropertySymbols(I),$=0;$<te.length;$++){var se=te[$],ee=Object.getOwnPropertyDescriptor(I,se);ee&&!ee.enumerable&&!k||(D[se]=O(I[se],j-1),ee.enumerable||Object.defineProperty(D,se,{enumerable:!1}))}if(k)for(var Q=Object.getOwnPropertyNames(I),$=0;$<Q.length;$++){var re=Q[$],ee=Object.getOwnPropertyDescriptor(I,re);ee&&ee.enumerable||(D[re]=O(I[re],j-1),Object.defineProperty(D,re,{enumerable:!1}))}return D}return O(_,b)}h.clonePrototype=function(x){if(x===null)return null;var b=function(){};return b.prototype=x,new b};function c(_){return Object.prototype.toString.call(_)}h.__objToStr=c;function m(_){return typeof _=="object"&&c(_)==="[object Date]"}h.__isDate=m;function g(_){return typeof _=="object"&&c(_)==="[object Array]"}h.__isArray=g;function d(_){return typeof _=="object"&&c(_)==="[object RegExp]"}h.__isRegExp=d;function y(_){var x="";return _.global&&(x+="g"),_.ignoreCase&&(x+="i"),_.multiline&&(x+="m"),x}return h.__getRegExpFlags=y,h})();typeof n=="object"&&n.exports&&(n.exports=i)}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function D(C,N){var $=[],G=!0,te=!1,se=void 0;try{for(var ee=C[Symbol.iterator](),Q;!(G=(Q=ee.next()).done)&&($.push(Q.value),!(N&&$.length===N));G=!0);}catch(re){te=!0,se=re}finally{try{!G&&ee.return&&ee.return()}finally{if(te)throw se}}return $}return function(C,N){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return D(C,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function D(C,N){for(var $=0;$<N.length;$++){var G=N[$];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(C,G.key,G)}}return function(C,N,$){return N&&D(C.prototype,N),$&&D(C,$),C}})(),s=function D(C,N,$){C===null&&(C=Function.prototype);var G=Object.getOwnPropertyDescriptor(C,N);if(G===void 0){var te=Object.getPrototypeOf(C);return te===null?void 0:D(te,N,$)}else{if("value"in G)return G.value;var se=G.get;return se===void 0?void 0:se.call($)}},u=i(0),h=E(u),c=i(8),m=E(c),g=i(4),d=E(g),y=i(16),_=E(y),x=i(13),b=E(x),S=i(25),k=E(S);function E(D){return D&&D.__esModule?D:{default:D}}function A(D,C){if(!(D instanceof C))throw new TypeError("Cannot call a class as a function")}function R(D,C){if(!D)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:D}function O(D,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);D.prototype=Object.create(C&&C.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(D,C):D.__proto__=C)}function I(D){return D instanceof d.default||D instanceof g.BlockEmbed}var j=(function(D){O(C,D);function C(N,$){A(this,C);var G=R(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,N));return G.emitter=$.emitter,Array.isArray($.whitelist)&&(G.whitelist=$.whitelist.reduce(function(te,se){return te[se]=!0,te},{})),G.domNode.addEventListener("DOMNodeInserted",function(){}),G.optimize(),G.enable(),G}return o(C,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function($,G){var te=this.line($),se=a(te,2),ee=se[0],Q=se[1],re=this.line($+G),X=a(re,1),B=X[0];if(s(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"deleteAt",this).call(this,$,G),B!=null&&ee!==B&&Q>0){if(ee instanceof g.BlockEmbed||B instanceof g.BlockEmbed){this.optimize();return}if(ee instanceof b.default){var F=ee.newlineIndex(ee.length(),!0);if(F>-1&&(ee=ee.split(F+1),ee===B)){this.optimize();return}}else if(B instanceof b.default){var z=B.newlineIndex(0);z>-1&&B.split(z+1)}var Y=B.children.head instanceof _.default?null:B.children.head;ee.moveChildren(B,Y),ee.remove()}this.optimize()}},{key:"enable",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",$)}},{key:"formatAt",value:function($,G,te,se){this.whitelist!=null&&!this.whitelist[te]||(s(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"formatAt",this).call(this,$,G,te,se),this.optimize())}},{key:"insertAt",value:function($,G,te){if(!(te!=null&&this.whitelist!=null&&!this.whitelist[G])){if($>=this.length())if(te==null||h.default.query(G,h.default.Scope.BLOCK)==null){var se=h.default.create(this.statics.defaultChild);this.appendChild(se),te==null&&G.endsWith(`
|
|
126
|
+
`)&&(G=G.slice(0,-1)),se.insertAt(0,G,te)}else{var ee=h.default.create(G,te);this.appendChild(ee)}else s(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertAt",this).call(this,$,G,te);this.optimize()}}},{key:"insertBefore",value:function($,G){if($.statics.scope===h.default.Scope.INLINE_BLOT){var te=h.default.create(this.statics.defaultChild);te.appendChild($),$=te}s(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertBefore",this).call(this,$,G)}},{key:"leaf",value:function($){return this.path($).pop()||[null,-1]}},{key:"line",value:function($){return $===this.length()?this.line($-1):this.descendant(I,$)}},{key:"lines",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,te=function se(ee,Q,re){var X=[],B=re;return ee.children.forEachAt(Q,re,function(F,z,Y){I(F)?X.push(F):F instanceof h.default.Container&&(X=X.concat(se(F,z,B))),B-=Y}),X};return te(this,$,G)}},{key:"optimize",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(s(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"optimize",this).call(this,$,G),$.length>0&&this.emitter.emit(m.default.events.SCROLL_OPTIMIZE,$,G))}},{key:"path",value:function($){return s(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"path",this).call(this,$).slice(1)}},{key:"update",value:function($){if(this.batch!==!0){var G=m.default.sources.USER;typeof $=="string"&&(G=$),Array.isArray($)||($=this.observer.takeRecords()),$.length>0&&this.emitter.emit(m.default.events.SCROLL_BEFORE_UPDATE,G,$),s(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"update",this).call(this,$.concat([])),$.length>0&&this.emitter.emit(m.default.events.SCROLL_UPDATE,G,$)}}}]),C})(h.default.Scroll);j.blotName="scroll",j.className="ql-editor",j.tagName="DIV",j.defaultChild="block",j.allowedChildren=[d.default,g.BlockEmbed,k.default],r.default=j}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.SHORTKEY=r.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(K){return typeof K}:function(K){return K&&typeof Symbol=="function"&&K.constructor===Symbol&&K!==Symbol.prototype?"symbol":typeof K},o=(function(){function K(ie,fe){var ue=[],_e=!0,Ce=!1,$e=void 0;try{for(var ze=ie[Symbol.iterator](),tt;!(_e=(tt=ze.next()).done)&&(ue.push(tt.value),!(fe&&ue.length===fe));_e=!0);}catch(pe){Ce=!0,$e=pe}finally{try{!_e&&ze.return&&ze.return()}finally{if(Ce)throw $e}}return ue}return function(ie,fe){if(Array.isArray(ie))return ie;if(Symbol.iterator in Object(ie))return K(ie,fe);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),s=(function(){function K(ie,fe){for(var ue=0;ue<fe.length;ue++){var _e=fe[ue];_e.enumerable=_e.enumerable||!1,_e.configurable=!0,"value"in _e&&(_e.writable=!0),Object.defineProperty(ie,_e.key,_e)}}return function(ie,fe,ue){return fe&&K(ie.prototype,fe),ue&&K(ie,ue),ie}})(),u=i(21),h=D(u),c=i(11),m=D(c),g=i(3),d=D(g),y=i(2),_=D(y),x=i(20),b=D(x),S=i(0),k=D(S),E=i(5),A=D(E),R=i(10),O=D(R),I=i(9),j=D(I);function D(K){return K&&K.__esModule?K:{default:K}}function C(K,ie,fe){return ie in K?Object.defineProperty(K,ie,{value:fe,enumerable:!0,configurable:!0,writable:!0}):K[ie]=fe,K}function N(K,ie){if(!(K instanceof ie))throw new TypeError("Cannot call a class as a function")}function $(K,ie){if(!K)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ie&&(typeof ie=="object"||typeof ie=="function")?ie:K}function G(K,ie){if(typeof ie!="function"&&ie!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof ie);K.prototype=Object.create(ie&&ie.prototype,{constructor:{value:K,enumerable:!1,writable:!0,configurable:!0}}),ie&&(Object.setPrototypeOf?Object.setPrototypeOf(K,ie):K.__proto__=ie)}var te=(0,O.default)("quill:keyboard"),se=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",ee=(function(K){G(ie,K),s(ie,null,[{key:"match",value:function(ue,_e){return _e=J(_e),["altKey","ctrlKey","metaKey","shiftKey"].some(function(Ce){return!!_e[Ce]!==ue[Ce]&&_e[Ce]!==null})?!1:_e.key===(ue.which||ue.keyCode)}}]);function ie(fe,ue){N(this,ie);var _e=$(this,(ie.__proto__||Object.getPrototypeOf(ie)).call(this,fe,ue));return _e.bindings={},Object.keys(_e.options.bindings).forEach(function(Ce){Ce==="list autofill"&&fe.scroll.whitelist!=null&&!fe.scroll.whitelist.list||_e.options.bindings[Ce]&&_e.addBinding(_e.options.bindings[Ce])}),_e.addBinding({key:ie.keys.ENTER,shiftKey:null},F),_e.addBinding({key:ie.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(_e.addBinding({key:ie.keys.BACKSPACE},{collapsed:!0},re),_e.addBinding({key:ie.keys.DELETE},{collapsed:!0},X)):(_e.addBinding({key:ie.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},re),_e.addBinding({key:ie.keys.DELETE},{collapsed:!0,suffix:/^.?$/},X)),_e.addBinding({key:ie.keys.BACKSPACE},{collapsed:!1},B),_e.addBinding({key:ie.keys.DELETE},{collapsed:!1},B),_e.addBinding({key:ie.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},re),_e.listen(),_e}return s(ie,[{key:"addBinding",value:function(ue){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},$e=J(ue);if($e==null||$e.key==null)return te.warn("Attempted to add invalid keyboard binding",$e);typeof _e=="function"&&(_e={handler:_e}),typeof Ce=="function"&&(Ce={handler:Ce}),$e=(0,d.default)($e,_e,Ce),this.bindings[$e.key]=this.bindings[$e.key]||[],this.bindings[$e.key].push($e)}},{key:"listen",value:function(){var ue=this;this.quill.root.addEventListener("keydown",function(_e){if(!_e.defaultPrevented){var Ce=_e.which||_e.keyCode,$e=(ue.bindings[Ce]||[]).filter(function(ot){return ie.match(_e,ot)});if($e.length!==0){var ze=ue.quill.getSelection();if(!(ze==null||!ue.quill.hasFocus())){var tt=ue.quill.getLine(ze.index),pe=o(tt,2),ut=pe[0],be=pe[1],ge=ue.quill.getLeaf(ze.index),xe=o(ge,2),Te=xe[0],Me=xe[1],ve=ze.length===0?[Te,Me]:ue.quill.getLeaf(ze.index+ze.length),ye=o(ve,2),we=ye[0],je=ye[1],Le=Te instanceof k.default.Text?Te.value().slice(0,Me):"",Ye=we instanceof k.default.Text?we.value().slice(je):"",lt={collapsed:ze.length===0,empty:ze.length===0&&ut.length()<=1,format:ue.quill.getFormat(ze),offset:be,prefix:Le,suffix:Ye},rt=$e.some(function(ot){if(ot.collapsed!=null&&ot.collapsed!==lt.collapsed||ot.empty!=null&&ot.empty!==lt.empty||ot.offset!=null&&ot.offset!==lt.offset)return!1;if(Array.isArray(ot.format)){if(ot.format.every(function(dt){return lt.format[dt]==null}))return!1}else if(a(ot.format)==="object"&&!Object.keys(ot.format).every(function(dt){return ot.format[dt]===!0?lt.format[dt]!=null:ot.format[dt]===!1?lt.format[dt]==null:(0,m.default)(ot.format[dt],lt.format[dt])}))return!1;return ot.prefix!=null&&!ot.prefix.test(lt.prefix)||ot.suffix!=null&&!ot.suffix.test(lt.suffix)?!1:ot.handler.call(ue,ze,lt)!==!0});rt&&_e.preventDefault()}}}})}}]),ie})(j.default);ee.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},ee.DEFAULTS={bindings:{bold:Y("bold"),italic:Y("italic"),underline:Y("underline"),indent:{key:ee.keys.TAB,format:["blockquote","indent","list"],handler:function(ie,fe){if(fe.collapsed&&fe.offset!==0)return!0;this.quill.format("indent","+1",A.default.sources.USER)}},outdent:{key:ee.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(ie,fe){if(fe.collapsed&&fe.offset!==0)return!0;this.quill.format("indent","-1",A.default.sources.USER)}},"outdent backspace":{key:ee.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(ie,fe){fe.format.indent!=null?this.quill.format("indent","-1",A.default.sources.USER):fe.format.list!=null&&this.quill.format("list",!1,A.default.sources.USER)}},"indent code-block":z(!0),"outdent code-block":z(!1),"remove tab":{key:ee.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(ie){this.quill.deleteText(ie.index-1,1,A.default.sources.USER)}},tab:{key:ee.keys.TAB,handler:function(ie){this.quill.history.cutoff();var fe=new _.default().retain(ie.index).delete(ie.length).insert(" ");this.quill.updateContents(fe,A.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(ie.index+1,A.default.sources.SILENT)}},"list empty enter":{key:ee.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(ie,fe){this.quill.format("list",!1,A.default.sources.USER),fe.format.indent&&this.quill.format("indent",!1,A.default.sources.USER)}},"checklist enter":{key:ee.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(ie){var fe=this.quill.getLine(ie.index),ue=o(fe,2),_e=ue[0],Ce=ue[1],$e=(0,d.default)({},_e.formats(),{list:"checked"}),ze=new _.default().retain(ie.index).insert(`
|
|
127
|
+
`,$e).retain(_e.length()-Ce-1).retain(1,{list:"unchecked"});this.quill.updateContents(ze,A.default.sources.USER),this.quill.setSelection(ie.index+1,A.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:ee.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(ie,fe){var ue=this.quill.getLine(ie.index),_e=o(ue,2),Ce=_e[0],$e=_e[1],ze=new _.default().retain(ie.index).insert(`
|
|
128
|
+
`,fe.format).retain(Ce.length()-$e-1).retain(1,{header:null});this.quill.updateContents(ze,A.default.sources.USER),this.quill.setSelection(ie.index+1,A.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(ie,fe){var ue=fe.prefix.length,_e=this.quill.getLine(ie.index),Ce=o(_e,2),$e=Ce[0],ze=Ce[1];if(ze>ue)return!0;var tt=void 0;switch(fe.prefix.trim()){case"[]":case"[ ]":tt="unchecked";break;case"[x]":tt="checked";break;case"-":case"*":tt="bullet";break;default:tt="ordered"}this.quill.insertText(ie.index," ",A.default.sources.USER),this.quill.history.cutoff();var pe=new _.default().retain(ie.index-ze).delete(ue+1).retain($e.length()-2-ze).retain(1,{list:tt});this.quill.updateContents(pe,A.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(ie.index-ue,A.default.sources.SILENT)}},"code exit":{key:ee.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(ie){var fe=this.quill.getLine(ie.index),ue=o(fe,2),_e=ue[0],Ce=ue[1],$e=new _.default().retain(ie.index+_e.length()-Ce-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents($e,A.default.sources.USER)}},"embed left":Q(ee.keys.LEFT,!1),"embed left shift":Q(ee.keys.LEFT,!0),"embed right":Q(ee.keys.RIGHT,!1),"embed right shift":Q(ee.keys.RIGHT,!0)}};function Q(K,ie){var fe,ue=K===ee.keys.LEFT?"prefix":"suffix";return fe={key:K,shiftKey:ie,altKey:null},C(fe,ue,/^$/),C(fe,"handler",function(Ce){var $e=Ce.index;K===ee.keys.RIGHT&&($e+=Ce.length+1);var ze=this.quill.getLeaf($e),tt=o(ze,1),pe=tt[0];return pe instanceof k.default.Embed?(K===ee.keys.LEFT?ie?this.quill.setSelection(Ce.index-1,Ce.length+1,A.default.sources.USER):this.quill.setSelection(Ce.index-1,A.default.sources.USER):ie?this.quill.setSelection(Ce.index,Ce.length+1,A.default.sources.USER):this.quill.setSelection(Ce.index+Ce.length+1,A.default.sources.USER),!1):!0}),fe}function re(K,ie){if(!(K.index===0||this.quill.getLength()<=1)){var fe=this.quill.getLine(K.index),ue=o(fe,1),_e=ue[0],Ce={};if(ie.offset===0){var $e=this.quill.getLine(K.index-1),ze=o($e,1),tt=ze[0];if(tt!=null&&tt.length()>1){var pe=_e.formats(),ut=this.quill.getFormat(K.index-1,1);Ce=b.default.attributes.diff(pe,ut)||{}}}var be=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(ie.prefix)?2:1;this.quill.deleteText(K.index-be,be,A.default.sources.USER),Object.keys(Ce).length>0&&this.quill.formatLine(K.index-be,be,Ce,A.default.sources.USER),this.quill.focus()}}function X(K,ie){var fe=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(ie.suffix)?2:1;if(!(K.index>=this.quill.getLength()-fe)){var ue={},_e=0,Ce=this.quill.getLine(K.index),$e=o(Ce,1),ze=$e[0];if(ie.offset>=ze.length()-1){var tt=this.quill.getLine(K.index+1),pe=o(tt,1),ut=pe[0];if(ut){var be=ze.formats(),ge=this.quill.getFormat(K.index,1);ue=b.default.attributes.diff(be,ge)||{},_e=ut.length()}}this.quill.deleteText(K.index,fe,A.default.sources.USER),Object.keys(ue).length>0&&this.quill.formatLine(K.index+_e-1,fe,ue,A.default.sources.USER)}}function B(K){var ie=this.quill.getLines(K),fe={};if(ie.length>1){var ue=ie[0].formats(),_e=ie[ie.length-1].formats();fe=b.default.attributes.diff(_e,ue)||{}}this.quill.deleteText(K,A.default.sources.USER),Object.keys(fe).length>0&&this.quill.formatLine(K.index,1,fe,A.default.sources.USER),this.quill.setSelection(K.index,A.default.sources.SILENT),this.quill.focus()}function F(K,ie){var fe=this;K.length>0&&this.quill.scroll.deleteAt(K.index,K.length);var ue=Object.keys(ie.format).reduce(function(_e,Ce){return k.default.query(Ce,k.default.Scope.BLOCK)&&!Array.isArray(ie.format[Ce])&&(_e[Ce]=ie.format[Ce]),_e},{});this.quill.insertText(K.index,`
|
|
129
|
+
`,ue,A.default.sources.USER),this.quill.setSelection(K.index+1,A.default.sources.SILENT),this.quill.focus(),Object.keys(ie.format).forEach(function(_e){ue[_e]==null&&(Array.isArray(ie.format[_e])||_e!=="link"&&fe.quill.format(_e,ie.format[_e],A.default.sources.USER))})}function z(K){return{key:ee.keys.TAB,shiftKey:!K,format:{"code-block":!0},handler:function(fe){var ue=k.default.query("code-block"),_e=fe.index,Ce=fe.length,$e=this.quill.scroll.descendant(ue,_e),ze=o($e,2),tt=ze[0],pe=ze[1];if(tt!=null){var ut=this.quill.getIndex(tt),be=tt.newlineIndex(pe,!0)+1,ge=tt.newlineIndex(ut+pe+Ce),xe=tt.domNode.textContent.slice(be,ge).split(`
|
|
130
|
+
`);pe=0,xe.forEach(function(Te,Me){K?(tt.insertAt(be+pe,ue.TAB),pe+=ue.TAB.length,Me===0?_e+=ue.TAB.length:Ce+=ue.TAB.length):Te.startsWith(ue.TAB)&&(tt.deleteAt(be+pe,ue.TAB.length),pe-=ue.TAB.length,Me===0?_e-=ue.TAB.length:Ce-=ue.TAB.length),pe+=Te.length+1}),this.quill.update(A.default.sources.USER),this.quill.setSelection(_e,Ce,A.default.sources.SILENT)}}}}function Y(K){return{key:K[0].toUpperCase(),shortKey:!0,handler:function(fe,ue){this.quill.format(K,!ue.format[K],A.default.sources.USER)}}}function J(K){if(typeof K=="string"||typeof K=="number")return J({key:K});if((typeof K>"u"?"undefined":a(K))==="object"&&(K=(0,h.default)(K,!1)),typeof K.key=="string")if(ee.keys[K.key.toUpperCase()]!=null)K.key=ee.keys[K.key.toUpperCase()];else if(K.key.length===1)K.key=K.key.toUpperCase().charCodeAt(0);else return null;return K.shortKey&&(K[se]=K.shortKey,delete K.shortKey),K}r.default=ee,r.SHORTKEY=se}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function b(S,k){var E=[],A=!0,R=!1,O=void 0;try{for(var I=S[Symbol.iterator](),j;!(A=(j=I.next()).done)&&(E.push(j.value),!(k&&E.length===k));A=!0);}catch(D){R=!0,O=D}finally{try{!A&&I.return&&I.return()}finally{if(R)throw O}}return E}return function(S,k){if(Array.isArray(S))return S;if(Symbol.iterator in Object(S))return b(S,k);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=function b(S,k,E){S===null&&(S=Function.prototype);var A=Object.getOwnPropertyDescriptor(S,k);if(A===void 0){var R=Object.getPrototypeOf(S);return R===null?void 0:b(R,k,E)}else{if("value"in A)return A.value;var O=A.get;return O===void 0?void 0:O.call(E)}},s=(function(){function b(S,k){for(var E=0;E<k.length;E++){var A=k[E];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(S,A.key,A)}}return function(S,k,E){return k&&b(S.prototype,k),E&&b(S,E),S}})(),u=i(0),h=g(u),c=i(7),m=g(c);function g(b){return b&&b.__esModule?b:{default:b}}function d(b,S){if(!(b instanceof S))throw new TypeError("Cannot call a class as a function")}function y(b,S){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:b}function _(b,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);b.prototype=Object.create(S&&S.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(b,S):b.__proto__=S)}var x=(function(b){_(S,b),s(S,null,[{key:"value",value:function(){}}]);function S(k,E){d(this,S);var A=y(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,k));return A.selection=E,A.textNode=document.createTextNode(S.CONTENTS),A.domNode.appendChild(A.textNode),A._length=0,A}return s(S,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(E,A){if(this._length!==0)return o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"format",this).call(this,E,A);for(var R=this,O=0;R!=null&&R.statics.scope!==h.default.Scope.BLOCK_BLOT;)O+=R.offset(R.parent),R=R.parent;R!=null&&(this._length=S.CONTENTS.length,R.optimize(),R.formatAt(O,S.CONTENTS.length,E,A),this._length=0)}},{key:"index",value:function(E,A){return E===this.textNode?0:o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"index",this).call(this,E,A)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var E=this.textNode,A=this.selection.getNativeRange(),R=void 0,O=void 0,I=void 0;if(A!=null&&A.start.node===E&&A.end.node===E){var j=[E,A.start.offset,A.end.offset];R=j[0],O=j[1],I=j[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==S.CONTENTS){var D=this.textNode.data.split(S.CONTENTS).join("");this.next instanceof m.default?(R=this.next.domNode,this.next.insertAt(0,D),this.textNode.data=S.CONTENTS):(this.textNode.data=D,this.parent.insertBefore(h.default.create(this.textNode),this),this.textNode=document.createTextNode(S.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),O!=null){var C=[O,I].map(function($){return Math.max(0,Math.min(R.data.length,$-1))}),N=a(C,2);return O=N[0],I=N[1],{startNode:R,startOffset:O,endNode:R,endOffset:I}}}}},{key:"update",value:function(E,A){var R=this;if(E.some(function(I){return I.type==="characterData"&&I.target===R.textNode})){var O=this.restore();O&&(A.range=O)}}},{key:"value",value:function(){return""}}]),S})(h.default.Embed);x.blotName="cursor",x.className="ql-cursor",x.tagName="span",x.CONTENTS="\uFEFF",r.default=x}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(0),o=h(a),s=i(4),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function c(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function m(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function g(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var d=(function(y){g(_,y);function _(){return c(this,_),m(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return _})(o.default.Container);d.allowedChildren=[u.default,s.BlockEmbed,d],r.default=d}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.ColorStyle=r.ColorClass=r.ColorAttributor=void 0;var a=(function(){function x(b,S){for(var k=0;k<S.length;k++){var E=S[k];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(b,E.key,E)}}return function(b,S,k){return S&&x(b.prototype,S),k&&x(b,k),b}})(),o=function x(b,S,k){b===null&&(b=Function.prototype);var E=Object.getOwnPropertyDescriptor(b,S);if(E===void 0){var A=Object.getPrototypeOf(b);return A===null?void 0:x(A,S,k)}else{if("value"in E)return E.value;var R=E.get;return R===void 0?void 0:R.call(k)}},s=i(0),u=h(s);function h(x){return x&&x.__esModule?x:{default:x}}function c(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function m(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function g(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var d=(function(x){g(b,x);function b(){return c(this,b),m(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"value",value:function(k){var E=o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,k);return E.startsWith("rgb(")?(E=E.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+E.split(",").map(function(A){return("00"+parseInt(A).toString(16)).slice(-2)}).join("")):E}}]),b})(u.default.Attributor.Style),y=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),_=new d("color","color",{scope:u.default.Scope.INLINE});r.ColorAttributor=d,r.ColorClass=y,r.ColorStyle=_}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.sanitize=r.default=void 0;var a=(function(){function _(x,b){for(var S=0;S<b.length;S++){var k=b[S];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(x,k.key,k)}}return function(x,b,S){return b&&_(x.prototype,b),S&&_(x,S),x}})(),o=function _(x,b,S){x===null&&(x=Function.prototype);var k=Object.getOwnPropertyDescriptor(x,b);if(k===void 0){var E=Object.getPrototypeOf(x);return E===null?void 0:_(E,b,S)}else{if("value"in k)return k.value;var A=k.get;return A===void 0?void 0:A.call(S)}},s=i(6),u=h(s);function h(_){return _&&_.__esModule?_:{default:_}}function c(_,x){if(!(_ instanceof x))throw new TypeError("Cannot call a class as a function")}function m(_,x){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:_}function g(_,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);_.prototype=Object.create(x&&x.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(_,x):_.__proto__=x)}var d=(function(_){g(x,_);function x(){return c(this,x),m(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return a(x,[{key:"format",value:function(S,k){if(S!==this.statics.blotName||!k)return o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,S,k);k=this.constructor.sanitize(k),this.domNode.setAttribute("href",k)}}],[{key:"create",value:function(S){var k=o(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,S);return S=this.sanitize(S),k.setAttribute("href",S),k.setAttribute("rel","noopener noreferrer"),k.setAttribute("target","_blank"),k}},{key:"formats",value:function(S){return S.getAttribute("href")}},{key:"sanitize",value:function(S){return y(S,this.PROTOCOL_WHITELIST)?S:this.SANITIZED_URL}}]),x})(u.default);d.blotName="link",d.tagName="A",d.SANITIZED_URL="about:blank",d.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function y(_,x){var b=document.createElement("a");b.href=_;var S=b.href.slice(0,b.href.indexOf(":"));return x.indexOf(S)>-1}r.default=d,r.sanitize=y}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},o=(function(){function x(b,S){for(var k=0;k<S.length;k++){var E=S[k];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(b,E.key,E)}}return function(b,S,k){return S&&x(b.prototype,S),k&&x(b,k),b}})(),s=i(23),u=m(s),h=i(107),c=m(h);function m(x){return x&&x.__esModule?x:{default:x}}function g(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}var d=0;function y(x,b){x.setAttribute(b,x.getAttribute(b)!=="true")}var _=(function(){function x(b){var S=this;g(this,x),this.select=b,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(){S.togglePicker()}),this.label.addEventListener("keydown",function(k){switch(k.keyCode){case u.default.keys.ENTER:S.togglePicker();break;case u.default.keys.ESCAPE:S.escape(),k.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(x,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),y(this.label,"aria-expanded"),y(this.options,"aria-hidden")}},{key:"buildItem",value:function(S){var k=this,E=document.createElement("span");return E.tabIndex="0",E.setAttribute("role","button"),E.classList.add("ql-picker-item"),S.hasAttribute("value")&&E.setAttribute("data-value",S.getAttribute("value")),S.textContent&&E.setAttribute("data-label",S.textContent),E.addEventListener("click",function(){k.selectItem(E,!0)}),E.addEventListener("keydown",function(A){switch(A.keyCode){case u.default.keys.ENTER:k.selectItem(E,!0),A.preventDefault();break;case u.default.keys.ESCAPE:k.escape(),A.preventDefault();break}}),E}},{key:"buildLabel",value:function(){var S=document.createElement("span");return S.classList.add("ql-picker-label"),S.innerHTML=c.default,S.tabIndex="0",S.setAttribute("role","button"),S.setAttribute("aria-expanded","false"),this.container.appendChild(S),S}},{key:"buildOptions",value:function(){var S=this,k=document.createElement("span");k.classList.add("ql-picker-options"),k.setAttribute("aria-hidden","true"),k.tabIndex="-1",k.id="ql-picker-options-"+d,d+=1,this.label.setAttribute("aria-controls",k.id),this.options=k,[].slice.call(this.select.options).forEach(function(E){var A=S.buildItem(E);k.appendChild(A),E.selected===!0&&S.selectItem(A)}),this.container.appendChild(k)}},{key:"buildPicker",value:function(){var S=this;[].slice.call(this.select.attributes).forEach(function(k){S.container.setAttribute(k.name,k.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var S=this;this.close(),setTimeout(function(){return S.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(S){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,E=this.container.querySelector(".ql-selected");if(S!==E&&(E?.classList.remove("ql-selected"),S!=null&&(S.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(S.parentNode.children,S),S.hasAttribute("data-value")?this.label.setAttribute("data-value",S.getAttribute("data-value")):this.label.removeAttribute("data-value"),S.hasAttribute("data-label")?this.label.setAttribute("data-label",S.getAttribute("data-label")):this.label.removeAttribute("data-label"),k))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":a(Event))==="object"){var A=document.createEvent("Event");A.initEvent("change",!0,!0),this.select.dispatchEvent(A)}this.close()}}},{key:"update",value:function(){var S=void 0;if(this.select.selectedIndex>-1){var k=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];S=this.select.options[this.select.selectedIndex],this.selectItem(k)}else this.selectItem(null);var E=S!=null&&S!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",E)}}]),x})();r.default=_}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(0),o=te(a),s=i(5),u=te(s),h=i(4),c=te(h),m=i(16),g=te(m),d=i(25),y=te(d),_=i(24),x=te(_),b=i(35),S=te(b),k=i(6),E=te(k),A=i(22),R=te(A),O=i(7),I=te(O),j=i(55),D=te(j),C=i(42),N=te(C),$=i(23),G=te($);function te(se){return se&&se.__esModule?se:{default:se}}u.default.register({"blots/block":c.default,"blots/block/embed":h.BlockEmbed,"blots/break":g.default,"blots/container":y.default,"blots/cursor":x.default,"blots/embed":S.default,"blots/inline":E.default,"blots/scroll":R.default,"blots/text":I.default,"modules/clipboard":D.default,"modules/history":N.default,"modules/keyboard":G.default}),o.default.register(c.default,g.default,x.default,E.default,R.default,I.default),r.default=u.default}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(1),o=(function(){function s(u){this.domNode=u,this.domNode[a.DATA_KEY]={blot:this}}return Object.defineProperty(s.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),s.create=function(u){if(this.tagName==null)throw new a.ParchmentError("Blot definition missing tagName");var h;return Array.isArray(this.tagName)?(typeof u=="string"&&(u=u.toUpperCase(),parseInt(u).toString()===u&&(u=parseInt(u))),typeof u=="number"?h=document.createElement(this.tagName[u-1]):this.tagName.indexOf(u)>-1?h=document.createElement(u):h=document.createElement(this.tagName[0])):h=document.createElement(this.tagName),this.className&&h.classList.add(this.className),h},s.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},s.prototype.clone=function(){var u=this.domNode.cloneNode(!1);return a.create(u)},s.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[a.DATA_KEY]},s.prototype.deleteAt=function(u,h){var c=this.isolate(u,h);c.remove()},s.prototype.formatAt=function(u,h,c,m){var g=this.isolate(u,h);if(a.query(c,a.Scope.BLOT)!=null&&m)g.wrap(c,m);else if(a.query(c,a.Scope.ATTRIBUTE)!=null){var d=a.create(this.statics.scope);g.wrap(d),d.format(c,m)}},s.prototype.insertAt=function(u,h,c){var m=c==null?a.create("text",h):a.create(h,c),g=this.split(u);this.parent.insertBefore(m,g)},s.prototype.insertInto=function(u,h){h===void 0&&(h=null),this.parent!=null&&this.parent.children.remove(this);var c=null;u.children.insertBefore(this,h),h!=null&&(c=h.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=c)&&u.domNode.insertBefore(this.domNode,c),this.parent=u,this.attach()},s.prototype.isolate=function(u,h){var c=this.split(u);return c.split(h),c},s.prototype.length=function(){return 1},s.prototype.offset=function(u){return u===void 0&&(u=this.parent),this.parent==null||this==u?0:this.parent.children.offset(this)+this.parent.offset(u)},s.prototype.optimize=function(u){this.domNode[a.DATA_KEY]!=null&&delete this.domNode[a.DATA_KEY].mutations},s.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},s.prototype.replace=function(u){u.parent!=null&&(u.parent.insertBefore(this,u.next),u.remove())},s.prototype.replaceWith=function(u,h){var c=typeof u=="string"?a.create(u,h):u;return c.replace(this),c},s.prototype.split=function(u,h){return u===0?this:this.next},s.prototype.update=function(u,h){},s.prototype.wrap=function(u,h){var c=typeof u=="string"?a.create(u,h):u;return this.parent!=null&&this.parent.insertBefore(c,this.next),c.appendChild(this),c},s.blotName="abstract",s})();r.default=o}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(12),o=i(32),s=i(33),u=i(1),h=(function(){function c(m){this.attributes={},this.domNode=m,this.build()}return c.prototype.attribute=function(m,g){g?m.add(this.domNode,g)&&(m.value(this.domNode)!=null?this.attributes[m.attrName]=m:delete this.attributes[m.attrName]):(m.remove(this.domNode),delete this.attributes[m.attrName])},c.prototype.build=function(){var m=this;this.attributes={};var g=a.default.keys(this.domNode),d=o.default.keys(this.domNode),y=s.default.keys(this.domNode);g.concat(d).concat(y).forEach(function(_){var x=u.query(_,u.Scope.ATTRIBUTE);x instanceof a.default&&(m.attributes[x.attrName]=x)})},c.prototype.copy=function(m){var g=this;Object.keys(this.attributes).forEach(function(d){var y=g.attributes[d].value(g.domNode);m.format(d,y)})},c.prototype.move=function(m){var g=this;this.copy(m),Object.keys(this.attributes).forEach(function(d){g.attributes[d].remove(g.domNode)}),this.attributes={}},c.prototype.values=function(){var m=this;return Object.keys(this.attributes).reduce(function(g,d){return g[d]=m.attributes[d].value(m.domNode),g},{})},c})();r.default=h}),(function(n,r,i){var a=this&&this.__extends||(function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,m){c.__proto__=m}||function(c,m){for(var g in m)m.hasOwnProperty(g)&&(c[g]=m[g])};return function(c,m){h(c,m);function g(){this.constructor=c}c.prototype=m===null?Object.create(m):(g.prototype=m.prototype,new g)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(12);function s(h,c){var m=h.getAttribute("class")||"";return m.split(/\s+/).filter(function(g){return g.indexOf(c+"-")===0})}var u=(function(h){a(c,h);function c(){return h!==null&&h.apply(this,arguments)||this}return c.keys=function(m){return(m.getAttribute("class")||"").split(/\s+/).map(function(g){return g.split("-").slice(0,-1).join("-")})},c.prototype.add=function(m,g){return this.canAdd(m,g)?(this.remove(m),m.classList.add(this.keyName+"-"+g),!0):!1},c.prototype.remove=function(m){var g=s(m,this.keyName);g.forEach(function(d){m.classList.remove(d)}),m.classList.length===0&&m.removeAttribute("class")},c.prototype.value=function(m){var g=s(m,this.keyName)[0]||"",d=g.slice(this.keyName.length+1);return this.canAdd(m,d)?d:""},c})(o.default);r.default=u}),(function(n,r,i){var a=this&&this.__extends||(function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,m){c.__proto__=m}||function(c,m){for(var g in m)m.hasOwnProperty(g)&&(c[g]=m[g])};return function(c,m){h(c,m);function g(){this.constructor=c}c.prototype=m===null?Object.create(m):(g.prototype=m.prototype,new g)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(12);function s(h){var c=h.split("-"),m=c.slice(1).map(function(g){return g[0].toUpperCase()+g.slice(1)}).join("");return c[0]+m}var u=(function(h){a(c,h);function c(){return h!==null&&h.apply(this,arguments)||this}return c.keys=function(m){return(m.getAttribute("style")||"").split(";").map(function(g){var d=g.split(":");return d[0].trim()})},c.prototype.add=function(m,g){return this.canAdd(m,g)?(m.style[s(this.keyName)]=g,!0):!1},c.prototype.remove=function(m){m.style[s(this.keyName)]="",m.getAttribute("style")||m.removeAttribute("style")},c.prototype.value=function(m){var g=m.style[s(this.keyName)];return this.canAdd(m,g)?g:""},c})(o.default);r.default=u}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function u(h,c){for(var m=0;m<c.length;m++){var g=c[m];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(h,g.key,g)}}return function(h,c,m){return c&&u(h.prototype,c),m&&u(h,m),h}})();function o(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}var s=(function(){function u(h,c){o(this,u),this.quill=h,this.options=c,this.modules={}}return a(u,[{key:"init",value:function(){var c=this;Object.keys(this.options.modules).forEach(function(m){c.modules[m]==null&&c.addModule(m)})}},{key:"addModule",value:function(c){var m=this.quill.constructor.import("modules/"+c);return this.modules[c]=new m(this.quill,this.options.modules[c]||{}),this.modules[c]}}]),u})();s.DEFAULTS={modules:{}},s.themes={default:s},r.default=s}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function b(S,k){for(var E=0;E<k.length;E++){var A=k[E];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(S,A.key,A)}}return function(S,k,E){return k&&b(S.prototype,k),E&&b(S,E),S}})(),o=function b(S,k,E){S===null&&(S=Function.prototype);var A=Object.getOwnPropertyDescriptor(S,k);if(A===void 0){var R=Object.getPrototypeOf(S);return R===null?void 0:b(R,k,E)}else{if("value"in A)return A.value;var O=A.get;return O===void 0?void 0:O.call(E)}},s=i(0),u=m(s),h=i(7),c=m(h);function m(b){return b&&b.__esModule?b:{default:b}}function g(b,S){if(!(b instanceof S))throw new TypeError("Cannot call a class as a function")}function d(b,S){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:b}function y(b,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);b.prototype=Object.create(S&&S.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(b,S):b.__proto__=S)}var _="\uFEFF",x=(function(b){y(S,b);function S(k){g(this,S);var E=d(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,k));return E.contentNode=document.createElement("span"),E.contentNode.setAttribute("contenteditable",!1),[].slice.call(E.domNode.childNodes).forEach(function(A){E.contentNode.appendChild(A)}),E.leftGuard=document.createTextNode(_),E.rightGuard=document.createTextNode(_),E.domNode.appendChild(E.leftGuard),E.domNode.appendChild(E.contentNode),E.domNode.appendChild(E.rightGuard),E}return a(S,[{key:"index",value:function(E,A){return E===this.leftGuard?0:E===this.rightGuard?1:o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"index",this).call(this,E,A)}},{key:"restore",value:function(E){var A=void 0,R=void 0,O=E.data.split(_).join("");if(E===this.leftGuard)if(this.prev instanceof c.default){var I=this.prev.length();this.prev.insertAt(I,O),A={startNode:this.prev.domNode,startOffset:I+O.length}}else R=document.createTextNode(O),this.parent.insertBefore(u.default.create(R),this),A={startNode:R,startOffset:O.length};else E===this.rightGuard&&(this.next instanceof c.default?(this.next.insertAt(0,O),A={startNode:this.next.domNode,startOffset:O.length}):(R=document.createTextNode(O),this.parent.insertBefore(u.default.create(R),this.next),A={startNode:R,startOffset:O.length}));return E.data=_,A}},{key:"update",value:function(E,A){var R=this;E.forEach(function(O){if(O.type==="characterData"&&(O.target===R.leftGuard||O.target===R.rightGuard)){var I=R.restore(O.target);I&&(A.range=I)}})}}]),S})(u.default.Embed);r.default=x}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.AlignStyle=r.AlignClass=r.AlignAttribute=void 0;var a=i(0),o=s(a);function s(g){return g&&g.__esModule?g:{default:g}}var u={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},h=new o.default.Attributor.Attribute("align","align",u),c=new o.default.Attributor.Class("align","ql-align",u),m=new o.default.Attributor.Style("align","text-align",u);r.AlignAttribute=h,r.AlignClass=c,r.AlignStyle=m}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.BackgroundStyle=r.BackgroundClass=void 0;var a=i(0),o=u(a),s=i(26);function u(m){return m&&m.__esModule?m:{default:m}}var h=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),c=new s.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});r.BackgroundClass=h,r.BackgroundStyle=c}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.DirectionStyle=r.DirectionClass=r.DirectionAttribute=void 0;var a=i(0),o=s(a);function s(g){return g&&g.__esModule?g:{default:g}}var u={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},h=new o.default.Attributor.Attribute("direction","dir",u),c=new o.default.Attributor.Class("direction","ql-direction",u),m=new o.default.Attributor.Style("direction","direction",u);r.DirectionAttribute=h,r.DirectionClass=c,r.DirectionStyle=m}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.FontClass=r.FontStyle=void 0;var a=(function(){function b(S,k){for(var E=0;E<k.length;E++){var A=k[E];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(S,A.key,A)}}return function(S,k,E){return k&&b(S.prototype,k),E&&b(S,E),S}})(),o=function b(S,k,E){S===null&&(S=Function.prototype);var A=Object.getOwnPropertyDescriptor(S,k);if(A===void 0){var R=Object.getPrototypeOf(S);return R===null?void 0:b(R,k,E)}else{if("value"in A)return A.value;var O=A.get;return O===void 0?void 0:O.call(E)}},s=i(0),u=h(s);function h(b){return b&&b.__esModule?b:{default:b}}function c(b,S){if(!(b instanceof S))throw new TypeError("Cannot call a class as a function")}function m(b,S){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:b}function g(b,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);b.prototype=Object.create(S&&S.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(b,S):b.__proto__=S)}var d={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},y=new u.default.Attributor.Class("font","ql-font",d),_=(function(b){g(S,b);function S(){return c(this,S),m(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return a(S,[{key:"value",value:function(E){return o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"value",this).call(this,E).replace(/["']/g,"")}}]),S})(u.default.Attributor.Style),x=new _("font","font-family",d);r.FontStyle=x,r.FontClass=y}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.SizeStyle=r.SizeClass=void 0;var a=i(0),o=s(a);function s(c){return c&&c.__esModule?c:{default:c}}var u=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),h=new o.default.Attributor.Style("size","font-size",{scope:o.default.Scope.INLINE,whitelist:["10px","18px","32px"]});r.SizeClass=u,r.SizeStyle=h}),(function(n,r,i){n.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.getLastChangeIndex=r.default=void 0;var a=(function(){function k(E,A){for(var R=0;R<A.length;R++){var O=A[R];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(E,O.key,O)}}return function(E,A,R){return A&&k(E.prototype,A),R&&k(E,R),E}})(),o=i(0),s=g(o),u=i(5),h=g(u),c=i(9),m=g(c);function g(k){return k&&k.__esModule?k:{default:k}}function d(k,E){if(!(k instanceof E))throw new TypeError("Cannot call a class as a function")}function y(k,E){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:k}function _(k,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);k.prototype=Object.create(E&&E.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(k,E):k.__proto__=E)}var x=(function(k){_(E,k);function E(A,R){d(this,E);var O=y(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,A,R));return O.lastRecorded=0,O.ignoreChange=!1,O.clear(),O.quill.on(h.default.events.EDITOR_CHANGE,function(I,j,D,C){I!==h.default.events.TEXT_CHANGE||O.ignoreChange||(!O.options.userOnly||C===h.default.sources.USER?O.record(j,D):O.transform(j))}),O.quill.keyboard.addBinding({key:"Z",shortKey:!0},O.undo.bind(O)),O.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},O.redo.bind(O)),/Win/i.test(navigator.platform)&&O.quill.keyboard.addBinding({key:"Y",shortKey:!0},O.redo.bind(O)),O}return a(E,[{key:"change",value:function(R,O){if(this.stack[R].length!==0){var I=this.stack[R].pop();this.stack[O].push(I),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(I[R],h.default.sources.USER),this.ignoreChange=!1;var j=S(I[R]);this.quill.setSelection(j)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(R,O){if(R.ops.length!==0){this.stack.redo=[];var I=this.quill.getContents().diff(O),j=Date.now();if(this.lastRecorded+this.options.delay>j&&this.stack.undo.length>0){var D=this.stack.undo.pop();I=I.compose(D.undo),R=D.redo.compose(R)}else this.lastRecorded=j;this.stack.undo.push({redo:R,undo:I}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(R){this.stack.undo.forEach(function(O){O.undo=R.transform(O.undo,!0),O.redo=R.transform(O.redo,!0)}),this.stack.redo.forEach(function(O){O.undo=R.transform(O.undo,!0),O.redo=R.transform(O.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),E})(m.default);x.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function b(k){var E=k.ops[k.ops.length-1];return E==null?!1:E.insert!=null?typeof E.insert=="string"&&E.insert.endsWith(`
|
|
131
|
+
`):E.attributes!=null?Object.keys(E.attributes).some(function(A){return s.default.query(A,s.default.Scope.BLOCK)!=null}):!1}function S(k){var E=k.reduce(function(R,O){return R+=O.delete||0,R},0),A=k.length()-E;return b(k)&&(A-=1),A}r.default=x,r.getLastChangeIndex=S}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BaseTooltip=void 0;var a=(function(){function F(z,Y){for(var J=0;J<Y.length;J++){var K=Y[J];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(z,K.key,K)}}return function(z,Y,J){return Y&&F(z.prototype,Y),J&&F(z,J),z}})(),o=function F(z,Y,J){z===null&&(z=Function.prototype);var K=Object.getOwnPropertyDescriptor(z,Y);if(K===void 0){var ie=Object.getPrototypeOf(z);return ie===null?void 0:F(ie,Y,J)}else{if("value"in K)return K.value;var fe=K.get;return fe===void 0?void 0:fe.call(J)}},s=i(3),u=j(s),h=i(2),c=j(h),m=i(8),g=j(m),d=i(23),y=j(d),_=i(34),x=j(_),b=i(59),S=j(b),k=i(60),E=j(k),A=i(28),R=j(A),O=i(61),I=j(O);function j(F){return F&&F.__esModule?F:{default:F}}function D(F,z){if(!(F instanceof z))throw new TypeError("Cannot call a class as a function")}function C(F,z){if(!F)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return z&&(typeof z=="object"||typeof z=="function")?z:F}function N(F,z){if(typeof z!="function"&&z!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof z);F.prototype=Object.create(z&&z.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}}),z&&(Object.setPrototypeOf?Object.setPrototypeOf(F,z):F.__proto__=z)}var $=[!1,"center","right","justify"],G=["#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"],te=[!1,"serif","monospace"],se=["1","2","3",!1],ee=["small",!1,"large","huge"],Q=(function(F){N(z,F);function z(Y,J){D(this,z);var K=C(this,(z.__proto__||Object.getPrototypeOf(z)).call(this,Y,J)),ie=function fe(ue){if(!document.body.contains(Y.root))return document.body.removeEventListener("click",fe);K.tooltip!=null&&!K.tooltip.root.contains(ue.target)&&document.activeElement!==K.tooltip.textbox&&!K.quill.hasFocus()&&K.tooltip.hide(),K.pickers!=null&&K.pickers.forEach(function(_e){_e.container.contains(ue.target)||_e.close()})};return Y.emitter.listenDOM("click",document.body,ie),K}return a(z,[{key:"addModule",value:function(J){var K=o(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"addModule",this).call(this,J);return J==="toolbar"&&this.extendToolbar(K),K}},{key:"buildButtons",value:function(J,K){J.forEach(function(ie){var fe=ie.getAttribute("class")||"";fe.split(/\s+/).forEach(function(ue){if(ue.startsWith("ql-")&&(ue=ue.slice(3),K[ue]!=null))if(ue==="direction")ie.innerHTML=K[ue][""]+K[ue].rtl;else if(typeof K[ue]=="string")ie.innerHTML=K[ue];else{var _e=ie.value||"";_e!=null&&K[ue][_e]&&(ie.innerHTML=K[ue][_e])}})})}},{key:"buildPickers",value:function(J,K){var ie=this;this.pickers=J.map(function(ue){if(ue.classList.contains("ql-align"))return ue.querySelector("option")==null&&B(ue,$),new E.default(ue,K.align);if(ue.classList.contains("ql-background")||ue.classList.contains("ql-color")){var _e=ue.classList.contains("ql-background")?"background":"color";return ue.querySelector("option")==null&&B(ue,G,_e==="background"?"#ffffff":"#000000"),new S.default(ue,K[_e])}else return ue.querySelector("option")==null&&(ue.classList.contains("ql-font")?B(ue,te):ue.classList.contains("ql-header")?B(ue,se):ue.classList.contains("ql-size")&&B(ue,ee)),new R.default(ue)});var fe=function(){ie.pickers.forEach(function(_e){_e.update()})};this.quill.on(g.default.events.EDITOR_CHANGE,fe)}}]),z})(x.default);Q.DEFAULTS=(0,u.default)(!0,{},x.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var z=this,Y=this.container.querySelector("input.ql-image[type=file]");Y==null&&(Y=document.createElement("input"),Y.setAttribute("type","file"),Y.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),Y.classList.add("ql-image"),Y.addEventListener("change",function(){if(Y.files!=null&&Y.files[0]!=null){var J=new FileReader;J.onload=function(K){var ie=z.quill.getSelection(!0);z.quill.updateContents(new c.default().retain(ie.index).delete(ie.length).insert({image:K.target.result}),g.default.sources.USER),z.quill.setSelection(ie.index+1,g.default.sources.SILENT),Y.value=""},J.readAsDataURL(Y.files[0])}}),this.container.appendChild(Y)),Y.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var re=(function(F){N(z,F);function z(Y,J){D(this,z);var K=C(this,(z.__proto__||Object.getPrototypeOf(z)).call(this,Y,J));return K.textbox=K.root.querySelector('input[type="text"]'),K.listen(),K}return a(z,[{key:"listen",value:function(){var J=this;this.textbox.addEventListener("keydown",function(K){y.default.match(K,"enter")?(J.save(),K.preventDefault()):y.default.match(K,"escape")&&(J.cancel(),K.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),K!=null?this.textbox.value=K:J!==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-"+J)||""),this.root.setAttribute("data-mode",J)}},{key:"restoreFocus",value:function(){var J=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=J}},{key:"save",value:function(){var J=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var K=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",J,g.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",J,g.default.sources.USER)),this.quill.root.scrollTop=K;break}case"video":J=X(J);case"formula":{if(!J)break;var ie=this.quill.getSelection(!0);if(ie!=null){var fe=ie.index+ie.length;this.quill.insertEmbed(fe,this.root.getAttribute("data-mode"),J,g.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(fe+1," ",g.default.sources.USER),this.quill.setSelection(fe+2,g.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),z})(I.default);function X(F){var z=F.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||F.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return z?(z[1]||"https")+"://www.youtube.com/embed/"+z[2]+"?showinfo=0":(z=F.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(z[1]||"https")+"://player.vimeo.com/video/"+z[2]+"/":F}function B(F,z){var Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;z.forEach(function(J){var K=document.createElement("option");J===Y?K.setAttribute("selected","selected"):K.setAttribute("value",J),F.appendChild(K)})}r.BaseTooltip=re,r.default=Q}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function o(){this.head=this.tail=null,this.length=0}return o.prototype.append=function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];this.insertBefore(s[0],null),s.length>1&&this.append.apply(this,s.slice(1))},o.prototype.contains=function(s){for(var u,h=this.iterator();u=h();)if(u===s)return!0;return!1},o.prototype.insertBefore=function(s,u){s&&(s.next=u,u!=null?(s.prev=u.prev,u.prev!=null&&(u.prev.next=s),u.prev=s,u===this.head&&(this.head=s)):this.tail!=null?(this.tail.next=s,s.prev=this.tail,this.tail=s):(s.prev=null,this.head=this.tail=s),this.length+=1)},o.prototype.offset=function(s){for(var u=0,h=this.head;h!=null;){if(h===s)return u;u+=h.length(),h=h.next}return-1},o.prototype.remove=function(s){this.contains(s)&&(s.prev!=null&&(s.prev.next=s.next),s.next!=null&&(s.next.prev=s.prev),s===this.head&&(this.head=s.next),s===this.tail&&(this.tail=s.prev),this.length-=1)},o.prototype.iterator=function(s){return s===void 0&&(s=this.head),function(){var u=s;return s!=null&&(s=s.next),u}},o.prototype.find=function(s,u){u===void 0&&(u=!1);for(var h,c=this.iterator();h=c();){var m=h.length();if(s<m||u&&s===m&&(h.next==null||h.next.length()!==0))return[h,s];s-=m}return[null,0]},o.prototype.forEach=function(s){for(var u,h=this.iterator();u=h();)s(u)},o.prototype.forEachAt=function(s,u,h){if(!(u<=0))for(var c=this.find(s),m=c[0],g=c[1],d,y=s-g,_=this.iterator(m);(d=_())&&y<s+u;){var x=d.length();s>y?h(d,s-y,Math.min(u,y+x-s)):h(d,0,Math.min(x,s+u-y)),y+=x}},o.prototype.map=function(s){return this.reduce(function(u,h){return u.push(s(h)),u},[])},o.prototype.reduce=function(s,u){for(var h,c=this.iterator();h=c();)u=s(u,h);return u},o})();r.default=a}),(function(n,r,i){var a=this&&this.__extends||(function(){var m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,d){g.__proto__=d}||function(g,d){for(var y in d)d.hasOwnProperty(y)&&(g[y]=d[y])};return function(g,d){m(g,d);function y(){this.constructor=g}g.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(17),s=i(1),u={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},h=100,c=(function(m){a(g,m);function g(d){var y=m.call(this,d)||this;return y.scroll=y,y.observer=new MutationObserver(function(_){y.update(_)}),y.observer.observe(y.domNode,u),y.attach(),y}return g.prototype.detach=function(){m.prototype.detach.call(this),this.observer.disconnect()},g.prototype.deleteAt=function(d,y){this.update(),d===0&&y===this.length()?this.children.forEach(function(_){_.remove()}):m.prototype.deleteAt.call(this,d,y)},g.prototype.formatAt=function(d,y,_,x){this.update(),m.prototype.formatAt.call(this,d,y,_,x)},g.prototype.insertAt=function(d,y,_){this.update(),m.prototype.insertAt.call(this,d,y,_)},g.prototype.optimize=function(d,y){var _=this;d===void 0&&(d=[]),y===void 0&&(y={}),m.prototype.optimize.call(this,y);for(var x=[].slice.call(this.observer.takeRecords());x.length>0;)d.push(x.pop());for(var b=function(A,R){R===void 0&&(R=!0),!(A==null||A===_)&&A.domNode.parentNode!=null&&(A.domNode[s.DATA_KEY].mutations==null&&(A.domNode[s.DATA_KEY].mutations=[]),R&&b(A.parent))},S=function(A){A.domNode[s.DATA_KEY]==null||A.domNode[s.DATA_KEY].mutations==null||(A instanceof o.default&&A.children.forEach(S),A.optimize(y))},k=d,E=0;k.length>0;E+=1){if(E>=h)throw new Error("[Parchment] Maximum optimize iterations reached");for(k.forEach(function(A){var R=s.find(A.target,!0);R!=null&&(R.domNode===A.target&&(A.type==="childList"?(b(s.find(A.previousSibling,!1)),[].forEach.call(A.addedNodes,function(O){var I=s.find(O,!1);b(I,!1),I instanceof o.default&&I.children.forEach(function(j){b(j,!1)})})):A.type==="attributes"&&b(R.prev)),b(R))}),this.children.forEach(S),k=[].slice.call(this.observer.takeRecords()),x=k.slice();x.length>0;)d.push(x.pop())}},g.prototype.update=function(d,y){var _=this;y===void 0&&(y={}),d=d||this.observer.takeRecords(),d.map(function(x){var b=s.find(x.target,!0);return b==null?null:b.domNode[s.DATA_KEY].mutations==null?(b.domNode[s.DATA_KEY].mutations=[x],b):(b.domNode[s.DATA_KEY].mutations.push(x),null)}).forEach(function(x){x==null||x===_||x.domNode[s.DATA_KEY]==null||x.update(x.domNode[s.DATA_KEY].mutations||[],y)}),this.domNode[s.DATA_KEY].mutations!=null&&m.prototype.update.call(this,this.domNode[s.DATA_KEY].mutations,y),this.optimize(d,y)},g.blotName="scroll",g.defaultChild="block",g.scope=s.Scope.BLOCK_BLOT,g.tagName="DIV",g})(o.default);r.default=c}),(function(n,r,i){var a=this&&this.__extends||(function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,g){m.__proto__=g}||function(m,g){for(var d in g)g.hasOwnProperty(d)&&(m[d]=g[d])};return function(m,g){c(m,g);function d(){this.constructor=m}m.prototype=g===null?Object.create(g):(d.prototype=g.prototype,new d)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(18),s=i(1);function u(c,m){if(Object.keys(c).length!==Object.keys(m).length)return!1;for(var g in c)if(c[g]!==m[g])return!1;return!0}var h=(function(c){a(m,c);function m(){return c!==null&&c.apply(this,arguments)||this}return m.formats=function(g){if(g.tagName!==m.tagName)return c.formats.call(this,g)},m.prototype.format=function(g,d){var y=this;g===this.statics.blotName&&!d?(this.children.forEach(function(_){_ instanceof o.default||(_=_.wrap(m.blotName,!0)),y.attributes.copy(_)}),this.unwrap()):c.prototype.format.call(this,g,d)},m.prototype.formatAt=function(g,d,y,_){if(this.formats()[y]!=null||s.query(y,s.Scope.ATTRIBUTE)){var x=this.isolate(g,d);x.format(y,_)}else c.prototype.formatAt.call(this,g,d,y,_)},m.prototype.optimize=function(g){c.prototype.optimize.call(this,g);var d=this.formats();if(Object.keys(d).length===0)return this.unwrap();var y=this.next;y instanceof m&&y.prev===this&&u(d,y.formats())&&(y.moveChildren(this),y.remove())},m.blotName="inline",m.scope=s.Scope.INLINE_BLOT,m.tagName="SPAN",m})(o.default);r.default=h}),(function(n,r,i){var a=this&&this.__extends||(function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,m){c.__proto__=m}||function(c,m){for(var g in m)m.hasOwnProperty(g)&&(c[g]=m[g])};return function(c,m){h(c,m);function g(){this.constructor=c}c.prototype=m===null?Object.create(m):(g.prototype=m.prototype,new g)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(18),s=i(1),u=(function(h){a(c,h);function c(){return h!==null&&h.apply(this,arguments)||this}return c.formats=function(m){var g=s.query(c.blotName).tagName;if(m.tagName!==g)return h.formats.call(this,m)},c.prototype.format=function(m,g){s.query(m,s.Scope.BLOCK)!=null&&(m===this.statics.blotName&&!g?this.replaceWith(c.blotName):h.prototype.format.call(this,m,g))},c.prototype.formatAt=function(m,g,d,y){s.query(d,s.Scope.BLOCK)!=null?this.format(d,y):h.prototype.formatAt.call(this,m,g,d,y)},c.prototype.insertAt=function(m,g,d){if(d==null||s.query(g,s.Scope.INLINE)!=null)h.prototype.insertAt.call(this,m,g,d);else{var y=this.split(m),_=s.create(g,d);y.parent.insertBefore(_,y)}},c.prototype.update=function(m,g){navigator.userAgent.match(/Trident/)?this.build():h.prototype.update.call(this,m,g)},c.blotName="block",c.scope=s.Scope.BLOCK_BLOT,c.tagName="P",c})(o.default);r.default=u}),(function(n,r,i){var a=this&&this.__extends||(function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,c){h.__proto__=c}||function(h,c){for(var m in c)c.hasOwnProperty(m)&&(h[m]=c[m])};return function(h,c){u(h,c);function m(){this.constructor=h}h.prototype=c===null?Object.create(c):(m.prototype=c.prototype,new m)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(19),s=(function(u){a(h,u);function h(){return u!==null&&u.apply(this,arguments)||this}return h.formats=function(c){},h.prototype.format=function(c,m){u.prototype.formatAt.call(this,0,this.length(),c,m)},h.prototype.formatAt=function(c,m,g,d){c===0&&m===this.length()?this.format(g,d):u.prototype.formatAt.call(this,c,m,g,d)},h.prototype.formats=function(){return this.statics.formats(this.domNode)},h})(o.default);r.default=s}),(function(n,r,i){var a=this&&this.__extends||(function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,m){c.__proto__=m}||function(c,m){for(var g in m)m.hasOwnProperty(g)&&(c[g]=m[g])};return function(c,m){h(c,m);function g(){this.constructor=c}c.prototype=m===null?Object.create(m):(g.prototype=m.prototype,new g)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(19),s=i(1),u=(function(h){a(c,h);function c(m){var g=h.call(this,m)||this;return g.text=g.statics.value(g.domNode),g}return c.create=function(m){return document.createTextNode(m)},c.value=function(m){var g=m.data;return g.normalize&&(g=g.normalize()),g},c.prototype.deleteAt=function(m,g){this.domNode.data=this.text=this.text.slice(0,m)+this.text.slice(m+g)},c.prototype.index=function(m,g){return this.domNode===m?g:-1},c.prototype.insertAt=function(m,g,d){d==null?(this.text=this.text.slice(0,m)+g+this.text.slice(m),this.domNode.data=this.text):h.prototype.insertAt.call(this,m,g,d)},c.prototype.length=function(){return this.text.length},c.prototype.optimize=function(m){h.prototype.optimize.call(this,m),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof c&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},c.prototype.position=function(m,g){return[this.domNode,m]},c.prototype.split=function(m,g){if(g===void 0&&(g=!1),!g){if(m===0)return this;if(m===this.length())return this.next}var d=s.create(this.domNode.splitText(m));return this.parent.insertBefore(d,this.next),this.text=this.statics.value(this.domNode),d},c.prototype.update=function(m,g){var d=this;m.some(function(y){return y.type==="characterData"&&y.target===d.domNode})&&(this.text=this.statics.value(this.domNode))},c.prototype.value=function(){return this.text},c.blotName="text",c.scope=s.Scope.INLINE_BLOT,c})(o.default);r.default=u}),(function(n,r,i){var a=document.createElement("div");if(a.classList.toggle("test-class",!1),a.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(s,u){return arguments.length>1&&!this.contains(s)==!u?u:o.call(this,s)}}String.prototype.startsWith||(String.prototype.startsWith=function(s,u){return u=u||0,this.substr(u,s.length)===s}),String.prototype.endsWith||(String.prototype.endsWith=function(s,u){var h=this.toString();(typeof u!="number"||!isFinite(u)||Math.floor(u)!==u||u>h.length)&&(u=h.length),u-=s.length;var c=h.indexOf(s,u);return c!==-1&&c===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 h=Object(this),c=h.length>>>0,m=arguments[1],g,d=0;d<c;d++)if(g=h[d],u.call(m,g,d,h))return g}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})}),(function(n,r){var i=-1,a=1,o=0;function s(E,A,R){if(E==A)return E?[[o,E]]:[];(R<0||E.length<R)&&(R=null);var O=m(E,A),I=E.substring(0,O);E=E.substring(O),A=A.substring(O),O=g(E,A);var j=E.substring(E.length-O);E=E.substring(0,E.length-O),A=A.substring(0,A.length-O);var D=u(E,A);return I&&D.unshift([o,I]),j&&D.push([o,j]),y(D),R!=null&&(D=b(D,R)),D=S(D),D}function u(E,A){var R;if(!E)return[[a,A]];if(!A)return[[i,E]];var O=E.length>A.length?E:A,I=E.length>A.length?A:E,j=O.indexOf(I);if(j!=-1)return R=[[a,O.substring(0,j)],[o,I],[a,O.substring(j+I.length)]],E.length>A.length&&(R[0][0]=R[2][0]=i),R;if(I.length==1)return[[i,E],[a,A]];var D=d(E,A);if(D){var C=D[0],N=D[1],$=D[2],G=D[3],te=D[4],se=s(C,$),ee=s(N,G);return se.concat([[o,te]],ee)}return h(E,A)}function h(E,A){for(var R=E.length,O=A.length,I=Math.ceil((R+O)/2),j=I,D=2*I,C=new Array(D),N=new Array(D),$=0;$<D;$++)C[$]=-1,N[$]=-1;C[j+1]=0,N[j+1]=0;for(var G=R-O,te=G%2!=0,se=0,ee=0,Q=0,re=0,X=0;X<I;X++){for(var B=-X+se;B<=X-ee;B+=2){var F=j+B,z;B==-X||B!=X&&C[F-1]<C[F+1]?z=C[F+1]:z=C[F-1]+1;for(var Y=z-B;z<R&&Y<O&&E.charAt(z)==A.charAt(Y);)z++,Y++;if(C[F]=z,z>R)ee+=2;else if(Y>O)se+=2;else if(te){var J=j+G-B;if(J>=0&&J<D&&N[J]!=-1){var K=R-N[J];if(z>=K)return c(E,A,z,Y)}}}for(var ie=-X+Q;ie<=X-re;ie+=2){var J=j+ie,K;ie==-X||ie!=X&&N[J-1]<N[J+1]?K=N[J+1]:K=N[J-1]+1;for(var fe=K-ie;K<R&&fe<O&&E.charAt(R-K-1)==A.charAt(O-fe-1);)K++,fe++;if(N[J]=K,K>R)re+=2;else if(fe>O)Q+=2;else if(!te){var F=j+G-ie;if(F>=0&&F<D&&C[F]!=-1){var z=C[F],Y=j+z-F;if(K=R-K,z>=K)return c(E,A,z,Y)}}}}return[[i,E],[a,A]]}function c(E,A,R,O){var I=E.substring(0,R),j=A.substring(0,O),D=E.substring(R),C=A.substring(O),N=s(I,j),$=s(D,C);return N.concat($)}function m(E,A){if(!E||!A||E.charAt(0)!=A.charAt(0))return 0;for(var R=0,O=Math.min(E.length,A.length),I=O,j=0;R<I;)E.substring(j,I)==A.substring(j,I)?(R=I,j=R):O=I,I=Math.floor((O-R)/2+R);return I}function g(E,A){if(!E||!A||E.charAt(E.length-1)!=A.charAt(A.length-1))return 0;for(var R=0,O=Math.min(E.length,A.length),I=O,j=0;R<I;)E.substring(E.length-I,E.length-j)==A.substring(A.length-I,A.length-j)?(R=I,j=R):O=I,I=Math.floor((O-R)/2+R);return I}function d(E,A){var R=E.length>A.length?E:A,O=E.length>A.length?A:E;if(R.length<4||O.length*2<R.length)return null;function I(ee,Q,re){for(var X=ee.substring(re,re+Math.floor(ee.length/4)),B=-1,F="",z,Y,J,K;(B=Q.indexOf(X,B+1))!=-1;){var ie=m(ee.substring(re),Q.substring(B)),fe=g(ee.substring(0,re),Q.substring(0,B));F.length<fe+ie&&(F=Q.substring(B-fe,B)+Q.substring(B,B+ie),z=ee.substring(0,re-fe),Y=ee.substring(re+ie),J=Q.substring(0,B-fe),K=Q.substring(B+ie))}return F.length*2>=ee.length?[z,Y,J,K,F]:null}var j=I(R,O,Math.ceil(R.length/4)),D=I(R,O,Math.ceil(R.length/2)),C;if(!j&&!D)return null;D?j?C=j[4].length>D[4].length?j:D:C=D:C=j;var N,$,G,te;E.length>A.length?(N=C[0],$=C[1],G=C[2],te=C[3]):(G=C[0],te=C[1],N=C[2],$=C[3]);var se=C[4];return[N,$,G,te,se]}function y(E){E.push([o,""]);for(var A=0,R=0,O=0,I="",j="",D;A<E.length;)switch(E[A][0]){case a:O++,j+=E[A][1],A++;break;case i:R++,I+=E[A][1],A++;break;case o:R+O>1?(R!==0&&O!==0&&(D=m(j,I),D!==0&&(A-R-O>0&&E[A-R-O-1][0]==o?E[A-R-O-1][1]+=j.substring(0,D):(E.splice(0,0,[o,j.substring(0,D)]),A++),j=j.substring(D),I=I.substring(D)),D=g(j,I),D!==0&&(E[A][1]=j.substring(j.length-D)+E[A][1],j=j.substring(0,j.length-D),I=I.substring(0,I.length-D))),R===0?E.splice(A-O,R+O,[a,j]):O===0?E.splice(A-R,R+O,[i,I]):E.splice(A-R-O,R+O,[i,I],[a,j]),A=A-R-O+(R?1:0)+(O?1:0)+1):A!==0&&E[A-1][0]==o?(E[A-1][1]+=E[A][1],E.splice(A,1)):A++,O=0,R=0,I="",j="";break}E[E.length-1][1]===""&&E.pop();var C=!1;for(A=1;A<E.length-1;)E[A-1][0]==o&&E[A+1][0]==o&&(E[A][1].substring(E[A][1].length-E[A-1][1].length)==E[A-1][1]?(E[A][1]=E[A-1][1]+E[A][1].substring(0,E[A][1].length-E[A-1][1].length),E[A+1][1]=E[A-1][1]+E[A+1][1],E.splice(A-1,1),C=!0):E[A][1].substring(0,E[A+1][1].length)==E[A+1][1]&&(E[A-1][1]+=E[A+1][1],E[A][1]=E[A][1].substring(E[A+1][1].length)+E[A+1][1],E.splice(A+1,1),C=!0)),A++;C&&y(E)}var _=s;_.INSERT=a,_.DELETE=i,_.EQUAL=o,n.exports=_;function x(E,A){if(A===0)return[o,E];for(var R=0,O=0;O<E.length;O++){var I=E[O];if(I[0]===i||I[0]===o){var j=R+I[1].length;if(A===j)return[O+1,E];if(A<j){E=E.slice();var D=A-R,C=[I[0],I[1].slice(0,D)],N=[I[0],I[1].slice(D)];return E.splice(O,1,C,N),[O+1,E]}else R=j}}throw new Error("cursor_pos is out of bounds!")}function b(E,A){var R=x(E,A),O=R[1],I=R[0],j=O[I],D=O[I+1];if(j==null)return E;if(j[0]!==o)return E;if(D!=null&&j[1]+D[1]===D[1]+j[1])return O.splice(I,2,D,j),k(O,I,2);if(D!=null&&D[1].indexOf(j[1])===0){O.splice(I,2,[D[0],j[1]],[0,j[1]]);var C=D[1].slice(j[1].length);return C.length>0&&O.splice(I+2,0,[D[0],C]),k(O,I,3)}else return E}function S(E){for(var A=!1,R=function(D){return D.charCodeAt(0)>=56320&&D.charCodeAt(0)<=57343},O=function(D){return D.charCodeAt(D.length-1)>=55296&&D.charCodeAt(D.length-1)<=56319},I=2;I<E.length;I+=1)E[I-2][0]===o&&O(E[I-2][1])&&E[I-1][0]===i&&R(E[I-1][1])&&E[I][0]===a&&R(E[I][1])&&(A=!0,E[I-1][1]=E[I-2][1].slice(-1)+E[I-1][1],E[I][1]=E[I-2][1].slice(-1)+E[I][1],E[I-2][1]=E[I-2][1].slice(0,-1));if(!A)return E;for(var j=[],I=0;I<E.length;I+=1)E[I][1].length>0&&j.push(E[I]);return j}function k(E,A,R){for(var O=A+R-1;O>=0&&O>=A-1;O--)if(O+1<E.length){var I=E[O],j=E[O+1];I[0]===j[1]&&E.splice(O,2,[I[0],I[1]+j[1]])}return E}}),(function(n,r){r=n.exports=typeof Object.keys=="function"?Object.keys:i,r.shim=i;function i(a){var o=[];for(var s in a)o.push(s);return o}}),(function(n,r){var i=(function(){return Object.prototype.toString.call(arguments)})()=="[object Arguments]";r=n.exports=i?a:o,r.supported=a;function a(s){return Object.prototype.toString.call(s)=="[object Arguments]"}r.unsupported=o;function o(s){return s&&typeof s=="object"&&typeof s.length=="number"&&Object.prototype.hasOwnProperty.call(s,"callee")&&!Object.prototype.propertyIsEnumerable.call(s,"callee")||!1}}),(function(n,r){var i=Object.prototype.hasOwnProperty,a="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(a=!1));function s(h,c,m){this.fn=h,this.context=c,this.once=m||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var c=[],m,g;if(this._eventsCount===0)return c;for(g in m=this._events)i.call(m,g)&&c.push(a?g.slice(1):g);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(m)):c},u.prototype.listeners=function(c,m){var g=a?a+c:c,d=this._events[g];if(m)return!!d;if(!d)return[];if(d.fn)return[d.fn];for(var y=0,_=d.length,x=new Array(_);y<_;y++)x[y]=d[y].fn;return x},u.prototype.emit=function(c,m,g,d,y,_){var x=a?a+c:c;if(!this._events[x])return!1;var b=this._events[x],S=arguments.length,k,E;if(b.fn){switch(b.once&&this.removeListener(c,b.fn,void 0,!0),S){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,m),!0;case 3:return b.fn.call(b.context,m,g),!0;case 4:return b.fn.call(b.context,m,g,d),!0;case 5:return b.fn.call(b.context,m,g,d,y),!0;case 6:return b.fn.call(b.context,m,g,d,y,_),!0}for(E=1,k=new Array(S-1);E<S;E++)k[E-1]=arguments[E];b.fn.apply(b.context,k)}else{var A=b.length,R;for(E=0;E<A;E++)switch(b[E].once&&this.removeListener(c,b[E].fn,void 0,!0),S){case 1:b[E].fn.call(b[E].context);break;case 2:b[E].fn.call(b[E].context,m);break;case 3:b[E].fn.call(b[E].context,m,g);break;case 4:b[E].fn.call(b[E].context,m,g,d);break;default:if(!k)for(R=1,k=new Array(S-1);R<S;R++)k[R-1]=arguments[R];b[E].fn.apply(b[E].context,k)}}return!0},u.prototype.on=function(c,m,g){var d=new s(m,g||this),y=a?a+c:c;return this._events[y]?this._events[y].fn?this._events[y]=[this._events[y],d]:this._events[y].push(d):(this._events[y]=d,this._eventsCount++),this},u.prototype.once=function(c,m,g){var d=new s(m,g||this,!0),y=a?a+c:c;return this._events[y]?this._events[y].fn?this._events[y]=[this._events[y],d]:this._events[y].push(d):(this._events[y]=d,this._eventsCount++),this},u.prototype.removeListener=function(c,m,g,d){var y=a?a+c:c;if(!this._events[y])return this;if(!m)return--this._eventsCount===0?this._events=new o:delete this._events[y],this;var _=this._events[y];if(_.fn)_.fn===m&&(!d||_.once)&&(!g||_.context===g)&&(--this._eventsCount===0?this._events=new o:delete this._events[y]);else{for(var x=0,b=[],S=_.length;x<S;x++)(_[x].fn!==m||d&&!_[x].once||g&&_[x].context!==g)&&b.push(_[x]);b.length?this._events[y]=b.length===1?b[0]:b:--this._eventsCount===0?this._events=new o:delete this._events[y]}return this},u.prototype.removeAllListeners=function(c){var m;return c?(m=a?a+c:c,this._events[m]&&(--this._eventsCount===0?this._events=new o:delete this._events[m])):(this._events=new o,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prototype.setMaxListeners=function(){return this},u.prefixed=a,u.EventEmitter=u,typeof n<"u"&&(n.exports=u)}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.matchText=r.matchSpacing=r.matchNewline=r.matchBlot=r.matchAttributor=r.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ge){return typeof ge}:function(ge){return ge&&typeof Symbol=="function"&&ge.constructor===Symbol&&ge!==Symbol.prototype?"symbol":typeof ge},o=(function(){function ge(xe,Te){var Me=[],ve=!0,ye=!1,we=void 0;try{for(var je=xe[Symbol.iterator](),Le;!(ve=(Le=je.next()).done)&&(Me.push(Le.value),!(Te&&Me.length===Te));ve=!0);}catch(Ye){ye=!0,we=Ye}finally{try{!ve&&je.return&&je.return()}finally{if(ye)throw we}}return Me}return function(xe,Te){if(Array.isArray(xe))return xe;if(Symbol.iterator in Object(xe))return ge(xe,Te);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),s=(function(){function ge(xe,Te){for(var Me=0;Me<Te.length;Me++){var ve=Te[Me];ve.enumerable=ve.enumerable||!1,ve.configurable=!0,"value"in ve&&(ve.writable=!0),Object.defineProperty(xe,ve.key,ve)}}return function(xe,Te,Me){return Te&&ge(xe.prototype,Te),Me&&ge(xe,Me),xe}})(),u=i(3),h=N(u),c=i(2),m=N(c),g=i(0),d=N(g),y=i(5),_=N(y),x=i(10),b=N(x),S=i(9),k=N(S),E=i(36),A=i(37),R=i(13),O=N(R),I=i(26),j=i(38),D=i(39),C=i(40);function N(ge){return ge&&ge.__esModule?ge:{default:ge}}function $(ge,xe,Te){return xe in ge?Object.defineProperty(ge,xe,{value:Te,enumerable:!0,configurable:!0,writable:!0}):ge[xe]=Te,ge}function G(ge,xe){if(!(ge instanceof xe))throw new TypeError("Cannot call a class as a function")}function te(ge,xe){if(!ge)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return xe&&(typeof xe=="object"||typeof xe=="function")?xe:ge}function se(ge,xe){if(typeof xe!="function"&&xe!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof xe);ge.prototype=Object.create(xe&&xe.prototype,{constructor:{value:ge,enumerable:!1,writable:!0,configurable:!0}}),xe&&(Object.setPrototypeOf?Object.setPrototypeOf(ge,xe):ge.__proto__=xe)}var ee=(0,b.default)("quill:clipboard"),Q="__ql-matcher",re=[[Node.TEXT_NODE,be],[Node.TEXT_NODE,tt],["br",Ce],[Node.ELEMENT_NODE,tt],[Node.ELEMENT_NODE,_e],[Node.ELEMENT_NODE,pe],[Node.ELEMENT_NODE,ue],[Node.ELEMENT_NODE,ut],["li",ze],["b",fe.bind(fe,"bold")],["i",fe.bind(fe,"italic")],["style",$e]],X=[E.AlignAttribute,j.DirectionAttribute].reduce(function(ge,xe){return ge[xe.keyName]=xe,ge},{}),B=[E.AlignStyle,A.BackgroundStyle,I.ColorStyle,j.DirectionStyle,D.FontStyle,C.SizeStyle].reduce(function(ge,xe){return ge[xe.keyName]=xe,ge},{}),F=(function(ge){se(xe,ge);function xe(Te,Me){G(this,xe);var ve=te(this,(xe.__proto__||Object.getPrototypeOf(xe)).call(this,Te,Me));return ve.quill.root.addEventListener("paste",ve.onPaste.bind(ve)),ve.container=ve.quill.addContainer("ql-clipboard"),ve.container.setAttribute("contenteditable",!0),ve.container.setAttribute("tabindex",-1),ve.matchers=[],re.concat(ve.options.matchers).forEach(function(ye){var we=o(ye,2),je=we[0],Le=we[1];!Me.matchVisual&&Le===pe||ve.addMatcher(je,Le)}),ve}return s(xe,[{key:"addMatcher",value:function(Me,ve){this.matchers.push([Me,ve])}},{key:"convert",value:function(Me){if(typeof Me=="string")return this.container.innerHTML=Me.replace(/\>\r?\n +\</g,"><"),this.convert();var ve=this.quill.getFormat(this.quill.selection.savedRange.index);if(ve[O.default.blotName]){var ye=this.container.innerText;return this.container.innerHTML="",new m.default().insert(ye,$({},O.default.blotName,ve[O.default.blotName]))}var we=this.prepareMatching(),je=o(we,2),Le=je[0],Ye=je[1],lt=ie(this.container,Le,Ye);return J(lt,`
|
|
132
|
+
`)&<.ops[lt.ops.length-1].attributes==null&&(lt=lt.compose(new m.default().retain(lt.length()-1).delete(1))),ee.log("convert",this.container.innerHTML,lt),this.container.innerHTML="",lt}},{key:"dangerouslyPasteHTML",value:function(Me,ve){var ye=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_.default.sources.API;if(typeof Me=="string")this.quill.setContents(this.convert(Me),ve),this.quill.setSelection(0,_.default.sources.SILENT);else{var we=this.convert(ve);this.quill.updateContents(new m.default().retain(Me).concat(we),ye),this.quill.setSelection(Me+we.length(),_.default.sources.SILENT)}}},{key:"onPaste",value:function(Me){var ve=this;if(!(Me.defaultPrevented||!this.quill.isEnabled())){var ye=this.quill.getSelection(),we=new m.default().retain(ye.index),je=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(_.default.sources.SILENT),setTimeout(function(){we=we.concat(ve.convert()).delete(ye.length),ve.quill.updateContents(we,_.default.sources.USER),ve.quill.setSelection(we.length()-ye.length,_.default.sources.SILENT),ve.quill.scrollingContainer.scrollTop=je,ve.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var Me=this,ve=[],ye=[];return this.matchers.forEach(function(we){var je=o(we,2),Le=je[0],Ye=je[1];switch(Le){case Node.TEXT_NODE:ye.push(Ye);break;case Node.ELEMENT_NODE:ve.push(Ye);break;default:[].forEach.call(Me.container.querySelectorAll(Le),function(lt){lt[Q]=lt[Q]||[],lt[Q].push(Ye)});break}}),[ve,ye]}}]),xe})(k.default);F.DEFAULTS={matchers:[],matchVisual:!0};function z(ge,xe,Te){return(typeof xe>"u"?"undefined":a(xe))==="object"?Object.keys(xe).reduce(function(Me,ve){return z(Me,ve,xe[ve])},ge):ge.reduce(function(Me,ve){return ve.attributes&&ve.attributes[xe]?Me.push(ve):Me.insert(ve.insert,(0,h.default)({},$({},xe,Te),ve.attributes))},new m.default)}function Y(ge){if(ge.nodeType!==Node.ELEMENT_NODE)return{};var xe="__ql-computed-style";return ge[xe]||(ge[xe]=window.getComputedStyle(ge))}function J(ge,xe){for(var Te="",Me=ge.ops.length-1;Me>=0&&Te.length<xe.length;--Me){var ve=ge.ops[Me];if(typeof ve.insert!="string")break;Te=ve.insert+Te}return Te.slice(-1*xe.length)===xe}function K(ge){if(ge.childNodes.length===0)return!1;var xe=Y(ge);return["block","list-item"].indexOf(xe.display)>-1}function ie(ge,xe,Te){return ge.nodeType===ge.TEXT_NODE?Te.reduce(function(Me,ve){return ve(ge,Me)},new m.default):ge.nodeType===ge.ELEMENT_NODE?[].reduce.call(ge.childNodes||[],function(Me,ve){var ye=ie(ve,xe,Te);return ve.nodeType===ge.ELEMENT_NODE&&(ye=xe.reduce(function(we,je){return je(ve,we)},ye),ye=(ve[Q]||[]).reduce(function(we,je){return je(ve,we)},ye)),Me.concat(ye)},new m.default):new m.default}function fe(ge,xe,Te){return z(Te,ge,!0)}function ue(ge,xe){var Te=d.default.Attributor.Attribute.keys(ge),Me=d.default.Attributor.Class.keys(ge),ve=d.default.Attributor.Style.keys(ge),ye={};return Te.concat(Me).concat(ve).forEach(function(we){var je=d.default.query(we,d.default.Scope.ATTRIBUTE);je!=null&&(ye[je.attrName]=je.value(ge),ye[je.attrName])||(je=X[we],je!=null&&(je.attrName===we||je.keyName===we)&&(ye[je.attrName]=je.value(ge)||void 0),je=B[we],je!=null&&(je.attrName===we||je.keyName===we)&&(je=B[we],ye[je.attrName]=je.value(ge)||void 0))}),Object.keys(ye).length>0&&(xe=z(xe,ye)),xe}function _e(ge,xe){var Te=d.default.query(ge);if(Te==null)return xe;if(Te.prototype instanceof d.default.Embed){var Me={},ve=Te.value(ge);ve!=null&&(Me[Te.blotName]=ve,xe=new m.default().insert(Me,Te.formats(ge)))}else typeof Te.formats=="function"&&(xe=z(xe,Te.blotName,Te.formats(ge)));return xe}function Ce(ge,xe){return J(xe,`
|
|
133
|
+
`)||xe.insert(`
|
|
134
|
+
`),xe}function $e(){return new m.default}function ze(ge,xe){var Te=d.default.query(ge);if(Te==null||Te.blotName!=="list-item"||!J(xe,`
|
|
135
|
+
`))return xe;for(var Me=-1,ve=ge.parentNode;!ve.classList.contains("ql-clipboard");)(d.default.query(ve)||{}).blotName==="list"&&(Me+=1),ve=ve.parentNode;return Me<=0?xe:xe.compose(new m.default().retain(xe.length()-1).retain(1,{indent:Me}))}function tt(ge,xe){return J(xe,`
|
|
136
|
+
`)||(K(ge)||xe.length()>0&&ge.nextSibling&&K(ge.nextSibling))&&xe.insert(`
|
|
137
|
+
`),xe}function pe(ge,xe){if(K(ge)&&ge.nextElementSibling!=null&&!J(xe,`
|
|
138
|
+
|
|
139
|
+
`)){var Te=ge.offsetHeight+parseFloat(Y(ge).marginTop)+parseFloat(Y(ge).marginBottom);ge.nextElementSibling.offsetTop>ge.offsetTop+Te*1.5&&xe.insert(`
|
|
140
|
+
`)}return xe}function ut(ge,xe){var Te={},Me=ge.style||{};return Me.fontStyle&&Y(ge).fontStyle==="italic"&&(Te.italic=!0),Me.fontWeight&&(Y(ge).fontWeight.startsWith("bold")||parseInt(Y(ge).fontWeight)>=700)&&(Te.bold=!0),Object.keys(Te).length>0&&(xe=z(xe,Te)),parseFloat(Me.textIndent||0)>0&&(xe=new m.default().insert(" ").concat(xe)),xe}function be(ge,xe){var Te=ge.data;if(ge.parentNode.tagName==="O:P")return xe.insert(Te.trim());if(Te.trim().length===0&&ge.parentNode.classList.contains("ql-clipboard"))return xe;if(!Y(ge.parentNode).whiteSpace.startsWith("pre")){var Me=function(ye,we){return we=we.replace(/[^\u00a0]/g,""),we.length<1&&ye?" ":we};Te=Te.replace(/\r\n/g," ").replace(/\n/g," "),Te=Te.replace(/\s\s+/g,Me.bind(Me,!0)),(ge.previousSibling==null&&K(ge.parentNode)||ge.previousSibling!=null&&K(ge.previousSibling))&&(Te=Te.replace(/^\s+/,Me.bind(Me,!1))),(ge.nextSibling==null&&K(ge.parentNode)||ge.nextSibling!=null&&K(ge.nextSibling))&&(Te=Te.replace(/\s+$/,Me.bind(Me,!1)))}return xe.insert(Te)}r.default=F,r.matchAttributor=ue,r.matchBlot=_e,r.matchNewline=tt,r.matchSpacing=pe,r.matchText=be}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function y(_,x){for(var b=0;b<x.length;b++){var S=x[b];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(_,S.key,S)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}})(),o=function y(_,x,b){_===null&&(_=Function.prototype);var S=Object.getOwnPropertyDescriptor(_,x);if(S===void 0){var k=Object.getPrototypeOf(_);return k===null?void 0:y(k,x,b)}else{if("value"in S)return S.value;var E=S.get;return E===void 0?void 0:E.call(b)}},s=i(6),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function c(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function m(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function g(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var d=(function(y){g(_,y);function _(){return c(this,_),m(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"optimize",value:function(b){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,b),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),_})(u.default);d.blotName="bold",d.tagName=["STRONG","B"],r.default=d}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.addControls=r.default=void 0;var a=(function(){function C(N,$){var G=[],te=!0,se=!1,ee=void 0;try{for(var Q=N[Symbol.iterator](),re;!(te=(re=Q.next()).done)&&(G.push(re.value),!($&&G.length===$));te=!0);}catch(X){se=!0,ee=X}finally{try{!te&&Q.return&&Q.return()}finally{if(se)throw ee}}return G}return function(N,$){if(Array.isArray(N))return N;if(Symbol.iterator in Object(N))return C(N,$);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function C(N,$){for(var G=0;G<$.length;G++){var te=$[G];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(N,te.key,te)}}return function(N,$,G){return $&&C(N.prototype,$),G&&C(N,G),N}})(),s=i(2),u=b(s),h=i(0),c=b(h),m=i(5),g=b(m),d=i(10),y=b(d),_=i(9),x=b(_);function b(C){return C&&C.__esModule?C:{default:C}}function S(C,N,$){return N in C?Object.defineProperty(C,N,{value:$,enumerable:!0,configurable:!0,writable:!0}):C[N]=$,C}function k(C,N){if(!(C instanceof N))throw new TypeError("Cannot call a class as a function")}function E(C,N){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N&&(typeof N=="object"||typeof N=="function")?N:C}function A(C,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);C.prototype=Object.create(N&&N.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(C,N):C.__proto__=N)}var R=(0,y.default)("quill:toolbar"),O=(function(C){A(N,C);function N($,G){k(this,N);var te=E(this,(N.__proto__||Object.getPrototypeOf(N)).call(this,$,G));if(Array.isArray(te.options.container)){var se=document.createElement("div");j(se,te.options.container),$.container.parentNode.insertBefore(se,$.container),te.container=se}else typeof te.options.container=="string"?te.container=document.querySelector(te.options.container):te.container=te.options.container;if(!(te.container instanceof HTMLElement)){var ee;return ee=R.error("Container required for toolbar",te.options),E(te,ee)}return te.container.classList.add("ql-toolbar"),te.controls=[],te.handlers={},Object.keys(te.options.handlers).forEach(function(Q){te.addHandler(Q,te.options.handlers[Q])}),[].forEach.call(te.container.querySelectorAll("button, select"),function(Q){te.attach(Q)}),te.quill.on(g.default.events.EDITOR_CHANGE,function(Q,re){Q===g.default.events.SELECTION_CHANGE&&te.update(re)}),te.quill.on(g.default.events.SCROLL_OPTIMIZE,function(){var Q=te.quill.selection.getRange(),re=a(Q,1),X=re[0];te.update(X)}),te}return o(N,[{key:"addHandler",value:function(G,te){this.handlers[G]=te}},{key:"attach",value:function(G){var te=this,se=[].find.call(G.classList,function(Q){return Q.indexOf("ql-")===0});if(se){if(se=se.slice(3),G.tagName==="BUTTON"&&G.setAttribute("type","button"),this.handlers[se]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[se]==null){R.warn("ignoring attaching to disabled format",se,G);return}if(c.default.query(se)==null){R.warn("ignoring attaching to nonexistent format",se,G);return}}var ee=G.tagName==="SELECT"?"change":"click";G.addEventListener(ee,function(Q){var re=void 0;if(G.tagName==="SELECT"){if(G.selectedIndex<0)return;var X=G.options[G.selectedIndex];X.hasAttribute("selected")?re=!1:re=X.value||!1}else G.classList.contains("ql-active")?re=!1:re=G.value||!G.hasAttribute("value"),Q.preventDefault();te.quill.focus();var B=te.quill.selection.getRange(),F=a(B,1),z=F[0];if(te.handlers[se]!=null)te.handlers[se].call(te,re);else if(c.default.query(se).prototype instanceof c.default.Embed){if(re=prompt("Enter "+se),!re)return;te.quill.updateContents(new u.default().retain(z.index).delete(z.length).insert(S({},se,re)),g.default.sources.USER)}else te.quill.format(se,re,g.default.sources.USER);te.update(z)}),this.controls.push([se,G])}}},{key:"update",value:function(G){var te=G==null?{}:this.quill.getFormat(G);this.controls.forEach(function(se){var ee=a(se,2),Q=ee[0],re=ee[1];if(re.tagName==="SELECT"){var X=void 0;if(G==null)X=null;else if(te[Q]==null)X=re.querySelector("option[selected]");else if(!Array.isArray(te[Q])){var B=te[Q];typeof B=="string"&&(B=B.replace(/\"/g,'\\"')),X=re.querySelector('option[value="'+B+'"]')}X==null?(re.value="",re.selectedIndex=-1):X.selected=!0}else if(G==null)re.classList.remove("ql-active");else if(re.hasAttribute("value")){var F=te[Q]===re.getAttribute("value")||te[Q]!=null&&te[Q].toString()===re.getAttribute("value")||te[Q]==null&&!re.getAttribute("value");re.classList.toggle("ql-active",F)}else re.classList.toggle("ql-active",te[Q]!=null)})}}]),N})(x.default);O.DEFAULTS={};function I(C,N,$){var G=document.createElement("button");G.setAttribute("type","button"),G.classList.add("ql-"+N),$!=null&&(G.value=$),C.appendChild(G)}function j(C,N){Array.isArray(N[0])||(N=[N]),N.forEach(function($){var G=document.createElement("span");G.classList.add("ql-formats"),$.forEach(function(te){if(typeof te=="string")I(G,te);else{var se=Object.keys(te)[0],ee=te[se];Array.isArray(ee)?D(G,se,ee):I(G,se,ee)}}),C.appendChild(G)})}function D(C,N,$){var G=document.createElement("select");G.classList.add("ql-"+N),$.forEach(function(te){var se=document.createElement("option");te!==!1?se.setAttribute("value",te):se.setAttribute("selected","selected"),G.appendChild(se)}),C.appendChild(G)}O.DEFAULTS={container:null,handlers:{clean:function(){var N=this,$=this.quill.getSelection();if($!=null)if($.length==0){var G=this.quill.getFormat();Object.keys(G).forEach(function(te){c.default.query(te,c.default.Scope.INLINE)!=null&&N.quill.format(te,!1)})}else this.quill.removeFormat($,g.default.sources.USER)},direction:function(N){var $=this.quill.getFormat().align;N==="rtl"&&$==null?this.quill.format("align","right",g.default.sources.USER):!N&&$==="right"&&this.quill.format("align",!1,g.default.sources.USER),this.quill.format("direction",N,g.default.sources.USER)},indent:function(N){var $=this.quill.getSelection(),G=this.quill.getFormat($),te=parseInt(G.indent||0);if(N==="+1"||N==="-1"){var se=N==="+1"?1:-1;G.direction==="rtl"&&(se*=-1),this.quill.format("indent",te+se,g.default.sources.USER)}},link:function(N){N===!0&&(N=prompt("Enter link URL:")),this.quill.format("link",N,g.default.sources.USER)},list:function(N){var $=this.quill.getSelection(),G=this.quill.getFormat($);N==="check"?G.list==="checked"||G.list==="unchecked"?this.quill.format("list",!1,g.default.sources.USER):this.quill.format("list","unchecked",g.default.sources.USER):this.quill.format("list",N,g.default.sources.USER)}}},r.default=O,r.addControls=j}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function y(_,x){for(var b=0;b<x.length;b++){var S=x[b];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(_,S.key,S)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}})(),o=function y(_,x,b){_===null&&(_=Function.prototype);var S=Object.getOwnPropertyDescriptor(_,x);if(S===void 0){var k=Object.getPrototypeOf(_);return k===null?void 0:y(k,x,b)}else{if("value"in S)return S.value;var E=S.get;return E===void 0?void 0:E.call(b)}},s=i(28),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function c(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function m(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function g(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var d=(function(y){g(_,y);function _(x,b){c(this,_);var S=m(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,x));return S.label.innerHTML=b,S.container.classList.add("ql-color-picker"),[].slice.call(S.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(k){k.classList.add("ql-primary")}),S}return a(_,[{key:"buildItem",value:function(b){var S=o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"buildItem",this).call(this,b);return S.style.backgroundColor=b.getAttribute("value")||"",S}},{key:"selectItem",value:function(b,S){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"selectItem",this).call(this,b,S);var k=this.label.querySelector(".ql-color-label"),E=b&&b.getAttribute("data-value")||"";k&&(k.tagName==="line"?k.style.stroke=E:k.style.fill=E)}}]),_})(u.default);r.default=d}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function y(_,x){for(var b=0;b<x.length;b++){var S=x[b];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(_,S.key,S)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}})(),o=function y(_,x,b){_===null&&(_=Function.prototype);var S=Object.getOwnPropertyDescriptor(_,x);if(S===void 0){var k=Object.getPrototypeOf(_);return k===null?void 0:y(k,x,b)}else{if("value"in S)return S.value;var E=S.get;return E===void 0?void 0:E.call(b)}},s=i(28),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function c(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function m(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function g(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var d=(function(y){g(_,y);function _(x,b){c(this,_);var S=m(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,x));return S.container.classList.add("ql-icon-picker"),[].forEach.call(S.container.querySelectorAll(".ql-picker-item"),function(k){k.innerHTML=b[k.getAttribute("data-value")||""]}),S.defaultItem=S.container.querySelector(".ql-selected"),S.selectItem(S.defaultItem),S}return a(_,[{key:"selectItem",value:function(b,S){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"selectItem",this).call(this,b,S),b=b||this.defaultItem,this.label.innerHTML=b.innerHTML}}]),_})(u.default);r.default=d}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function u(h,c){for(var m=0;m<c.length;m++){var g=c[m];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(h,g.key,g)}}return function(h,c,m){return c&&u(h.prototype,c),m&&u(h,m),h}})();function o(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}var s=(function(){function u(h,c){var m=this;o(this,u),this.quill=h,this.boundsContainer=c||document.body,this.root=h.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){m.root.style.marginTop=-1*m.quill.root.scrollTop+"px"}),this.hide()}return a(u,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(c){var m=c.left+c.width/2-this.root.offsetWidth/2,g=c.bottom+this.quill.root.scrollTop;this.root.style.left=m+"px",this.root.style.top=g+"px",this.root.classList.remove("ql-flip");var d=this.boundsContainer.getBoundingClientRect(),y=this.root.getBoundingClientRect(),_=0;if(y.right>d.right&&(_=d.right-y.right,this.root.style.left=m+_+"px"),y.left<d.left&&(_=d.left-y.left,this.root.style.left=m+_+"px"),y.bottom>d.bottom){var x=y.bottom-y.top,b=c.bottom-c.top+x;this.root.style.top=g-b+"px",this.root.classList.add("ql-flip")}return _}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),u})();r.default=s}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function D(C,N){var $=[],G=!0,te=!1,se=void 0;try{for(var ee=C[Symbol.iterator](),Q;!(G=(Q=ee.next()).done)&&($.push(Q.value),!(N&&$.length===N));G=!0);}catch(re){te=!0,se=re}finally{try{!G&&ee.return&&ee.return()}finally{if(te)throw se}}return $}return function(C,N){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return D(C,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=function D(C,N,$){C===null&&(C=Function.prototype);var G=Object.getOwnPropertyDescriptor(C,N);if(G===void 0){var te=Object.getPrototypeOf(C);return te===null?void 0:D(te,N,$)}else{if("value"in G)return G.value;var se=G.get;return se===void 0?void 0:se.call($)}},s=(function(){function D(C,N){for(var $=0;$<N.length;$++){var G=N[$];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(C,G.key,G)}}return function(C,N,$){return N&&D(C.prototype,N),$&&D(C,$),C}})(),u=i(3),h=k(u),c=i(8),m=k(c),g=i(43),d=k(g),y=i(27),_=k(y),x=i(15),b=i(41),S=k(b);function k(D){return D&&D.__esModule?D:{default:D}}function E(D,C){if(!(D instanceof C))throw new TypeError("Cannot call a class as a function")}function A(D,C){if(!D)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:D}function R(D,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);D.prototype=Object.create(C&&C.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(D,C):D.__proto__=C)}var O=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],I=(function(D){R(C,D);function C(N,$){E(this,C),$.modules.toolbar!=null&&$.modules.toolbar.container==null&&($.modules.toolbar.container=O);var G=A(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,N,$));return G.quill.container.classList.add("ql-snow"),G}return s(C,[{key:"extendToolbar",value:function($){$.container.classList.add("ql-snow"),this.buildButtons([].slice.call($.container.querySelectorAll("button")),S.default),this.buildPickers([].slice.call($.container.querySelectorAll("select")),S.default),this.tooltip=new j(this.quill,this.options.bounds),$.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(G,te){$.handlers.link.call($,!te.format.link)})}}]),C})(d.default);I.DEFAULTS=(0,h.default)(!0,{},d.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(C){if(C){var N=this.quill.getSelection();if(N==null||N.length==0)return;var $=this.quill.getText(N);/^\S+@\S+\.\S+$/.test($)&&$.indexOf("mailto:")!==0&&($="mailto:"+$);var G=this.quill.theme.tooltip;G.edit("link",$)}else this.quill.format("link",!1)}}}}});var j=(function(D){R(C,D);function C(N,$){E(this,C);var G=A(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,N,$));return G.preview=G.root.querySelector("a.ql-preview"),G}return s(C,[{key:"listen",value:function(){var $=this;o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(G){$.root.classList.contains("ql-editing")?$.save():$.edit("link",$.preview.textContent),G.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(G){if($.linkRange!=null){var te=$.linkRange;$.restoreFocus(),$.quill.formatText(te,"link",!1,m.default.sources.USER),delete $.linkRange}G.preventDefault(),$.hide()}),this.quill.on(m.default.events.SELECTION_CHANGE,function(G,te,se){if(G!=null){if(G.length===0&&se===m.default.sources.USER){var ee=$.quill.scroll.descendant(_.default,G.index),Q=a(ee,2),re=Q[0],X=Q[1];if(re!=null){$.linkRange=new x.Range(G.index-X,re.length());var B=_.default.formats(re.domNode);$.preview.textContent=B,$.preview.setAttribute("href",B),$.show(),$.position($.quill.getBounds($.linkRange));return}}else delete $.linkRange;$.hide()}})}},{key:"show",value:function(){o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),C})(g.BaseTooltip);j.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),r.default=I}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(29),o=ve(a),s=i(36),u=i(38),h=i(64),c=i(65),m=ve(c),g=i(66),d=ve(g),y=i(67),_=ve(y),x=i(37),b=i(26),S=i(39),k=i(40),E=i(56),A=ve(E),R=i(68),O=ve(R),I=i(27),j=ve(I),D=i(69),C=ve(D),N=i(70),$=ve(N),G=i(71),te=ve(G),se=i(72),ee=ve(se),Q=i(73),re=ve(Q),X=i(13),B=ve(X),F=i(74),z=ve(F),Y=i(75),J=ve(Y),K=i(57),ie=ve(K),fe=i(41),ue=ve(fe),_e=i(28),Ce=ve(_e),$e=i(59),ze=ve($e),tt=i(60),pe=ve(tt),ut=i(61),be=ve(ut),ge=i(108),xe=ve(ge),Te=i(62),Me=ve(Te);function ve(ye){return ye&&ye.__esModule?ye:{default:ye}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":s.AlignClass,"attributors/class/background":x.BackgroundClass,"attributors/class/color":b.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":S.FontClass,"attributors/class/size":k.SizeClass,"attributors/style/align":s.AlignStyle,"attributors/style/background":x.BackgroundStyle,"attributors/style/color":b.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":S.FontStyle,"attributors/style/size":k.SizeStyle},!0),o.default.register({"formats/align":s.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":h.IndentClass,"formats/background":x.BackgroundStyle,"formats/color":b.ColorStyle,"formats/font":S.FontClass,"formats/size":k.SizeClass,"formats/blockquote":m.default,"formats/code-block":B.default,"formats/header":d.default,"formats/list":_.default,"formats/bold":A.default,"formats/code":X.Code,"formats/italic":O.default,"formats/link":j.default,"formats/script":C.default,"formats/strike":$.default,"formats/underline":te.default,"formats/image":ee.default,"formats/video":re.default,"formats/list/item":y.ListItem,"modules/formula":z.default,"modules/syntax":J.default,"modules/toolbar":ie.default,"themes/bubble":xe.default,"themes/snow":Me.default,"ui/icons":ue.default,"ui/picker":Ce.default,"ui/icon-picker":pe.default,"ui/color-picker":ze.default,"ui/tooltip":be.default},!0),r.default=o.default}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.IndentClass=void 0;var a=(function(){function _(x,b){for(var S=0;S<b.length;S++){var k=b[S];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(x,k.key,k)}}return function(x,b,S){return b&&_(x.prototype,b),S&&_(x,S),x}})(),o=function _(x,b,S){x===null&&(x=Function.prototype);var k=Object.getOwnPropertyDescriptor(x,b);if(k===void 0){var E=Object.getPrototypeOf(x);return E===null?void 0:_(E,b,S)}else{if("value"in k)return k.value;var A=k.get;return A===void 0?void 0:A.call(S)}},s=i(0),u=h(s);function h(_){return _&&_.__esModule?_:{default:_}}function c(_,x){if(!(_ instanceof x))throw new TypeError("Cannot call a class as a function")}function m(_,x){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:_}function g(_,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);_.prototype=Object.create(x&&x.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(_,x):_.__proto__=x)}var d=(function(_){g(x,_);function x(){return c(this,x),m(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return a(x,[{key:"add",value:function(S,k){if(k==="+1"||k==="-1"){var E=this.value(S)||0;k=k==="+1"?E+1:E-1}return k===0?(this.remove(S),!0):o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"add",this).call(this,S,k)}},{key:"canAdd",value:function(S,k){return o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"canAdd",this).call(this,S,k)||o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"canAdd",this).call(this,S,parseInt(k))}},{key:"value",value:function(S){return parseInt(o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"value",this).call(this,S))||void 0}}]),x})(u.default.Attributor.Class),y=new d("indent","ql-indent",{scope:u.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});r.IndentClass=y}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(4),o=s(a);function s(g){return g&&g.__esModule?g:{default:g}}function u(g,d){if(!(g instanceof d))throw new TypeError("Cannot call a class as a function")}function h(g,d){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:g}function c(g,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);g.prototype=Object.create(d&&d.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(g,d):g.__proto__=d)}var m=(function(g){c(d,g);function d(){return u(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d})(o.default);m.blotName="blockquote",m.tagName="blockquote",r.default=m}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function d(y,_){for(var x=0;x<_.length;x++){var b=_[x];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,_,x){return _&&d(y.prototype,_),x&&d(y,x),y}})(),o=i(4),s=u(o);function u(d){return d&&d.__esModule?d:{default:d}}function h(d,y){if(!(d instanceof y))throw new TypeError("Cannot call a class as a function")}function c(d,y){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:d}function m(d,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);d.prototype=Object.create(y&&y.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(d,y):d.__proto__=y)}var g=(function(d){m(y,d);function y(){return h(this,y),c(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,null,[{key:"formats",value:function(x){return this.tagName.indexOf(x.tagName)+1}}]),y})(s.default);g.blotName="header",g.tagName=["H1","H2","H3","H4","H5","H6"],r.default=g}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.ListItem=void 0;var a=(function(){function E(A,R){for(var O=0;O<R.length;O++){var I=R[O];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(A,I.key,I)}}return function(A,R,O){return R&&E(A.prototype,R),O&&E(A,O),A}})(),o=function E(A,R,O){A===null&&(A=Function.prototype);var I=Object.getOwnPropertyDescriptor(A,R);if(I===void 0){var j=Object.getPrototypeOf(A);return j===null?void 0:E(j,R,O)}else{if("value"in I)return I.value;var D=I.get;return D===void 0?void 0:D.call(O)}},s=i(0),u=d(s),h=i(4),c=d(h),m=i(25),g=d(m);function d(E){return E&&E.__esModule?E:{default:E}}function y(E,A,R){return A in E?Object.defineProperty(E,A,{value:R,enumerable:!0,configurable:!0,writable:!0}):E[A]=R,E}function _(E,A){if(!(E instanceof A))throw new TypeError("Cannot call a class as a function")}function x(E,A){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:E}function b(E,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);E.prototype=Object.create(A&&A.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(E,A):E.__proto__=A)}var S=(function(E){b(A,E);function A(){return _(this,A),x(this,(A.__proto__||Object.getPrototypeOf(A)).apply(this,arguments))}return a(A,[{key:"format",value:function(O,I){O===k.blotName&&!I?this.replaceWith(u.default.create(this.statics.scope)):o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"format",this).call(this,O,I)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(O,I){return this.parent.isolate(this.offset(this.parent),this.length()),O===this.parent.statics.blotName?(this.parent.replaceWith(O,I),this):(this.parent.unwrap(),o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"replaceWith",this).call(this,O,I))}}],[{key:"formats",value:function(O){return O.tagName===this.tagName?void 0:o(A.__proto__||Object.getPrototypeOf(A),"formats",this).call(this,O)}}]),A})(c.default);S.blotName="list-item",S.tagName="LI";var k=(function(E){b(A,E),a(A,null,[{key:"create",value:function(O){var I=O==="ordered"?"OL":"UL",j=o(A.__proto__||Object.getPrototypeOf(A),"create",this).call(this,I);return(O==="checked"||O==="unchecked")&&j.setAttribute("data-checked",O==="checked"),j}},{key:"formats",value:function(O){if(O.tagName==="OL")return"ordered";if(O.tagName==="UL")return O.hasAttribute("data-checked")?O.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function A(R){_(this,A);var O=x(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,R)),I=function(D){if(D.target.parentNode===R){var C=O.statics.formats(R),N=u.default.find(D.target);C==="checked"?N.format("list","unchecked"):C==="unchecked"&&N.format("list","checked")}};return R.addEventListener("touchstart",I),R.addEventListener("mousedown",I),O}return a(A,[{key:"format",value:function(O,I){this.children.length>0&&this.children.tail.format(O,I)}},{key:"formats",value:function(){return y({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(O,I){if(O instanceof S)o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertBefore",this).call(this,O,I);else{var j=I==null?this.length():I.offset(this),D=this.split(j);D.parent.insertBefore(O,D)}}},{key:"optimize",value:function(O){o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"optimize",this).call(this,O);var I=this.next;I!=null&&I.prev===this&&I.statics.blotName===this.statics.blotName&&I.domNode.tagName===this.domNode.tagName&&I.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(I.moveChildren(this),I.remove())}},{key:"replace",value:function(O){if(O.statics.blotName!==this.statics.blotName){var I=u.default.create(this.statics.defaultChild);O.moveChildren(I),this.appendChild(I)}o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"replace",this).call(this,O)}}]),A})(g.default);k.blotName="list",k.scope=u.default.Scope.BLOCK_BLOT,k.tagName=["OL","UL"],k.defaultChild="list-item",k.allowedChildren=[S],r.ListItem=S,r.default=k}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(56),o=s(a);function s(g){return g&&g.__esModule?g:{default:g}}function u(g,d){if(!(g instanceof d))throw new TypeError("Cannot call a class as a function")}function h(g,d){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:g}function c(g,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);g.prototype=Object.create(d&&d.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(g,d):g.__proto__=d)}var m=(function(g){c(d,g);function d(){return u(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d})(o.default);m.blotName="italic",m.tagName=["EM","I"],r.default=m}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function y(_,x){for(var b=0;b<x.length;b++){var S=x[b];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(_,S.key,S)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}})(),o=function y(_,x,b){_===null&&(_=Function.prototype);var S=Object.getOwnPropertyDescriptor(_,x);if(S===void 0){var k=Object.getPrototypeOf(_);return k===null?void 0:y(k,x,b)}else{if("value"in S)return S.value;var E=S.get;return E===void 0?void 0:E.call(b)}},s=i(6),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function c(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function m(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function g(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var d=(function(y){g(_,y);function _(){return c(this,_),m(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,null,[{key:"create",value:function(b){return b==="super"?document.createElement("sup"):b==="sub"?document.createElement("sub"):o(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,b)}},{key:"formats",value:function(b){if(b.tagName==="SUB")return"sub";if(b.tagName==="SUP")return"super"}}]),_})(u.default);d.blotName="script",d.tagName=["SUB","SUP"],r.default=d}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(6),o=s(a);function s(g){return g&&g.__esModule?g:{default:g}}function u(g,d){if(!(g instanceof d))throw new TypeError("Cannot call a class as a function")}function h(g,d){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:g}function c(g,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);g.prototype=Object.create(d&&d.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(g,d):g.__proto__=d)}var m=(function(g){c(d,g);function d(){return u(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d})(o.default);m.blotName="strike",m.tagName="S",r.default=m}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(6),o=s(a);function s(g){return g&&g.__esModule?g:{default:g}}function u(g,d){if(!(g instanceof d))throw new TypeError("Cannot call a class as a function")}function h(g,d){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:g}function c(g,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);g.prototype=Object.create(d&&d.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(g,d):g.__proto__=d)}var m=(function(g){c(d,g);function d(){return u(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d})(o.default);m.blotName="underline",m.tagName="U",r.default=m}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function x(b,S){for(var k=0;k<S.length;k++){var E=S[k];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(b,E.key,E)}}return function(b,S,k){return S&&x(b.prototype,S),k&&x(b,k),b}})(),o=function x(b,S,k){b===null&&(b=Function.prototype);var E=Object.getOwnPropertyDescriptor(b,S);if(E===void 0){var A=Object.getPrototypeOf(b);return A===null?void 0:x(A,S,k)}else{if("value"in E)return E.value;var R=E.get;return R===void 0?void 0:R.call(k)}},s=i(0),u=c(s),h=i(27);function c(x){return x&&x.__esModule?x:{default:x}}function m(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function g(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function d(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var y=["alt","height","width"],_=(function(x){d(b,x);function b(){return m(this,b),g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"format",value:function(k,E){y.indexOf(k)>-1?E?this.domNode.setAttribute(k,E):this.domNode.removeAttribute(k):o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,k,E)}}],[{key:"create",value:function(k){var E=o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,k);return typeof k=="string"&&E.setAttribute("src",this.sanitize(k)),E}},{key:"formats",value:function(k){return y.reduce(function(E,A){return k.hasAttribute(A)&&(E[A]=k.getAttribute(A)),E},{})}},{key:"match",value:function(k){return/\.(jpe?g|gif|png)$/.test(k)||/^data:image\/.+;base64/.test(k)}},{key:"sanitize",value:function(k){return(0,h.sanitize)(k,["http","https","data"])?k:"//:0"}},{key:"value",value:function(k){return k.getAttribute("src")}}]),b})(u.default.Embed);_.blotName="image",_.tagName="IMG",r.default=_}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function x(b,S){for(var k=0;k<S.length;k++){var E=S[k];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(b,E.key,E)}}return function(b,S,k){return S&&x(b.prototype,S),k&&x(b,k),b}})(),o=function x(b,S,k){b===null&&(b=Function.prototype);var E=Object.getOwnPropertyDescriptor(b,S);if(E===void 0){var A=Object.getPrototypeOf(b);return A===null?void 0:x(A,S,k)}else{if("value"in E)return E.value;var R=E.get;return R===void 0?void 0:R.call(k)}},s=i(4),u=i(27),h=c(u);function c(x){return x&&x.__esModule?x:{default:x}}function m(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function g(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function d(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var y=["height","width"],_=(function(x){d(b,x);function b(){return m(this,b),g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"format",value:function(k,E){y.indexOf(k)>-1?E?this.domNode.setAttribute(k,E):this.domNode.removeAttribute(k):o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,k,E)}}],[{key:"create",value:function(k){var E=o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,k);return E.setAttribute("frameborder","0"),E.setAttribute("allowfullscreen",!0),E.setAttribute("src",this.sanitize(k)),E}},{key:"formats",value:function(k){return y.reduce(function(E,A){return k.hasAttribute(A)&&(E[A]=k.getAttribute(A)),E},{})}},{key:"sanitize",value:function(k){return h.default.sanitize(k)}},{key:"value",value:function(k){return k.getAttribute("src")}}]),b})(s.BlockEmbed);_.blotName="video",_.className="ql-video",_.tagName="IFRAME",r.default=_}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.FormulaBlot=void 0;var a=(function(){function k(E,A){for(var R=0;R<A.length;R++){var O=A[R];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(E,O.key,O)}}return function(E,A,R){return A&&k(E.prototype,A),R&&k(E,R),E}})(),o=function k(E,A,R){E===null&&(E=Function.prototype);var O=Object.getOwnPropertyDescriptor(E,A);if(O===void 0){var I=Object.getPrototypeOf(E);return I===null?void 0:k(I,A,R)}else{if("value"in O)return O.value;var j=O.get;return j===void 0?void 0:j.call(R)}},s=i(35),u=d(s),h=i(5),c=d(h),m=i(9),g=d(m);function d(k){return k&&k.__esModule?k:{default:k}}function y(k,E){if(!(k instanceof E))throw new TypeError("Cannot call a class as a function")}function _(k,E){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:k}function x(k,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);k.prototype=Object.create(E&&E.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(k,E):k.__proto__=E)}var b=(function(k){x(E,k);function E(){return y(this,E),_(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return a(E,null,[{key:"create",value:function(R){var O=o(E.__proto__||Object.getPrototypeOf(E),"create",this).call(this,R);return typeof R=="string"&&(window.katex.render(R,O,{throwOnError:!1,errorColor:"#f00"}),O.setAttribute("data-value",R)),O}},{key:"value",value:function(R){return R.getAttribute("data-value")}}]),E})(u.default);b.blotName="formula",b.className="ql-formula",b.tagName="SPAN";var S=(function(k){x(E,k),a(E,null,[{key:"register",value:function(){c.default.register(b,!0)}}]);function E(){y(this,E);var A=_(this,(E.__proto__||Object.getPrototypeOf(E)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return A}return E})(g.default);r.FormulaBlot=b,r.default=S}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.CodeToken=r.CodeBlock=void 0;var a=(function(){function R(O,I){for(var j=0;j<I.length;j++){var D=I[j];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(O,D.key,D)}}return function(O,I,j){return I&&R(O.prototype,I),j&&R(O,j),O}})(),o=function R(O,I,j){O===null&&(O=Function.prototype);var D=Object.getOwnPropertyDescriptor(O,I);if(D===void 0){var C=Object.getPrototypeOf(O);return C===null?void 0:R(C,I,j)}else{if("value"in D)return D.value;var N=D.get;return N===void 0?void 0:N.call(j)}},s=i(0),u=_(s),h=i(5),c=_(h),m=i(9),g=_(m),d=i(13),y=_(d);function _(R){return R&&R.__esModule?R:{default:R}}function x(R,O){if(!(R instanceof O))throw new TypeError("Cannot call a class as a function")}function b(R,O){if(!R)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:R}function S(R,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);R.prototype=Object.create(O&&O.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(R,O):R.__proto__=O)}var k=(function(R){S(O,R);function O(){return x(this,O),b(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return a(O,[{key:"replaceWith",value:function(j){this.domNode.textContent=this.domNode.textContent,this.attach(),o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replaceWith",this).call(this,j)}},{key:"highlight",value:function(j){var D=this.domNode.textContent;this.cachedText!==D&&((D.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=j(D),this.domNode.normalize(),this.attach()),this.cachedText=D)}}]),O})(y.default);k.className="ql-syntax";var E=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),A=(function(R){S(O,R),a(O,null,[{key:"register",value:function(){c.default.register(E,!0),c.default.register(k,!0)}}]);function O(I,j){x(this,O);var D=b(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,I,j));if(typeof D.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var C=null;return D.quill.on(c.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(C),C=setTimeout(function(){D.highlight(),C=null},D.options.interval)}),D.highlight(),D}return a(O,[{key:"highlight",value:function(){var j=this;if(!this.quill.selection.composing){this.quill.update(c.default.sources.USER);var D=this.quill.getSelection();this.quill.scroll.descendants(k).forEach(function(C){C.highlight(j.options.highlight)}),this.quill.update(c.default.sources.SILENT),D!=null&&this.quill.setSelection(D,c.default.sources.SILENT)}}}]),O})(g.default);A.DEFAULTS={highlight:(function(){return window.hljs==null?null:function(R){var O=window.hljs.highlightAuto(R);return O.value}})(),interval:1e3},r.CodeBlock=k,r.CodeToken=E,r.default=A}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'}),(function(n,r){n.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'}),(function(n,r){n.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'}),(function(n,r){n.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'}),(function(n,r){n.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BubbleTooltip=void 0;var a=function O(I,j,D){I===null&&(I=Function.prototype);var C=Object.getOwnPropertyDescriptor(I,j);if(C===void 0){var N=Object.getPrototypeOf(I);return N===null?void 0:O(N,j,D)}else{if("value"in C)return C.value;var $=C.get;return $===void 0?void 0:$.call(D)}},o=(function(){function O(I,j){for(var D=0;D<j.length;D++){var C=j[D];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(I,C.key,C)}}return function(I,j,D){return j&&O(I.prototype,j),D&&O(I,D),I}})(),s=i(3),u=x(s),h=i(8),c=x(h),m=i(43),g=x(m),d=i(15),y=i(41),_=x(y);function x(O){return O&&O.__esModule?O:{default:O}}function b(O,I){if(!(O instanceof I))throw new TypeError("Cannot call a class as a function")}function S(O,I){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:O}function k(O,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);O.prototype=Object.create(I&&I.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(O,I):O.__proto__=I)}var E=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],A=(function(O){k(I,O);function I(j,D){b(this,I),D.modules.toolbar!=null&&D.modules.toolbar.container==null&&(D.modules.toolbar.container=E);var C=S(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,j,D));return C.quill.container.classList.add("ql-bubble"),C}return o(I,[{key:"extendToolbar",value:function(D){this.tooltip=new R(this.quill,this.options.bounds),this.tooltip.root.appendChild(D.container),this.buildButtons([].slice.call(D.container.querySelectorAll("button")),_.default),this.buildPickers([].slice.call(D.container.querySelectorAll("select")),_.default)}}]),I})(g.default);A.DEFAULTS=(0,u.default)(!0,{},g.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(I){I?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var R=(function(O){k(I,O);function I(j,D){b(this,I);var C=S(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,j,D));return C.quill.on(c.default.events.EDITOR_CHANGE,function(N,$,G,te){if(N===c.default.events.SELECTION_CHANGE)if($!=null&&$.length>0&&te===c.default.sources.USER){C.show(),C.root.style.left="0px",C.root.style.width="",C.root.style.width=C.root.offsetWidth+"px";var se=C.quill.getLines($.index,$.length);if(se.length===1)C.position(C.quill.getBounds($));else{var ee=se[se.length-1],Q=C.quill.getIndex(ee),re=Math.min(ee.length()-1,$.index+$.length-Q),X=C.quill.getBounds(new d.Range(Q,re));C.position(X)}}else document.activeElement!==C.textbox&&C.quill.hasFocus()&&C.hide()}),C}return o(I,[{key:"listen",value:function(){var D=this;a(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){D.root.classList.remove("ql-editing")}),this.quill.on(c.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!D.root.classList.contains("ql-hidden")){var C=D.quill.getSelection();C!=null&&D.position(D.quill.getBounds(C))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(D){var C=a(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"position",this).call(this,D),N=this.root.querySelector(".ql-tooltip-arrow");if(N.style.marginLeft="",C===0)return C;N.style.marginLeft=-1*C-N.offsetWidth/2+"px"}}]),I})(m.BaseTooltip);R.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),r.BubbleTooltip=R,r.default=A}),(function(n,r,i){n.exports=i(63)})]).default})})(r0)),r0.exports}var AL=kL();const F7=yh(AL);var i0={exports:{}},Kf={},ap={exports:{}};var PL=ap.exports,r3;function OL(){return r3||(r3=1,(function(e,t){(function(n){var r=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,a=typeof d0=="object"&&d0;(a.global===a||a.window===a||a.self===a)&&(n=a);var o,s=2147483647,u=36,h=1,c=26,m=38,g=700,d=72,y=128,_="-",x=/^xn--/,b=/[^\x20-\x7E]/,S=/[\x2E\u3002\uFF0E\uFF61]/g,k={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},E=u-h,A=Math.floor,R=String.fromCharCode,O;function I(X){throw new RangeError(k[X])}function j(X,B){for(var F=X.length,z=[];F--;)z[F]=B(X[F]);return z}function D(X,B){var F=X.split("@"),z="";F.length>1&&(z=F[0]+"@",X=F[1]),X=X.replace(S,".");var Y=X.split("."),J=j(Y,B).join(".");return z+J}function C(X){for(var B=[],F=0,z=X.length,Y,J;F<z;)Y=X.charCodeAt(F++),Y>=55296&&Y<=56319&&F<z?(J=X.charCodeAt(F++),(J&64512)==56320?B.push(((Y&1023)<<10)+(J&1023)+65536):(B.push(Y),F--)):B.push(Y);return B}function N(X){return j(X,function(B){var F="";return B>65535&&(B-=65536,F+=R(B>>>10&1023|55296),B=56320|B&1023),F+=R(B),F}).join("")}function $(X){return X-48<10?X-22:X-65<26?X-65:X-97<26?X-97:u}function G(X,B){return X+22+75*(X<26)-((B!=0)<<5)}function te(X,B,F){var z=0;for(X=F?A(X/g):X>>1,X+=A(X/B);X>E*c>>1;z+=u)X=A(X/E);return A(z+(E+1)*X/(X+m))}function se(X){var B=[],F=X.length,z,Y=0,J=y,K=d,ie,fe,ue,_e,Ce,$e,ze,tt,pe;for(ie=X.lastIndexOf(_),ie<0&&(ie=0),fe=0;fe<ie;++fe)X.charCodeAt(fe)>=128&&I("not-basic"),B.push(X.charCodeAt(fe));for(ue=ie>0?ie+1:0;ue<F;){for(_e=Y,Ce=1,$e=u;ue>=F&&I("invalid-input"),ze=$(X.charCodeAt(ue++)),(ze>=u||ze>A((s-Y)/Ce))&&I("overflow"),Y+=ze*Ce,tt=$e<=K?h:$e>=K+c?c:$e-K,!(ze<tt);$e+=u)pe=u-tt,Ce>A(s/pe)&&I("overflow"),Ce*=pe;z=B.length+1,K=te(Y-_e,z,_e==0),A(Y/z)>s-J&&I("overflow"),J+=A(Y/z),Y%=z,B.splice(Y++,0,J)}return N(B)}function ee(X){var B,F,z,Y,J,K,ie,fe,ue,_e,Ce,$e=[],ze,tt,pe,ut;for(X=C(X),ze=X.length,B=y,F=0,J=d,K=0;K<ze;++K)Ce=X[K],Ce<128&&$e.push(R(Ce));for(z=Y=$e.length,Y&&$e.push(_);z<ze;){for(ie=s,K=0;K<ze;++K)Ce=X[K],Ce>=B&&Ce<ie&&(ie=Ce);for(tt=z+1,ie-B>A((s-F)/tt)&&I("overflow"),F+=(ie-B)*tt,B=ie,K=0;K<ze;++K)if(Ce=X[K],Ce<B&&++F>s&&I("overflow"),Ce==B){for(fe=F,ue=u;_e=ue<=J?h:ue>=J+c?c:ue-J,!(fe<_e);ue+=u)ut=fe-_e,pe=u-_e,$e.push(R(G(_e+ut%pe,0))),fe=A(ut/pe);$e.push(R(G(fe,0))),J=te(F,tt,z==Y),F=0,++z}++F,++B}return $e.join("")}function Q(X){return D(X,function(B){return x.test(B)?se(B.slice(4).toLowerCase()):B})}function re(X){return D(X,function(B){return b.test(B)?"xn--"+ee(B):B})}if(o={version:"1.4.1",ucs2:{decode:C,encode:N},decode:se,encode:ee,toASCII:re,toUnicode:Q},r&&i)if(e.exports==r)i.exports=o;else for(O in o)o.hasOwnProperty(O)&&(r[O]=o[O]);else n.punycode=o})(PL)})(ap,ap.exports)),ap.exports}var m2,i3;function Pd(){return i3||(i3=1,m2=TypeError),m2}const CL={},LL=Object.freeze(Object.defineProperty({__proto__:null,default:CL},Symbol.toStringTag,{value:"Module"})),NL=G_(LL);var v2,a3;function tg(){if(a3)return v2;a3=1;var e=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,n=e&&t&&typeof t.get=="function"?t.get:null,r=e&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=i&&a&&typeof a.get=="function"?a.get:null,s=i&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,h=u?WeakMap.prototype.has:null,c=typeof WeakSet=="function"&&WeakSet.prototype,m=c?WeakSet.prototype.has:null,g=typeof WeakRef=="function"&&WeakRef.prototype,d=g?WeakRef.prototype.deref:null,y=Boolean.prototype.valueOf,_=Object.prototype.toString,x=Function.prototype.toString,b=String.prototype.match,S=String.prototype.slice,k=String.prototype.replace,E=String.prototype.toUpperCase,A=String.prototype.toLowerCase,R=RegExp.prototype.test,O=Array.prototype.concat,I=Array.prototype.join,j=Array.prototype.slice,D=Math.floor,C=typeof BigInt=="function"?BigInt.prototype.valueOf:null,N=Object.getOwnPropertySymbols,$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,G=typeof Symbol=="function"&&typeof Symbol.iterator=="object",te=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===G||!0)?Symbol.toStringTag:null,se=Object.prototype.propertyIsEnumerable,ee=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(We){return We.__proto__}:null);function Q(We,Be){if(We===1/0||We===-1/0||We!==We||We&&We>-1e3&&We<1e3||R.call(/e/,Be))return Be;var $t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof We=="number"){var At=We<0?-D(-We):D(We);if(At!==We){var Lt=String(At),Tt=S.call(Be,Lt.length+1);return k.call(Lt,$t,"$&_")+"."+k.call(k.call(Tt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return k.call(Be,$t,"$&_")}var re=NL,X=re.custom,B=tt(X)?X:null,F={__proto__:null,double:'"',single:"'"},z={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};v2=function We(Be,$t,At,Lt){var Tt=$t||{};if(be(Tt,"quoteStyle")&&!be(F,Tt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(be(Tt,"maxStringLength")&&(typeof Tt.maxStringLength=="number"?Tt.maxStringLength<0&&Tt.maxStringLength!==1/0:Tt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var tn=be(Tt,"customInspect")?Tt.customInspect:!0;if(typeof tn!="boolean"&&tn!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(be(Tt,"indent")&&Tt.indent!==null&&Tt.indent!==" "&&!(parseInt(Tt.indent,10)===Tt.indent&&Tt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(be(Tt,"numericSeparator")&&typeof Tt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Wt=Tt.numericSeparator;if(typeof Be>"u")return"undefined";if(Be===null)return"null";if(typeof Be=="boolean")return Be?"true":"false";if(typeof Be=="string")return Ye(Be,Tt);if(typeof Be=="number"){if(Be===0)return 1/0/Be>0?"0":"-0";var hn=String(Be);return Wt?Q(Be,hn):hn}if(typeof Be=="bigint"){var bi=String(Be)+"n";return Wt?Q(Be,bi):bi}var nr=typeof Tt.depth>"u"?5:Tt.depth;if(typeof At>"u"&&(At=0),At>=nr&&nr>0&&typeof Be=="object")return ie(Be)?"[Array]":"[Object]";var ei=Zt(Tt,At);if(typeof Lt>"u")Lt=[];else if(Te(Lt,Be)>=0)return"[Circular]";function dr(zi,ao,Fs){if(ao&&(Lt=j.call(Lt),Lt.push(ao)),Fs){var as={depth:Tt.depth};return be(Tt,"quoteStyle")&&(as.quoteStyle=Tt.quoteStyle),We(zi,as,At+1,Lt)}return We(zi,Tt,At+1,Lt)}if(typeof Be=="function"&&!ue(Be)){var Jt=xe(Be),ua=an(Be,dr);return"[Function"+(Jt?": "+Jt:" (anonymous)")+"]"+(ua.length>0?" { "+I.call(ua,", ")+" }":"")}if(tt(Be)){var Fa=G?k.call(String(Be),/^(Symbol\(.*\))_[^)]*$/,"$1"):$.call(Be);return typeof Be=="object"&&!G?rt(Fa):Fa}if(Le(Be)){for(var ti="<"+A.call(String(Be.nodeName)),Ki=Be.attributes||[],Hn=0;Hn<Ki.length;Hn++)ti+=" "+Ki[Hn].name+"="+Y(J(Ki[Hn].value),"double",Tt);return ti+=">",Be.childNodes&&Be.childNodes.length&&(ti+="..."),ti+="</"+A.call(String(Be.nodeName))+">",ti}if(ie(Be)){if(Be.length===0)return"[]";var Or=an(Be,dr);return ei&&!Ct(Or)?"["+on(Or,ei)+"]":"[ "+I.call(Or,", ")+" ]"}if(_e(Be)){var Dr=an(Be,dr);return!("cause"in Error.prototype)&&"cause"in Be&&!se.call(Be,"cause")?"{ ["+String(Be)+"] "+I.call(O.call("[cause]: "+dr(Be.cause),Dr),", ")+" }":Dr.length===0?"["+String(Be)+"]":"{ ["+String(Be)+"] "+I.call(Dr,", ")+" }"}if(typeof Be=="object"&&tn){if(B&&typeof Be[B]=="function"&&re)return re(Be,{depth:nr-At});if(tn!=="symbol"&&typeof Be.inspect=="function")return Be.inspect()}if(Me(Be)){var Ea=[];return r&&r.call(Be,function(zi,ao){Ea.push(dr(ao,Be,!0)+" => "+dr(zi,Be))}),dt("Map",n.call(Be),Ea,ei)}if(we(Be)){var Go=[];return s&&s.call(Be,function(zi){Go.push(dr(zi,Be))}),dt("Set",o.call(Be),Go,ei)}if(ve(Be))return ot("WeakMap");if(je(Be))return ot("WeakSet");if(ye(Be))return ot("WeakRef");if($e(Be))return rt(dr(Number(Be)));if(pe(Be))return rt(dr(C.call(Be)));if(ze(Be))return rt(y.call(Be));if(Ce(Be))return rt(dr(String(Be)));if(typeof window<"u"&&Be===window)return"{ [object Window] }";if(typeof globalThis<"u"&&Be===globalThis||typeof d0<"u"&&Be===d0)return"{ [object globalThis] }";if(!fe(Be)&&!ue(Be)){var ka=an(Be,dr),io=ee?ee(Be)===Object.prototype:Be instanceof Object||Be.constructor===Object,ui=Be instanceof Object?"":"null prototype",Aa=!io&&te&&Object(Be)===Be&&te in Be?S.call(ge(Be),8,-1):ui?"Object":"",Pa=io||typeof Be.constructor!="function"?"":Be.constructor.name?Be.constructor.name+" ":"",Wo=Pa+(Aa||ui?"["+I.call(O.call([],Aa||[],ui||[]),": ")+"] ":"");return ka.length===0?Wo+"{}":ei?Wo+"{"+on(ka,ei)+"}":Wo+"{ "+I.call(ka,", ")+" }"}return String(Be)};function Y(We,Be,$t){var At=$t.quoteStyle||Be,Lt=F[At];return Lt+We+Lt}function J(We){return k.call(String(We),/"/g,""")}function K(We){return!te||!(typeof We=="object"&&(te in We||typeof We[te]<"u"))}function ie(We){return ge(We)==="[object Array]"&&K(We)}function fe(We){return ge(We)==="[object Date]"&&K(We)}function ue(We){return ge(We)==="[object RegExp]"&&K(We)}function _e(We){return ge(We)==="[object Error]"&&K(We)}function Ce(We){return ge(We)==="[object String]"&&K(We)}function $e(We){return ge(We)==="[object Number]"&&K(We)}function ze(We){return ge(We)==="[object Boolean]"&&K(We)}function tt(We){if(G)return We&&typeof We=="object"&&We instanceof Symbol;if(typeof We=="symbol")return!0;if(!We||typeof We!="object"||!$)return!1;try{return $.call(We),!0}catch{}return!1}function pe(We){if(!We||typeof We!="object"||!C)return!1;try{return C.call(We),!0}catch{}return!1}var ut=Object.prototype.hasOwnProperty||function(We){return We in this};function be(We,Be){return ut.call(We,Be)}function ge(We){return _.call(We)}function xe(We){if(We.name)return We.name;var Be=b.call(x.call(We),/^function\s*([\w$]+)/);return Be?Be[1]:null}function Te(We,Be){if(We.indexOf)return We.indexOf(Be);for(var $t=0,At=We.length;$t<At;$t++)if(We[$t]===Be)return $t;return-1}function Me(We){if(!n||!We||typeof We!="object")return!1;try{n.call(We);try{o.call(We)}catch{return!0}return We instanceof Map}catch{}return!1}function ve(We){if(!h||!We||typeof We!="object")return!1;try{h.call(We,h);try{m.call(We,m)}catch{return!0}return We instanceof WeakMap}catch{}return!1}function ye(We){if(!d||!We||typeof We!="object")return!1;try{return d.call(We),!0}catch{}return!1}function we(We){if(!o||!We||typeof We!="object")return!1;try{o.call(We);try{n.call(We)}catch{return!0}return We instanceof Set}catch{}return!1}function je(We){if(!m||!We||typeof We!="object")return!1;try{m.call(We,m);try{h.call(We,h)}catch{return!0}return We instanceof WeakSet}catch{}return!1}function Le(We){return!We||typeof We!="object"?!1:typeof HTMLElement<"u"&&We instanceof HTMLElement?!0:typeof We.nodeName=="string"&&typeof We.getAttribute=="function"}function Ye(We,Be){if(We.length>Be.maxStringLength){var $t=We.length-Be.maxStringLength,At="... "+$t+" more character"+($t>1?"s":"");return Ye(S.call(We,0,Be.maxStringLength),Be)+At}var Lt=z[Be.quoteStyle||"single"];Lt.lastIndex=0;var Tt=k.call(k.call(We,Lt,"\\$1"),/[\x00-\x1f]/g,lt);return Y(Tt,"single",Be)}function lt(We){var Be=We.charCodeAt(0),$t={8:"b",9:"t",10:"n",12:"f",13:"r"}[Be];return $t?"\\"+$t:"\\x"+(Be<16?"0":"")+E.call(Be.toString(16))}function rt(We){return"Object("+We+")"}function ot(We){return We+" { ? }"}function dt(We,Be,$t,At){var Lt=At?on($t,At):I.call($t,", ");return We+" ("+Be+") {"+Lt+"}"}function Ct(We){for(var Be=0;Be<We.length;Be++)if(Te(We[Be],`
|
|
141
|
+
`)>=0)return!1;return!0}function Zt(We,Be){var $t;if(We.indent===" ")$t=" ";else if(typeof We.indent=="number"&&We.indent>0)$t=I.call(Array(We.indent+1)," ");else return null;return{base:$t,prev:I.call(Array(Be+1),$t)}}function on(We,Be){if(We.length===0)return"";var $t=`
|
|
142
|
+
`+Be.prev+Be.base;return $t+I.call(We,","+$t)+`
|
|
143
|
+
`+Be.prev}function an(We,Be){var $t=ie(We),At=[];if($t){At.length=We.length;for(var Lt=0;Lt<We.length;Lt++)At[Lt]=be(We,Lt)?Be(We[Lt],We):""}var Tt=typeof N=="function"?N(We):[],tn;if(G){tn={};for(var Wt=0;Wt<Tt.length;Wt++)tn["$"+Tt[Wt]]=Tt[Wt]}for(var hn in We)be(We,hn)&&($t&&String(Number(hn))===hn&&hn<We.length||G&&tn["$"+hn]instanceof Symbol||(R.call(/[^\w$]/,hn)?At.push(Be(hn,We)+": "+Be(We[hn],We)):At.push(hn+": "+Be(We[hn],We))));if(typeof N=="function")for(var bi=0;bi<Tt.length;bi++)se.call(We,Tt[bi])&&At.push("["+Be(Tt[bi])+"]: "+Be(We[Tt[bi]],We));return At}return v2}var y2,o3;function TL(){if(o3)return y2;o3=1;var e=tg(),t=Pd(),n=function(s,u,h){for(var c=s,m;(m=c.next)!=null;c=m)if(m.key===u)return c.next=m.next,h||(m.next=s.next,s.next=m),m},r=function(s,u){if(s){var h=n(s,u);return h&&h.value}},i=function(s,u,h){var c=n(s,u);c?c.value=h:s.next={key:u,next:s.next,value:h}},a=function(s,u){return s?!!n(s,u):!1},o=function(s,u){if(s)return n(s,u,!0)};return y2=function(){var u,h={assert:function(c){if(!h.has(c))throw new t("Side channel does not contain "+e(c))},delete:function(c){var m=u&&u.next,g=o(u,c);return g&&m&&m===g&&(u=void 0),!!g},get:function(c){return r(u,c)},has:function(c){return a(u,c)},set:function(c,m){u||(u={next:void 0}),i(u,c,m)}};return h},y2}var b2,s3;function B7(){return s3||(s3=1,b2=Object),b2}var w2,l3;function RL(){return l3||(l3=1,w2=Error),w2}var x2,u3;function ML(){return u3||(u3=1,x2=EvalError),x2}var _2,c3;function IL(){return c3||(c3=1,_2=RangeError),_2}var S2,f3;function jL(){return f3||(f3=1,S2=ReferenceError),S2}var E2,h3;function DL(){return h3||(h3=1,E2=SyntaxError),E2}var k2,d3;function FL(){return d3||(d3=1,k2=URIError),k2}var A2,p3;function BL(){return p3||(p3=1,A2=Math.abs),A2}var P2,g3;function zL(){return g3||(g3=1,P2=Math.floor),P2}var O2,m3;function UL(){return m3||(m3=1,O2=Math.max),O2}var C2,v3;function qL(){return v3||(v3=1,C2=Math.min),C2}var L2,y3;function $L(){return y3||(y3=1,L2=Math.pow),L2}var N2,b3;function HL(){return b3||(b3=1,N2=Math.round),N2}var T2,w3;function GL(){return w3||(w3=1,T2=Number.isNaN||function(t){return t!==t}),T2}var R2,x3;function WL(){if(x3)return R2;x3=1;var e=GL();return R2=function(n){return e(n)||n===0?n:n<0?-1:1},R2}var M2,_3;function VL(){return _3||(_3=1,M2=Object.getOwnPropertyDescriptor),M2}var I2,S3;function z7(){if(S3)return I2;S3=1;var e=VL();if(e)try{e([],"length")}catch{e=null}return I2=e,I2}var j2,E3;function YL(){if(E3)return j2;E3=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return j2=e,j2}var D2,k3;function XL(){return k3||(k3=1,D2=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;t[n]=i;for(var a in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,n);if(s.value!==i||s.enumerable!==!0)return!1}return!0}),D2}var F2,A3;function KL(){if(A3)return F2;A3=1;var e=typeof Symbol<"u"&&Symbol,t=XL();return F2=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},F2}var B2,P3;function U7(){return P3||(P3=1,B2=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),B2}var z2,O3;function q7(){if(O3)return z2;O3=1;var e=B7();return z2=e.getPrototypeOf||null,z2}var U2,C3;function ZL(){if(C3)return U2;C3=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,n=Math.max,r="[object Function]",i=function(u,h){for(var c=[],m=0;m<u.length;m+=1)c[m]=u[m];for(var g=0;g<h.length;g+=1)c[g+u.length]=h[g];return c},a=function(u,h){for(var c=[],m=h,g=0;m<u.length;m+=1,g+=1)c[g]=u[m];return c},o=function(s,u){for(var h="",c=0;c<s.length;c+=1)h+=s[c],c+1<s.length&&(h+=u);return h};return U2=function(u){var h=this;if(typeof h!="function"||t.apply(h)!==r)throw new TypeError(e+h);for(var c=a(arguments,1),m,g=function(){if(this instanceof m){var b=h.apply(this,i(c,arguments));return Object(b)===b?b:this}return h.apply(u,i(c,arguments))},d=n(0,h.length-c.length),y=[],_=0;_<d;_++)y[_]="$"+_;if(m=Function("binder","return function ("+o(y,",")+"){ return binder.apply(this,arguments); }")(g),h.prototype){var x=function(){};x.prototype=h.prototype,m.prototype=new x,x.prototype=null}return m},U2}var q2,L3;function ng(){if(L3)return q2;L3=1;var e=ZL();return q2=Function.prototype.bind||e,q2}var $2,N3;function yy(){return N3||(N3=1,$2=Function.prototype.call),$2}var H2,T3;function $7(){return T3||(T3=1,H2=Function.prototype.apply),H2}var G2,R3;function QL(){return R3||(R3=1,G2=typeof Reflect<"u"&&Reflect&&Reflect.apply),G2}var W2,M3;function JL(){if(M3)return W2;M3=1;var e=ng(),t=$7(),n=yy(),r=QL();return W2=r||e.call(n,t),W2}var V2,I3;function H7(){if(I3)return V2;I3=1;var e=ng(),t=Pd(),n=yy(),r=JL();return V2=function(a){if(a.length<1||typeof a[0]!="function")throw new t("a function is required");return r(e,n,a)},V2}var Y2,j3;function eN(){if(j3)return Y2;j3=1;var e=H7(),t=z7(),n;try{n=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var r=!!n&&t&&t(Object.prototype,"__proto__"),i=Object,a=i.getPrototypeOf;return Y2=r&&typeof r.get=="function"?e([r.get]):typeof a=="function"?function(s){return a(s==null?s:i(s))}:!1,Y2}var X2,D3;function tN(){if(D3)return X2;D3=1;var e=U7(),t=q7(),n=eN();return X2=e?function(i){return e(i)}:t?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return t(i)}:n?function(i){return n(i)}:null,X2}var K2,F3;function nN(){if(F3)return K2;F3=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,n=ng();return K2=n.call(e,t),K2}var Z2,B3;function by(){if(B3)return Z2;B3=1;var e,t=B7(),n=RL(),r=ML(),i=IL(),a=jL(),o=DL(),s=Pd(),u=FL(),h=BL(),c=zL(),m=UL(),g=qL(),d=$L(),y=HL(),_=WL(),x=Function,b=function(ue){try{return x('"use strict"; return ('+ue+").constructor;")()}catch{}},S=z7(),k=YL(),E=function(){throw new s},A=S?(function(){try{return arguments.callee,E}catch{try{return S(arguments,"callee").get}catch{return E}}})():E,R=KL()(),O=tN(),I=q7(),j=U7(),D=$7(),C=yy(),N={},$=typeof Uint8Array>"u"||!O?e:O(Uint8Array),G={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":R&&O?O([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":N,"%AsyncGenerator%":N,"%AsyncGeneratorFunction%":N,"%AsyncIteratorPrototype%":N,"%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%":n,"%eval%":eval,"%EvalError%":r,"%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%":x,"%GeneratorFunction%":N,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":R&&O?O(O([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!R||!O?e:O(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":S,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":i,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!R||!O?e:O(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":R&&O?O(""[Symbol.iterator]()):e,"%Symbol%":R?Symbol:e,"%SyntaxError%":o,"%ThrowTypeError%":A,"%TypedArray%":$,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":C,"%Function.prototype.apply%":D,"%Object.defineProperty%":k,"%Object.getPrototypeOf%":I,"%Math.abs%":h,"%Math.floor%":c,"%Math.max%":m,"%Math.min%":g,"%Math.pow%":d,"%Math.round%":y,"%Math.sign%":_,"%Reflect.getPrototypeOf%":j};if(O)try{null.error}catch(ue){var te=O(O(ue));G["%Error.prototype%"]=te}var se=function ue(_e){var Ce;if(_e==="%AsyncFunction%")Ce=b("async function () {}");else if(_e==="%GeneratorFunction%")Ce=b("function* () {}");else if(_e==="%AsyncGeneratorFunction%")Ce=b("async function* () {}");else if(_e==="%AsyncGenerator%"){var $e=ue("%AsyncGeneratorFunction%");$e&&(Ce=$e.prototype)}else if(_e==="%AsyncIteratorPrototype%"){var ze=ue("%AsyncGenerator%");ze&&O&&(Ce=O(ze.prototype))}return G[_e]=Ce,Ce},ee={__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"]},Q=ng(),re=nN(),X=Q.call(C,Array.prototype.concat),B=Q.call(D,Array.prototype.splice),F=Q.call(C,String.prototype.replace),z=Q.call(C,String.prototype.slice),Y=Q.call(C,RegExp.prototype.exec),J=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,K=/\\(\\)?/g,ie=function(_e){var Ce=z(_e,0,1),$e=z(_e,-1);if(Ce==="%"&&$e!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if($e==="%"&&Ce!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var ze=[];return F(_e,J,function(tt,pe,ut,be){ze[ze.length]=ut?F(be,K,"$1"):pe||tt}),ze},fe=function(_e,Ce){var $e=_e,ze;if(re(ee,$e)&&(ze=ee[$e],$e="%"+ze[0]+"%"),re(G,$e)){var tt=G[$e];if(tt===N&&(tt=se($e)),typeof tt>"u"&&!Ce)throw new s("intrinsic "+_e+" exists, but is not available. Please file an issue!");return{alias:ze,name:$e,value:tt}}throw new o("intrinsic "+_e+" does not exist!")};return Z2=function(_e,Ce){if(typeof _e!="string"||_e.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Ce!="boolean")throw new s('"allowMissing" argument must be a boolean');if(Y(/^%?[^%]*%?$/,_e)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var $e=ie(_e),ze=$e.length>0?$e[0]:"",tt=fe("%"+ze+"%",Ce),pe=tt.name,ut=tt.value,be=!1,ge=tt.alias;ge&&(ze=ge[0],B($e,X([0,1],ge)));for(var xe=1,Te=!0;xe<$e.length;xe+=1){var Me=$e[xe],ve=z(Me,0,1),ye=z(Me,-1);if((ve==='"'||ve==="'"||ve==="`"||ye==='"'||ye==="'"||ye==="`")&&ve!==ye)throw new o("property names with quotes must have matching quotes");if((Me==="constructor"||!Te)&&(be=!0),ze+="."+Me,pe="%"+ze+"%",re(G,pe))ut=G[pe];else if(ut!=null){if(!(Me in ut)){if(!Ce)throw new s("base intrinsic for "+_e+" exists, but the property is not available.");return}if(S&&xe+1>=$e.length){var we=S(ut,Me);Te=!!we,Te&&"get"in we&&!("originalValue"in we.get)?ut=we.get:ut=ut[Me]}else Te=re(ut,Me),ut=ut[Me];Te&&!be&&(G[pe]=ut)}}return ut},Z2}var Q2,z3;function G7(){if(z3)return Q2;z3=1;var e=by(),t=H7(),n=t([e("%String.prototype.indexOf%")]);return Q2=function(i,a){var o=e(i,!!a);return typeof o=="function"&&n(i,".prototype.")>-1?t([o]):o},Q2}var J2,U3;function W7(){if(U3)return J2;U3=1;var e=by(),t=G7(),n=tg(),r=Pd(),i=e("%Map%",!0),a=t("Map.prototype.get",!0),o=t("Map.prototype.set",!0),s=t("Map.prototype.has",!0),u=t("Map.prototype.delete",!0),h=t("Map.prototype.size",!0);return J2=!!i&&function(){var m,g={assert:function(d){if(!g.has(d))throw new r("Side channel does not contain "+n(d))},delete:function(d){if(m){var y=u(m,d);return h(m)===0&&(m=void 0),y}return!1},get:function(d){if(m)return a(m,d)},has:function(d){return m?s(m,d):!1},set:function(d,y){m||(m=new i),o(m,d,y)}};return g},J2}var em,q3;function rN(){if(q3)return em;q3=1;var e=by(),t=G7(),n=tg(),r=W7(),i=Pd(),a=e("%WeakMap%",!0),o=t("WeakMap.prototype.get",!0),s=t("WeakMap.prototype.set",!0),u=t("WeakMap.prototype.has",!0),h=t("WeakMap.prototype.delete",!0);return em=a?function(){var m,g,d={assert:function(y){if(!d.has(y))throw new i("Side channel does not contain "+n(y))},delete:function(y){if(a&&y&&(typeof y=="object"||typeof y=="function")){if(m)return h(m,y)}else if(r&&g)return g.delete(y);return!1},get:function(y){return a&&y&&(typeof y=="object"||typeof y=="function")&&m?o(m,y):g&&g.get(y)},has:function(y){return a&&y&&(typeof y=="object"||typeof y=="function")&&m?u(m,y):!!g&&g.has(y)},set:function(y,_){a&&y&&(typeof y=="object"||typeof y=="function")?(m||(m=new a),s(m,y,_)):r&&(g||(g=r()),g.set(y,_))}};return d}:r,em}var tm,$3;function iN(){if($3)return tm;$3=1;var e=Pd(),t=tg(),n=TL(),r=W7(),i=rN(),a=i||r||n;return tm=function(){var s,u={assert:function(h){if(!u.has(h))throw new e("Side channel does not contain "+t(h))},delete:function(h){return!!s&&s.delete(h)},get:function(h){return s&&s.get(h)},has:function(h){return!!s&&s.has(h)},set:function(h,c){s||(s=a()),s.set(h,c)}};return u},tm}var nm,H3;function wy(){if(H3)return nm;H3=1;var e=String.prototype.replace,t=/%20/g,n={RFC1738:"RFC1738",RFC3986:"RFC3986"};return nm={default:n.RFC3986,formatters:{RFC1738:function(r){return e.call(r,t,"+")},RFC3986:function(r){return String(r)}},RFC1738:n.RFC1738,RFC3986:n.RFC3986},nm}var rm,G3;function V7(){if(G3)return rm;G3=1;var e=wy(),t=Object.prototype.hasOwnProperty,n=Array.isArray,r=(function(){for(var x=[],b=0;b<256;++b)x.push("%"+((b<16?"0":"")+b.toString(16)).toUpperCase());return x})(),i=function(b){for(;b.length>1;){var S=b.pop(),k=S.obj[S.prop];if(n(k)){for(var E=[],A=0;A<k.length;++A)typeof k[A]<"u"&&E.push(k[A]);S.obj[S.prop]=E}}},a=function(b,S){for(var k=S&&S.plainObjects?{__proto__:null}:{},E=0;E<b.length;++E)typeof b[E]<"u"&&(k[E]=b[E]);return k},o=function x(b,S,k){if(!S)return b;if(typeof S!="object"&&typeof S!="function"){if(n(b))b.push(S);else if(b&&typeof b=="object")(k&&(k.plainObjects||k.allowPrototypes)||!t.call(Object.prototype,S))&&(b[S]=!0);else return[b,S];return b}if(!b||typeof b!="object")return[b].concat(S);var E=b;return n(b)&&!n(S)&&(E=a(b,k)),n(b)&&n(S)?(S.forEach(function(A,R){if(t.call(b,R)){var O=b[R];O&&typeof O=="object"&&A&&typeof A=="object"?b[R]=x(O,A,k):b.push(A)}else b[R]=A}),b):Object.keys(S).reduce(function(A,R){var O=S[R];return t.call(A,R)?A[R]=x(A[R],O,k):A[R]=O,A},E)},s=function(b,S){return Object.keys(S).reduce(function(k,E){return k[E]=S[E],k},b)},u=function(x,b,S){var k=x.replace(/\+/g," ");if(S==="iso-8859-1")return k.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(k)}catch{return k}},h=1024,c=function(b,S,k,E,A){if(b.length===0)return b;var R=b;if(typeof b=="symbol"?R=Symbol.prototype.toString.call(b):typeof b!="string"&&(R=String(b)),k==="iso-8859-1")return escape(R).replace(/%u[0-9a-f]{4}/gi,function($){return"%26%23"+parseInt($.slice(2),16)+"%3B"});for(var O="",I=0;I<R.length;I+=h){for(var j=R.length>=h?R.slice(I,I+h):R,D=[],C=0;C<j.length;++C){var N=j.charCodeAt(C);if(N===45||N===46||N===95||N===126||N>=48&&N<=57||N>=65&&N<=90||N>=97&&N<=122||A===e.RFC1738&&(N===40||N===41)){D[D.length]=j.charAt(C);continue}if(N<128){D[D.length]=r[N];continue}if(N<2048){D[D.length]=r[192|N>>6]+r[128|N&63];continue}if(N<55296||N>=57344){D[D.length]=r[224|N>>12]+r[128|N>>6&63]+r[128|N&63];continue}C+=1,N=65536+((N&1023)<<10|j.charCodeAt(C)&1023),D[D.length]=r[240|N>>18]+r[128|N>>12&63]+r[128|N>>6&63]+r[128|N&63]}O+=D.join("")}return O},m=function(b){for(var S=[{obj:{o:b},prop:"o"}],k=[],E=0;E<S.length;++E)for(var A=S[E],R=A.obj[A.prop],O=Object.keys(R),I=0;I<O.length;++I){var j=O[I],D=R[j];typeof D=="object"&&D!==null&&k.indexOf(D)===-1&&(S.push({obj:R,prop:j}),k.push(D))}return i(S),b},g=function(b){return Object.prototype.toString.call(b)==="[object RegExp]"},d=function(b){return!b||typeof b!="object"?!1:!!(b.constructor&&b.constructor.isBuffer&&b.constructor.isBuffer(b))},y=function(b,S){return[].concat(b,S)},_=function(b,S){if(n(b)){for(var k=[],E=0;E<b.length;E+=1)k.push(S(b[E]));return k}return S(b)};return rm={arrayToObject:a,assign:s,combine:y,compact:m,decode:u,encode:c,isBuffer:d,isRegExp:g,maybeMap:_,merge:o},rm}var im,W3;function aN(){if(W3)return im;W3=1;var e=iN(),t=V7(),n=wy(),r=Object.prototype.hasOwnProperty,i={brackets:function(x){return x+"[]"},comma:"comma",indices:function(x,b){return x+"["+b+"]"},repeat:function(x){return x}},a=Array.isArray,o=Array.prototype.push,s=function(_,x){o.apply(_,a(x)?x:[x])},u=Date.prototype.toISOString,h=n.default,c={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:t.encode,encodeValuesOnly:!1,filter:void 0,format:h,formatter:n.formatters[h],indices:!1,serializeDate:function(x){return u.call(x)},skipNulls:!1,strictNullHandling:!1},m=function(x){return typeof x=="string"||typeof x=="number"||typeof x=="boolean"||typeof x=="symbol"||typeof x=="bigint"},g={},d=function _(x,b,S,k,E,A,R,O,I,j,D,C,N,$,G,te,se,ee){for(var Q=x,re=ee,X=0,B=!1;(re=re.get(g))!==void 0&&!B;){var F=re.get(x);if(X+=1,typeof F<"u"){if(F===X)throw new RangeError("Cyclic object value");B=!0}typeof re.get(g)>"u"&&(X=0)}if(typeof j=="function"?Q=j(b,Q):Q instanceof Date?Q=N(Q):S==="comma"&&a(Q)&&(Q=t.maybeMap(Q,function(pe){return pe instanceof Date?N(pe):pe})),Q===null){if(A)return I&&!te?I(b,c.encoder,se,"key",$):b;Q=""}if(m(Q)||t.isBuffer(Q)){if(I){var z=te?b:I(b,c.encoder,se,"key",$);return[G(z)+"="+G(I(Q,c.encoder,se,"value",$))]}return[G(b)+"="+G(String(Q))]}var Y=[];if(typeof Q>"u")return Y;var J;if(S==="comma"&&a(Q))te&&I&&(Q=t.maybeMap(Q,I)),J=[{value:Q.length>0?Q.join(",")||null:void 0}];else if(a(j))J=j;else{var K=Object.keys(Q);J=D?K.sort(D):K}var ie=O?String(b).replace(/\./g,"%2E"):String(b),fe=k&&a(Q)&&Q.length===1?ie+"[]":ie;if(E&&a(Q)&&Q.length===0)return fe+"[]";for(var ue=0;ue<J.length;++ue){var _e=J[ue],Ce=typeof _e=="object"&&_e&&typeof _e.value<"u"?_e.value:Q[_e];if(!(R&&Ce===null)){var $e=C&&O?String(_e).replace(/\./g,"%2E"):String(_e),ze=a(Q)?typeof S=="function"?S(fe,$e):fe:fe+(C?"."+$e:"["+$e+"]");ee.set(x,X);var tt=e();tt.set(g,ee),s(Y,_(Ce,ze,S,k,E,A,R,O,S==="comma"&&te&&a(Q)?null:I,j,D,C,N,$,G,te,se,tt))}}return Y},y=function(x){if(!x)return c;if(typeof x.allowEmptyArrays<"u"&&typeof x.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof x.encodeDotInKeys<"u"&&typeof x.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(x.encoder!==null&&typeof x.encoder<"u"&&typeof x.encoder!="function")throw new TypeError("Encoder has to be a function.");var b=x.charset||c.charset;if(typeof x.charset<"u"&&x.charset!=="utf-8"&&x.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var S=n.default;if(typeof x.format<"u"){if(!r.call(n.formatters,x.format))throw new TypeError("Unknown format option provided.");S=x.format}var k=n.formatters[S],E=c.filter;(typeof x.filter=="function"||a(x.filter))&&(E=x.filter);var A;if(x.arrayFormat in i?A=x.arrayFormat:"indices"in x?A=x.indices?"indices":"repeat":A=c.arrayFormat,"commaRoundTrip"in x&&typeof x.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var R=typeof x.allowDots>"u"?x.encodeDotInKeys===!0?!0:c.allowDots:!!x.allowDots;return{addQueryPrefix:typeof x.addQueryPrefix=="boolean"?x.addQueryPrefix:c.addQueryPrefix,allowDots:R,allowEmptyArrays:typeof x.allowEmptyArrays=="boolean"?!!x.allowEmptyArrays:c.allowEmptyArrays,arrayFormat:A,charset:b,charsetSentinel:typeof x.charsetSentinel=="boolean"?x.charsetSentinel:c.charsetSentinel,commaRoundTrip:!!x.commaRoundTrip,delimiter:typeof x.delimiter>"u"?c.delimiter:x.delimiter,encode:typeof x.encode=="boolean"?x.encode:c.encode,encodeDotInKeys:typeof x.encodeDotInKeys=="boolean"?x.encodeDotInKeys:c.encodeDotInKeys,encoder:typeof x.encoder=="function"?x.encoder:c.encoder,encodeValuesOnly:typeof x.encodeValuesOnly=="boolean"?x.encodeValuesOnly:c.encodeValuesOnly,filter:E,format:S,formatter:k,serializeDate:typeof x.serializeDate=="function"?x.serializeDate:c.serializeDate,skipNulls:typeof x.skipNulls=="boolean"?x.skipNulls:c.skipNulls,sort:typeof x.sort=="function"?x.sort:null,strictNullHandling:typeof x.strictNullHandling=="boolean"?x.strictNullHandling:c.strictNullHandling}};return im=function(_,x){var b=_,S=y(x),k,E;typeof S.filter=="function"?(E=S.filter,b=E("",b)):a(S.filter)&&(E=S.filter,k=E);var A=[];if(typeof b!="object"||b===null)return"";var R=i[S.arrayFormat],O=R==="comma"&&S.commaRoundTrip;k||(k=Object.keys(b)),S.sort&&k.sort(S.sort);for(var I=e(),j=0;j<k.length;++j){var D=k[j],C=b[D];S.skipNulls&&C===null||s(A,d(C,D,R,O,S.allowEmptyArrays,S.strictNullHandling,S.skipNulls,S.encodeDotInKeys,S.encode?S.encoder:null,S.filter,S.sort,S.allowDots,S.serializeDate,S.format,S.formatter,S.encodeValuesOnly,S.charset,I))}var N=A.join(S.delimiter),$=S.addQueryPrefix===!0?"?":"";return S.charsetSentinel&&(S.charset==="iso-8859-1"?$+="utf8=%26%2310003%3B&":$+="utf8=%E2%9C%93&"),N.length>0?$+N:""},im}var am,V3;function oN(){if(V3)return am;V3=1;var e=V7(),t=Object.prototype.hasOwnProperty,n=Array.isArray,r={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},i=function(g){return g.replace(/&#(\d+);/g,function(d,y){return String.fromCharCode(parseInt(y,10))})},a=function(g,d,y){if(g&&typeof g=="string"&&d.comma&&g.indexOf(",")>-1)return g.split(",");if(d.throwOnLimitExceeded&&y>=d.arrayLimit)throw new RangeError("Array limit exceeded. Only "+d.arrayLimit+" element"+(d.arrayLimit===1?"":"s")+" allowed in an array.");return g},o="utf8=%26%2310003%3B",s="utf8=%E2%9C%93",u=function(d,y){var _={__proto__:null},x=y.ignoreQueryPrefix?d.replace(/^\?/,""):d;x=x.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var b=y.parameterLimit===1/0?void 0:y.parameterLimit,S=x.split(y.delimiter,y.throwOnLimitExceeded?b+1:b);if(y.throwOnLimitExceeded&&S.length>b)throw new RangeError("Parameter limit exceeded. Only "+b+" parameter"+(b===1?"":"s")+" allowed.");var k=-1,E,A=y.charset;if(y.charsetSentinel)for(E=0;E<S.length;++E)S[E].indexOf("utf8=")===0&&(S[E]===s?A="utf-8":S[E]===o&&(A="iso-8859-1"),k=E,E=S.length);for(E=0;E<S.length;++E)if(E!==k){var R=S[E],O=R.indexOf("]="),I=O===-1?R.indexOf("="):O+1,j,D;I===-1?(j=y.decoder(R,r.decoder,A,"key"),D=y.strictNullHandling?null:""):(j=y.decoder(R.slice(0,I),r.decoder,A,"key"),D=e.maybeMap(a(R.slice(I+1),y,n(_[j])?_[j].length:0),function(N){return y.decoder(N,r.decoder,A,"value")})),D&&y.interpretNumericEntities&&A==="iso-8859-1"&&(D=i(String(D))),R.indexOf("[]=")>-1&&(D=n(D)?[D]:D);var C=t.call(_,j);C&&y.duplicates==="combine"?_[j]=e.combine(_[j],D):(!C||y.duplicates==="last")&&(_[j]=D)}return _},h=function(g,d,y,_){var x=0;if(g.length>0&&g[g.length-1]==="[]"){var b=g.slice(0,-1).join("");x=Array.isArray(d)&&d[b]?d[b].length:0}for(var S=_?d:a(d,y,x),k=g.length-1;k>=0;--k){var E,A=g[k];if(A==="[]"&&y.parseArrays)E=y.allowEmptyArrays&&(S===""||y.strictNullHandling&&S===null)?[]:e.combine([],S);else{E=y.plainObjects?{__proto__:null}:{};var R=A.charAt(0)==="["&&A.charAt(A.length-1)==="]"?A.slice(1,-1):A,O=y.decodeDotInKeys?R.replace(/%2E/g,"."):R,I=parseInt(O,10);!y.parseArrays&&O===""?E={0:S}:!isNaN(I)&&A!==O&&String(I)===O&&I>=0&&y.parseArrays&&I<=y.arrayLimit?(E=[],E[I]=S):O!=="__proto__"&&(E[O]=S)}S=E}return S},c=function(d,y,_,x){if(d){var b=_.allowDots?d.replace(/\.([^.[]+)/g,"[$1]"):d,S=/(\[[^[\]]*])/,k=/(\[[^[\]]*])/g,E=_.depth>0&&S.exec(b),A=E?b.slice(0,E.index):b,R=[];if(A){if(!_.plainObjects&&t.call(Object.prototype,A)&&!_.allowPrototypes)return;R.push(A)}for(var O=0;_.depth>0&&(E=k.exec(b))!==null&&O<_.depth;){if(O+=1,!_.plainObjects&&t.call(Object.prototype,E[1].slice(1,-1))&&!_.allowPrototypes)return;R.push(E[1])}if(E){if(_.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+_.depth+" and strictDepth is true");R.push("["+b.slice(E.index)+"]")}return h(R,y,_,x)}},m=function(d){if(!d)return r;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 y=typeof d.charset>"u"?r.charset:d.charset,_=typeof d.duplicates>"u"?r.duplicates:d.duplicates;if(_!=="combine"&&_!=="first"&&_!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var x=typeof d.allowDots>"u"?d.decodeDotInKeys===!0?!0:r.allowDots:!!d.allowDots;return{allowDots:x,allowEmptyArrays:typeof d.allowEmptyArrays=="boolean"?!!d.allowEmptyArrays:r.allowEmptyArrays,allowPrototypes:typeof d.allowPrototypes=="boolean"?d.allowPrototypes:r.allowPrototypes,allowSparse:typeof d.allowSparse=="boolean"?d.allowSparse:r.allowSparse,arrayLimit:typeof d.arrayLimit=="number"?d.arrayLimit:r.arrayLimit,charset:y,charsetSentinel:typeof d.charsetSentinel=="boolean"?d.charsetSentinel:r.charsetSentinel,comma:typeof d.comma=="boolean"?d.comma:r.comma,decodeDotInKeys:typeof d.decodeDotInKeys=="boolean"?d.decodeDotInKeys:r.decodeDotInKeys,decoder:typeof d.decoder=="function"?d.decoder:r.decoder,delimiter:typeof d.delimiter=="string"||e.isRegExp(d.delimiter)?d.delimiter:r.delimiter,depth:typeof d.depth=="number"||d.depth===!1?+d.depth:r.depth,duplicates:_,ignoreQueryPrefix:d.ignoreQueryPrefix===!0,interpretNumericEntities:typeof d.interpretNumericEntities=="boolean"?d.interpretNumericEntities:r.interpretNumericEntities,parameterLimit:typeof d.parameterLimit=="number"?d.parameterLimit:r.parameterLimit,parseArrays:d.parseArrays!==!1,plainObjects:typeof d.plainObjects=="boolean"?d.plainObjects:r.plainObjects,strictDepth:typeof d.strictDepth=="boolean"?!!d.strictDepth:r.strictDepth,strictNullHandling:typeof d.strictNullHandling=="boolean"?d.strictNullHandling:r.strictNullHandling,throwOnLimitExceeded:typeof d.throwOnLimitExceeded=="boolean"?d.throwOnLimitExceeded:!1}};return am=function(g,d){var y=m(d);if(g===""||g===null||typeof g>"u")return y.plainObjects?{__proto__:null}:{};for(var _=typeof g=="string"?u(g,y):g,x=y.plainObjects?{__proto__:null}:{},b=Object.keys(_),S=0;S<b.length;++S){var k=b[S],E=c(k,_[k],y,typeof g=="string");x=e.merge(x,E,y)}return y.allowSparse===!0?x:e.compact(x)},am}var om,Y3;function sN(){if(Y3)return om;Y3=1;var e=aN(),t=oN(),n=wy();return om={formats:n,parse:t,stringify:e},om}var X3;function Y7(){if(X3)return Kf;X3=1;var e=OL();function t(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var n=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,a=["<",">",'"',"`"," ","\r",`
|
|
144
|
+
`," "],o=["{","}","|","\\","^","`"].concat(a),s=["'"].concat(o),u=["%","/","?",";","#"].concat(s),h=["/","?","#"],c=255,m=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,d={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},x=sN();function b(A,R,O){if(A&&typeof A=="object"&&A instanceof t)return A;var I=new t;return I.parse(A,R,O),I}t.prototype.parse=function(A,R,O){if(typeof A!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof A);var I=A.indexOf("?"),j=I!==-1&&I<A.indexOf("#")?"?":"#",D=A.split(j),C=/\\/g;D[0]=D[0].replace(C,"/"),A=D.join(j);var N=A;if(N=N.trim(),!O&&A.split("#").length===1){var $=i.exec(N);if($)return this.path=N,this.href=N,this.pathname=$[1],$[2]?(this.search=$[2],R?this.query=x.parse(this.search.substr(1)):this.query=this.search.substr(1)):R&&(this.search="",this.query={}),this}var G=n.exec(N);if(G){G=G[0];var te=G.toLowerCase();this.protocol=te,N=N.substr(G.length)}if(O||G||N.match(/^\/\/[^@/]+@[^@/]+/)){var se=N.substr(0,2)==="//";se&&!(G&&y[G])&&(N=N.substr(2),this.slashes=!0)}if(!y[G]&&(se||G&&!_[G])){for(var ee=-1,Q=0;Q<h.length;Q++){var re=N.indexOf(h[Q]);re!==-1&&(ee===-1||re<ee)&&(ee=re)}var X,B;ee===-1?B=N.lastIndexOf("@"):B=N.lastIndexOf("@",ee),B!==-1&&(X=N.slice(0,B),N=N.slice(B+1),this.auth=decodeURIComponent(X)),ee=-1;for(var Q=0;Q<u.length;Q++){var re=N.indexOf(u[Q]);re!==-1&&(ee===-1||re<ee)&&(ee=re)}ee===-1&&(ee=N.length),this.host=N.slice(0,ee),N=N.slice(ee),this.parseHost(),this.hostname=this.hostname||"";var F=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!F)for(var z=this.hostname.split(/\./),Q=0,Y=z.length;Q<Y;Q++){var J=z[Q];if(J&&!J.match(m)){for(var K="",ie=0,fe=J.length;ie<fe;ie++)J.charCodeAt(ie)>127?K+="x":K+=J[ie];if(!K.match(m)){var ue=z.slice(0,Q),_e=z.slice(Q+1),Ce=J.match(g);Ce&&(ue.push(Ce[1]),_e.unshift(Ce[2])),_e.length&&(N="/"+_e.join(".")+N),this.hostname=ue.join(".");break}}}this.hostname.length>c?this.hostname="":this.hostname=this.hostname.toLowerCase(),F||(this.hostname=e.toASCII(this.hostname));var $e=this.port?":"+this.port:"",ze=this.hostname||"";this.host=ze+$e,this.href+=this.host,F&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),N[0]!=="/"&&(N="/"+N))}if(!d[te])for(var Q=0,Y=s.length;Q<Y;Q++){var tt=s[Q];if(N.indexOf(tt)!==-1){var pe=encodeURIComponent(tt);pe===tt&&(pe=escape(tt)),N=N.split(tt).join(pe)}}var ut=N.indexOf("#");ut!==-1&&(this.hash=N.substr(ut),N=N.slice(0,ut));var be=N.indexOf("?");if(be!==-1?(this.search=N.substr(be),this.query=N.substr(be+1),R&&(this.query=x.parse(this.query)),N=N.slice(0,be)):R&&(this.search="",this.query={}),N&&(this.pathname=N),_[te]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var $e=this.pathname||"",ge=this.search||"";this.path=$e+ge}return this.href=this.format(),this};function S(A){return typeof A=="string"&&(A=b(A)),A instanceof t?A.format():t.prototype.format.call(A)}t.prototype.format=function(){var A=this.auth||"";A&&(A=encodeURIComponent(A),A=A.replace(/%3A/i,":"),A+="@");var R=this.protocol||"",O=this.pathname||"",I=this.hash||"",j=!1,D="";this.host?j=A+this.host:this.hostname&&(j=A+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(j+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(D=x.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var C=this.search||D&&"?"+D||"";return R&&R.substr(-1)!==":"&&(R+=":"),this.slashes||(!R||_[R])&&j!==!1?(j="//"+(j||""),O&&O.charAt(0)!=="/"&&(O="/"+O)):j||(j=""),I&&I.charAt(0)!=="#"&&(I="#"+I),C&&C.charAt(0)!=="?"&&(C="?"+C),O=O.replace(/[?#]/g,function(N){return encodeURIComponent(N)}),C=C.replace("#","%23"),R+j+O+C+I};function k(A,R){return b(A,!1,!0).resolve(R)}t.prototype.resolve=function(A){return this.resolveObject(b(A,!1,!0)).format()};function E(A,R){return A?b(A,!1,!0).resolveObject(R):R}return t.prototype.resolveObject=function(A){if(typeof A=="string"){var R=new t;R.parse(A,!1,!0),A=R}for(var O=new t,I=Object.keys(this),j=0;j<I.length;j++){var D=I[j];O[D]=this[D]}if(O.hash=A.hash,A.href==="")return O.href=O.format(),O;if(A.slashes&&!A.protocol){for(var C=Object.keys(A),N=0;N<C.length;N++){var $=C[N];$!=="protocol"&&(O[$]=A[$])}return _[O.protocol]&&O.hostname&&!O.pathname&&(O.pathname="/",O.path=O.pathname),O.href=O.format(),O}if(A.protocol&&A.protocol!==O.protocol){if(!_[A.protocol]){for(var G=Object.keys(A),te=0;te<G.length;te++){var se=G[te];O[se]=A[se]}return O.href=O.format(),O}if(O.protocol=A.protocol,!A.host&&!y[A.protocol]){for(var Y=(A.pathname||"").split("/");Y.length&&!(A.host=Y.shift()););A.host||(A.host=""),A.hostname||(A.hostname=""),Y[0]!==""&&Y.unshift(""),Y.length<2&&Y.unshift(""),O.pathname=Y.join("/")}else O.pathname=A.pathname;if(O.search=A.search,O.query=A.query,O.host=A.host||"",O.auth=A.auth,O.hostname=A.hostname||A.host,O.port=A.port,O.pathname||O.search){var ee=O.pathname||"",Q=O.search||"";O.path=ee+Q}return O.slashes=O.slashes||A.slashes,O.href=O.format(),O}var re=O.pathname&&O.pathname.charAt(0)==="/",X=A.host||A.pathname&&A.pathname.charAt(0)==="/",B=X||re||O.host&&A.pathname,F=B,z=O.pathname&&O.pathname.split("/")||[],Y=A.pathname&&A.pathname.split("/")||[],J=O.protocol&&!_[O.protocol];if(J&&(O.hostname="",O.port=null,O.host&&(z[0]===""?z[0]=O.host:z.unshift(O.host)),O.host="",A.protocol&&(A.hostname=null,A.port=null,A.host&&(Y[0]===""?Y[0]=A.host:Y.unshift(A.host)),A.host=null),B=B&&(Y[0]===""||z[0]==="")),X)O.host=A.host||A.host===""?A.host:O.host,O.hostname=A.hostname||A.hostname===""?A.hostname:O.hostname,O.search=A.search,O.query=A.query,z=Y;else if(Y.length)z||(z=[]),z.pop(),z=z.concat(Y),O.search=A.search,O.query=A.query;else if(A.search!=null){if(J){O.host=z.shift(),O.hostname=O.host;var K=O.host&&O.host.indexOf("@")>0?O.host.split("@"):!1;K&&(O.auth=K.shift(),O.hostname=K.shift(),O.host=O.hostname)}return O.search=A.search,O.query=A.query,(O.pathname!==null||O.search!==null)&&(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.href=O.format(),O}if(!z.length)return O.pathname=null,O.search?O.path="/"+O.search:O.path=null,O.href=O.format(),O;for(var ie=z.slice(-1)[0],fe=(O.host||A.host||z.length>1)&&(ie==="."||ie==="..")||ie==="",ue=0,_e=z.length;_e>=0;_e--)ie=z[_e],ie==="."?z.splice(_e,1):ie===".."?(z.splice(_e,1),ue++):ue&&(z.splice(_e,1),ue--);if(!B&&!F)for(;ue--;ue)z.unshift("..");B&&z[0]!==""&&(!z[0]||z[0].charAt(0)!=="/")&&z.unshift(""),fe&&z.join("/").substr(-1)!=="/"&&z.push("");var Ce=z[0]===""||z[0]&&z[0].charAt(0)==="/";if(J){O.hostname=Ce?"":z.length?z.shift():"",O.host=O.hostname;var K=O.host&&O.host.indexOf("@")>0?O.host.split("@"):!1;K&&(O.auth=K.shift(),O.hostname=K.shift(),O.host=O.hostname)}return B=B||O.host&&z.length,B&&!Ce&&z.unshift(""),z.length>0?O.pathname=z.join("/"):(O.pathname=null,O.path=null),(O.pathname!==null||O.search!==null)&&(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.auth=A.auth||O.auth,O.slashes=O.slashes||A.slashes,O.href=O.format(),O},t.prototype.parseHost=function(){var A=this.host,R=r.exec(A);R&&(R=R[0],R!==":"&&(this.port=R.substr(1)),A=A.substr(0,A.length-R.length)),A&&(this.hostname=A)},Kf.parse=b,Kf.resolve=k,Kf.resolveObject=E,Kf.format=S,Kf.Url=t,Kf}var a0={exports:{}},lN=a0.exports,K3;function uN(){return K3||(K3=1,(function(e){(function(t,n){e.exports?e.exports=n():t.xmlserializer=n()})(lN,function(){var t=function(d){return d.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},n=function(d){return d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},r=function(d){return d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},i=function(d){var y=d.value;return" "+d.name+'="'+n(y)+'"'},a=function(d){var y=d.tagName;return d.namespaceURI==="http://www.w3.org/1999/xhtml"&&(y=y.toLowerCase()),y},o=function(d,y){var _=Array.prototype.map.call(d.attributes||d.attrs,function(x){return x.name}).indexOf("xmlns")>=0;return!_&&(y||d.namespaceURI!==d.parentNode.namespaceURI)?' xmlns="'+d.namespaceURI+'"':""},s=function(d){return Array.prototype.map.call(d.childNodes,function(y){return g(y)}).join("")},u=function(d,y){var _="<"+a(d);return _+=o(d,y),Array.prototype.forEach.call(d.attributes||d.attrs,function(x){_+=i(x)}),d.childNodes.length>0?(_+=">",_+=s(d),_+="</"+a(d)+">"):_+="/>",_},h=function(d){var y=d.nodeValue||d.value||"";return r(y)},c=function(d){return"<!--"+d.data.replace(/-/g,"-")+"-->"},m=function(d){return"<![CDATA["+d.nodeValue+"]]>"},g=function(d,y){var _=y&&y.rootNode;if(d.nodeName==="#document"||d.nodeName==="#document-fragment")return s(d);if(d.tagName)return u(d,_);if(d.nodeName==="#text")return h(d);if(d.nodeName==="#comment")return c(d);if(d.nodeName==="#cdata-section")return m(d)};return{serializeToString:function(d){return t(g(d,{rootNode:!0}))}}})})(a0)),a0.exports}var sm={},Z3;function cN(){if(Z3)return sm;Z3=1;var e=function(a){var o=new XMLSerializer;return Array.prototype.map.call(a.childNodes,function(s){return o.serializeToString(s)}).join("")},t=function(a){if(a.documentElement.tagName==="parsererror"&&a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml")return a.documentElement;if((a.documentElement.tagName==="xml"||a.documentElement.tagName==="html")&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0];if(a.documentElement.tagName==="html"&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="body"&&a.documentElement.childNodes[0].childNodes&&a.documentElement.childNodes[0].childNodes.length&&a.documentElement.childNodes[0].childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0].childNodes[0]},n=[new RegExp(`^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)
|
|
145
|
+
?</div>`),new RegExp(`^(.+)
|
|
146
|
+
`)],r=function(a){var o=e(a),s,u;for(s=0;s<n.length;s++)if(u=n[s].exec(o),u)return u[1]},i=function(a){var o;if(a===null)throw new Error("Parse error");var s=t(a);if(s!==void 0)throw o=r(s)||"Parse error",new Error(o)};return sm.failOnParseError=function(a){return i(a),a},sm}var lm={},um={},Q3;function rg(){return Q3||(Q3=1,(function(e){var t=Y7();e.getDocumentBaseUrl=function(s){return s.baseURI!=="about:blank"?s.baseURI:null},e.clone=function(s){var u={},h;for(h in s)s.hasOwnProperty(h)&&(u[h]=s[h]);return u},e.cloneArray=function(s){return Array.prototype.slice.apply(s,[0])},e.joinUrl=function(s,u){return s?t.resolve(s,u):u},e.isDataUri=function(s){return/^data:/.test(s)},e.collectAndReportErrors=function(s){var u=[];return Promise.all(s.map(function(h){return h.catch(function(c){u.push(c)})})).then(function(){return u})};var n=null,r=function(s,u){return u===!1||u==="none"||u==="repeated"?((n===null||u!=="repeated")&&(n=Date.now()),s+"?_="+n):s};e.ajax=function(s,u){return new Promise(function(h,c){var m=new window.XMLHttpRequest,g=e.joinUrl(u.baseUrl,s),d,y=function(){c({msg:"Unable to load url",url:g})};d=r(g,u.cache),m.addEventListener("load",function(){m.status===200||m.status===0?h(m.response):y()},!1),m.addEventListener("error",y,!1);try{m.open("GET",d,!0),m.overrideMimeType(u.mimeType),m.send(null)}catch{y()}})},e.binaryAjax=function(s,u){var h=e.clone(u);return h.mimeType="text/plain; charset=x-user-defined",e.ajax(s,h).then(function(c){for(var m="",g=0;g<c.length;g++)m+=String.fromCharCode(c.charCodeAt(g)&255);return m})};var i=function(s){var u=function(h,c){return h.substring(0,c.length)===c};return u(s,"<?xml")||u(s,"<svg")?"image/svg+xml":"image/png"};e.getDataURIForImageURL=function(s,u){return e.binaryAjax(s,u).then(function(h){var c=btoa(h),m=i(h);return"data:"+m+";base64,"+c})};var a=[],o=function(s){return a.indexOf(s)<0&&a.push(s),a.indexOf(s)};e.memoize=function(s,u,h){if(typeof h!="object")throw new Error("cacheBucket is not an object");return function(){var c=Array.prototype.slice.call(arguments),m=u(c),g=o(s),d;return h[g]&&h[g][m]?h[g][m]:(d=s.apply(null,c),h[g]=h[g]||{},h[g][m]=d,d)}}})(um)),um}var cm={},J3;function fN(){if(J3)return cm;J3=1;var e=rg(),t=function(a,o){var s=null;a.hasAttribute("src")?s=a.getAttribute("src"):a.hasAttributeNS("http://www.w3.org/1999/xlink","href")?s=a.getAttributeNS("http://www.w3.org/1999/xlink","href"):a.hasAttribute("href")&&(s=a.getAttribute("href"));var u=e.getDocumentBaseUrl(a.ownerDocument),h=e.clone(o);return!h.baseUrl&&u&&(h.baseUrl=u),e.getDataURIForImageURL(s,h).then(function(c){return c},function(c){throw{resourceType:"image",url:c.url,msg:"Unable to load image "+c.url}})},n=function(a){return a.filter(function(o){var s=null;return o.hasAttribute("src")?s=o.getAttribute("src"):o.hasAttributeNS("http://www.w3.org/1999/xlink","href")?s=o.getAttributeNS("http://www.w3.org/1999/xlink","href"):o.hasAttribute("href")&&(s=o.getAttribute("href")),s!==null&&!e.isDataUri(s)})},r=function(a){return Array.prototype.filter.call(a,function(o){return o.type==="image"})},i=function(a){return Array.prototype.slice.call(a)};return cm.inline=function(a,o){var s=i(a.getElementsByTagName("img")),u=i(a.getElementsByTagName("image")),h=r(a.getElementsByTagName("input"));s=s.concat(u),s=s.concat(h);var c=n(s);return e.collectAndReportErrors(c.map(function(m){return t(m,o).then(function(g){m.attributes.src?m.attributes.src.value=g:m.attributes["xlink:href"]?m.attributes["xlink:href"].value=g:m.attributes.href&&(m.attributes.href.value=g)})}))},cm}var fm={},e4;function hN(){if(e4)return fm;e4=1;var e=rg(),t=function(a,o){var s=a.attributes.src.value,u=e.getDocumentBaseUrl(a.ownerDocument),h=e.clone(o);return!h.baseUrl&&u&&(h.baseUrl=u),e.ajax(s,h).catch(function(c){throw{resourceType:"script",url:c.url,msg:"Unable to load script "+c.url}})},n=function(a){return a.replace(/<\//g,"<\\/")},r=function(a,o){a.attributes.removeNamedItem("src"),a.textContent=n(o)},i=function(a){var o=a.getElementsByTagName("script");return Array.prototype.filter.call(o,function(s){return!!s.attributes.src})};return fm.inline=function(a,o){var s=i(a);return e.collectAndReportErrors(s.map(function(u){return t(u,o).then(function(h){r(u,h)})}))},fm}var hm={},dm={},t4;function xy(){return t4||(t4=1,(function(e){e.unquoteString=function(t){var n=/^"(.*)"$/,r=/^'(.*)'$/;return n.test(t)?t.replace(n,"$1"):r.test(t)?t.replace(r,"$1"):t},e.rulesForCssText=function(t){var n=document.implementation.createHTMLDocument(""),r=document.createElement("style"),i;return r.textContent=t,n.body.appendChild(r),i=r.sheet.cssRules,Array.prototype.slice.call(i)},e.cssRulesToText=function(t){return t.reduce(function(n,r){return n+r.cssText},"")},e.exchangeRule=function(t,n,r){var i=t.indexOf(n);t[i]=e.rulesForCssText(r)[0]},e.changeFontFaceRuleSrc=function(t,n,r){var i="@font-face { font-family: "+n.style.getPropertyValue("font-family")+"; ";n.style.getPropertyValue("font-style")&&(i+="font-style: "+n.style.getPropertyValue("font-style")+"; "),n.style.getPropertyValue("font-weight")&&(i+="font-weight: "+n.style.getPropertyValue("font-weight")+"; "),n.style.getPropertyValue("unicode-range")&&(i+="unicode-range: "+n.style.getPropertyValue("unicode-range")+"; "),i+="src: "+r+"}",e.exchangeRule(t,n,i)}})(dm)),dm}var pm={},n4;function dN(){return n4||(n4=1,(function(e){var t=xy(),n=function(a){var o=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return a.replace(o,"$1")};e.extractCssUrl=function(a){var o=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,s;if(!o.test(a))throw new Error("Invalid url");return s=o.exec(a)[1],t.unquoteString(n(s))};var r=function(a){var o=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,s="(url\\("+o+"\\)|[^,\\s]+)",u="(?:\\s*"+s+")+",h="^\\s*("+u+")(?:\\s*,\\s*("+u+"))*\\s*$",c=new RegExp(u,"g"),m,g=[],d=function(y){var _=new RegExp(s,"g"),x=[],b;for(b=_.exec(y);b;)x.push(b[1]),b=_.exec(y);return x};if(a.match(new RegExp(h))){for(m=c.exec(a);m;)g.push(d(m[0])),m=c.exec(a);return g}return[]},i=function(a){var o,s;for(o=0;o<a.length;o++)try{return s=e.extractCssUrl(a[o]),{url:s,idx:o}}catch{}};e.parse=function(a){var o=r(a);return o.map(function(s){var u=i(s);return u?{preUrl:s.slice(0,u.idx),url:u.url,postUrl:s.slice(u.idx+1)}:{preUrl:s}})},e.serialize=function(a){var o=a.map(function(s){var u=[].concat(s.preUrl);return s.url&&u.push('url("'+s.url+'")'),s.postUrl&&(u=u.concat(s.postUrl)),u.join(" ")});return o.join(", ")}})(pm)),pm}function B1(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 gm={exports:{}},r4;function pN(){return r4||(r4=1,(function(e,t){(function(n){e.exports=n()})(function(){return(function n(r,i,a){function o(h,c){if(!i[h]){if(!r[h]){var m=typeof B1=="function"&&B1;if(!c&&m)return m(h,!0);if(s)return s(h,!0);var g=new Error("Cannot find module '"+h+"'");throw g.code="MODULE_NOT_FOUND",g}var d=i[h]={exports:{}};r[h][0].call(d.exports,function(y){var _=r[h][1][y];return o(_||y)},d,d.exports,n,r,i,a)}return i[h].exports}for(var s=typeof B1=="function"&&B1,u=0;u<a.length;u++)o(a[u]);return o})({1:[function(n,r,i){function a(u,h){function c(){this.constructor=u}c.prototype=h.prototype,u.prototype=new c}function o(u,h,c,m){this.message=u,this.expected=h,this.found=c,this.location=m,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}a(o,Error),o.buildMessage=function(u,h){var c={literal:function(b){return'"'+g(b.text)+'"'},class:function(b){var S="",k;for(k=0;k<b.parts.length;k++)S+=b.parts[k]instanceof Array?d(b.parts[k][0])+"-"+d(b.parts[k][1]):d(b.parts[k]);return"["+(b.inverted?"^":"")+S+"]"},any:function(b){return"any character"},end:function(b){return"end of input"},other:function(b){return b.description}};function m(b){return b.charCodeAt(0).toString(16).toUpperCase()}function g(b){return b.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(S){return"\\x0"+m(S)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(S){return"\\x"+m(S)})}function d(b){return b.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(S){return"\\x0"+m(S)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(S){return"\\x"+m(S)})}function y(b){return c[b.type](b)}function _(b){var S=new Array(b.length),k,E;for(k=0;k<b.length;k++)S[k]=y(b[k]);if(S.sort(),S.length>0){for(k=1,E=1;k<S.length;k++)S[k-1]!==S[k]&&(S[E]=S[k],E++);S.length=E}switch(S.length){case 1:return S[0];case 2:return S[0]+" or "+S[1];default:return S.slice(0,-1).join(", ")+", or "+S[S.length-1]}}function x(b){return b?'"'+g(b)+'"':"end of input"}return"Expected "+_(u)+" but "+x(h)+" found."};function s(u,h){h=h!==void 0?h:{};var c={},m={start:$e},g=$e,d="",y=function(){return[]},_=",",x=J(",",!1),b=function(ve,ye){return[ve].concat(ye)},S=function(ve){return[ve]},k=function(ve,ye){return{url:ve,format:ye}},E=function(ve){return{url:ve}},A="url(",R=J("url(",!1),O=")",I=J(")",!1),j=function(ve){return ve},D="format(",C=J("format(",!1),N="local(",$=J("local(",!1),G=function(ve){return{local:ve}},te=/^[^)]/,se=K([")"],!0,!1),ee=function(ve){return Me.extractValue(ve.join(""))},Q=/^[ \t\r\n\f]/,re=K([" "," ","\r",`
|
|
147
|
+
`,"\f"],!1,!1),X=0,B=[{line:1,column:1}],F=0,z=[],Y;if("startRule"in h){if(!(h.startRule in m))throw new Error(`Can't start parsing from rule "`+h.startRule+'".');g=m[h.startRule]}function J(ve,ye){return{type:"literal",text:ve,ignoreCase:ye}}function K(ve,ye,we){return{type:"class",parts:ve,inverted:ye,ignoreCase:we}}function ie(){return{type:"end"}}function fe(ve){var ye=B[ve],we;if(ye)return ye;for(we=ve-1;!B[we];)we--;for(ye=B[we],ye={line:ye.line,column:ye.column};we<ve;)u.charCodeAt(we)===10?(ye.line++,ye.column=1):ye.column++,we++;return B[ve]=ye,ye}function ue(ve,ye){var we=fe(ve),je=fe(ye);return{start:{offset:ve,line:we.line,column:we.column},end:{offset:ye,line:je.line,column:je.column}}}function _e(ve){X<F||(X>F&&(F=X,z=[]),z.push(ve))}function Ce(ve,ye,we){return new o(o.buildMessage(ve,ye),ve,ye,we)}function $e(){var ve,ye;return ve=ze(),ve===c&&(ve=X,ye=d,ye!==c&&(ye=y()),ve=ye),ve}function ze(){var ve,ye,we,je,Le,Ye;if(ve=X,ye=tt(),ye!==c){for(we=[],je=Te();je!==c;)we.push(je),je=Te();if(we!==c)if(u.charCodeAt(X)===44?(je=_,X++):(je=c,_e(x)),je!==c){for(Le=[],Ye=Te();Ye!==c;)Le.push(Ye),Ye=Te();Le!==c?(Ye=ze(),Ye!==c?(ye=b(ye,Ye),ve=ye):(X=ve,ve=c)):(X=ve,ve=c)}else X=ve,ve=c;else X=ve,ve=c}else X=ve,ve=c;return ve===c&&(ve=X,ye=tt(),ye!==c&&(ye=S(ye)),ve=ye),ve}function tt(){var ve;return ve=pe(),ve===c&&(ve=ge()),ve}function pe(){var ve,ye,we,je;if(ve=X,ye=ut(),ye!==c){if(we=[],je=Te(),je!==c)for(;je!==c;)we.push(je),je=Te();else we=c;we!==c?(je=be(),je!==c?(ye=k(ye,je),ve=ye):(X=ve,ve=c)):(X=ve,ve=c)}else X=ve,ve=c;return ve===c&&(ve=X,ye=ut(),ye!==c&&(ye=E(ye)),ve=ye),ve}function ut(){var ve,ye,we,je;return ve=X,u.substr(X,4)===A?(ye=A,X+=4):(ye=c,_e(R)),ye!==c?(we=xe(),we!==c?(u.charCodeAt(X)===41?(je=O,X++):(je=c,_e(I)),je!==c?(ye=j(we),ve=ye):(X=ve,ve=c)):(X=ve,ve=c)):(X=ve,ve=c),ve}function be(){var ve,ye,we,je;return ve=X,u.substr(X,7)===D?(ye=D,X+=7):(ye=c,_e(C)),ye!==c?(we=xe(),we!==c?(u.charCodeAt(X)===41?(je=O,X++):(je=c,_e(I)),je!==c?(ye=j(we),ve=ye):(X=ve,ve=c)):(X=ve,ve=c)):(X=ve,ve=c),ve}function ge(){var ve,ye,we,je;return ve=X,u.substr(X,6)===N?(ye=N,X+=6):(ye=c,_e($)),ye!==c?(we=xe(),we!==c?(u.charCodeAt(X)===41?(je=O,X++):(je=c,_e(I)),je!==c?(ye=G(we),ve=ye):(X=ve,ve=c)):(X=ve,ve=c)):(X=ve,ve=c),ve}function xe(){var ve,ye,we;if(ve=X,ye=[],te.test(u.charAt(X))?(we=u.charAt(X),X++):(we=c,_e(se)),we!==c)for(;we!==c;)ye.push(we),te.test(u.charAt(X))?(we=u.charAt(X),X++):(we=c,_e(se));else ye=c;return ye!==c&&(ye=ee(ye)),ve=ye,ve}function Te(){var ve;return Q.test(u.charAt(X))?(ve=u.charAt(X),X++):(ve=c,_e(re)),ve}var Me=n("../util");if(Y=g(),Y!==c&&X===u.length)return Y;throw Y!==c&&X<u.length&&_e(ie()),Ce(z,F<u.length?u.charAt(F):null,F<u.length?ue(F,F+1):ue(F,F))}r.exports={SyntaxError:o,parse:s}},{"../util":3}],2:[function(n,r,i){var a=n("./grammar");i.SyntaxError=function(o,s){this.message=o,this.offset=s},i.parse=function(o){try{return a.parse(o)}catch(s){throw new i.SyntaxError(s.message,s.offset)}},i.serialize=function(o){return o.map(function(s){var u;return s.url?(u='url("'+s.url+'")',s.format&&(u+=' format("'+s.format+'")')):u='local("'+s.local+'")',u}).join(", ")}},{"./grammar":1}],3:[function(n,r,i){var a=function(s){var u=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return s.replace(u,"$1")},o=function(s){var u=/^"(.*)"$/,h=/^'(.*)'$/;return u.test(s)?s.replace(u,"$1"):h.test(s)?s.replace(h,"$1"):s};i.extractValue=function(s){return o(a(s))}},{}]},{},[2])(2)})})(gm)),gm.exports}var i4;function gN(){return i4||(i4=1,(function(e){var t=rg(),n=xy(),r=dN(),i=pN(),a=function(S,k,E){S.style.setProperty(k,E,S.style.getPropertyPriority(k))},o=function(S){return S.filter(function(k){return k.type===window.CSSRule.STYLE_RULE&&(k.style.getPropertyValue("background-image")||k.style.getPropertyValue("background"))})},s=function(S){var k=[];return S.forEach(function(E){E.style.getPropertyValue("background-image")?k.push({property:"background-image",value:E.style.getPropertyValue("background-image"),rule:E}):E.style.getPropertyValue("background")&&k.push({property:"background",value:E.style.getPropertyValue("background"),rule:E})}),k},u=function(S){return S.filter(function(k){return k.type===window.CSSRule.FONT_FACE_RULE&&k.style.getPropertyValue("src")})},h=function(S){return S.filter(function(k){return k.type===window.CSSRule.IMPORT_RULE&&k.href})},c=function(S){var k=[];return S.forEach(function(E,A){E.url&&!t.isDataUri(E.url)&&k.push(A)}),k},m=function(S){var k=[];return S.forEach(function(E,A){E.url&&!t.isDataUri(E.url)&&k.push(A)}),k};e.adjustPathsOfCssResources=function(S,k){var E=o(k),A=s(E),R=!1;return A.forEach(function(O){var I=r.parse(O.value),j=c(I),D;j.length>0&&(j.forEach(function(C){var N=I[C].url,$=t.joinUrl(S,N);I[C].url=$}),D=r.serialize(I),a(O.rule,O.property,D),R=!0)}),u(k).forEach(function(O){var I=O.style.getPropertyValue("src"),j,D;try{j=i.parse(I)}catch{return}D=m(j),D.length>0&&(D.forEach(function(C){var N=j[C].url,$=t.joinUrl(S,N);j[C].url=$}),n.changeFontFaceRuleSrc(k,O,i.serialize(j)),R=!0)}),h(k).forEach(function(O){var I=O.href,j=t.joinUrl(S,I);n.exchangeRule(k,O,"@import url("+j+");"),R=!0}),R};var g=function(S,k,E){var A=S.indexOf(k);S.splice(A,1),E.forEach(function(R,O){S.splice(A+O,0,R)})},d=function(S,k,E,A){var R=k.href,O;return R=n.unquoteString(R),O=t.joinUrl(A.baseUrl,R),E.indexOf(O)>=0?(g(S,k,[]),Promise.resolve([])):(E.push(O),t.ajax(R,A).then(function(I){var j=n.rulesForCssText(I);return e.loadCSSImportsForRules(j,E,A).then(function(D){return e.adjustPathsOfCssResources(R,j),g(S,k,j),D.errors})},function(I){throw{resourceType:"stylesheet",url:I.url,msg:"Unable to load stylesheet "+I.url}}))};e.loadCSSImportsForRules=function(S,k,E){var A=h(S),R=[],O=!1;return Promise.all(A.map(function(I){return d(S,I,k,E).then(function(j){R=R.concat(j),O=!0},function(j){R.push(j)})})).then(function(){return{hasChanges:O,errors:R}})};var y=function(S,k){var E=r.parse(S),A=c(E),R=!1;return t.collectAndReportErrors(A.map(function(O){var I=E[O].url;return t.getDataURIForImageURL(I,k).then(function(j){E[O].url=j,R=!0},function(j){throw{resourceType:"backgroundImage",url:j.url,msg:"Unable to load background-image "+j.url}})})).then(function(O){return{backgroundValue:r.serialize(E),hasChanges:R,errors:O}})},_=function(S,k){var E=o(S),A=s(E),R=[],O=!1;return Promise.all(A.map(function(I){return y(I.value,k).then(function(j){j.hasChanges&&(a(I.rule,I.property,j.backgroundValue),O=!0),R=R.concat(j.errors)})})).then(function(){return{hasChanges:O,errors:R}})},x=function(S,k){var E=!1,A,R;try{A=i.parse(S)}catch{A=[]}return R=m(A),t.collectAndReportErrors(R.map(function(O){var I=A[O],j=I.format||"woff";return t.binaryAjax(I.url,k).then(function(D){var C=btoa(D);I.url="data:font/"+j+";base64,"+C,E=!0},function(D){throw{resourceType:"fontFace",url:D.url,msg:"Unable to load font-face "+D.url}})})).then(function(O){return{srcDeclarationValue:i.serialize(A),hasChanges:E,errors:O}})},b=function(S,k){var E=u(S),A=[],R=!1;return Promise.all(E.map(function(O){var I=O.style.getPropertyValue("src");return x(I,k).then(function(j){j.hasChanges&&(n.changeFontFaceRuleSrc(S,O,j.srcDeclarationValue),R=!0),A=A.concat(j.errors)})})).then(function(){return{hasChanges:R,errors:A}})};e.loadAndInlineCSSResourcesForRules=function(S,k){var E=!1,A=[];return Promise.all([_,b].map(function(R){return R(S,k).then(function(O){E=E||O.hasChanges,A=A.concat(O.errors)})})).then(function(){return{hasChanges:E,errors:A}})}})(hm)),hm}var a4;function mN(){return a4||(a4=1,(function(e){var t=rg(),n=fN(),r=hN(),i=gN(),a=xy(),o=function(x){return t.joinUrl(x,".")},s=function(x){var b=x.map(function(S,k){return k===x.length-1&&(S={baseUrl:o(S.baseUrl)}),JSON.stringify(S)});return b},u=function(x,b){return b.cache!==!1&&b.cache!=="none"&&b.cacheBucket?t.memoize(x,s,b.cacheBucket):x},h=function(x,b,S){var k=a.rulesForCssText(x);return i.loadCSSImportsForRules(k,b,S).then(function(E){return i.loadAndInlineCSSResourcesForRules(k,S).then(function(A){var R=E.errors.concat(A.errors),O=E.hasChanges||A.hasChanges;return O&&(x=a.cssRulesToText(k)),{hasChanges:O,content:x,errors:R}})})},c=function(x,b,S){var k=x.textContent,E=u(h,b);return E(k,S,b).then(function(A){return A.hasChanges&&(x.childNodes[0].nodeValue=A.content),t.cloneArray(A.errors)})},m=function(x){var b=x.getElementsByTagName("style");return Array.prototype.filter.call(b,function(S){return!S.attributes.type||S.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(x,b){var S=m(x),k=[],E=[],A;return A=t.clone(b),A.baseUrl=A.baseUrl||t.getDocumentBaseUrl(x),Promise.all(S.map(function(R){return c(R,A,E).then(function(O){k=k.concat(O)})})).then(function(){return k})};var g=function(x,b){var S=x.parentNode,k;b=b.trim(),b&&(k=x.ownerDocument.createElement("style"),k.type="text/css",k.appendChild(x.ownerDocument.createTextNode(b)),S.insertBefore(k,x)),S.removeChild(x)},d=function(x,b){return t.ajax(x,b).then(function(S){var k=a.rulesForCssText(S);return{content:S,cssRules:k}}).then(function(S){var k=i.adjustPathsOfCssResources(x,S.cssRules);return{content:S.content,cssRules:S.cssRules,hasChanges:k}}).then(function(S){return i.loadCSSImportsForRules(S.cssRules,[],b).then(function(k){return{content:S.content,cssRules:S.cssRules,hasChanges:S.hasChanges||k.hasChanges,errors:k.errors}})}).then(function(S){return i.loadAndInlineCSSResourcesForRules(S.cssRules,b).then(function(k){return{content:S.content,cssRules:S.cssRules,hasChanges:S.hasChanges||k.hasChanges,errors:S.errors.concat(k.errors)}})}).then(function(S){var k=S.content;return S.hasChanges&&(k=a.cssRulesToText(S.cssRules)),{content:k,errors:S.errors}})},y=function(x,b){var S=x.attributes.href.value,k=t.getDocumentBaseUrl(x.ownerDocument),E=t.clone(b);!E.baseUrl&&k&&(E.baseUrl=k);var A=u(d,b);return A(S,E).then(function(R){return{content:R.content,errors:t.cloneArray(R.errors)}})},_=function(x){var b=x.getElementsByTagName("link");return Array.prototype.filter.call(b,function(S){return S.attributes.rel&&S.attributes.rel.value==="stylesheet"&&(!S.attributes.type||S.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(x,b){var S=_(x),k=[];return Promise.all(S.map(function(E){return y(E,b).then(function(A){g(E,A.content+`
|
|
148
|
+
`),k=k.concat(A.errors)},function(A){k.push({resourceType:"stylesheet",url:A.url,msg:"Unable to load stylesheet "+A.url})})})).then(function(){return k})},e.loadAndInlineImages=n.inline,e.loadAndInlineScript=r.inline,e.inlineReferences=function(x,b){var S=[],k=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return b.inlineScripts!==!1&&k.push(e.loadAndInlineScript),Promise.all(k.map(function(E){return E(x,b).then(function(A){S=S.concat(A)})})).then(function(){return S})}})(lm)),lm}var vN=i0.exports,o4;function yN(){return o4||(o4=1,(function(e){(function(t,n){t===void 0&&window!==void 0&&(t=window),e.exports?e.exports=n(Y7(),uN(),cN(),mN()):t.rasterizeHTML=n(t.url,t.xmlserializer,t.sanedomparsererror,t.inlineresources)})(vN,function(t,n,r,i){var a=(function(y){var _={},x=[];_.joinUrl=function(k,E){return k?y.resolve(k,E):E},_.getConstantUniqueIdFor=function(k){return x.indexOf(k)<0&&x.push(k),x.indexOf(k)},_.clone=function(k){var E={},A;for(A in k)k.hasOwnProperty(A)&&(E[A]=k[A]);return E};var b=function(k){return typeof k=="object"&&k!==null},S=function(k){return b(k)&&Object.prototype.toString.apply(k).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return _.parseOptionalParameters=function(k){var E={canvas:null,options:{}};return k[0]==null||S(k[0])?(E.canvas=k[0]||null,E.options=_.clone(k[1])):E.options=_.clone(k[0]),E},_})(t),o=(function(y){var _={},x=function(b,S,k){var E=b[S];return b[S]=function(){var A=Array.prototype.slice.call(arguments);return k.apply(this,[A,E])},E};return _.baseUrlRespectingXhr=function(b,S){var k=function(){var E=new b;return x(E,"open",function(A,R){var O=A.shift(),I=A.shift(),j=y.joinUrl(S,I);return R.apply(this,[O,j].concat(A))}),E};return k},_.finishNotifyingXhr=function(b){var S=0,k=0,E=!1,A,R=new Promise(function(I){A=function(){var j=S-k;j<=0&&E&&I({totalCount:S})}}),O=function(){var I=new b;return x(I,"send",function(j,D){return S+=1,D.apply(this,arguments)}),I.addEventListener("load",function(){k+=1,A()}),I};return O.waitForRequestsToFinish=function(){return E=!0,A(),R},O},_})(a),s=(function(){var y={},_=function(O){return Array.prototype.slice.call(O)};y.addClassName=function(O,I){O.className+=" "+I},y.addClassNameRecursively=function(O,I){y.addClassName(O,I),O.parentNode!==O.ownerDocument&&y.addClassNameRecursively(O.parentNode,I)};var x=function(O,I){var j=O.parentStyleSheet,D=_(j.cssRules).indexOf(O);j.insertRule(I,D+1),j.deleteRule(D)},b=function(O,I){var j=O.cssText.replace(/^[^\{]+/,""),D=I+" "+j;x(O,D)},S=function(O){return _(O).reduce(function(I,j){return I+j.cssText},"")},k=function(O){O.textContent=S(O.sheet.cssRules)},E=function(O){var I=document.implementation.createHTMLDocument(""),j=document.createElement("style");j.textContent=O.textContent,I.body.appendChild(j),O.sheet=j.sheet},A=function(O){return"((?:^|[^.#:\\w])|(?=\\W))("+O.join("|")+")(?=\\W|$)"},R=function(O,I,j){var D=A(I);_(O.querySelectorAll("style")).forEach(function(C){typeof C.sheet>"u"&&E(C);var N=_(C.sheet.cssRules).filter(function($){return $.selectorText&&new RegExp(D,"i").test($.selectorText)});N.length&&(N.forEach(function($){var G=$.selectorText.replace(new RegExp(D,"gi"),function(te,se,ee){return se+j(ee)});G!==$.selectorText&&b($,G)}),k(C))})};return y.rewriteCssSelectorWith=function(O,I,j){R(O,[I],function(){return j})},y.lowercaseCssTypeSelectors=function(O,I){R(O,I,function(j){return j.toLowerCase()})},y.findHtmlOnlyNodeNames=function(O){var I=O.ownerDocument.createTreeWalker(O,NodeFilter.SHOW_ELEMENT),j={},D={},C;do C=I.currentNode.tagName.toLowerCase(),I.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?j[C]=!0:D[C]=!0;while(I.nextNode());return Object.keys(j).filter(function(N){return!D[N]})},y})(),u=(function(y){var _={},x=function(S){return Array.prototype.slice.call(S)},b={active:!0,hover:!0,focus:!1,target:!1};return _.fakeUserAction=function(S,k,E){var A=S.querySelector(k),R=":"+E,O="rasterizehtml"+E;A&&(b[E]?y.addClassNameRecursively(A,O):y.addClassName(A,O),y.rewriteCssSelectorWith(S,R,"."+O))},_.persistInputValues=function(S){var k=S.querySelectorAll("input"),E=S.querySelectorAll("textarea"),A=function(R){return R.type==="checkbox"||R.type==="radio"};x(k).filter(A).forEach(function(R){R.checked?R.setAttribute("checked",""):R.removeAttribute("checked")}),x(k).filter(function(R){return!A(R)}).forEach(function(R){R.setAttribute("value",R.value)}),x(E).forEach(function(R){R.textContent=R.value})},_.rewriteTagNameSelectorsToLowerCase=function(S){y.lowercaseCssTypeSelectors(S,y.findHtmlOnlyNodeNames(S))},_})(s),h=(function(y,_,x,b){var S={},k=function(ee,Q,re,X){var B=ee.createElement(Q);return B.style.visibility="hidden",B.style.width=re+"px",B.style.height=X+"px",B.style.position="absolute",B.style.top=-1e4-X+"px",B.style.left=-1e4-re+"px",ee.getElementsByTagName("body")[0].appendChild(B),B},E=function(ee){return ee>0?new Promise(function(Q){setTimeout(Q,ee)}):Promise.resolve()};S.executeJavascript=function(ee,Q){return new Promise(function(re){var X=k(b.document,"iframe",Q.width,Q.height),B=ee.outerHTML,F=[],z=Q.executeJsTimeout||0,Y=function(){b.document.getElementsByTagName("body")[0].removeChild(X)},J=function(){var ue=X.contentDocument;re({document:ue,errors:F,cleanUp:Y})},K=X.contentWindow.XMLHttpRequest,ie=_.finishNotifyingXhr(K),fe=_.baseUrlRespectingXhr(ie,Q.baseUrl);X.onload=function(){E(z).then(ie.waitForRequestsToFinish).then(J)},X.contentDocument.open(),X.contentWindow.XMLHttpRequest=fe,X.contentWindow.onerror=function(ue){F.push({resourceType:"scriptExecution",msg:ue})},X.contentDocument.write("<!DOCTYPE html>"),X.contentDocument.write(B),X.contentDocument.close()})};var A=function(ee,Q,re){var X=ee.createElement("iframe");return X.style.width=Q+"px",X.style.height=re+"px",X.style.visibility="hidden",X.style.position="absolute",X.style.top=-1e4-re+"px",X.style.left=-1e4-Q+"px",X.style.borderWidth=0,X.sandbox="allow-same-origin",X.scrolling="no",X},R=function(ee,Q,re){var X=Math.floor(ee/re),B=Math.floor(Q/re);return A(b.document,X,B)},O=function(ee,Q,re,X){return{width:Math.max(ee.width*X,Q),height:Math.max(ee.height*X,re)}},I=function(ee,Q){var re=ee.querySelector(Q);if(re)return re;if(ee.ownerDocument.querySelector(Q)===ee)return ee;throw{message:"Clipping selector not found"}},j=function(ee,Q,re,X,B){var F=Math.max(ee.scrollWidth,ee.clientWidth),z=Math.max(ee.scrollHeight,ee.clientHeight),Y,J,K,ie,fe,ue,_e,Ce;return Q?(ue=I(ee,Q),_e=ue.getBoundingClientRect(),Y=_e.top,J=_e.left,K=_e.width,ie=_e.height):(Y=0,J=0,K=F,ie=z),Ce=O({width:K,height:ie},re,X,B),fe=b.getComputedStyle(ee.ownerDocument.documentElement).fontSize,{left:J,top:Y,width:Ce.width,height:Ce.height,viewportWidth:F,viewportHeight:z,rootFontSize:fe}},D=function(ee,Q){var re=ee.tagName;return Q.querySelector(re)},C=function(ee){var Q=ee.tagName.toLowerCase();return Q==="html"||Q==="body"?ee.outerHTML:'<body style="margin: 0;">'+ee.outerHTML+"</body>"};S.calculateDocumentContentSize=function(ee,Q){return new Promise(function(re,X){var B=Q.zoom||1,F;F=R(Q.width,Q.height,B),b.document.getElementsByTagName("body")[0].appendChild(F),F.onload=function(){var z=F.contentDocument,Y;try{Y=j(D(ee,z),Q.clip,Q.width,Q.height,B),re(Y)}catch(J){X(J)}finally{b.document.getElementsByTagName("body")[0].removeChild(F)}},F.contentDocument.open(),F.contentDocument.write("<!DOCTYPE html>"),F.contentDocument.write(C(ee)),F.contentDocument.close()})},S.parseHtmlFragment=function(ee){var Q=b.document.implementation.createHTMLDocument("");Q.documentElement.innerHTML=ee;var re=Q.querySelector("body").firstChild;if(!re)throw"Invalid source";return re};var N=function(ee,Q){var re=/<html((?:\s+[^>]*)?)>/im.exec(Q),X=b.document.implementation.createHTMLDocument(""),B,F,z,Y;if(re)for(B="<div"+re[1]+"></div>",X.documentElement.innerHTML=B,z=X.querySelector("div"),F=0;F<z.attributes.length;F++)Y=z.attributes[F],ee.documentElement.setAttribute(Y.name,Y.value)};S.parseHTML=function(ee){var Q=b.document.implementation.createHTMLDocument("");return Q.documentElement.innerHTML=ee,N(Q,ee),Q};var $=function(ee){try{return x.failOnParseError(ee)}catch(Q){throw{message:"Invalid source",originalError:Q}}};S.validateXHTML=function(ee){var Q=new DOMParser,re=Q.parseFromString(ee,"application/xml");$(re)};var G=null,te=function(ee,Q){return Q==="none"||Q==="repeated"?((G===null||Q!=="repeated")&&(G=Date.now()),ee+"?_="+G):ee},se=function(ee,Q){return new Promise(function(re,X){var B=new window.XMLHttpRequest,F=y.joinUrl(Q.baseUrl,ee),z=te(F,Q.cache),Y=function(J){X({message:"Unable to load page",originalError:J})};B.addEventListener("load",function(){B.status===200||B.status===0?re(B.responseXML):Y(B.statusText)},!1),B.addEventListener("error",function(J){Y(J)},!1);try{B.open("GET",z,!0),B.responseType="document",B.send(null)}catch(J){Y(J)}})};return S.loadDocument=function(ee,Q){return se(ee,Q).then(function(re){return $(re)})},S})(a,o,r,window),c=(function(y){var _={},x=function(D,C){return C?URL.createObjectURL(new Blob([D],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(D)},b=function(D){D instanceof Blob&&URL.revokeObjectURL(D)},S='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',k=function(D){return new Promise(function(C,N){var $=document.createElement("canvas"),G=new Image;G.onload=function(){var te=$.getContext("2d");try{te.drawImage(G,0,0),$.toDataURL("image/png"),C(!0)}catch{C(!1)}},G.onerror=N,G.src=D})},E=function(){var D=x(S,!0);return k(D).then(function(C){return b(D),C?!1:k(x(S,!1)).then(function(N){return N})},function(){return!1})},A=function(){if(y.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},R=function(){return new Promise(function(D,C){A()&&y.URL?E().then(function(N){D(!N)},function(){C()}):D(!1)})},O,I=function(){return O===void 0&&(O=R()),O},j=function(D){return I().then(function(C){return x(D,C)})};return _.renderSvg=function(D){return new Promise(function(C,N){var $,G,te=function(){G.onload=null,G.onerror=null},se=function(){$&&b($)};G=new Image,G.onload=function(){te(),se(),C(G)},G.onerror=function(){se(),N()},j(D).then(function(ee){$=ee,G.src=$},N)})},_})(window),m=(function(y,_,x,b){var S={},k=function(D,C){var N=C||1,$={width:D.width,height:D.height,"font-size":D.rootFontSize};return N!==1&&($.style="transform:scale("+N+"); transform-origin: 0 0;"),$},E=function(D){var C,N,$,G;C=Math.round(D.viewportWidth),N=Math.round(D.viewportHeight),$=-D.left,G=-D.top;var te={x:$,y:G,width:C,height:N};return te},A=function(D){var C=D.style||"";D.style=C+"float: left;"},R=function(D){D.externalResourcesRequired=!0},O=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},I=function(D){var C=Object.keys(D);return C.length?" "+C.map(function(N){return N+'="'+D[N]+'"'}).join(" "):""},j=function(D,C,N){var $=b.serializeToString(D);_.validateXHTML($);var G=E(C);return A(G),R(G),'<svg xmlns="http://www.w3.org/2000/svg"'+I(k(C,N))+">"+O()+"<foreignObject"+I(G)+">"+$+"</foreignObject></svg>"};return S.getSvgForDocument=function(D,C,N){return x.rewriteTagNameSelectorsToLowerCase(D),j(D,C,N)},S.drawDocumentAsSvg=function(D,C){return["hover","active","focus","target"].forEach(function(N){C[N]&&x.fakeUserAction(D,C[N],N)}),_.calculateDocumentContentSize(D,C).then(function(N){return S.getSvgForDocument(D,N,C.zoom)})},S})(a,h,u,n),g=(function(y,_,x,b,S,k){var E={},A=function(D){return{message:"Error rendering page",originalError:D}},R=function(D){return S.renderSvg(D).then(function(C){return{image:C,svg:D}},function(C){throw A(C)})},O=function(D,C){try{C.getContext("2d").drawImage(D,0,0)}catch(N){throw A(N)}},I=function(D,C,N){return b.drawDocumentAsSvg(D,N).then(R).then(function($){return C&&O($.image,C),$})},j=function(D,C){return _.executeJavascript(D,C).then(function(N){var $=N.document;return x.persistInputValues($),{document:$,errors:N.errors,cleanUp:N.cleanUp}})};return E.rasterize=function(D,C,N){var $;return $=y.clone(N),$.inlineScripts=N.executeJs===!0,k.inlineReferences(D,$).then(function(G){return N.executeJs?j(D,N).then(function(te){return{element:te.document.documentElement,errors:G.concat(te.errors),cleanUp:te.cleanUp}}):{element:D,errors:G,cleanUp:function(){}}}).then(function(G){return I(G.element,C,N).then(function(te){return G.cleanUp(),{image:te.image,svg:te.svg,errors:G.errors}})})},E})(a,h,u,m,c,i),d=(function(y,_,x){var b={},S=function(O,I){var j=300,D=200,C=O?O.width:j,N=O?O.height:D,$=I.width!==void 0?I.width:C,G=I.height!==void 0?I.height:N;return{width:$,height:G}},k=function(O){var I=S(O.canvas,O.options),j;return j=y.clone(O.options),j.width=I.width,j.height=I.height,j};b.drawDocument=function(){var O=arguments[0],I=Array.prototype.slice.call(arguments,1),j=y.parseOptionalParameters(I),D=O.documentElement?O.documentElement:O;return x.rasterize(D,j.canvas,k(j))};var E=function(O,I,j){var D=_.parseHTML(O);return b.drawDocument(D,I,j)};b.drawHTML=function(){var O=arguments[0],I=Array.prototype.slice.call(arguments,1),j=y.parseOptionalParameters(I);return E(O,j.canvas,j.options)};var A=function(O,I,j){var D=document.implementation.createHTMLDocument("");D.replaceChild(O.documentElement,D.documentElement);var C=j?y.clone(j):{};return j.baseUrl||(C.baseUrl=I),{document:D,options:C}},R=function(O,I,j){return _.loadDocument(O,j).then(function(D){var C=A(D,O,j);return b.drawDocument(C.document,I,C.options)})};return b.drawURL=function(){var O=arguments[0],I=Array.prototype.slice.call(arguments,1),j=y.parseOptionalParameters(I);return R(O,j.canvas,j.options)},b})(a,h,g);return d})})(i0)),i0.exports}var bN=yN();function wN(e,t){if(!e.includes("@font-face"))return"";const n=new Set,r=new Set;t&&((t.match(/font-weight:\s*(\d+|bold|normal)/gi)||[]).forEach(h=>{const c=h.split(":")[1].trim();c==="bold"?n.add("700"):c==="normal"?n.add("400"):/^\d+$/.test(c)&&n.add(c)}),(t.match(/font-style:\s*(italic|normal)/gi)||[]).forEach(h=>{h.split(":")[1].trim().toLowerCase()==="italic"&&r.add("italic")}),/<(b|strong)\b/i.test(t)&&n.add("700"),/<(i|em)\b/i.test(t)&&r.add("italic"));const i=$o(t);i&&i.trim()&&n.add("400"),n.size===0&&n.add("400");const a=n,o=r.has("italic"),s=Array.from(new Set(i)).map(h=>h.codePointAt(0)).filter(h=>h!==void 0),u=e.split(/}\s*/).map(h=>h&&h+"}").filter(h=>/@font-face/.test(h)&&(c=>{const m=(c.match(/font-weight:\s*(\d+)/)||[])[1];if(m&&!a.has(m)||/font-style:\s*italic/.test(c)&&!o)return!1;const g=c.match(/unicode-range:\s*([^;]+);/);if(!g)return!0;const d=g[1].split(",").map(y=>{const[_,x=_]=y.replace("U+","").split("-").map(b=>parseInt(b,16));return[_,x]});return s.some(y=>d.some(([_,x])=>y>=_&&y<=x))})(h)).join(`
|
|
149
|
+
`);return u?`<style>${u}</style>`:""}const Np=`
|
|
150
|
+
p {
|
|
151
|
+
margin: 0;
|
|
152
|
+
padding: 0;
|
|
153
|
+
word-wrap: break-word; /* Required for Firefox */
|
|
154
|
+
/* a text may have several spaces, we need to preserve them */
|
|
155
|
+
white-space: pre-wrap;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* Reset default list styles and setup counters */
|
|
159
|
+
ul, ol {
|
|
160
|
+
list-style: none; /* Remove default markers */
|
|
161
|
+
padding-inline-start: 0; /* Reset padding */
|
|
162
|
+
margin: 0;
|
|
163
|
+
display: block; /* Use block instead of inline-block for better text wrapping */
|
|
164
|
+
width: 100%;
|
|
165
|
+
text-decoration: inherit;
|
|
166
|
+
counter-reset: ol-counter; /* Initialize counter for ol */
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
li {
|
|
170
|
+
position: relative; /* Needed for absolute positioning of ::before */
|
|
171
|
+
padding-inline-start: 2.1em; /* Space for the marker (start side) */
|
|
172
|
+
margin: 0; /* Reset default li margins */
|
|
173
|
+
word-wrap: break-word; /* Required for Firefox text wrapping */
|
|
174
|
+
white-space: pre-wrap; /* Preserve spaces and allow wrapping */
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
li::before {
|
|
178
|
+
content: ''; /* Base content */
|
|
179
|
+
position: absolute;
|
|
180
|
+
/* Use logical properties for positioning */
|
|
181
|
+
inset-inline-start: 0; /* Position marker at the start edge (left in LTR, right in RTL) */
|
|
182
|
+
top: 0; /* Adjust vertical alignment */
|
|
183
|
+
/* Prevent letter-spacing from affecting the marker */
|
|
184
|
+
letter-spacing: normal;
|
|
185
|
+
/* Define width to ensure consistent spacing and alignment */
|
|
186
|
+
display: inline-block;
|
|
187
|
+
width: 2em; /* Width for the marker container */
|
|
188
|
+
/* Align multi-digit numbers to the end (right in LTR, left in RTL) */
|
|
189
|
+
text-align: end;
|
|
190
|
+
/* Space between marker and text (using logical property) */
|
|
191
|
+
margin-inline-end: 0.8em; /* Pushes text away from marker (2.5em total = 1.7em width + 0.8em margin)*/
|
|
192
|
+
/* Prevent marker style from inheriting list item styles */
|
|
193
|
+
font-weight: normal;
|
|
194
|
+
font-style: normal;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/* Style for bullet points */
|
|
198
|
+
ul > li::before {
|
|
199
|
+
content: '•'; /* Literal bullet character */
|
|
200
|
+
/* Center the bullet within its allocated width */
|
|
201
|
+
text-align: center; /* Override text-align: end for bullets */
|
|
202
|
+
font-size: 1.2em;
|
|
203
|
+
top: 0em; /* Re-adjust vertical alignment for bullet */
|
|
204
|
+
/* Bullets don't need number alignment, width can be tighter */
|
|
205
|
+
width: 2em;
|
|
206
|
+
/* Adjust margin to maintain overall padding */
|
|
207
|
+
margin-inline-end: 1.5em; /* 2.5em total padding = 1em width + 1.5em margin */
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* Style for numbers using counter */
|
|
211
|
+
ol > li {
|
|
212
|
+
counter-increment: ol-counter; /* Increment counter for each li in ol */
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
ol > li::before {
|
|
216
|
+
content: counter(ol-counter) "."; /* Display counter value + dot */
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.ql-indent-1 {
|
|
220
|
+
margin-inline-start: 0.5em;
|
|
221
|
+
}
|
|
222
|
+
.ql-indent-2 {
|
|
223
|
+
margin-inline-start: 1em;
|
|
224
|
+
}
|
|
225
|
+
.ql-indent-3 {
|
|
226
|
+
margin-inline-start: 1.5em;
|
|
227
|
+
}
|
|
228
|
+
`,xN=`
|
|
229
|
+
<style>
|
|
230
|
+
html, body {
|
|
231
|
+
padding: 0;
|
|
232
|
+
margin: 0;
|
|
233
|
+
}
|
|
234
|
+
${Np}
|
|
235
|
+
</style>
|
|
236
|
+
`;let sf;const X7=()=>(sf||(sf=document.createElement("div"),sf.id="polotno-hidden-do-not-touch",sf.style.overflow="hidden",sf.style.position="relative",document.body.appendChild(sf),sf.innerHTML=`<style>#polotno-hidden-do-not-touch {${Np}}</style>`),sf);navigator.userAgent.includes("Firefox");function _N({html:e}){const t=document.createElement("div");t.innerHTML=e,t.style.display="inline-block",t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.zIndex="1000",t.style.whiteSpace="nowrap",t.style.visibility="hidden";const n=X7();n.appendChild(t);const r=t.innerText,i=t.childNodes[0];i.style.whiteSpace="nowrap";const a=r?.split(/\s+/)||[];let o=!1;for(let s=0;s<a.length;s++){const u=a[s];if(i&&(i.textContent=u,o=i.scrollWidth>t.clientWidth,o))break}return n.removeChild(t),o}function s4(e){const t=document.createElement("div");t.innerHTML=e,t.style.display="inline-block",t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.zIndex="1000";const n=X7();n.appendChild(t);const r=t.getBoundingClientRect();return n.removeChild(t),{width:r.width,height:r.height}}const SN={},mm={},vm=new Map;async function l4({html:e,width:t,height:n,fontFamily:r,padding:i,font:a,pixelRatio:o}){let s="";if(r!=="Arial"&&!a){const y=uO();s=await(async function(_,x){const b=`${_}|${x}`;if(vm.has(b))return vm.get(b);const S=`https://fonts.googleapis.com/css?family=${_}:${x}&display=swap`,k=await(await fetch(S)).text();return vm.set(b,k),k})(r,y)}if(a){const y=a.styles||(a.url?[{src:`url("${a.url}")`}]:(_=>{if(mm[_])return mm[_];const x=(function(S){const k=[];for(let E=0;E<document.styleSheets.length;E++){const A=document.styleSheets[E];try{const R=A.cssRules;if(R)for(let O=0;O<R.length;O++){const I=R[O];I instanceof CSSFontFaceRule&&I.style.fontFamily.replace(/['"]/g,"")===S&&k.push(I)}}catch(R){console.warn(`Could not access stylesheet: ${A.href}`,R)}}return k})(_),b=x.filter(S=>S.style.fontFamily.replace(/['"]/g,"")===_).map(S=>({src:S.style.getPropertyValue("src"),fontStyle:S.style.getPropertyValue("font-style")||"normal",fontWeight:S.style.getPropertyValue("font-weight")||"normal"}));return mm[_]=b,b})(r));s="",y.forEach(_=>{s+=`
|
|
237
|
+
@font-face {
|
|
238
|
+
font-family: '${r}';
|
|
239
|
+
src: ${_.src};
|
|
240
|
+
font-style: ${_.fontStyle||"normal"};
|
|
241
|
+
font-weight: ${_.fontWeight||"normal"};
|
|
242
|
+
}
|
|
243
|
+
`})}let u="";s&&(u=wN(s,e)),e+=u+xN;const h=t+2*i,c=n+2*i,m=document.createElement("canvas"),g=await bN.drawHTML(`<div style="padding: ${i}px;" dir="auto">${e}</div>`,m,{width:h,height:c,cacheBucket:SN});vy(m,h*o,c*o);const d=m.getContext("2d");return d?.drawImage(g.image,0,0,h,c,0,0,m.width,m.height),m}let EN={data:""},kN=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||EN,AN=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,PN=/\/\*[^]*?\*\/|\s\s+|\n/g,pf=(e,t)=>{let n="",r="",i="";for(let a in e){let o=e[a];a[0]=="@"?a[1]=="i"?n=a+" "+o+";":r+=a[1]=="f"?pf(o,a):a+"{"+pf(o,a[1]=="k"?"":t)+"}":typeof o=="object"?r+=pf(o,t?t.replace(/([^,])+/g,s=>a.replace(/(^:.*)|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,s):s?s+" "+u:u)):a):o!=null&&(a=a.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=pf.p?pf.p(a,o):a+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},Vd={},K7=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+K7(e[n]);return t}return e},ON=(e,t,n,r,i)=>{let a=K7(e),o=Vd[a]||(Vd[a]=(s=>{let u=0,h=11;for(;u<s.length;)h=101*h+s.charCodeAt(u++)>>>0;return"go"+h})(a));if(!Vd[o]){let s=a!==e?e:(u=>{let h,c=[{}];for(;h=AN.exec(u.replace(PN,""));)h[4]?c.shift():h[3]?c.unshift(c[0][h[3]]=c[0][h[3]]||{}):c[0][h[1]]=h[2];return c[0]})(e);Vd[o]=pf(i?{["@keyframes "+o]:s}:s,n?"":"."+o)}return((s,u,h)=>{u.data.indexOf(s)==-1&&(u.data=h?s+u.data:u.data+s)})(Vd[o],t,r),o};function _y(e){let t=this||{},n=e.call?e(t.p):e;return ON(n.unshift?n.raw?((r,i,a)=>r.reduce((o,s,u)=>{let h=i[u];if(h&&h.call){let c=h(a),m=c&&c.props&&c.props.className||/^go/.test(c)&&c;h=m?"."+m:c&&typeof c=="object"?c.props?"":pf(c,""):c===!1?"":c}return o+s+(h??"")},""))(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,kN(t.target),t.g,t.o,t.k)}let Z7,Av,Pv;_y.bind({g:1});_y.bind({k:1});function CN(e,t,n,r){pf.p=t,Z7=e,Av=n,Pv=r}function Od(e,t){let n=this||{};return function(){let r=arguments;function i(a,o){let s=Object.assign({},a),u=s.className||i.className;n.p=Object.assign({theme:Av&&Av()},s),n.o=/ *go\d+/.test(u),s.className=_y.apply(n,r)+(u?" "+u:""),t&&(s.ref=o);let h=e;return e[0]&&(h=s.as||e,delete s.as),Pv&&h[0]&&Pv(s),Z7(h,s)}return t?t(i):i}}CN(oe.createElement);function Q7(e,t){if(t===1)return e;const n=un.Util.colorToRGBA(e);return n?`rgba(${n.r}, ${n.g}, ${n.b}, ${n.a*t})`:e}function u4(e){const t=(e||"").trim();if(t==="<p><br></p>"||t==="<p></p>")return"";if(t.startsWith("<p>")&&t.endsWith("</p>")){const n=t.slice(3,-4);if(!/(<\/?(p|div|h[1-6]|ul|ol|li|table|thead|tbody|tr|td|blockquote)\b)/i.test(n))return n}return e}const Zf=Qn({enabled:!1,currentFormat:{},editor:Qn.object({instance:null},{},{deep:!1})}),J7=Od("div",oe.forwardRef)`
|
|
244
|
+
.ql-editor {
|
|
245
|
+
outline: none;
|
|
246
|
+
}
|
|
247
|
+
.ql-clipboard {
|
|
248
|
+
pointer-events: none;
|
|
249
|
+
}
|
|
250
|
+
${Np}
|
|
251
|
+
strong {
|
|
252
|
+
font-weight: 700;
|
|
253
|
+
}
|
|
254
|
+
.ql-direction-rtl {
|
|
255
|
+
direction: rtl;
|
|
256
|
+
}
|
|
257
|
+
`;let LN=["bold","color","font","italic","size","strike","underline","indent","list","direction"];const c4=(e,t)=>{var n=e.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+t+"<p><br></p></div>");e.setContents(n),e.history.clear()},NN=({html:e,onBlur:t,onChange:n,element:r,clickCoords:i})=>{var a;const o=oe.useRef(null);oe.useEffect(()=>{if(!o.current)return;const h=(c=o.current,new F7(c,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:LN}));var c;mc(()=>{Zf.editor.instance=h}),window.__polotnoQuill=h,h.on("text-change",()=>{h.getSelection()&&mc(()=>{Zf.currentFormat=h.getFormat(h.getSelection())}),setTimeout(()=>{var y;const _=(y=o.current)===null||y===void 0?void 0:y.childNodes[0];if(!_)return;const x=_.innerHTML;n(u4(x))},10)}),c4(h,e),i?MN(h,i):h.setSelection(0,0,"api"),h.on("selection-change",(y,_,x)=>{y&&mc(()=>{Zf.currentFormat=h.getFormat(h.getSelection())})}),o.current.childNodes[0].addEventListener("blur",y=>{var _;if(!((_=y.relatedTarget)===null||_===void 0)&&_.classList.contains("ql-clipboard"))return;(function(b){return!!b&&!!b.closest(".sketch-picker")})(y.relatedTarget)||t()});const m=o.current.childNodes[0],g=y=>{var _,x;const b=h.getSelection();if(!b||b.length===0)return;const S=h.getText(b.index,b.length).replace(/\n$/,""),k=window.getSelection();let E="";if(k&&k.rangeCount>0){const A=k.getRangeAt(0),R=document.createElement("div");R.appendChild(A.cloneContents()),E=R.innerHTML}(_=y.clipboardData)===null||_===void 0||_.setData("text/plain",S),E&&((x=y.clipboardData)===null||x===void 0||x.setData("text/html",E)),y.preventDefault()},d=y=>{g(y);const _=h.getSelection();_&&_.length>0&&h.deleteText(_.index,_.length)};return m.addEventListener("copy",g),m.addEventListener("cut",d),()=>{m.removeEventListener("copy",g),m.removeEventListener("cut",d),mc(()=>{Zf.editor.instance=null,Zf.currentFormat={}}),delete window.__polotnoQuill}},[]),oe.useEffect(()=>D6(()=>r.text,()=>{var h;const c=Zf.editor.instance;if(!c)return;const m=c.getSelection();u4((h=o.current)===null||h===void 0?void 0:h.childNodes[0].innerHTML)===r.text||(c4(c,e),m&&(c.setSelection(m.index,m.length),mc(()=>{Zf.currentFormat=c.getFormat(c.getSelection())})))},{fireImmediately:!0}),[]),oe.useEffect(()=>{window.addEventListener("blur",t);const h=c=>{var m;!((m=o.current)===null||m===void 0)&&m.contains(c.target)||t()};return window.addEventListener("touchstart",h),()=>{window.removeEventListener("blur",t),window.removeEventListener("touchstart",h)}},[]);const s={color:r.fill};r.fill.indexOf("gradient")>=0&&(s.backgroundColor=r.fill,s.backgroundImage=r.fill,s.backgroundSize="100% 100%",s.backgroundRepeat="repeat",s.webkitBackgroundClip="text",s.MozBackgroundClip="text",s.WebkitTextFillColor="transparent",s.MozTextFillColor="transparent");const u=T7(r);return oe.createElement(J7,{ref:o,style:Object.assign(Object.assign({},s),{fontSize:r.fontSize,fontWeight:r.fontWeight,textTransform:r.textTransform,width:r.a.width,fontFamily:'"'+r.fontFamily+'"',lineHeight:r.lineHeight,letterSpacing:r.letterSpacing*r.fontSize+"px",textAlign:r.align,opacity:Math.max(r.a.opacity,.2),textShadow:r.shadowEnabled?`${r.shadowOffsetX}px ${r.shadowOffsetY}px ${r.shadowBlur}px ${Q7(r.shadowColor,(a=r.shadowOpacity)!==null&&a!==void 0?a:1)}`:void 0,caretColor:u}),dir:Ap($o(r.text))})};function TN(e){return!(function(t){const n=t.getContext("2d").getImageData(0,0,t.width,t.height).data;for(let r=0;r<n.length;r+=4)if(n[r+3]!==0)return!0;return!1})(e)}const f4=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),RN=Qr(({element:e,store:t})=>{var n;const r=oe.useRef(null),[i,a]=oe.useState(),[o,s]=oe.useState(!1),[u,h]=oe.useState(!1),c=oe.useRef(e.height),m=t.selectedShapes.indexOf(e)>=0&&e.selectable,g=N0(m),d=e.fontSize/3,{textVerticalResizeEnabled:y}=Ir,_=Ir.autoDeleteEmptyText,x=N0(e.fontFamily),[b]=R7(t,e.fontFamily),S=e._editModeEnabled;qp(r);const k=b?e.fontFamily:x!==e.fontFamily?x:"Arial",E=Gu(e).fill,A=a2(e,{fontFamily:k,color:E}),R=a2(e,{fontFamily:k,color:E,forEditor:!0});let{width:O,height:I}=(function(z,Y,J){return oe.useMemo(()=>s4(z),[z,Y.width,J])})(A,e,b);oe.useEffect(()=>{if(!b)return;if(!e.height)return void t.history.ignore(()=>{e.set({height:I})});const{textOverflow:z}=Ir;if(z!=="change-font-size"||o)z==="resize"&&(y&&e.height<I&&!o&&t.history.ignore(()=>{e.set({height:I})}),y||e.height===I||t.history.ignore(()=>{e.set({height:I})}));else{const Y=(J=>{let K=J.fontSize;for(let ie=1;ie<50;ie++){const fe=a2(Object.assign(Object.assign({},J.toJSON()),{fontSize:K}),{fontFamily:J.fontFamily}),{height:ue}=s4(fe);if(!(J.height&&ue>J.height||!Ir.textSplitAllowed&&!J.curveEnabled&&_N({html:fe})))break;K-=.5}return K})(e);Y!==e.fontSize?t.history.ignore(()=>{e.set({fontSize:Y})}):e.height!==I&&(y&&e.height<I?t.history.ignore(()=>{e.set({height:I})}):y||t.history.ignore(()=>{e.set({height:I})}))}});const j=oe.useMemo(()=>{const z={lastArgs:null,lastResult:null};return async function(Y){return z.lastArgs&&z.lastResult&&(J=z.lastArgs,K=Y,JSON.stringify(J)===JSON.stringify(K))||(z.lastResult=await l4(Y),z.lastArgs=Object.assign({},Y)),z.lastResult;var J,K}},[]),D=oe.useRef(0),C=oe.useRef(null);oe.useEffect(()=>{o||S||(async()=>{D.current++;const z=D.current;let Y=dh(`text ${e.id} ${z}`);C.current&&C.current(),C.current=Y,h(!0);let J=null;const K=f4?5:1;for(let ie=0;ie<K;ie++){const fe=ie>0?j:l4;try{if(J=await fe({skipCache:ie>0,html:A,width:e.width||1,height:e.height||I||1,fontFamily:k,padding:d,pixelRatio:t._elementsPixelRatio,font:t.fonts.find(ue=>ue.fontFamily===k)||cy.find(ue=>ue.fontFamily===k)}),z!==D.current)return;if(f4&&TN(J)){await new Promise(ue=>setTimeout(ue,50*(ie+1)));continue}break}catch(ue){console.error(ue),$p(`Error rendering rich text with id ${e.id}`);break}}J?a(J):Y?(Y(),Y=null):console.error("Finish function is called twice!"),h(!1)})()},[A,o,I,S,k,e.height,t._elementsPixelRatio,b]);const[N,$]=kv(u,300),[G]=kv(o,300,!0),te=G||N;oe.useEffect(()=>{var z;if(!te)return $u(()=>{const Y=r.current;Rs(Y,e)});(z=r.current)===null||z===void 0||z.clearCache()},[i,te,e.shadowColor,e.shadowOffsetX,e.shadowOffsetY,e.shadowOpacity]),oe.useEffect(()=>{i&&!u&&C.current&&(C.current(),C.current=null)},[i,u]),oe.useLayoutEffect(()=>{if(!b||!e.curveEnabled)return;const z=new un.TextPath({data:ph(e.a.width,e.a.height,e.curvePower,e.a.fontSize),text:$o(e.text),letterSpacing:e.letterSpacing*e.a.fontSize,fontSize:e.a.fontSize,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,align:"center",textBaseline:"middle",fill:e.fill}),Y=z.getSelfRect().width;if(Y){const J=Y-e.a.width,K=e.a.rotation*Math.PI/180,ie=-J/2*Math.cos(K),fe=-J/2*Math.sin(K);e.set({width:Y,x:e.a.x+ie,y:e.a.y+fe})}z.destroy()},[b,e.curveEnabled,e.curvePower,e.text,e.fontSize,e.fontFamily,e.fontWeight,e.fontStyle,e.letterSpacing]),oe.useEffect(()=>()=>{C.current&&C.current()},[]),oe.useEffect(()=>{g&&!m&&_&&$o(e.text)===""&&e.removable&&!e.placeholder&&t.deleteElements([e.id])},[_,e.placeholder,e.removable,e.text,m,g]);let se=0;e.verticalAlign==="middle"&&(se=(e.height-I)/2),e.verticalAlign==="bottom"&&(se=e.height-I);const ee=M7({fontLoaded:b,fontFamily:e.fontFamily,fontSize:e.fontSize,lineHeight:e.lineHeight}),Q=Tf(),re=ph(e.a.width,I,e.curvePower,e.fontSize),X=oe.useRef(null),B=oe.useRef(null),F=S&&e.strokeWidth>0&&!e.curveEnabled;return oe.createElement(oe.Fragment,null,oe.createElement(Pr,{x:e.a.x,y:e.a.y,offsetX:e.backgroundPadding*(e.fontSize*ee*.5),offsetY:e.backgroundPadding*(e.fontSize*ee*.5),rotation:e.a.rotation,hideInExport:!e.showInExport,listening:!1,visible:e.backgroundEnabled,opacity:e.backgroundOpacity*e.a.opacity,fill:e.backgroundColor,width:e.a.width+e.backgroundPadding*(e.fontSize*ee),height:e.a.height+e.backgroundPadding*(e.fontSize*ee),cornerRadius:e.backgroundCornerRadius*(e.fontSize*ee*.5)}),oe.createElement(Ep,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,data:re,stroke:"red",strokeWidth:1,visible:!1}),oe.createElement(Pr,{ref:r,name:"element",x:e.a.x,y:e.a.y,listening:e.selectable,rotation:e.a.rotation,width:e.a.width,height:e.a.height,visible:!te,draggable:Q?e.draggable&&m:e.draggable,preventDefault:!Q||m,opacity:S?0:e.a.opacity,hideInExport:!e.showInExport,onDragMove:z=>{e.set({x:z.target.x(),y:z.target.y()})},onDragEnd:z=>{e.set({x:z.target.x(),y:z.target.y()})},id:e.id,onDblClick:z=>{e.contentEditable&&(B.current={x:z.evt.clientX,y:z.evt.clientY},e.toggleEditMode(!0))},onDblTap:z=>{var Y;if(e.contentEditable){const J=(Y=z.evt.changedTouches)===null||Y===void 0?void 0:Y[0];B.current=J?{x:J.clientX,y:J.clientY}:null,e.toggleEditMode(!0)}},onTransformStart:z=>{s(!0),c.current=e.height},onTransform:z=>{var Y;const J=z.target,K=((Y=J.getStage())===null||Y===void 0?void 0:Y.findOne("Transformer")).getActiveAnchor(),ie=K==="middle-left"||K==="middle-right",fe=K==="top-center"||K==="bottom-center",ue=J.scaleX();if(ie){const _e=J.scaleX(),Ce=J.width()*_e,$e=e.fontSize;let ze=Ce;if(Ce<$e&&(ze=$e,X.current&&J.position(X.current)),J.width(ze),J.scaleX(1),Ir.textVerticalResizeEnabled){const tt=Math.max(I,c.current);e.set({height:tt})}e.set({width:J.width(),x:J.x(),y:J.y()})}else if(fe){let _e=Ir.textOverflow==="resize"?I:e.lineHeight*e.fontSize;const Ce=Math.max(_e,z.target.height()*z.target.scaleY());J.scaleY(1),e.set({x:J.x(),y:J.y(),height:Ce,rotation:J.rotation()})}else J.scaleX(1),J.scaleY(1),e.set({fontSize:e.fontSize*ue,letterSpacing:e.letterSpacing,width:J.width()*ue,x:J.x(),y:J.y(),rotation:J.rotation(),height:J.height()*ue});X.current=z.target.position()},onTransformEnd:z=>{s(!1),h(!0);const Y=z.target.scaleX();z.target.scaleX(1),z.target.scaleY(1),e.set({fontSize:e.fontSize*Y,width:z.target.width()*Y,x:z.target.x(),y:z.target.y(),rotation:z.target.rotation(),shadowBlur:e.shadowBlur*Y,shadowOffsetX:e.shadowOffsetX*Y,shadowOffsetY:e.shadowOffsetY*Y,strokeWidth:e.strokeWidth*Y})}}),oe.createElement(ju,{ref:r,image:i,x:e.a.x,y:e.a.y,offsetX:d,offsetY:d-se,listening:!1,rotation:e.a.rotation,width:e.a.width+2*d,height:(e.a.width+2*d)*(i?.height/i?.width||1),visible:!te&&!S,opacity:e.a.opacity,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,hideInExport:!e.showInExport,editModeEnabled:e._editModeEnabled||o||te}),(te||F)&&oe.createElement(hr,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,offsetY:-se},oe.createElement(A0,{divProps:{style:{pointerEvents:"none"}}},oe.createElement(J7,{dangerouslySetInnerHTML:{__html:A},style:{pointerEvents:"none",opacity:e.a.opacity,textShadow:e.shadowEnabled?`${e.shadowOffsetX}px ${e.shadowOffsetY}px ${e.shadowBlur}px ${Q7(e.shadowColor,(n=e.shadowOpacity)!==null&&n!==void 0?n:1)}`:void 0}}))),S&&oe.createElement(hr,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,offsetY:-se},oe.createElement(A0,null,oe.createElement(NN,{html:R,element:e,onChange:z=>{const Y=N7({oldText:$o(e.text),newText:$o(z),element:e});e.set({text:z,fontSize:Y})},onBlur:z=>{e.toggleEditMode(!1),$(!0)},clickCoords:B.current}))))});function MN(e,t){if(!e||!t)return;const{x:n,y:r}=t;try{let i=null;if(document.caretRangeFromPoint)i=document.caretRangeFromPoint(n,r);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(n,r);a&&(i=document.createRange(),i.setStart(a.offsetNode,a.offset))}if(i){const a=F7.find(i.startContainer,!0);if(a){const o=a.offset(e.scroll)+i.startOffset;return void e.setSelection(o,0,"api")}}}catch{}e.setSelection(0,0,"api")}function Sy(e){return e/180*Math.PI}function z1(e,t,n,r,i){const a=Math.sqrt(n*n+r*r);return i+=Math.atan2(r,n),{x:e+a*Math.cos(i),y:t+a*Math.sin(i)}}function Cd(e){const{x:t,y:n,width:r,height:i}=e,a=Sy(e.rotation),o=z1(t,n,0,0,a),s=z1(t,n,r,0,a),u=z1(t,n,r,i,a),h=z1(t,n,0,i,a),c=Math.min(o.x,s.x,u.x,h.x),m=Math.min(o.y,s.y,u.y,h.y),g=Math.max(o.x,s.x,u.x,h.x),d=Math.max(o.y,s.y,u.y,h.y);return{x:c,y:m,width:g-c,height:d-m,minX:c,minY:m,maxX:g,maxY:d}}function ig(e){const t=e.map(o=>Cd(o)),n=Math.min(...t.map(o=>o.minX)),r=Math.min(...t.map(o=>o.minY)),i=Math.max(...t.map(o=>o.maxX)),a=Math.max(...t.map(o=>o.maxY));return{x:n,y:r,width:i-n,height:a-r,minX:n,minY:r,maxX:i,maxY:a}}function IN(e){const t=Sy(e.rotation||0);return{x:e.x+e.width/2*Math.cos(t)+e.height/2*Math.sin(-t),y:e.y+e.height/2*Math.cos(t)+e.width/2*Math.sin(t)}}function jN(e,t,n){const r=Sy(t),i=n.x+(e.x-n.x)*Math.cos(r)-(e.y-n.y)*Math.sin(r),a=n.y+(e.x-n.x)*Math.sin(r)+(e.y-n.y)*Math.cos(r);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:i,y:a})}function DN(e,t){return jN(e,t,IN(e))}const rs={stroke:"rgb(0, 161, 255)",strokeWidth:1,dash:[4,6]},FN=({stroke:e,strokeWidth:t,dash:n})=>{e!==void 0&&(rs.stroke=e),t!==void 0&&(rs.strokeWidth=t),n!==void 0&&(rs.dash=n)};let h4=({targetKonvaNodes:e,guideKonvaNode:t,distance:n,snapDirection:r})=>n<5;function Ov(e,t){var n=[],r=[];e.vertical.forEach(h=>{t.vertical.forEach(c=>{var m=Math.abs(h.offset-c.guide);h4({targetKonvaNodes:c.nodes,guideKonvaNode:h.node,distance:m,snapDirection:h.snap})&&n.push({lineGuide:h.offset,diff:m,snap:c.snap,offset:c.offset})})}),e.horizontal.forEach(h=>{t.horizontal.forEach(c=>{var m=Math.abs(h.offset-c.guide);h4({targetKonvaNodes:c.nodes,guideKonvaNode:h.node,distance:m,snapDirection:h.snap})&&r.push({lineGuide:h.offset,diff:m,snap:c.snap,offset:c.offset})})});var i=[];const a=n.sort((h,c)=>h.diff-c.diff),o=r.sort((h,c)=>h.diff-c.diff);var s=a[0],u=o[0];return s&&a.filter(h=>Math.abs(h.diff-s.diff)<.1).forEach(h=>{i.push(Object.assign({orientation:"V"},h))}),u&&o.filter(h=>Math.abs(h.diff-u.diff)<.1).forEach(h=>{i.push(Object.assign({orientation:"H"},h))}),i}const ex=()=>{if(un.DD._dragElements.size===0)return;const e=[...un.DD._dragElements.entries()],t=e.find(([n,r])=>r.node instanceof un.Transformer);t&&(e.splice(e.indexOf(t),1),e.unshift(t),un.DD._dragElements.clear(),e.forEach(([n,r])=>{un.DD._dragElements.set(n,r)}))};function BN(e,t,n){const r=oe.useRef(null);FN(n);const i=c=>c.hasName("element")||c.hasName("page-background")||!r.current&&c.hasName("elements-area");function a(c){var m;const g=(m=e.current)===null||m===void 0?void 0:m.getStage(),d=[],y=[];return g.find(i).forEach(_=>{if(!(c.indexOf(_)>=0)){var x=_.getClientRect({skipShadow:!0,skipStroke:!0});d.push({offset:x.x,node:_,snap:"start"},{offset:x.x+x.width,node:_,snap:"end"},{offset:x.x+x.width/2,node:_,snap:"center"}),y.push({offset:x.y,node:_,snap:"start"},{offset:x.y+x.height,node:_,snap:"end"},{offset:x.y+x.height/2,node:_,snap:"center"})}}),{vertical:d,horizontal:y}}function o(c){var m;const g=(m=e.current)===null||m===void 0?void 0:m.getLayer(),d=g?.children.find(y=>y.name()==="line-guides");c.forEach(y=>{if(y.orientation==="H"){var _=new un.Line({x:-g.getStage().x(),y:-g.getStage().y(),points:[-6e3,y.lineGuide,6e3,y.lineGuide],stroke:rs.stroke,strokeWidth:rs.strokeWidth,name:"guid-line",dash:rs.dash});d?.add(_),g.batchDraw()}else y.orientation==="V"&&(_=new un.Line({x:-g.getStage().x(),y:-g.getStage().y(),points:[y.lineGuide,-6e3,y.lineGuide,6e3],stroke:rs.stroke,strokeWidth:rs.strokeWidth,name:"guid-line",dash:rs.dash}),d?.add(_))})}const s=c=>{const m=c.target.getLayer().children.find(k=>k.name()==="line-guides");m?.destroyChildren();var g=a(c.target.nodes()),d=(function(k){const E=k.__getNodeRect(),A=Cd(Object.assign(Object.assign({},E),{rotation:un.Util.radToDeg(E.rotation)})),R=k.getAbsolutePosition();return{vertical:[{guide:A.x,offset:R.x-A.x,snap:"start",nodes:k.nodes()},{guide:A.x+A.width/2,offset:R.x-A.x-A.width/2,snap:"center",nodes:k.nodes()},{guide:A.x+A.width,offset:R.x-A.x-A.width,snap:"end",nodes:k.nodes()}],horizontal:[{guide:A.y,offset:R.y-A.y,snap:"start",nodes:k.nodes()},{guide:A.y+A.height/2,offset:R.y-A.y-A.height/2,snap:"center",nodes:k.nodes()},{guide:A.y+A.height,offset:R.y-A.y-A.height,snap:"end",nodes:k.nodes()}]}})(c.target),y=Ov(g,d);if(!y.length)return;o(y);const _=c.target.getAbsolutePosition(),x=(c.target.nodes().map(k=>k.getAbsolutePosition()),Object.assign({},_));y.forEach(k=>{switch(k.snap){case"start":case"center":case"end":switch(k.orientation){case"V":x.x=k.lineGuide+k.offset;break;case"H":x.y=k.lineGuide+k.offset}}});const b=x.x-_.x,S=x.y-_.y;c.evt.ctrlKey||c.evt.metaKey||c.target.nodes().forEach(k=>{const E=k.getAbsolutePosition();k.setAbsolutePosition({x:E.x+b,y:E.y+S})})},u=(c,m,g)=>{var d;const y=e.current,_=y.getLayer().children.find(I=>I.name()==="line-guides");if(_?.destroyChildren(),y.getActiveAnchor()==="rotater")return m;const x=y.getActiveAnchor(),b=zN[x],S=(d=y.findOne(`.${b}`))===null||d===void 0?void 0:d.getAbsolutePosition();if(!S)return m;const k={x:c.x-S.x,y:c.y-S.y},E=(function(I,j){const D=p4(I,j)/p4(j,j);return{x:D*j.x,y:D*j.y}})({x:m.x-c.x,y:m.y-c.y},k);if(Math.sqrt(Math.pow(E.x,2)+Math.pow(E.y,2))>5)return m;const A={x:c.x+E.x,y:c.y+E.y};var R=Ov(a(y.nodes()),{vertical:[{guide:A.x,offset:0,snap:"start",nodes:y.nodes()}],horizontal:[{guide:A.y,offset:0,snap:"start",nodes:y.nodes()}]});if(!R.length||(o(R),g.ctrlKey||g.metaKey))return m;const O=[];if(R.forEach(I=>{const j=(function(D,C,N){if(N.orientation==="V"){const $=N.lineGuide;if(Math.abs(C.x-D.x)<1e-4)return null;const G=(C.y-D.y)/(C.x-D.x);return{x:$,y:G*$+(D.y-G*D.x)}}{const $=N.lineGuide;if(Math.abs(C.y-D.y)<1e-4)return null;const G=(C.y-D.y)/(C.x-D.x);return{x:($-D.y)/G+D.x,y:$}}})(A,S,{orientation:I.orientation,lineGuide:I.lineGuide});j&&O.push(j)}),O.length>0){let I=O[0],j=Math.sqrt(Math.pow(A.x-I.x,2)+Math.pow(A.y-I.y,2));if(O.forEach(D=>{const C=Math.sqrt(Math.pow(A.x-D.x,2)+Math.pow(A.y-D.y,2));C<j&&(j=C,I=D)}),j<10)return I}return A},h=c=>{if(!c.target)return;const m=c.target.getLayer(),g=m.children.find(d=>d.name()==="line-guides");g?.destroyChildren(),m.batchDraw()};oe.useEffect(()=>{e.current&&(e.current.anchorDragBoundFunc(u),e.current.on("dragstart",c=>{setTimeout(()=>{ex()})}),e.current.on("dragmove",s),e.current.on("dragend",h),e.current.on("transformend",h),e.current.on("transform",c=>{var m,g;c.evt.ctrlKey||c.evt.metaKey?(m=e.current)===null||m===void 0||m.rotationSnapTolerance(0):(g=e.current)===null||g===void 0||g.rotationSnapTolerance(5)}))},[])}function d4(e,t,n){const r=o=>o.hasName("element")||o.hasName("line-anchor")||o.hasName("page-background")||o.hasName("elements-area"),i=o=>{const s=o.target.getLayer().children.find(y=>y.name()==="line-guides");s?.destroyChildren();var u,h=Ov((function(y){var _;const x=(_=e.current)===null||_===void 0?void 0:_.getStage();var b=[],S=[];return x.find(r).forEach(k=>{if(!(y.indexOf(k)>=0)){var E=k.getClientRect({skipShadow:!0,skipStroke:!0});k.hasName("line-anchor")&&(E={x:k.absolutePosition().x,y:k.absolutePosition().y,width:0,height:0}),b.push({offset:E.x,node:k,snap:"start"},{offset:E.x+E.width,node:k,snap:"end"},{offset:E.x+E.width/2,node:k,snap:"center"}),S.push({offset:E.y,node:k,snap:"start"},{offset:E.y+E.height,node:k,snap:"end"},{offset:E.y+E.height/2,node:k,snap:"center"})}}),{vertical:b,horizontal:S}})([o.target,...t.map(y=>y.current)]),{vertical:[{guide:(u=o.target).absolutePosition().x,offset:0,snap:"center",nodes:[u]}],horizontal:[{guide:u.absolutePosition().y,offset:0,snap:"center",nodes:[u]}]});if(!h.length)return;(function(y){var _;const x=(_=e.current)===null||_===void 0?void 0:_.getLayer(),b=x?.children.find(S=>S.name()==="line-guides");y.forEach(S=>{if(S.orientation==="H"){var k=new un.Line({points:[-6e3,S.lineGuide,6e3,S.lineGuide],stroke:rs.stroke,strokeWidth:rs.strokeWidth,name:"guid-line",dash:rs.dash});b?.add(k),x.batchDraw()}else S.orientation==="V"&&(k=new un.Line({points:[S.lineGuide,-6e3,S.lineGuide,6e3],stroke:rs.stroke,strokeWidth:rs.strokeWidth,name:"guid-line",dash:rs.dash}),b?.add(k))})})(h);const c=o.target.getAbsolutePosition(),m=Object.assign({},c);h.forEach(y=>{switch(y.snap){case"start":case"center":case"end":switch(y.orientation){case"V":m.x=y.lineGuide+y.offset;break;case"H":m.y=y.lineGuide+y.offset}}});const g=m.x-c.x,d=m.y-c.y;if(!o.evt.ctrlKey&&!o.evt.metaKey){const y=o.target.getAbsolutePosition();o.target.absolutePosition({x:y.x+g,y:y.y+d})}},a=o=>{if(!o.target)return;const s=o.target.getLayer(),u=s.children.find(h=>h.name()==="line-guides");u?.destroyChildren(),s.batchDraw()};oe.useEffect(()=>{e.current&&(e.current.on("dragmove",i),e.current.on("dragend",a))},n)}function p4(e,t){return e.x*t.x+e.y*t.y}const zN={"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"};function UN(e){const{x:t,y:n,width:r,height:i,rotation:a}=e.a,o=a*Math.PI/180,s={x:t+i/2*Math.cos(o+Math.PI/2),y:n+i/2*Math.sin(o+Math.PI/2)};return{middleLeft:s,middleRight:{x:s.x+r*Math.cos(o),y:s.y+r*Math.sin(o)}}}function g4(e,t,n){const r=Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)),i=Math.atan2(t.y-e.y,t.x-e.x),a=180*i/Math.PI;return{x:e.x+Math.cos(i-Math.PI/2)*n/2,y:e.y+Math.sin(i-Math.PI/2)*n/2,width:r,height:n,rotation:a}}const m4=(e,t)=>{const n=gf.anchorSize||10;return{offsetX:n/2/e,offsetY:n/2/e,width:n/e,height:n/e,cornerRadius:(gf.anchorCornerRadius||0)/e,fill:gf.anchorFill||"white",stroke:gf.anchorStroke||"rgb(0, 161, 255)",strokeWidth:gf.anchorStrokeWidth||2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:r=>{r.target.getStage().container().style.cursor="crosshair"},onMouseLeave:r=>{r.target.getStage().container().style.cursor=""},onDragStart:r=>{t.history.startTransaction()},onDragEnd:r=>{t.history.endTransaction()}}},v4=Qr(({element:e,type:t})=>{const n=Gu(e,e.a.color,"fill"),r=Gu(e,e.a.color,"stroke"),i=Object.assign(Object.assign(Object.assign({strokeWidth:e.height,lineCap:"round",lineJoin:"round"},r),n),{opacity:e.a.opacity,hideInExport:!e.showInExport});return oe.createElement(oe.Fragment,null,t==="arrow"&&oe.createElement(yc,Object.assign({points:[3*e.height,2*-e.height,0,0,3*e.height,2*e.height]},i)),t==="triangle"&&oe.createElement(yc,Object.assign({points:[3*e.height,2*-e.height,0,0,3*e.height,2*e.height],closed:!0},i)),t==="bar"&&oe.createElement(yc,Object.assign({points:[0,2*-e.height,0,2*e.height],closed:!0},i)),t==="square"&&oe.createElement(yc,Object.assign({points:[0,2*-e.height,4*e.height,2*-e.height,4*e.height,2*e.height,0,2*e.height],closed:!0},i)),t==="circle"&&oe.createElement(IP,Object.assign({x:2*e.height,y:0,radius:2*e.height},i)))}),qN=Qr(({element:e,store:t})=>{const n=oe.useRef(null),r=oe.useRef(null),i=oe.useRef(null),a=e.selectable||t.role==="admin",o=Tf(),s=t.selectedElements.indexOf(e)>=0&&t.selectedElements.length===1,u=t.selectedShapes.indexOf(e)>=0&&e.selectable,{middleLeft:h,middleRight:c}=UN(e);d4(r,[n],[s]),d4(i,[n],[s]);const m=Gu(e,e.a.color,"stroke");return oe.createElement(oe.Fragment,null,oe.createElement(yc,Object.assign({ref:n,name:"element",id:e.id,x:e.a.x,y:e.a.y,points:[0,0,e.a.width,0],offsetY:-e.a.height/2,strokeWidth:e.a.height,hitStrokeWidth:Math.max(e.a.height,20),dash:e.dash.map(g=>g*e.a.height)},m,{rotation:e.a.rotation,opacity:e.animated("opacity"),shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,listening:a,draggable:o?e.draggable&&u:e.draggable,preventDefault:!o||u,hideInExport:!e.showInExport,onDragMove:g=>{e.set({x:g.target.x(),y:g.target.y()})},onDragEnd:g=>{e.set({x:g.target.x(),y:g.target.y()})},onTransform:g=>{const d=g.target.scaleX();g.target.scaleX(1),g.target.scaleY(1),e.set({height:e.height*d,width:e.width*d,x:g.target.x(),y:g.target.y(),rotation:g.target.rotation()})}})),oe.createElement(hr,{x:h.x,y:h.y,rotation:e.rotation,hideInExport:!e.showInExport,onClick:g=>{var d;return(d=n.current)===null||d===void 0?void 0:d.fire("click",g)},onTap:g=>{var d;return(d=n.current)===null||d===void 0?void 0:d.fire("tap",g)}},oe.createElement(v4,{element:e,type:e.startHead})),oe.createElement(hr,{x:c.x,y:c.y,rotation:e.rotation+180,onClick:g=>{var d;return(d=n.current)===null||d===void 0?void 0:d.fire("click",g)},onTap:g=>{var d;return(d=n.current)===null||d===void 0?void 0:d.fire("tap",g)}},oe.createElement(v4,{element:e,type:e.endHead})),s&&e.resizable&&oe.createElement(uy,{selector:".page-abs-container",enabled:!0},oe.createElement(hr,{visible:s},oe.createElement(Pr,Object.assign({x:h.x,y:h.y,ref:r,name:"line-anchor"},m4(t.scale,t),{onDragMove:g=>{const d=g4(g.target.position(),c,e.height);e.set({x:d.x,y:d.y,width:d.width,rotation:d.rotation})}})),oe.createElement(Pr,Object.assign({x:c.x,y:c.y,ref:i,name:"line-anchor"},m4(t.scale,t),{onDragMove:g=>{const d=g4(h,g.target.position(),e.height);e.set({x:d.x,y:d.y,width:d.width,rotation:d.rotation})}})))))});function ud(){return document.createElement("canvas")}const tx=new window.Image;tx.src=Mf(`
|
|
258
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
259
|
+
<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"/>
|
|
260
|
+
<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"/>
|
|
261
|
+
</svg>
|
|
262
|
+
`);const nx=new window.Image;nx.src=Mf(`
|
|
263
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
264
|
+
<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"/>
|
|
265
|
+
<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"/>
|
|
266
|
+
<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"/>
|
|
267
|
+
<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"/>
|
|
268
|
+
</svg>
|
|
269
|
+
`);const rx=(e,t,n,r,i=0,a=!1)=>{const o=Math.floor(Math.max(e.width*r,1)),s=Math.floor(Math.max(e.height*r,1)),u=Math.min(i*r,o/2,s/2),h=Math.max(e.width/n.width,e.height/n.height)*r,c=e.page._exportingOrRendering&&Ir.imageDownScalingEnabled&&h<1&&!a,m=t instanceof HTMLVideoElement?t.videoWidth:t?.width,g=t instanceof HTMLVideoElement?t.videoHeight:t?.height,d=n.x===0&&n.y===0&&n.width===m&&n.height===g,y=oe.useMemo(()=>{if(t&&m&&g)return d&&u===0&&!c?void 0:ud()},[t,u,c,d,m,g]),_=()=>{if(!y||!t)return;y.width=o,y.height=s;const x=y.getContext("2d");if(!x)return;u&&(x.beginPath(),x.moveTo(u,0),x.lineTo(o-u,0),x.arc(o-u,u,u,3*Math.PI/2,0,!1),x.lineTo(o,s-u),x.arc(o-u,s-u,u,0,Math.PI/2,!1),x.lineTo(u,s),x.arc(u,s-u,u,Math.PI/2,Math.PI,!1),x.lineTo(0,u),x.arc(u,u,u,Math.PI,3*Math.PI/2,!1),x.clip());const b=c?(function(k,E){var A,R;const O=ud(),I=k instanceof HTMLVideoElement?k.videoWidth:k.width,j=k instanceof HTMLVideoElement?k.videoHeight:k.height;O.width=I,O.height=j,(A=O.getContext("2d"))===null||A===void 0||A.drawImage(k,0,0,O.width,O.height);const D=(function(C,N,$,G,te,se,ee){for(var Q=new ImageData(N,$),re=new Int32Array(C.data.buffer),X=C.width,B=new Int32Array(Q.data.buffer),F=Q.width,z=N/se,Y=$/ee,J=Math.round(1/z),K=Math.round(1/Y),ie=J*K,fe=0;fe<Q.height;fe++)for(var ue=0;ue<F;ue++){for(var _e=0+Math.round(ue/z)+(0+Math.round(fe/Y))*X,Ce=0,$e=0,ze=0,tt=0,pe=0;pe<K;pe++)for(var ut=0;ut<J;ut++){var be=re[_e+ut+pe*X];Ce+=be<<24>>>24,$e+=be<<16>>>24,ze+=be<<8>>>24,tt+=be>>>24}Ce=Math.round(Ce/ie),$e=Math.round($e/ie),ze=Math.round(ze/ie),tt=Math.round(tt/ie),B[ue+fe*F]=tt<<24|ze<<16|$e<<8|Ce}return Q})(O.getContext("2d").getImageData(0,0,O.width,O.height),Math.floor(O.width*E),Math.floor(O.height*E),0,0,O.width,O.height);return O.width=Math.floor(O.width*E),O.height=Math.floor(O.height*E),(R=O.getContext("2d"))===null||R===void 0||R.putImageData(D,0,0),O})(t,h):t,S=c?{x:Math.floor(n.x*h),y:Math.floor(n.y*h),width:Math.floor(n.width*h),height:Math.floor(n.height*h)}:n;x.drawImage(b,S.x,S.y,S.width,S.height,0,0,y.width,y.height)};return oe.useLayoutEffect(()=>{_()},[y,e.width,e.height,n.x,n.y,n.width,n.height,i,r,a,e.page._exportingOrRendering,c]),oe.useEffect(()=>()=>{y&&y.nodeName==="CANVAS"&&un.Util.releaseCanvas(y)},[y]),[y||t,_]},$N=ud(),HN=Qr(({element:e})=>{const t=Math.min(30,e.width/4,e.height/4),n=oe.useRef(null);return oe.useEffect(()=>{const r=n.current;if(!r)return;const i=new un.Animation(a=>{r.rotate((a?.timeDiff||0)/2)},r.getLayer());return i.start(),()=>{i.stop()}}),oe.createElement(hr,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},oe.createElement(Pr,{width:e.width,height:e.height,fill:"rgba(124, 173, 212, 0.8)"}),oe.createElement(sy,{ref:n,x:e.width/2,y:e.height/2,fill:"white",outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270}))}),GN=Qr(({element:e})=>{const t=Math.max(10,Math.min(30,e.width/25));return oe.createElement(hr,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},oe.createElement(Pr,{width:e.width,height:e.height,fill:"rgba(223, 102, 102, 0.8)"}),oe.createElement(Uu,{text:"Can not load the video...",fontSize:t,width:e.width,height:e.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let WN=function(e,t,n){const r=oe.useRef("loading"),i=oe.useRef(null),[a,o]=oe.useState(0),s=oe.useRef(),u=oe.useRef(),h=oe.useRef();return s.current===e&&u.current===t&&h.current===n||(r.current="loading",i.current=void 0,s.current=e,u.current=t,h.current=n),oe.useLayoutEffect(function(){if(e){var c=document.createElement("video");return c.addEventListener("canplay",m),c.addEventListener("error",g),c.crossOrigin=t,c.src=e,c.load(),function(){c.removeEventListener("canplay",m),c.removeEventListener("error",g)}}function m(){r.current="loaded",i.current=c,i.current.currentTime=0,o(Math.random()),i.current.removeEventListener("canplay",m)}function g(d){var y;const _=c.readyState===4,x=c.buffered&&c.buffered.length>0&&c.buffered.end(c.buffered.length-1)/c.duration*100>=100;if(_&&x)return;const b=d.message||((y=c.error)===null||y===void 0?void 0:y.message)||"Unknown error",S=new Error("Video failed to load: "+b);console.error(S),r.current="failed",i.current=void 0,o(Math.random())}},[e,t,n]),[i.current,r.current]};function y4(e){return e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA}const b4=(e,t,n)=>{const r=oe.useRef(),i=()=>{var a;(a=r.current)===null||a===void 0||a.call(r),r.current=void 0};oe.useEffect(()=>i,[]),oe.useLayoutEffect(()=>{const a=t.slice(0,200),o=`video with id ${n} url: ${a}`;e!=="loading"||r.current||(r.current=dh(o)),e!=="loading"&&i(),e==="failed"&&$p(o)},[e])},VN=Qr(({element:e,store:t})=>{var n;const[r,i]=oe.useState(!1),a=oe.useRef(null),o=oe.useRef(null),s=t.selectedShapes.indexOf(e)>=0&&e.selectable,[u,h]=oe.useState(!1),[c,m]=WN(e.src,"anonymous"),[g,d]=oe.useState(!1),y=t.activePage===e.page;b4(m,e.src,e.id),c&&(c.playsInline=!0);const _=((be,ge,xe)=>{const Te=oe.useMemo(()=>{var Me,ve;const{flipX:ye,flipY:we}=be,je=be.type==="svg"||be.src.indexOf("data:image/svg+xml")>=0||be.src.indexOf(".svg")>=0,Le=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;if(!(ye||we||Le&&je))return ge;if(!ge)return null;const Ye=ge instanceof HTMLVideoElement?ge.videoWidth:ge?.width,lt=ge instanceof HTMLVideoElement?ge.videoHeight:ge?.height;if(!Ye||!lt)return null;const rt=ud();let ot=1;be.type==="svg"&&(ot=Math.max(be.width/Ye*xe,be.height/lt*xe)),rt.width=Math.max(Ye*ot,1),rt.height=Math.max(lt*ot,1);let dt=ye?-rt.width:0,Ct=we?-rt.height:0;return(Me=rt.getContext("2d"))===null||Me===void 0||Me.scale(ye?-1:1,we?-1:1),(ve=rt.getContext("2d"))===null||ve===void 0||ve.drawImage(ge,dt,Ct,rt.width,rt.height),rt},[be.flipX,be.flipY,ge,be.width,be.height,xe]);return oe.useEffect(()=>()=>{Te&&Te.nodeName==="CANVAS"&&un.Util.releaseCanvas(Te)},[Te]),Te})(e,c,t._elementsPixelRatio),x=_||$N;oe.useEffect(()=>{c&&t.history.ignore(()=>{e.set({duration:1e3*c.duration})})},[c]),oe.useEffect(()=>{var be;if(!c)return;const ge=t.animatedElementsIds,xe=(!ge.length||ge.includes(e.id))&&t.isPlaying,Te=y&&(xe||u);if(!Te)return void c.pause();Te&&(c.currentTime=e.startTime*c.duration,c.play());const Me=new un.Animation(()=>{z.current()},(be=a.current)===null||be===void 0?void 0:be.getLayer());Me.start();const ve=()=>{h(!1),c.currentTime=e.startTime*c.duration},ye=()=>{c.currentTime>=e.endTime*c.duration&&(c.pause(),c.currentTime=e.startTime*c.duration,h(!1))};return c.addEventListener("ended",ve),c.addEventListener("timeupdate",ye),()=>{c.pause(),Me.stop(),c.removeEventListener("ended",ve),c.removeEventListener("timeupdate",ye)}},[c,u,t.isPlaying,y]),oe.useEffect(()=>{c&&(c.volume=e.volume)},[c,e.volume]);const b=oe.useRef();oe.useEffect(()=>{const be=$u(()=>{var ge,xe;if(c){const Te=t.animatedElementsIds;if(Te.length&&!Te.includes(e.id))return;const Me=e.startTime*c.duration*1e3,ve=c.duration*(e.endTime-e.startTime)*1e3,ye=((t.currentTime||e.page.startTime)-e.page.startTime)%ve+Me;if(Math.abs(1e3*c.currentTime-ye)>500||!t.isPlaying){const we=ye/1e3;we!==c.currentTime&&(c.currentTime=we),!y4(c)&&!t.isPlaying&&!b.current&&(b.current=dh(`video ${e.id}`))}z.current(),(xe=(ge=a.current)===null||ge===void 0?void 0:ge.getLayer())===null||xe===void 0||xe.batchDraw()}});return()=>{be(),b.current&&(b.current(),b.current=null)}},[t,c]),oe.useEffect(()=>{if(!c)return;const be=()=>{var xe,Te;!y4(c)&&e.page._exportingOrRendering||b.current&&(z.current(),(Te=(xe=a.current)===null||xe===void 0?void 0:xe.getLayer())===null||Te===void 0||Te.batchDraw(),b.current(),b.current=null)};let ge;return e.page._exportingOrRendering&&(ge=setInterval(be,20)),c.addEventListener("timeupdate",be),c.addEventListener("canplay",be),()=>{clearInterval(ge),c.removeEventListener("timeupdate",be),c.removeEventListener("canplay",be)}},[e.page._exportingOrRendering,c,e.id,dh]);let{cropX:S,cropY:k,cropWidth:E,cropHeight:A}=e;m!=="loaded"&&(S=k=0,E=A=1);const R=(O=x)instanceof HTMLVideoElement?O.videoWidth:O?.width||0;var O;const I=(be=>be instanceof HTMLVideoElement?be.videoHeight:be?.height||0)(x),j=R*E,D=I*A,C=e.width/e.height;let N,$;const G=j/D,te=e.type==="svg";te?(N=j,$=D):C>=G?(N=j,$=j/C):(N=D*C,$=D);const se={x:R*S,y:I*k,width:N,height:$},ee=(n=e.cornerRadius)!==null&&n!==void 0?n:0,[Q,re]=rx(e,x,se,t._elementsPixelRatio,ee,!0);let[X,B]=((be,ge,xe,Te)=>{const Me=(Ye=>{const[lt,rt]=oe.useState(Ye);return oe.useEffect(()=>{(async()=>{const ot=await(async function(dt){if(!(dt.indexOf("data:image/svg+xml")>=0||dt.indexOf(".svg")>=0))return dt;const Ct=await Gp(dt),Zt=gy(Ct);return Mf(Zt)})(Ye);ot!==lt&&rt(ot)})()},[Ye]),lt})(be.clipSrc||""),[ve,ye]=ly(Me,"anonymous"),we=be.clipSrc?ye:"loaded";b4(we,be.clipSrc,be.id);const je=oe.useMemo(()=>{if(ge&&ve)return ud()},[ge,ve]);function Le(){var Ye;if(!ve)return;const lt=ge instanceof HTMLVideoElement?ge.videoWidth:ge?.width,rt=ge instanceof HTMLVideoElement?ge.videoHeight:ge?.height;if(!ge||!lt||!rt||!ve||!ve.width||!ve.height||!je)return;const ot=ud(),dt=Math.max(be.width/ve.width*xe,be.height/ve.height*xe);ot.width=ve.width*dt,ot.height=ve.height*dt,(Ye=ot.getContext("2d"))===null||Ye===void 0||Ye.drawImage(ve,0,0,ot.width,ot.height),je.width=Math.max(lt,1),je.height=Math.max(rt,1);const Ct=je.getContext("2d");Ct&&(Ct.save(),Ct.drawImage(ot,0,0,lt,rt),un.Util.releaseCanvas(ot),Ct.globalCompositeOperation="source-in",Ct.drawImage(ge,0,0,je.width,je.height),Ct.restore())}return oe.useLayoutEffect(()=>{Le()},[je,ge,ve,be.width,be.height,xe,...Te]),[be.clipSrc&&ve?je:ge,Le]})(e,Q,t._elementsPixelRatio,[se,ee,t._elementsPixelRatio]);function F(){re(),B()}const z=oe.useRef(F);z.current=F;const Y=Math.max(e.width/N,e.height/$);oe.useEffect(()=>{var be;if(!e._cropModeEnabled)return;const ge=(be=a.current)===null||be===void 0?void 0:be.getStage();function xe(Me){e._cropModeEnabled&&Me.target!==o.current&&e.toggleCropMode(!1)}function Te(Me){e._cropModeEnabled&&Me.target.parentNode!==ge.content&&e.toggleCropMode(!1)}return document.body.addEventListener("click",Te),ge?.on("click",xe),ge?.on("tap",xe),()=>{document.body.removeEventListener("click",Te),document.body.removeEventListener("touchstart",Te),ge?.off("click",xe),ge?.off("click",xe)}},[e._cropModeEnabled]),oe.useLayoutEffect(()=>{if(!r&&!e._cropModeEnabled)return Rs(a.current,e),$u(()=>{Rs(a.current,e)},{delay:100})},[x,r,E,A,e._cropModeEnabled]),oe.useLayoutEffect(()=>{var be;r||e._cropModeEnabled?(be=a.current)===null||be===void 0||be.clearCache():Rs(a.current,e)},[r,e.width,e.height,e._cropModeEnabled]),oe.useEffect(()=>{Rs(a.current,e)},[e.shadowEnabled,e.shadowBlur,e.cornerRadius,e.shadowColor,e.shadowOffsetX,e.shadowOffsetY,e.shadowOpacity]);const J=oe.useRef(null),K=oe.useRef(null),ie=oe.useRef(null);oe.useLayoutEffect(()=>{e._cropModeEnabled&&(K.current.nodes([J.current]),ie.current.nodes([o.current]))},[e._cropModeEnabled]);const fe=be=>{Math.round(be.target.x())>0&&(be.target.x(0),be.target.scaleX(1)),Math.round(be.target.y())>0&&(be.target.y(0),be.target.scaleY(1));const ge=be.target.width()*be.target.scaleX(),xe=be.target.height()*be.target.scaleY(),Te=Math.min(1,N/ge),Me=Math.min(1,$/xe),ve=1-Te,ye=Math.min(ve,Math.max(0,Math.round(-be.target.x())/ge)),we=1-Me,je=Math.min(we,Math.max(0,Math.round(-be.target.y())/xe));be.target.setAttrs({x:-ye*R,y:-je*I,scaleX:1,scaleY:1}),e.set({cropX:ye,cropY:je,cropWidth:Te,cropHeight:Me})},ue=()=>{e.type!=="svg"&&e.contentEditable&&setTimeout(()=>{e.toggleCropMode(!0)})},_e=m==="loading",Ce=m==="failed",$e=!_e&&!Ce,ze=oe.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),tt=$e?e.a.opacity:0;qp(a,tt);const pe=e.selectable||t.role==="admin",ut=Tf();return oe.createElement(oe.Fragment,null,oe.createElement(hr,{onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1)},_e&&oe.createElement(HN,{element:e}),Ce&&oe.createElement(GN,{element:e}),oe.createElement(ju,{ref:a,name:"element",id:e.id,image:X,x:e.a.x,y:e.a.y,width:e.a.width||1,height:e.a.height||1,rotation:e.a.rotation,opacity:tt,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:se,listening:pe,draggable:ut?e.draggable&&s:e.draggable,preventDefault:!ut||s,hideInExport:!e.showInExport,onDragMove:be=>{e.set({x:be.target.x(),y:be.target.y()})},onDragEnd:be=>{e.set({x:be.target.x(),y:be.target.y()})},onDblClick:ue,onDblTap:ue,onTransformStart:()=>{i(!0),ze.current={cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight}},onTransform:be=>{var ge;const xe=be.currentTarget,Te=Math.abs(xe.scaleX()-1)<1e-7?1:xe.scaleX(),Me=Math.abs(xe.scaleY()-1)<1e-7?1:xe.scaleY();xe.scaleX(1),xe.scaleY(1);const ve=(ge=be.target.getStage())===null||ge===void 0?void 0:ge.findOne("Transformer"),ye=1-N/R,we=Math.min(ye,Math.max(0,e.cropX)),je=1-$/I,Le=Math.min(je,Math.max(0,e.cropY)),Ye=ve.getActiveAnchor(),lt=!(Ye.indexOf("middle")>=0||Ye.indexOf("center")>=0),rt=!lt&&Te<1&&ze.current.cropHeight>$/I;let ot=lt?e.cropWidth:e.cropWidth*Te;rt&&(ot=e.cropWidth);const dt=!lt&&Me<1&&ze.current.cropWidth>N/R;let Ct=lt?e.cropHeight:e.cropHeight*Me;dt&&(Ct=e.cropHeight),te&&(ot=e.cropWidth,Ct=e.cropHeight),e.set({cropX:we,cropY:Le,x:xe.x(),y:xe.y(),width:xe.width()*Te,height:xe.height()*Me,rotation:be.target.rotation(),cropWidth:Math.min(ot,1-we),cropHeight:Math.min(Ct,1-Le)})},onTransformEnd:be=>{const ge=be.currentTarget;e.set({width:ge.width(),height:ge.height(),x:ge.x(),y:ge.y(),rotation:be.target.rotation(),cropWidth:N/R,cropHeight:$/I}),i(!1)}}),oe.createElement(Pr,{x:e.a.x,y:e.a.y,width:Math.max(e.a.width-e.borderSize,0),height:Math.max(e.a.height-e.borderSize,0),opacity:tt,offsetX:-e.borderSize/2,offsetY:-e.borderSize/2,stroke:e.borderColor,strokeWidth:e.borderSize,listening:!1,visible:!!e.borderSize,rotation:e.rotation,cornerRadius:Math.max(0,ee-e.borderSize),hideInExport:!e.showInExport}),!t.isPlaying&&oe.createElement(ju,{image:u?(g||ut)&&nx:tx,x:e.a.x,y:e.a.y,offsetX:-e.a.width/2+15/t.scale,offsetY:-e.a.height/2+15/t.scale,rotation:e.a.rotation,width:30/t.scale,height:30/t.scale,hideInExport:!0,onClick:()=>h(!u),onTap:()=>h(!u)}),e._cropModeEnabled&&oe.createElement(uy,{selector:".page-abs-container",enabled:!0},oe.createElement(Pr,{x:-window.innerWidth/t.scale,y:-window.innerWidth/t.scale,width:window.innerWidth/t.scale*3,height:window.innerWidth/t.scale*3,fill:"rgba(0,0,0,0.3)"}),oe.createElement(ju,{listening:!1,image:X,x:e.a.x,y:e.a.y,width:e.a.width,height:e.a.height,rotation:e.a.rotation,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur}),oe.createElement(hr,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,scaleX:Y,scaleY:Y},oe.createElement(ju,{image:x,ref:o,width:R,height:I,opacity:.4,draggable:!0,x:-e.cropX*R,y:-e.cropY*I,onDragMove:fe,onTransform:fe}),oe.createElement(kp,{ref:ie,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(be,ge)=>ge.width<5||ge.height<5?be:ge,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),oe.createElement(Pr,{width:N,height:$,ref:J,listening:!1,onTransform:be=>{be.target.x()<-e.cropX*R-1e-9&&(be.target.x(-e.cropX*R),be.target.scaleX(1)),be.target.y()<-e.cropY*I-1e-9&&(be.target.y(-e.cropY*I),be.target.scaleY(1));const ge=Math.min(1,Math.max(0,e.cropX+be.target.x()/R)),xe=Math.min(1,Math.max(0,be.target.y()/I+e.cropY)),Te=be.target.width()*be.target.scaleX(),Me=be.target.height()*be.target.scaleY(),ve=Math.min(1-ge,Te/R),ye=Math.min(1-xe,Me/I),we=be.target.getAbsolutePosition(be.target.getParent().getParent());be.target.scale({x:1,y:1}),be.target.position({x:0,y:0}),e.set({x:we.x,y:we.y,cropX:ge,cropY:xe,cropWidth:ve,cropHeight:ye,width:Math.min(Te*Y,R*(1-ge)*Y),height:Math.min(Me*Y,I*(1-xe)*Y)})}}),oe.createElement(kp,{ref:K,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(be,ge)=>ge.width<5||ge.height<5?be:ge,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2,visible:e.resizable})))))}),Ey=({width:e,height:t,cornerRadius:n})=>{if(n>0){const r=Math.min(n,e/2,t/2);return`M 0 ${r} A ${r} ${r} 0 0 1 ${r} 0 L ${e-r} 0 A ${r} ${r} 0 0 1 ${e} ${r} L ${e} ${t-r} A ${r} ${r} 0 0 1 ${e-r} ${t} L ${r} ${t} A ${r} ${r} 0 0 1 0 ${t-r} Z`}return`M 0 0 L ${e} 0 L ${e} ${t} L 0 ${t} Z`},YN=({width:e,height:t})=>`M ${e/2} 0 L ${e} ${t} L 0 ${t} Z`,XN=({width:e,height:t})=>`M 0 0 L ${e} 0 L 0 ${t} Z`,KN=({width:e,height:t})=>`M ${e/2} ${t/2} m -${e/2}, 0 a ${e/2},${t/2} 0 1,0 ${e},0 a ${e/2},${t/2} 0 1,0 -${e},0`;function ZN({width:e,height:t}){const n=e/2,r=t/2,i=e/2,a=t/2,o=i/2,s=a/2;let u="",h=Math.PI/5;for(let c=0;c<10;c++){const m=c%2==0?a:s,g=n+(c%2==0?i:o)*Math.sin(c*h),d=r-m*Math.cos(c*h);c===0?u=`M ${g} ${d}`:u+=` L ${g} ${d}`}return u+" Z"}function QN({width:e,height:t}){const n=e/2,r=t/2;return`M ${n} 0 L ${e} ${r} L ${n} ${t} L 0 ${r} Z`}function JN({width:e,height:t}){const n=e/2,r=t/2,i=e/2,a=t/2;let o="",s=2*Math.PI/5;for(let u=0;u<5;u++){const h=a,c=n+i*Math.sin(u*s),m=r-h*Math.cos(u*s);u===0?o=`M ${c} ${m}`:o+=` L ${c} ${m}`}return o+" Z"}function eT({width:e,height:t}){const n=e/2,r=t/2,i=e/2,a=t/2;let o="",s=2*Math.PI/6;for(let u=0;u<6;u++){const h=a,c=n+i*Math.sin(u*s),m=r-h*Math.cos(u*s);u===0?o=`M ${c} ${m}`:o+=` L ${c} ${m}`}return o+" Z"}function It({path:e,aspectRatio:t,width:n,height:r}){return{path:e,scaleX:n/t.width,scaleY:r/t.height}}function tT({width:e,height:t}){const n=.1*Math.min(e,t),r=.2*e,i=.2*t,a=.5*e;let o=`M ${n},0`;return o+=" H "+(e-n),o+=` A ${n},${n} 0 0 1 ${e},${n}`,o+=" V "+(t-n-i),o+=` A ${n},${n} 0 0 1 ${e-n},${t-i}`,o+=` H ${a+r/2}`,o+=` L ${a},${t}`,o+=` L ${a-r/2},${t-i}`,o+=` H ${n}`,o+=` A ${n},${n} 0 0 1 0,${t-n-i}`,o+=` V ${n}`,o+=` A ${n},${n} 0 0 1 ${n},0`,o+=" Z",o}function nT({width:e,height:t}){const n=.3*e,r=.3*t,i=e/2,a=t/2,o=i-n/2,s=i+n/2,u=a-r/2,h=a+r/2;let c=`M ${o},0 `;return c+=`H ${s} `,c+=`V ${u} `,c+=`H ${e} `,c+=`V ${h} `,c+=`H ${s} `,c+=`V ${t} `,c+=`H ${o} `,c+=`V ${h} `,c+="H 0 ",c+=`V ${u} `,c+=`H ${o} `,c+="V 0 ",c+="Z",c}const rT={rect:Ey,circle:KN,star:ZN,triangle:YN,rightTriangle:XN,diamond:QN,pentagon:JN,hexagon:eT,speechBubble:tT,cross:nT,arc:({width:e,height:t})=>It({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:e,height:t}),cloud:({width:e,height:t})=>It({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:e,height:t}),rightArrow:({width:e,height:t})=>{const n=.6*e;return`M 0 ${t/4} L ${n} ${t/4} L ${n} 0 L ${e} ${t/2} L ${n} ${t} L ${n} ${.75*t} L 0 ${.75*t} Z`},leftArrow:({width:e,height:t})=>{const n=.4*e;return`M ${e} ${t/4} L ${n} ${t/4} L ${n} 0 L 0 ${t/2} L ${n} ${t} L ${n} ${.75*t} L ${e} ${.75*t} Z`},downArrow:({width:e,height:t})=>{const n=.6*t;return`M ${e/4} 0 L ${e/4} ${n} L 0 ${n} L ${e/2} ${t} L ${e} ${n} L ${.75*e} ${n} L ${.75*e} 0 Z`},upArrow:({width:e,height:t})=>{const n=.4*t;return`M ${e/4} ${t} L ${e/4} ${n} L 0 ${n} L ${e/2} 0 L ${e} ${n} L ${.75*e} ${n} L ${.75*e} ${t} Z`},asterisk1:({width:e,height:t})=>It({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:e,height:t}),asterisk2:({width:e,height:t})=>It({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:e,height:t}),bookmark:({width:e,height:t})=>It({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:e,height:t}),butterfly:({width:e,height:t})=>It({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:e,height:t}),cylinder:({width:e,height:t})=>It({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:e,height:t}),diamond2:({width:e,height:t})=>It({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:e,height:t}),door:({width:e,height:t})=>It({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:e,height:t}),drop1:({width:e,height:t})=>It({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:e,height:t}),drop2:({width:e,height:t})=>It({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:e,height:t}),explosion:({width:e,height:t})=>It({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:e,height:t}),flag:({width:e,height:t})=>It({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:e,height:t}),flower:({width:e,height:t})=>It({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:e,height:t}),frame:({width:e,height:t})=>It({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:e,height:t}),heart1:({width:e,height:t})=>It({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:e,height:t}),home:({width:e,height:t})=>It({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:e,height:t}),home2:({width:e,height:t})=>It({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:e,height:t}),hourglass:({width:e,height:t})=>It({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:e,height:t}),house:({width:e,height:t})=>It({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:e,height:t}),keyhole:({width:e,height:t})=>It({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:e,height:t}),kiss:({width:e,height:t})=>It({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:e,height:t}),leaf:({width:e,height:t})=>It({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:e,height:t}),lightning1:({width:e,height:t})=>It({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:e,height:t}),lightning2:({width:e,height:t})=>It({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:e,height:t}),magnet:({width:e,height:t})=>It({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:e,height:t}),mithosis:({width:e,height:t})=>It({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:e,height:t}),orangeRicky:({width:e,height:t})=>It({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:e,height:t}),party:({width:e,height:t})=>It({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:e,height:t}),pillow:({width:e,height:t})=>It({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:e,height:t}),polygon:({width:e,height:t})=>It({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:e,height:t}),rainbow:({width:e,height:t})=>It({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:e,height:t}),rhodeIsland:({width:e,height:t})=>It({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:e,height:t}),shell:({width:e,height:t})=>It({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:e,height:t}),shield1:({width:e,height:t})=>It({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:e,height:t}),shield2:({width:e,height:t})=>It({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:e,height:t}),skewedRectangle:({width:e,height:t})=>It({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:e,height:t}),softFlower:({width:e,height:t})=>It({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:e,height:t}),softStar:({width:e,height:t})=>It({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:e,height:t}),stairs1:({width:e,height:t})=>It({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:e,height:t}),stairs2:({width:e,height:t})=>It({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:e,height:t}),teewee:({width:e,height:t})=>It({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:e,height:t}),blob1:({width:e,height:t})=>It({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:e,height:t}),blob10:({width:e,height:t})=>It({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:e,height:t}),blob11:({width:e,height:t})=>It({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:e,height:t}),blob12:({width:e,height:t})=>It({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:e,height:t}),blob13:({width:e,height:t})=>It({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:e,height:t}),blob14:({width:e,height:t})=>It({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:e,height:t}),blob15:({width:e,height:t})=>It({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:e,height:t}),blob16:({width:e,height:t})=>It({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:e,height:t}),blob17:({width:e,height:t})=>It({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:e,height:t}),blob18:({width:e,height:t})=>It({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:e,height:t}),blob19:({width:e,height:t})=>It({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:e,height:t}),blob2:({width:e,height:t})=>It({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:e,height:t}),blob20:({width:e,height:t})=>It({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:e,height:t}),blob21:({width:e,height:t})=>It({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:e,height:t}),blob22:({width:e,height:t})=>It({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:e,height:t}),blob23:({width:e,height:t})=>It({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:e,height:t}),blob24:({width:e,height:t})=>It({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:e,height:t}),blob25:({width:e,height:t})=>It({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:e,height:t}),blob26:({width:e,height:t})=>It({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:e,height:t}),blob27:({width:e,height:t})=>It({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:e,height:t}),blob28:({width:e,height:t})=>It({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:e,height:t}),blob29:({width:e,height:t})=>It({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:e,height:t}),blob3:({width:e,height:t})=>It({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:e,height:t}),blob30:({width:e,height:t})=>It({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:e,height:t}),blob31:({width:e,height:t})=>It({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:e,height:t}),blob32:({width:e,height:t})=>It({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:e,height:t}),blob4:({width:e,height:t})=>It({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:e,height:t}),blob5:({width:e,height:t})=>It({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:e,height:t}),blob6:({width:e,height:t})=>It({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:e,height:t}),blob7:({width:e,height:t})=>It({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:e,height:t}),blob8:({width:e,height:t})=>It({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:e,height:t}),blob9:({width:e,height:t})=>It({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:e,height:t})};function ix(e){return rT[e]||Ey}function ax(e){const{subType:t}=e,n=ix(t);return n?(function(r,i){const{width:a,height:o,fill:s,stroke:u,strokeWidth:h,dash:c}=r,m=(c||[]).map(x=>x*h);let g=i(r),d=1,y=1;typeof g!="string"&&(d=g.scaleX,y=g.scaleY,g=g.path);const _=`clip-${r.id||Math.random()}`;return`
|
|
270
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${o}">
|
|
271
|
+
<defs>
|
|
272
|
+
<clipPath id="${_}">
|
|
273
|
+
<path d="${g}" />
|
|
274
|
+
</clipPath>
|
|
275
|
+
</defs>
|
|
276
|
+
|
|
277
|
+
<!-- Path for the fill -->
|
|
278
|
+
<path d="${g}" fill="${s}" transform="scale(${d}, ${y})"/>
|
|
279
|
+
|
|
280
|
+
<!-- Path for the stroke, clipped by the star path -->
|
|
281
|
+
<path d="${g}" fill="none" stroke="${u}" stroke-width="${2*h}" clip-path="url(#${_})" transform="scale(${d}, ${y})" stroke-dasharray="${m.join(" ")}"/>
|
|
282
|
+
</svg>
|
|
283
|
+
`})(e,n):(console.error(`Polotno error: Can not convert ${e.subType} figure to svg.`),Ey(e))}const ym={},iT=Qr(({element:e,store:t})=>{const n=oe.useRef(null),r=e.selectable||t.role==="admin",i=Tf(),a=t.selectedShapes.indexOf(e)>=0&&e.selectable,o=Math.min(e.strokeWidth,e.width/2,e.height/2),s=Math.max(0,Math.min(e.width/2,e.height/2,e.cornerRadius)),u=Gu(e,e.a.fill,"fill"),h=Object.assign(Object.assign({width:e.a.width,height:e.a.height},u),{cornerRadius:s,opacity:e.animated("opacity"),shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,preventDefault:!i||a,hideInExport:!e.showInExport}),c=Gu(e,e.stroke,"stroke"),m=Object.assign(Object.assign({visible:o>0,x:o/2,y:o/2,width:e.a.width-o,height:e.a.height-o},c),{strokeWidth:o,cornerRadius:Math.max(0,s-o),dash:e.dash.map(_=>_*o),opacity:e.animated("opacity"),hideInExport:!e.showInExport,listening:!1}),g=(d=e.subType,ym[d]||(ym[d]=(y=ix(d),Qr(({element:_,fillProps:x,strokeProps:b})=>{let S=y({width:_.a.width,height:_.a.height,cornerRadius:_.cornerRadius}),k=1,E=1;typeof S!="string"&&(k=S.scaleX,E=S.scaleY,S=S.path);const A=oe.useRef(null);return oe.createElement(oe.Fragment,null,oe.createElement(Pr,{width:_.width,height:_.height,fill:"transparent"}),oe.createElement(Ep,Object.assign({},x,{ref:A,data:S,scaleX:k,scaleY:E})),oe.createElement(hr,{clipFunc:R=>{const O=A.current;if(O){var I=O.dataArray;R.beginPath();for(var j=0;j<I.length;j++){var D=I[j].command,C=I[j].points;switch(D){case"L":R.lineTo(C[0],C[1]);break;case"M":R.moveTo(C[0],C[1]);break;case"C":R.bezierCurveTo(C[0],C[1],C[2],C[3],C[4],C[5]);break;case"Q":R.quadraticCurveTo(C[0],C[1],C[2],C[3]);break;case"A":var N=C[0],$=C[1],G=C[2],te=C[3],se=C[4],ee=C[5],Q=C[6],re=C[7],X=G>te?G:te,B=G>te?1:G/te,F=G>te?te/G:1;R.translate(N,$),R.rotate(Q),R.scale(B,F),R.arc(0,0,X,se,se+ee,1-re),R.scale(1/B,1/F),R.rotate(-Q),R.translate(-N,-$);break;case"z":R.closePath()}}}},scaleX:k,scaleY:E},oe.createElement(Ep,Object.assign({},b,{x:0,y:0,data:S,strokeWidth:2*b.strokeWidth,dash:b.dash.map(R=>R)}))))}))),ym[d]||hr);var d,y;return oe.createElement(oe.Fragment,null,oe.createElement(hr,{ref:n,id:e.id,x:e.a.x,y:e.a.y,rotation:e.a.rotation,opacity:e.a.opacity,listening:r,draggable:i?e.draggable&&a:e.draggable,name:"element",onDragMove:_=>{e.set({x:_.target.x(),y:_.target.y()})},onDragEnd:_=>{e.set({x:_.target.x(),y:_.target.y()})},onTransform:_=>{const x=_.target.scale();_.target.scaleX(1),_.target.scaleY(1),e.set({width:e.width*x.x,height:e.height*x.y,x:_.target.x(),y:_.target.y(),rotation:_.target.rotation()})}},oe.createElement(g,{element:e,fillProps:h,strokeProps:m})))});var lc={},bm={},uc={},w4;function ox(){if(w4)return uc;w4=1,Object.defineProperty(uc,"__esModule",{value:!0}),uc.loop=uc.conditional=uc.parse=void 0;var e=function r(i,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:o;if(Array.isArray(a))a.forEach(function(h){return r(i,h,o,s)});else if(typeof a=="function")a(i,o,s,r);else{var u=Object.keys(a)[0];Array.isArray(a[u])?(s[u]={},r(i,a[u],o,s[u])):s[u]=a[u](i,o,s,r)}return o};uc.parse=e;var t=function(i,a){return function(o,s,u,h){a(o,s,u)&&h(o,i,s,u)}};uc.conditional=t;var n=function(i,a){return function(o,s,u,h){for(var c=[],m=o.pos;a(o,s,u);){var g={};if(h(o,i,s,g),o.pos===m)break;m=o.pos,c.push(g)}return c}};return uc.loop=n,uc}var ia={},x4;function sx(){if(x4)return ia;x4=1,Object.defineProperty(ia,"__esModule",{value:!0}),ia.readBits=ia.readArray=ia.readUnsigned=ia.readString=ia.peekBytes=ia.readBytes=ia.peekByte=ia.readByte=ia.buildStream=void 0;var e=function(m){return{data:m,pos:0}};ia.buildStream=e;var t=function(){return function(m){return m.data[m.pos++]}};ia.readByte=t;var n=function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(g){return g.data[g.pos+m]}};ia.peekByte=n;var r=function(m){return function(g){return g.data.subarray(g.pos,g.pos+=m)}};ia.readBytes=r;var i=function(m){return function(g){return g.data.subarray(g.pos,g.pos+m)}};ia.peekBytes=i;var a=function(m){return function(g){return Array.from(r(m)(g)).map(function(d){return String.fromCharCode(d)}).join("")}};ia.readString=a;var o=function(m){return function(g){var d=r(2)(g);return m?(d[1]<<8)+d[0]:(d[0]<<8)+d[1]}};ia.readUnsigned=o;var s=function(m,g){return function(d,y,_){for(var x=typeof g=="function"?g(d,y,_):g,b=r(m),S=new Array(x),k=0;k<x;k++)S[k]=b(d);return S}};ia.readArray=s;var u=function(m,g,d){for(var y=0,_=0;_<d;_++)y+=m[g+_]&&Math.pow(2,d-_-1);return y},h=function(m){return function(g){for(var d=t()(g),y=new Array(8),_=0;_<8;_++)y[7-_]=!!(d&1<<_);return Object.keys(m).reduce(function(x,b){var S=m[b];return S.length?x[b]=u(y,S.index,S.length):x[b]=y[S.index],x},{})}};return ia.readBits=h,ia}var _4;function aT(){return _4||(_4=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=ox(),n=sx(),r={blocks:function(g){for(var d=0,y=[],_=g.data.length,x=0,b=(0,n.readByte)()(g);b!==d&&b;b=(0,n.readByte)()(g)){if(g.pos+b>=_){var S=_-g.pos;y.push((0,n.readBytes)(S)(g)),x+=S;break}y.push((0,n.readBytes)(b)(g)),x+=b}for(var k=new Uint8Array(x),E=0,A=0;A<y.length;A++)k.set(y[A],E),E+=y[A].length;return k}},i=(0,t.conditional)({gce:[{codes:(0,n.readBytes)(2)},{byteSize:(0,n.readByte)()},{extras:(0,n.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,n.readUnsigned)(!0)},{transparentColorIndex:(0,n.readByte)()},{terminator:(0,n.readByte)()}]},function(m){var g=(0,n.peekBytes)(2)(m);return g[0]===33&&g[1]===249}),a=(0,t.conditional)({image:[{code:(0,n.readByte)()},{descriptor:[{left:(0,n.readUnsigned)(!0)},{top:(0,n.readUnsigned)(!0)},{width:(0,n.readUnsigned)(!0)},{height:(0,n.readUnsigned)(!0)},{lct:(0,n.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,t.conditional)({lct:(0,n.readArray)(3,function(m,g,d){return Math.pow(2,d.descriptor.lct.size+1)})},function(m,g,d){return d.descriptor.lct.exists}),{data:[{minCodeSize:(0,n.readByte)()},r]}]},function(m){return(0,n.peekByte)()(m)===44}),o=(0,t.conditional)({text:[{codes:(0,n.readBytes)(2)},{blockSize:(0,n.readByte)()},{preData:function(g,d,y){return(0,n.readBytes)(y.text.blockSize)(g)}},r]},function(m){var g=(0,n.peekBytes)(2)(m);return g[0]===33&&g[1]===1}),s=(0,t.conditional)({application:[{codes:(0,n.readBytes)(2)},{blockSize:(0,n.readByte)()},{id:function(g,d,y){return(0,n.readString)(y.blockSize)(g)}},r]},function(m){var g=(0,n.peekBytes)(2)(m);return g[0]===33&&g[1]===255}),u=(0,t.conditional)({comment:[{codes:(0,n.readBytes)(2)},r]},function(m){var g=(0,n.peekBytes)(2)(m);return g[0]===33&&g[1]===254}),h=[{header:[{signature:(0,n.readString)(3)},{version:(0,n.readString)(3)}]},{lsd:[{width:(0,n.readUnsigned)(!0)},{height:(0,n.readUnsigned)(!0)},{gct:(0,n.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,n.readByte)()},{pixelAspectRatio:(0,n.readByte)()}]},(0,t.conditional)({gct:(0,n.readArray)(3,function(m,g){return Math.pow(2,g.lsd.gct.size+1)})},function(m,g){return g.lsd.gct.exists}),{frames:(0,t.loop)([i,s,u,a,o],function(m){var g=(0,n.peekByte)()(m);return g===33||g===44})}],c=h;e.default=c})(bm)),bm}var Yd={},S4;function oT(){if(S4)return Yd;S4=1,Object.defineProperty(Yd,"__esModule",{value:!0}),Yd.deinterlace=void 0;var e=function(n,r){for(var i=new Array(n.length),a=n.length/r,o=function(d,y){var _=n.slice(y*r,(y+1)*r);i.splice.apply(i,[d*r,r].concat(_))},s=[0,4,2,1],u=[8,8,4,2],h=0,c=0;c<4;c++)for(var m=s[c];m<a;m+=u[c])o(m,h),h++;return i};return Yd.deinterlace=e,Yd}var Xd={},E4;function sT(){if(E4)return Xd;E4=1,Object.defineProperty(Xd,"__esModule",{value:!0}),Xd.lzw=void 0;var e=function(n,r,i){var a=4096,o=-1,s=i,u,h,c,m,g,d,y,O,_,x,R,b,I,j,C,D,S=new Array(i),k=new Array(a),E=new Array(a),A=new Array(a+1);for(b=n,h=1<<b,g=h+1,u=h+2,y=o,m=b+1,c=(1<<m)-1,_=0;_<h;_++)k[_]=0,E[_]=_;var R,O,I,j,D,C;for(R=O=I=j=D=C=0,x=0;x<s;){if(j===0){if(O<m){R+=r[C]<<O,O+=8,C++;continue}if(_=R&c,R>>=m,O-=m,_>u||_==g)break;if(_==h){m=b+1,c=(1<<m)-1,u=h+2,y=o;continue}if(y==o){A[j++]=E[_],y=_,I=_;continue}for(d=_,_==u&&(A[j++]=I,_=y);_>h;)A[j++]=E[_],_=k[_];I=E[_]&255,A[j++]=I,u<a&&(k[u]=y,E[u]=I,u++,(u&c)===0&&u<a&&(m++,c+=u)),y=d}j--,S[D++]=A[j],x++}for(x=D;x<s;x++)S[x]=0;return S};return Xd.lzw=e,Xd}var k4;function lT(){if(k4)return lc;k4=1,Object.defineProperty(lc,"__esModule",{value:!0}),lc.decompressFrames=lc.decompressFrame=lc.parseGIF=void 0;var e=a(aT()),t=ox(),n=sx(),r=oT(),i=sT();function a(c){return c&&c.__esModule?c:{default:c}}var o=function(m){var g=new Uint8Array(m);return(0,t.parse)((0,n.buildStream)(g),e.default)};lc.parseGIF=o;var s=function(m){for(var g=m.pixels.length,d=new Uint8ClampedArray(g*4),y=0;y<g;y++){var _=y*4,x=m.pixels[y],b=m.colorTable[x]||[0,0,0];d[_]=b[0],d[_+1]=b[1],d[_+2]=b[2],d[_+3]=x!==m.transparentIndex?255:0}return d},u=function(m,g,d){if(!m.image){console.warn("gif frame does not have associated image.");return}var y=m.image,_=y.descriptor.width*y.descriptor.height,x=(0,i.lzw)(y.data.minCodeSize,y.data.blocks,_);y.descriptor.lct.interlaced&&(x=(0,r.deinterlace)(x,y.descriptor.width));var b={pixels:x,dims:{top:m.image.descriptor.top,left:m.image.descriptor.left,width:m.image.descriptor.width,height:m.image.descriptor.height}};return y.descriptor.lct&&y.descriptor.lct.exists?b.colorTable=y.lct:b.colorTable=g,m.gce&&(b.delay=(m.gce.delay||10)*10,b.disposalType=m.gce.extras.disposal,m.gce.extras.transparentColorGiven&&(b.transparentIndex=m.gce.transparentColorIndex)),d&&(b.patch=s(b)),b};lc.decompressFrame=u;var h=function(m,g){return m.frames.filter(function(d){return d.image}).map(function(d){return u(d,m.gct,g)})};return lc.decompressFrames=h,lc}var A4=lT();function wm(e,t,n){const r=t.getContext("2d"),i=n.getContext("2d");if(!r||!i)return;e.disposalType===2&&r.clearRect(0,0,t.width,t.height),n.width=e.width,n.height=e.height;const a=i.createImageData(e.width,e.height);a.data.set(e.patch),i.putImageData(a,0,0),r.drawImage(n,e.left,e.top)}const uT=Qr(({element:e})=>{const t=Math.min(30,e.width/4,e.height/4),n=oe.useRef(null);return oe.useEffect(()=>{const r=n.current;if(!r)return;const i=new un.Animation(a=>{r.rotate((a?.timeDiff||0)/2)},r.getLayer());return i.start(),()=>{i.stop()}},[]),oe.createElement(hr,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},oe.createElement(Pr,{width:e.width,height:e.height,fill:"rgba(124, 173, 212, 0.8)"}),oe.createElement(sy,{ref:n,x:e.width/2,y:e.height/2,fill:"white",outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270}))}),cT=Qr(({element:e})=>{const t=Math.max(10,Math.min(30,e.width/22));return oe.createElement(hr,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},oe.createElement(Pr,{width:e.width,height:e.height,fill:"rgba(223, 102, 102, 0.8)"}),oe.createElement(Uu,{text:"Cannot load the GIF...",fontSize:t,width:e.width,height:e.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))}),fT=Qr(({element:e,store:t})=>{var n;const[r,i]=oe.useState(!1),a=t.selectedShapes.indexOf(e)>=0&&e.selectable,o=oe.useRef(null),s=oe.useRef(),[u,h,c,m]=(function(j){const[D,C]=oe.useState([]),[N,$]=oe.useState(0),[G,te]=oe.useState("loading"),[se,ee]=oe.useState({width:0,height:0});return oe.useEffect(()=>{(async()=>{try{const Q=await fetch(j),re=await Q.arrayBuffer(),X=A4.parseGIF(re),B=A4.decompressFrames(X,!0),F=X.lsd.width,z=X.lsd.height;ee({width:F,height:z});const Y=B.map(K=>({patch:new Uint8ClampedArray(K.patch),delay:K.delay,width:K.dims.width,height:K.dims.height,left:K.dims.left,top:K.dims.top,disposalType:K.disposalType})),J=Y.reduce((K,ie)=>K+ie.delay,0);C(Y),$(J),te("loaded")}catch(Q){console.error("Failed to load GIF:",Q),te("failed")}})()},[j]),[D,N,se,G]})(e.src);mp(m,e.src,e.id),oe.useEffect(()=>(s.current=document.createElement("canvas"),()=>{s.current&&un.Util.releaseCanvas(s.current)}),[]),oe.useEffect(()=>{if(m==="loaded"&&s.current&&(s.current.width=c.width,s.current.height=c.height,u.length>0)){const j=s.current.getContext("2d");if(j){j.clearRect(0,0,c.width,c.height);const D=document.createElement("canvas");wm(u[0],s.current,D)}}},[c,m,u]),oe.useEffect(()=>{if(!u.length||!s.current)return;const j=s.current;j.width=c.width,j.height=c.height;const D=document.createElement("canvas"),C=j.getContext("2d");C&&C.clearRect(0,0,j.width,j.height);let N=-1;wm(u[0],j,D),k(),N=0;const $=G=>{const te=(se=>{const ee=se%h;let Q=0;for(let re=0;re<u.length;re++)if(Q+=u[re].delay,Q>ee)return re;return 0})(G);te!==N&&(wm(u[te],j,D),k(),o.current.getLayer().draw(),N=te)};if(t.isPlaying||e.page._exportingOrRendering)return $u(()=>{$(t.currentTime-e.page.startTime)});{const G=window.setInterval(()=>{$(t.currentTime||performance.now())},16);return()=>{clearInterval(G)}}},[t.isPlaying,u,h,e.page._exportingOrRendering]),oe.useEffect(()=>{h&&t.history.ignore(()=>{e.set({duration:h})})},[h]);let{cropX:g,cropY:d,cropWidth:y,cropHeight:_}=e;m!=="loaded"&&(g=d=0,y=_=1);const x={x:c.width*g,y:c.height*d,width:c.width*y,height:c.height*_},b=(n=e.cornerRadius)!==null&&n!==void 0?n:0,[S,k]=rx(e,s.current,x,t._elementsPixelRatio,b,r||e._cropModeEnabled);oe.useLayoutEffect(()=>{if(!r&&!e._cropModeEnabled&&o.current)return Rs(o.current,e),$u(()=>{Rs(o.current,e)},{delay:100})},[s.current,r,y,_,e._cropModeEnabled,c.width,c.height]);const E=m==="loading",A=m==="failed",R=E||A?0:e.a.opacity;qp(o,R);const O=e.selectable||t.role==="admin",I=Tf();return oe.createElement(oe.Fragment,null,E&&oe.createElement(uT,{element:e}),A&&oe.createElement(cT,{element:e}),oe.createElement(ju,{ref:o,name:"element",id:e.id,image:S,x:e.a.x,y:e.a.y,width:e.a.width||1,height:e.a.height||1,rotation:e.a.rotation,opacity:R,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:x,listening:O,draggable:I?e.draggable&&a:e.draggable,preventDefault:!I||a,hideInExport:!e.showInExport,onDragMove:j=>{e.set({x:j.target.x(),y:j.target.y()})},onDragEnd:j=>{e.set({x:j.target.x(),y:j.target.y()})},onTransformStart:()=>i(!0),onTransform:j=>{const D=j.currentTarget,C=Math.abs(D.scaleX()-1)<1e-7?1:D.scaleX(),N=Math.abs(D.scaleY()-1)<1e-7?1:D.scaleY();D.scaleX(1),D.scaleY(1),e.set({x:D.x(),y:D.y(),width:D.width()*C,height:D.height()*N,rotation:D.rotation()})},onTransformEnd:()=>i(!1)}),oe.createElement(Pr,{x:e.a.x,y:e.a.y,width:Math.max(e.a.width-e.borderSize,0),height:Math.max(e.a.height-e.borderSize,0),opacity:R,offsetX:-e.borderSize/2,offsetY:-e.borderSize/2,stroke:e.borderColor,strokeWidth:e.borderSize,listening:!1,visible:!!e.borderSize,rotation:e.rotation,cornerRadius:Math.max(0,b-e.borderSize),hideInExport:!e.showInExport}))}),hT={stroke:"rgb(0, 161, 255)",strokeWidth:2},dT=Qr(({element:e})=>oe.createElement(Pr,Object.assign({name:"highlighter",x:e.a.x,y:e.a.y,rotation:e.a.rotation,width:e.a.width,height:e.a.height,listening:!1,strokeScaleEnabled:!1},hT)));let Ll=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const vp=function(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!=Object.keys(t).length)return!1;for(var n in e)if(!t.hasOwnProperty(n)||!vp(e[n],t[n]))return!1;return!0}return!1};Object.assign(Dt);const pT=Dt.model("UndoManager",{history:Dt.array(Dt.frozen()),undoIdx:-1,targetPath:""}).views(e=>({get canUndo(){return e.undoIdx>0},get canRedo(){return e.undoIdx<e.history.length-1}})).actions(e=>{let t,n,r=!1,i=null,a=0,o=0;const s=()=>o>0;function u(){const c=bc(t);return{pages:c.pages,width:c.width,height:c.height,custom:c.custom,audios:c.audios}}function h(c){const m=t.pages.map(_=>_.id),g=c.pages.map(_=>_.id),d=!vp(m,g),y=!vp(t.custom,c.custom);d?Ev(t.pages,c.pages):t.pages.forEach((_,x)=>{Ev(_,c.pages[x])}),y&&t.set({custom:c.custom}),t.setSize(c.width,c.height)}return{startTransaction(){o++},endTransaction(c){o--,c||this.requestAddState(u())},async ignore(c,m=!1,g=!1){g&&await new Promise(b=>setTimeout(b,10)),a&&e.addUndoState();let d=s();e.startTransaction();let y=o;try{await c()}catch(b){setTimeout(()=>{throw b})}const _=y!==o,x=!_;e.endTransaction(x),m||d||e.replaceState(),_||(clearTimeout(a),a=0)},async transaction(c){await e.ignore(c,!0),this.addUndoState()},requestAddState(c){i=c,a||s()||(r?r=!1:a=setTimeout(()=>{a=0,clearTimeout(a),s()||this.addUndoState()},100))},addUndoState(){if(r)return void(r=!1);const c=e.history[e.undoIdx];!vp(i,c)&&(clearTimeout(a),a=0,e.history.splice(e.undoIdx+1),e.history.push(i),e.undoIdx=e.history.length-1)},afterCreate(){if(t=OO(e,".."),!t)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");n=r7(t,()=>{this.requestAddState(u())}),e.history.length===0&&this.requestAddState(u())},clear(){clearTimeout(a),a=0,e.history.splice(0,e.history.length),e.undoIdx=-1,e.addUndoState(u())},beforeDestroy(){n()},undo(){a&&this.addUndoState(),s()?h(e.history[e.undoIdx]):e.canUndo?(e.undoIdx--,r=!0,h(e.history[e.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){a&&this.addUndoState(),e.canRedo?(e.undoIdx++,r=!0,h(e.history[e.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){e.history[e.undoIdx]=u()}}});async function U1(e,t){const n=await(await fetch(e)).blob(),r=document.createElement("a"),i=URL.createObjectURL(n);r.href=i,r.download=t,document.body.appendChild(r),r.click(),setTimeout(function(){document.body.removeChild(r),window.URL.revokeObjectURL(i)},0)}let xm=null;function gT(){var e;return!((e=window.jspdf)===null||e===void 0)&&e.jsPDF?Promise.resolve(window.jspdf.jsPDF):xm||(xm=new Promise(t=>{var n=document.createElement("script");n.onload=function(){t(window.jspdf.jsPDF)},n.src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/3.0.1/jspdf.umd.min.js",document.head.appendChild(n)}),xm)}function mT(){return window.GIF?Promise.resolve(window.GIF):new Promise(e=>{var t=document.createElement("script");t.onload=function(){e(window.GIF)},t.src="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js",document.head.appendChild(t)})}async function vT({width:e,height:t}){return new(await mT())({workers:4,width:e,height:t,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
|
|
284
|
+
(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]);
|
|
285
|
+
`],{type:"application/javascript"}))})}const yT="https://api.polotno.com",bT=()=>yT+"/api",lx=Qn({value:!1}),ux=Qn({value:"v1"}),wT=()=>ux.value,xT=()=>lx.value,_T=Un(()=>{lx.value=!0});let op=typeof window<"u"?window.location.origin:"";const ST=typeof navigator<"u"&&navigator.userAgent.indexOf("Headless")>-1,ET=typeof navigator<"u"&&navigator.userAgent.indexOf("Electron")>-1;op==="file://"&&ST&&(op="headless"),op==="file://"&&ET&&(op="electron");const kT=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${op}" here: https://polotno.com/cabinet`;let AT=fetch;async function PT(e){for(let t=0;t<5;t++)try{const n=await AT(bT()+"/validate-key",{method:"POST",body:JSON.stringify({key:e,site:location.host,skdVersion:"2.34.0"})});if(mc(()=>{ux.value=n.headers.get("x-api-version")}),!e)return console.warn("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"),!1;if(n.status!==200){await new Promise(i=>setTimeout(i,3e3));continue}const r=await n.json();return r.is_valid||console.warn("Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet"),r.is_paid||console.log("%cPolotno Free Version. For development usage only. https://polotno.com/","background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),r.is_domain_valid||console.log(kT,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),Q8(r.remove_background_enabled),r.is_paid||!1}catch{await new Promise(r=>setTimeout(r,3e3))}return console.error("Can not validate Polotno API key. Please report to anton@polotno.com immediately."),!0}async function OT(e,t){await PT(e)&&!t||_T()}const _m=[112,72,89,115],CT=(()=>{const e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let r=0;r<8;r++)n=1&n?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return e})(),P4=()=>typeof globalThis<"u"?globalThis.Buffer:void 0,O4=(e,t,n)=>{e[t]=n>>>24&255,e[t+1]=n>>>16&255,e[t+2]=n>>>8&255,e[t+3]=255&n},LT=(e,t,n)=>{const r=e.indexOf(","),i=(o=>{if(typeof atob=="function"){const u=atob(o),h=new Uint8Array(u.length);for(let c=0;c<u.length;c++)h[c]=u.charCodeAt(c);return h}const s=P4();if(s)return new Uint8Array(s.from(o,"base64"));throw new Error("No base64 decoder available")})(r>=0?e.slice(r+1):e),a=t==="image/png"?((o,s)=>{const u=(g=>{const d=new Uint8Array(9),y=new DataView(d.buffer);y.setUint32(0,g,!1),y.setUint32(4,g,!1),d[8]=1;const _=new Uint8Array(8+d.length+4);O4(_,0,d.length),_.set(_m,4),_.set(d,8);const x=new Uint8Array(4+d.length);return x.set(_m,0),x.set(d,4),O4(_,8+d.length,(b=>{let S=4294967295;for(let k=0;k<b.length;k++)S=CT[255&(S^b[k])]^S>>>8;return(4294967295^S)>>>0})(x)),_})(Math.round(s/.0254)),h=((g,d)=>{let y=8;for(;y+8<=g.length;){const _=g[y]<<24|g[y+1]<<16|g[y+2]<<8|g[y+3],x=y+4,b=g.subarray(x,x+4),S=8+_+4;if(d.every((k,E)=>b[E]===k))return{offset:y,totalLength:S};y+=S}return null})(o,_m);if(h){const g=new Uint8Array(o.length-h.totalLength+u.length);return g.set(o.slice(0,h.offset),0),g.set(u,h.offset),g.set(o.slice(h.offset+h.totalLength),h.offset+u.length),g}const c=16+(o[8]<<24|o[9]<<16|o[10]<<8|o[11])+4;if(c>o.length)return o;const m=new Uint8Array(o.length+u.length);return m.set(o.slice(0,c),0),m.set(u,c),m.set(o.slice(c),c+u.length),m})(i,n):((o,s)=>{const u=(m=>{let g=2;for(;g+4<m.length;){if(m[g]!==255)return-1;const d=m[g+1];if(d===216||d===217){g+=2;continue}const y=m[g+2]<<8|m[g+3];if(y<2)return-1;if(d===224&&m[g+4]===74&&m[g+5]===70&&m[g+6]===73&&m[g+7]===70&&m[g+8]===0)return g;const _=g+2+y;if(_<=g||_>m.length)return-1;g=_}return-1})(o);if(u>=0){const m=new Uint8Array(o),g=u+9;return m[g]=1,m[g+1]=s>>8&255,m[g+2]=255&s,m[g+3]=s>>8&255,m[g+4]=255&s,m}const h=(m=>{const g=new Uint8Array(18);return g[0]=255,g[1]=224,g[2]=0,g[3]=16,g[4]=74,g[5]=70,g[6]=73,g[7]=70,g[8]=0,g[9]=1,g[10]=1,g[11]=1,g[12]=m>>8&255,g[13]=255&m,g[14]=m>>8&255,g[15]=255&m,g})(s),c=new Uint8Array(o.length+h.length);return c.set(o.subarray(0,2),0),c.set(h,2),c.set(o.subarray(2),2+h.length),c})(i,n);return`data:${t};base64,${(o=>{if(typeof btoa=="function"){let u="";for(let h=0;h<o.length;h++)u+=String.fromCharCode(o[h]);return btoa(u)}const s=P4();if(s)return s.from(o).toString("base64");throw new Error("No base64 encoder available")})(a)}`},ag=({px:e,unit:t="px",dpi:n})=>{switch(t){case"pt":default:return e;case"mm":return e/(n/25.4);case"cm":return e/(n/2.54);case"in":return e/n}},C4=({px:e,precious:t=2,dpi:n=72,unit:r="px"})=>parseFloat(ag({px:e,dpi:n,unit:r}).toFixed(t)),L4=({unitVal:e,dpi:t,unit:n})=>e/ag({px:1,unit:n,dpi:t}),NT=e=>{const t=parseFloat(ag(e).toFixed(1));switch(e.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`}};async function TT(e){for(let t=0;t<30;t++){const n=await e();if(n)return n;await new Promise(r=>setTimeout(r,50))}}function Wp(e){return new Promise((t,n)=>{const r=document.createElement("img");r.onload=()=>{t(r)},r.onerror=i=>{n(i)},r.crossOrigin="anonymous",r.src=e})}async function RT(e,t){const n=await Wp(e),r=document.createElement("canvas");r.width=2*n.width,r.height=2*n.height,r.getContext("2d").drawImage(n,0,0,r.width,r.height);const i=document.createElement("canvas");i.width=t.width,i.height=t.height;const a=i.getContext("2d");let{cropX:o,cropY:s}=t;const u=r.width*t.cropWidth,h=r.height*t.cropHeight,c=t.width/t.height;let m,g;const d=u/h;return t.type==="svg"?(m=u,g=h):c>=d?(m=u,g=u/c):(m=h*c,g=h),a.drawImage(r,o*r.width,s*r.height,m,g,0,0,i.width,i.height),i.toDataURL("image/png")}function cx(e,t){const{width:n,height:r}=e,i=n/r;let a,o;i>=t.width/t.height?(a=t.width,o=t.width/i):(a=t.height*i,o=t.height);const s=(t.width-a)/2,u=(t.height-o)/2;return{cropX:s/t.width,cropY:u/t.height,cropWidth:a/t.width,cropHeight:o/t.height}}var il;(function(e){e.sepia="sepia",e.grayscale="grayscale",e.natural="natural",e.warm="warm",e.cold="cold",e.temperature="temperature",e.contrast="contrast",e.shadows="shadows",e.white="white",e.black="black",e.vibrance="vibrance",e.saturation="saturation"})(il||(il={}));function fx(e,t){let n={filter:"",html:void 0};switch(e){case il.warm:{const r=Math.max(0,Math.min(1,t??.5)),i=1+.3*r,a=1+.15*r,o=1;return n.filter="url(#warm-filter)",n.html=`
|
|
286
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
287
|
+
<filter id="warm-filter" color-interpolation-filters="sRGB">
|
|
288
|
+
<feColorMatrix type="matrix" values="
|
|
289
|
+
${i} 0 0 0 0
|
|
290
|
+
0 ${a} 0 0 0
|
|
291
|
+
0 0 ${o} 0 0
|
|
292
|
+
0 0 0 1 0" />
|
|
293
|
+
</filter>
|
|
294
|
+
</svg>`,n}case il.cold:{const r=Math.max(0,Math.min(1,t??.5)),i=1-.15*r,a=1-.1*r,o=1+.15*r;return n.filter="url(#cold-filter)",n.html=`
|
|
295
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
296
|
+
<filter id="cold-filter" color-interpolation-filters="sRGB">
|
|
297
|
+
<feColorMatrix type="matrix" values="
|
|
298
|
+
${i} 0 0 0 0
|
|
299
|
+
0 ${a} 0 0 0
|
|
300
|
+
0 0 ${o} 0 0
|
|
301
|
+
0 0 0 1 0" />
|
|
302
|
+
</filter>
|
|
303
|
+
</svg>`,n}case"natural":{const r=Math.max(0,Math.min(1,t??.5)),i=1+.1*r,a=1+.3*r,o=1+.2*r;return n.filter=`saturate(${a}) brightness(${i}) contrast(${o})`,n}case il.temperature:{const r=Math.max(-1,Math.min(1,t??0)),i=1+.15*r,a=1,o=1-.15*r;return n.filter="url(#temperature-filter)",n.html=`
|
|
304
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
305
|
+
<filter id="temperature-filter" color-interpolation-filters="sRGB">
|
|
306
|
+
<feColorMatrix type="matrix" values="
|
|
307
|
+
${i} 0 0 0 0
|
|
308
|
+
0 ${a} 0 0 0
|
|
309
|
+
0 0 ${o} 0 0
|
|
310
|
+
0 0 0 1 0" />
|
|
311
|
+
</filter>
|
|
312
|
+
</svg>
|
|
313
|
+
`,n}case il.contrast:{const r=100*Math.max(-1,Math.min(1,t??0)),i=259*(r+255)/(255*(259-r)),a=.5*(1-i);return n.filter="url(#contrast-filter)",n.html=`
|
|
314
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
315
|
+
<filter id="contrast-filter" color-interpolation-filters="sRGB">
|
|
316
|
+
<feComponentTransfer>
|
|
317
|
+
<feFuncR type="linear" slope="${i}" intercept="${a}" />
|
|
318
|
+
<feFuncG type="linear" slope="${i}" intercept="${a}" />
|
|
319
|
+
<feFuncB type="linear" slope="${i}" intercept="${a}" />
|
|
320
|
+
</feComponentTransfer>
|
|
321
|
+
</filter>
|
|
322
|
+
</svg>
|
|
323
|
+
`,n}case il.shadows:{const r=Math.max(-1,Math.min(1,t??0)),i=Math.min(Math.max(1-.6*r,.4),2.5);return n.filter="url(#shadows-filter)",n.html=`
|
|
324
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
325
|
+
<filter id="shadows-filter" color-interpolation-filters="sRGB">
|
|
326
|
+
<feComponentTransfer>
|
|
327
|
+
<feFuncR type="gamma" amplitude="1" exponent="${i}" offset="0" />
|
|
328
|
+
<feFuncG type="gamma" amplitude="1" exponent="${i}" offset="0" />
|
|
329
|
+
<feFuncB type="gamma" amplitude="1" exponent="${i}" offset="0" />
|
|
330
|
+
</feComponentTransfer>
|
|
331
|
+
</filter>
|
|
332
|
+
</svg>
|
|
333
|
+
`,n}case il.white:case il.black:return null;case il.vibrance:{const r=Math.max(-1,Math.min(1,t??0)),i=.299,a=.587,o=.114;let s;s=r>=0?1+1.5*r:1+r;const u=1-s,h=u*i+s,c=u*a,m=u*o,g=u*i,d=u*a+s,y=u*o,_=u*i,x=u*a,b=u*o+s;return n.filter="url(#vibrance-filter)",n.html=`
|
|
334
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
335
|
+
<filter id="vibrance-filter" color-interpolation-filters="sRGB">
|
|
336
|
+
<feColorMatrix type="matrix" values="
|
|
337
|
+
${h} ${c} ${m} 0 0
|
|
338
|
+
${g} ${d} ${y} 0 0
|
|
339
|
+
${_} ${x} ${b} 0 0
|
|
340
|
+
0 0 0 1 0" />
|
|
341
|
+
</filter>
|
|
342
|
+
</svg>
|
|
343
|
+
`,n}case il.saturation:{const o=1+Math.max(-1,Math.min(1,t??0)),s=1-o,u=s*.2126+o,h=s*.7152,c=s*.0722,m=s*.2126,g=s*.7152+o,d=s*.0722,y=s*.2126,_=s*.7152,x=s*.0722+o;return n.filter="url(#saturation-filter)",n.html=`
|
|
344
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
345
|
+
<filter id="saturation-filter" color-interpolation-filters="sRGB">
|
|
346
|
+
<feColorMatrix type="matrix" values="
|
|
347
|
+
${u} ${h} ${c} 0 0
|
|
348
|
+
${m} ${g} ${d} 0 0
|
|
349
|
+
${y} ${_} ${x} 0 0
|
|
350
|
+
0 0 0 1 0" />
|
|
351
|
+
</filter>
|
|
352
|
+
</svg>
|
|
353
|
+
`,n}default:return null}}async function MT(e){return new Promise((t,n)=>{const r=document.createElement("video");r.crossOrigin="anonymous",r.src=e,r.addEventListener("loadedmetadata",()=>{const{videoWidth:i,videoHeight:a}=r;t({width:i,height:a})}),r.addEventListener("error",i=>{const a=e.slice(0,100);n(new Error(`Failed to load video: ${a}`))})})}var IT=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const _r=(e,t,...n)=>({type:e,props:t,children:n||[]});function hx(e){return la(e),e}const o0=async({element:e,page:t,store:n})=>{let{src:r}=e;if(e.type==="svg"&&Object.keys(e.colorsReplace).length){const D=await Gp(r);r=my(D,new Map(Object.entries(e.colorsReplace)))}let i="";e.flipX&&(i+="scaleX(-1)"),e.flipY&&(i+="scaleY(-1)"),i||(i="none");const a={};if(e.type==="svg"&&e.maskSrc){const D=await Zb(r);a["mask-image"]=`url(${D})`,a["mask-size"]="100% 100%",a["mask-position"]="0 0",a["mask-repeat"]="no-repeat",a["-webkit-mask-image"]=`url(${D})`,a["-webkit-mask-size"]="100% 100%",a["-webkit-mask-position"]="0 0",a["-webkit-mask-repeat"]="no-repeat",r=e.maskSrc}else if(e.clipSrc){const D=e.clipSrc,C=await Zb(D);a["mask-image"]=`url(${C})`,a["mask-size"]="100% 100%",a["mask-position"]="0 0",a["mask-repeat"]="no-repeat",a["-webkit-mask-image"]=`url(${C})`,a["-webkit-mask-size"]="100% 100%",a["-webkit-mask-position"]="0 0",a["-webkit-mask-repeat"]="no-repeat"}const o=await Wp(r),s=o.width*e.cropWidth,u=o.height*e.cropHeight,h=e.width/e.height;let c,m;const g=s/u,d=e.type==="svg"||e.stretchEnabled;d?(c=s,m=u):h>=g?(c=s,m=s/h):(c=u*h,m=u);const y=c/o.width,_=m/o.height,x=c/m>e.width/e.height?e.height/m:e.width/c,b=d?e.width/c:x,S=d?e.height/m:x,k=c*b/y,E=m*S/_;let A=e.cropX*b*o.width,R=e.cropY*S*o.height;e.flipX&&(A=(1-e.cropX-e.cropWidth)*b*o.width),e.flipY&&(R=(1-e.cropY-e.cropHeight)*S*o.height);const O=e.borderSize&&la(e.borderColor),I=O?Math.max(0,e.cornerRadius-e.borderSize):e.cornerRadius,j=_r("div",{style:Object.assign(Object.assign({},a),{width:"100%",height:"100%",borderRadius:I+"px",border:e.borderSize&&!O?`${e.borderSize}px solid ${e.borderColor}`:"none",backgroundRepeat:"no-repeat",backgroundImage:`url(${r})`,transform:i,backgroundSize:`${Math.round(k)}px ${Math.round(E)}px`,backgroundPositionX:-Math.round(A)+"px",backgroundPositionY:-Math.round(R)+"px"})});return O?_r("div",{style:{width:"100%",height:"100%",borderRadius:e.cornerRadius+"px",background:hx(e.borderColor),padding:e.borderSize+"px",boxSizing:"border-box"}},j):j},N4=({element:e,type:t})=>{const n={"stroke-width":e.height,stroke:e.color,"line-cap":"round","stroke-linejoin":"round",opacity:e.opacity};return t==="arrow"||t==="triangle"?_r("polyline",Object.assign({points:`${3*e.height},${2*-e.height} 0,0 ${3*e.height},${2*e.height}`},n)):t==="bar"?_r("polyline",Object.assign({points:`0,${2*-e.height} 0,${2*e.height}`},n)):t==="circle"?_r("circle",Object.assign({r:e.height},n)):t==="square"?_r("polyline",Object.assign({points:`${-e.height},${-e.height} ${-e.height},${e.height} ${e.height},${e.height} ${e.height},${-e.height}`},n)):null},jT={image:o0,svg:o0,text:async({element:e,page:t,store:n})=>{const r=la(e.fill),i=la(e.stroke);if(e.curveEnabled){const x=ph(e.width,e.height,e.curvePower,e.fontSize),b=$o(e.text).replace(/\n/g," ");let S=`
|
|
354
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${e.width}" height="${e.height}" style="display: block;">
|
|
355
|
+
<defs>
|
|
356
|
+
<path id="curve-${e.id}" d="${x}" fill="none" />`;if(r){const R=`curve-fill-grad-${e.id}`;S+=ad(e.fill,R)}if(i&&e.strokeWidth){const R=`curve-stroke-grad-${e.id}`;S+=ad(e.stroke,R)}S+=`</defs>
|
|
357
|
+
<text
|
|
358
|
+
font-family="'${e.fontFamily}'"
|
|
359
|
+
font-size="${e.fontSize}"
|
|
360
|
+
font-weight="${e.fontWeight}"
|
|
361
|
+
font-style="${e.fontStyle}"
|
|
362
|
+
fill="${r?`url(#curve-fill-grad-${e.id})`:e.fill}"
|
|
363
|
+
text-anchor="middle"
|
|
364
|
+
dominant-baseline="central"
|
|
365
|
+
letter-spacing="${e.letterSpacing*e.fontSize}px"${e.textDecoration?` text-decoration="${e.textDecoration}"`:""}${e.strokeWidth?` stroke="${i?`url(#curve-stroke-grad-${e.id})`:e.stroke}" stroke-width="${e.strokeWidth}" paint-order="stroke fill"`:""}>
|
|
366
|
+
<textPath href="#curve-${e.id}" startOffset="50%">
|
|
367
|
+
${b}
|
|
368
|
+
</textPath>
|
|
369
|
+
</text>
|
|
370
|
+
</svg>`;const k=e.backgroundPadding*(e.fontSize*e.lineHeight),E=e.backgroundEnabled&&_r("div",{style:{position:"absolute",top:-k/2+"px",left:-k/2+"px",width:e.width+k+"px",height:e.height+k+"px",backgroundColor:e.backgroundColor,opacity:e.backgroundOpacity,borderRadius:e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5)+"px"}}),A=_r("div",{style:{width:"100%",height:"100%",position:"absolute",top:0,left:0},innerHTML:S});return _r("div",{style:{position:"relative",width:"100%",height:"100%"}},E,A)}const a=x=>({backgroundImage:x,backgroundSize:"100% 100%",backgroundRepeat:"repeat",WebkitBackgroundClip:"text",MozBackgroundClip:"text",backgroundClip:"text",WebkitTextFillColor:"transparent",MozTextFillColor:"transparent",color:"transparent"});let o={top:0,left:0};r&&(o=Object.assign(Object.assign({},o),a(e.fill)));const s=e.backgroundPadding*(e.fontSize*e.lineHeight),u=_r("div",{style:{position:"absolute",top:-s/2+"px",left:-s/2+"px",display:e.backgroundEnabled?"block":"none",width:e.width+s+"px",height:e.height+s+"px",backgroundColor:e.backgroundColor,opacity:e.backgroundOpacity,borderRadius:e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5)+"px"}});e.verticalAlign==="middle"?(o.top="50%",o.transform="translateY(-50%)"):e.verticalAlign==="bottom"&&(o.bottom=0);const h=/<[a-z][\s\S]*>/i.test(e.text),c=h?e.text:e.text.split(`
|
|
371
|
+
`).join("<br />");if(e.strokeWidth&&(i||r&&!i)){const x=Object.assign({position:"absolute",width:e.width+"px",whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:e.fontSize+"px",textAlign:e.align,fontFamily:`'${e.fontFamily}'`,textDecoration:e.textDecoration||"none",textDecorationColor:e.textDecoration?e.fill:void 0,textTransform:e.textTransform||"none",lineHeight:e.lineHeight,letterSpacing:e.letterSpacing*e.fontSize+"px",fontStyle:e.fontStyle,fontWeight:e.fontWeight},o),b=i?Object.assign(Object.assign(Object.assign({},x),a(e.stroke)),{WebkitTextStroke:`${e.strokeWidth}px transparent`}):Object.assign(Object.assign({},x),{color:"transparent",WebkitTextStroke:`${e.strokeWidth}px ${e.stroke}`}),S=r?Object.assign(Object.assign({},x),a(e.fill)):Object.assign(Object.assign({},x),{color:e.fill}),k="el-"+e.id,E=h?`<style>#${k} {${Np}}</style>`:"",A=_r("div",{style:Object.assign(Object.assign({},b),{position:"absolute",top:0,left:0,pointerEvents:"none"}),"aria-hidden":"true",innerHTML:h?`${E}${c}`:c}),R=_r("div",Object.assign(Object.assign({style:Object.assign(Object.assign({},S),{position:"relative"})},h?{id:k}:{}),{innerHTML:h?`${E}${c}`:c}));return _r("div",{style:{position:"relative",width:"100%",height:"100%"}},u,_r("div",{style:{position:"relative",width:e.width+"px"}},A,R))}const m=Object.assign(Object.assign({},o),{position:"absolute",width:e.width+"px",color:e.fill,whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:e.fontSize+"px",textAlign:e.align,fontFamily:`'${e.fontFamily}'`,textDecoration:e.textDecoration||"none",textDecorationColor:e.textDecoration?e.fill:void 0,textTransform:e.textTransform||"none",lineHeight:e.lineHeight,letterSpacing:e.letterSpacing*e.fontSize+"px",fontStyle:e.fontStyle,fontWeight:e.fontWeight,WebkitTextStroke:e.strokeWidth?`${e.strokeWidth}px ${e.stroke}`:void 0,paintOrder:e.strokeWidth?"stroke fill":void 0}),g="el-"+e.id,d=h?{id:g}:{},y=`<style>#${g} {${Np}}</style>`,_=_r("div",Object.assign(Object.assign({style:m},d),{innerHTML:h?`${y}${c}`:c}));return _r("div",{style:{position:"relative",width:"100%",height:"100%"}},u,_)},line:async({element:e,page:t,store:n})=>_r("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},_r("rect",{x:0,y:0,width:e.width,height:e.height,fill:e.color}),_r("g",{transform:`translate(0 ${e.height/2})`},N4({element:e,type:e.startHead})),_r("g",{transform:`translate(${e.width} ${e.height/2}) rotate(180)`},N4({element:e,type:e.endHead}))),figure:async({element:e,page:t,store:n,elementHook:r})=>{let i=ax(e);if(e.strokeWidth&&la(e.stroke)){const o=`figure-stroke-grad-${e.id}`,s=ad(e.stroke,o);i=i.replace(new RegExp(`stroke="${e.stroke.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}"`,"g"),`stroke="url(#${o})"`),i=i.replace("</defs>",`${s}</defs>`)}if(la(e.fill)){const o=`figure-fill-grad-${e.id}`,s=ad(e.fill,o);i=i.replace(new RegExp(`fill="${e.fill.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}"`,"g"),`fill="url(#${o})"`),i=i.replace("</defs>",`${s}</defs>`)}const a=_r("div",{innerHTML:i});return r&&r({dom:a,element:e})||a},group:async({element:e,page:t,store:n,elementHook:r})=>{const i=await Promise.all(e.children.map(o=>dx({element:o,page:t,store:n,elementHook:r}))),a=_r("div",{style:{transformOrigin:"top left",opacity:e.opacity}},...i);return r&&r({dom:a,element:e})||a},video:async({element:e,page:t,store:n,elementHook:r})=>{const{cropX:i,cropY:a,cropWidth:o,cropHeight:s}=e,u=await MT(e.src),h=u.width*o,c=u.height*s,m=e.width/e.height;let g,d;m>=h/c?(g=h,d=h/m):(g=c*m,d=c);const y=g/o,_=d/s,x=i*u.width,b=a*u.height,S=Math.max(e.width/u.width,e.height/u.height),k={position:"absolute",width:`${Math.round(y*S)}px`,height:`${Math.round(_*S)}px`,left:-Math.round(x*S)+"px",top:-Math.round(b*S)+"px",objectFit:"fill"},E=`video-${e.id}`,A=e.borderSize&&la(e.borderColor),R=A?Math.max(0,e.cornerRadius-e.borderSize):e.cornerRadius,O=_r("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",borderRadius:R+"px",border:e.borderSize&&!A?`${e.borderSize}px solid ${e.borderColor}`:"none"}},_r("video",{id:E,src:e.src,style:k,controls:!0,playsInline:!0,muted:!0,volume:e.volume}));if(A){const I=_r("div",{style:{width:"100%",height:"100%",borderRadius:e.cornerRadius+"px",background:hx(e.borderColor),padding:e.borderSize+"px",boxSizing:"border-box"}},O);return r&&r({dom:I,element:e})||I}return r&&r({dom:O,element:e})||O},gif:o0};async function dx({element:e,page:t,store:n,elementHook:r}){var i;let a=await jT[e.type];if(a||(a=()=>_r("div",{}),console.error(`HTML export does not support ${e.type} type...`)),!e.visible)return null;const o=await a({element:e,page:t,store:n}),s=[],u=[];if(e.blurEnabled&&s.push(`blur(${e.blurRadius/2}px)`),e.brightnessEnabled&&s.push(`brightness(${100*e.brightness+100}%)`),e.sepiaEnabled&&s.push("sepia()"),e.grayscaleEnabled&&s.push("grayscale()"),e.filters)for(const[c,m]of Object.entries(e.filters)){const g=fx(il[c],m.intensity);g&&(s.push(g.filter),g.html&&u.push(g.html))}if(e.shadowEnabled){const c=(function(m,g){if(g===1)return m;const d=un.Util.colorToRGBA(m);return d?`rgba(${d.r}, ${d.g}, ${d.b}, ${d.a*g})`:m})(e.shadowColor,(i=e.shadowOpacity)!==null&&i!==void 0?i:1);s.push(`drop-shadow(${e.shadowOffsetX}px ${e.shadowOffsetY}px ${e.shadowBlur/2}px ${c})`)}const h=_r("div",{id:e.id,style:{position:"absolute",left:e.x+"px",top:e.y+"px",width:e.width+"px",height:e.height+"px",transform:`rotate(${e.rotation}deg)`,transformOrigin:"top left",opacity:e.opacity,display:e.visible&&e.showInExport?"block":"none",filter:s.join(" ")||"none"}},o,...u);return r&&r({dom:h,element:e})||h}async function DT({json:e,elementHook:t}){const n=await Promise.all(e.pages.map(a=>(async function({page:o,store:s,elementHook:u}){const h=await Promise.all(o.children.map(d=>dx({element:d,page:o,store:s,elementHook:u}))),c=o.width==="auto"?s.width:o.width,m=o.height==="auto"?s.height:o.height;let g={};if(o.background.indexOf("url")>=0||o.background.indexOf("http")>=0||o.background.indexOf(".jpg")>=0||o.background.indexOf(".png")>=0||o.background.indexOf(".jpeg")>=0){const{width:d,height:y}=await Wp(o.background),_=await o0({element:Object.assign({x:0,y:0,width:c,height:m,src:o.background,cornerRadius:0},cx({width:c,height:m},{width:d,height:y})),page:o,store:s});h.unshift(_)}else g=Object.assign(Object.assign({},g),{backgroundColor:o.background});return _r("div",{className:"page",id:o.id,style:Object.assign(Object.assign({},g),{width:c+"px",height:m+"px",overflow:"hidden",position:"relative"})},...h)})({page:a,store:e,elementHook:t}))),r=[];mi({children:e.pages},a=>{a.type==="text"&&r.indexOf(a.fontFamily)===-1&&r.push(a.fontFamily)});const i=r.map(a=>{const o=e.fonts.find(s=>s.fontFamily===a);if(o){const s=(o.styles||(o.url?[{src:`url("${o.url}")`}]:[])).map(u=>`
|
|
372
|
+
@font-face {
|
|
373
|
+
font-family: '${o.fontFamily}';
|
|
374
|
+
src: ${u.src};
|
|
375
|
+
font-style: ${u.fontStyle||"normal"};
|
|
376
|
+
font-weight: ${u.fontWeight||"normal"};
|
|
377
|
+
font-display: swap;
|
|
378
|
+
}`).join(`
|
|
379
|
+
`);return _r("style",{},s)}return _r("link",{href:K8(a),rel:"stylesheet"})});return _r("div",{className:"design"},...i,...n)}const px=({dom:e})=>{if(typeof e=="string")return e;if(!e)return"";const t=e.props,{innerHTML:n}=t,r=IT(t,["innerHTML"]),i=Object.keys(r).map(a=>a==="style"&&typeof r[a]=="object"?`style="${Object.keys(r[a]).filter(o=>r[a][o]!=null).map(o=>`${o.replace(/[A-Z]/g,s=>`-${s.toLowerCase()}`)}: ${r[a][o]}`).join("; ")}"`:((o,s)=>typeof s=="object"?`${o}="${Object.keys(s).map(u=>`${u.replace(/-([a-z])/g,h=>h[1].toUpperCase())}:${s[u]};`).join(" ")}"`:`${o}="${s}"`)(a,r[a])).join(" ");return`<${e.type} ${i}>${n||e.children.map(a=>px({dom:a})).join("")}</${e.type}>`};async function FT({json:e,elementHook:t}){const n=await DT({json:e,elementHook:t});return px({dom:n})}var BT=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const gx=(e,t)=>{if(e.children)for(const n of e.children){if(t(n)===!0)break;gx(n,t)}},en=(e,t,...n)=>({type:e,props:t,children:n||[]});function Jf(e,t){if(!la(e))return null;const{stops:n,rotation:r}=Up(e),i=r*Math.PI/180,a=.5-.5*Math.sin(i),o=.5+.5*Math.cos(i),s=.5+.5*Math.sin(i),u=.5-.5*Math.cos(i),h=n.map(({offset:c,color:m})=>en("stop",{offset:100*c+"%","stop-color":m}));return en("linearGradient",{id:t,x1:100*a+"%",y1:100*o+"%",x2:100*s+"%",y2:100*u+"%"},...h)}const Sm=async e=>{try{const t=await fetch(e);if(typeof Buffer<"u"){const n=await t.arrayBuffer(),r=Buffer.from(n).toString("base64");return`data:${t.headers.get("content-type")||"image/png"};base64,${r}`}{const n=await t.blob();return new Promise((r,i)=>{const a=new FileReader;a.onloadend=()=>r(a.result),a.onerror=i,a.readAsDataURL(n)})}}catch(t){return console.error("Error converting URL to data URL:",t),e}},Em=async({element:e,page:t,store:n})=>{let{src:r}=e;if(e.type==="svg"){const z=await Gp(r);r=my(z,new Map(Object.entries(e.colorsReplace)))}else r=await Sm(r);let i,a,o,s,u="";if(e.flipX||e.flipY){const z=e.flipX?-1:1,Y=e.flipY?-1:1,J=e.width/2,K=e.height/2;u=`translate(${J}, ${K}) scale(${z}, ${Y}) translate(${-J}, ${-K})`}e.clipSrc&&(i=`clip-img-mask-${e.id}`,a=await Sm(e.clipSrc)),e.maskSrc&&(o=`mask-img-${e.id}`,s=await Sm(e.maskSrc));const h=await Wp(r),c=h.width*e.cropWidth,m=h.height*e.cropHeight,g=e.width/e.height;let d,y;const _=c/m,x=typeof e.stretchEnabled=="boolean"&&e.stretchEnabled||e.type==="svg";x?(d=c,y=m):g>=_?(d=c,y=c/g):(d=m*g,y=m);const b=d/h.width,S=y/h.height,k=d/y>e.width/e.height?e.height/y:e.width/d,E=x?e.width/d:k,A=x?e.height/y:k,R=d*E/b,O=y*A/S;let I=e.cropX*h.width*E,j=e.cropY*h.height*A;e.flipX&&(I=(1-e.cropX-e.cropWidth)*h.width*E),e.flipY&&(j=(1-e.cropY-e.cropHeight)*h.height*A);const D=`clip-${e.id}`,C=e.cornerRadius||0,N=r.replace(/&/g,"&"),$={x:-I,y:-j,width:R,height:O,preserveAspectRatio:"none","clip-path":`url(#${D})`},G=[en("clipPath",{id:D},en("rect",{x:0,y:0,width:e.width,height:e.height,rx:C||void 0,ry:C||void 0}))];i&&a&&G.push(en("mask",{id:i,maskUnits:"userSpaceOnUse","mask-type":"alpha"},en("image",{href:a.replace(/&/g,"&"),x:0,y:0,width:e.width,height:e.height,preserveAspectRatio:"none"}))),o&&G.push(en("mask",{id:o,maskUnits:"userSpaceOnUse","mask-type":"alpha"},en("image",Object.assign({href:N},$))));let te=N;const se={};o&&s&&(te=s.replace(/&/g,"&"),se.mask=`url(#${o})`);const ee={};i&&(ee.mask=`url(#${i})`);const Q=e.borderSize||0,re=Q>0&&la(e.borderColor),X=re?`border-grad-${e.id}`:null;if(re){const z=Jf(e.borderColor,X);z&&G.push(z)}const B=Q>0?en("rect",{x:Q/2,y:Q/2,width:Math.max(0,e.width-Q),height:Math.max(0,e.height-Q),fill:"none",stroke:re?`url(#${X})`:e.borderColor,"stroke-width":Q,rx:Math.max(0,C-Q)||void 0,ry:Math.max(0,C-Q)||void 0}):null,F=en("g",{},en("defs",{},...G),en("image",Object.assign(Object.assign({href:te},$),se)),B);return en("g",ee,u?en("g",{transform:u},F):F)},T4=({element:e,type:t})=>{const n={"stroke-width":e.height,stroke:e.color,"line-cap":"round","stroke-linejoin":"round",fill:e.color};return t==="arrow"?en("polyline",Object.assign({points:`${3*e.height},${2*-e.height} 0,0 ${3*e.height},${2*e.height}`},n)):t==="triangle"?en("polygon",Object.assign({points:`${3*e.height},${2*-e.height} 0,0 ${3*e.height},${2*e.height}`},n)):t==="bar"?en("polyline",Object.assign({points:`0,${2*-e.height} 0,${2*e.height}`},n)):t==="circle"?en("circle",Object.assign({cx:2*e.height,cy:0,r:2*e.height},n)):t==="square"?en("polygon",Object.assign({points:`0,${2*-e.height} ${4*e.height},${2*-e.height} ${4*e.height},${2*e.height} 0,${2*e.height}`},n)):null},zT={image:Em,svg:Em,text:async({element:e,page:t,store:n})=>{const r=la(e.fill),i=la(e.stroke);if(e.curveEnabled){const k=ph(e.width,e.height,e.curvePower,e.fontSize),E=`curve-path-${e.id}`,A=$o(e.text).replace(/\n/g," "),R=e.backgroundPadding*(e.fontSize*e.lineHeight*.5),O=e.backgroundEnabled?en("rect",{x:-R,y:-R,width:e.width+2*R,height:e.height+2*R,fill:e.backgroundColor,opacity:e.backgroundOpacity,rx:e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5),ry:e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5)}):null,I=[en("path",{id:E,d:k,fill:"none"})],j=e.strokeWidth&&(i||r&&!i);if(r){const D=`curve-fill-grad-${e.id}`,C=Jf(e.fill,D);C&&I.push(C)}if(i&&e.strokeWidth){const D=`curve-stroke-grad-${e.id}`,C=Jf(e.stroke,D);C&&I.push(C)}if(j){const D={"font-size":e.fontSize+"px","text-anchor":"middle","dominant-baseline":"central","font-family":e.fontFamily,"font-style":e.fontStyle,"font-weight":e.fontWeight,"text-decoration":e.textDecoration||void 0,"letter-spacing":e.letterSpacing*e.fontSize+"px"},C=i?`url(#curve-stroke-grad-${e.id})`:e.stroke,N=en("text",Object.assign(Object.assign({},D),{fill:C,"stroke-width":e.strokeWidth,stroke:C}),en("textPath",{href:`#${E}`,startOffset:"50%",innerHTML:A})),$=r?`url(#curve-fill-grad-${e.id})`:e.fill,G=en("text",Object.assign(Object.assign({},D),{fill:$}),en("textPath",{href:`#${E}`,startOffset:"50%",innerHTML:A}));return en("g",{},O,en("defs",{},...I),N,G)}return en("g",{},O,en("defs",{},...I),en("text",{fill:r?`url(#curve-fill-grad-${e.id})`:e.fill,"font-size":e.fontSize+"px","text-anchor":"middle","dominant-baseline":"central","font-family":e.fontFamily,"font-style":e.fontStyle,"font-weight":e.fontWeight,"text-decoration":e.textDecoration||void 0,"letter-spacing":e.letterSpacing*e.fontSize+"px","stroke-width":e.strokeWidth||void 0,stroke:e.strokeWidth?i?`url(#curve-stroke-grad-${e.id})`:e.stroke:void 0,"paint-order":e.strokeWidth?"stroke fill":void 0},en("textPath",{href:`#${E}`,startOffset:"50%",innerHTML:A})))}const a=(k,E,A,R,O,I=0)=>{const j=document.createElement("canvas").getContext("2d");return j.font=`${O} ${R} ${E}px ${A}`,j.measureText(k).width+Math.max(0,(k?k.length:0)-1)*I*E},o=(k,E,A,R,O,I,j=0)=>{const D=[];return k.split(`
|
|
380
|
+
`).forEach(C=>{const N=C.split(" ");let $="";for(let G=0;G<N.length;G++){const te=$+N[G]+" ";a(te,A,R,O,I,j)>E+.5&&G>0?(D.push($.trim()),$=N[G]+" "):$=te}D.push($.trim())}),D};let s=$o(e.text);e.textTransform=="uppercase"&&(s=s.toUpperCase());let u=e.fontSize,h=[];for(;;){h=o(s,e.width,u,e.fontFamily,e.fontWeight,e.fontStyle,e.letterSpacing);const k=Math.max(...h.map(A=>a(A,u,e.fontFamily,e.fontWeight,e.fontStyle,e.letterSpacing))),E=h.length*u*e.lineHeight;if(k<=e.width&&E<=e.height||(u-=1,u<4))break}const c=u*e.lineHeight,m=h.length*c;let g=u;e.verticalAlign==="middle"?g=(e.height-m)/2+u:e.verticalAlign==="bottom"&&(g=e.height-m+u);const d=e.align==="center"?"middle":e.align==="right"?"end":"start",y=h.map((k,E)=>en("tspan",{x:e.align==="center"?e.width/2:e.align==="right"?e.width:0,dy:E===0?0:c,innerHTML:k})),_=e.backgroundPadding*(u*e.lineHeight*.5),x=e.backgroundEnabled?en("rect",{x:-_,y:-_,width:e.width+2*_,height:e.height+2*_,fill:e.backgroundColor,opacity:e.backgroundOpacity,rx:e.backgroundCornerRadius*(u*e.lineHeight*.5),ry:e.backgroundCornerRadius*(u*e.lineHeight*.5)}):null,b=[],S=e.strokeWidth&&(i||r&&!i);if(r){const k=`text-fill-grad-${e.id}`,E=Jf(e.fill,k);E&&b.push(E)}if(i&&e.strokeWidth){const k=`text-stroke-grad-${e.id}`,E=Jf(e.stroke,k);E&&b.push(E)}if(S){const k={y:g,"font-size":u+"px","text-anchor":d,"font-family":e.fontFamily,"font-style":e.fontStyle,"font-weight":e.fontWeight,"text-decoration":e.textDecoration,"line-height":e.lineHeight,"letter-spacing":e.letterSpacing*u+"px"},E=i?`url(#text-stroke-grad-${e.id})`:e.stroke,A=en("text",Object.assign(Object.assign({},k),{fill:E,"stroke-width":e.strokeWidth,stroke:E}),...y.map(I=>en("tspan",I.props,I.props.innerHTML))),R=r?`url(#text-fill-grad-${e.id})`:e.fill,O=en("text",Object.assign(Object.assign({},k),{fill:R}),...y.map(I=>en("tspan",I.props,I.props.innerHTML)));return en("g",{},x,b.length>0?en("defs",{},...b):null,A,O)}return en("g",{},x,b.length>0?en("defs",{},...b):null,en("text",{fill:r?`url(#text-fill-grad-${e.id})`:e.fill,y:g,"font-size":u+"px","text-anchor":d,"font-family":e.fontFamily,"font-style":e.fontStyle,"font-weight":e.fontWeight,"text-decoration":e.textDecoration,"line-height":e.lineHeight,"letter-spacing":e.letterSpacing*u+"px","stroke-width":e.strokeWidth||void 0,stroke:e.strokeWidth?e.stroke:void 0,"paint-order":e.strokeWidth?"stroke fill":void 0},...y))},line:async({element:e,page:t,store:n})=>en("g",{},en("line",{x1:0,y1:e.height/2,x2:e.width,y2:e.height/2,stroke:e.color,"stroke-width":e.height,"stroke-dasharray":e.dash&&e.dash.length?e.dash.map(r=>r*e.height).join(" "):void 0}),en("g",{transform:`translate(0 ${e.height/2})`},T4({element:e,type:e.startHead})),en("g",{transform:`translate(${e.width} ${e.height/2}) rotate(180)`},T4({element:e,type:e.endHead}))),figure:async({element:e,page:t,store:n,elementHook:r})=>{let i=(function(s){let u=s.replace(/<svg[^>]*>/,"");return u=u.replace(/<\/svg>/,""),u})(ax(e));const a=[];if(e.strokeWidth&&la(e.stroke)){const s=`figure-stroke-grad-${e.id}`,u=Jf(e.stroke,s);if(u){a.push(u);const h=e.stroke.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");i=i.replace(new RegExp(`stroke="${h}"`,"g"),`stroke="url(#${s})"`)}}if(la(e.fill)){const s=`figure-fill-grad-${e.id}`,u=Jf(e.fill,s);if(u){a.push(u);const h=e.fill.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");i=i.replace(new RegExp(`fill="${h}"`,"g"),`fill="url(#${s})"`)}}if(a.length>0){const s=en("g",{},en("defs",{},...a),en("g",{innerHTML:i}));return r&&r({dom:s,element:e})||s}const o=en("g",{innerHTML:i});return r&&r({dom:o,element:e})||o},group:async({element:e,page:t,store:n,elementHook:r})=>{const i=await Promise.all(e.children.map(o=>mx({element:o,page:t,store:n,elementHook:r}))),a=en("g",{style:{"transform-origin":"top left"}},...i);return r&&r({dom:a,element:e})||a},gif:Em};async function mx({element:e,page:t,store:n,elementHook:r}){var i;let a=await zT[e.type];a||(a=()=>en("g",{}),console.error(`SVG export does not support ${e.type} type...`));const o=await a({element:e,page:t,store:n}),s=[],u=[];if(e.blurEnabled&&s.push(`blur(${e.blurRadius/2}px)`),e.brightnessEnabled&&s.push(`brightness(${100*e.brightness+100}%)`),e.sepiaEnabled&&s.push("sepia()"),e.grayscaleEnabled&&s.push("grayscale()"),e.shadowEnabled&&s.push(`drop-shadow(${e.shadowOffsetX}px ${e.shadowOffsetY}px ${e.shadowBlur}px ${e.shadowColor})`),e.filters)for(const[c,m]of Object.entries(e.filters)){const g=fx(il[c],m.intensity);if(g&&(s.push(g.filter),g.html)){const d=g.html.replace(/<svg([^>]*)>/,"<g$1>").replace(/<\/svg>/,"</g>");u.push(d)}}const h=en("g",{className:"element",id:e.id,transform:e.type!=="group"?`translate(${e.x}, ${e.y}) rotate(${e.rotation})`:void 0,display:(i=e.visible)===null||i===void 0||i?void 0:"none",opacity:e.opacity,style:{"transform-origin":"top left",filter:s.join(" ")}},o,...u);return r&&r({dom:h,element:e})||h}async function R4(e){try{const t=await fetch(e),n=t.headers.get("content-type")||"font/ttf",r=await t.arrayBuffer();return`data:${n};base64,${typeof Buffer<"u"?Buffer.from(r).toString("base64"):(function(i){const a=new Uint8Array(i);let o="";for(let s=0;s<a.length;s+=32768){const u=a.subarray(s,s+32768);o+=String.fromCharCode(...u)}if(typeof btoa<"u")return btoa(o);if(typeof Buffer<"u")return Buffer.from(a).toString("base64");throw new Error("No base64 encoder available in this environment")})(r)}`}catch(t){return console.error("Error embedding font:",t),e}}async function UT({json:e,elementHook:t,fontEmbedding:n="inline"}){const r=[];gx({children:e.pages},o=>{o.type==="text"&&r.indexOf(o.fontFamily)===-1&&r.push(o.fontFamily)});const i=n==="inline"?await(async function(o,s){return await Promise.all(o.map(async u=>{var h,c;if(u==="Arial")return null;const m=s.find(g=>g.fontFamily===u);if(m){const g=await R4(m.url);return en("style",{},`@font-face { font-family: ${u}; src: url(${g}); }`)}{const g=`https://fonts.googleapis.com/css?family=${u}:bi,normal,i,b`;try{const d=await fetch(g),y=await d.text(),_=(c=(h=y.match(/url\((.*?)\)/g))===null||h===void 0?void 0:h.map(b=>b.replace(/url\((.*?)\)/,"$1")))===null||c===void 0?void 0:c.filter(b=>b.startsWith("https"));if(!_?.length)throw new Error("No font URLs found");const x=await Promise.all(_.map(async b=>{const S=await R4(b),k=y.match(/font-style:\s*(.*?);/),E=y.match(/font-weight:\s*(.*?);/),A=k?k[1]:"normal",R=E?E[1]:"normal";return`@font-face {
|
|
381
|
+
font-family: ${u};
|
|
382
|
+
font-style: ${A};
|
|
383
|
+
font-weight: ${R};
|
|
384
|
+
src: url(${S});
|
|
385
|
+
}`}));return en("style",{},x.join(`
|
|
386
|
+
`))}catch(d){return console.error("Error embedding Google Font:",d),en("defs",{},en("style",{type:"text/css",innerHTML:`@import url('${g}');`.replace(/&/g,"&")}))}}}))})(r,e.fonts):[],a=await Promise.all(e.pages.map(o=>(async function({page:s,store:u,elementHook:h}){const c=await Promise.all(s.children.map(d=>mx({element:d,page:s,store:u,elementHook:h}))),m=s.background.indexOf("url")>=0||s.background.indexOf("http")>=0||s.background.indexOf(".jpg")>=0||s.background.indexOf(".png")>=0||s.background.indexOf(".jpeg")>=0;let g;if(m){const d=await Wp(s.background);g=await RT(s.background,Object.assign({width:u.width,height:u.height,x:0,y:0},cx({width:u.width,height:u.height},{width:d.width,height:d.height})))}return en("g",{className:"page",style:{}},m?en("image",{"xlink:href":g,x:0,y:0,width:u.width,height:u.height,preserveAspectRatio:"none"}):en("rect",{x:0,y:0,width:u.width,height:u.height,fill:m?void 0:s.background}),...c)})({page:o,store:e,elementHook:t})));return en("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${e.width} ${e.height}`,width:e.width,height:e.height},...i,...a)}const vx=({dom:e,nestLevel:t=0})=>{if(typeof e=="string")return e;if(!e)return"";const n=e.props,{innerHTML:r}=n,i=BT(n,["innerHTML"]),a=Object.keys(i).map(s=>((u,h)=>typeof h=="object"?`${u}="${Object.keys(h).map(c=>`${c}:${h[c]};`).join(" ")}"`:h==null||h===""?"":`${u}="${h}"`)(s,i[s])).filter(s=>s&&s.trim().length>0).join(" "),o=" ".repeat(t);return`${o}<${e.type}${a?" "+a:""}>${r||`
|
|
387
|
+
`+e.children.map(s=>vx({dom:s,nestLevel:t+1})).join("")}${o}</${e.type}>
|
|
388
|
+
`};async function qT({json:e,elementHook:t,fontEmbedding:n="inline"}){const r=await UT({json:e,elementHook:t,fontEmbedding:n});return vx({dom:r})}const yp=Dt.model("Page",{id:Dt.identifier,children:Dt.array(Dt.late(()=>kx)),width:Dt.optional(Dt.union(Dt.number,Dt.literal("auto")),"auto"),height:Dt.optional(Dt.union(Dt.number,Dt.literal("auto")),"auto"),background:"white",bleed:0,custom:Dt.frozen(),duration:5e3,_exporting:!1,_rendering:!1,_forceMount:!1}).postProcessSnapshot(e=>{const t=Object.assign({},e),n={};for(var r in t)r[0]!=="_"&&(n[r]=e[r]);return n}).views(e=>({get store(){return Qf(e,lh)}})).views(e=>({get startTime(){let t=0;for(const n of e.store.pages){if(n.id===e.id)return t;t+=n.duration}return t},get _exportingOrRendering(){return e._exporting||e._rendering}})).views(e=>({get computedWidth(){return e.width==="auto"?e.store.width:e.width},get computedHeight(){return e.height==="auto"?e.store.height:e.height}})).actions(e=>({toJSON:()=>JSON.parse(JSON.stringify(bc(e))),_forEachElementUp(t,n){const r=t.map(i=>({id:i,index:e.children.findIndex(a=>a.id===i)}));r.sort((i,a)=>a.index-i.index);for(const{index:i}of r){if(i==-1)continue;const a=i<e.children.length-1&&e.children[i+1],o=t.indexOf(a?.id)>=0;i===e.children.length-1||o||n(i)}},_forEachElementDown(t,n){const r=t.map(i=>({id:i,index:e.children.findIndex(a=>a.id===i)}));r.sort((i,a)=>i.index-a.index);for(const{index:i}of r){if(i==-1)continue;const a=i>0&&e.children[i-1],o=t.indexOf(a?.id)>=0;i===0||o||n(i)}return!1}})).actions(e=>({clone(t={}){const n=e.toJSON();n.children.forEach(o=>{o.id=Ll(10),mi(o,s=>{s.id=Ll(10)})});const r=Object.assign(Object.assign(Object.assign({},n),{id:Ll(10)}),t),i=e.store.addPage(r),a=e.store.pages.indexOf(e);return i.setZIndex(a+1),i.select(),i},setZIndex(t){e.store.setPageZIndex(e.id,t)},set(t){Object.assign(e,t)},select(){e.store.selectPage(e.id)},addElement(t,{skipSelect:n=!1}={}){const r=ky[t.type];if(!r)return void console.error("Can not find model with type "+t.type);"children"in t&&Array.isArray(t.children)&&mi(t,o=>{o.id=o.id||Ll(10)});const i=e.children.reduce((o,s)=>{if(s.type==="group"){const u=s.children.reduce((h,c)=>{var m;const g=(m=c.name)===null||m===void 0?void 0:m.match(new RegExp(`${t.type}-(\\d+)`));if(g){const d=parseInt(g[1],10);return Math.max(h,d||0)}},0);return Math.max(o,u||0)}{const u=s.name.match(new RegExp(`${t.type}-(\\d+)`));if(u){const h=parseInt(u[1],10);return Math.max(o,h||0)}}return o},0),a=r.create(Object.assign({id:Ll(10),name:`${t.type}-${i+1}`},t));return e.children.push(a),a.selectable&&!n&&e.store.selectElements([a.id]),a},canMoveElementsUp(t){let n=!1;return e._forEachElementUp(t,()=>{n=n||!0}),n},moveElementsUp(t){e._forEachElementUp(t,n=>{const r=e.children[n];ih(r),e.children.splice(n+1,0,r)})},canMoveElementsTop(t){return this.canMoveElementsUp(t)},moveElementsTop(t){const n=[],r=[];e.children.forEach(i=>{t.indexOf(i.id)>=0?n.push(i):r.push(i)}),e.children.replace(r.concat(n))},canMoveElementsDown(t){let n=!1;return e._forEachElementDown(t,()=>{n=n||!0}),n},moveElementsDown(t){e._forEachElementDown(t,n=>{const r=e.children[n];ih(r),e.children.splice(n-1,0,r)})},canMoveElementsBottom(t){return this.canMoveElementsDown(t)},moveElementsBottom(t){const n=[],r=[];e.children.forEach(i=>{t.indexOf(i.id)>=0?n.push(i):r.push(i)}),e.children.replace(n.concat(r))},setElementZIndex(t,n){const r=e.children.find(i=>i.id===t);r&&(ih(r),e.children.remove(r),e.children.splice(n,0,r))},setSize({width:t,height:n,useMagic:r,softChange:i}){if(r){const a=[],o=R=>R.type==="image"&&R.x<1&&R.y<1&&R.width>=e.computedWidth-2&&R.height>=e.computedHeight-2;mi(e,R=>{R.type!=="group"&&(o(R)||a.push(R))});const s=a.length?ig(a):{x:0,y:0,width:e.computedWidth,height:e.computedHeight},u=1/4,h=Math.max(0,Math.min(s.x,e.computedWidth-s.x-s.width)),c=e.computedWidth*u,m=Math.max(0,h-c),g=Math.max(0,Math.min(s.y,e.computedHeight-s.y-s.height)),d=e.computedHeight*u,y=Math.max(0,g-d),_=e.computedWidth-2*m,x=e.computedHeight-2*y,b=t/_,S=n/x,k=Math.min(b,S),E=(t-_*k)/2-m*k,A=(n-x*k)/2-y*k;mi(e,R=>{R.type!=="group"&&(o(R)?R.set({x:R.x*k,y:R.y*k,width:R.width*b,height:R.height*S,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(R.set({x:E+R.x*k,y:A+R.y*k,width:R.width*k,height:R.height*k}),R.type==="text"?R.set({fontSize:R.fontSize*k}):R.type==="figure"&&R.set({strokeWidth:R.strokeWidth*k})))})}i||(e.width=t),i||(e.height=n)}})).actions(e=>({moveElementUp(t){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),e.moveElementsUp([t])},moveElementDown(t){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),e.moveElementsDown([t])},moveElementTop(t){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),e.moveElementsTop([t])},moveElementBottom(t){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),e.moveElementsBottom([t])},play(){e.store.play({startTime:e.startTime,endTime:e.startTime+e.duration})}})),M4=Dt.model("Audio",{id:Dt.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0,custom:Dt.frozen()}).actions(e=>({toJSON:()=>Object.assign({},bc(e))})).actions(e=>({set(t){Object.assign(e,t)}}));var Kd=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};SO("ignore");const $T=Dt.model("Font",{fontFamily:Dt.string,url:Dt.optional(Dt.string,""),styles:Dt.frozen()}).preProcessSnapshot(e=>Object.assign(Object.assign({},e),{fontFamily:e.fontFamily||e.name})),lh=Dt.model("Store",{role:"",pages:Dt.array(yp),fonts:Dt.array($T),audios:Dt.array(M4),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,schemaVersion:2,bleedVisible:!1,rulesVisible:!1,distanceGuidesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:Dt.frozen(),tool:Dt.optional(Dt.enumeration("Tool",["selection","draw","pan","text","eraser"]),"selection"),toolOptions:Dt.optional(Dt.model({brushType:Dt.optional(Dt.enumeration("BrushType",["brush","highlighter"]),"brush"),strokeWidth:Dt.optional(Dt.number,5),stroke:Dt.optional(Dt.string,"#000000"),opacity:Dt.optional(Dt.number,1)}),{}),selectedElementsIds:Dt.array(Dt.string),animatedElementsIds:Dt.array(Dt.string),history:Dt.optional(pT,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),_activePageId:"",_selectedPagesIds:Dt.array(Dt.string),_forceShowCredit:!1,_key:"",_validated:!1}).views(e=>{const t=bh(()=>{const n={};return mi({children:e.pages},r=>(n[r.id]=r,!1)),n},{keepAlive:!0});return{get _idsMap(){return t.get()}}}).views(e=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),e.bleedVisible},get selectedElements(){return e.selectedElementsIds.map(t=>{for(const n of e.pages)for(const r of n.children)if(r.id===t)return r}).filter(t=>!!t)},get children(){return e.pages},get selectedShapes(){const t=[];return mi({children:e.selectedElements},n=>{n.type!=="group"&&t.push(n)}),t},get activePage(){return e.pages.slice().find(t=>t.id===e._activePageId)||(e.pages.length?e.pages[0]:null)},get selectedPages(){return e._selectedPagesIds.map(t=>e.pages.find(n=>n.id===t))},get duration(){let t=0;return e.pages.forEach(n=>{t+=n.duration}),t},get _hasCroppedImages(){return e.find(t=>t.type==="image"&&t._cropModeEnabled)},find(t){let n;return mi({children:e.pages},r=>{if(!n&&t(r))return n=r,!0}),n},getElementById:t=>e._idsMap[t]})).actions(e=>{let t=0,n=null,r=!1;return{afterCreate(){e.history.canUndo},setCurrentTime(i){e.currentTime=i},_togglePlaying(i=!e.isPlaying){e.isPlaying=i},play({animatedElementsIds:i=[],startTime:a=0,currentTime:o=0,endTime:s=e.duration,repeat:u=!1}={}){o&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),a=o),e.animatedElementsIds=i,e.currentTime=a,e.isPlaying=!0,t=Date.now(),n=s,r=u,requestAnimationFrame(e.seek)},checkActivePage(){let i=0;for(const a of e.pages){if(e.currentTime>=a.startTime&&e.currentTime<a.startTime+a.duration){e.selectPage(a.id);break}i+=a.duration}},seek(){if(!e.isPlaying)return;const i=Date.now(),a=i-t;t=i,e.currentTime+=a,e.checkActivePage();const o=n||e.duration;e.isPlaying&&e.currentTime<o?requestAnimationFrame(e.seek):e.isPlaying&&r?(e.currentTime=0,requestAnimationFrame(e.seek)):e.stop()},stop(){e.isPlaying=!1,e.currentTime=0,e.animatedElementsIds=[],e.checkActivePage()}}}).actions(e=>({__(){e._validated||(OT(e._key,e._forceShowCredit),e._validated=!0)},set(t){Object.assign(e,t)},setUnit({unit:t,dpi:n}){e.unit=t||e.unit,e.dpi=n||e.dpi},setRole(t){e.role=t},setTool(t){e.tool=t},setToolOptions(t){Object.assign(e.toolOptions,t)},addPage(t){const n=yp.create(Object.assign({id:Ll(10)},t));return e.pages.push(n),e._activePageId=n.id,n},selectPage(t){e._activePageId=t,e._selectedPagesIds.length===1&&(e._selectedPagesIds=[t])},selectPages(t){e._selectedPagesIds=t,e._selectedPagesIds.length===1&&(e._activePageId=e._selectedPagesIds[0])},selectElements(t){const n=t.map(r=>e.getElementById(r)).sort((r,i)=>r.page.children.indexOf(r)-r.page.children.indexOf(i)).filter(r=>!!r).map(r=>r.id);e.selectedElementsIds=n},toggleBleed(t){e.bleedVisible=t??!e.bleedVisible},toggleRulers(t){e.rulesVisible=t??!e.rulesVisible},toggleDistanceGuides(t){e.distanceGuidesVisible=t??!e.distanceGuidesVisible},openSidePanel(t){e.openedSidePanel!==t&&(e.previousOpenedSidePanel=e.openedSidePanel,e.openedSidePanel=t)},setScale(t){e.scale=t},_setScaleToFit(t){e.scaleToFit=t},setElementsPixelRatio(t){e._elementsPixelRatio=t},setSize(t,n,r){e.pages.forEach(i=>{i.setSize({width:t,height:n,useMagic:r,softChange:!0})}),e.width=t,e.height=n},setPageZIndex(t,n){const r=e.pages.find(i=>i.id===t);r&&(ih(r),e.pages.remove(r),e.pages.splice(n,0,r))},deletePages(t){const n=e.pages.indexOf(e.activePage);t.forEach(a=>{const o=e.pages.find(s=>s.id===a);o2(o)});const r=Math.min(e.pages.length-1,n),i=e.pages[r];i&&(e._activePageId=i.id),e.selectedElementsIds=e.selectedElementsIds.filter(a=>e.getElementById(a))},groupElements(t,n={}){const r=t.map(s=>e.getElementById(s)),i=r[0].page;if(r.forEach(s=>{s&&ih(s)}),!r.length)return;const a=i.children.reduce((s,u)=>{if(u.type==="group"){const h=u.name.match(/group-(\d+)/);if(h){const c=parseInt(h[1],10);return Math.max(s,c)}}return s},0),o=Object.assign({id:Ll(10),name:`group-${a+1}`,children:r,type:"group"},n);return i.children.push(o),e.selectedElementsIds=[o.id],i.children.find(s=>s.id===o.id)},ungroupElements(t){const n=t.map(i=>e.getElementById(i)),r=[];n.forEach(i=>{if(i&&i.type==="group"){const a=i.page,o=a.children.indexOf(i);i.children.forEach(s=>{r.push(s.id)}),i.children.forEach(s=>{ih(s),a.children.push(s)}),a.children.splice(o,1)}}),e.selectedElementsIds=r},deleteElements(t){const n=[];e.find(r=>(t.includes(r.id)&&n.push(r),!1)),n.forEach(r=>{o2(r)}),e.selectedElementsIds=e.selectedElementsIds.filter(r=>e.getElementById(r))},on(t,n){if(t==="change"){let r=e.toJSON();return r7(e,i=>{const a=e.toJSON();!vp(r,a)&&(r=a,n(a))})}},async _toCanvas({pixelRatio:t,ignoreBackground:n,pageId:r,mimeType:i,includeBleed:a,_skipTimeout:o,quickMode:s=!1}={}){var u;const h=t||1;r=r||((u=e.pages[0])===null||u===void 0?void 0:u.id);const c=e.pages.find(N=>N.id===r);if(!c)throw new Error(`No page for export with id ${r}`);const m=e._elementsPixelRatio;h>e._elementsPixelRatio&&e.setElementsPixelRatio(h),s?c?.set({_forceMount:!0}):c?.set({_exporting:!0});const g=await TT(()=>{const N=un.stages.filter($=>$.getAttr("pageId")===r);return N.length===0?null:N});if(!g)throw c?.set({_forceMount:!1,_exporting:!1}),e.setElementsPixelRatio(m),new Error(`Export is failed. Can not find stage for page ${r}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);g.length>1&&console.error(`Polotno error: Detected several canvas elements for page "${r}" in the document. This is not supported and will lead to incorrect export. Make sure to use unique ids for all pages and make sure you unmount <Workspace /> when it is not needed.`);const d=g[0];await e.waitLoading({_skipTimeout:o});const y=d.findOne(".page-container");if(!y)throw e.setElementsPixelRatio(m),c?.set({_forceMount:!1,_exporting:!1}),new Error("Export is failed. Canvas was unmounted.");const _=d.position();d.position({x:0,y:0}),d.find("Transformer").forEach(N=>{N.setAttr("oldVisible",N.visible()),N.visible(!1)}),y.find(".page-background").forEach(N=>N.shadowEnabled(!1)),y.find(".page-background").forEach(N=>N.strokeEnabled(!1)),y.find(".highlighter").forEach(N=>N.visible(!1));const x=y.findOne(".page-background-group"),b=x.clip();x.clip({x:null,y:null,width:null,height:null});const S=y.findOne(".elements-container"),k=S.clip();S.clip({x:null,y:null,width:null,height:null});const E=y.find(N=>!N.visible()&&N.getAttr("editModeEnabled")&&!N.getAttr("hideInExport"));E.forEach(N=>{N.setAttr("oldVisible",N.visible()),N.show()});const A=y.find(N=>N.getAttr("hideInExport"));A.forEach(N=>{N.setAttr("oldVisible",N.visible()),N.hide()}),n&&y.find(".page-background").forEach(N=>N.hide());const R=a?c.bleed:0;let O=R;!e.bleedVisible&&a||(e.bleedVisible||a?e.bleedVisible&&a?O=0:e.bleedVisible&&!a&&(O=-c.bleed):O=0);const I=document.createElement("canvas");I.width=Math.round((c.computedWidth+2*R)*h),I.height=Math.round((c.computedHeight+2*R)*h);const j=I.getContext("2d");i==="image/jpeg"&&(j.fillStyle="white",j.fillRect(0,0,I.width,I.height));const D=y.scale();y.scale({x:1,y:1});const C=y.toCanvas({x:y.x()-O,y:y.y()-O,width:c.computedWidth+2*R,height:c.computedHeight+2*R,pixelRatio:h});return y.scale(D),j.drawImage(C,0,0,I.width,I.height),un.Util.releaseCanvas(C),n&&y.find(".page-background").forEach(N=>N.show()),A.forEach(N=>{N.visible(N.getAttr("oldVisible"))}),E.forEach(N=>{N.visible(N.getAttr("oldVisible"))}),y.find(".page-background").forEach(N=>N.shadowEnabled(!0)),y.find(".page-background").forEach(N=>N.strokeEnabled(!0)),d.find("Transformer").forEach(N=>{N.visible(N.getAttr("oldVisible"))}),y.find(".highlighter").forEach(N=>N.visible(!0)),x.clip(b),S.clip(k),d.position(_),c?.set({_exporting:!1,_forceMount:!1}),await new Promise(N=>setTimeout(N)),e.setElementsPixelRatio(m),I},async toDataURL(t={}){var{mimeType:n,quality:r,dpi:i,dpiMetadata:a="auto"}=t,o=Kd(t,["mimeType","quality","dpi","dpiMetadata"]);const s=await e._toCanvas(Object.assign({mimeType:n},o)),u=n||"image/png",h=s.toDataURL(u,r);un.Util.releaseCanvas(s);const c=i??e.dpi;return u!=="image/png"&&u!=="image/jpeg"||a==="never"||a==="auto"&&c===72?h:LT(h,u,c)},async toBlob(t={}){var{mimeType:n,quality:r}=t,i=Kd(t,["mimeType","quality"]);const a=await e._toCanvas(Object.assign({mimeType:n},i)),o=await new Promise(s=>{a.toBlob(s,n,r)});return un.Util.releaseCanvas(a),o},async saveAsImage(t={}){var{fileName:n}=t,r=Kd(t,["fileName"]);const i=r.mimeType||"image/png",a=i.split("/")[1];U1(await e.toDataURL(r),n||"polotno."+a)},async _toPDF(t){const n=t.dpi||e.dpi,r=t.parallel||1,i=t.unit||(e.unit==="px"?"mm":e.unit),a=t.pixelRatio||1,o=t.pageIds||e.pages.map(k=>k.id),s=e.pages.filter(k=>o.includes(k.id)),u=await gT(),h=k=>ag({px:k,unit:i,dpi:n}),c=t.cropMarkSize||0,m=h(c),g=s[0]||{},d=t.includeBleed?g.bleed:0,y=h(g.computedWidth+2*d+2*m),_=h(g.computedHeight+2*d+2*m);var x=new u({unit:i,orientation:y>_?"landscape":"portrait",format:[y,_],compress:!0,putOnlyUsedFonts:!0});x.deletePage(1);const b=((k,E)=>{for(var A=[],R=0;R<k.length;R+=E)A.push(k.slice(R,R+E));return A})(s,r);let S=0;for(const k of b){const E=k.map(async A=>{const R=t.includeBleed?A.bleed:0,O=A.computedWidth+2*R+2*c,I=A.computedHeight+2*R+2*c,j=h(O),D=h(I);let C=0,N=a;for(;C<10;){C+=1,C===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const $=await e.toDataURL(Object.assign(Object.assign({},t),{pageId:A.id,pixelRatio:N}));if($.length>20)return t.onProgress&&t.onProgress(++S/o.length*.9),{url:$,width:j,height:D,widthPx:O,heightPx:I};N*=.8}});(await Promise.all(E)).forEach(({url:A,width:R,height:O,widthPx:I,heightPx:j})=>{x.addPage([R,O],R>O?"landscape":"portrait");const D=x.getCurrentPageInfo();var C;switch(i){case"pt":C=1;break;case"mm":C=72/25.4;break;case"cm":C=72/2.54;break;case"in":C=72;break;case"px":C=.75;break;case"pc":case"em":C=12;break;case"ex":C=6;break;default:throw"Invalid unit: "+i}if(D.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:R*C,topRightY:O*C},D.pageContext.artBox={bottomLeftX:h(c+d)*C,bottomLeftY:h(c+d)*C,topRightX:h(I-c-d)*C,topRightY:h(j-c-d)*C},D.pageContext.bleedBox={bottomLeftX:h(c+d)*C,bottomLeftY:h(c+d)*C,topRightX:h(I-c-d)*C,topRightY:h(j-c-d)*C},m){x.setLineWidth(h(1));const N=m+h(d);x.line(N,0,N,m),x.line(0,N,m,N),x.line(R-N,0,R-N,m),x.line(R,N,R-m,N),x.line(0,O-N,m,O-N),x.line(N,O,N,O-m),x.line(R,O-N,R-m,O-N),x.line(R-N,O,R-N,O-m)}x.addImage(A,m,m,R-2*m,O-2*m,void 0,"FAST")})}return x},toPDFDataURL:async t=>(await e._toPDF(Object.assign({mimeType:"image/jpeg"},t))).output("datauristring"),async toGIFDataURL(t={}){const n=t.pixelRatio||1,r=await vT({width:e.width*n,height:e.height*n}),i=1e3/(t.fps||10),a=e.duration/i;for(let o=0;o<a-1;o++){const s=o*i||1;e.setCurrentTime(s);let u=0,h="";for(const m of e.pages)if(u+=m.duration,m.set({_rendering:u>s}),u>s){h=m.id;break}const c=await e._toCanvas({pixelRatio:n,pageId:h,_skipTimeout:!0});r.addFrame(c.getContext("2d"),{delay:i,copy:!0})}for(const o of e.pages)o.set({_rendering:!1});return e.stop(),r.render(),new Promise(o=>{r.on("finished",function(s){(function(u,h){var c=new FileReader;c.onload=function(m){h(m.target.result)},c.readAsDataURL(u)})(s,o)})})},async saveAsGIF(t={}){var{fileName:n}=t,r=Kd(t,["fileName"]);const i=await e.toGIFDataURL(r);U1(i,n||"polotno.gif")},async toHTML({elementHook:t}={elementHook:void 0}){const n=e.toJSON();return FT({json:n,elementHook:t})},async saveAsHTML({fileName:t,elementHook:n}={}){const r=await e.toHTML({elementHook:n}),i="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(r)));U1(i,t||"polotno.html")},async toSVG({elementHook:t,pageId:n,fontEmbedding:r="inline"}={fontEmbedding:"inline"}){var i;const a=e.toJSON();n=n||((i=a.pages[0])===null||i===void 0?void 0:i.id);const o=a.pages.find(s=>s.id===n);return qT({json:Object.assign(Object.assign({},a),{pages:o?[o]:[]}),elementHook:t,fontEmbedding:r})},async saveAsSVG({fileName:t,elementHook:n,pageId:r,fontEmbedding:i="inline"}={}){const a=await e.toSVG({elementHook:n,pageId:r,fontEmbedding:i}),o="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(a)));U1(o,t||"polotno.svg")},async saveAsPDF(t={}){var{fileName:n}=t,r=Kd(t,["fileName"]);(await e._toPDF(Object.assign({mimeType:"image/jpeg"},r))).save(n||"polotno.pdf")},async waitLoading({_skipTimeout:t=!1}={}){t||await new Promise(n=>setTimeout(n,50)),await aO()},toJSON:()=>({width:e.width,height:e.height,fonts:bc(e.fonts),pages:bc(e.pages),audios:bc(e.audios),unit:e.unit,dpi:e.dpi,custom:e.custom,schemaVersion:e.schemaVersion}),loadJSON(t,n=!1){var r;const i=JSON.parse(JSON.stringify(t)),a=i.schemaVersion||0;a<1&&Ir.htmlRenderEnabled&&mi({children:i.pages},h=>{if(h.type==="text"){const m=h.letterSpacing*16;h.letterSpacing=m/h.fontSize}}),a<2&&mi({children:i.pages},h=>{h.filters&&Object.keys(h.filters).forEach(c=>{if(["warm","cold","natural"].includes(c))return;const m=h.filters[c];m&&typeof m.intensity=="number"&&(m.intensity=m.intensity/100)})}),delete i.schemaVersion;const o=e.pages.indexOf(e.activePage);let s=(r=i.pages[o]||i.pages[0])===null||r===void 0?void 0:r.id;i._activePageId=s;const u=Object.assign({},bc(e));Object.assign(u,i),u.history=n?e.history.toJSON():{history:[],undoIdx:-1},Ev(e,u)},clear({keepHistory:t=!1}={}){const n=e.pages.map(r=>r.id);e.deletePages(n),e.custom=null,t||e.history.clear()},addFont(t){e.removeFont(t.fontFamily),e.fonts.push(t)},removeFont(t){e.fonts.filter(n=>n.fontFamily===t).forEach(n=>o2(n))},addAudio(t){const n=M4.create(Object.assign({id:Ll(10)},t));e.audios.push(n)},removeAudio(t){const n=e.audios.find(r=>r.id===t);n&&e.audios.remove(n)},async loadFont(t,n=""){const r=e.fonts.find(a=>a.fontFamily===t)||cy.find(a=>a.fontFamily===t);let i=[{fontStyle:"normal",fontWeight:"normal"},{fontStyle:"normal",fontWeight:"bold"}];return r?(r.styles&&(i=r.styles.map(a=>({fontStyle:a.fontStyle||"normal",fontWeight:a.fontWeight||"normal"}))),fO(r)):cO(t),Promise.all(i.map(a=>lO(t,a.fontStyle,a.fontWeight,n)))},validate:t=>lh.validate(t,[{path:"",type:lh}]).map(n=>({path:"store"+n.context.map(r=>r.path).join("."),message:n.message}))}));function HT({key:e,showCredit:t}={key:"",showCredit:!1}){return lh.create({_forceShowCredit:t,_key:e})}const yx=Dt.model("Node",{id:Dt.identifier,type:"none",name:"",opacity:1,custom:Dt.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(e=>{for(var t in e)e[t]===null&&(e[t]=void 0);return e}).postProcessSnapshot(e=>{const t=Object.assign({},e),n={};for(var r in t)r[0]!=="_"&&(n[r]=e[r]);return n}).views(e=>({get locked(){return!(e.draggable||e.contentEditable||e.styleEditable||e.resizable)},get page(){return Qf(e,yp)},get store(){return Qf(e,lh)},get top(){let t=e;for(;;){if(!F1(t,sd))return t;t=Qf(t,sd)}},get parent(){if(F1(e,sd)){const t=Qf(e,sd);return t&&t.children&&t.children.length,t}if(F1(e,yp)){const t=Qf(e,yp);return t&&t.children&&t.children.length,t}if(F1(e,lh)){const t=Qf(e,lh);return t&&t.pages&&t.pages.length,t}return null},get zIndex(){return e.parent.children.indexOf(e)}})).actions(e=>({toJSON:()=>Object.assign({},bc(e))})).actions(e=>({clone(t={},{skipSelect:n=!1}={}){const r=JSON.parse(JSON.stringify(e.toJSON()));return t.id=t.id||Ll(10),mi(r,i=>{i.id=Ll(10)}),Object.assign(r,t),e.page.addElement(r,{skipSelect:n})},set(t){Object.assign(e,t)},moveUp(){e.page.moveElementsUp([e.id])},moveTop(){e.page.moveElementsTop([e.id])},moveDown(){e.page.moveElementsDown([e.id])},moveBottom(){e.page.moveElementsBottom([e.id])},setZIndex(t){e.parent.setElementZIndex(e.id,t)},beforeDestroy(){}})),I4={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}}},j4={right:{cropX:-1},left:{cropX:1},up:{cropY:1},down:{cropY:-1}},GT={none:()=>({}),fade:({dTime:e,element:t,animation:n})=>{const r=e/n.duration;return n.type==="enter"?{opacity:r*t.opacity}:{opacity:(1-r)*t.opacity}},rotate:({dTime:e,element:t,animation:n})=>{const r=e/n.duration*360;return DN({x:t.x,y:t.y,width:t.width,height:t.height,rotation:t.rotation},r)},blink:({dTime:e,element:t,animation:n})=>{const r=n.duration,i=e%r/(r/2),a=i<=1?i:2-i;return{opacity:t.opacity*a}},bounce:({dTime:e,element:t,animation:n})=>{var r;const i=n.duration,a=i/2,o=(r=n.data.strength)!==null&&r!==void 0?r:1,s={},u={x:t.x+t.width/3*o,y:t.y+t.height/3*o,width:t.width/3*o,height:t.height/3*o,fontSize:t.fontSize/3*o},h={x:t.x,y:t.y,width:t.width,height:t.height,fontSize:t.fontSize},c=e%i/a,m=c<=1?c:2-c;for(let g in u){const d=u[g],y=h[g]-d;s[g]=d+m*y}return s},move:({dTime:e,element:t,animation:n})=>{var r;const i=I4[n.data.direction]||I4.right,a=(r=n.data.strength)!==null&&r!==void 0?r:1,o={};for(var s in i.from){let u=i.from[s],h=i.to[s];n.type==="exit"&&(u=i.to[s],h=-i.from[s]),u*=a,h*=a;const c=t[s]+u,m=t[s]+h-c;o[s]=c+e/n.duration*m}return o},zoom:({dTime:e,element:t,animation:n})=>{var r;const i={},a=1+(((n.data.direction||"in")==="in"?.75:1.25)-1)*((r=n.data.strength)!==null&&r!==void 0?r:1),o=t.rotation*Math.PI/180,s=Math.cos(o),u=Math.sin(o),h=t.width*(1-a),c=t.height*(1-a),m=(h*s-c*u)/2,g=(h*u+c*s)/2,d={x:t.x+m,y:t.y+g,width:t.width*a,height:t.height*a,fontSize:t.fontSize*a},y={x:t.x,y:t.y,width:t.width,height:t.height,fontSize:t.fontSize};for(var _ in d){let x=d[_],b=y[_];if(n.type==="exit"){const k=x;x=b,b=k}const S=b-x;i[_]=x+e/n.duration*S}return i},cameraZoom:({dTime:e,element:t,animation:n})=>{var r,i,a;const o={},s=n.data.direction||"right",u=j4[s]||j4.right,h=(r=n.data.movementStrength)!==null&&r!==void 0?r:.1,c=(i=n.data.shakeStrength)!==null&&i!==void 0?i:.015;a=n.data.zoomStrength;const m=e/n.duration,g=c*(1-m),d=Math.sin(12*m)*g*.7+Math.sin(8*m)*g*.3;n.type==="exit"&&Math.max(t.cropWidth||1,t.cropHeight||1),n.type;const y=1-Math.pow(1-m,2),_=t.cropX||0,x=t.cropY||0,b=t.cropWidth||1,S=t.cropHeight||1,k=b,E=S;let A,R,O=0,I=0;if(u.cropX){const j=u.cropX>0?1-(_+b):_;O=Math.min(j,Math.abs(h))*u.cropX}if(u.cropY){const j=u.cropY>0?1-(x+S):x;I=Math.min(j,Math.abs(h))*u.cropY}return n.type==="enter"?(A=u.cropX?_+O*(1-y):_,R=u.cropY?x+I*(1-y):x):(A=u.cropX?_+O*y:_,R=u.cropY?x+I*y:x),o.cropX=Math.max(0,Math.min(1-k,A+d*k)),o.cropY=Math.max(0,Math.min(1-E,R+d*E)),o.cropWidth=k,o.cropHeight=E,o}},km=({element:e,dTime:t,animation:n})=>{const r=GT[n.name];return r?r({element:e,dTime:t,animation:n}):(console.error("Can not find animation type: "+n.name),{})},WT=Dt.model("Animation",{delay:0,duration:500,enabled:!0,type:Dt.enumeration("Type",["enter","exit","loop"]),name:"none",data:Dt.frozen({})}),Am=(e,t)=>{const n={};for(const r in t)if(typeof e[r]=="number"&&typeof t[r]=="number"){const i=t[r]-e[r];i!==0&&(n[r]=i)}return n},VT=Dt.model("ShapeFilter",{intensity:1}),D4=["temperature","contrast","highlights","shadows","white","black","saturation","vibrance"],Vp=yx.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:Dt.array(WT),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,filters:Dt.map(VT),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(e=>{const t=Object.assign(Object.assign({},e),{x:e.x||0,y:e.y||0,filters:Array.isArray(e.filters)?{}:e.filters});return"width"in e&&(t.width=t.width||1),"height"in e&&(t.height=t.height||1),e.locked&&(t.draggable=!1,t.contentEditable=!1,t.styleEditable=!1,t.resizable=!1,t.removable=!1),t}).views(e=>{const t=Qn({x:e.x,y:e.y,width:e.width,height:e.height,rotation:e.rotation,opacity:e.opacity,color:e.color,fontSize:e.fontSize}),n=Un(i=>{Object.assign(t,i)}),r=Un(i=>{for(const a in i)typeof t[a]=="number"&&(t[a]=t[a]+i[a])});return{get a(){const{currentTime:i}=e.store;if(n({x:e.x,y:e.y,width:e.width,height:e.height,rotation:e.rotation,opacity:e.opacity,color:e.color,fontSize:e.fontSize,cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight}),i===0)return t;const a=i-e.page.startTime;if(a>e.page.duration||a<0)return t;const o=e.store.animatedElementsIds;if(o.length&&!o.includes(e.id))return t;const s=e.animations.find(g=>g.type==="enter"),u=s?.enabled&&a<s.delay;u&&n({opacity:0});const h=s?.enabled&&a>=s.delay&&a<=s.delay+s.duration;if(h){const g=a-s.delay,d=km({element:e,animation:s,dTime:g}),y=Am(e,d);r(y)}const c=e.animations.find(g=>g.type==="exit");if(!u&&!h&&c?.enabled&&a>=e.page.duration-c.duration-c.delay&&a<=e.page.duration-c.delay){const g=a-(e.page.duration-c.duration-c.delay),d=km({element:e,animation:c,dTime:g}),y=Am(e,d);r(y)}c?.enabled&&a>=e.page.duration-c.delay&&n({opacity:0});const m=e.animations.find(g=>g.type==="loop");if(m?.enabled){const g=km({element:e,animation:m,dTime:a}),d=Am(e,g);r(d)}return t},animated:i=>e.a[i]}}).actions(e=>({setAnimation(t,n){const r=e.animations.find(i=>i.type===t);r?Object.assign(r,n):e.animations.push(Object.assign({type:t},n))},setFilter(t,n){D4.includes(t)||e.filters.forEach((r,i)=>{D4.includes(i.toString())||e.filters.delete(i.toString())}),n==null?e.filters.delete(t):e.filters.set(t,{intensity:n})}})),bx=Vp.named("Text").props({type:"text",text:"",placeholder:"",fontSize:14,fontFamily:"Roboto",fontStyle:"normal",fontWeight:"normal",textDecoration:"",textTransform:"none",fill:"black",align:"center",width:100,height:0,verticalAlign:"top",strokeWidth:0,stroke:"black",lineHeight:Dt.optional(Dt.union(Dt.number,Dt.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5,curveEnabled:!1,curvePower:.5}).preProcessSnapshot(e=>Object.assign({},e)).actions(e=>({toggleEditMode(t){e._editModeEnabled=t??!e._editModeEnabled,e._editModeEnabled?e.store.history.startTransaction():e.store.history.endTransaction()}})),og=Vp.named("Image").props({type:"image",width:100,height:100,src:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,cornerRadius:0,flipX:!1,flipY:!1,clipSrc:"",borderColor:"black",borderSize:0,keepRatio:!1,stretchEnabled:!1}).extend(e=>{const t=Qn.box(!1);let n=!1;return{views:{get _cropModeEnabled(){return t.get()}},actions:{toggleCropMode(r){const i=r??!t.get();t.set(i),i&&!n?(e.store.history.startTransaction(),n=!0):!i&&n&&(e.store.history.endTransaction(),n=!1)},beforeDestroy(){n&&(e.store.history.endTransaction(),n=!1)}}}}),wx=og.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1}),xx=Vp.named("Line").props({type:"line",width:400,height:10,color:"black",dash:Dt.array(Dt.number),startHead:"",endHead:""}).actions(e=>({})),_x=Vp.named("SVG").props({type:"svg",src:"",maskSrc:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,keepRatio:!0,stretchEnabled:!0,flipX:!1,flipY:!1,width:100,height:100,borderColor:"black",borderSize:0,cornerRadius:0,colorsReplace:Dt.map(Dt.string)}).preProcessSnapshot(e=>Object.assign(Object.assign({},e),{src:e.src||e.svgSource,colorsReplace:Array.isArray(e.colorsReplace)?{}:e.colorsReplace})).actions(e=>({replaceColor(t,n){e.colorsReplace.set(t,n)}})),Sx=Vp.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:Dt.array(Dt.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0}),Ex=og.named("Gif").props({type:"gif",duration:0,keepRatio:!0});var YT=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const mi=(e,t)=>{if(e.children)for(const n of e.children){if(t(n)===!0)break;mi(n,t)}},XT=[...new Array(20)].map((e,t)=>Dt.late(()=>KT[t])),kx=Dt.union({dispatcher:e=>{const t=ky[e.type];if(!t)throw new Error(`Unknown element type: "${e.type}"`);return t}},_x,bx,og,xx,wx,Sx,Ex,Dt.late(()=>sd),...XT),sd=yx.named("Group").props({type:"group",children:Dt.array(kx)}).views(e=>({get draggable(){let t=!0;return mi(e,n=>{n.draggable||(t=!1)}),t},get resizable(){let t=!0;return mi(e,n=>{n.resizable||(t=!1)}),t},get contentEditable(){let t=!0;return mi(e,n=>{n.contentEditable||(t=!1)}),t},get styleEditable(){let t=!0;return mi(e,n=>{n.styleEditable||(t=!1)}),t},get locked(){let t=!0;return mi(e,n=>{n.locked||(t=!1)}),t}})).actions(e=>({set(t){var{draggable:n,contentEditable:r,styleEditable:i,resizable:a}=t,o=YT(t,["draggable","contentEditable","styleEditable","resizable"]);n!==void 0&&mi(e,s=>{s.set({draggable:n})}),r!==void 0&&mi(e,s=>{s.set({contentEditable:r})}),i!==void 0&&mi(e,s=>{s.set({styleEditable:i})}),a!==void 0&&mi(e,s=>{s.set({resizable:a})}),Object.assign(e,o)},addElement(t,{skipSelect:n=!1}={}){const r=ky[t.type];if(!r)return void console.error("Can not find model with type "+t.type);t.children&&t.children.forEach(a=>{a.id=a.id||Ll(10)});const i=r.create(Object.assign({id:Ll(10)},t));return e.children.push(i),i.selectable&&!n&&e.store.selectElements([i.id]),i},setElementZIndex(t,n){const r=e.children.find(i=>i.id===t);r&&(ih(r),e.children.remove(r),e.children.splice(n,0,r))},setAnimation(t,n){mi(e,r=>{r.setAnimation(t,n)})}})),KT=[],ky={svg:_x,text:bx,image:og,group:sd,line:xx,video:wx,figure:Sx,gif:Ex},ZT={text:sL,image:t3,svg:t3,line:qN,video:VN,figure:iT,group:Qr(e=>{const{element:t,store:n}=e,{children:r}=t,i=t.selectable||n.role==="admin";return oe.createElement(hr,{opacity:t.opacity,listening:i,hideInExport:!t.showInExport,id:t.id},r.map(a=>oe.createElement(Ax,Object.assign({},e,{key:a.id,store:n,element:a}))))}),gif:fT},QT=(e,t)=>{const n=[];mi(e,c=>{c.type!=="group"&&n.push(c.a)});const r=[];n.forEach(c=>{const m=[{x:0,y:0},{x:0+c.width,y:0},{x:0+c.width,y:0+c.height},{x:0,y:0+c.height}],g=new un.Transform;g.translate(c.x,c.y),g.rotate(un.Util.degToRad(c.rotation)),m.forEach(d=>{const y=g.point(d);r.push(y)})});const i=new un.Transform;i.rotate(-un.Util.degToRad(t));let a=1/0,o=1/0,s=-1/0,u=-1/0;r.forEach(c=>{const m=i.point(c);a=Math.min(a,m.x),o=Math.min(o,m.y),s=Math.max(s,m.x),u=Math.max(u,m.y)}),i.invert();const h=i.point({x:a,y:o});return{x:h.x,y:h.y,width:s-a,height:u-o,rotation:t}},Ax=Qr(e=>{var t;const{element:n,store:r}=e,[i,a]=oe.useState(!1),o=r.selectedElements.indexOf(n)>=0&&n.selectable,s=((t=n.parent)===null||t===void 0?void 0:t.type)==="group",u=(m=>{const[g,d]=oe.useState(null);return oe.useEffect(()=>{const y=setTimeout(()=>{const _=m.page.id,x=un.stages.find(b=>b.getAttr("pageId")===_);x||console.error("No stage is found for element",m.id),d(x)});return()=>clearTimeout(y)},[m.id]),g})(n),h=u?.findOne("Transformer");oe.useEffect(()=>{if(u){const m=d=>{const y=d.target.findAncestor(".element",!0),_=r.getElementById(y?.id()),x=_?.top,b=x?.id;a(b===n.id)};u.on("mouseover",m);const g=()=>{a(!1)};return u.on("mouseleave",g),()=>{u.off("mouseover",m),u.off("mouseleave",g)}}},[u]);let c=ZT[e.element.type];return e.element.type==="text"&&Ir.htmlRenderEnabled&&(c=RN),e.element.visible?c?oe.createElement(hr,{name:"element-container"},oe.createElement(c,Object.assign({},e)),i&&!o&&!s&&oe.createElement(dT,{element:n.type==="group"?{a:QT(n,h?.rotation()||0)}:n})):(console.error("Can not find component for "+e.element.type),null):null});function JT(e,t=.5){if(e.length<3)return e;const n=[];n.push(e[0]);for(let r=0;r<e.length-1;r++){const i=e[Math.max(0,r-1)],a=e[r],o=e[r+1],s=e[Math.min(e.length-1,r+2)],u=10;for(let h=0;h<u;h++){const c=h/u,m=c*c,g=m*c,d=.5*(2*a.x+(-i.x+o.x)*c+(2*i.x-5*a.x+4*o.x-s.x)*m+(-i.x+3*a.x-3*o.x+s.x)*g),y=.5*(2*a.y+(-i.y+o.y)*c+(2*i.y-5*a.y+4*o.y-s.y)*m+(-i.y+3*a.y-3*o.y+s.y)*g);n.push({x:d,y})}}return n.push(e[e.length-1]),n}function eR(e){if(e.length===0)return"";if(e.length===1){const n=e[0];return`M ${n.x},${n.y} L ${n.x+.1},${n.y}`}let t=`M ${e[0].x},${e[0].y}`;for(let n=1;n<e.length-1;n++){const r=e[n],i=e[n+1],a=(r.x+i.x)/2,o=(r.y+i.y)/2;t+=` Q ${r.x},${r.y} ${a},${o}`}if(e.length>1){const n=e[e.length-1];t+=` L ${n.x},${n.y}`}return t}function tR(e){if(e.length===0)return{x:0,y:0,width:0,height:0};let t=e[0].x,n=e[0].y,r=e[0].x,i=e[0].y;for(const a of e)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x),i=Math.max(i,a.y);return{x:t,y:n,width:r-t,height:i-n}}function nR(e,t){if(e.length===0)throw new Error("Cannot create SVG from empty path");const n=JT(e),r=tR(n),i=t.strokeWidth,a=r.x-i,o=r.y-i,s=r.width+2*i,u=r.height+2*i,h=`
|
|
389
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${s}" height="${u}" viewBox="0 0 ${s} ${u}">
|
|
390
|
+
<path
|
|
391
|
+
d="${eR(n.map(c=>({x:c.x-a,y:c.y-o})))}"
|
|
392
|
+
stroke="${t.stroke}"
|
|
393
|
+
stroke-width="${t.strokeWidth}"
|
|
394
|
+
stroke-linecap="round"
|
|
395
|
+
stroke-linejoin="round"
|
|
396
|
+
fill="none"
|
|
397
|
+
/>
|
|
398
|
+
</svg>
|
|
399
|
+
`.trim();return{src:Mf(h),x:a,y:o,width:s,height:u}}const rR=Qr(({store:e,page:t,width:n,height:r,scale:i,xPadding:a,yPadding:o,bleed:s})=>{const[u,h]=oe.useState(!1),[c,m]=oe.useState([]),g=oe.useRef(null),d=e.tool==="draw",{strokeWidth:y,stroke:_,opacity:x,brushType:b}=e.toolOptions,S=oe.useCallback(R=>{if(!d||(h(!0),R.cancelBubble=!0,!R.target.getStage()))return;const O=g.current.getRelativePointerPosition();O&&m([{x:O.x,y:O.y}])},[d,i,a,o,s]),k=oe.useCallback(R=>{if(!d||!u||(R.cancelBubble=!0,!R.target.getStage()))return;const O=g.current.getRelativePointerPosition();O&&m(I=>[...I,{x:O.x,y:O.y}])},[d,u,i,a,o,s]),E=oe.useCallback(()=>{if(d&&u){if(h(!1),c.length>1)try{const R=nR(c,{stroke:_,strokeWidth:y,smooth:!0}),O=e.selectedElementsIds.slice();e.history.transaction(()=>{t.addElement({type:"svg",x:R.x,y:R.y,width:R.width,height:R.height,src:R.src,opacity:x},{skipSelect:!0})}),e.selectElements(O)}catch(R){console.error("Error creating path SVG:",R)}m([])}},[d,u,c,_,y,x,t,e.history,e]),A=oe.useMemo(()=>c.flatMap(R=>[R.x,R.y]),[c]);return oe.useEffect(()=>{if(d&&g.current){const R=g.current.getStage();if(!R)return;const O=y*i;if(O>100||O<4)R.container().style.cursor="crosshair";else{const I=O/2,j=O/2,D=`data:image/svg+xml;base64,${btoa(`<svg xmlns="http://www.w3.org/2000/svg" width="${O}" height="${O}" viewBox="0 0 ${O} ${O}">
|
|
400
|
+
<circle cx="${j}" cy="${j}" r="${I-1}" fill="${_}" opacity="${x}" stroke="white" stroke-width="1"/>
|
|
401
|
+
<circle cx="${j}" cy="${j}" r="${I-1}" fill="none" stroke="black" stroke-width="1" opacity="0.3"/>
|
|
402
|
+
</svg>`)}`;R.container().style.cursor=`url("${D}") ${j} ${j}, crosshair`}return()=>{R.container()&&(R.container().style.cursor="")}}},[d,_,y,x,i]),d?oe.createElement(hr,{ref:g,listening:d,x:a+s*i,y:o+s*i,scaleX:i,scaleY:i},oe.createElement(Pr,{x:-(a+s*i)/i,y:-(o+s*i)/i,width:n/i,height:r/i,fill:"transparent",onMouseDown:S,onMouseMove:k,onMouseUp:E,onTouchStart:S,onTouchMove:k,onTouchEnd:E}),c.length>0&&oe.createElement(yc,{points:A,stroke:_,strokeWidth:y,lineCap:"round",lineJoin:"round",opacity:x,tension:.5,listening:!1})):null});function iR(e,t,n="scale"){const r=t.width/t.height;let i,a;r>=e.width/e.height?(i=e.width,a=e.width/r):(i=e.height*r,a=e.height);let o=0,s=0;return n==="left-top"?(o=0,s=0):n==="left-middle"?(o=0,s=(e.height-a)/2):n==="left-bottom"?(o=0,s=e.height-a):n==="center-top"?(o=(e.width-i)/2,s=0):n==="center-middle"?(o=(e.width-i)/2,s=(e.height-a)/2):n==="center-bottom"?(o=(e.width-i)/2,s=e.height-a):n==="right-top"?(o=e.width-i,s=0):n==="right-middle"?(o=e.width-i,s=(e.height-a)/2):n==="right-bottom"?(o=e.width-i,s=e.height-a):n==="scale"?(o=0,s=0,i=e.width,a=e.height):console.error(new Error("Unknown clip position property - "+n)),{cropX:o,cropY:s,cropWidth:i,cropHeight:a}}var Px=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const F4=un.DD._drag;window.removeEventListener("mousemove",F4),un.DD._drag=function(e){mc(()=>{F4.call(this,e)})},window.addEventListener("mousemove",un.DD._drag);const Cv=new un.Group,vf=20;Cv.add(new un.Rect({width:vf,height:vf,fill:"white"})),Cv.add(new un.Path({scaleX:vf/24,scaleY:vf/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 aR=Cv.toCanvas({pixelRatio:2,width:vf,height:vf}),gf={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:e=>{e.hasName("rotater")&&e.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:aR,fillPatternScaleX:20/vf/2,fillPatternScaleY:20/vf/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},q1={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"]}},oR=e=>oe.createElement(Pr,Object.assign({},e,{preventDefault:!1})),sR=e=>{var{url:t}=e,n=Px(e,["url"]);const[r,i]=ly(t,"anonymous"),a=r?iR(r,{width:n.width,height:n.height},"center-middle"):{};return mp(i,t,"page background"),oe.createElement(ju,Object.assign({image:r},n,a))},lR=e=>{const t=Gu({fill:e.fill,a:{width:e.width,height:e.height}});return oe.createElement(Pr,Object.assign({},e,t))},uR=e=>{const{background:t,scale:n,borderColor:r}=e,i=Px(e,["background","scale","borderColor"]),a=oe.useMemo(()=>!!un.Util.colorToRGBA(t)||la(t),[t]),o=oe.useMemo(()=>{const s=document.createElement("canvas"),u=30;s.width=60,s.height=60;const h=s.getContext("2d");return h&&(h.fillStyle="black",h.fillRect(u,0,u,u),h.fillRect(0,u,u,u)),s},[]);return oe.createElement(oe.Fragment,null,oe.createElement(Pr,Object.assign({fillPatternImage:o},i,{opacity:.1,hideInExport:!0})),a?oe.createElement(lR,Object.assign({fill:t},i)):oe.createElement(sR,Object.assign({url:t},i)))},cR=Qr(({selection:e,fill:t="rgba(0, 161, 255, 0.3)",stroke:n="rgb(0, 161, 255)",strokeWidth:r=1})=>e.visible?oe.createElement(Pr,{name:"selection",x:Math.min(e.x1,e.x2),y:Math.min(e.y1,e.y2),width:Math.abs(e.x1-e.x2),height:Math.abs(e.y1-e.y2),fill:t,stroke:n,strokeWidth:r}):null);function fR(e){let t=180*e/Math.PI;return t%=360,t>180?t-=360:t<-180&&(t+=360),Math.round(t)}const hR=Qr(({x:e,y:t,width:n,height:r,rotation:i,anchor:a,store:o,tagFill:s,textFill:u})=>{const h=Cd({x:e,y:t,width:n,height:r,rotation:un.Util.radToDeg(i)});if(a===void 0)return null;const c=(r/2+70)*Math.cos(i-Math.PI/2),m=(r/2+70)*Math.sin(i-Math.PI/2),g=C4({unit:o.unit,dpi:o.dpi,px:n/o.scale,precious:o.unit==="px"?0:1})+" x "+C4({unit:o.unit,dpi:o.dpi,px:r/o.scale,precious:o.unit==="px"?0:1})+(o.unit==="px"?"":" "+o.unit);return oe.createElement(oe.Fragment,null,oe.createElement(E0,{x:(h.minX+h.maxX)/2+c,y:(h.minY+h.maxY)/2+m,offsetX:14,offsetY:14,visible:a==="rotater"},oe.createElement(k0,{cornerRadius:5,fill:s||"rgb(0, 161, 255)"}),oe.createElement(Uu,{align:"center",verticalAlign:"middle",fill:u||"white",padding:8,text:fR(i).toString()+"°"})),oe.createElement(E0,{x:(h.minX+h.maxX)/2,y:h.maxY+20,visible:a!=="rotater"},oe.createElement(k0,{cornerRadius:5,fill:s||"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),oe.createElement(Uu,{align:"center",verticalAlign:"middle",fill:u||"white",padding:8,text:g})))}),dR=Qr(({elements:e,store:t})=>{const n=e.filter(i=>i.alwaysOnTop),r=e.filter(i=>!i.alwaysOnTop).concat(n);return oe.createElement(oe.Fragment,null,r.map(i=>oe.createElement(Ax,{key:i.id,store:t,element:i,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))}),pR=({store:e})=>{const[t,n]=oe.useState(!1),[r,i]=oe.useState({x:0,y:0});return{open:oe.useCallback(o=>{n(!0),i(o)},[]),close:oe.useCallback(()=>{n(!1)},[]),props:{isOpen:t,offset:r,setIsOpen:n}}},gR=atob("UG9sb3RubyBmcmVlIGxpY2Vuc2UgbGltaXRhdGlvbiBleGNlZWRlZCAtIFBsZWFzZSB1cGdyYWRlIHlvdXIgYWNjb3VudC4="),B4=atob("cmVk"),mR=atob("djAuOS4y"),vR=e=>oe.createElement(oe.Fragment,null,oe.createElement(E0,{fill:B4,height:200},oe.createElement(k0,{fill:B4}),oe.createElement(Uu,Object.assign({},e,{fill:"white",text:gR,height:void 0,padding:10,fontSize:20})))),yR=Qr(({store:e,page:t,width:n,height:r,pageControlsEnabled:i,backColor:a,pageBorderColor:o,activePageBorderColor:s,components:u,bleedColor:h,altCloneEnabled:c,viewportSize:m,selectionRectFill:g,selectionRectStroke:d,selectionRectStrokeWidth:y,snapGuideStroke:_,snapGuideStrokeWidth:x,snapGuideDash:b,transformLabelFill:S,transformLabelTextFill:k,distanceGuideStroke:E,distanceLabelFill:A,distanceLabelTextFill:R,layout:O="vertical",tooltipSafeArea:I})=>{const j=e.bleedVisible?t.bleed:0,D=t.computedWidth+2*j,C=t.computedHeight+2*j,N=(n-D*e.scale)/2,$=(r-C*e.scale)/2,G=oe.useRef(null),te=oe.useRef(null),se=oe.useRef(null),ee=i==null||i,[Q,re]=oe.useState(null),[X,B]=oe.useState({}),F=pR({store:e}),z=e.selectedElements.find(ye=>ye._cropModeEnabled),Y=e.selectedElements.find(ye=>ye.curveEnabled),J=e.selectedShapes.filter(ye=>!ye.resizable).length>0,K=e.selectedShapes.filter(ye=>!ye.draggable).length>0,ie=e.selectedElements.filter(ye=>!ye.visible).length>0;oe.useLayoutEffect(()=>{var ye,we,je;if(!G.current)return;const Le=G.current.getStage(),Ye=e.selectedShapes.map(ot=>ot._cropModeEnabled?null:Le.findOne("#"+ot.id)).filter(ot=>ot),lt=e.selectedElements.length===1,rt=lt&&((ye=e.selectedElements[0])===null||ye===void 0?void 0:ye.type)||"many";q1[rt]?(G.current.setAttrs(Object.assign(Object.assign({},gf),q1[rt])),rt!=="svg"&&rt!=="image"&&rt!=="gif"||e.selectedElements[0].keepRatio||G.current.setAttrs({enabledAnchors:gf.enabledAnchors}),rt==="text"&&Ir.textVerticalResizeEnabled&&G.current.setAttrs({enabledAnchors:(we=q1.text.enabledAnchors)===null||we===void 0?void 0:we.concat(["bottom-center"])}),rt==="text"&<&&e.selectedElements[0].curveEnabled&&G.current.setAttrs({enabledAnchors:q1.many.enabledAnchors})):G.current.setAttrs(gf),J&&G.current.enabledAnchors([]),K&&G.current.rotateEnabled(!1),Ye.find(ot=>ot?.isDragging())&&Ye.forEach(ot=>{ot.isDragging()||ot==null||ot.startDrag()}),G.current.nodes(Ye),ex(),(je=G.current.getLayer())===null||je===void 0||je.batchDraw()},[e.selectedShapes,z,J,ie,K,Y]);const fe=()=>{const ye=G.current;if(!ye)return;if(!ye.isTransforming())return void B({});if(!ye.nodes().length||!ye.isTransforming())return;const we=ye.__getNodeRect(),je=ye?.getActiveAnchor(),Le=ye.getStage();B({anchor:je,x:we.x-Le.x(),y:we.y-Le.y(),rotation:we.rotation,width:we.width,height:we.height})};oe.useEffect(()=>{var ye;(ye=G.current)===null||ye===void 0||ye.update(),fe()},[e.scale]);const ue=uE(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),_e=oe.useRef(!1),Ce=Tf(),$e=Un(ye=>{var we,je,Le,Ye;if(Ce)return;_e.current=!1;const lt=ye.target.findAncestor(".elements-container"),rt=ye.target.findAncestor("Transformer"),ot=ye.target.findAncestor(".page-abs-container");if(lt||rt||ot)return;const dt=(we=ye.target.getStage())===null||we===void 0?void 0:we.getPointerPosition();dt.x-=(je=ye.target.getStage())===null||je===void 0?void 0:je.x(),dt.y-=(Le=ye.target.getStage())===null||Le===void 0?void 0:Le.y(),dt&&(ue.visible=!0,ue.x1=dt.x,ue.y1=dt.y,ue.x2=dt.x,ue.y2=dt.y,((Ye=ye.target.getStage())===null||Ye===void 0?void 0:Ye.getPointersPositions().length)>=2&&(ue.visible=!1))});(({stageRef:ye,containerRef:we,viewportSize:je})=>{oe.useEffect(()=>{var Le;const Ye=(Le=we.current)===null||Le===void 0?void 0:Le.closest(".polotno-workspace-inner");function lt(){var rt;if(!ye.current)return;const ot=(rt=we.current)===null||rt===void 0?void 0:rt.getBoundingClientRect(),dt=Ye?.getBoundingClientRect(),Ct=Math.max(0,dt.left-ot.left-100),Zt=Math.max(0,dt.top-ot.top-100);ye.current.position({x:-Ct,y:-Zt}),ye.current.container().style.transform=`translate(${Ct}px, ${Zt}px)`}return lt(),Ye.addEventListener("scroll",lt),()=>{Ye.removeEventListener("scroll",lt)}},[je.width,je.height])})({stageRef:te,containerRef:se,viewportSize:m}),oe.useEffect(()=>{const ye=Un(je=>{var Le,Ye,lt,rt;if(!ue.visible)return;(Le=te.current)===null||Le===void 0||Le.setPointersPositions(je);let ot=(Ye=te.current)===null||Ye===void 0?void 0:Ye.getPointerPosition();ot?(ot.x-=(lt=te.current)===null||lt===void 0?void 0:lt.x(),ot.y-=(rt=te.current)===null||rt===void 0?void 0:rt.y()):ot={x:ue.x2,y:ue.y2},ue.x2=ot.x,ue.y2=ot.y}),we=Un(()=>{if(!ue.visible||!te.current)return;const je=te.current.findOne(".selection"),Le=je?je.getClientRect():{width:0,height:0,x:0,y:0};if(Le.width&&Le.height){const Ye=[];te.current.find(".element").forEach(rt=>{const ot=rt.getClientRect(),dt=e.getElementById(rt.id()),Ct=dt?.draggable,Zt=dt?.selectable;un.Util.haveIntersection(Le,ot)&&Ct&&Zt&&Ye.push(dt.top.id)});const lt=[...new Set(Ye)];e.selectElements(lt)}ue.visible=!1,_e.current=!0});return window.addEventListener("mousemove",ye),window.addEventListener("touchmove",ye),window.addEventListener("mouseup",we),window.addEventListener("touchend",we),()=>{window.removeEventListener("mousemove",ye),window.removeEventListener("touchmove",ye),window.removeEventListener("mouseup",we),window.removeEventListener("touchend",we)}},[]);const ze=oe.useCallback(ye=>{if(!e.selectedElements[0]||ye&&e.selectedElementsIds.includes(ye))return;const we=ig(e.selectedShapes),je=ye?e.getElementById(ye):{x:0,y:0,width:t.computedWidth,height:t.computedHeight,rotation:0},Le=Cd(je),Ye=[];we.minX>Le.maxX&&Ye.push({distance:we.minX-Le.maxX,box1:we,box2:Le,points:[{x:we.minX,y:we.minY+we.height/2},{x:Le.maxX,y:we.minY+we.height/2},{x:Le.maxX,y:Le.minY+Le.height/2}]}),we.maxX<Le.minX&&Ye.push({distance:Le.minX-we.maxX,box1:we,box2:Le,points:[{x:we.maxX,y:we.minY+we.height/2},{x:Le.minX,y:we.minY+we.height/2},{x:Le.minX,y:Le.minY+Le.height/2}]}),we.minY>Le.maxY&&Ye.push({box1:we,box2:Le,distance:we.minY-Le.maxY,points:[{x:we.minX+we.width/2,y:we.minY},{x:we.minX+we.width/2,y:Le.maxY},{x:Le.minX+Le.width/2,y:Le.maxY}]}),we.maxY<Le.minY&&Ye.push({box1:we,box2:Le,distance:Le.minY-we.maxY,points:[{x:we.minX+we.width/2,y:we.maxY},{x:we.minX+we.width/2,y:Le.minY},{x:Le.minX+Le.width/2,y:Le.minY}]});const lt=we.minX>=Le.minX&&we.maxX<=Le.maxX&&we.minY>=Le.minY&&we.maxY<=Le.maxY;if(lt&&(Ye.push({distance:we.minX-Le.minX,box1:we,box2:Le,points:[{x:we.minX,y:we.minY+we.height/2},{x:Le.minX,y:we.minY+we.height/2},{x:Le.minX,y:Le.minY+Le.height/2}]}),Ye.push({distance:Le.maxX-we.maxX,box1:we,box2:Le,points:[{x:we.maxX,y:we.minY+we.height/2},{x:Le.maxX,y:we.minY+we.height/2},{x:Le.maxX,y:Le.minY+Le.height/2}]}),Ye.push({box1:we,box2:Le,distance:we.minY-Le.minY,points:[{x:we.minX+we.width/2,y:we.minY},{x:we.minX+we.width/2,y:Le.minY},{x:Le.minX+Le.width/2,y:Le.minY}]}),Ye.push({box1:we,box2:Le,distance:Le.maxY-we.maxY,points:[{x:we.minX+we.width/2,y:we.maxY},{x:we.minX+we.width/2,y:Le.maxY},{x:Le.minX+Le.width/2,y:Le.maxY}]})),Ye.length===0&&!lt){const rt=we.minX<Le.maxX&&we.maxX>Le.minX,ot=we.minY<Le.maxY&&we.maxY>Le.minY;if(rt&&ot){const dt=(Math.max(we.minY,Le.minY)+Math.min(we.maxY,Le.maxY))/2,Ct=(Math.max(we.minX,Le.minX)+Math.min(we.maxX,Le.maxX))/2;we.minX<Le.minX?Ye.push({distance:Le.minX-we.minX,box1:we,box2:Le,points:[{x:we.minX,y:dt},{x:Le.minX,y:dt},{x:Le.minX,y:dt}]}):Ye.push({distance:we.minX-Le.minX,box1:we,box2:Le,points:[{x:we.minX,y:dt},{x:Le.minX,y:dt},{x:Le.minX,y:dt}]}),we.maxX>Le.maxX?Ye.push({distance:we.maxX-Le.maxX,box1:we,box2:Le,points:[{x:Le.maxX,y:dt},{x:we.maxX,y:dt},{x:Le.maxX,y:dt}]}):Ye.push({distance:Le.maxX-we.maxX,box1:we,box2:Le,points:[{x:we.maxX,y:dt},{x:Le.maxX,y:dt},{x:Le.maxX,y:dt}]}),we.minY<Le.minY?Ye.push({box1:we,box2:Le,distance:Le.minY-we.minY,points:[{x:Ct,y:we.minY},{x:Ct,y:Le.minY},{x:Ct,y:Le.minY}]}):Ye.push({box1:we,box2:Le,distance:we.minY-Le.minY,points:[{x:Ct,y:we.minY},{x:Ct,y:Le.minY},{x:Ct,y:Le.minY}]}),we.maxY>Le.maxY?Ye.push({box1:we,box2:Le,distance:we.maxY-Le.maxY,points:[{x:Ct,y:Le.maxY},{x:Ct,y:we.maxY},{x:Ct,y:Le.maxY}]}):Ye.push({box1:we,box2:Le,distance:Le.maxY-we.maxY,points:[{x:Ct,y:we.maxY},{x:Ct,y:Le.maxY},{x:Ct,y:Le.maxY}]})}}JSON.stringify(Q)!==JSON.stringify(Ye)&&re(Ye)},[e,t]);oe.useEffect(()=>{e.distanceGuidesVisible?ze():Q&&re(null)},[e.distanceGuidesVisible,ze,e.selectedShapes.map(ye=>`${ye.x},${ye.y},${ye.width},${ye.height},${ye.rotation}`).join("|")]);const tt=oe.useRef(!1);oe.useEffect(()=>{var ye;let we;const je=(ye=se.current)===null||ye===void 0?void 0:ye.closest(".polotno-workspace-inner"),Le=()=>{tt.current=!0,clearTimeout(we),we=setTimeout(()=>{tt.current=!1},300)};return je.addEventListener("scroll",Le),()=>{clearTimeout(we),je.removeEventListener("scroll",Le)}},[]);const pe=ye=>{if(e.activePage!==t&&t.select(),tt.current||_e.current)return;const we=ye.evt.ctrlKey||ye.evt.metaKey||ye.evt.shiftKey,je=ye.target.findAncestor(".elements-container"),Le=ye.target.findAncestor(".page-abs-container"),Ye=ye.target.findAncestor("Transformer");if(!(we||je||Ye||Le||ue.visible))return void e.selectElements([]);const lt=ye.target.findAncestor(".element-container",!0),rt=lt?.findOne(".element")||ye.target.findAncestor(".element",!0),ot=e.getElementById(rt?.id()),dt=ot?.top,Ct=dt?.id,Zt=e.selectedElementsIds.indexOf(Ct)>=0,on=ye.target.findAncestor(".page-container",!0);Ct&&we&&!Zt?e.selectElements(e.selectedElementsIds.concat([Ct])):Ct&&we&&Zt?e.selectElements(e.selectedElementsIds.filter(an=>an!==Ct)):!Ct||we||Zt?on?e.selectPages([t.id]):e.selectPages([]):e.selectElements([Ct])};BN(G,e,{stroke:_,strokeWidth:x,dash:b});const ut=e.activePage===t,be=e._selectedPagesIds.includes(t.id),ge=u?.PageControls,xe=u?.Tooltip,Te=u?.ContextMenu,Me=1/e.scale,ve=0/e.scale;return oe.createElement("div",{ref:se,onDragOver:ye=>ye.preventDefault(),onDrop:ye=>{if(ye.preventDefault(),!te.current)return;te.current.setPointersPositions(ye),te.current.findOne(".elements-container").getRelativePointerPosition();const we=te.current.getPointerPosition(),je=te.current.getAllIntersections(we).map(Ye=>Ye.findAncestor(".element",!0)).filter(Boolean);[...new Set(je.reverse())].map(Ye=>e.getElementById(Ye.id()))[0]},style:{position:"relative",width:n+"px",height:r+"px",overflow:"hidden",flexShrink:0},className:"polotno-page-container"+(ut?" active-page":"")},oe.createElement(DP,{ref:te,width:Math.min(n,m.width+200),height:Math.min(m.height+200,r),onClick:pe,onTap:pe,onContextMenu:ye=>{ye.evt.preventDefault();const we=ye.target.findAncestor(".element",!0),je=e.getElementById(we?.id()),Le=je?.top,Ye=Le?.id;Ye?e.selectedElementsIds.indexOf(Ye)>=0||e.selectElements([Ye]):e.selectElements([]),F.open({x:ye.evt.clientX,y:ye.evt.clientY})},onMouseDown:$e,onMouseMove:ye=>{if(!e.distanceGuidesVisible&&!ye.evt.altKey)return void(Q&&re(null));const we=ye.target.findAncestor(".element",!0),je=we?.id();ze(je)},onDragStart:ye=>{var we;const je=ye.target.findAncestor(".element",!0);if(je){const Le=e.getElementById(je?.id()),Ye=Le?.top,lt=Ye?.id;!(e.selectedElementsIds.indexOf(lt)>=0)&<&&(e.selectElements([lt]),ye.target.stopDrag(),ye.target.startDrag(ye),(we=G.current)===null||we===void 0||we.startDrag(ye))}Q&&re(null)},pageId:t.id,style:{position:"absolute",overflow:"hidden",top:0,left:0}},oe.createElement(MP,null,oe.createElement(oR,{width:n,height:r,fill:a}),oe.createElement(hr,{x:N,y:$,scaleX:e.scale,scaleY:e.scale,name:"page-container"},oe.createElement(hr,{name:"page-container-2"},oe.createElement(hr,{name:"page-background-group",x:j,y:j},oe.createElement(uR,{x:-t.bleed,y:-t.bleed,width:t.computedWidth+2*t.bleed,height:t.computedHeight+2*t.bleed,background:t.background,name:"page-background",preventDefault:!1,scale:e.scale})),oe.createElement(hr,{x:j,y:j,name:"elements-container",listening:!e.isPlaying},oe.createElement(Pr,{name:"elements-area",width:t.computedWidth,height:t.computedHeight,listening:!1}),oe.createElement(dR,{elements:t.children,store:e})),oe.createElement(Pr,{stroke:h,name:"bleed",strokeWidth:t.bleed,x:t.bleed/2,y:t.bleed/2,width:t.computedWidth+t.bleed,height:t.computedHeight+t.bleed,listening:!1,visible:t.bleed>0&&e.bleedVisible,hideInExport:!0}),wT()===mR&&oe.createElement(vR,{name:"hit-detection",x:-Me/2-ve,y:-Me/2-ve,width:D+Me+2*ve,height:C+Me+2*ve}))),oe.createElement(yc,{name:"workspace-background",points:[0,0,n,0,n,r,0,r,0,0,N,$,N,r-$,n-N,r-$,n-N,$,N,$],listening:!1,closed:!0,fill:a}),oe.createElement(hr,{x:N,y:$,scaleX:e.scale,scaleY:e.scale},oe.createElement(Pr,{name:"page-highlight",hideInExport:!0,x:-Me/2-ve,y:-Me/2-ve,width:D+Me+2*ve,height:C+Me+2*ve,stroke:be?s:o,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),oe.createElement(hr,{x:N+j*e.scale,y:$+j*e.scale,scaleX:e.scale,scaleY:e.scale,name:"page-abs-container"},oe.createElement(kp,{ref:G,onDragStart:ye=>{var we;!((we=ye.evt)===null||we===void 0)&&we.altKey&&c&&e.selectedElements.forEach(je=>{const Le=je.clone({},{skipSelect:!0}),Ye=t.children.indexOf(je);t.setElementZIndex(Le.id,Ye)}),e.history.startTransaction()},onDragEnd:()=>{e.history.endTransaction()},onTransformStart:()=>{e.history.startTransaction(),re(null)},boundBoxFunc:(ye,we)=>{const je=Math.abs(we.width)<1||Math.abs(we.height)<1,Le=Math.abs(ye.width)<1||Math.abs(ye.height)<1;return je&&!Le?ye:we},onTransform:ye=>{const we=G.current.nodes(),je=we[we.length-1];ye.target===je&&setTimeout(()=>{fe()},0)},onTransformEnd:ye=>{B({}),e.history.endTransaction()},visible:!e.isPlaying}),Q&&Q.map(({points:ye,distance:we,box1:je,box2:Le},Ye)=>oe.createElement(hr,{name:"distances-container",hideInExport:!0,key:Ye,listening:!1},oe.createElement(Pr,Object.assign({},je,{stroke:E,strokeWidth:1,strokeScaleEnabled:!1})),oe.createElement(Pr,Object.assign({},Le,{stroke:E,strokeWidth:1,strokeScaleEnabled:!1})),oe.createElement(yc,{points:[ye[0].x,ye[0].y,ye[1].x,ye[1].y],stroke:E,strokeWidth:1,strokeScaleEnabled:!1}),oe.createElement(yc,{points:[ye[1].x,ye[1].y,ye[2].x,ye[2].y],stroke:E,strokeWidth:1,strokeScaleEnabled:!1}),oe.createElement(E0,{x:(ye[0].x+ye[1].x)/2,y:(ye[0].y+ye[1].y)/2,offsetY:-10,scaleX:1/e.scale,scaleY:1/e.scale},oe.createElement(k0,{cornerRadius:5,fill:A,pointerDirection:"down"}),oe.createElement(Uu,{align:"center",verticalAlign:"middle",fill:R,padding:5,text:NT({unit:e.unit,dpi:e.dpi,px:we})})))),t._rendering&&oe.createElement(hr,null,oe.createElement(Pr,{width:D,height:C,fill:"rgba(255,255,255,0.9)"}),oe.createElement(Uu,{text:"Rendering...",fontSize:60,width:D,height:C,align:"center",verticalAlign:"middle"})),xe&&oe.createElement(xe,{components:u,store:e,page:t,stageRef:te,tooltipSafeArea:I}),Te&&oe.createElement(A0,null,oe.createElement(Te,Object.assign({components:u,store:e},F.props)))),oe.createElement(rR,{store:e,page:t,width:n,height:r,scale:e.scale,xPadding:N,yPadding:$,bleed:j}),oe.createElement(hR,Object.assign({},X,{store:e,tagFill:S,textFill:k})),oe.createElement(cR,{selection:ue,fill:g,stroke:d,strokeWidth:y}),xT()&&oe.createElement(Uu,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:n-170,y:r-18,onMouseEnter:ye=>{ye.target.getStage().container().style.cursor="pointer"},onMouseLeave:ye=>{ye.target.getStage().container().style.cursor=""},onTouchStart:ye=>{ye.cancelBubble=!0},onMouseDown:ye=>{ye.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),oe.createElement(hr,{name:"line-guides"}))),ee&&ge&&oe.createElement(ge,{store:e,page:t,xPadding:N,yPadding:$,layout:O}))}),bR=Od("div",oe.forwardRef)`
|
|
403
|
+
position: absolute;
|
|
404
|
+
top: 0;
|
|
405
|
+
left: 0;
|
|
406
|
+
pointer-events: none;
|
|
407
|
+
`,wR=Od("div",oe.forwardRef)`
|
|
408
|
+
height: 14px;
|
|
409
|
+
position: sticky;
|
|
410
|
+
font-size: 8px;
|
|
411
|
+
line-height: 14px;
|
|
412
|
+
top: 0;
|
|
413
|
+
left: 0;
|
|
414
|
+
color: grey;
|
|
415
|
+
border-bottom: 1px solid grey;
|
|
416
|
+
background-color: #e8e8e8;
|
|
417
|
+
overflow: hidden;
|
|
418
|
+
`,xR=Od("div",oe.forwardRef)`
|
|
419
|
+
left: 0;
|
|
420
|
+
width: 14px;
|
|
421
|
+
position: sticky;
|
|
422
|
+
font-size: 8px;
|
|
423
|
+
line-height: 14px;
|
|
424
|
+
color: grey;
|
|
425
|
+
border-right: 1px solid grey;
|
|
426
|
+
background-color: #e8e8e8;
|
|
427
|
+
overflow: hidden;
|
|
428
|
+
`,_R=Od("div",oe.forwardRef)`
|
|
429
|
+
position: absolute;
|
|
430
|
+
border-left: 1px solid grey;
|
|
431
|
+
padding-left: 2px;
|
|
432
|
+
`,SR=Od("div",oe.forwardRef)`
|
|
433
|
+
position: absolute;
|
|
434
|
+
left: 14px;
|
|
435
|
+
border-left: 1px solid grey;
|
|
436
|
+
padding-left: 2px;
|
|
437
|
+
transform: rotate(90deg);
|
|
438
|
+
transform-origin: left top;
|
|
439
|
+
overflow: hidden;
|
|
440
|
+
`,ER=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4],kR=Qr(({store:e,width:t,height:n})=>{const r=oe.useRef(null);if(!e.activePage)return null;const i=e.activePage,a=(e.bleedVisible&&i.bleed,i.computedWidth*e.scale),o=i.computedHeight*e.scale,s=(t-a)/2,u=(h=y=>L4({unitVal:y,dpi:e.dpi,unit:e.unit})*e.scale,ER.find(y=>h(y)>30)||1e4);var h;const c=L4({unitVal:u,dpi:e.dpi,unit:e.unit})*e.scale,m=Math.round(a/c)+1,g=Math.round(o/c)+1,d=ig(e.selectedShapes);return oe.createElement(bR,{ref:r,className:"polotno-rulers"},oe.createElement(wR,{style:{width:t+"px"},className:"polotno-x-ruler"},[...Array(m)].map((y,_)=>oe.createElement(_R,{key:_,style:{left:s+_*c+"px",width:c+"px"}},e.unit==="px"||u>=1?Math.round(u*_):(u*_).toFixed(1))),!!e.selectedShapes.length&&oe.createElement("div",{style:{position:"absolute",left:s+d.x*e.scale+"px",height:"14px",width:d.width*e.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),e.pages.map((y,_)=>{var x;const b=y.computedHeight*e.scale,S=(n-b)/2;return oe.createElement(xR,{key:y.id,style:{height:n-14+"px"},className:"polotno-y-ruler"},[...Array(g)].map((k,E)=>oe.createElement(SR,{key:E,style:{top:S+E*c-14+"px",width:c+"px"}},e.unit==="px"||u>=1?Math.round(u*E):(u*E).toFixed(1))),((x=e.selectedShapes[0])===null||x===void 0?void 0:x.page)===y&&oe.createElement("div",{style:{position:"absolute",top:S+d.y*e.scale-14+"px",width:"14px",height:d.height*e.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))}),AR=Qr(({audio:e,store:t})=>{const[n]=(function(r){const[i,a]=oe.useState(null),[o,s]=oe.useState("loading");return oe.useEffect(()=>{const u=new Audio(r),h=()=>{s("loaded"),a(u)},c=()=>{s("failed"),a(null)};return u.addEventListener("canplay",h),u.addEventListener("error",c),()=>{u.removeEventListener("canplay",h),u.removeEventListener("error",c)}},[r]),[i,o]})(e.src);return oe.useEffect(()=>{n&&t.history.ignore(()=>{e.set({duration:1e3*n.duration})})},[n,e,t.history]),oe.useEffect(()=>{if(!n)return;const r=()=>{n.currentTime=e.startTime*e.duration/1e3},i=()=>{const o=e.endTime*e.duration/1e3;n.currentTime>=o&&(n.pause(),n.currentTime=e.startTime*e.duration/1e3)};n.addEventListener("ended",r),n.addEventListener("timeupdate",i);const a=$u(()=>{const o=t.animatedElementsIds;if(o.length&&!o.includes(e.id))return;const s=t.currentTime-e.delay,u=e.duration*(e.endTime-e.startTime),h=s>=0&&s<u;if(!t.isPlaying||t.animatedElementsIds.length!==0||!h)return void n.pause();n.volume=e.volume,n.paused&&n.play();const c=s%u/1e3+e.startTime*e.duration/1e3,m=n.currentTime;Math.abs(m-c)>.5&&c!==m&&(n.currentTime=c)});return()=>{n.pause(),n.removeEventListener("ended",r),n.removeEventListener("timeupdate",i),a()}},[t.isPlaying,e.startTime,e.endTime,e.volume,n]),null});let Ox={data:[],pageId:""};const T0="polotno_clipboard",Ay=(e,t)=>{Ox={data:JSON.parse(JSON.stringify(e)),pageId:t};try{localStorage.setItem(T0,JSON.stringify(e)),localStorage.setItem(T0+"_page",t)}catch{}},PR=()=>{try{const e=localStorage.getItem(T0),t=localStorage.getItem(T0+"_page");if(e)return{data:JSON.parse(e),pageId:t}}catch{}return Ox},OR=e=>{var t;e.selectedElements.length!==0&&Ay(e.selectedElements.map(n=>n.toJSON()),(t=e.activePage)===null||t===void 0?void 0:t.id)},CR=e=>{var t;Ay(e.selectedElements.map(r=>r.toJSON()),(t=e.activePage)===null||t===void 0?void 0:t.id);let n=e.selectedElements.filter(r=>r.removable).map(r=>r.id);e.deleteElements(n)},LR=e=>{e.history.transaction(()=>{var t,n;let r=0,i=0;const{data:a,pageId:o}=PR();if(o===((t=e.activePage)===null||t===void 0?void 0:t.id))r=e.width/20,i=e.height/20;else{const u=[];mi({children:a},c=>{c.type!=="group"&&u.push(c)});const h=ig(u);h.maxX>e.width&&(r=-h.minX),h.maxY>e.height&&(i=-h.minY)}const s=[];mi({children:a},u=>{delete u.id,u.type!=="group"&&(u.x+=r,u.y+=i)}),a.forEach(u=>{var h;const c=(h=e.activePage)===null||h===void 0?void 0:h.addElement(u);c&&s.push(c.id)}),Ay(a,(n=e.activePage)===null||n===void 0?void 0:n.id),e.selectElements(s)})};function NR(e,t){const n=[];e.forEach(r=>{if(r.removable===!1)return;const i=r.clone();r.type==="group"?i.children.forEach(a=>{a.set({x:a.x+50,y:a.y+50})}):i.set({x:r.x+50,y:r.y+50}),n.push(i.id)}),t.selectElements(n)}const Ho=e=>{if(e.type!=="group")return Cd(e);let t=1/0,n=1/0,r=-1/0,i=-1/0;return e.children.forEach(a=>{const o=Ho(a);t=Math.min(t,o.x),n=Math.min(n,o.y),r=Math.max(r,o.x+o.width),i=Math.max(i,o.y+o.height)}),{x:t,y:n,width:r-t,height:i-n}},Oh=(e,t,n)=>{if(e.type!=="group"){const r=Cd(e),i=t-r.x,a=n-r.y;e.set({x:e.x+i,y:e.y+a})}else{const r=t-Ho(e).x,i=n-Ho(e).y;e.children.forEach(a=>{const o=Ho(a);Oh(a,o.x+r,o.y+i)})}};function TR(e){var t;let n=(t=e.activePage)===null||t===void 0?void 0:t.computedWidth;e.selectedElements.forEach(r=>{n=Math.min(n,Ho(r).x)}),e.selectedElements.length===1&&(n=0),e.selectedElements.forEach(r=>{const i=Ho(r);Oh(r,i.x-i.x+n,i.y)})}function RR(e){var t;let n=0;e.selectedElements.forEach(r=>{const i=Ho(r);n=Math.max(n,i.x+i.width)}),e.selectedElements.length===1&&(n=(t=e.activePage)===null||t===void 0?void 0:t.computedWidth),e.selectedElements.forEach(r=>{const i=Ho(r);Oh(r,n-i.width,i.y)})}function MR(e){var t;let n=(t=e.activePage)===null||t===void 0?void 0:t.computedHeight;e.selectedElements.forEach(r=>{n=Math.min(n,Ho(r).y)}),e.selectedElements.length===1&&(n=0),e.selectedElements.forEach(r=>{const i=Ho(r);Oh(r,i.x,i.y-i.y+n)})}function IR(e){var t,n;let r=(t=e.activePage)===null||t===void 0?void 0:t.computedHeight,i=0;e.selectedElements.forEach(o=>{const s=Ho(o);r=Math.min(r,s.y),i=Math.max(i,s.y+s.height)});let a=(i+r)/2;e.selectedElements.length===1&&(a=((n=e.activePage)===null||n===void 0?void 0:n.computedHeight)/2),e.selectedElements.forEach(o=>{const s=Ho(o);Oh(o,s.x,a-s.height/2)})}function jR(e){var t;let n=0;e.selectedElements.forEach(r=>{const i=Ho(r);n=Math.max(n,i.y+i.height)}),e.selectedElements.length===1&&(n=(t=e.activePage)===null||t===void 0?void 0:t.computedHeight),e.selectedElements.forEach(r=>{const i=Ho(r);Oh(r,i.x,n-i.height)})}function DR(e){var t,n;let r=(t=e.activePage)===null||t===void 0?void 0:t.computedWidth,i=0;e.selectedElements.forEach(o=>{const s=Ho(o);r=Math.min(r,s.x),i=Math.max(i,s.x+s.width)});let a=(i+r)/2;e.selectedElements.length===1&&(a=((n=e.activePage)===null||n===void 0?void 0:n.computedWidth)/2),e.selectedElements.forEach(o=>{const s=Ho(o);Oh(o,a-s.width/2,s.y)})}const Pm="rgba(191, 191, 191, 100)";function FR(e,t){var n,r,i,a;if(((n=document.activeElement)===null||n===void 0?void 0:n.tagName)==="INPUT"||((r=document.activeElement)===null||r===void 0?void 0:r.tagName)==="TEXTAREA"||((i=document.activeElement)===null||i===void 0?void 0:i.contentEditable)==="true")return;const o=document.querySelector(".polotno-workspace-container");if(document.activeElement!==o&&!o?.contains(document.activeElement)){const m=window.getSelection();if(m&&m.toString().length>0)return}const s=t.selectedElements.filter(m=>m.removable).map(m=>m.id);e.keyCode!==46&&e.keyCode!==8||t.deleteElements(s);const u=e.ctrlKey||e.metaKey,h=e.shiftKey,c=e.altKey;if(e.key==="Escape"&&t.tool==="draw")return e.preventDefault(),void t.setTool("selection");if(!u||h||e.key.toLowerCase()!=="z"&&e.key.toLowerCase()!=="y"||(e.preventDefault(),t.history.undo()),u&&h&&(e.key.toLowerCase()==="z"||e.key.toLowerCase()==="y")&&(e.preventDefault(),t.history.redo()),u&&e.code==="KeyA"){e.preventDefault();const m=(a=t.activePage)===null||a===void 0?void 0:a.children.filter(d=>d.selectable),g=m?.map(d=>d.id)||[];t.selectElements(g)}if(u&&e.code==="KeyC"&&(e.preventDefault(),OR(t)),u&&e.code==="KeyX"&&(e.preventDefault(),CR(t)),u&&e.code==="KeyV"&&(e.preventDefault(),LR(t)),e.code==="ArrowDown"&&(e.preventDefault(),t.selectedShapes.forEach(m=>{m.draggable&&m.set({y:m.y+1})})),e.code==="ArrowUp"&&(e.preventDefault(),t.selectedShapes.forEach(m=>{m.draggable&&m.set({y:m.y-1})})),e.code==="ArrowLeft"&&(e.preventDefault(),t.selectedShapes.forEach(m=>{m.draggable&&m.set({x:m.x-1})})),e.code==="ArrowRight"&&(e.preventDefault(),t.selectedShapes.forEach(m=>{m.draggable&&m.set({x:m.x+1})})),u&&e.code==="KeyG"){e.preventDefault();const m=t.selectedElements[0];if(m&&m.type==="group"){const g=m;t.ungroupElements([g.id])}else t.groupElements(t.selectedElements.map(g=>g.id))}if(u&&e.code==="KeyD"&&(e.preventDefault(),NR(t.selectedElements,t)),e.code==="KeyT"&&!u){e.preventDefault();const m=30,g=t.width/2,d=t.width/2-g/2,y=t.height/2-m/2,_=2160,x=(t.width+t.height)/_;t.activePage.addElement({type:"text",x:d,y,width:g,fontSize:m*x,text:"Sample Text",fontFamily:"Roboto"})}if(e.code==="KeyR"&&!u){e.preventDefault();const m={type:"figure",x:t.width/4,y:t.height/4,width:300,height:300,fill:Pm,stroke:"#0c0c0c",strokeWidth:0,subType:"rect"};t.activePage.addElement(m)}if(e.code==="KeyL"&&!u){e.preventDefault();const m=t.activePage.computedWidth/3,g={type:"line",x:t.activePage.computedWidth/2-m/2,y:t.activePage.computedHeight/2,width:m,color:Pm};t.activePage.addElement(g)}if(e.code==="KeyO"&&!u){e.preventDefault(),e.preventDefault();const m={type:"figure",x:t.width/4,y:t.height/4,width:300,height:300,fill:Pm,stroke:"#0c0c0c",strokeWidth:0,subType:"circle"};t.activePage.addElement(m)}u&&e.code==="Equal"&&(e.preventDefault(),t.setScale(t.scale+.1)),u&&e.code==="Minus"&&(e.preventDefault(),t.setScale(t.scale-.1)),c&&(e.code==="KeyA"&&(e.preventDefault(),TR(t)),e.code==="KeyD"&&(e.preventDefault(),RR(t)),e.code==="KeyS"&&(e.preventDefault(),jR(t)),e.code==="KeyW"&&(e.preventDefault(),MR(t)),e.code==="KeyV"&&(e.preventDefault(),IR(t)),e.code==="KeyH"&&(e.preventDefault(),DR(t))),e.code==="BracketRight"&&(e.preventDefault(),u?t.activePage.moveElementsUp(t.selectedElementsIds):t.activePage.moveElementsTop(t.selectedElementsIds)),e.code==="BracketLeft"&&(e.preventDefault(),u?t.activePage.moveElementsDown(t.selectedElementsIds):t.activePage.moveElementsBottom(t.selectedElementsIds))}const Lv=Qn({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",curvedText:"Curved text",curvePower:"Power",temperature:"Temperature",saturation:"Saturation",contrast:"Contrast",shadows:"Shadows",white:"White",black:"Black",vibrance:"Vibrance",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",uppercase:"Uppercase",position:"Position",layering:"Layering",toForward:"To Front",up:"Forward",down:"Backward",toBottom:"To back",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",strokeSettings:"Stroke settings",spacing:"Spacing",volume:"Volume",lineStyle:"Line style",lineStartHead:"Line start",lineEndHead:"Line end",textDirection:"Text direction",fontSize:"Font size",fontFamily:"Font family",textAlign:"Text align",verticalAlign:"Vertical align",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",listFormat:"List",colorPicker:{solid:"Solid",linear:"Linear",angle:"Angle"},aiText:{aiWrite:"AI write",rewrite:"Rewrite",shorten:"Shorten",continue:"Continue writing",proofread:"Proofread",tones:"Tones",friendly:"Friendly",professional:"Professional",humorous:"Humorous",formal:"Formal",customPrompt:"Custom prompt",generatedResult:"Generated result",cancel:"Cancel",generate:"Generate",back:"Back",tryAgain:"Try Again",insert:"Insert",promptPlaceholder:"Describe what you want to generate"}},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down",moveLeft:"Move left",moveRight:"Move right"},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",draw:"Draw",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"}}),R0=e=>e&&typeof e=="object";function Cx(e,t){Object.keys(t).forEach(n=>{const r=e[n],i=t[n];R0(i)&&R0(r)?Cx(r,i):e[n]=i})}function Lx(e,t,n=""){Object.keys(t).forEach(r=>{const i=t[r],a=n?`${n}.${r}`:r;R0(i)?R0(e[r])?Lx(e[r],i,a):console.warn(`Missing nested translation object at '${a}'`):e[r]===void 0&&console.warn(`Missing translation '${a}'`)})}Un((e,{validate:t=!1}={})=>{t&&Lx(e,Lv),Cx(Lv,e)});const z4={},U4=e=>{const t=(function(i,a){var o,s=a.split("."),u=i;for(o=0;o<s.length;++o){if(u[s[o]]==null)return;u=u[s[o]]}return u})(Lv,e);if(t!==void 0)return t;z4[e]||(z4[e]=!0,console.warn(`Missing translation '${e}'`));const n=e.split("."),r=n[n.length-1]||" ";return r.charAt(0).toUpperCase()+r.slice(1)},BR=({store:e})=>oe.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},oe.createElement("p",null,U4("workspace.noPages")),oe.createElement("button",{onClick:()=>{e.addPage()}},U4("workspace.addPage"))),zR=({width:e,height:t,xPadding:n,yPadding:r,backgroundColor:i})=>oe.createElement("div",{style:{width:e+"px",height:t+"px",backgroundColor:i,paddingLeft:n+"px",paddingRight:n+"px",paddingTop:r+"px",paddingBottom:r+"px",flexShrink:0}},oe.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}})),UR=[4,6],qR=Qr(({store:e,layout:t="vertical",pageControlsEnabled:n,backgroundColor:r,pageBorderColor:i,activePageBorderColor:a,bleedColor:o,snapGuideStroke:s,snapGuideStrokeWidth:u,snapGuideDash:h,selectionRectFill:c,selectionRectStroke:m,selectionRectStrokeWidth:g,transformLabelFill:d,transformLabelTextFill:y,distanceGuideStroke:_,distanceLabelFill:x,distanceLabelTextFill:b,components:S,onKeyDown:k,paddingX:E,paddingY:A,altCloneEnabled:R=!0,visiblePagesOffset:O,renderOnlyActivePage:I,tooltipSafeArea:j})=>{var D;const C=t==="horizontal",N=E??20,$=A??55,[G,te]=oe.useState({width:100,height:100}),se=oe.useRef(G),ee=oe.useRef(null),Q=oe.useRef(null),re=e.bleedVisible?Math.max(0,...e.pages.map(be=>be.bleed)):0,X=Math.max(...e.pages.map(be=>be.computedWidth)),B=Math.max(...e.pages.map(be=>be.computedHeight)),F=((D=e.activePage)===null||D===void 0?void 0:D.computedHeight)||0,z=X+2*re,Y=(I?F:B)+2*re,J=async({skipTimeout:be}={skipTimeout:!1})=>{if(be||await new Promise(lt=>setTimeout(lt,50)),ee.current===null)return;const ge=ee.current.getBoundingClientRect();ge.width!==0&&ge.height!==0||(console.warn(`Polotno warning: <Workspace /> component can not automatically detect its size.
|
|
441
|
+
Width or height of parent elements is equal 0.
|
|
442
|
+
Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
|
|
443
|
+
For simpler debugging here is the log of the parent element:`),console.log(ee.current));const xe=Q.current.clientWidth||ge.width,Te={width:xe,height:ge.height};(se.current.width!==Te.width||se.current.height!==Te.height)&&(te(Te),se.current=Te);const Me=(xe-2*N)/z,ve=e.pages.length>1?3.1:2,ye=(ge.height-$*ve)/Y,we=e.pages.length>1?3.1:2,je=(xe-N*we)/z,Le=(ge.height-2*$)/Y,Ye=e.pages.length?Math.max(Math.min(C?je:Me,C?Le:ye),.01):1;e.scaleToFit!==Ye&&(e.setScale(Ye),e._setScaleToFit(Ye))};oe.useLayoutEffect(()=>{J({skipTimeout:!0})},[]),oe.useEffect(()=>{J()},[z,Y,A,E]),oe.useLayoutEffect(()=>{J({skipTimeout:!0})},[e.openedSidePanel]),oe.useEffect(()=>{e.__()},[]),oe.useEffect(()=>{const be=ee.current;if(window.ResizeObserver){const ge=new ResizeObserver(()=>{J({skipTimeout:!0})});return ge.observe(be),()=>ge.unobserve(be)}{const ge=setInterval(()=>{J({skipTimeout:!0})},100);return()=>clearInterval(ge)}},[z,Y]);const K=I?1:e.pages.length;let ie,fe;if(C){const be=z*e.scale*K;ie=Math.max(N,(G.width-be)/K/2),fe=Math.max($,(G.height-Y*e.scale)/2)}else{ie=Math.max(N,(G.width-z*e.scale)/2);const be=Y*e.scale*K;fe=Math.max($,(G.height-be)/K/2)}oe.useEffect(()=>{const be=ge=>{(k||FR)(ge,e)};return window.addEventListener("keydown",be),()=>window.removeEventListener("keydown",be)},[]),oe.useEffect(()=>{const be=xe=>{if(xe.ctrlKey||xe.metaKey){xe.preventDefault();const ye=Math.max(5,e.scaleToFit);let we=Math.min(.1,e.scaleToFit);C&&z>0&&Number.isFinite(z)&&(we=Math.max(we,300/z)),we=Math.max(we,.01);const je=.03,Le=(Te=xe.deltaY<0?e.scale*(1+je):e.scale/(1+je),Me=we,ve=ye,Math.max(Me,Math.min(ve,Te)));return void e.setScale(Le)}var Te,Me,ve},ge=Q.current;return ge?.addEventListener("wheel",be),()=>ge?.removeEventListener("wheel",be)},[C,z,e]);const ue=oe.useRef(!1);((be,ge,xe,Te,Me,ve)=>{const ye=oe.useRef({width:ge,height:xe}),we=oe.useRef({top:0,left:0}),je=oe.useRef(!1),Le=oe.useRef(Me.pages.length);je.current=Le.current!==Me.pages.length,Le.current=Me.pages.length,oe.useEffect(()=>{const Ye=be.current,lt=rt=>{we.current={top:Ye.scrollTop,left:Ye.scrollLeft}};return Ye.addEventListener("scroll",lt),()=>{Ye.removeEventListener("scroll",lt)}},[]),oe.useLayoutEffect(()=>{if(!be.current||je.current)return;const Ye=be.current,lt=(we.current.left+Ye.offsetWidth/2)/ye.current.width,rt=(we.current.top+Ye.offsetHeight/2)/ye.current.height;ve.current=!0,Ye.scrollLeft=lt*ge-Ye.offsetWidth/2,Ye.scrollTop=rt*xe-Ye.offsetHeight/2,ye.current={width:ge,height:xe}},[Te,ge,xe])})(Q,z*e.scale+2*ie,Y*e.scale+2*fe,e.scale,e,ue);const _e=C?z*e.scale+2*ie:Y*e.scale+2*fe,{handleScroll:Ce}=((be,ge,xe,Te,Me,ve,ye)=>{const we=oe.useRef(!1),je=oe.useRef(null),Le=oe.useRef(!1),Ye=ye==="horizontal";oe.useEffect(()=>{const rt=be.current,ot=()=>{Me.current};return rt.addEventListener("scroll",ot),()=>{rt.removeEventListener("scroll",ot)}},[]);const lt=xe.pages.indexOf(xe.activePage);return oe.useLayoutEffect(()=>{if(ve||!xe.activePage||!be.current||we.current)return;const rt=be.current,ot=xe.pages.indexOf(xe.activePage)*ge,dt=Ye?rt.scrollLeft:rt.scrollTop;let Ct=()=>{};return(Math.abs(ot-dt)>.5*ge||Le.current)&&(Le.current=!0,Ct=(({element:Zt,scrollTop:on,scrollLeft:an,duration:We=300,onFinish:Be=()=>{}})=>{const $t=on!==void 0,At=$t?Zt.scrollTop:Zt.scrollLeft,Lt=$t?on:an,Tt=Lt-At;let tn=0,Wt=!1;if(We===0)return $t?Zt.scrollTop=Lt:Zt.scrollLeft=Lt,()=>{};const hn=()=>{if(Wt)return;tn+=20;const nr=bi(tn,At,Tt,We);$t?Zt.scrollTop=nr:Zt.scrollLeft=nr,tn<We?setTimeout(hn,20):Be()},bi=(nr,ei,dr,Jt)=>(nr/=Jt/2)<1?dr/2*nr*nr+ei:-dr/2*(--nr*(nr-2)-1)+ei;return hn(),()=>{Wt=!0}})(Object.assign(Object.assign({element:rt},Ye?{scrollLeft:ot}:{scrollTop:ot}),{onFinish:()=>{Le.current=!1},duration:xe.isPlaying?0:300}))),Ct},[xe.activePage,lt,xe.isPlaying,ve,ye]),{handleScroll:rt=>{if(ve||Le.current)return;we.current=!0,clearTimeout(je.current),je.current=setTimeout(()=>{we.current=!1},300);const ot=rt.currentTarget.childNodes[0];if(!ot)return;const dt=Ye?ot.offsetWidth:ot.offsetHeight;if(!dt)return;const Ct=Ye?rt.currentTarget.scrollLeft:rt.currentTarget.scrollTop,Zt=Ye?Te.width:Te.height,on=Math.floor((Ct+Zt/3)/dt),an=xe.pages[on];an&&xe.activePage!==an&&an.select()}}})(Q,_e,e,G,ue,I,t),$e=G.width>=z*e.scale+2*ie,ze=r||"rgba(232, 232, 232, 0.9)",tt=e.pages.indexOf(e.activePage),pe=S?.NoPages||BR,ut=O??Math.min(3,Math.max(1,Math.ceil(C?G.width/2/(z*e.scale):G.height/2/(Y*e.scale))));return oe.createElement("div",{ref:ee,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:ze,overflow:"hidden"},tabIndex:0,className:"polotno-workspace-container"},oe.createElement("div",{ref:Q,onScroll:Ce,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",flexDirection:C?"row":"column",overflow:"auto",overflowX:C?"auto":$e?"hidden":"auto",overflowY:C?"hidden":"auto"},className:"polotno-workspace-inner"},e.pages.map((be,ge)=>{const xe=be===e.activePage;if(I&&!xe&&!be._exportingOrRendering&&!be._forceMount)return null;if(!(Math.abs(ge-tt)<=ut||be._exportingOrRendering||be._forceMount))return oe.createElement("div",{key:be.id,style:{flexShrink:0}},oe.createElement(zR,{width:z*e.scale+2*ie,height:Y*e.scale+2*fe,backgroundColor:ze,xPadding:ie,yPadding:fe}));const Te=oe.createElement(yR,{key:be.id,page:be,xPadding:ie,yPadding:fe,width:z*e.scale+2*ie,height:Y*e.scale+2*fe,store:e,pageControlsEnabled:n,backColor:ze,pageBorderColor:i||"lightgrey",activePageBorderColor:a||"rgb(0, 161, 255)",altCloneEnabled:R,bleedColor:o||"rgba(255, 0, 0, 0.1)",selectionRectFill:c,selectionRectStroke:m,selectionRectStrokeWidth:g,snapGuideStroke:s||"rgb(0, 161, 255)",snapGuideStrokeWidth:u||1,snapGuideDash:h||UR,transformLabelFill:d,transformLabelTextFill:y,distanceGuideStroke:_||"rgb(0, 161, 255)",distanceLabelFill:x||"rgb(0, 161, 255)",distanceLabelTextFill:b||"white",components:S,viewportSize:G,layout:t,tooltipSafeArea:j});return(be._exportingOrRendering||be._forceMount)&&!xe&&I?oe.createElement("div",{style:{display:"none",flexShrink:0},key:be.id},Te):Te}),e.rulesVisible&&oe.createElement(kR,{store:e,xPadding:ie,yPadding:fe,width:z*e.scale+2*ie,height:Y*e.scale+2*fe}),e.pages.length===0&&oe.createElement(pe,{store:e}),e.audios.map(be=>oe.createElement(AR,{key:be.id,audio:be,store:e}))))}),$R="modulepreload",HR=function(e,t){return new URL(e,t).href},q4={},Om=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let h=function(c){return Promise.all(c.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};const o=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),u=s?.nonce||s?.getAttribute("nonce");i=h(n.map(c=>{if(c=HR(c,r),c in q4)return;q4[c]=!0;const m=c.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(r)for(let y=o.length-1;y>=0;y--){const _=o[y];if(_.href===c&&(!m||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${g}`))return;const d=document.createElement("link");if(d.rel=m?"stylesheet":$R,m||(d.as="script"),d.crossOrigin="",d.href=c,u&&d.setAttribute("nonce",u),document.head.appendChild(d),m)return new Promise((y,_)=>{d.addEventListener("load",y),d.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(o){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o}return i.then(o=>{for(const s of o||[])s.status==="rejected"&&a(s.reason);return t().catch(a)})};function jr(e){"@babel/helpers - typeof";return jr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jr(e)}var iu=Uint8Array,ll=Uint16Array,Py=Int32Array,Oy=new iu([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]),Cy=new iu([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]),$4=new iu([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nx=function(e,t){for(var n=new ll(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new Py(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},Tx=Nx(Oy,2),GR=Tx.b,Nv=Tx.r;GR[28]=258,Nv[258]=28;var WR=Nx(Cy,0),H4=WR.r,Tv=new ll(32768);for(var vi=0;vi<32768;++vi){var lf=(vi&43690)>>1|(vi&21845)<<1;lf=(lf&52428)>>2|(lf&13107)<<2,lf=(lf&61680)>>4|(lf&3855)<<4,Tv[vi]=((lf&65280)>>8|(lf&255)<<8)>>1}var bp=(function(e,t,n){for(var r=e.length,i=0,a=new ll(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new ll(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new ll(1<<t);var u=15-t;for(i=0;i<r;++i)if(e[i])for(var h=i<<4|e[i],c=t-e[i],m=o[e[i]-1]++<<c,g=m|(1<<c)-1;m<=g;++m)s[Tv[m]>>u]=h}else for(s=new ll(r),i=0;i<r;++i)e[i]&&(s[i]=Tv[o[e[i]-1]++]>>15-e[i]);return s}),mh=new iu(288);for(var vi=0;vi<144;++vi)mh[vi]=8;for(var vi=144;vi<256;++vi)mh[vi]=9;for(var vi=256;vi<280;++vi)mh[vi]=7;for(var vi=280;vi<288;++vi)mh[vi]=8;var M0=new iu(32);for(var vi=0;vi<32;++vi)M0[vi]=5;var VR=bp(mh,9,0),YR=bp(M0,5,0),Rx=function(e){return(e+7)/8|0},XR=function(e,t,n){return(n==null||n>e.length)&&(n=e.length),new iu(e.subarray(t,n))},cc=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Zd=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},Cm=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return{t:Ix,l:0};if(i==1){var o=new iu(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(A,R){return A.f-R.f}),n.push({s:-1,f:25001});var s=n[0],u=n[1],h=0,c=1,m=2;for(n[0]={s:-1,f:s.f+u.f,l:s,r:u};c!=i-1;)s=n[n[h].f<n[m].f?h++:m++],u=n[h!=c&&n[h].f<n[m].f?h++:m++],n[c++]={s:-1,f:s.f+u.f,l:s,r:u};for(var g=a[0].s,r=1;r<i;++r)a[r].s>g&&(g=a[r].s);var d=new ll(g+1),y=Rv(n[c-1],d,0);if(y>t){var r=0,_=0,x=y-t,b=1<<x;for(a.sort(function(R,O){return d[O.s]-d[R.s]||R.f-O.f});r<i;++r){var S=a[r].s;if(d[S]>t)_+=b-(1<<y-d[S]),d[S]=t;else break}for(_>>=x;_>0;){var k=a[r].s;d[k]<t?_-=1<<t-d[k]++-1:++r}for(;r>=0&&_;--r){var E=a[r].s;d[E]==t&&(--d[E],++_)}y=t}return{t:new iu(d),l:y}},Rv=function(e,t,n){return e.s==-1?Math.max(Rv(e.l,t,n+1),Rv(e.r,t,n+1)):t[e.s]=n},G4=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ll(++t),r=0,i=e[0],a=1,o=function(u){n[r++]=u},s=1;s<=t;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return{c:n.subarray(0,r),n:t}},Qd=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Mx=function(e,t,n){var r=n.length,i=Rx(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<r;++a)e[i+a+4]=n[a];return(i+4+r)*8},W4=function(e,t,n,r,i,a,o,s,u,h,c){cc(t,c++,n),++i[256];for(var m=Cm(i,15),g=m.t,d=m.l,y=Cm(a,15),_=y.t,x=y.l,b=G4(g),S=b.c,k=b.n,E=G4(_),A=E.c,R=E.n,O=new ll(19),I=0;I<S.length;++I)++O[S[I]&31];for(var I=0;I<A.length;++I)++O[A[I]&31];for(var j=Cm(O,7),D=j.t,C=j.l,N=19;N>4&&!D[$4[N-1]];--N);var $=h+5<<3,G=Qd(i,mh)+Qd(a,M0)+o,te=Qd(i,g)+Qd(a,_)+o+14+3*N+Qd(O,D)+2*O[16]+3*O[17]+7*O[18];if(u>=0&&$<=G&&$<=te)return Mx(t,c,e.subarray(u,u+h));var se,ee,Q,re;if(cc(t,c,1+(te<G)),c+=2,te<G){se=bp(g,d,0),ee=g,Q=bp(_,x,0),re=_;var X=bp(D,C,0);cc(t,c,k-257),cc(t,c+5,R-1),cc(t,c+10,N-4),c+=14;for(var I=0;I<N;++I)cc(t,c+3*I,D[$4[I]]);c+=3*N;for(var B=[S,A],F=0;F<2;++F)for(var z=B[F],I=0;I<z.length;++I){var Y=z[I]&31;cc(t,c,X[Y]),c+=D[Y],Y>15&&(cc(t,c,z[I]>>5&127),c+=z[I]>>12)}}else se=VR,ee=mh,Q=YR,re=M0;for(var I=0;I<s;++I){var J=r[I];if(J>255){var Y=J>>18&31;Zd(t,c,se[Y+257]),c+=ee[Y+257],Y>7&&(cc(t,c,J>>23&31),c+=Oy[Y]);var K=J&31;Zd(t,c,Q[K]),c+=re[K],K>3&&(Zd(t,c,J>>5&8191),c+=Cy[K])}else Zd(t,c,se[J]),c+=ee[J]}return Zd(t,c,se[256]),c+ee[256]},KR=new Py([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ix=new iu(0),ZR=function(e,t,n,r,i,a){var o=a.z||e.length,s=new iu(r+o+5*(1+Math.ceil(o/7e3))+i),u=s.subarray(r,s.length-i),h=a.l,c=(a.r||0)&7;if(t){c&&(u[0]=a.r>>3);for(var m=KR[t-1],g=m>>13,d=m&8191,y=(1<<n)-1,_=a.p||new ll(32768),x=a.h||new ll(y+1),b=Math.ceil(n/3),S=2*b,k=function(tt){return(e[tt]^e[tt+1]<<b^e[tt+2]<<S)&y},E=new Py(25e3),A=new ll(288),R=new ll(32),O=0,I=0,j=a.i||0,D=0,C=a.w||0,N=0;j+2<o;++j){var $=k(j),G=j&32767,te=x[$];if(_[G]=te,x[$]=G,C<=j){var se=o-j;if((O>7e3||D>24576)&&(se>423||!h)){c=W4(e,u,0,E,A,R,I,D,N,j-N,c),D=O=I=0,N=j;for(var ee=0;ee<286;++ee)A[ee]=0;for(var ee=0;ee<30;++ee)R[ee]=0}var Q=2,re=0,X=d,B=G-te&32767;if(se>2&&$==k(j-B))for(var F=Math.min(g,se)-1,z=Math.min(32767,j),Y=Math.min(258,se);B<=z&&--X&&G!=te;){if(e[j+Q]==e[j+Q-B]){for(var J=0;J<Y&&e[j+J]==e[j+J-B];++J);if(J>Q){if(Q=J,re=B,J>F)break;for(var K=Math.min(B,J-2),ie=0,ee=0;ee<K;++ee){var fe=j-B+ee&32767,ue=_[fe],_e=fe-ue&32767;_e>ie&&(ie=_e,te=fe)}}}G=te,te=_[G],B+=G-te&32767}if(re){E[D++]=268435456|Nv[Q]<<18|H4[re];var Ce=Nv[Q]&31,$e=H4[re]&31;I+=Oy[Ce]+Cy[$e],++A[257+Ce],++R[$e],C=j+Q,++O}else E[D++]=e[j],++A[e[j]]}}for(j=Math.max(j,C);j<o;++j)E[D++]=e[j],++A[e[j]];c=W4(e,u,h,E,A,R,I,D,N,j-N,c),h||(a.r=c&7|u[c/8|0]<<3,c-=7,a.h=x,a.p=_,a.i=j,a.w=C)}else{for(var j=a.w||0;j<o+h;j+=65535){var ze=j+65535;ze>=o&&(u[c/8|0]=h,ze=o),c=Mx(u,c+1,e.subarray(j,ze))}a.i=o}return XR(s,0,r+Rx(c)+i)},jx=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,a=n.length|0,o=0;o!=a;){for(var s=Math.min(o+2655,a);o<s;++o)i+=r+=n[o];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}e=r,t=i},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},QR=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),o=new iu(a.length+e.length);o.set(a),o.set(e,a.length),e=o,i.w=a.length}return ZR(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,i)},Dx=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},JR=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=jx();i.p(t.dictionary),Dx(e,2,i.d())}};function Mv(e,t){t||(t={});var n=jx();n.p(e);var r=QR(e,t,t.dictionary?6:2,4);return JR(r,t),Dx(r,r.length-4,n.d()),r}var eM=typeof TextDecoder<"u"&&new TextDecoder,tM=0;try{eM.decode(Ix,{stream:!0}),tM=1}catch{}function nM(e){if(Array.isArray(e))return e}function rM(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,s=[],u=!0,h=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(u=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(c){h=!0,i=c}finally{try{if(!u&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(h)throw i}}return s}}function V4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function iM(e,t){if(e){if(typeof e=="string")return V4(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?V4(e,t):void 0}}function aM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
444
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Y4(e,t){return nM(e)||rM(e,t)||iM(e,t)||aM()}function X4(e,t="utf8"){return new TextDecoder(t).decode(e)}const oM=new TextEncoder;function sM(e){return oM.encode(e)}const lM=1024*8,uM=(()=>{const e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),Lm={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class Ly{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(t=lM,n={}){let r=!1;typeof t=="number"?t=new ArrayBuffer(t):(r=!0,this.lastWrittenByte=t.byteLength);const i=n.offset?n.offset>>>0:0,a=t.byteLength-i;let o=i;(ArrayBuffer.isView(t)||t instanceof Ly)&&(t.byteLength!==t.buffer.byteLength&&(o=t.byteOffset+i),t=t.buffer),r?this.lastWrittenByte=a:this.lastWrittenByte=0,this.buffer=t,this.length=a,this.byteLength=a,this.byteOffset=o,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,o,a),this._mark=0,this._marks=[]}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t=1){return this.offset+=t,this}back(t=1){return this.offset-=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const t=this._marks.pop();if(t===void 0)throw new Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t=1){if(!this.available(t)){const r=(this.offset+t)*2,i=new Uint8Array(r);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=r,this.byteLength=r,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(t=1){return this.readArray(t,"uint8")}readArray(t,n){const r=Lm[n].BYTES_PER_ELEMENT*t,i=this.byteOffset+this.offset,a=this.buffer.slice(i,i+r);if(this.littleEndian===uM&&n!=="uint8"&&n!=="int8"){const s=new Uint8Array(this.buffer.slice(i,i+r));s.reverse();const u=new Lm[n](s.buffer);return this.offset+=r,u.reverse(),u}const o=new Lm[n](a);return this.offset+=r,o}readInt16(){const t=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}readUint16(){const t=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}readInt32(){const t=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}readUint32(){const t=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat32(){const t=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat64(){const t=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}readBigInt64(){const t=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,t}readBigUint64(){const t=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,t}readChar(){return String.fromCharCode(this.readInt8())}readChars(t=1){let n="";for(let r=0;r<t;r++)n+=this.readChar();return n}readUtf8(t=1){return X4(this.readBytes(t))}decodeText(t=1,n="utf8"){return X4(this.readBytes(t),n)}writeBoolean(t){return this.writeUint8(t?255:0),this}writeInt8(t){return this.ensureAvailable(1),this._data.setInt8(this.offset++,t),this._updateLastWrittenByte(),this}writeUint8(t){return this.ensureAvailable(1),this._data.setUint8(this.offset++,t),this._updateLastWrittenByte(),this}writeByte(t){return this.writeUint8(t)}writeBytes(t){this.ensureAvailable(t.length);for(let n=0;n<t.length;n++)this._data.setUint8(this.offset++,t[n]);return this._updateLastWrittenByte(),this}writeInt16(t){return this.ensureAvailable(2),this._data.setInt16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(t){return this.ensureAvailable(2),this._data.setUint16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(t){return this.ensureAvailable(4),this._data.setInt32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(t){return this.ensureAvailable(4),this._data.setUint32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(t){return this.ensureAvailable(4),this._data.setFloat32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(t){return this.ensureAvailable(8),this._data.setFloat64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(t){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(t){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(t){return this.writeUint8(t.charCodeAt(0))}writeChars(t){for(let n=0;n<t.length;n++)this.writeUint8(t.charCodeAt(n));return this}writeUtf8(t){return this.writeBytes(sM(t))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function Ld(e){let t=e.length;for(;--t>=0;)e[t]=0}const cM=3,fM=258,Fx=29,hM=256,dM=hM+1+Fx,Bx=30,pM=512,gM=new Array((dM+2)*2);Ld(gM);const mM=new Array(Bx*2);Ld(mM);const vM=new Array(pM);Ld(vM);const yM=new Array(fM-cM+1);Ld(yM);const bM=new Array(Fx);Ld(bM);const wM=new Array(Bx);Ld(wM);const xM=(e,t,n,r)=>{let i=e&65535|0,a=e>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0};var Iv=xM;const _M=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},SM=new Uint32Array(_M()),EM=(e,t,n,r)=>{const i=SM,a=r+n;e^=-1;for(let o=r;o<a;o++)e=e>>>8^i[(e^t[o])&255];return e^-1};var Ru=EM,jv={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},zx={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const kM=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var AM=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)kM(n,r)&&(e[r]=n[r])}}return e},PM=e=>{let t=0;for(let r=0,i=e.length;r<i;r++)t+=e[r].length;const n=new Uint8Array(t);for(let r=0,i=0,a=e.length;r<a;r++){let o=e[r];n.set(o,i),i+=o.length}return n},Ux={assign:AM,flattenChunks:PM};let qx=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{qx=!1}const Tp=new Uint8Array(256);for(let e=0;e<256;e++)Tp[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Tp[254]=Tp[254]=1;var OM=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,i,a,o=e.length,s=0;for(i=0;i<o;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|n&63):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|n&63):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|n&63);return t};const CM=(e,t)=>{if(t<65534&&e.subarray&&qx)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};var LM=(e,t)=>{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,i;const a=new Array(n*2);for(i=0,r=0;r<n;){let o=e[r++];if(o<128){a[i++]=o;continue}let s=Tp[o];if(s>4){a[i++]=65533,r+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&r<n;)o=o<<6|e[r++]&63,s--;if(s>1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return CM(a,i)},NM=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+Tp[e[n]]>t?n:t},Dv={string2buf:OM,buf2string:LM,utf8border:NM};function TM(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var RM=TM;const $1=16209,MM=16191;var IM=function(t,n){let r,i,a,o,s,u,h,c,m,g,d,y,_,x,b,S,k,E,A,R,O,I,j,D;const C=t.state;r=t.next_in,j=t.input,i=r+(t.avail_in-5),a=t.next_out,D=t.output,o=a-(n-t.avail_out),s=a+(t.avail_out-257),u=C.dmax,h=C.wsize,c=C.whave,m=C.wnext,g=C.window,d=C.hold,y=C.bits,_=C.lencode,x=C.distcode,b=(1<<C.lenbits)-1,S=(1<<C.distbits)-1;e:do{y<15&&(d+=j[r++]<<y,y+=8,d+=j[r++]<<y,y+=8),k=_[d&b];t:for(;;){if(E=k>>>24,d>>>=E,y-=E,E=k>>>16&255,E===0)D[a++]=k&65535;else if(E&16){A=k&65535,E&=15,E&&(y<E&&(d+=j[r++]<<y,y+=8),A+=d&(1<<E)-1,d>>>=E,y-=E),y<15&&(d+=j[r++]<<y,y+=8,d+=j[r++]<<y,y+=8),k=x[d&S];n:for(;;){if(E=k>>>24,d>>>=E,y-=E,E=k>>>16&255,E&16){if(R=k&65535,E&=15,y<E&&(d+=j[r++]<<y,y+=8,y<E&&(d+=j[r++]<<y,y+=8)),R+=d&(1<<E)-1,R>u){t.msg="invalid distance too far back",C.mode=$1;break e}if(d>>>=E,y-=E,E=a-o,R>E){if(E=R-E,E>c&&C.sane){t.msg="invalid distance too far back",C.mode=$1;break e}if(O=0,I=g,m===0){if(O+=h-E,E<A){A-=E;do D[a++]=g[O++];while(--E);O=a-R,I=D}}else if(m<E){if(O+=h+m-E,E-=m,E<A){A-=E;do D[a++]=g[O++];while(--E);if(O=0,m<A){E=m,A-=E;do D[a++]=g[O++];while(--E);O=a-R,I=D}}}else if(O+=m-E,E<A){A-=E;do D[a++]=g[O++];while(--E);O=a-R,I=D}for(;A>2;)D[a++]=I[O++],D[a++]=I[O++],D[a++]=I[O++],A-=3;A&&(D[a++]=I[O++],A>1&&(D[a++]=I[O++]))}else{O=a-R;do D[a++]=D[O++],D[a++]=D[O++],D[a++]=D[O++],A-=3;while(A>2);A&&(D[a++]=D[O++],A>1&&(D[a++]=D[O++]))}}else if((E&64)===0){k=x[(k&65535)+(d&(1<<E)-1)];continue n}else{t.msg="invalid distance code",C.mode=$1;break e}break}}else if((E&64)===0){k=_[(k&65535)+(d&(1<<E)-1)];continue t}else if(E&32){C.mode=MM;break e}else{t.msg="invalid literal/length code",C.mode=$1;break e}break}}while(r<i&&a<s);A=y>>3,r-=A,y-=A<<3,d&=(1<<y)-1,t.next_in=r,t.next_out=a,t.avail_in=r<i?5+(i-r):5-(r-i),t.avail_out=a<s?257+(s-a):257-(a-s),C.hold=d,C.bits=y};const Kh=15,K4=852,Z4=592,Q4=0,Nm=1,J4=2,jM=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),DM=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),FM=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),BM=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),zM=(e,t,n,r,i,a,o,s)=>{const u=s.bits;let h=0,c=0,m=0,g=0,d=0,y=0,_=0,x=0,b=0,S=0,k,E,A,R,O,I=null,j;const D=new Uint16Array(Kh+1),C=new Uint16Array(Kh+1);let N=null,$,G,te;for(h=0;h<=Kh;h++)D[h]=0;for(c=0;c<r;c++)D[t[n+c]]++;for(d=u,g=Kh;g>=1&&D[g]===0;g--);if(d>g&&(d=g),g===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(m=1;m<g&&D[m]===0;m++);for(d<m&&(d=m),x=1,h=1;h<=Kh;h++)if(x<<=1,x-=D[h],x<0)return-1;if(x>0&&(e===Q4||g!==1))return-1;for(C[1]=0,h=1;h<Kh;h++)C[h+1]=C[h]+D[h];for(c=0;c<r;c++)t[n+c]!==0&&(o[C[t[n+c]]++]=c);if(e===Q4?(I=N=o,j=20):e===Nm?(I=jM,N=DM,j=257):(I=FM,N=BM,j=0),S=0,c=0,h=m,O=a,y=d,_=0,A=-1,b=1<<d,R=b-1,e===Nm&&b>K4||e===J4&&b>Z4)return 1;for(;;){$=h-_,o[c]+1<j?(G=0,te=o[c]):o[c]>=j?(G=N[o[c]-j],te=I[o[c]-j]):(G=96,te=0),k=1<<h-_,E=1<<y,m=E;do E-=k,i[O+(S>>_)+E]=$<<24|G<<16|te|0;while(E!==0);for(k=1<<h-1;S&k;)k>>=1;if(k!==0?(S&=k-1,S+=k):S=0,c++,--D[h]===0){if(h===g)break;h=t[n+o[c]]}if(h>d&&(S&R)!==A){for(_===0&&(_=d),O+=m,y=h-_,x=1<<y;y+_<g&&(x-=D[y+_],!(x<=0));)y++,x<<=1;if(b+=1<<y,e===Nm&&b>K4||e===J4&&b>Z4)return 1;A=S&R,i[A]=d<<24|y<<16|O-a|0}}return S!==0&&(i[O+S]=h-_<<24|64<<16|0),s.bits=d,0};var wp=zM;const UM=0,$x=1,Hx=2,{Z_FINISH:ew,Z_BLOCK:qM,Z_TREES:H1,Z_OK:vh,Z_STREAM_END:$M,Z_NEED_DICT:HM,Z_STREAM_ERROR:Nl,Z_DATA_ERROR:Gx,Z_MEM_ERROR:Wx,Z_BUF_ERROR:GM,Z_DEFLATED:tw}=zx,sg=16180,nw=16181,rw=16182,iw=16183,aw=16184,ow=16185,sw=16186,lw=16187,uw=16188,cw=16189,I0=16190,fc=16191,Tm=16192,fw=16193,Rm=16194,hw=16195,dw=16196,pw=16197,gw=16198,G1=16199,W1=16200,mw=16201,vw=16202,yw=16203,bw=16204,ww=16205,Mm=16206,xw=16207,_w=16208,Ci=16209,Vx=16210,Yx=16211,WM=852,VM=592,YM=15,XM=YM,Sw=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function KM(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Ch=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<sg||t.mode>Yx?1:0},Xx=e=>{if(Ch(e))return Nl;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=sg,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(WM),t.distcode=t.distdyn=new Int32Array(VM),t.sane=1,t.back=-1,vh},Kx=e=>{if(Ch(e))return Nl;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Xx(e)},Zx=(e,t)=>{let n;if(Ch(e))return Nl;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Nl:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,Kx(e))},Qx=(e,t)=>{if(!e)return Nl;const n=new KM;e.state=n,n.strm=e,n.window=null,n.mode=sg;const r=Zx(e,t);return r!==vh&&(e.state=null),r},ZM=e=>Qx(e,XM);let Ew=!0,Im,jm;const QM=e=>{if(Ew){Im=new Int32Array(512),jm=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(wp($x,e.lens,0,288,Im,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;wp(Hx,e.lens,0,32,jm,0,e.work,{bits:5}),Ew=!1}e.lencode=Im,e.lenbits=9,e.distcode=jm,e.distbits=5},Jx=(e,t,n,r)=>{let i;const a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(t.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(t.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},JM=(e,t)=>{let n,r,i,a,o,s,u,h,c,m,g,d,y,_,x=0,b,S,k,E,A,R,O,I;const j=new Uint8Array(4);let D,C;const N=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ch(e)||!e.output||!e.input&&e.avail_in!==0)return Nl;n=e.state,n.mode===fc&&(n.mode=Tm),o=e.next_out,i=e.output,u=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,h=n.hold,c=n.bits,m=s,g=u,I=vh;e:for(;;)switch(n.mode){case sg:if(n.wrap===0){n.mode=Tm;break}for(;c<16;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}if(n.wrap&2&&h===35615){n.wbits===0&&(n.wbits=15),n.check=0,j[0]=h&255,j[1]=h>>>8&255,n.check=Ru(n.check,j,2,0),h=0,c=0,n.mode=nw;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((h&255)<<8)+(h>>8))%31){e.msg="incorrect header check",n.mode=Ci;break}if((h&15)!==tw){e.msg="unknown compression method",n.mode=Ci;break}if(h>>>=4,c-=4,O=(h&15)+8,n.wbits===0&&(n.wbits=O),O>15||O>n.wbits){e.msg="invalid window size",n.mode=Ci;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=h&512?cw:fc,h=0,c=0;break;case nw:for(;c<16;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}if(n.flags=h,(n.flags&255)!==tw){e.msg="unknown compression method",n.mode=Ci;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=Ci;break}n.head&&(n.head.text=h>>8&1),n.flags&512&&n.wrap&4&&(j[0]=h&255,j[1]=h>>>8&255,n.check=Ru(n.check,j,2,0)),h=0,c=0,n.mode=rw;case rw:for(;c<32;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}n.head&&(n.head.time=h),n.flags&512&&n.wrap&4&&(j[0]=h&255,j[1]=h>>>8&255,j[2]=h>>>16&255,j[3]=h>>>24&255,n.check=Ru(n.check,j,4,0)),h=0,c=0,n.mode=iw;case iw:for(;c<16;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}n.head&&(n.head.xflags=h&255,n.head.os=h>>8),n.flags&512&&n.wrap&4&&(j[0]=h&255,j[1]=h>>>8&255,n.check=Ru(n.check,j,2,0)),h=0,c=0,n.mode=aw;case aw:if(n.flags&1024){for(;c<16;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}n.length=h,n.head&&(n.head.extra_len=h),n.flags&512&&n.wrap&4&&(j[0]=h&255,j[1]=h>>>8&255,n.check=Ru(n.check,j,2,0)),h=0,c=0}else n.head&&(n.head.extra=null);n.mode=ow;case ow:if(n.flags&1024&&(d=n.length,d>s&&(d=s),d&&(n.head&&(O=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+d),O)),n.flags&512&&n.wrap&4&&(n.check=Ru(n.check,r,d,a)),s-=d,a+=d,n.length-=d),n.length))break e;n.length=0,n.mode=sw;case sw:if(n.flags&2048){if(s===0)break e;d=0;do O=r[a+d++],n.head&&O&&n.length<65536&&(n.head.name+=String.fromCharCode(O));while(O&&d<s);if(n.flags&512&&n.wrap&4&&(n.check=Ru(n.check,r,d,a)),s-=d,a+=d,O)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=lw;case lw:if(n.flags&4096){if(s===0)break e;d=0;do O=r[a+d++],n.head&&O&&n.length<65536&&(n.head.comment+=String.fromCharCode(O));while(O&&d<s);if(n.flags&512&&n.wrap&4&&(n.check=Ru(n.check,r,d,a)),s-=d,a+=d,O)break e}else n.head&&(n.head.comment=null);n.mode=uw;case uw:if(n.flags&512){for(;c<16;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}if(n.wrap&4&&h!==(n.check&65535)){e.msg="header crc mismatch",n.mode=Ci;break}h=0,c=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=fc;break;case cw:for(;c<32;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}e.adler=n.check=Sw(h),h=0,c=0,n.mode=I0;case I0:if(n.havedict===0)return e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=s,n.hold=h,n.bits=c,HM;e.adler=n.check=1,n.mode=fc;case fc:if(t===qM||t===H1)break e;case Tm:if(n.last){h>>>=c&7,c-=c&7,n.mode=Mm;break}for(;c<3;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}switch(n.last=h&1,h>>>=1,c-=1,h&3){case 0:n.mode=fw;break;case 1:if(QM(n),n.mode=G1,t===H1){h>>>=2,c-=2;break e}break;case 2:n.mode=dw;break;case 3:e.msg="invalid block type",n.mode=Ci}h>>>=2,c-=2;break;case fw:for(h>>>=c&7,c-=c&7;c<32;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}if((h&65535)!==(h>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Ci;break}if(n.length=h&65535,h=0,c=0,n.mode=Rm,t===H1)break e;case Rm:n.mode=hw;case hw:if(d=n.length,d){if(d>s&&(d=s),d>u&&(d=u),d===0)break e;i.set(r.subarray(a,a+d),o),s-=d,a+=d,u-=d,o+=d,n.length-=d;break}n.mode=fc;break;case dw:for(;c<14;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}if(n.nlen=(h&31)+257,h>>>=5,c-=5,n.ndist=(h&31)+1,h>>>=5,c-=5,n.ncode=(h&15)+4,h>>>=4,c-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Ci;break}n.have=0,n.mode=pw;case pw:for(;n.have<n.ncode;){for(;c<3;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}n.lens[N[n.have++]]=h&7,h>>>=3,c-=3}for(;n.have<19;)n.lens[N[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,D={bits:n.lenbits},I=wp(UM,n.lens,0,19,n.lencode,0,n.work,D),n.lenbits=D.bits,I){e.msg="invalid code lengths set",n.mode=Ci;break}n.have=0,n.mode=gw;case gw:for(;n.have<n.nlen+n.ndist;){for(;x=n.lencode[h&(1<<n.lenbits)-1],b=x>>>24,S=x>>>16&255,k=x&65535,!(b<=c);){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}if(k<16)h>>>=b,c-=b,n.lens[n.have++]=k;else{if(k===16){for(C=b+2;c<C;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}if(h>>>=b,c-=b,n.have===0){e.msg="invalid bit length repeat",n.mode=Ci;break}O=n.lens[n.have-1],d=3+(h&3),h>>>=2,c-=2}else if(k===17){for(C=b+3;c<C;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}h>>>=b,c-=b,O=0,d=3+(h&7),h>>>=3,c-=3}else{for(C=b+7;c<C;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}h>>>=b,c-=b,O=0,d=11+(h&127),h>>>=7,c-=7}if(n.have+d>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Ci;break}for(;d--;)n.lens[n.have++]=O}}if(n.mode===Ci)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=Ci;break}if(n.lenbits=9,D={bits:n.lenbits},I=wp($x,n.lens,0,n.nlen,n.lencode,0,n.work,D),n.lenbits=D.bits,I){e.msg="invalid literal/lengths set",n.mode=Ci;break}if(n.distbits=6,n.distcode=n.distdyn,D={bits:n.distbits},I=wp(Hx,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,D),n.distbits=D.bits,I){e.msg="invalid distances set",n.mode=Ci;break}if(n.mode=G1,t===H1)break e;case G1:n.mode=W1;case W1:if(s>=6&&u>=258){e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=s,n.hold=h,n.bits=c,IM(e,g),o=e.next_out,i=e.output,u=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,h=n.hold,c=n.bits,n.mode===fc&&(n.back=-1);break}for(n.back=0;x=n.lencode[h&(1<<n.lenbits)-1],b=x>>>24,S=x>>>16&255,k=x&65535,!(b<=c);){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}if(S&&(S&240)===0){for(E=b,A=S,R=k;x=n.lencode[R+((h&(1<<E+A)-1)>>E)],b=x>>>24,S=x>>>16&255,k=x&65535,!(E+b<=c);){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}h>>>=E,c-=E,n.back+=E}if(h>>>=b,c-=b,n.back+=b,n.length=k,S===0){n.mode=ww;break}if(S&32){n.back=-1,n.mode=fc;break}if(S&64){e.msg="invalid literal/length code",n.mode=Ci;break}n.extra=S&15,n.mode=mw;case mw:if(n.extra){for(C=n.extra;c<C;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}n.length+=h&(1<<n.extra)-1,h>>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=vw;case vw:for(;x=n.distcode[h&(1<<n.distbits)-1],b=x>>>24,S=x>>>16&255,k=x&65535,!(b<=c);){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}if((S&240)===0){for(E=b,A=S,R=k;x=n.distcode[R+((h&(1<<E+A)-1)>>E)],b=x>>>24,S=x>>>16&255,k=x&65535,!(E+b<=c);){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}h>>>=E,c-=E,n.back+=E}if(h>>>=b,c-=b,n.back+=b,S&64){e.msg="invalid distance code",n.mode=Ci;break}n.offset=k,n.extra=S&15,n.mode=yw;case yw:if(n.extra){for(C=n.extra;c<C;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}n.offset+=h&(1<<n.extra)-1,h>>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Ci;break}n.mode=bw;case bw:if(u===0)break e;if(d=g-u,n.offset>d){if(d=n.offset-d,d>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Ci;break}d>n.wnext?(d-=n.wnext,y=n.wsize-d):y=n.wnext-d,d>n.length&&(d=n.length),_=n.window}else _=i,y=o-n.offset,d=n.length;d>u&&(d=u),u-=d,n.length-=d;do i[o++]=_[y++];while(--d);n.length===0&&(n.mode=W1);break;case ww:if(u===0)break e;i[o++]=n.length,u--,n.mode=W1;break;case Mm:if(n.wrap){for(;c<32;){if(s===0)break e;s--,h|=r[a++]<<c,c+=8}if(g-=u,e.total_out+=g,n.total+=g,n.wrap&4&&g&&(e.adler=n.check=n.flags?Ru(n.check,i,g,o-g):Iv(n.check,i,g,o-g)),g=u,n.wrap&4&&(n.flags?h:Sw(h))!==n.check){e.msg="incorrect data check",n.mode=Ci;break}h=0,c=0}n.mode=xw;case xw:if(n.wrap&&n.flags){for(;c<32;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}if(n.wrap&4&&h!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=Ci;break}h=0,c=0}n.mode=_w;case _w:I=$M;break e;case Ci:I=Gx;break e;case Vx:return Wx;case Yx:default:return Nl}return e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=s,n.hold=h,n.bits=c,(n.wsize||g!==e.avail_out&&n.mode<Ci&&(n.mode<Mm||t!==ew))&&Jx(e,e.output,e.next_out,g-e.avail_out),m-=e.avail_in,g-=e.avail_out,e.total_in+=m,e.total_out+=g,n.total+=g,n.wrap&4&&g&&(e.adler=n.check=n.flags?Ru(n.check,i,g,e.next_out-g):Iv(n.check,i,g,e.next_out-g)),e.data_type=n.bits+(n.last?64:0)+(n.mode===fc?128:0)+(n.mode===G1||n.mode===Rm?256:0),(m===0&&g===0||t===ew)&&I===vh&&(I=GM),I},eI=e=>{if(Ch(e))return Nl;let t=e.state;return t.window&&(t.window=null),e.state=null,vh},tI=(e,t)=>{if(Ch(e))return Nl;const n=e.state;return(n.wrap&2)===0?Nl:(n.head=t,t.done=!1,vh)},nI=(e,t)=>{const n=t.length;let r,i,a;return Ch(e)||(r=e.state,r.wrap!==0&&r.mode!==I0)?Nl:r.mode===I0&&(i=1,i=Iv(i,t,n,0),i!==r.check)?Gx:(a=Jx(e,t,n,n),a?(r.mode=Vx,Wx):(r.havedict=1,vh))};var rI=Kx,iI=Zx,aI=Xx,oI=ZM,sI=Qx,lI=JM,uI=eI,cI=tI,fI=nI,hI="pako inflate (from Nodeca project)",pc={inflateReset:rI,inflateReset2:iI,inflateResetKeep:aI,inflateInit:oI,inflateInit2:sI,inflate:lI,inflateEnd:uI,inflateGetHeader:cI,inflateSetDictionary:fI,inflateInfo:hI};function dI(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var pI=dI;const e_=Object.prototype.toString,{Z_NO_FLUSH:gI,Z_FINISH:mI,Z_OK:Rp,Z_STREAM_END:Dm,Z_NEED_DICT:Fm,Z_STREAM_ERROR:vI,Z_DATA_ERROR:kw,Z_MEM_ERROR:yI}=zx;function Yp(e){this.options=Ux.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new RM,this.strm.avail_out=0;let n=pc.inflateInit2(this.strm,t.windowBits);if(n!==Rp)throw new Error(jv[n]);if(this.header=new pI,pc.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Dv.string2buf(t.dictionary):e_.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=pc.inflateSetDictionary(this.strm,t.dictionary),n!==Rp)))throw new Error(jv[n])}Yp.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let a,o,s;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?mI:gI,e_.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),a=pc.inflate(n,o),a===Fm&&i&&(a=pc.inflateSetDictionary(n,i),a===Rp?a=pc.inflate(n,o):a===kw&&(a=Fm));n.avail_in>0&&a===Dm&&n.state.wrap>0&&e[n.next_in]!==0;)pc.inflateReset(n),a=pc.inflate(n,o);switch(a){case vI:case kw:case Fm:case yI:return this.onEnd(a),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||a===Dm))if(this.options.to==="string"){let u=Dv.utf8border(n.output,n.next_out),h=n.next_out-u,c=Dv.buf2string(n.output,u);n.next_out=h,n.avail_out=r-h,h&&n.output.set(n.output.subarray(u,u+h),0),this.onData(c)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(a===Rp&&s===0)){if(a===Dm)return a=pc.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};Yp.prototype.onData=function(e){this.chunks.push(e)};Yp.prototype.onEnd=function(e){e===Rp&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ux.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function bI(e,t){const n=new Yp(t);if(n.push(e),n.err)throw n.msg||jv[n.err];return n.result}var wI=Yp,xI=bI,_I={Inflate:wI,inflate:xI};const{Inflate:SI,inflate:EI}=_I;var Aw=SI,kI=EI;const t_=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=3988292384^t>>>1:t=t>>>1;t_[e]=t}const Pw=4294967295;function AI(e,t,n){let r=e;for(let i=0;i<n;i++)r=t_[(r^t[i])&255]^r>>>8;return r}function PI(e,t){return(AI(Pw,e,t)^Pw)>>>0}function Ow(e,t,n){const r=e.readUint32(),i=PI(new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),t);if(i!==r)throw new Error(`CRC mismatch for chunk ${n}. Expected ${r}, found ${i}`)}function n_(e,t,n){for(let r=0;r<n;r++)t[r]=e[r]}function r_(e,t,n,r){let i=0;for(;i<r;i++)t[i]=e[i];for(;i<n;i++)t[i]=e[i]+t[i-r]&255}function i_(e,t,n,r){let i=0;if(n.length===0)for(;i<r;i++)t[i]=e[i];else for(;i<r;i++)t[i]=e[i]+n[i]&255}function a_(e,t,n,r,i){let a=0;if(n.length===0){for(;a<i;a++)t[a]=e[a];for(;a<r;a++)t[a]=e[a]+(t[a-i]>>1)&255}else{for(;a<i;a++)t[a]=e[a]+(n[a]>>1)&255;for(;a<r;a++)t[a]=e[a]+(t[a-i]+n[a]>>1)&255}}function o_(e,t,n,r,i){let a=0;if(n.length===0){for(;a<i;a++)t[a]=e[a];for(;a<r;a++)t[a]=e[a]+t[a-i]&255}else{for(;a<i;a++)t[a]=e[a]+n[a]&255;for(;a<r;a++)t[a]=e[a]+OI(t[a-i],n[a],n[a-i])&255}}function OI(e,t,n){const r=e+t-n,i=Math.abs(r-e),a=Math.abs(r-t),o=Math.abs(r-n);return i<=a&&i<=o?e:a<=o?t:n}function CI(e,t,n,r,i,a){switch(e){case 0:n_(t,n,i);break;case 1:r_(t,n,i,a);break;case 2:i_(t,n,r,i);break;case 3:a_(t,n,r,i,a);break;case 4:o_(t,n,r,i,a);break;default:throw new Error(`Unsupported filter: ${e}`)}}const LI=new Uint16Array([255]),NI=new Uint8Array(LI.buffer),TI=NI[0]===255;function RI(e){const{data:t,width:n,height:r,channels:i,depth:a}=e,o=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],s=Math.ceil(a/8)*i,u=new Uint8Array(r*n*s);let h=0;for(let c=0;c<7;c++){const m=o[c],g=Math.ceil((n-m.x)/m.xStep),d=Math.ceil((r-m.y)/m.yStep);if(g<=0||d<=0)continue;const y=g*s,_=new Uint8Array(y);for(let x=0;x<d;x++){const b=t[h++],S=t.subarray(h,h+y);h+=y;const k=new Uint8Array(y);CI(b,S,k,_,y,s),_.set(k);for(let E=0;E<g;E++){const A=m.x+E*m.xStep,R=m.y+x*m.yStep;if(!(A>=n||R>=r))for(let O=0;O<s;O++)u[(R*n+A)*s+O]=k[E*s+O]}}}if(a===16){const c=new Uint16Array(u.buffer);if(TI)for(let m=0;m<c.length;m++)c[m]=MI(c[m]);return c}else return u}function MI(e){return(e&255)<<8|e>>8&255}const II=new Uint16Array([255]),jI=new Uint8Array(II.buffer),DI=jI[0]===255,FI=new Uint8Array(0);function Cw(e){const{data:t,width:n,height:r,channels:i,depth:a}=e,o=Math.ceil(a/8)*i,s=Math.ceil(a/8*i*n),u=new Uint8Array(r*s);let h=FI,c=0,m,g;for(let d=0;d<r;d++){switch(m=t.subarray(c+1,c+1+s),g=u.subarray(d*s,(d+1)*s),t[c]){case 0:n_(m,g,s);break;case 1:r_(m,g,s,o);break;case 2:i_(m,g,h,s);break;case 3:a_(m,g,h,s,o);break;case 4:o_(m,g,h,s,o);break;default:throw new Error(`Unsupported filter: ${t[c]}`)}h=g,c+=s+1}if(a===16){const d=new Uint16Array(u.buffer);if(DI)for(let y=0;y<d.length;y++)d[y]=BI(d[y]);return d}else return u}function BI(e){return(e&255)<<8|e>>8&255}const s0=Uint8Array.of(137,80,78,71,13,10,26,10);function Lw(e){if(!zI(e.readBytes(s0.length)))throw new Error("wrong PNG signature")}function zI(e){if(e.length<s0.length)return!1;for(let t=0;t<s0.length;t++)if(e[t]!==s0[t])return!1;return!0}const UI="tEXt",qI=0,s_=new TextDecoder("latin1");function $I(e){if(GI(e),e.length===0||e.length>79)throw new Error("keyword length must be between 1 and 79")}const HI=/^[\u0000-\u00FF]*$/;function GI(e){if(!HI.test(e))throw new Error("invalid latin1 text")}function WI(e,t,n){const r=l_(t);e[r]=VI(t,n-r.length-1)}function l_(e){for(e.mark();e.readByte()!==qI;);const t=e.offset;e.reset();const n=s_.decode(e.readBytes(t-e.offset-1));return e.skip(1),$I(n),n}function VI(e,t){return s_.decode(e.readBytes(t))}const nl={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},Bm={UNKNOWN:-1,DEFLATE:0},Nw={UNKNOWN:-1,ADAPTIVE:0},zm={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},V1={NONE:0,BACKGROUND:1,PREVIOUS:2},Um={SOURCE:0,OVER:1};class YI extends Ly{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;constructor(t,n={}){super(t);const{checkCrc:r=!1}=n;this._checkCrc=r,this._inflator=new Aw,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=Bm.UNKNOWN,this._filterMethod=Nw.UNKNOWN,this._interlaceMethod=zm.UNKNOWN,this._colorType=nl.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(Lw(this);!this._end;){const t=this.readUint32(),n=this.readChars(4);this.decodeChunk(t,n)}return this.decodeImage(),this._png}decodeApng(){for(Lw(this);!this._end;){const t=this.readUint32(),n=this.readChars(4);this.decodeApngChunk(t,n)}return this.decodeApngImage(),this._apng}decodeChunk(t,n){const r=this.offset;switch(n){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(t);break;case"IDAT":this.decodeIDAT(t);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(t);break;case"iCCP":this.decodeiCCP(t);break;case UI:WI(this._png.text,this,t);break;case"pHYs":this.decodepHYs();break;default:this.skip(t);break}if(this.offset-r!==t)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?Ow(this,t+4,n):this.skip(4)}decodeApngChunk(t,n){const r=this.offset;switch(n!=="fdAT"&&n!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),n){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(t);break;default:this.decodeChunk(t,n),this.offset=r+t;break}if(this.offset-r!==t)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?Ow(this,t+4,n):this.skip(4)}decodeIHDR(){const t=this._png;t.width=this.readUint32(),t.height=this.readUint32(),t.depth=XI(this.readUint8());const n=this.readUint8();this._colorType=n;let r;switch(n){case nl.GREYSCALE:r=1;break;case nl.TRUECOLOUR:r=3;break;case nl.INDEXED_COLOUR:r=1;break;case nl.GREYSCALE_ALPHA:r=2;break;case nl.TRUECOLOUR_ALPHA:r=4;break;case nl.UNKNOWN:default:throw new Error(`Unknown color type: ${n}`)}if(this._png.channels=r,this._compressionMethod=this.readUint8(),this._compressionMethod!==Bm.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const t={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(t)}decodePLTE(t){if(t%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${t}`);const n=t/3;this._hasPalette=!0;const r=[];this._palette=r;for(let i=0;i<n;i++)r.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(t){this._writingDataChunks=!0;const n=t,r=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,r,n)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(t)}decodeFDAT(t){this._writingDataChunks=!0;let n=t,r=this.offset+this.byteOffset;if(r+=4,n-=4,this._inflator.push(new Uint8Array(this.buffer,r,n)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(t)}decodetRNS(t){switch(this._colorType){case nl.GREYSCALE:case nl.TRUECOLOUR:{if(t%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${t}`);if(t/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${t/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(t/2);for(let n=0;n<t/2;n++)this._transparency[n]=this.readUint16();break}case nl.INDEXED_COLOUR:{if(t>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${t} vs ${this._palette.length})`);let n=0;for(;n<t;n++){const r=this.readByte();this._palette[n].push(r)}for(;n<this._palette.length;n++)this._palette[n].push(255);break}case nl.UNKNOWN:case nl.GREYSCALE_ALPHA:case nl.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(t){const n=l_(this),r=this.readUint8();if(r!==Bm.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${r}`);const i=this.readBytes(t-n.length-2);this._png.iccEmbeddedProfile={name:n,profile:kI(i)}}decodepHYs(){const t=this.readUint32(),n=this.readUint32(),r=this.readByte();this._png.resolution={x:t,y:n,unit:r}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let t=0;t<this._numberOfFrames;t++){const n={sequenceNumber:this._frames[t].sequenceNumber,delayNumber:this._frames[t].delayNumber,delayDenominator:this._frames[t].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},r=this._frames.at(t);if(r){if(r.data=Cw({data:r.data,width:r.width,height:r.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),t===0||r.xOffset===0&&r.yOffset===0&&r.width===this._png.width&&r.height===this._png.height)n.data=r.data;else{const i=this._apng.frames.at(t-1);this.disposeFrame(r,i,n),this.addFrameDataToCanvas(n,r)}this._apng.frames.push(n)}}return this._apng}disposeFrame(t,n,r){switch(t.disposeOp){case V1.NONE:break;case V1.BACKGROUND:for(let i=0;i<this._png.height;i++)for(let a=0;a<this._png.width;a++){const o=(i*t.width+a)*this._png.channels;for(let s=0;s<this._png.channels;s++)r.data[o+s]=0}break;case V1.PREVIOUS:r.data.set(n.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(t,n){const r=1<<this._png.depth,i=(a,o)=>{const s=((a+n.yOffset)*this._png.width+n.xOffset+o)*this._png.channels,u=(a*n.width+o)*this._png.channels;return{index:s,frameIndex:u}};switch(n.blendOp){case Um.SOURCE:for(let a=0;a<n.height;a++)for(let o=0;o<n.width;o++){const{index:s,frameIndex:u}=i(a,o);for(let h=0;h<this._png.channels;h++)t.data[s+h]=n.data[u+h]}break;case Um.OVER:for(let a=0;a<n.height;a++)for(let o=0;o<n.width;o++){const{index:s,frameIndex:u}=i(a,o);for(let h=0;h<this._png.channels;h++){const c=n.data[u+this._png.channels-1]/r,m=h%(this._png.channels-1)===0?1:n.data[u+h],g=Math.floor(c*m+(1-c)*t.data[s+h]);t.data[s+h]+=g}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const t=this._isAnimated?(this._frames?.at(0)).data:this._inflator.result;if(this._filterMethod!==Nw.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===zm.NO_INTERLACE)this._png.data=Cw({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===zm.ADAM7)this._png.data=RI({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const t=this._inflator.result,n=this._frames.at(-1);n?n.data=t:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:V1.NONE,blendOp:Um.SOURCE,data:t}),this._inflator=new Aw,this._writingDataChunks=!1}}function XI(e){if(e!==1&&e!==2&&e!==4&&e!==8&&e!==16)throw new Error(`invalid bit depth: ${e}`);return e}var Tw;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.METRE=1]="METRE"})(Tw||(Tw={}));function KI(e,t){return new YI(e,t).decode()}var En=(function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this})();function qm(){En.console&&typeof En.console.log=="function"&&En.console.log.apply(En.console,arguments)}var Zr={log:qm,warn:function(e){En.console&&(typeof En.console.warn=="function"?En.console.warn.apply(En.console,arguments):qm.call(null,arguments))},error:function(e){En.console&&(typeof En.console.error=="function"?En.console.error.apply(En.console,arguments):qm(e))}};function $m(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){eh(r.response,t,n)},r.onerror=function(){Zr.error("could not download file")},r.send()}function Rw(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function Y1(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var eh=En.saveAs||((typeof window>"u"?"undefined":jr(window))!=="object"||window!==En?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(e,t,n){var r=En.URL||En.webkitURL,i=document.createElement("a");t=t||e.name||"download",i.download=t,i.rel="noopener",typeof e=="string"?(i.href=e,i.origin!==location.origin?Rw(i.href)?$m(e,t,n):Y1(i,i.target="_blank"):Y1(i)):(i.href=r.createObjectURL(e),setTimeout(function(){r.revokeObjectURL(i.href)},4e4),setTimeout(function(){Y1(i)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download",typeof e=="string")if(Rw(e))$m(e,t,n);else{var r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){Y1(r)})}else navigator.msSaveOrOpenBlob((function(i,a){return a===void 0?a={autoBom:!1}:jr(a)!=="object"&&(Zr.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob(["\uFEFF",i],{type:i.type}):i})(e,n),t)}:function(e,t,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return $m(e,t,n);var i=e.type==="application/octet-stream",a=/constructor/i.test(En.HTMLElement)||En.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a)&&(typeof FileReader>"u"?"undefined":jr(FileReader))==="object"){var s=new FileReader;s.onloadend=function(){var c=s.result;c=o?c:c.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=c:location=c,r=null},s.readAsDataURL(e)}else{var u=En.URL||En.webkitURL,h=u.createObjectURL(e);r?r.location=h:location.href=h,r=null,setTimeout(function(){u.revokeObjectURL(h)},4e4)}});function u_(e){var t;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 n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(s){return[parseInt(s[1]),parseInt(s[2]),parseInt(s[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(s){return[parseInt(s[1],16),parseInt(s[2],16),parseInt(s[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(s){return[parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16),parseInt(s[3]+s[3],16)]}}],r=0;r<n.length;r++){var i=n[r].re,a=n[r].process,o=i.exec(e);o&&(t=a(o),this.r=t[0],this.g=t[1],this.b=t[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var s=this.r.toString(16),u=this.g.toString(16),h=this.b.toString(16);return s.length==1&&(s="0"+s),u.length==1&&(u="0"+u),h.length==1&&(h="0"+h),"#"+s+u+h}}var l0=En.atob.bind(En),Mw=En.btoa.bind(En);function Hm(e,t){var n=e[0],r=e[1],i=e[2],a=e[3];n=Bo(n,r,i,a,t[0],7,-680876936),a=Bo(a,n,r,i,t[1],12,-389564586),i=Bo(i,a,n,r,t[2],17,606105819),r=Bo(r,i,a,n,t[3],22,-1044525330),n=Bo(n,r,i,a,t[4],7,-176418897),a=Bo(a,n,r,i,t[5],12,1200080426),i=Bo(i,a,n,r,t[6],17,-1473231341),r=Bo(r,i,a,n,t[7],22,-45705983),n=Bo(n,r,i,a,t[8],7,1770035416),a=Bo(a,n,r,i,t[9],12,-1958414417),i=Bo(i,a,n,r,t[10],17,-42063),r=Bo(r,i,a,n,t[11],22,-1990404162),n=Bo(n,r,i,a,t[12],7,1804603682),a=Bo(a,n,r,i,t[13],12,-40341101),i=Bo(i,a,n,r,t[14],17,-1502002290),n=zo(n,r=Bo(r,i,a,n,t[15],22,1236535329),i,a,t[1],5,-165796510),a=zo(a,n,r,i,t[6],9,-1069501632),i=zo(i,a,n,r,t[11],14,643717713),r=zo(r,i,a,n,t[0],20,-373897302),n=zo(n,r,i,a,t[5],5,-701558691),a=zo(a,n,r,i,t[10],9,38016083),i=zo(i,a,n,r,t[15],14,-660478335),r=zo(r,i,a,n,t[4],20,-405537848),n=zo(n,r,i,a,t[9],5,568446438),a=zo(a,n,r,i,t[14],9,-1019803690),i=zo(i,a,n,r,t[3],14,-187363961),r=zo(r,i,a,n,t[8],20,1163531501),n=zo(n,r,i,a,t[13],5,-1444681467),a=zo(a,n,r,i,t[2],9,-51403784),i=zo(i,a,n,r,t[7],14,1735328473),n=Uo(n,r=zo(r,i,a,n,t[12],20,-1926607734),i,a,t[5],4,-378558),a=Uo(a,n,r,i,t[8],11,-2022574463),i=Uo(i,a,n,r,t[11],16,1839030562),r=Uo(r,i,a,n,t[14],23,-35309556),n=Uo(n,r,i,a,t[1],4,-1530992060),a=Uo(a,n,r,i,t[4],11,1272893353),i=Uo(i,a,n,r,t[7],16,-155497632),r=Uo(r,i,a,n,t[10],23,-1094730640),n=Uo(n,r,i,a,t[13],4,681279174),a=Uo(a,n,r,i,t[0],11,-358537222),i=Uo(i,a,n,r,t[3],16,-722521979),r=Uo(r,i,a,n,t[6],23,76029189),n=Uo(n,r,i,a,t[9],4,-640364487),a=Uo(a,n,r,i,t[12],11,-421815835),i=Uo(i,a,n,r,t[15],16,530742520),n=qo(n,r=Uo(r,i,a,n,t[2],23,-995338651),i,a,t[0],6,-198630844),a=qo(a,n,r,i,t[7],10,1126891415),i=qo(i,a,n,r,t[14],15,-1416354905),r=qo(r,i,a,n,t[5],21,-57434055),n=qo(n,r,i,a,t[12],6,1700485571),a=qo(a,n,r,i,t[3],10,-1894986606),i=qo(i,a,n,r,t[10],15,-1051523),r=qo(r,i,a,n,t[1],21,-2054922799),n=qo(n,r,i,a,t[8],6,1873313359),a=qo(a,n,r,i,t[15],10,-30611744),i=qo(i,a,n,r,t[6],15,-1560198380),r=qo(r,i,a,n,t[13],21,1309151649),n=qo(n,r,i,a,t[4],6,-145523070),a=qo(a,n,r,i,t[11],10,-1120210379),i=qo(i,a,n,r,t[2],15,718787259),r=qo(r,i,a,n,t[9],21,-343485551),e[0]=yf(n,e[0]),e[1]=yf(r,e[1]),e[2]=yf(i,e[2]),e[3]=yf(a,e[3])}function lg(e,t,n,r,i,a){return t=yf(yf(t,e),yf(r,a)),yf(t<<i|t>>>32-i,n)}function Bo(e,t,n,r,i,a,o){return lg(t&n|~t&r,e,t,i,a,o)}function zo(e,t,n,r,i,a,o){return lg(t&r|n&~r,e,t,i,a,o)}function Uo(e,t,n,r,i,a,o){return lg(t^n^r,e,t,i,a,o)}function qo(e,t,n,r,i,a,o){return lg(n^(t|~r),e,t,i,a,o)}function c_(e){var t,n=e.length,r=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)Hm(r,ZI(e.substring(t-64,t)));e=e.substring(t-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<e.length;t++)i[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(i[t>>2]|=128<<(t%4<<3),t>55)for(Hm(r,i),t=0;t<16;t++)i[t]=0;return i[14]=8*n,Hm(r,i),r}function ZI(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}var Iw="0123456789abcdef".split("");function QI(e){for(var t="",n=0;n<4;n++)t+=Iw[e>>8*n+4&15]+Iw[e>>8*n&15];return t}function JI(e){return String.fromCharCode(255&e,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function Fv(e){return c_(e).map(JI).join("")}var ej=(function(e){for(var t=0;t<e.length;t++)e[t]=QI(e[t]);return e.join("")})(c_("hello"))!="5d41402abc4b2a76b9719d911017c592";function yf(e,t){if(ej){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}return e+t&4294967295}function Bv(e,t){var n,r,i,a;if(e!==n){for(var o=(i=e,a=1+(256/e.length|0),new Array(a+1).join(i)),s=[],u=0;u<256;u++)s[u]=u;var h=0;for(u=0;u<256;u++){var c=s[u];h=(h+c+o.charCodeAt(u))%256,s[u]=s[h],s[h]=c}n=e,r=s}else s=r;var m=t.length,g=0,d=0,y="";for(u=0;u<m;u++)d=(d+(c=s[g=(g+1)%256]))%256,s[g]=s[d],s[d]=c,o=s[(s[g]+s[d])%256],y+=String.fromCharCode(t.charCodeAt(u)^o);return y}var jw={print:4,modify:8,copy:16,"annot-forms":32};function ed(e,t,n,r){this.v=1,this.r=2;var i=192;e.forEach(function(s){if(jw.perm!==void 0)throw new Error("Invalid permission: "+s);i+=jw[s]}),this.padding="(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";var a=(t+this.padding).substr(0,32),o=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(a,o),this.P=-(1+(255^i)),this.encryptionKey=Fv(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=Bv(this.encryptionKey,this.padding)}function td(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var t="",n=e.length,r=0;r<n;r++){var i=e.charCodeAt(r);t+=i<33||i===35||i===37||i===40||i===41||i===47||i===60||i===62||i===91||i===93||i===123||i===125||i>126?"#"+("0"+i.toString(16)).slice(-2):e[r]}return t}function Dw(e){if(jr(e)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var t={};this.subscribe=function(n,r,i){if(i=i||!1,typeof n!="string"||typeof r!="function"||typeof i!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");t.hasOwnProperty(n)||(t[n]={});var a=Math.random().toString(35);return t[n][a]=[r,!!i],a},this.unsubscribe=function(n){for(var r in t)if(t[r][n])return delete t[r][n],Object.keys(t[r]).length===0&&delete t[r],!0;return!1},this.publish=function(n){if(t.hasOwnProperty(n)){var r=Array.prototype.slice.call(arguments,1),i=[];for(var a in t[n]){var o=t[n][a];try{o[0].apply(e,r)}catch(s){En.console&&Zr.error("jsPDF PubSub Error",s.message,s)}o[1]&&i.push(a)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function j0(e){if(!(this instanceof j0))return new j0(e);var t="opacity,stroke-opacity".split(",");for(var n in e)e.hasOwnProperty(n)&&t.indexOf(n)>=0&&(this[n]=e[n]);this.id="",this.objectNumber=-1}function f_(e,t){this.gState=e,this.matrix=t,this.id="",this.objectNumber=-1}function th(e,t,n,r,i){if(!(this instanceof th))return new th(e,t,n,r,i);this.type=e==="axial"?2:3,this.coords=t,this.colors=n,f_.call(this,r,i)}function ld(e,t,n,r,i){if(!(this instanceof ld))return new ld(e,t,n,r,i);this.boundingBox=e,this.xStep=t,this.yStep=n,this.stream="",this.cloneIndex=0,f_.call(this,r,i)}function sn(e){var t,n=typeof arguments[0]=="string"?arguments[0]:"p",r=arguments[1],i=arguments[2],a=arguments[3],o=[],s=1,u=16,h="S",c=null;jr(e=e||{})==="object"&&(n=e.orientation,r=e.unit||r,i=e.format||i,a=e.compress||e.compressPdf||a,(c=e.encryption||null)!==null&&(c.userPassword=c.userPassword||"",c.ownerPassword=c.ownerPassword||"",c.userPermissions=c.userPermissions||[]),s=typeof e.userUnit=="number"?Math.abs(e.userUnit):1,e.precision!==void 0&&(t=e.precision),e.floatPrecision!==void 0&&(u=e.floatPrecision),h=e.defaultPathOperation||"S"),o=e.filters||(a===!0?["FlateEncode"]:o),r=r||"mm",n=(""+(n||"P")).toLowerCase();var m=e.putOnlyUsedFonts||!1,g={},d={internal:{},__private__:{}};d.__private__.PubSub=Dw;var y="1.3",_=d.__private__.getPdfVersion=function(){return y};d.__private__.setPdfVersion=function(q){y=q};var x={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 x};var b=d.__private__.getPageFormat=function(q){return x[q]};i=i||"a4";var S="compat",k="advanced",E=S;function A(){this.saveGraphicsState(),pe(new Jt(ot,0,0,-ot,0,_i()*ot).toString()+" cm"),this.setFontSize(this.getFontSize()/ot),h="n",E=k}function R(){this.restoreGraphicsState(),h="S",E=S}var O=d.__private__.combineFontStyleAndFontWeight=function(q,ce){if(q=="bold"&&ce=="normal"||q=="bold"&&ce==400||q=="normal"&&ce=="italic"||q=="bold"&&ce=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return ce&&(q=ce==400||ce==="normal"?q==="italic"?"italic":"normal":ce!=700&&ce!=="bold"||q!=="normal"?(ce==700?"bold":ce)+""+q:"bold"),q};d.advancedAPI=function(q){var ce=E===S;return ce&&A.call(this),typeof q!="function"||(q(this),ce&&R.call(this)),this},d.compatAPI=function(q){var ce=E===k;return ce&&R.call(this),typeof q!="function"||(q(this),ce&&A.call(this)),this},d.isAdvancedAPI=function(){return E===k};var I,j=function(q){if(E!==k)throw new Error(q+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},D=d.roundToPrecision=d.__private__.roundToPrecision=function(q,ce){var Oe=t||ce;if(isNaN(q)||isNaN(Oe))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return q.toFixed(Oe).replace(/0+$/,"")};I=d.hpf=d.__private__.hpf=typeof u=="number"?function(q){if(isNaN(q))throw new Error("Invalid argument passed to jsPDF.hpf");return D(q,u)}:u==="smart"?function(q){if(isNaN(q))throw new Error("Invalid argument passed to jsPDF.hpf");return D(q,q>-1&&q<1?16:5)}:function(q){if(isNaN(q))throw new Error("Invalid argument passed to jsPDF.hpf");return D(q,16)};var C=d.f2=d.__private__.f2=function(q){if(isNaN(q))throw new Error("Invalid argument passed to jsPDF.f2");return D(q,2)},N=d.__private__.f3=function(q){if(isNaN(q))throw new Error("Invalid argument passed to jsPDF.f3");return D(q,3)},$=d.scale=d.__private__.scale=function(q){if(isNaN(q))throw new Error("Invalid argument passed to jsPDF.scale");return E===S?q*ot:E===k?q:void 0},G=function(q){return $((function(ce){return E===S?_i()-ce:E===k?ce:void 0})(q))};d.__private__.setPrecision=d.setPrecision=function(q){typeof parseInt(q,10)=="number"&&(t=parseInt(q,10))};var te,se="00000000000000000000000000000000",ee=d.__private__.getFileId=function(){return se},Q=d.__private__.setFileId=function(q){return se=q!==void 0&&/^[a-fA-F0-9]{32}$/.test(q)?q.toUpperCase():se.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),c!==null&&(xi=new ed(c.userPermissions,c.userPassword,c.ownerPassword,se)),se};d.setFileId=function(q){return Q(q),this},d.getFileId=function(){return ee()};var re=d.__private__.convertDateToPDFDate=function(q){var ce=q.getTimezoneOffset(),Oe=ce<0?"+":"-",Ie=Math.floor(Math.abs(ce/60)),He=Math.abs(ce%60),ft=[Oe,Y(Ie),"'",Y(He),"'"].join("");return["D:",q.getFullYear(),Y(q.getMonth()+1),Y(q.getDate()),Y(q.getHours()),Y(q.getMinutes()),Y(q.getSeconds()),ft].join("")},X=d.__private__.convertPDFDateToDate=function(q){var ce=parseInt(q.substr(2,4),10),Oe=parseInt(q.substr(6,2),10)-1,Ie=parseInt(q.substr(8,2),10),He=parseInt(q.substr(10,2),10),ft=parseInt(q.substr(12,2),10),pt=parseInt(q.substr(14,2),10);return new Date(ce,Oe,Ie,He,ft,pt,0)},B=d.__private__.setCreationDate=function(q){var ce;if(q===void 0&&(q=new Date),q instanceof Date)ce=re(q);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(q))throw new Error("Invalid argument passed to jsPDF.setCreationDate");ce=q}return te=ce},F=d.__private__.getCreationDate=function(q){var ce=te;return q==="jsDate"&&(ce=X(te)),ce};d.setCreationDate=function(q){return B(q),this},d.getCreationDate=function(q){return F(q)};var z,Y=d.__private__.padd2=function(q){return("0"+parseInt(q)).slice(-2)},J=d.__private__.padd2Hex=function(q){return("00"+(q=q.toString())).substr(q.length)},K=0,ie=[],fe=[],ue=0,_e=[],Ce=[],$e=!1,ze=fe;d.__private__.setCustomOutputDestination=function(q){$e=!0,ze=q};var tt=function(q){$e||(ze=q)};d.__private__.resetCustomOutputDestination=function(){$e=!1,ze=fe};var pe=d.__private__.out=function(q){return q=q.toString(),ue+=q.length+1,ze.push(q),ze},ut=d.__private__.write=function(q){return pe(arguments.length===1?q.toString():Array.prototype.join.call(arguments," "))},be=d.__private__.getArrayBuffer=function(q){for(var ce=q.length,Oe=new ArrayBuffer(ce),Ie=new Uint8Array(Oe);ce--;)Ie[ce]=q.charCodeAt(ce);return Oe},ge=[["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 ge};var xe=e.fontSize||16;d.__private__.setFontSize=d.setFontSize=function(q){return xe=E===k?q/ot:q,this};var Te,Me=d.__private__.getFontSize=d.getFontSize=function(){return E===S?xe:xe*ot},ve=e.R2L||!1;d.__private__.setR2L=d.setR2L=function(q){return ve=q,this},d.__private__.getR2L=d.getR2L=function(){return ve};var ye,we=d.__private__.setZoomMode=function(q){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(q))Te=q;else if(isNaN(q)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(q)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+q+'" is not recognized.');Te=q}else Te=parseInt(q,10)};d.__private__.getZoomMode=function(){return Te};var je,Le=d.__private__.setPageMode=function(q){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(q)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+q+'" is not recognized.');ye=q};d.__private__.getPageMode=function(){return ye};var Ye=d.__private__.setLayoutMode=function(q){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(q)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+q+'" is not recognized.');je=q};d.__private__.getLayoutMode=function(){return je},d.__private__.setDisplayMode=d.setDisplayMode=function(q,ce,Oe){return we(q),Ye(ce),Le(Oe),this};var lt={title:"",subject:"",author:"",keywords:"",creator:""};d.__private__.getDocumentProperty=function(q){if(Object.keys(lt).indexOf(q)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return lt[q]},d.__private__.getDocumentProperties=function(){return lt},d.__private__.setDocumentProperties=d.setProperties=d.setDocumentProperties=function(q){for(var ce in lt)lt.hasOwnProperty(ce)&&q[ce]&&(lt[ce]=q[ce]);return this},d.__private__.setDocumentProperty=function(q,ce){if(Object.keys(lt).indexOf(q)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return lt[q]=ce};var rt,ot,dt,Ct,Zt,on={},an={},We=[],Be={},$t={},At={},Lt={},Tt=null,tn=0,Wt=[],hn=new Dw(d),bi=e.hotfixes||[],nr={},ei={},dr=[],Jt=function q(ce,Oe,Ie,He,ft,pt){if(!(this instanceof q))return new q(ce,Oe,Ie,He,ft,pt);isNaN(ce)&&(ce=1),isNaN(Oe)&&(Oe=0),isNaN(Ie)&&(Ie=0),isNaN(He)&&(He=1),isNaN(ft)&&(ft=0),isNaN(pt)&&(pt=0),this._matrix=[ce,Oe,Ie,He,ft,pt]};Object.defineProperty(Jt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(q){this._matrix[0]=q}}),Object.defineProperty(Jt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(q){this._matrix[1]=q}}),Object.defineProperty(Jt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(q){this._matrix[2]=q}}),Object.defineProperty(Jt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(q){this._matrix[3]=q}}),Object.defineProperty(Jt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(q){this._matrix[4]=q}}),Object.defineProperty(Jt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(q){this._matrix[5]=q}}),Object.defineProperty(Jt.prototype,"a",{get:function(){return this._matrix[0]},set:function(q){this._matrix[0]=q}}),Object.defineProperty(Jt.prototype,"b",{get:function(){return this._matrix[1]},set:function(q){this._matrix[1]=q}}),Object.defineProperty(Jt.prototype,"c",{get:function(){return this._matrix[2]},set:function(q){this._matrix[2]=q}}),Object.defineProperty(Jt.prototype,"d",{get:function(){return this._matrix[3]},set:function(q){this._matrix[3]=q}}),Object.defineProperty(Jt.prototype,"e",{get:function(){return this._matrix[4]},set:function(q){this._matrix[4]=q}}),Object.defineProperty(Jt.prototype,"f",{get:function(){return this._matrix[5]},set:function(q){this._matrix[5]=q}}),Object.defineProperty(Jt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Jt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Jt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Jt.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),Jt.prototype.join=function(q){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(I).join(q)},Jt.prototype.multiply=function(q){var ce=q.sx*this.sx+q.shy*this.shx,Oe=q.sx*this.shy+q.shy*this.sy,Ie=q.shx*this.sx+q.sy*this.shx,He=q.shx*this.shy+q.sy*this.sy,ft=q.tx*this.sx+q.ty*this.shx+this.tx,pt=q.tx*this.shy+q.ty*this.sy+this.ty;return new Jt(ce,Oe,Ie,He,ft,pt)},Jt.prototype.decompose=function(){var q=this.sx,ce=this.shy,Oe=this.shx,Ie=this.sy,He=this.tx,ft=this.ty,pt=Math.sqrt(q*q+ce*ce),Ft=(q/=pt)*Oe+(ce/=pt)*Ie;Oe-=q*Ft,Ie-=ce*Ft;var jt=Math.sqrt(Oe*Oe+Ie*Ie);return Ft/=jt,q*(Ie/=jt)<ce*(Oe/=jt)&&(q=-q,ce=-ce,Ft=-Ft,pt=-pt),{scale:new Jt(pt,0,0,jt,0,0),translate:new Jt(1,0,0,1,He,ft),rotate:new Jt(q,ce,-ce,q,0,0),skew:new Jt(1,0,Ft,1,0,0)}},Jt.prototype.toString=function(q){return this.join(" ")},Jt.prototype.inversed=function(){var q=this.sx,ce=this.shy,Oe=this.shx,Ie=this.sy,He=this.tx,ft=this.ty,pt=1/(q*Ie-ce*Oe),Ft=Ie*pt,jt=-ce*pt,mn=-Oe*pt,xn=q*pt;return new Jt(Ft,jt,mn,xn,-Ft*He-mn*ft,-jt*He-xn*ft)},Jt.prototype.applyToPoint=function(q){var ce=q.x*this.sx+q.y*this.shx+this.tx,Oe=q.x*this.shy+q.y*this.sy+this.ty;return new Ga(ce,Oe)},Jt.prototype.applyToRectangle=function(q){var ce=this.applyToPoint(q),Oe=this.applyToPoint(new Ga(q.x+q.w,q.y+q.h));return new gl(ce.x,ce.y,Oe.x-ce.x,Oe.y-ce.y)},Jt.prototype.clone=function(){var q=this.sx,ce=this.shy,Oe=this.shx,Ie=this.sy,He=this.tx,ft=this.ty;return new Jt(q,ce,Oe,Ie,He,ft)},d.Matrix=Jt;var ua=d.matrixMult=function(q,ce){return ce.multiply(q)},Fa=new Jt(1,0,0,1,0,0);d.unitMatrix=d.identityMatrix=Fa;var ti=function(q,ce){if(!$t[q]){var Oe=(ce instanceof th?"Sh":"P")+(Object.keys(Be).length+1).toString(10);ce.id=Oe,$t[q]=Oe,Be[Oe]=ce,hn.publish("addPattern",ce)}};d.ShadingPattern=th,d.TilingPattern=ld,d.addShadingPattern=function(q,ce){return j("addShadingPattern()"),ti(q,ce),this},d.beginTilingPattern=function(q){j("beginTilingPattern()"),ci(q.boundingBox[0],q.boundingBox[1],q.boundingBox[2]-q.boundingBox[0],q.boundingBox[3]-q.boundingBox[1],q.matrix)},d.endTilingPattern=function(q,ce){j("endTilingPattern()"),ce.stream=Ce[z].join(`
|
|
445
|
+
`),ti(q,ce),hn.publish("endTilingPattern",ce),dr.pop().restore()};var Ki,Hn=d.__private__.newObject=function(){var q=Or();return Dr(q,!0),q},Or=d.__private__.newObjectDeferred=function(){return K++,ie[K]=function(){return ue},K},Dr=function(q,ce){return ce=typeof ce=="boolean"&&ce,ie[q]=ue,ce&&pe(q+" 0 obj"),q},Ea=d.__private__.newAdditionalObject=function(){var q={objId:Or(),content:""};return _e.push(q),q},Go=Or(),ka=Or(),io=d.__private__.decodeColorString=function(q){var ce=q.split(" ");if(ce.length!==2||ce[1]!=="g"&&ce[1]!=="G")ce.length!==5||ce[4]!=="k"&&ce[4]!=="K"||(ce=[(1-ce[0])*(1-ce[3]),(1-ce[1])*(1-ce[3]),(1-ce[2])*(1-ce[3]),"r"]);else{var Oe=parseFloat(ce[0]);ce=[Oe,Oe,Oe,"r"]}for(var Ie="#",He=0;He<3;He++)Ie+=("0"+Math.floor(255*parseFloat(ce[He])).toString(16)).slice(-2);return Ie},ui=d.__private__.encodeColorString=function(q){var ce;typeof q=="string"&&(q={ch1:q});var Oe=q.ch1,Ie=q.ch2,He=q.ch3,ft=q.ch4,pt=q.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof Oe=="string"&&Oe.charAt(0)!=="#"){var Ft=new u_(Oe);if(Ft.ok)Oe=Ft.toHex();else if(!/^\d*\.?\d*$/.test(Oe))throw new Error('Invalid color "'+Oe+'" passed to jsPDF.encodeColorString.')}if(typeof Oe=="string"&&/^#[0-9A-Fa-f]{3}$/.test(Oe)&&(Oe="#"+Oe[1]+Oe[1]+Oe[2]+Oe[2]+Oe[3]+Oe[3]),typeof Oe=="string"&&/^#[0-9A-Fa-f]{6}$/.test(Oe)){var jt=parseInt(Oe.substr(1),16);Oe=jt>>16&255,Ie=jt>>8&255,He=255&jt}if(Ie===void 0||ft===void 0&&Oe===Ie&&Ie===He)ce=typeof Oe=="string"?Oe+" "+pt[0]:q.precision===2?C(Oe/255)+" "+pt[0]:N(Oe/255)+" "+pt[0];else if(ft===void 0||jr(ft)==="object"){if(ft&&!isNaN(ft.a)&&ft.a===0)return["1.","1.","1.",pt[1]].join(" ");ce=typeof Oe=="string"?[Oe,Ie,He,pt[1]].join(" "):q.precision===2?[C(Oe/255),C(Ie/255),C(He/255),pt[1]].join(" "):[N(Oe/255),N(Ie/255),N(He/255),pt[1]].join(" ")}else ce=typeof Oe=="string"?[Oe,Ie,He,ft,pt[2]].join(" "):q.precision===2?[C(Oe),C(Ie),C(He),C(ft),pt[2]].join(" "):[N(Oe),N(Ie),N(He),N(ft),pt[2]].join(" ");return ce},Aa=d.__private__.getFilters=function(){return o},Pa=d.__private__.putStream=function(q){var ce=(q=q||{}).data||"",Oe=q.filters||Aa(),Ie=q.alreadyAppliedFilters||[],He=q.addLength1||!1,ft=ce.length,pt=q.objectId,Ft=function(Si){return Si};if(c!==null&&pt===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");c!==null&&(Ft=xi.encryptor(pt,0));var jt={};Oe===!0&&(Oe=["FlateEncode"]);var mn=q.additionalKeyValues||[],xn=(jt=sn.API.processDataByFilters!==void 0?sn.API.processDataByFilters(ce,Oe):{data:ce,reverseChain:[]}).reverseChain+(Array.isArray(Ie)?Ie.join(" "):Ie.toString());if(jt.data.length!==0&&(mn.push({key:"Length",value:jt.data.length}),He===!0&&mn.push({key:"Length1",value:ft})),xn.length!=0)if(xn.split("/").length-1==1)mn.push({key:"Filter",value:xn});else{mn.push({key:"Filter",value:"["+xn+"]"});for(var Dn=0;Dn<mn.length;Dn+=1)if(mn[Dn].key==="DecodeParms"){for(var Lr=[],hi=0;hi<jt.reverseChain.split("/").length-1;hi+=1)Lr.push("null");Lr.push(mn[Dn].value),mn[Dn].value="["+Lr.join(" ")+"]"}}pe("<<");for(var lr=0;lr<mn.length;lr++)pe("/"+mn[lr].key+" "+mn[lr].value);pe(">>"),jt.data.length!==0&&(pe("stream"),pe(Ft(jt.data)),pe("endstream"))},Wo=d.__private__.putPage=function(q){var ce=q.number,Oe=q.data,Ie=q.objId,He=q.contentsObjId;Dr(Ie,!0),pe("<</Type /Page"),pe("/Parent "+q.rootDictionaryObjId+" 0 R"),pe("/Resources "+q.resourceDictionaryObjId+" 0 R"),pe("/MediaBox ["+parseFloat(I(q.mediaBox.bottomLeftX))+" "+parseFloat(I(q.mediaBox.bottomLeftY))+" "+I(q.mediaBox.topRightX)+" "+I(q.mediaBox.topRightY)+"]"),q.cropBox!==null&&pe("/CropBox ["+I(q.cropBox.bottomLeftX)+" "+I(q.cropBox.bottomLeftY)+" "+I(q.cropBox.topRightX)+" "+I(q.cropBox.topRightY)+"]"),q.bleedBox!==null&&pe("/BleedBox ["+I(q.bleedBox.bottomLeftX)+" "+I(q.bleedBox.bottomLeftY)+" "+I(q.bleedBox.topRightX)+" "+I(q.bleedBox.topRightY)+"]"),q.trimBox!==null&&pe("/TrimBox ["+I(q.trimBox.bottomLeftX)+" "+I(q.trimBox.bottomLeftY)+" "+I(q.trimBox.topRightX)+" "+I(q.trimBox.topRightY)+"]"),q.artBox!==null&&pe("/ArtBox ["+I(q.artBox.bottomLeftX)+" "+I(q.artBox.bottomLeftY)+" "+I(q.artBox.topRightX)+" "+I(q.artBox.topRightY)+"]"),typeof q.userUnit=="number"&&q.userUnit!==1&&pe("/UserUnit "+q.userUnit),hn.publish("putPage",{objId:Ie,pageContext:Wt[ce],pageNumber:ce,page:Oe}),pe("/Contents "+He+" 0 R"),pe(">>"),pe("endobj");var ft=Oe.join(`
|
|
446
|
+
`);return E===k&&(ft+=`
|
|
447
|
+
Q`),Dr(He,!0),Pa({data:ft,filters:Aa(),objectId:He}),pe("endobj"),Ie},zi=d.__private__.putPages=function(){var q,ce,Oe=[];for(q=1;q<=tn;q++)Wt[q].objId=Or(),Wt[q].contentsObjId=Or();for(q=1;q<=tn;q++)Oe.push(Wo({number:q,data:Ce[q],objId:Wt[q].objId,contentsObjId:Wt[q].contentsObjId,mediaBox:Wt[q].mediaBox,cropBox:Wt[q].cropBox,bleedBox:Wt[q].bleedBox,trimBox:Wt[q].trimBox,artBox:Wt[q].artBox,userUnit:Wt[q].userUnit,rootDictionaryObjId:Go,resourceDictionaryObjId:ka}));Dr(Go,!0),pe("<</Type /Pages");var Ie="/Kids [";for(ce=0;ce<tn;ce++)Ie+=Oe[ce]+" 0 R ";pe(Ie+"]"),pe("/Count "+tn),pe(">>"),pe("endobj"),hn.publish("postPutPages")},ao=function(q){hn.publish("putFont",{font:q,out:pe,newObject:Hn,putStream:Pa}),q.isAlreadyPutted!==!0&&(q.objectNumber=Hn(),pe("<<"),pe("/Type /Font"),pe("/BaseFont /"+td(q.postScriptName)),pe("/Subtype /Type1"),typeof q.encoding=="string"&&pe("/Encoding /"+q.encoding),pe("/FirstChar 32"),pe("/LastChar 255"),pe(">>"),pe("endobj"))},Fs=function(q){q.objectNumber=Hn();var ce=[];ce.push({key:"Type",value:"/XObject"}),ce.push({key:"Subtype",value:"/Form"}),ce.push({key:"BBox",value:"["+[I(q.x),I(q.y),I(q.x+q.width),I(q.y+q.height)].join(" ")+"]"}),ce.push({key:"Matrix",value:"["+q.matrix.toString()+"]"});var Oe=q.pages[1].join(`
|
|
448
|
+
`);Pa({data:Oe,additionalKeyValues:ce,objectId:q.objectNumber}),pe("endobj")},as=function(q,ce){ce||(ce=21);var Oe=Hn(),Ie=(function(pt,Ft){var jt,mn=[],xn=1/(Ft-1);for(jt=0;jt<1;jt+=xn)mn.push(jt);if(mn.push(1),pt[0].offset!=0){var Dn={offset:0,color:pt[0].color};pt.unshift(Dn)}if(pt[pt.length-1].offset!=1){var Lr={offset:1,color:pt[pt.length-1].color};pt.push(Lr)}for(var hi="",lr=0,Si=0;Si<mn.length;Si++){for(jt=mn[Si];jt>pt[lr+1].offset;)lr++;var kr=pt[lr].offset,Li=(jt-kr)/(pt[lr+1].offset-kr),Us=pt[lr].color,Ya=pt[lr+1].color;hi+=J(Math.round((1-Li)*Us[0]+Li*Ya[0]).toString(16))+J(Math.round((1-Li)*Us[1]+Li*Ya[1]).toString(16))+J(Math.round((1-Li)*Us[2]+Li*Ya[2]).toString(16))}return hi.trim()})(q.colors,ce),He=[];He.push({key:"FunctionType",value:"0"}),He.push({key:"Domain",value:"[0.0 1.0]"}),He.push({key:"Size",value:"["+ce+"]"}),He.push({key:"BitsPerSample",value:"8"}),He.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),He.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Pa({data:Ie,additionalKeyValues:He,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:Oe}),pe("endobj"),q.objectNumber=Hn(),pe("<< /ShadingType "+q.type),pe("/ColorSpace /DeviceRGB");var ft="/Coords ["+I(parseFloat(q.coords[0]))+" "+I(parseFloat(q.coords[1]))+" ";q.type===2?ft+=I(parseFloat(q.coords[2]))+" "+I(parseFloat(q.coords[3])):ft+=I(parseFloat(q.coords[2]))+" "+I(parseFloat(q.coords[3]))+" "+I(parseFloat(q.coords[4]))+" "+I(parseFloat(q.coords[5])),pe(ft+="]"),q.matrix&&pe("/Matrix ["+q.matrix.toString()+"]"),pe("/Function "+Oe+" 0 R"),pe("/Extend [true true]"),pe(">>"),pe("endobj")},fu=function(q,ce){var Oe=Or(),Ie=Hn();ce.push({resourcesOid:Oe,objectOid:Ie}),q.objectNumber=Ie;var He=[];He.push({key:"Type",value:"/Pattern"}),He.push({key:"PatternType",value:"1"}),He.push({key:"PaintType",value:"1"}),He.push({key:"TilingType",value:"1"}),He.push({key:"BBox",value:"["+q.boundingBox.map(I).join(" ")+"]"}),He.push({key:"XStep",value:I(q.xStep)}),He.push({key:"YStep",value:I(q.yStep)}),He.push({key:"Resources",value:Oe+" 0 R"}),q.matrix&&He.push({key:"Matrix",value:"["+q.matrix.toString()+"]"}),Pa({data:q.stream,additionalKeyValues:He,objectId:q.objectNumber}),pe("endobj")},If=function(q){for(var ce in q.objectNumber=Hn(),pe("<<"),q)switch(ce){case"opacity":pe("/ca "+C(q[ce]));break;case"stroke-opacity":pe("/CA "+C(q[ce]))}pe(">>"),pe("endobj")},Cr=function(q){Dr(q.resourcesOid,!0),pe("<<"),pe("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),(function(){for(var ce in pe("/Font <<"),on)on.hasOwnProperty(ce)&&(m===!1||m===!0&&g.hasOwnProperty(ce))&&pe("/"+ce+" "+on[ce].objectNumber+" 0 R");pe(">>")})(),(function(){if(Object.keys(Be).length>0){for(var ce in pe("/Shading <<"),Be)Be.hasOwnProperty(ce)&&Be[ce]instanceof th&&Be[ce].objectNumber>=0&&pe("/"+ce+" "+Be[ce].objectNumber+" 0 R");hn.publish("putShadingPatternDict"),pe(">>")}})(),(function(ce){if(Object.keys(Be).length>0){for(var Oe in pe("/Pattern <<"),Be)Be.hasOwnProperty(Oe)&&Be[Oe]instanceof d.TilingPattern&&Be[Oe].objectNumber>=0&&Be[Oe].objectNumber<ce&&pe("/"+Oe+" "+Be[Oe].objectNumber+" 0 R");hn.publish("putTilingPatternDict"),pe(">>")}})(q.objectOid),(function(){if(Object.keys(At).length>0){var ce;for(ce in pe("/ExtGState <<"),At)At.hasOwnProperty(ce)&&At[ce].objectNumber>=0&&pe("/"+ce+" "+At[ce].objectNumber+" 0 R");hn.publish("putGStateDict"),pe(">>")}})(),(function(){for(var ce in pe("/XObject <<"),nr)nr.hasOwnProperty(ce)&&nr[ce].objectNumber>=0&&pe("/"+ce+" "+nr[ce].objectNumber+" 0 R");hn.publish("putXobjectDict"),pe(">>")})(),pe(">>"),pe("endobj")},hu=function(q){an[q.fontName]=an[q.fontName]||{},an[q.fontName][q.fontStyle]=q.id},os=function(q,ce,Oe,Ie,He){var ft={id:"F"+(Object.keys(on).length+1).toString(10),postScriptName:q,fontName:ce,fontStyle:Oe,encoding:Ie,isStandardFont:He||!1,metadata:{}};return hn.publish("addFont",{font:ft,instance:this}),on[ft.id]=ft,hu(ft),ft.id},Oa=d.__private__.pdfEscape=d.pdfEscape=function(q,ce){return(function(Oe,Ie){var He,ft,pt,Ft,jt,mn,xn,Dn,Lr;if(pt=(Ie=Ie||{}).sourceEncoding||"Unicode",jt=Ie.outputEncoding,(Ie.autoencode||jt)&&on[rt].metadata&&on[rt].metadata[pt]&&on[rt].metadata[pt].encoding&&(Ft=on[rt].metadata[pt].encoding,!jt&&on[rt].encoding&&(jt=on[rt].encoding),!jt&&Ft.codePages&&(jt=Ft.codePages[0]),typeof jt=="string"&&(jt=Ft[jt]),jt)){for(xn=!1,mn=[],He=0,ft=Oe.length;He<ft;He++)(Dn=jt[Oe.charCodeAt(He)])?mn.push(String.fromCharCode(Dn)):mn.push(Oe[He]),mn[He].charCodeAt(0)>>8&&(xn=!0);Oe=mn.join("")}for(He=Oe.length;xn===void 0&&He!==0;)Oe.charCodeAt(He-1)>>8&&(xn=!0),He--;if(!xn)return Oe;for(mn=Ie.noBOM?[]:[254,255],He=0,ft=Oe.length;He<ft;He++){if((Lr=(Dn=Oe.charCodeAt(He))>>8)>>8)throw new Error("Character at position "+He+" of string '"+Oe+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");mn.push(Lr),mn.push(Dn-(Lr<<8))}return String.fromCharCode.apply(void 0,mn)})(q,ce).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},ss=d.__private__.beginPage=function(q){Ce[++tn]=[],Wt[tn]={objId:0,contentsObjId:0,userUnit:Number(s),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(q[0]),topRightY:Number(q[1])}},Po(tn),tt(Ce[z])},Cc=function(q,ce){var Oe,Ie,He;switch(n=ce||n,typeof q=="string"&&(Oe=b(q.toLowerCase()),Array.isArray(Oe)&&(Ie=Oe[0],He=Oe[1])),Array.isArray(q)&&(Ie=q[0]*ot,He=q[1]*ot),isNaN(Ie)&&(Ie=i[0],He=i[1]),(Ie>14400||He>14400)&&(Zr.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),He=Math.min(14400,He)),i=[Ie,He],n.substr(0,1)){case"l":He>Ie&&(i=[He,Ie]);break;case"p":Ie>He&&(i=[He,Ie])}ss(i),cn(qa),pe(Bs),La!==0&&pe(La+" J"),co!==0&&pe(co+" j"),hn.publish("addPage",{pageNumber:tn})},hl=function(q){q>0&&q<=tn&&(Ce.splice(q,1),Wt.splice(q,1),tn--,z>tn&&(z=tn),this.setPage(z))},Po=function(q){q>0&&q<=tn&&(z=q)},wi=d.__private__.getNumberOfPages=d.getNumberOfPages=function(){return Ce.length-1},pr=function(q,ce,Oe){var Ie,He=void 0;return Oe=Oe||{},q=q!==void 0?q:on[rt].fontName,ce=ce!==void 0?ce:on[rt].fontStyle,Ie=q.toLowerCase(),an[Ie]!==void 0&&an[Ie][ce]!==void 0?He=an[Ie][ce]:an[q]!==void 0&&an[q][ce]!==void 0?He=an[q][ce]:Oe.disableWarning===!1&&Zr.warn("Unable to look up font label for font '"+q+"', '"+ce+"'. Refer to getFontList() for available fonts."),He||Oe.noFallback||(He=an.times[ce])==null&&(He=an.times.normal),He},wn=d.__private__.putInfo=function(){var q=Hn(),ce=function(Ie){return Ie};for(var Oe in c!==null&&(ce=xi.encryptor(q,0)),pe("<<"),pe("/Producer ("+Oa(ce("jsPDF "+sn.version))+")"),lt)lt.hasOwnProperty(Oe)&<[Oe]&&pe("/"+Oe.substr(0,1).toUpperCase()+Oe.substr(1)+" ("+Oa(ce(lt[Oe]))+")");pe("/CreationDate ("+Oa(ce(te))+")"),pe(">>"),pe("endobj")},oo=d.__private__.putCatalog=function(q){var ce=(q=q||{}).rootDictionaryObjId||Go;switch(Hn(),pe("<<"),pe("/Type /Catalog"),pe("/Pages "+ce+" 0 R"),Te||(Te="fullwidth"),Te){case"fullwidth":pe("/OpenAction [3 0 R /FitH null]");break;case"fullheight":pe("/OpenAction [3 0 R /FitV null]");break;case"fullpage":pe("/OpenAction [3 0 R /Fit]");break;case"original":pe("/OpenAction [3 0 R /XYZ null null 1]");break;default:var Oe=""+Te;Oe.substr(Oe.length-1)==="%"&&(Te=parseInt(Te)/100),typeof Te=="number"&&pe("/OpenAction [3 0 R /XYZ null null "+C(Te)+"]")}switch(je||(je="continuous"),je){case"continuous":pe("/PageLayout /OneColumn");break;case"single":pe("/PageLayout /SinglePage");break;case"two":case"twoleft":pe("/PageLayout /TwoColumnLeft");break;case"tworight":pe("/PageLayout /TwoColumnRight")}ye&&pe("/PageMode /"+ye),hn.publish("putCatalog"),pe(">>"),pe("endobj")},Ui=d.__private__.putTrailer=function(){pe("trailer"),pe("<<"),pe("/Size "+(K+1)),pe("/Root "+K+" 0 R"),pe("/Info "+(K-1)+" 0 R"),c!==null&&pe("/Encrypt "+xi.oid+" 0 R"),pe("/ID [ <"+se+"> <"+se+"> ]"),pe(">>")},Gn=d.__private__.putHeader=function(){pe("%PDF-"+y),pe("%ºß¬à")},so=d.__private__.putXRef=function(){var q="0000000000";pe("xref"),pe("0 "+(K+1)),pe("0000000000 65535 f ");for(var ce=1;ce<=K;ce++)typeof ie[ce]=="function"?pe((q+ie[ce]()).slice(-10)+" 00000 n "):ie[ce]!==void 0?pe((q+ie[ce]).slice(-10)+" 00000 n "):pe("0000000000 00000 n ")},qi=d.__private__.buildDocument=function(){var q;K=0,ue=0,fe=[],ie=[],_e=[],Go=Or(),ka=Or(),tt(fe),hn.publish("buildDocument"),Gn(),zi(),(function(){hn.publish("putAdditionalObjects");for(var Oe=0;Oe<_e.length;Oe++){var Ie=_e[Oe];Dr(Ie.objId,!0),pe(Ie.content),pe("endobj")}hn.publish("postPutAdditionalObjects")})(),q=[],(function(){for(var Oe in on)on.hasOwnProperty(Oe)&&(m===!1||m===!0&&g.hasOwnProperty(Oe))&&ao(on[Oe])})(),(function(){var Oe;for(Oe in At)At.hasOwnProperty(Oe)&&If(At[Oe])})(),(function(){for(var Oe in nr)nr.hasOwnProperty(Oe)&&Fs(nr[Oe])})(),(function(Oe){var Ie;for(Ie in Be)Be.hasOwnProperty(Ie)&&(Be[Ie]instanceof th?as(Be[Ie]):Be[Ie]instanceof ld&&fu(Be[Ie],Oe))})(q),hn.publish("putResources"),q.forEach(Cr),Cr({resourcesOid:ka,objectOid:Number.MAX_SAFE_INTEGER}),hn.publish("postPutResources"),c!==null&&(xi.oid=Hn(),pe("<<"),pe("/Filter /Standard"),pe("/V "+xi.v),pe("/R "+xi.r),pe("/U <"+xi.toHexString(xi.U)+">"),pe("/O <"+xi.toHexString(xi.O)+">"),pe("/P "+xi.P),pe(">>"),pe("endobj")),wn(),oo();var ce=ue;return so(),Ui(),pe("startxref"),pe(""+ce),pe("%%EOF"),tt(Ce[z]),fe.join(`
|
|
449
|
+
`)},qr=d.__private__.getBlob=function(q){return new Blob([be(q)],{type:"application/pdf"})},ls=d.output=d.__private__.output=(Ki=function(q,ce){switch(typeof(ce=ce||{})=="string"?ce={filename:ce}:ce.filename=ce.filename||"generated.pdf",q){case void 0:return qi();case"save":d.save(ce.filename);break;case"arraybuffer":return be(qi());case"blob":return qr(qi());case"bloburi":case"bloburl":if(En.URL!==void 0&&typeof En.URL.createObjectURL=="function")return En.URL&&En.URL.createObjectURL(qr(qi()))||void 0;Zr.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var Oe="",Ie=qi();try{Oe=Mw(Ie)}catch{Oe=Mw(unescape(encodeURIComponent(Ie)))}return"data:application/pdf;filename="+ce.filename+";base64,"+Oe;case"pdfobjectnewwindow":if(Object.prototype.toString.call(En)==="[object Window]"){var He="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"';ce.pdfObjectUrl&&(He=ce.pdfObjectUrl,ft="");var pt='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+He+'"'+ft+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(ce)+");<\/script></body></html>",Ft=En.open();return Ft!==null&&Ft.document.write(pt),Ft}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(En)==="[object Window]"){var jt='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(ce.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+ce.filename+'" width="500px" height="400px" /></body></html>',mn=En.open();if(mn!==null){mn.document.write(jt);var xn=this;mn.document.documentElement.querySelector("#pdfViewer").onload=function(){mn.document.title=ce.filename,mn.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(xn.output("bloburl"))}}return mn}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(En)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var Dn='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",ce)+'"></iframe></body></html>',Lr=En.open();if(Lr!==null&&(Lr.document.write(Dn),Lr.document.title=ce.filename),Lr||typeof safari>"u")return Lr;break;case"datauri":case"dataurl":return En.document.location.href=this.output("datauristring",ce);default:return null}},Ki.foo=function(){try{return Ki.apply(this,arguments)}catch(Oe){var q=Oe.stack||"";~q.indexOf(" at ")&&(q=q.split(" at ")[1]);var ce="Error in function "+q.split(`
|
|
450
|
+
`)[0].split("<")[0]+": "+Oe.message;if(!En.console)throw new Error(ce);En.console.error(ce,Oe),En.alert&&alert(ce)}},Ki.foo.bar=Ki,Ki.foo),lo=function(q){return Array.isArray(bi)===!0&&bi.indexOf(q)>-1};switch(r){case"pt":ot=1;break;case"mm":ot=72/25.4;break;case"cm":ot=72/2.54;break;case"in":ot=72;break;case"px":ot=lo("px_scaling")==1?.75:96/72;break;case"pc":case"em":ot=12;break;case"ex":ot=6;break;default:if(typeof r!="number")throw new Error("Invalid unit: "+r);ot=r}var xi=null;B(),Q();var Ba=d.__private__.getPageInfo=d.getPageInfo=function(q){if(isNaN(q)||q%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Wt[q].objId,pageNumber:q,pageContext:Wt[q]}},du=d.__private__.getPageInfoByObjId=function(q){if(isNaN(q)||q%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var ce in Wt)if(Wt[ce].objId===q)break;return Ba(ce)},Ca=d.__private__.getCurrentPageInfo=d.getCurrentPageInfo=function(){return{objId:Wt[z].objId,pageNumber:z,pageContext:Wt[z]}};d.addPage=function(){return Cc.apply(this,arguments),this},d.setPage=function(){return Po.apply(this,arguments),tt.call(this,Ce[z]),this},d.insertPage=function(q){return this.addPage(),this.movePage(z,q),this},d.movePage=function(q,ce){var Oe,Ie;if(q>ce){Oe=Ce[q],Ie=Wt[q];for(var He=q;He>ce;He--)Ce[He]=Ce[He-1],Wt[He]=Wt[He-1];Ce[ce]=Oe,Wt[ce]=Ie,this.setPage(ce)}else if(q<ce){Oe=Ce[q],Ie=Wt[q];for(var ft=q;ft<ce;ft++)Ce[ft]=Ce[ft+1],Wt[ft]=Wt[ft+1];Ce[ce]=Oe,Wt[ce]=Ie,this.setPage(ce)}return this},d.deletePage=function(){return hl.apply(this,arguments),this},d.__private__.text=d.text=function(q,ce,Oe,Ie,He){var ft,pt,Ft,jt,mn,xn,Dn,Lr,hi,lr=(Ie=Ie||{}).scope||this;if(typeof q=="number"&&typeof ce=="number"&&(typeof Oe=="string"||Array.isArray(Oe))){var Si=Oe;Oe=ce,ce=q,q=Si}if(arguments[3]instanceof Jt==0?(Ft=arguments[4],jt=arguments[5],jr(Dn=arguments[3])==="object"&&Dn!==null||(typeof Ft=="string"&&(jt=Ft,Ft=null),typeof Dn=="string"&&(jt=Dn,Dn=null),typeof Dn=="number"&&(Ft=Dn,Dn=null),Ie={flags:Dn,angle:Ft,align:jt})):(j("The transform parameter of text() with a Matrix value"),hi=He),isNaN(ce)||isNaN(Oe)||q==null)throw new Error("Invalid arguments passed to jsPDF.text");if(q.length===0)return lr;var kr,Li="",Us=typeof Ie.lineHeightFactor=="number"?Ie.lineHeightFactor:Ua,Ya=lr.internal.scaleFactor;function qs(Rn){return Rn=Rn.split(" ").join(Array(Ie.TabLen||9).join(" ")),Oa(Rn,Dn)}function Vo(Rn){for(var fn,Pn=Rn.concat(),Mn=[],Za=Pn.length;Za--;)typeof(fn=Pn.shift())=="string"?Mn.push(fn):Array.isArray(Rn)&&(fn.length===1||fn[1]===void 0&&fn[2]===void 0)?Mn.push(fn[0]):Mn.push([fn[0],fn[1],fn[2]]);return Mn}function $s(Rn,fn){var Pn;if(typeof Rn=="string")Pn=fn(Rn)[0];else if(Array.isArray(Rn)){for(var Mn,Za,Ys=Rn.concat(),ys=[],Xs=Ys.length;Xs--;)typeof(Mn=Ys.shift())=="string"?ys.push(fn(Mn)[0]):Array.isArray(Mn)&&typeof Mn[0]=="string"&&(Za=fn(Mn[0],Mn[1],Mn[2]),ys.push([Za[0],Za[1],Za[2]]));Pn=ys}return Pn}var Hs=!1,vl=!0;if(typeof q=="string")Hs=!0;else if(Array.isArray(q)){var ho=q.concat();pt=[];for(var Gs,Ei=ho.length;Ei--;)(typeof(Gs=ho.shift())!="string"||Array.isArray(Gs)&&typeof Gs[0]!="string")&&(vl=!1);Hs=vl}if(Hs===!1)throw new Error('Type of text must be string or Array. "'+q+'" is not recognized.');typeof q=="string"&&(q=q.match(/[\r?\n]/)?q.split(/\r\n|\r|\n/g):[q]);var hs=xe/lr.internal.scaleFactor,Lo=hs*(Us-1);switch(Ie.baseline){case"bottom":Oe-=Lo;break;case"top":Oe+=hs-Lo;break;case"hanging":Oe+=hs-2*Lo;break;case"middle":Oe+=hs/2-Lo}if((xn=Ie.maxWidth||0)>0&&(typeof q=="string"?q=lr.splitTextToSize(q,xn):Object.prototype.toString.call(q)==="[object Array]"&&(q=q.reduce(function(Rn,fn){return Rn.concat(lr.splitTextToSize(fn,xn))},[]))),ft={text:q,x:ce,y:Oe,options:Ie,mutex:{pdfEscape:Oa,activeFontKey:rt,fonts:on,activeFontSize:xe}},hn.publish("preProcessText",ft),q=ft.text,Ft=(Ie=ft.options).angle,hi instanceof Jt==0&&Ft&&typeof Ft=="number"){Ft*=Math.PI/180,Ie.rotationDirection===0&&(Ft=-Ft),E===k&&(Ft=-Ft);var jl=Math.cos(Ft),Dl=Math.sin(Ft);hi=new Jt(jl,Dl,-Dl,jl,0,0)}else Ft&&Ft instanceof Jt&&(hi=Ft);E!==k||hi||(hi=Fa),(mn=Ie.charSpace||Ha)!==void 0&&(Li+=I($(mn))+` Tc
|
|
451
|
+
`,this.setCharSpace(this.getCharSpace()||0)),(Lr=Ie.horizontalScale)!==void 0&&(Li+=I(100*Lr)+` Tz
|
|
452
|
+
`),Ie.lang;var ha=-1,po=Ie.renderingMode!==void 0?Ie.renderingMode:Ie.stroke,No=lr.internal.getCurrentPageInfo().pageContext;switch(po){case 0:case!1:case"fill":ha=0;break;case 1:case!0:case"stroke":ha=1;break;case 2:case"fillThenStroke":ha=2;break;case 3:case"invisible":ha=3;break;case 4:case"fillAndAddForClipping":ha=4;break;case 5:case"strokeAndAddPathForClipping":ha=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":ha=6;break;case 7:case"addToPathForClipping":ha=7}var Ws=No.usedRenderingMode!==void 0?No.usedRenderingMode:-1;ha!==-1?Li+=ha+` Tr
|
|
453
|
+
`:Ws!==-1&&(Li+=`0 Tr
|
|
454
|
+
`),ha!==-1&&(No.usedRenderingMode=ha),jt=Ie.align||"left";var Fr,Xa=xe*Us,yl=lr.internal.pageSize.getWidth(),Fl=on[rt];mn=Ie.charSpace||Ha,xn=Ie.maxWidth||0,Dn=Object.assign({autoencode:!0,noBOM:!0},Ie.flags);var $i=[],Ni=function(Rn){return lr.getStringUnitWidth(Rn,{font:Fl,charSpace:mn,fontSize:xe,doKerning:!1})*xe/Ya};if(Object.prototype.toString.call(q)==="[object Array]"){var Na;pt=Vo(q),jt!=="left"&&(Fr=pt.map(Ni));var Ka,da=0;if(jt==="right"){ce-=Fr[0],q=[],Ei=pt.length;for(var Zi=0;Zi<Ei;Zi++)Zi===0?(Ka=uo(ce),Na=Er(Oe)):(Ka=$(da-Fr[Zi]),Na=-Xa),q.push([pt[Zi],Ka,Na]),da=Fr[Zi]}else if(jt==="center"){ce-=Fr[0]/2,q=[],Ei=pt.length;for(var To=0;To<Ei;To++)To===0?(Ka=uo(ce),Na=Er(Oe)):(Ka=$((da-Fr[To])/2),Na=-Xa),q.push([pt[To],Ka,Na]),da=Fr[To]}else if(jt==="left"){q=[],Ei=pt.length;for(var ds=0;ds<Ei;ds++)q.push(pt[ds])}else if(jt==="justify"&&Fl.encoding==="Identity-H"){q=[],Ei=pt.length,xn=xn!==0?xn:yl;for(var go=0,ri=0;ri<Ei;ri++)if(Na=ri===0?Er(Oe):-Xa,Ka=ri===0?uo(ce):go,ri<Ei-1){var Yo=$((xn-Fr[ri])/(pt[ri].split(" ").length-1)),di=pt[ri].split(" ");q.push([di[0]+" ",Ka,Na]),go=0;for(var Ta=1;Ta<di.length;Ta++){var Ro=(Ni(di[Ta-1]+" "+di[Ta])-Ni(di[Ta]))*Ya+Yo;Ta==di.length-1?q.push([di[Ta],Ro,0]):q.push([di[Ta]+" ",Ro,0]),go-=Ro}}else q.push([pt[ri],Ka,Na]);q.push(["",go,0])}else{if(jt!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(q=[],Ei=pt.length,xn=xn!==0?xn:yl,ri=0;ri<Ei;ri++){Na=ri===0?Er(Oe):-Xa,Ka=ri===0?uo(ce):0;var pa=pt[ri].split(" ").length-1,bl=pa>0?(xn-Fr[ri])/pa:0;ri<Ei-1?$i.push(I($(bl))):$i.push(0),q.push([pt[ri],Ka,Na])}}}(typeof Ie.R2L=="boolean"?Ie.R2L:ve)===!0&&(q=$s(q,function(Rn,fn,Pn){return[Rn.split("").reverse().join(""),fn,Pn]})),ft={text:q,x:ce,y:Oe,options:Ie,mutex:{pdfEscape:Oa,activeFontKey:rt,fonts:on,activeFontSize:xe}},hn.publish("postProcessText",ft),q=ft.text,kr=ft.mutex.isHex||!1;var Xo=on[rt].encoding;Xo!=="WinAnsiEncoding"&&Xo!=="StandardEncoding"||(q=$s(q,function(Rn,fn,Pn){return[qs(Rn),fn,Pn]})),pt=Vo(q),q=[];for(var ps,gs,rr,ms=Array.isArray(pt[0])?1:0,vs="",Vs=function(Rn,fn,Pn){var Mn="";return Pn instanceof Jt?(Pn=typeof Ie.angle=="number"?ua(Pn,new Jt(1,0,0,1,Rn,fn)):ua(new Jt(1,0,0,1,Rn,fn),Pn),E===k&&(Pn=ua(new Jt(1,0,0,-1,0,0),Pn)),Mn=Pn.join(" ")+` Tm
|
|
455
|
+
`):Mn=I(Rn)+" "+I(fn)+` Td
|
|
456
|
+
`,Mn},Nr=0;Nr<pt.length;Nr++){switch(vs="",ms){case 1:rr=(kr?"<":"(")+pt[Nr][0]+(kr?">":")"),ps=parseFloat(pt[Nr][1]),gs=parseFloat(pt[Nr][2]);break;case 0:rr=(kr?"<":"(")+pt[Nr]+(kr?">":")"),ps=uo(ce),gs=Er(Oe)}$i!==void 0&&$i[Nr]!==void 0&&(vs=$i[Nr]+` Tw
|
|
457
|
+
`),Nr===0?q.push(vs+Vs(ps,gs,hi)+rr):ms===0?q.push(vs+rr):ms===1&&q.push(vs+Vs(ps,gs,hi)+rr)}q=ms===0?q.join(` Tj
|
|
458
|
+
T* `):q.join(` Tj
|
|
459
|
+
`),q+=` Tj
|
|
460
|
+
`;var ga=`BT
|
|
461
|
+
/`;return ga+=rt+" "+xe+` Tf
|
|
462
|
+
`,ga+=I(xe*Us)+` TL
|
|
463
|
+
`,ga+=$a+`
|
|
464
|
+
`,ga+=Li,ga+=q,pe(ga+="ET"),g[rt]=!0,lr};var Rl=d.__private__.clip=d.clip=function(q){return pe(q==="evenodd"?"W*":"W"),this};d.clipEvenOdd=function(){return Rl("evenodd")},d.__private__.discardPath=d.discardPath=function(){return pe("n"),this};var us=d.__private__.isValidStyle=function(q){var ce=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(q)!==-1&&(ce=!0),ce};d.__private__.setDefaultPathOperation=d.setDefaultPathOperation=function(q){return us(q)&&(h=q),this};var pu=d.__private__.getStyle=d.getStyle=function(q){var ce=h;switch(q){case"D":case"S":ce="S";break;case"F":ce="f";break;case"FD":case"DF":ce="B";break;case"f":case"f*":case"B":case"B*":ce=q}return ce},jn=d.close=function(){return pe("h"),this};d.stroke=function(){return pe("S"),this},d.fill=function(q){return cs("f",q),this},d.fillEvenOdd=function(q){return cs("f*",q),this},d.fillStroke=function(q){return cs("B",q),this},d.fillStrokeEvenOdd=function(q){return cs("B*",q),this};var cs=function(q,ce){jr(ce)==="object"?Lc(ce,q):pe(q)},Oo=function(q){q===null||E===k&&q===void 0||(q=pu(q),pe(q))};function dl(q,ce,Oe,Ie,He){var ft=new ld(ce||this.boundingBox,Oe||this.xStep,Ie||this.yStep,this.gState,He||this.matrix);ft.stream=this.stream;var pt=q+"$$"+this.cloneIndex+++"$$";return ti(pt,ft),ft}var Lc=function(q,ce){var Oe=$t[q.key],Ie=Be[Oe];if(Ie instanceof th)pe("q"),pe(Nc(ce)),Ie.gState&&d.setGState(Ie.gState),pe(q.matrix.toString()+" cm"),pe("/"+Oe+" sh"),pe("Q");else if(Ie instanceof ld){var He=new Jt(1,0,0,-1,0,_i());q.matrix&&(He=He.multiply(q.matrix||Fa),Oe=dl.call(Ie,q.key,q.boundingBox,q.xStep,q.yStep,He).id),pe("q"),pe("/Pattern cs"),pe("/"+Oe+" scn"),Ie.gState&&d.setGState(Ie.gState),pe(ce),pe("Q")}},Nc=function(q){switch(q){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},pl=d.moveTo=function(q,ce){return pe(I($(q))+" "+I(G(ce))+" m"),this},Ml=d.lineTo=function(q,ce){return pe(I($(q))+" "+I(G(ce))+" l"),this},ca=d.curveTo=function(q,ce,Oe,Ie,He,ft){return pe([I($(q)),I(G(ce)),I($(Oe)),I(G(Ie)),I($(He)),I(G(ft)),"c"].join(" ")),this};d.__private__.line=d.line=function(q,ce,Oe,Ie,He){if(isNaN(q)||isNaN(ce)||isNaN(Oe)||isNaN(Ie)||!us(He))throw new Error("Invalid arguments passed to jsPDF.line");return E===S?this.lines([[Oe-q,Ie-ce]],q,ce,[1,1],He||"S"):this.lines([[Oe-q,Ie-ce]],q,ce,[1,1]).stroke()},d.__private__.lines=d.lines=function(q,ce,Oe,Ie,He,ft){var pt,Ft,jt,mn,xn,Dn,Lr,hi,lr,Si,kr,Li;if(typeof q=="number"&&(Li=Oe,Oe=ce,ce=q,q=Li),Ie=Ie||[1,1],ft=ft||!1,isNaN(ce)||isNaN(Oe)||!Array.isArray(q)||!Array.isArray(Ie)||!us(He)||typeof ft!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(pl(ce,Oe),pt=Ie[0],Ft=Ie[1],mn=q.length,Si=ce,kr=Oe,jt=0;jt<mn;jt++)(xn=q[jt]).length===2?(Si=xn[0]*pt+Si,kr=xn[1]*Ft+kr,Ml(Si,kr)):(Dn=xn[0]*pt+Si,Lr=xn[1]*Ft+kr,hi=xn[2]*pt+Si,lr=xn[3]*Ft+kr,Si=xn[4]*pt+Si,kr=xn[5]*Ft+kr,ca(Dn,Lr,hi,lr,Si,kr));return ft&&jn(),Oo(He),this},d.path=function(q){for(var ce=0;ce<q.length;ce++){var Oe=q[ce],Ie=Oe.c;switch(Oe.op){case"m":pl(Ie[0],Ie[1]);break;case"l":Ml(Ie[0],Ie[1]);break;case"c":ca.apply(this,Ie);break;case"h":jn()}}return this},d.__private__.rect=d.rect=function(q,ce,Oe,Ie,He){if(isNaN(q)||isNaN(ce)||isNaN(Oe)||isNaN(Ie)||!us(He))throw new Error("Invalid arguments passed to jsPDF.rect");return E===S&&(Ie=-Ie),pe([I($(q)),I(G(ce)),I($(Oe)),I($(Ie)),"re"].join(" ")),Oo(He),this},d.__private__.triangle=d.triangle=function(q,ce,Oe,Ie,He,ft,pt){if(isNaN(q)||isNaN(ce)||isNaN(Oe)||isNaN(Ie)||isNaN(He)||isNaN(ft)||!us(pt))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[Oe-q,Ie-ce],[He-Oe,ft-Ie],[q-He,ce-ft]],q,ce,[1,1],pt,!0),this},d.__private__.roundedRect=d.roundedRect=function(q,ce,Oe,Ie,He,ft,pt){if(isNaN(q)||isNaN(ce)||isNaN(Oe)||isNaN(Ie)||isNaN(He)||isNaN(ft)||!us(pt))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var Ft=4/3*(Math.SQRT2-1);return He=Math.min(He,.5*Oe),ft=Math.min(ft,.5*Ie),this.lines([[Oe-2*He,0],[He*Ft,0,He,ft-ft*Ft,He,ft],[0,Ie-2*ft],[0,ft*Ft,-He*Ft,ft,-He,ft],[2*He-Oe,0],[-He*Ft,0,-He,-ft*Ft,-He,-ft],[0,2*ft-Ie],[0,-ft*Ft,He*Ft,-ft,He,-ft]],q+He,ce,[1,1],pt,!0),this},d.__private__.ellipse=d.ellipse=function(q,ce,Oe,Ie,He){if(isNaN(q)||isNaN(ce)||isNaN(Oe)||isNaN(Ie)||!us(He))throw new Error("Invalid arguments passed to jsPDF.ellipse");var ft=4/3*(Math.SQRT2-1)*Oe,pt=4/3*(Math.SQRT2-1)*Ie;return pl(q+Oe,ce),ca(q+Oe,ce-pt,q+ft,ce-Ie,q,ce-Ie),ca(q-ft,ce-Ie,q-Oe,ce-pt,q-Oe,ce),ca(q-Oe,ce+pt,q-ft,ce+Ie,q,ce+Ie),ca(q+ft,ce+Ie,q+Oe,ce+pt,q+Oe,ce),Oo(He),this},d.__private__.circle=d.circle=function(q,ce,Oe,Ie){if(isNaN(q)||isNaN(ce)||isNaN(Oe)||!us(Ie))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(q,ce,Oe,Oe,Ie)},d.setFont=function(q,ce,Oe){return Oe&&(ce=O(ce,Oe)),rt=pr(q,ce,{disableWarning:!1}),this};var za=d.__private__.getFont=d.getFont=function(){return on[pr.apply(d,arguments)]};d.__private__.getFontList=d.getFontList=function(){var q,ce,Oe={};for(q in an)if(an.hasOwnProperty(q))for(ce in Oe[q]=[],an[q])an[q].hasOwnProperty(ce)&&Oe[q].push(ce);return Oe},d.addFont=function(q,ce,Oe,Ie,He){var ft=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&ft.indexOf(arguments[3])!==-1?He=arguments[3]:arguments[3]&&ft.indexOf(arguments[3])==-1&&(Oe=O(Oe,Ie)),os.call(this,q,ce,Oe,He=He||"Identity-H")};var Ua,qa=e.lineWidth||.200025,Ln=d.__private__.getLineWidth=d.getLineWidth=function(){return qa},cn=d.__private__.setLineWidth=d.setLineWidth=function(q){return qa=q,pe(I($(q))+" w"),this};d.__private__.setLineDash=sn.API.setLineDash=sn.API.setLineDashPattern=function(q,ce){if(q=q||[],ce=ce||0,isNaN(ce)||!Array.isArray(q))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return q=q.map(function(Oe){return I($(Oe))}).join(" "),ce=I($(ce)),pe("["+q+"] "+ce+" d"),this};var Co=d.__private__.getLineHeight=d.getLineHeight=function(){return xe*Ua};d.__private__.getLineHeight=d.getLineHeight=function(){return xe*Ua};var Tc=d.__private__.setLineHeightFactor=d.setLineHeightFactor=function(q){return typeof(q=q||1.15)=="number"&&(Ua=q),this},Rc=d.__private__.getLineHeightFactor=d.getLineHeightFactor=function(){return Ua};Tc(e.lineHeight);var uo=d.__private__.getHorizontalCoordinate=function(q){return $(q)},Er=d.__private__.getVerticalCoordinate=function(q){return E===k?q:Wt[z].mediaBox.topRightY-Wt[z].mediaBox.bottomLeftY-$(q)},gu=d.__private__.getHorizontalCoordinateString=d.getHorizontalCoordinateString=function(q){return I(uo(q))},mu=d.__private__.getVerticalCoordinateString=d.getVerticalCoordinateString=function(q){return I(Er(q))},Bs=e.strokeColor||"0 G";d.__private__.getStrokeColor=d.getDrawColor=function(){return io(Bs)},d.__private__.setStrokeColor=d.setDrawColor=function(q,ce,Oe,Ie){return Bs=ui({ch1:q,ch2:ce,ch3:Oe,ch4:Ie,pdfColorType:"draw",precision:2}),pe(Bs),this};var Ku=e.fillColor||"0 g";d.__private__.getFillColor=d.getFillColor=function(){return io(Ku)},d.__private__.setFillColor=d.setFillColor=function(q,ce,Oe,Ie){return Ku=ui({ch1:q,ch2:ce,ch3:Oe,ch4:Ie,pdfColorType:"fill",precision:2}),pe(Ku),this};var $a=e.textColor||"0 g",fa=d.__private__.getTextColor=d.getTextColor=function(){return io($a)};d.__private__.setTextColor=d.setTextColor=function(q,ce,Oe,Ie){return $a=ui({ch1:q,ch2:ce,ch3:Oe,ch4:Ie,pdfColorType:"text",precision:3}),this};var Ha=e.charSpace,vu=d.__private__.getCharSpace=d.getCharSpace=function(){return parseFloat(Ha||0)};d.__private__.setCharSpace=d.setCharSpace=function(q){if(isNaN(q))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Ha=q,this};var La=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(q){var ce=d.CapJoinStyles[q];if(ce===void 0)throw new Error("Line cap style of '"+q+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return La=ce,pe(ce+" J"),this};var co=0;d.__private__.setLineJoin=d.setLineJoin=function(q){var ce=d.CapJoinStyles[q];if(ce===void 0)throw new Error("Line join style of '"+q+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return co=ce,pe(ce+" j"),this},d.__private__.setLineMiterLimit=d.__private__.setMiterLimit=d.setLineMiterLimit=d.setMiterLimit=function(q){if(q=q||0,isNaN(q))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return pe(I($(q))+" M"),this},d.GState=j0,d.setGState=function(q){(q=typeof q=="string"?At[Lt[q]]:zs(null,q)).equals(Tt)||(pe("/"+q.id+" gs"),Tt=q)};var zs=function(q,ce){if(!q||!Lt[q]){var Oe=!1;for(var Ie in At)if(At.hasOwnProperty(Ie)&&At[Ie].equals(ce)){Oe=!0;break}if(Oe)ce=At[Ie];else{var He="GS"+(Object.keys(At).length+1).toString(10);At[He]=ce,ce.id=He}return q&&(Lt[q]=ce.id),hn.publish("addGState",ce),ce}};d.addGState=function(q,ce){return zs(q,ce),this},d.saveGraphicsState=function(){return pe("q"),We.push({key:rt,size:xe,color:$a}),this},d.restoreGraphicsState=function(){pe("Q");var q=We.pop();return rt=q.key,xe=q.size,$a=q.color,Tt=null,this},d.setCurrentTransformationMatrix=function(q){return pe(q.toString()+" cm"),this},d.comment=function(q){return pe("#"+q),this};var Ga=function(q,ce){var Oe=q||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return Oe},set:function(ft){isNaN(ft)||(Oe=parseFloat(ft))}});var Ie=ce||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return Ie},set:function(ft){isNaN(ft)||(Ie=parseFloat(ft))}});var He="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return He},set:function(ft){He=ft.toString()}}),this},gl=function(q,ce,Oe,Ie){Ga.call(this,q,ce),this.type="rect";var He=Oe||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return He},set:function(pt){isNaN(pt)||(He=parseFloat(pt))}});var ft=Ie||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return ft},set:function(pt){isNaN(pt)||(ft=parseFloat(pt))}}),this},Il=function(){this.page=tn,this.currentPage=z,this.pages=Ce.slice(0),this.pagesContext=Wt.slice(0),this.x=dt,this.y=Ct,this.matrix=Zt,this.width=fo(z),this.height=fs(z),this.outputDestination=ze,this.id="",this.objectNumber=-1};Il.prototype.restore=function(){tn=this.page,z=this.currentPage,Wt=this.pagesContext,Ce=this.pages,dt=this.x,Ct=this.y,Zt=this.matrix,ml(z,this.width),$r(z,this.height),ze=this.outputDestination};var ci=function(q,ce,Oe,Ie,He){dr.push(new Il),tn=z=0,Ce=[],dt=q,Ct=ce,Zt=He,ss([Oe,Ie])};for(var Wa in d.beginFormObject=function(q,ce,Oe,Ie,He){return ci(q,ce,Oe,Ie,He),this},d.endFormObject=function(q){return(function(ce){if(ei[ce])dr.pop().restore();else{var Oe=new Il,Ie="Xo"+(Object.keys(nr).length+1).toString(10);Oe.id=Ie,ei[ce]=Ie,nr[Ie]=Oe,hn.publish("addFormObject",Oe),dr.pop().restore()}})(q),this},d.doFormObject=function(q,ce){var Oe=nr[ei[q]];return pe("q"),pe(ce.toString()+" cm"),pe("/"+Oe.id+" Do"),pe("Q"),this},d.getFormObject=function(q){var ce=nr[ei[q]];return{x:ce.x,y:ce.y,width:ce.width,height:ce.height,matrix:ce.matrix}},d.save=function(q,ce){return q=q||"generated.pdf",(ce=ce||{}).returnPromise=ce.returnPromise||!1,ce.returnPromise===!1?(eh(qr(qi()),q),typeof eh.unload=="function"&&En.setTimeout&&setTimeout(eh.unload,911),this):new Promise(function(Oe,Ie){try{var He=eh(qr(qi()),q);typeof eh.unload=="function"&&En.setTimeout&&setTimeout(eh.unload,911),Oe(He)}catch(ft){Ie(ft.message)}})},sn.API)sn.API.hasOwnProperty(Wa)&&(Wa==="events"&&sn.API.events.length?(function(q,ce){var Oe,Ie,He;for(He=ce.length-1;He!==-1;He--)Oe=ce[He][0],Ie=ce[He][1],q.subscribe.apply(q,[Oe].concat(typeof Ie=="function"?[Ie]:Ie))})(hn,sn.API.events):d[Wa]=sn.API[Wa]);function fo(q){return Wt[q].mediaBox.topRightX-Wt[q].mediaBox.bottomLeftX}function ml(q,ce){Wt[q].mediaBox.topRightX=ce+Wt[q].mediaBox.bottomLeftX}function fs(q){return Wt[q].mediaBox.topRightY-Wt[q].mediaBox.bottomLeftY}function $r(q,ce){Wt[q].mediaBox.topRightY=ce+Wt[q].mediaBox.bottomLeftY}var fi=d.getPageWidth=function(q){return fo(q=q||z)/ot},ni=d.setPageWidth=function(q,ce){ml(q,ce*ot)},_i=d.getPageHeight=function(q){return fs(q=q||z)/ot},Va=d.setPageHeight=function(q,ce){$r(q,ce*ot)};return d.internal={pdfEscape:Oa,getStyle:pu,getFont:za,getFontSize:Me,getCharSpace:vu,getTextColor:fa,getLineHeight:Co,getLineHeightFactor:Rc,getLineWidth:Ln,write:ut,getHorizontalCoordinate:uo,getVerticalCoordinate:Er,getCoordinateString:gu,getVerticalCoordinateString:mu,collections:{},newObject:Hn,newAdditionalObject:Ea,newObjectDeferred:Or,newObjectDeferredBegin:Dr,getFilters:Aa,putStream:Pa,events:hn,scaleFactor:ot,pageSize:{getWidth:function(){return fi(z)},setWidth:function(q){ni(z,q)},getHeight:function(){return _i(z)},setHeight:function(q){Va(z,q)}},encryptionOptions:c,encryption:xi,getEncryptor:function(q){return c!==null?xi.encryptor(q,0):function(ce){return ce}},output:ls,getNumberOfPages:wi,get pages(){return Ce},out:pe,f2:C,f3:N,getPageInfo:Ba,getPageInfoByObjId:du,getCurrentPageInfo:Ca,getPDFVersion:_,Point:Ga,Rectangle:gl,Matrix:Jt,hasHotfix:lo},Object.defineProperty(d.internal.pageSize,"width",{get:function(){return fi(z)},set:function(q){ni(z,q)},enumerable:!0,configurable:!0}),Object.defineProperty(d.internal.pageSize,"height",{get:function(){return _i(z)},set:function(q){Va(z,q)},enumerable:!0,configurable:!0}),(function(q){for(var ce=0,Oe=ge.length;ce<Oe;ce++){var Ie=os.call(this,q[ce][0],q[ce][1],q[ce][2],ge[ce][3],!0);m===!1&&(g[Ie]=!0);var He=q[ce][0].split("-");hu({id:Ie,fontName:He[0],fontStyle:He[1]||""})}hn.publish("addFonts",{fonts:on,dictionary:an})}).call(d,ge),rt="F1",Cc(i,n),hn.publish("initialized"),d}ed.prototype.lsbFirstWord=function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)},ed.prototype.toHexString=function(e){return e.split("").map(function(t){return("0"+(255&t.charCodeAt(0)).toString(16)).slice(-2)}).join("")},ed.prototype.hexToBytes=function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(String.fromCharCode(parseInt(e.substr(n,2),16)));return t.join("")},ed.prototype.processOwnerPassword=function(e,t){return Bv(Fv(t).substr(0,5),e)},ed.prototype.encryptor=function(e,t){var n=Fv(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&t,t>>8&255)).substr(0,10);return function(r){return Bv(n,r)}},j0.prototype.equals=function(e){var t,n="id,objectNumber,equals";if(!e||jr(e)!==jr(this))return!1;var r=0;for(t in this)if(!(n.indexOf(t)>=0)){if(this.hasOwnProperty(t)&&!e.hasOwnProperty(t)||this[t]!==e[t])return!1;r++}for(t in e)e.hasOwnProperty(t)&&n.indexOf(t)<0&&r--;return r===0},sn.API={events:[]},sn.version="3.0.4";var Xi=sn.API,Ny=1,Lh=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Zh=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Cn=function(e){return e.toFixed(2)},uf=function(e){return e.toFixed(5)};Xi.__acroform__={};var Ds=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},Fw=function(e){return e*Ny},Mu=function(e){var t=new d_,n=Kt.internal.getHeight(e)||0,r=Kt.internal.getWidth(e)||0;return t.BBox=[0,0,Number(Cn(r)),Number(Cn(n))],t},tj=Xi.__acroform__.setBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return e|1<<t},nj=Xi.__acroform__.clearBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return e&~(1<<t)},rj=Xi.__acroform__.getBit=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return e&1<<t?1:0},aa=Xi.__acroform__.getBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return rj(e,t-1)},oa=Xi.__acroform__.setBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return tj(e,t-1)},sa=Xi.__acroform__.clearBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return nj(e,t-1)},ij=Xi.__acroform__.calculateCoordinates=function(e,t){var n=t.internal.getHorizontalCoordinate,r=t.internal.getVerticalCoordinate,i=e[0],a=e[1],o=e[2],s=e[3],u={};return u.lowerLeft_X=n(i)||0,u.lowerLeft_Y=r(a+s)||0,u.upperRight_X=n(i+o)||0,u.upperRight_Y=r(a)||0,[Number(Cn(u.lowerLeft_X)),Number(Cn(u.lowerLeft_Y)),Number(Cn(u.upperRight_X)),Number(Cn(u.upperRight_Y))]},aj=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var t=[],n=e._V||e.DV,r=zv(e,n),i=e.scope.internal.getFont(e.fontName,e.fontStyle).id;t.push("/Tx BMC"),t.push("q"),t.push("BT"),t.push(e.scope.__private__.encodeColorString(e.color)),t.push("/"+i+" "+Cn(r.fontSize)+" Tf"),t.push("1 0 0 1 0 0 Tm"),t.push(r.text),t.push("ET"),t.push("Q"),t.push("EMC");var a=Mu(e);return a.scope=e.scope,a.stream=t.join(`
|
|
465
|
+
`),a}},zv=function(e,t){var n=e.fontSize===0?e.maxFontSize:e.fontSize,r={text:"",fontSize:""},i=(t=(t=t.substr(0,1)=="("?t.substr(1):t).substr(t.length-1)==")"?t.substr(0,t.length-1):t).split(" ");i=e.multiline?i.map(function(C){return C.split(`
|
|
466
|
+
`)}):i.map(function(C){return[C]});var a=n,o=Kt.internal.getHeight(e)||0;o=o<0?-o:o;var s=Kt.internal.getWidth(e)||0;s=s<0?-s:s;var u=function(C,N,$){if(C+1<i.length){var G=N+" "+i[C+1][0];return X1(G,e,$).width<=s-4}return!1};a++;e:for(;a>0;){t="",a--;var h,c,m=X1("3",e,a).height,g=e.multiline?o-a:(o-m)/2,d=g+=2,y=0,_=0,x=0;if(a<=0){t=`(...) Tj
|
|
467
|
+
`,t+="% Width of Text: "+X1(t,e,a=12).width+", FieldWidth:"+s+`
|
|
468
|
+
`;break}for(var b="",S=0,k=0;k<i.length;k++)if(i.hasOwnProperty(k)){var E=!1;if(i[k].length!==1&&x!==i[k].length-1){if((m+2)*(S+2)+2>o)continue e;b+=i[k][x],E=!0,_=k,k--}else{b=(b+=i[k][x]+" ").substr(b.length-1)==" "?b.substr(0,b.length-1):b;var A=parseInt(k),R=u(A,b,a),O=k>=i.length-1;if(R&&!O){b+=" ",x=0;continue}if(R||O){if(O)_=A;else if(e.multiline&&(m+2)*(S+2)+2>o)continue e}else{if(!e.multiline||(m+2)*(S+2)+2>o)continue e;_=A}}for(var I="",j=y;j<=_;j++){var D=i[j];if(e.multiline){if(j===_){I+=D[x]+" ",x=(x+1)%D.length;continue}if(j===y){I+=D[D.length-1]+" ";continue}}I+=D[0]+" "}switch(I=I.substr(I.length-1)==" "?I.substr(0,I.length-1):I,c=X1(I,e,a).width,e.textAlign){case"right":h=s-c-2;break;case"center":h=(s-c)/2;break;default:h=2}t+=Cn(h)+" "+Cn(d)+` Td
|
|
469
|
+
`,t+="("+Lh(I)+`) Tj
|
|
470
|
+
`,t+=-Cn(h)+` 0 Td
|
|
471
|
+
`,d=-(a+2),c=0,y=E?_:_+1,S++,b=""}break}return r.text=t,r.fontSize=a,r},X1=function(e,t,n){var r=t.scope.internal.getFont(t.fontName,t.fontStyle),i=t.scope.getStringUnitWidth(e,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:t.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},oj={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},sj=function(e,t){var n={type:"reference",object:e};t.internal.getPageInfo(e.page).pageContext.annotations.find(function(r){return r.type===n.type&&r.object===n.object})===void 0&&t.internal.getPageInfo(e.page).pageContext.annotations.push(n)},lj=function(e,t){if(t.scope=e,e.internal!==void 0&&(e.internal.acroformPlugin===void 0||e.internal.acroformPlugin.isInitialized===!1)){if(uu.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(oj)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");Ny=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new p_,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe("postPutResources",function(){(function(n){n.internal.events.unsubscribe(n.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete n.internal.acroformPlugin.acroFormDictionaryRoot._eventID,n.internal.acroformPlugin.printedOut=!0})(e)}),e.internal.events.subscribe("buildDocument",function(){(function(n){n.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var r=n.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var i in r)if(r.hasOwnProperty(i)){var a=r[i];a.objId=void 0,a.hasAnnotation&&sj(a,n)}})(e)}),e.internal.events.subscribe("putCatalog",function(){(function(n){if(n.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");n.internal.write("/AcroForm "+n.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(e)}),e.internal.events.subscribe("postPutPages",function(n){(function(r,i){var a=!r;for(var o in r||(i.internal.newObjectDeferredBegin(i.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),i.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),r=r||i.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(r.hasOwnProperty(o)){var s=r[o],u=[],h=s.Rect;if(s.Rect&&(s.Rect=ij(s.Rect,i)),i.internal.newObjectDeferredBegin(s.objId,!0),s.DA=Kt.createDefaultAppearanceStream(s),jr(s)==="object"&&typeof s.getKeyValueListForStream=="function"&&(u=s.getKeyValueListForStream()),s.Rect=h,s.hasAppearanceStream&&!s.appearanceStreamContent){var c=aj(s);u.push({key:"AP",value:"<</N "+c+">>"}),i.internal.acroformPlugin.xForms.push(c)}if(s.appearanceStreamContent){var m="";for(var g in s.appearanceStreamContent)if(s.appearanceStreamContent.hasOwnProperty(g)){var d=s.appearanceStreamContent[g];if(m+="/"+g+" ",m+="<<",Object.keys(d).length>=1||Array.isArray(d)){for(var o in d)if(d.hasOwnProperty(o)){var y=d[o];typeof y=="function"&&(y=y.call(i,s)),m+="/"+o+" "+y+" ",i.internal.acroformPlugin.xForms.indexOf(y)>=0||i.internal.acroformPlugin.xForms.push(y)}}else typeof(y=d)=="function"&&(y=y.call(i,s)),m+="/"+o+" "+y,i.internal.acroformPlugin.xForms.indexOf(y)>=0||i.internal.acroformPlugin.xForms.push(y);m+=">>"}u.push({key:"AP",value:`<<
|
|
472
|
+
`+m+">>"})}i.internal.putStream({additionalKeyValues:u,objectId:s.objId}),i.internal.out("endobj")}a&&(function(_,x){for(var b in _)if(_.hasOwnProperty(b)){var S=b,k=_[b];x.internal.newObjectDeferredBegin(k.objId,!0),jr(k)==="object"&&typeof k.putStream=="function"&&k.putStream(),delete _[S]}})(i.internal.acroformPlugin.xForms,i)})(n,e)}),e.internal.acroformPlugin.isInitialized=!0}},h_=Xi.__acroform__.arrayToPdfArray=function(e,t,n){var r=function(o){return o};if(Array.isArray(e)){for(var i="[",a=0;a<e.length;a++)switch(a!==0&&(i+=" "),jr(e[a])){case"boolean":case"number":case"object":i+=e[a].toString();break;case"string":e[a].substr(0,1)!=="/"?(t!==void 0&&n&&(r=n.internal.getEncryptor(t)),i+="("+Lh(r(e[a].toString()))+")"):i+=e[a].toString()}return i+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},Gm=function(e,t,n){var r=function(i){return i};return t!==void 0&&n&&(r=n.internal.getEncryptor(t)),(e=e||"").toString(),"("+Lh(r(e))+")"},Du=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})};Du.prototype.toString=function(){return this.objId+" 0 R"},Du.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},Du.prototype.getKeyValueListForStream=function(){var e=[],t=Object.getOwnPropertyNames(this).filter(function(a){return a!="content"&&a!="appearanceStreamContent"&&a!="scope"&&a!="objId"&&a.substring(0,1)!="_"});for(var n in t)if(Object.getOwnPropertyDescriptor(this,t[n]).configurable===!1){var r=t[n],i=this[r];i&&(Array.isArray(i)?e.push({key:r,value:h_(i,this.objId,this.scope)}):i instanceof Du?(i.scope=this.scope,e.push({key:r,value:i.objId+" 0 R"})):typeof i!="function"&&e.push({key:r,value:i}))}return e};var d_=function(){Du.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,t=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(n){e=n.trim()},get:function(){return e||null}})};Ds(d_,Du);var p_=function(){Du.call(this);var e,t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var n=function(r){return r};return this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),"("+Lh(n(e))+")"}},set:function(n){e=n}})};Ds(p_,Du);var uu=function e(){Du.call(this);var t=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(b){if(isNaN(b))throw new Error('Invalid value "'+b+'" for attribute F supplied.');t=b}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!aa(t,3)},set:function(b){b?this.F=oa(t,3):this.F=sa(t,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(b){if(isNaN(b))throw new Error('Invalid value "'+b+'" for attribute Ff supplied.');n=b}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(r.length!==0)return r},set:function(b){r=b!==void 0?b:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(b){r[0]=b}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(b){r[1]=b}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(b){r[2]=b}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(b){r[3]=b}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(b){switch(b){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=b;break;default:throw new Error('Invalid value "'+b+'" for attribute FT supplied.')}}});var a=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!a||a.length<1){if(this instanceof D0)return;a="FieldObject"+e.FieldNum++}var b=function(S){return S};return this.scope&&(b=this.scope.internal.getEncryptor(this.objId)),"("+Lh(b(a))+")"},set:function(b){a=b.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return a},set:function(b){a=b}});var o="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return o},set:function(b){o=b}});var s="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return s},set:function(b){s=b}});var u=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return u},set:function(b){u=b}});var h=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return h===void 0?50/Ny:h},set:function(b){h=b}});var c="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return c},set:function(b){c=b}});var m="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!m||this instanceof D0||this instanceof uh))return Gm(m,this.objId,this.scope)},set:function(b){b=b.toString(),m=b}});var g=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(g)return this instanceof ro==0?Gm(g,this.objId,this.scope):g},set:function(b){b=b.toString(),g=this instanceof ro==0?b.substr(0,1)==="("?Zh(b.substr(1,b.length-2)):Zh(b):b}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof ro==1?Zh(g.substr(1,g.length-1)):g},set:function(b){b=b.toString(),g=this instanceof ro==1?"/"+b:b}});var d=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(d)return d},set:function(b){this.V=b}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(d)return this instanceof ro==0?Gm(d,this.objId,this.scope):d},set:function(b){b=b.toString(),d=this instanceof ro==0?b.substr(0,1)==="("?Zh(b.substr(1,b.length-2)):Zh(b):b}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof ro==1?Zh(d.substr(1,d.length-1)):d},set:function(b){b=b.toString(),d=this instanceof ro==1?"/"+b:b}}),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 y,_=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return _},set:function(b){b=!!b,_=b}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(y)return y},set:function(b){y=b}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,1)},set:function(b){b?this.Ff=oa(this.Ff,1):this.Ff=sa(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,2)},set:function(b){b?this.Ff=oa(this.Ff,2):this.Ff=sa(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,3)},set:function(b){b?this.Ff=oa(this.Ff,3):this.Ff=sa(this.Ff,3)}});var x=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(x!==null)return x},set:function(b){if([0,1,2].indexOf(b)===-1)throw new Error('Invalid value "'+b+'" for attribute Q supplied.');x=b}}),Object.defineProperty(this,"textAlign",{get:function(){var b;switch(x){case 0:default:b="left";break;case 1:b="center";break;case 2:b="right"}return b},configurable:!0,enumerable:!0,set:function(b){switch(b){case"right":case 2:x=2;break;case"center":case 1:x=1;break;default:x=0}}})};Ds(uu,Du);var cd=function(){uu.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(n){e=n}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(n){e=n}});var t=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return h_(t,this.objId,this.scope)},set:function(n){var r,i;i=[],typeof(r=n)=="string"&&(i=(function(a,o,s){s||(s=1);for(var u,h=[];u=o.exec(a);)h.push(u[s]);return h})(r,/\((.*?)\)/g)),t=i}}),this.getOptions=function(){return t},this.setOptions=function(n){t=n,this.sort&&t.sort()},this.addOption=function(n){n=(n=n||"").toString(),t.push(n),this.sort&&t.sort()},this.removeOption=function(n,r){for(r=r||!1,n=(n=n||"").toString();t.indexOf(n)!==-1&&(t.splice(t.indexOf(n),1),r!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,18)},set:function(n){n?this.Ff=oa(this.Ff,18):this.Ff=sa(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,19)},set:function(n){this.combo===!0&&(n?this.Ff=oa(this.Ff,19):this.Ff=sa(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,20)},set:function(n){n?(this.Ff=oa(this.Ff,20),t.sort()):this.Ff=sa(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,22)},set:function(n){n?this.Ff=oa(this.Ff,22):this.Ff=sa(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,23)},set:function(n){n?this.Ff=oa(this.Ff,23):this.Ff=sa(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,27)},set:function(n){n?this.Ff=oa(this.Ff,27):this.Ff=sa(this.Ff,27)}}),this.hasAppearanceStream=!1};Ds(cd,uu);var fd=function(){cd.call(this),this.fontName="helvetica",this.combo=!1};Ds(fd,cd);var hd=function(){fd.call(this),this.combo=!0};Ds(hd,fd);var u0=function(){hd.call(this),this.edit=!0};Ds(u0,hd);var ro=function(){uu.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,15)},set:function(n){n?this.Ff=oa(this.Ff,15):this.Ff=sa(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,16)},set:function(n){n?this.Ff=oa(this.Ff,16):this.Ff=sa(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,17)},set:function(n){n?this.Ff=oa(this.Ff,17):this.Ff=sa(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,26)},set:function(n){n?this.Ff=oa(this.Ff,26):this.Ff=sa(this.Ff,26)}});var e,t={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var n=function(a){return a};if(this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),Object.keys(t).length!==0){var r,i=[];for(r in i.push("<<"),t)i.push("/"+r+" ("+Lh(n(t[r]))+")");return i.push(">>"),i.join(`
|
|
473
|
+
`)}},set:function(n){jr(n)==="object"&&(t=n)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||""},set:function(n){typeof n=="string"&&(t.CA=n)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(n){e=n}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(n){e="/"+n}})};Ds(ro,uu);var c0=function(){ro.call(this),this.pushButton=!0};Ds(c0,ro);var dd=function(){ro.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t!==void 0?t:[]}})};Ds(dd,ro);var D0=function(){var e,t;uu.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(i){e=i}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(i){t=i}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var i=function(s){return s};this.scope&&(i=this.scope.internal.getEncryptor(this.objId));var a,o=[];for(a in o.push("<<"),r)o.push("/"+a+" ("+Lh(i(r[a]))+")");return o.push(">>"),o.join(`
|
|
474
|
+
`)},set:function(i){jr(i)==="object"&&(r=i)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(i){typeof i=="string"&&(r.CA=i)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(i){n=i}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(i){n="/"+i}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=Kt.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Ds(D0,uu),dd.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 t in this.Kids)if(this.Kids.hasOwnProperty(t)){var n=this.Kids[t];n.appearanceStreamContent=e.createAppearanceStream(n.optionName),n.caption=e.getCA()}},dd.prototype.createOption=function(e){var t=new D0;return t.Parent=this,t.optionName=e,this.Kids.push(t),uj.call(this.scope,t),t};var f0=function(){ro.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Kt.CheckBox.createAppearanceStream()};Ds(f0,ro);var uh=function(){uu.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,13)},set:function(t){t?this.Ff=oa(this.Ff,13):this.Ff=sa(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,21)},set:function(t){t?this.Ff=oa(this.Ff,21):this.Ff=sa(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,23)},set:function(t){t?this.Ff=oa(this.Ff,23):this.Ff=sa(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,24)},set:function(t){t?this.Ff=oa(this.Ff,24):this.Ff=sa(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,25)},set:function(t){t?this.Ff=oa(this.Ff,25):this.Ff=sa(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,26)},set:function(t){t?this.Ff=oa(this.Ff,26):this.Ff=sa(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Ds(uh,uu);var h0=function(){uh.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!aa(this.Ff,14)},set:function(e){e?this.Ff=oa(this.Ff,14):this.Ff=sa(this.Ff,14)}}),this.password=!0};Ds(h0,uh);var Kt={CheckBox:{createAppearanceStream:function(){return{N:{On:Kt.CheckBox.YesNormal},D:{On:Kt.CheckBox.YesPushDown,Off:Kt.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=Mu(e);t.scope=e.scope;var n=[],r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,i=e.scope.__private__.encodeColorString(e.color),a=zv(e,e.caption);return n.push("0.749023 g"),n.push("0 0 "+Cn(Kt.internal.getWidth(e))+" "+Cn(Kt.internal.getHeight(e))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+Cn(a.fontSize)+" Tf "+i),n.push("BT"),n.push(a.text),n.push("ET"),n.push("Q"),n.push("EMC"),t.stream=n.join(`
|
|
475
|
+
`),t},YesNormal:function(e){var t=Mu(e);t.scope=e.scope;var n=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color),i=[],a=Kt.internal.getHeight(e),o=Kt.internal.getWidth(e),s=zv(e,e.caption);return i.push("1 g"),i.push("0 0 "+Cn(o)+" "+Cn(a)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+Cn(o-1)+" "+Cn(a-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+n+" "+Cn(s.fontSize)+" Tf "+r),i.push(s.text),i.push("ET"),i.push("Q"),t.stream=i.join(`
|
|
476
|
+
`),t},OffPushDown:function(e){var t=Mu(e);t.scope=e.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+Cn(Kt.internal.getWidth(e))+" "+Cn(Kt.internal.getHeight(e))+" re"),n.push("f"),t.stream=n.join(`
|
|
477
|
+
`),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:Kt.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=Kt.RadioButton.Circle.YesNormal,t.D[e]=Kt.RadioButton.Circle.YesPushDown,t},getCA:function(){return"l"},YesNormal:function(e){var t=Mu(e);t.scope=e.scope;var n=[],r=Kt.internal.getWidth(e)<=Kt.internal.getHeight(e)?Kt.internal.getWidth(e)/4:Kt.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Kt.internal.Bezier_C,a=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+uf(Kt.internal.getWidth(e)/2)+" "+uf(Kt.internal.getHeight(e)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"),n.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"),n.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"),n.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join(`
|
|
478
|
+
`),t},YesPushDown:function(e){var t=Mu(e);t.scope=e.scope;var n=[],r=Kt.internal.getWidth(e)<=Kt.internal.getHeight(e)?Kt.internal.getWidth(e)/4:Kt.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),a=Number((i*Kt.internal.Bezier_C).toFixed(5)),o=Number((r*Kt.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+uf(Kt.internal.getWidth(e)/2)+" "+uf(Kt.internal.getHeight(e)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+a+" "+a+" "+i+" 0 "+i+" c"),n.push("-"+a+" "+i+" -"+i+" "+a+" -"+i+" 0 c"),n.push("-"+i+" -"+a+" -"+a+" -"+i+" 0 -"+i+" c"),n.push(a+" -"+i+" "+i+" -"+a+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+uf(Kt.internal.getWidth(e)/2)+" "+uf(Kt.internal.getHeight(e)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join(`
|
|
479
|
+
`),t},OffPushDown:function(e){var t=Mu(e);t.scope=e.scope;var n=[],r=Kt.internal.getWidth(e)<=Kt.internal.getHeight(e)?Kt.internal.getWidth(e)/4:Kt.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),a=Number((i*Kt.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+uf(Kt.internal.getWidth(e)/2)+" "+uf(Kt.internal.getHeight(e)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+a+" "+a+" "+i+" 0 "+i+" c"),n.push("-"+a+" "+i+" -"+i+" "+a+" -"+i+" 0 c"),n.push("-"+i+" -"+a+" -"+a+" -"+i+" 0 -"+i+" c"),n.push(a+" -"+i+" "+i+" -"+a+" "+i+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join(`
|
|
480
|
+
`),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:Kt.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=Kt.RadioButton.Cross.YesNormal,t.D[e]=Kt.RadioButton.Cross.YesPushDown,t},getCA:function(){return"8"},YesNormal:function(e){var t=Mu(e);t.scope=e.scope;var n=[],r=Kt.internal.calculateCross(e);return n.push("q"),n.push("1 1 "+Cn(Kt.internal.getWidth(e)-2)+" "+Cn(Kt.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(Cn(r.x1.x)+" "+Cn(r.x1.y)+" m"),n.push(Cn(r.x2.x)+" "+Cn(r.x2.y)+" l"),n.push(Cn(r.x4.x)+" "+Cn(r.x4.y)+" m"),n.push(Cn(r.x3.x)+" "+Cn(r.x3.y)+" l"),n.push("s"),n.push("Q"),t.stream=n.join(`
|
|
481
|
+
`),t},YesPushDown:function(e){var t=Mu(e);t.scope=e.scope;var n=Kt.internal.calculateCross(e),r=[];return r.push("0.749023 g"),r.push("0 0 "+Cn(Kt.internal.getWidth(e))+" "+Cn(Kt.internal.getHeight(e))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+Cn(Kt.internal.getWidth(e)-2)+" "+Cn(Kt.internal.getHeight(e)-2)+" re"),r.push("W"),r.push("n"),r.push(Cn(n.x1.x)+" "+Cn(n.x1.y)+" m"),r.push(Cn(n.x2.x)+" "+Cn(n.x2.y)+" l"),r.push(Cn(n.x4.x)+" "+Cn(n.x4.y)+" m"),r.push(Cn(n.x3.x)+" "+Cn(n.x3.y)+" l"),r.push("s"),r.push("Q"),t.stream=r.join(`
|
|
482
|
+
`),t},OffPushDown:function(e){var t=Mu(e);t.scope=e.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+Cn(Kt.internal.getWidth(e))+" "+Cn(Kt.internal.getHeight(e))+" re"),n.push("f"),t.stream=n.join(`
|
|
483
|
+
`),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+n}};Kt.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=Kt.internal.getWidth(e),n=Kt.internal.getHeight(e),r=Math.min(t,n);return{x1:{x:(t-r)/2,y:(n-r)/2+r},x2:{x:(t-r)/2+r,y:(n-r)/2},x3:{x:(t-r)/2,y:(n-r)/2},x4:{x:(t-r)/2+r,y:(n-r)/2+r}}}},Kt.internal.getWidth=function(e){var t=0;return jr(e)==="object"&&(t=Fw(e.Rect[2])),t},Kt.internal.getHeight=function(e){var t=0;return jr(e)==="object"&&(t=Fw(e.Rect[3])),t};var uj=Xi.addField=function(e){if(lj(this,e),!(e instanceof uu))throw new Error("Invalid argument passed to jsPDF.addField.");var t;return(t=e).scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};Xi.AcroFormChoiceField=cd,Xi.AcroFormListBox=fd,Xi.AcroFormComboBox=hd,Xi.AcroFormEditBox=u0,Xi.AcroFormButton=ro,Xi.AcroFormPushButton=c0,Xi.AcroFormRadioButton=dd,Xi.AcroFormCheckBox=f0,Xi.AcroFormTextField=uh,Xi.AcroFormPasswordField=h0,Xi.AcroFormAppearance=Kt,Xi.AcroForm={ChoiceField:cd,ListBox:fd,ComboBox:hd,EditBox:u0,Button:ro,PushButton:c0,RadioButton:dd,CheckBox:f0,TextField:uh,PasswordField:h0,Appearance:Kt},sn.AcroForm={ChoiceField:cd,ListBox:fd,ComboBox:hd,EditBox:u0,Button:ro,PushButton:c0,RadioButton:dd,CheckBox:f0,TextField:uh,PasswordField:h0,Appearance:Kt};sn.AcroForm;function g_(e){return e.reduce(function(t,n,r){return t[n]=r,t},{})}(function(e){var t="addImage_";e.__addimage__={};var n="UNKNOWN",r={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]]},i=e.__addimage__.getImageFileTypeByImageData=function(C,N){var $,G,te,se,ee,Q=n;if((N=N||n)==="RGBA"||C.data!==void 0&&C.data instanceof Uint8ClampedArray&&"height"in C&&"width"in C)return"RGBA";if(R(C))for(ee in r)for(te=r[ee],$=0;$<te.length;$+=1){for(se=!0,G=0;G<te[$].length;G+=1)if(te[$][G]!==void 0&&te[$][G]!==C[G]){se=!1;break}if(se===!0){Q=ee;break}}else for(ee in r)for(te=r[ee],$=0;$<te.length;$+=1){for(se=!0,G=0;G<te[$].length;G+=1)if(te[$][G]!==void 0&&te[$][G]!==C.charCodeAt(G)){se=!1;break}if(se===!0){Q=ee;break}}return Q===n&&N!==n&&(Q=N),Q},a=function C(N){for(var $=this.internal.write,G=this.internal.putStream,te=(0,this.internal.getFilters)();te.indexOf("FlateEncode")!==-1;)te.splice(te.indexOf("FlateEncode"),1);N.objectId=this.internal.newObject();var se=[];if(se.push({key:"Type",value:"/XObject"}),se.push({key:"Subtype",value:"/Image"}),se.push({key:"Width",value:N.width}),se.push({key:"Height",value:N.height}),N.colorSpace===b.INDEXED?se.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(N.palette.length/3-1)+" "+("sMask"in N&&N.sMask!==void 0?N.objectId+2:N.objectId+1)+" 0 R]"}):(se.push({key:"ColorSpace",value:"/"+N.colorSpace}),N.colorSpace===b.DEVICE_CMYK&&se.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),se.push({key:"BitsPerComponent",value:N.bitsPerComponent}),"decodeParameters"in N&&N.decodeParameters!==void 0&&se.push({key:"DecodeParms",value:"<<"+N.decodeParameters+">>"}),"transparency"in N&&Array.isArray(N.transparency)&&N.transparency.length>0){for(var ee="",Q=0,re=N.transparency.length;Q<re;Q++)ee+=N.transparency[Q]+" "+N.transparency[Q]+" ";se.push({key:"Mask",value:"["+ee+"]"})}N.sMask!==void 0&&se.push({key:"SMask",value:N.objectId+1+" 0 R"});var X=N.filter!==void 0?["/"+N.filter]:void 0;if(G({data:N.data,additionalKeyValues:se,alreadyAppliedFilters:X,objectId:N.objectId}),$("endobj"),"sMask"in N&&N.sMask!==void 0){var B,F=(B=N.sMaskBitsPerComponent)!==null&&B!==void 0?B:N.bitsPerComponent,z={width:N.width,height:N.height,colorSpace:"DeviceGray",bitsPerComponent:F,data:N.sMask};"filter"in N&&(z.decodeParameters="/Predictor ".concat(N.predictor," /Colors 1 /BitsPerComponent ").concat(F," /Columns ").concat(N.width),z.filter=N.filter),C.call(this,z)}if(N.colorSpace===b.INDEXED){var Y=this.internal.newObject();G({data:I(new Uint8Array(N.palette)),objectId:Y}),$("endobj")}},o=function(){var C=this.internal.collections[t+"images"];for(var N in C)a.call(this,C[N])},s=function(){var C,N=this.internal.collections[t+"images"],$=this.internal.write;for(var G in N)$("/I"+(C=N[G]).index,C.objectId,"0","R")},u=function(){this.internal.collections[t+"images"]||(this.internal.collections[t+"images"]={},this.internal.events.subscribe("putResources",o),this.internal.events.subscribe("putXobjectDict",s))},h=function(){var C=this.internal.collections[t+"images"];return u.call(this),C},c=function(){return Object.keys(this.internal.collections[t+"images"]).length},m=function(C){return typeof e["process"+C.toUpperCase()]=="function"},g=function(C){return jr(C)==="object"&&C.nodeType===1},d=function(C,N){if(C.nodeName==="IMG"&&C.hasAttribute("src")){var $=""+C.getAttribute("src");if($.indexOf("data:image/")===0)return l0(unescape($).split("base64,").pop());var G=e.loadFile($,!0);if(G!==void 0)return G}if(C.nodeName==="CANVAS"){if(C.width===0||C.height===0)throw new Error("Given canvas must have data. Canvas width: "+C.width+", height: "+C.height);var te;switch(N){case"PNG":te="image/png";break;case"WEBP":te="image/webp";break;default:te="image/jpeg"}return l0(C.toDataURL(te,1).split("base64,").pop())}},y=function(C){var N=this.internal.collections[t+"images"];if(N){for(var $ in N)if(C===N[$].alias)return N[$]}},_=function(C,N,$){return C||N||(C=-96,N=-96),C<0&&(C=-1*$.width*72/C/this.internal.scaleFactor),N<0&&(N=-1*$.height*72/N/this.internal.scaleFactor),C===0&&(C=N*$.width/$.height),N===0&&(N=C*$.height/$.width),[C,N]},x=function(C,N,$,G,te,se){var ee=_.call(this,$,G,te),Q=this.internal.getCoordinateString,re=this.internal.getVerticalCoordinateString,X=h.call(this);if($=ee[0],G=ee[1],X[te.index]=te,se){se*=Math.PI/180;var B=Math.cos(se),F=Math.sin(se),z=function(J){return J.toFixed(4)},Y=[z(B),z(F),z(-1*F),z(B),0,0,"cm"]}this.internal.write("q"),se?(this.internal.write([1,"0","0",1,Q(C),re(N+G),"cm"].join(" ")),this.internal.write(Y.join(" ")),this.internal.write([Q($),"0","0",Q(G),"0","0","cm"].join(" "))):this.internal.write([Q($),"0","0",Q(G),Q(C),re(N+G),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+te.index+" Do"),this.internal.write("Q")},b=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 S=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},k=e.__addimage__.sHashCode=function(C){var N,$,G=0;if(typeof C=="string")for($=C.length,N=0;N<$;N++)G=(G<<5)-G+C.charCodeAt(N),G|=0;else if(R(C))for($=C.byteLength/2,N=0;N<$;N++)G=(G<<5)-G+C[N],G|=0;return G},E=e.__addimage__.validateStringAsBase64=function(C){(C=C||"").toString().trim();var N=!0;return C.length===0&&(N=!1),C.length%4!=0&&(N=!1),/^[A-Za-z0-9+/]+$/.test(C.substr(0,C.length-2))===!1&&(N=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(C.substr(-2))===!1&&(N=!1),N},A=e.__addimage__.extractImageFromDataUrl=function(C){if(C==null||!(C=C.trim()).startsWith("data:"))return null;var N=C.indexOf(",");return N<0?null:C.substring(0,N).trim().endsWith("base64")?C.substring(N+1):null};e.__addimage__.isArrayBuffer=function(C){return C instanceof ArrayBuffer};var R=e.__addimage__.isArrayBufferView=function(C){return C instanceof Int8Array||C instanceof Uint8Array||C instanceof Uint8ClampedArray||C instanceof Int16Array||C instanceof Uint16Array||C instanceof Int32Array||C instanceof Uint32Array||C instanceof Float32Array||C instanceof Float64Array},O=e.__addimage__.binaryStringToUint8Array=function(C){for(var N=C.length,$=new Uint8Array(N),G=0;G<N;G++)$[G]=C.charCodeAt(G);return $},I=e.__addimage__.arrayBufferToBinaryString=function(C){for(var N="",$=R(C)?C:new Uint8Array(C),G=0;G<$.length;G+=8192)N+=String.fromCharCode.apply(null,$.subarray(G,G+8192));return N};e.addImage=function(){var C,N,$,G,te,se,ee,Q,re;if(typeof arguments[1]=="number"?(N=n,$=arguments[1],G=arguments[2],te=arguments[3],se=arguments[4],ee=arguments[5],Q=arguments[6],re=arguments[7]):(N=arguments[1],$=arguments[2],G=arguments[3],te=arguments[4],se=arguments[5],ee=arguments[6],Q=arguments[7],re=arguments[8]),jr(C=arguments[0])==="object"&&!g(C)&&"imageData"in C){var X=C;C=X.imageData,N=X.format||N||n,$=X.x||$||0,G=X.y||G||0,te=X.w||X.width||te,se=X.h||X.height||se,ee=X.alias||ee,Q=X.compression||Q,re=X.rotation||X.angle||re}var B=this.internal.getFilters();if(Q===void 0&&B.indexOf("FlateEncode")!==-1&&(Q="SLOW"),isNaN($)||isNaN(G))throw new Error("Invalid coordinates passed to jsPDF.addImage");u.call(this);var F=j.call(this,C,N,ee,Q);return x.call(this,$,G,te,se,F,re),this};var j=function(C,N,$,G){var te,se,ee;if(typeof C=="string"&&i(C)===n){C=unescape(C);var Q=D(C,!1);(Q!==""||(Q=e.loadFile(C,!0))!==void 0)&&(C=Q)}if(g(C)&&(C=d(C,N)),N=i(C,N),!m(N))throw new Error("addImage does not support files of type '"+N+"', please ensure that a plugin for '"+N+"' support is added.");if(((ee=$)==null||ee.length===0)&&($=(function(re){return typeof re=="string"||R(re)?k(re):R(re.data)?k(re.data):null})(C)),(te=y.call(this,$))||(C instanceof Uint8Array||N==="RGBA"||(se=C,C=O(C)),te=this["process"+N.toUpperCase()](C,c.call(this),$,(function(re){return re&&typeof re=="string"&&(re=re.toUpperCase()),re in e.image_compression?re:S.NONE})(G),se)),!te)throw new Error("An unknown error occurred whilst processing the image.");return te},D=e.__addimage__.convertBase64ToBinaryString=function(C,N){N=typeof N!="boolean"||N;var $,G="";if(typeof C=="string"){var te;$=(te=A(C))!==null&&te!==void 0?te:C;try{G=l0($)}catch(se){if(N)throw E($)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+se.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return G};e.getImageProperties=function(C){var N,$,G="";if(g(C)&&(C=d(C)),typeof C=="string"&&i(C)===n&&((G=D(C,!1))===""&&(G=e.loadFile(C)||""),C=G),$=i(C),!m($))throw new Error("addImage does not support files of type '"+$+"', please ensure that a plugin for '"+$+"' support is added.");if(C instanceof Uint8Array||(C=O(C)),!(N=this["process"+$.toUpperCase()](C)))throw new Error("An unknown error occurred whilst processing the image");return N.fileType=$,N}})(sn.API),(function(e){var t=function(n){if(n!==void 0&&n!="")return!0};sn.API.events.push(["addPage",function(n){this.internal.getPageInfo(n.pageNumber).pageContext.annotations=[]}]),e.events.push(["putPage",function(n){for(var r,i,a,o=this.internal.getCoordinateString,s=this.internal.getVerticalCoordinateString,u=this.internal.getPageInfoByObjId(n.objId),h=n.pageContext.annotations,c=!1,m=0;m<h.length&&!c;m++)switch((r=h[m]).type){case"link":(t(r.options.url)||t(r.options.pageNumber))&&(c=!0);break;case"reference":case"text":case"freetext":c=!0}if(c!=0){this.internal.write("/Annots [");for(var g=0;g<h.length;g++){r=h[g];var d=this.internal.pdfEscape,y=this.internal.getEncryptor(n.objId);switch(r.type){case"reference":this.internal.write(" "+r.object.objId+" 0 R ");break;case"text":var _=this.internal.newAdditionalObject(),x=this.internal.newAdditionalObject(),b=this.internal.getEncryptor(_.objId),S=r.title||"Note";a="<</Type /Annot /Subtype /Text "+(i="/Rect ["+o(r.bounds.x)+" "+s(r.bounds.y+r.bounds.h)+" "+o(r.bounds.x+r.bounds.w)+" "+s(r.bounds.y)+"] ")+"/Contents ("+d(b(r.contents))+")",a+=" /Popup "+x.objId+" 0 R",a+=" /P "+u.objId+" 0 R",a+=" /T ("+d(b(S))+") >>",_.content=a;var k=_.objId+" 0 R";a="<</Type /Annot /Subtype /Popup "+(i="/Rect ["+o(r.bounds.x+30)+" "+s(r.bounds.y+r.bounds.h)+" "+o(r.bounds.x+r.bounds.w+30)+" "+s(r.bounds.y)+"] ")+" /Parent "+k,r.open&&(a+=" /Open true"),a+=" >>",x.content=a,this.internal.write(_.objId,"0 R",x.objId,"0 R");break;case"freetext":i="/Rect ["+o(r.bounds.x)+" "+s(r.bounds.y)+" "+o(r.bounds.x+r.bounds.w)+" "+s(r.bounds.y+r.bounds.h)+"] ";var E=r.color||"#000000";a="<</Type /Annot /Subtype /FreeText "+i+"/Contents ("+d(y(r.contents))+")",a+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+E+")",a+=" /Border [0 0 0]",a+=" >>",this.internal.write(a);break;case"link":if(r.options.name){var A=this.annotations._nameMap[r.options.name];r.options.pageNumber=A.page,r.options.top=A.y}else r.options.top||(r.options.top=0);if(i="/Rect ["+r.finalBounds.x+" "+r.finalBounds.y+" "+r.finalBounds.w+" "+r.finalBounds.h+"] ",a="",r.options.url)a="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /A <</S /URI /URI ("+d(y(r.options.url))+") >>";else if(r.options.pageNumber)switch(a="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(r.options.pageNumber).objId+" 0 R",r.options.magFactor=r.options.magFactor||"XYZ",r.options.magFactor){case"Fit":a+=" /Fit]";break;case"FitH":a+=" /FitH "+r.options.top+"]";break;case"FitV":r.options.left=r.options.left||0,a+=" /FitV "+r.options.left+"]";break;default:var R=s(r.options.top);r.options.left=r.options.left||0,r.options.zoom===void 0&&(r.options.zoom=0),a+=" /XYZ "+r.options.left+" "+R+" "+r.options.zoom+"]"}a!=""&&(a+=" >>",this.internal.write(a))}}this.internal.write("]")}}]),e.createAnnotation=function(n){var r=this.internal.getCurrentPageInfo();switch(n.type){case"link":this.link(n.bounds.x,n.bounds.y,n.bounds.w,n.bounds.h,n);break;case"text":case"freetext":r.pageContext.annotations.push(n)}},e.link=function(n,r,i,a,o){var s=this.internal.getCurrentPageInfo(),u=this.internal.getCoordinateString,h=this.internal.getVerticalCoordinateString;s.pageContext.annotations.push({finalBounds:{x:u(n),y:h(r),w:u(n+i),h:h(r+a)},options:o,type:"link"})},e.textWithLink=function(n,r,i,a){var o,s,u=this.getTextWidth(n),h=this.internal.getLineHeight()/this.internal.scaleFactor;if(a.maxWidth!==void 0){s=a.maxWidth;var c=this.splitTextToSize(n,s).length;o=Math.ceil(h*c)}else s=u,o=h;return this.text(n,r,i,a),i+=.2*h,a.align==="center"&&(r-=u/2),a.align==="right"&&(r-=u),this.link(r,i-h,s,o,a),u},e.getTextWidth=function(n){var r=this.internal.getFontSize();return this.getStringUnitWidth(n)*r/this.internal.scaleFactor}})(sn.API),(function(e){var t={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]},n={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}},r={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];e.__arabicParser__={};var a=e.__arabicParser__.isInArabicSubstitutionA=function(_){return t[_.charCodeAt(0)]!==void 0},o=e.__arabicParser__.isArabicLetter=function(_){return typeof _=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(_)},s=e.__arabicParser__.isArabicEndLetter=function(_){return o(_)&&a(_)&&t[_.charCodeAt(0)].length<=2},u=e.__arabicParser__.isArabicAlfLetter=function(_){return o(_)&&i.indexOf(_.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(_){return o(_)&&a(_)&&t[_.charCodeAt(0)].length>=1};var h=e.__arabicParser__.arabicLetterHasFinalForm=function(_){return o(_)&&a(_)&&t[_.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(_){return o(_)&&a(_)&&t[_.charCodeAt(0)].length>=3};var c=e.__arabicParser__.arabicLetterHasMedialForm=function(_){return o(_)&&a(_)&&t[_.charCodeAt(0)].length==4},m=e.__arabicParser__.resolveLigatures=function(_){var x=0,b=n,S="",k=0;for(x=0;x<_.length;x+=1)b[_.charCodeAt(x)]!==void 0?(k++,typeof(b=b[_.charCodeAt(x)])=="number"&&(S+=String.fromCharCode(b),b=n,k=0),x===_.length-1&&(b=n,S+=_.charAt(x-(k-1)),x-=k-1,k=0)):(b=n,S+=_.charAt(x-k),x-=k,k=0);return S};e.__arabicParser__.isArabicDiacritic=function(_){return _!==void 0&&r[_.charCodeAt(0)]!==void 0};var g=e.__arabicParser__.getCorrectForm=function(_,x,b){return o(_)?a(_)===!1?-1:!h(_)||!o(x)&&!o(b)||!o(b)&&s(x)||s(_)&&!o(x)||s(_)&&u(x)||s(_)&&s(x)?0:c(_)&&o(x)&&!s(x)&&o(b)&&h(b)?3:s(_)||!o(b)?1:2:-1},d=function(_){var x=0,b=0,S=0,k="",E="",A="",R=(_=_||"").split("\\s+"),O=[];for(x=0;x<R.length;x+=1){for(O.push(""),b=0;b<R[x].length;b+=1)k=R[x][b],E=R[x][b-1],A=R[x][b+1],o(k)?(S=g(k,E,A),O[x]+=S!==-1?String.fromCharCode(t[k.charCodeAt(0)][S]):k):O[x]+=k;O[x]=m(O[x])}return O.join(" ")},y=e.__arabicParser__.processArabic=e.processArabic=function(){var _,x=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,b=[];if(Array.isArray(x)){var S=0;for(b=[],S=0;S<x.length;S+=1)Array.isArray(x[S])?b.push([d(x[S][0]),x[S][1],x[S][2]]):b.push([d(x[S])]);_=b}else _=d(x);return typeof arguments[0]=="string"?_:(arguments[0].text=_,arguments[0])};e.events.push(["preProcessText",y])})(sn.API),sn.API.autoPrint=function(e){var t;return(e=e||{}).variant=e.variant||"non-conform",e.variant==="javascript"?this.addJS("print({});"):(this.internal.events.subscribe("postPutResources",function(){t=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 "+t+" 0 R")})),this},(function(e){var t=function(){var n=void 0;Object.defineProperty(this,"pdf",{get:function(){return n},set:function(s){n=s}});var r=150;Object.defineProperty(this,"width",{get:function(){return r},set:function(s){r=isNaN(s)||Number.isInteger(s)===!1||s<0?150:s,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=r+1)}});var i=300;Object.defineProperty(this,"height",{get:function(){return i},set:function(s){i=isNaN(s)||Number.isInteger(s)===!1||s<0?300:s,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=i+1)}});var a=[];Object.defineProperty(this,"childNodes",{get:function(){return a},set:function(s){a=s}});var o={};Object.defineProperty(this,"style",{get:function(){return o},set:function(s){o=s}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(n,r){var i;if((n=n||"2d")!=="2d")return null;for(i in r)this.pdf.context2d.hasOwnProperty(i)&&(this.pdf.context2d[i]=r[i]);return this.pdf.context2d._canvas=this,this.pdf.context2d},t.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new t,this.canvas.pdf=this}])})(sn.API),(function(e){var t={left:0,top:0,bottom:0,right:0},n=!1,r=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({},t),this.internal.__cell__.margins.width=this.getPageWidth(),i.call(this))},i=function(){this.internal.__cell__.lastCell=new a,this.internal.__cell__.pages=1},a=function(){var u=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return u},set:function(_){u=_}});var h=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return h},set:function(_){h=_}});var c=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return c},set:function(_){c=_}});var m=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return m},set:function(_){m=_}});var g=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return g},set:function(_){g=_}});var d=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return d},set:function(_){d=_}});var y=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return y},set:function(_){y=_}}),this};a.prototype.clone=function(){return new a(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},a.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(u){return r.call(this),this.internal.__cell__.headerFunction=typeof u=="function"?u:void 0,this},e.getTextDimensions=function(u,h){r.call(this);var c=(h=h||{}).fontSize||this.getFontSize(),m=h.font||this.getFont(),g=h.scaleFactor||this.internal.scaleFactor,d=0,y=0,_=0,x=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 b=h.maxWidth;b>0?typeof u=="string"?u=this.splitTextToSize(u,b):Object.prototype.toString.call(u)==="[object Array]"&&(u=u.reduce(function(k,E){return k.concat(x.splitTextToSize(E,b))},[])):u=Array.isArray(u)?u:[u];for(var S=0;S<u.length;S++)d<(_=this.getStringUnitWidth(u[S],{font:m})*c)&&(d=_);return d!==0&&(y=u.length),{w:d/=g,h:Math.max((y*c*this.getLineHeightFactor()-c*(this.getLineHeightFactor()-1))/g,0)}},e.cellAddPage=function(){r.call(this),this.addPage();var u=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new a(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 a?arguments[0]:new a(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]),r.call(this);var h=this.internal.__cell__.lastCell,c=this.internal.__cell__.padding,m=this.internal.__cell__.margins||t,g=this.internal.__cell__.tableHeaderRow,d=this.internal.__cell__.printHeaders;return h.lineNumber!==void 0&&(h.lineNumber===u.lineNumber?(u.x=(h.x||0)+(h.width||0),u.y=h.y||0):h.y+h.height+u.height+m.bottom>this.getPageHeight()?(this.cellAddPage(),u.y=m.top,d&&g&&(this.printHeaderRow(u.lineNumber,!0),u.y+=g[0].height)):u.y=h.y+h.height||u.y),u.text[0]!==void 0&&(this.rect(u.x,u.y,u.width,u.height,n===!0?"FD":void 0),u.align==="right"?this.text(u.text,u.x+u.width-c,u.y+c,{align:"right",baseline:"top"}):u.align==="center"?this.text(u.text,u.x+u.width/2,u.y+c,{align:"center",baseline:"top",maxWidth:u.width-c-c}):this.text(u.text,u.x+c,u.y+c,{align:"left",baseline:"top",maxWidth:u.width-c-c})),this.internal.__cell__.lastCell=u,this};e.table=function(u,h,c,m,g){if(r.call(this),!c)throw new Error("No data for PDF table.");var d,y,_,x,b=[],S=[],k=[],E={},A={},R=[],O=[],I=(g=g||{}).autoSize||!1,j=g.printHeaders!==!1,D=g.css&&g.css["font-size"]!==void 0?16*g.css["font-size"]:g.fontSize||12,C=g.margins||Object.assign({width:this.getPageWidth()},t),N=typeof g.padding=="number"?g.padding:3,$=g.headerBackgroundColor||"#c8c8c8",G=g.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=j,this.internal.__cell__.margins=C,this.internal.__cell__.table_font_size=D,this.internal.__cell__.padding=N,this.internal.__cell__.headerBackgroundColor=$,this.internal.__cell__.headerTextColor=G,this.setFontSize(D),m==null)S=b=Object.keys(c[0]),k=b.map(function(){return"left"});else if(Array.isArray(m)&&jr(m[0])==="object")for(b=m.map(function(X){return X.name}),S=m.map(function(X){return X.prompt||X.name||""}),k=m.map(function(X){return X.align||"left"}),d=0;d<m.length;d+=1)A[m[d].name]=.7499990551181103*m[d].width;else Array.isArray(m)&&typeof m[0]=="string"&&(S=b=m,k=b.map(function(){return"left"}));if(I||Array.isArray(m)&&typeof m[0]=="string")for(d=0;d<b.length;d+=1){for(E[x=b[d]]=c.map(function(X){return X[x]}),this.setFont(void 0,"bold"),R.push(this.getTextDimensions(S[d],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),y=E[x],this.setFont(void 0,"normal"),_=0;_<y.length;_+=1)R.push(this.getTextDimensions(y[_],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);A[x]=Math.max.apply(null,R)+N+N,R=[]}if(j){var te={};for(d=0;d<b.length;d+=1)te[b[d]]={},te[b[d]].text=S[d],te[b[d]].align=k[d];var se=s.call(this,te,A);O=b.map(function(X){return new a(u,h,A[X],se,te[X].text,void 0,te[X].align)}),this.setTableHeaderRow(O),this.printHeaderRow(1,!1)}var ee=m.reduce(function(X,B){return X[B.name]=B.align,X},{});for(d=0;d<c.length;d+=1){"rowStart"in g&&g.rowStart instanceof Function&&g.rowStart({row:d,data:c[d]},this);var Q=s.call(this,c[d],A);for(_=0;_<b.length;_+=1){var re=c[d][b[_]];"cellStart"in g&&g.cellStart instanceof Function&&g.cellStart({row:d,col:_,data:re},this),o.call(this,new a(u,h,A[b[_]],Q,re,d+2,ee[b[_]]))}}return this.internal.__cell__.table_x=u,this.internal.__cell__.table_y=h,this};var s=function(u,h){var c=this.internal.__cell__.padding,m=this.internal.__cell__.table_font_size,g=this.internal.scaleFactor;return Object.keys(u).map(function(d){var y=u[d];return this.splitTextToSize(y.hasOwnProperty("text")?y.text:y,h[d]-c-c)},this).map(function(d){return this.getLineHeightFactor()*d.length*m/g+c+c},this).reduce(function(d,y){return Math.max(d,y)},0)};e.setTableHeaderRow=function(u){r.call(this),this.internal.__cell__.tableHeaderRow=u},e.printHeaderRow=function(u,h){if(r.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var c;if(n=!0,typeof this.internal.__cell__.headerFunction=="function"){var m=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new a(m[0],m[1],m[2],m[3],void 0,-1)}this.setFont(void 0,"bold");for(var g=[],d=0;d<this.internal.__cell__.tableHeaderRow.length;d+=1){c=this.internal.__cell__.tableHeaderRow[d].clone(),h&&(c.y=this.internal.__cell__.margins.top||0,g.push(c)),c.lineNumber=u;var y=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),o.call(this,c),this.setTextColor(y)}g.length>0&&this.setTableHeaderRow(g),this.setFont(void 0,"normal"),n=!1}})(sn.API);var m_={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},v_=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],Uv=g_(v_),y_=[100,200,300,400,500,600,700,800,900],cj=g_(y_);function Wm(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),n=(function(a){return m_[a=a||"normal"]?a:"normal"})(e.style),r=(function(a){return a?typeof a=="number"?a>=100&&a<=900&&a%100==0?a:400:/^\d00$/.test(a)?parseInt(a):a==="bold"?700:400:400})(e.weight),i=(function(a){return typeof Uv[a=a||"normal"]=="number"?a:"normal"})(e.stretch);return{family:t,style:n,weight:r,stretch:i,src:e.src||[],ref:e.ref||{name:t,style:[i,n,r].join(" ")}}}function Bw(e,t,n,r){var i;for(i=n;i>=0&&i<t.length;i+=r)if(e[t[i]])return e[t[i]];for(i=n;i>=0&&i<t.length;i-=r)if(e[t[i]])return e[t[i]]}var fj={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},zw={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function Uw(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function qw(e){return e.trimLeft()}function hj(e,t){for(var n=0;n<e.length;){if(e.charAt(n)===t)return[e.substring(0,n),e.substring(n+1)];n+=1}return null}function dj(e){var t=e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return t===null?null:[t[0],e.substring(t[0].length)]}var K1,$w,Hw,Qh,Z1,Gw,Ww,Vw,Vm=["times"];function Yw(e,t,n,r,i){var a=4,o=Kw;switch(i){case sn.API.image_compression.FAST:a=1,o=Xw;break;case sn.API.image_compression.MEDIUM:a=6,o=Zw;break;case sn.API.image_compression.SLOW:a=9,o=Qw}e=(function(u,h,c,m){for(var g,d=u.length/h,y=new Uint8Array(u.length+d),_=[pj,Xw,Kw,Zw,Qw],x=0;x<d;x+=1){var b=x*h,S=u.subarray(b,b+h);if(m)y.set(m(S,c,g),b+x);else{for(var k=_.length,E=[],A=0;A<k;A+=1)E[A]=_[A](S,c,g);var R=mj(E.concat());y.set(E[R],b+x)}g=S}return y})(e,t,Math.ceil(n*r/8),o);var s=Mv(e,{level:a});return sn.API.__addimage__.arrayBufferToBinaryString(s)}function pj(e){var t=Array.apply([],e);return t.unshift(0),t}function Xw(e,t){var n=e.length,r=[];r[0]=1;for(var i=0;i<n;i+=1){var a=e[i-t]||0;r[i+1]=e[i]-a+256&255}return r}function Kw(e,t,n){var r=e.length,i=[];i[0]=2;for(var a=0;a<r;a+=1){var o=n&&n[a]||0;i[a+1]=e[a]-o+256&255}return i}function Zw(e,t,n){var r=e.length,i=[];i[0]=3;for(var a=0;a<r;a+=1){var o=e[a-t]||0,s=n&&n[a]||0;i[a+1]=e[a]+256-(o+s>>>1)&255}return i}function Qw(e,t,n){var r=e.length,i=[];i[0]=4;for(var a=0;a<r;a+=1){var o=gj(e[a-t]||0,n&&n[a]||0,n&&n[a-t]||0);i[a+1]=e[a]-o+256&255}return i}function gj(e,t,n){if(e===t&&t===n)return e;var r=Math.abs(t-n),i=Math.abs(e-n),a=Math.abs(e+t-n-n);return r<=i&&r<=a?e:i<=a?t:n}function mj(e){var t=e.map(function(n){return n.reduce(function(r,i){return r+Math.abs(i)},0)});return t.indexOf(Math.min.apply(null,t))}function Ym(e,t,n){var r=t*n,i=Math.floor(r/8),a=16-(r-8*i+n),o=(1<<n)-1;return b_(e,i)>>a&o}function Jw(e,t,n,r){var i=n*r,a=Math.floor(i/8),o=16-(i-8*a+r),s=(1<<r)-1,u=(t&s)<<o;(function(h,c,m){if(c+1<h.byteLength)h.setUint16(c,m,!1);else{var g=m>>8&255;h.setUint8(c,g)}})(e,a,b_(e,a)&~(s<<o)&65535|u)}function b_(e,t){return t+1<e.byteLength?e.getUint16(t,!1):e.getUint8(t)<<8}function vj(e){var t=0;if(e[t++]!==71||e[t++]!==73||e[t++]!==70||e[t++]!==56||(e[t++]+1&253)!=56||e[t++]!==97)throw new Error("Invalid GIF 87a/89a header.");var n=e[t++]|e[t++]<<8,r=e[t++]|e[t++]<<8,i=e[t++],a=i>>7,o=1<<1+(7&i);e[t++],e[t++];var s=null,u=null;a&&(s=t,u=o,t+=3*o);var h=!0,c=[],m=0,g=null,d=0,y=null;for(this.width=n,this.height=r;h&&t<e.length;)switch(e[t++]){case 33:switch(e[t++]){case 255:if(e[t]!==11||e[t+1]==78&&e[t+2]==69&&e[t+3]==84&&e[t+4]==83&&e[t+5]==67&&e[t+6]==65&&e[t+7]==80&&e[t+8]==69&&e[t+9]==50&&e[t+10]==46&&e[t+11]==48&&e[t+12]==3&&e[t+13]==1&&e[t+16]==0)t+=14,y=e[t++]|e[t++]<<8,t++;else for(t+=12;;){if(!((C=e[t++])>=0))throw Error("Invalid block size");if(C===0)break;t+=C}break;case 249:if(e[t++]!==4||e[t+4]!==0)throw new Error("Invalid graphics extension block.");var _=e[t++];m=e[t++]|e[t++]<<8,g=e[t++],1&_||(g=null),d=_>>2&7,t++;break;case 254:for(;;){if(!((C=e[t++])>=0))throw Error("Invalid block size");if(C===0)break;t+=C}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var x=e[t++]|e[t++]<<8,b=e[t++]|e[t++]<<8,S=e[t++]|e[t++]<<8,k=e[t++]|e[t++]<<8,E=e[t++],A=E>>6&1,R=1<<1+(7&E),O=s,I=u,j=!1;E>>7&&(j=!0,O=t,I=R,t+=3*R);var D=t;for(t++;;){var C;if(!((C=e[t++])>=0))throw Error("Invalid block size");if(C===0)break;t+=C}c.push({x,y:b,width:S,height:k,has_local_palette:j,palette_offset:O,palette_size:I,data_offset:D,data_length:t-D,transparent_index:g,interlaced:!!A,delay:m,disposal:d});break;case 59:h=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return c.length},this.loopCount=function(){return y},this.frameInfo=function(N){if(N<0||N>=c.length)throw new Error("Frame index out of range.");return c[N]},this.decodeAndBlitFrameBGRA=function(N,$){var G=this.frameInfo(N),te=G.width*G.height,se=new Uint8Array(te);e6(e,G.data_offset,se,te);var ee=G.palette_offset,Q=G.transparent_index;Q===null&&(Q=256);var re=G.width,X=n-re,B=re,F=4*(G.y*n+G.x),z=4*((G.y+G.height)*n+G.x),Y=F,J=4*X;G.interlaced===!0&&(J+=4*n*7);for(var K=8,ie=0,fe=se.length;ie<fe;++ie){var ue=se[ie];if(B===0&&(B=re,(Y+=J)>=z&&(J=4*X+4*n*(K-1),Y=F+(re+X)*(K<<1),K>>=1)),ue===Q)Y+=4;else{var _e=e[ee+3*ue],Ce=e[ee+3*ue+1],$e=e[ee+3*ue+2];$[Y++]=$e,$[Y++]=Ce,$[Y++]=_e,$[Y++]=255}--B}},this.decodeAndBlitFrameRGBA=function(N,$){var G=this.frameInfo(N),te=G.width*G.height,se=new Uint8Array(te);e6(e,G.data_offset,se,te);var ee=G.palette_offset,Q=G.transparent_index;Q===null&&(Q=256);var re=G.width,X=n-re,B=re,F=4*(G.y*n+G.x),z=4*((G.y+G.height)*n+G.x),Y=F,J=4*X;G.interlaced===!0&&(J+=4*n*7);for(var K=8,ie=0,fe=se.length;ie<fe;++ie){var ue=se[ie];if(B===0&&(B=re,(Y+=J)>=z&&(J=4*X+4*n*(K-1),Y=F+(re+X)*(K<<1),K>>=1)),ue===Q)Y+=4;else{var _e=e[ee+3*ue],Ce=e[ee+3*ue+1],$e=e[ee+3*ue+2];$[Y++]=_e,$[Y++]=Ce,$[Y++]=$e,$[Y++]=255}--B}}}function e6(e,t,n,r){for(var i=e[t++],a=1<<i,o=a+1,s=o+1,u=i+1,h=(1<<u)-1,c=0,m=0,g=0,d=e[t++],y=new Int32Array(4096),_=null;;){for(;c<16&&d!==0;)m|=e[t++]<<c,c+=8,d===1?d=e[t++]:--d;if(c<u)break;var x=m&h;if(m>>=u,c-=u,x!==a){if(x===o)break;for(var b=x<s?x:_,S=0,k=b;k>a;)k=y[k]>>8,++S;var E=k;if(g+S+(b!==x?1:0)>r)return void Zr.log("Warning, gif stream longer than expected.");n[g++]=E;var A=g+=S;for(b!==x&&(n[g++]=E),k=b;S--;)k=y[k],n[--A]=255&k,k>>=8;_!==null&&s<4096&&(y[s++]=_<<8|E,s>=h+1&&u<12&&(++u,h=h<<1|1)),_=x}else s=o+1,h=(1<<(u=i+1))-1,_=null}return g!==r&&Zr.log("Warning, gif stream shorter than expected."),n}function Xm(e){var t,n,r,i,a,o=Math.floor,s=new Array(64),u=new Array(64),h=new Array(64),c=new Array(64),m=new Array(65535),g=new Array(65535),d=new Array(64),y=new Array(64),_=[],x=0,b=7,S=new Array(64),k=new Array(64),E=new Array(64),A=new Array(256),R=new Array(2048),O=[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],I=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],j=[0,1,2,3,4,5,6,7,8,9,10,11],D=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],C=[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],N=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],$=[0,1,2,3,4,5,6,7,8,9,10,11],G=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],te=[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 se(F,z){for(var Y=0,J=0,K=new Array,ie=1;ie<=16;ie++){for(var fe=1;fe<=F[ie];fe++)K[z[J]]=[],K[z[J]][0]=Y,K[z[J]][1]=ie,J++,Y++;Y*=2}return K}function ee(F){for(var z=F[0],Y=F[1]-1;Y>=0;)z&1<<Y&&(x|=1<<b),Y--,--b<0&&(x==255?(Q(255),Q(0)):Q(x),b=7,x=0)}function Q(F){_.push(F)}function re(F){Q(F>>8&255),Q(255&F)}function X(F,z,Y,J,K){for(var ie,fe=K[0],ue=K[240],_e=(function(xe,Te){var Me,ve,ye,we,je,Le,Ye,lt,rt,ot,dt=0;for(rt=0;rt<8;++rt){Me=xe[dt],ve=xe[dt+1],ye=xe[dt+2],we=xe[dt+3],je=xe[dt+4],Le=xe[dt+5],Ye=xe[dt+6];var Ct=Me+(lt=xe[dt+7]),Zt=Me-lt,on=ve+Ye,an=ve-Ye,We=ye+Le,Be=ye-Le,$t=we+je,At=we-je,Lt=Ct+$t,Tt=Ct-$t,tn=on+We,Wt=on-We;xe[dt]=Lt+tn,xe[dt+4]=Lt-tn;var hn=.707106781*(Wt+Tt);xe[dt+2]=Tt+hn,xe[dt+6]=Tt-hn;var bi=.382683433*((Lt=At+Be)-(Wt=an+Zt)),nr=.5411961*Lt+bi,ei=1.306562965*Wt+bi,dr=.707106781*(tn=Be+an),Jt=Zt+dr,ua=Zt-dr;xe[dt+5]=ua+nr,xe[dt+3]=ua-nr,xe[dt+1]=Jt+ei,xe[dt+7]=Jt-ei,dt+=8}for(dt=0,rt=0;rt<8;++rt){Me=xe[dt],ve=xe[dt+8],ye=xe[dt+16],we=xe[dt+24],je=xe[dt+32],Le=xe[dt+40],Ye=xe[dt+48];var Fa=Me+(lt=xe[dt+56]),ti=Me-lt,Ki=ve+Ye,Hn=ve-Ye,Or=ye+Le,Dr=ye-Le,Ea=we+je,Go=we-je,ka=Fa+Ea,io=Fa-Ea,ui=Ki+Or,Aa=Ki-Or;xe[dt]=ka+ui,xe[dt+32]=ka-ui;var Pa=.707106781*(Aa+io);xe[dt+16]=io+Pa,xe[dt+48]=io-Pa;var Wo=.382683433*((ka=Go+Dr)-(Aa=Hn+ti)),zi=.5411961*ka+Wo,ao=1.306562965*Aa+Wo,Fs=.707106781*(ui=Dr+Hn),as=ti+Fs,fu=ti-Fs;xe[dt+40]=fu+zi,xe[dt+24]=fu-zi,xe[dt+8]=as+ao,xe[dt+56]=as-ao,dt++}for(rt=0;rt<64;++rt)ot=xe[rt]*Te[rt],d[rt]=ot>0?ot+.5|0:ot-.5|0;return d})(F,z),Ce=0;Ce<64;++Ce)y[O[Ce]]=_e[Ce];var $e=y[0]-Y;Y=y[0],$e==0?ee(J[0]):(ee(J[g[ie=32767+$e]]),ee(m[ie]));for(var ze=63;ze>0&&y[ze]==0;)ze--;if(ze==0)return ee(fe),Y;for(var tt,pe=1;pe<=ze;){for(var ut=pe;y[pe]==0&&pe<=ze;)++pe;var be=pe-ut;if(be>=16){tt=be>>4;for(var ge=1;ge<=tt;++ge)ee(ue);be&=15}ie=32767+y[pe],ee(K[(be<<4)+g[ie]]),ee(m[ie]),pe++}return ze!=63&&ee(fe),Y}function B(F){F=Math.min(Math.max(F,1),100),a!=F&&((function(z){for(var Y=[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],J=0;J<64;J++){var K=o((Y[J]*z+50)/100);K=Math.min(Math.max(K,1),255),s[O[J]]=K}for(var ie=[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],fe=0;fe<64;fe++){var ue=o((ie[fe]*z+50)/100);ue=Math.min(Math.max(ue,1),255),u[O[fe]]=ue}for(var _e=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Ce=0,$e=0;$e<8;$e++)for(var ze=0;ze<8;ze++)h[Ce]=1/(s[O[Ce]]*_e[$e]*_e[ze]*8),c[Ce]=1/(u[O[Ce]]*_e[$e]*_e[ze]*8),Ce++})(F<50?Math.floor(5e3/F):Math.floor(200-2*F)),a=F)}this.encode=function(F,z){z&&B(z),_=new Array,x=0,b=7,re(65496),re(65504),re(16),Q(74),Q(70),Q(73),Q(70),Q(0),Q(1),Q(1),Q(0),re(1),re(1),Q(0),Q(0),(function(){re(65499),re(132),Q(0);for(var ve=0;ve<64;ve++)Q(s[ve]);Q(1);for(var ye=0;ye<64;ye++)Q(u[ye])})(),(function(ve,ye){re(65472),re(17),Q(8),re(ye),re(ve),Q(3),Q(1),Q(17),Q(0),Q(2),Q(17),Q(1),Q(3),Q(17),Q(1)})(F.width,F.height),(function(){re(65476),re(418),Q(0);for(var ve=0;ve<16;ve++)Q(I[ve+1]);for(var ye=0;ye<=11;ye++)Q(j[ye]);Q(16);for(var we=0;we<16;we++)Q(D[we+1]);for(var je=0;je<=161;je++)Q(C[je]);Q(1);for(var Le=0;Le<16;Le++)Q(N[Le+1]);for(var Ye=0;Ye<=11;Ye++)Q($[Ye]);Q(17);for(var lt=0;lt<16;lt++)Q(G[lt+1]);for(var rt=0;rt<=161;rt++)Q(te[rt])})(),re(65498),re(12),Q(3),Q(1),Q(0),Q(2),Q(17),Q(3),Q(17),Q(0),Q(63),Q(0);var Y=0,J=0,K=0;x=0,b=7,this.encode.displayName="_encode_";for(var ie,fe,ue,_e,Ce,$e,ze,tt,pe,ut=F.data,be=F.width,ge=F.height,xe=4*be,Te=0;Te<ge;){for(ie=0;ie<xe;){for(Ce=xe*Te+ie,ze=-1,tt=0,pe=0;pe<64;pe++)$e=Ce+(tt=pe>>3)*xe+(ze=4*(7&pe)),Te+tt>=ge&&($e-=xe*(Te+1+tt-ge)),ie+ze>=xe&&($e-=ie+ze-xe+4),fe=ut[$e++],ue=ut[$e++],_e=ut[$e++],S[pe]=(R[fe]+R[ue+256|0]+R[_e+512|0]>>16)-128,k[pe]=(R[fe+768|0]+R[ue+1024|0]+R[_e+1280|0]>>16)-128,E[pe]=(R[fe+1280|0]+R[ue+1536|0]+R[_e+1792|0]>>16)-128;Y=X(S,h,Y,t,r),J=X(k,c,J,n,i),K=X(E,c,K,n,i),ie+=32}Te+=8}if(b>=0){var Me=[];Me[1]=b+1,Me[0]=(1<<b+1)-1,ee(Me)}return re(65497),new Uint8Array(_)},e=e||50,(function(){for(var F=String.fromCharCode,z=0;z<256;z++)A[z]=F(z)})(),t=se(I,j),n=se(N,$),r=se(D,C),i=se(G,te),(function(){for(var F=1,z=2,Y=1;Y<=15;Y++){for(var J=F;J<z;J++)g[32767+J]=Y,m[32767+J]=[],m[32767+J][1]=Y,m[32767+J][0]=J;for(var K=-(z-1);K<=-F;K++)g[32767+K]=Y,m[32767+K]=[],m[32767+K][1]=Y,m[32767+K][0]=z-1+K;F<<=1,z<<=1}})(),(function(){for(var F=0;F<256;F++)R[F]=19595*F,R[F+256|0]=38470*F,R[F+512|0]=7471*F+32768,R[F+768|0]=-11059*F,R[F+1024|0]=-21709*F,R[F+1280|0]=32768*F+8421375,R[F+1536|0]=-27439*F,R[F+1792|0]=-5329*F})(),B(e)}function Jl(e,t){if(this.pos=0,this.buffer=e,this.datav=new DataView(e.buffer),this.is_with_alpha=!!t,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 t6(e){function t(j){if(!j)throw Error("assert :P")}function n(j,D,C){for(var N=0;4>N;N++)if(j[D+N]!=C.charCodeAt(N))return!0;return!1}function r(j,D,C,N,$){for(var G=0;G<$;G++)j[D+G]=C[N+G]}function i(j,D,C,N){for(var $=0;$<N;$++)j[D+$]=C}function a(j){return new Int32Array(j)}function o(j,D){for(var C=[],N=0;N<j;N++)C.push(new D);return C}function s(j,D){var C=[];return(function N($,G,te){for(var se=te[G],ee=0;ee<se&&($.push(te.length>G+1?[]:new D),!(te.length<G+1));ee++)N($[ee],G+1,te)})(C,0,j),C}var u=function(){var j=this;function D(P,M){for(var V=1<<M-1>>>0;P&V;)V>>>=1;return V?(P&V-1)+V:P}function C(P,M,V,ne,le){t(!(ne%V));do P[M+(ne-=V)]=le;while(0<ne)}function N(P,M,V,ne,le){if(t(2328>=le),512>=le)var de=a(512);else if((de=a(le))==null)return 0;return(function(me,Se,Ee,Pe,De,Je){var Ae,qe,Qe=Se,ht=1<<Ee,Xe=a(16),ct=a(16);for(t(De!=0),t(Pe!=null),t(me!=null),t(0<Ee),qe=0;qe<De;++qe){if(15<Pe[qe])return 0;++Xe[Pe[qe]]}if(Xe[0]==De)return 0;for(ct[1]=0,Ae=1;15>Ae;++Ae){if(Xe[Ae]>1<<Ae)return 0;ct[Ae+1]=ct[Ae]+Xe[Ae]}for(qe=0;qe<De;++qe)Ae=Pe[qe],0<Pe[qe]&&(Je[ct[Ae]++]=qe);if(ct[15]==1)return(Pe=new $).g=0,Pe.value=Je[0],C(me,Qe,1,ht,Pe),ht;var Ue,mt=-1,vt=ht-1,Yt=0,zt=1,vn=1,Ut=1<<Ee;for(qe=0,Ae=1,De=2;Ae<=Ee;++Ae,De<<=1){if(zt+=vn<<=1,0>(vn-=Xe[Ae]))return 0;for(;0<Xe[Ae];--Xe[Ae])(Pe=new $).g=Ae,Pe.value=Je[qe++],C(me,Qe+Yt,De,Ut,Pe),Yt=D(Yt,Ae)}for(Ae=Ee+1,De=2;15>=Ae;++Ae,De<<=1){if(zt+=vn<<=1,0>(vn-=Xe[Ae]))return 0;for(;0<Xe[Ae];--Xe[Ae]){if(Pe=new $,(Yt&vt)!=mt){for(Qe+=Ut,Ue=1<<(mt=Ae)-Ee;15>mt&&!(0>=(Ue-=Xe[mt]));)++mt,Ue<<=1;ht+=Ut=1<<(Ue=mt-Ee),me[Se+(mt=Yt&vt)].g=Ue+Ee,me[Se+mt].value=Qe-Se-mt}Pe.g=Ae-Ee,Pe.value=Je[qe++],C(me,Qe+(Yt>>Ee),De,Ut,Pe),Yt=D(Yt,Ae)}}return zt!=2*ct[15]-1?0:ht})(P,M,V,ne,le,de)}function $(){this.value=this.g=0}function G(){this.value=this.g=0}function te(){this.G=o(5,$),this.H=a(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(Ni,G)}function se(P,M,V,ne){t(P!=null),t(M!=null),t(2147483648>ne),P.Ca=254,P.I=0,P.b=-8,P.Ka=0,P.oa=M,P.pa=V,P.Jd=M,P.Yc=V+ne,P.Zc=4<=ne?V+ne-4+1:V,fe(P)}function ee(P,M){for(var V=0;0<M--;)V|=_e(P,128)<<M;return V}function Q(P,M){var V=ee(P,M);return ue(P)?-V:V}function re(P,M,V,ne){var le,de=0;for(t(P!=null),t(M!=null),t(4294967288>ne),P.Sb=ne,P.Ra=0,P.u=0,P.h=0,4<ne&&(ne=4),le=0;le<ne;++le)de+=M[V+le]<<8*le;P.Ra=de,P.bb=ne,P.oa=M,P.pa=V}function X(P){for(;8<=P.u&&P.bb<P.Sb;)P.Ra>>>=8,P.Ra+=P.oa[P.pa+P.bb]<<da-8>>>0,++P.bb,P.u-=8;J(P)&&(P.h=1,P.u=0)}function B(P,M){if(t(0<=M),!P.h&&M<=Ka){var V=Y(P)&Na[M];return P.u+=M,X(P),V}return P.h=1,P.u=0}function F(){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 Y(P){return P.Ra>>>(P.u&da-1)>>>0}function J(P){return t(P.bb<=P.Sb),P.h||P.bb==P.Sb&&P.u>da}function K(P,M){P.u=M,P.h=J(P)}function ie(P){P.u>=Zi&&(t(P.u>=Zi),X(P))}function fe(P){t(P!=null&&P.oa!=null),P.pa<P.Zc?(P.I=(P.oa[P.pa++]|P.I<<8)>>>0,P.b+=8):(t(P!=null&&P.oa!=null),P.pa<P.Yc?(P.b+=8,P.I=P.oa[P.pa++]|P.I<<8):P.Ka?P.b=0:(P.I<<=8,P.b+=8,P.Ka=1))}function ue(P){return ee(P,1)}function _e(P,M){var V=P.Ca;0>P.b&&fe(P);var ne=P.b,le=V*M>>>8,de=(P.I>>>ne>le)+0;for(de?(V-=le,P.I-=le+1<<ne>>>0):V=le+1,ne=V,le=0;256<=ne;)le+=8,ne>>=8;return ne=7^le+To[ne],P.b-=ne,P.Ca=(V<<ne)-1,de}function Ce(P,M,V){P[M+0]=V>>24&255,P[M+1]=V>>16&255,P[M+2]=V>>8&255,P[M+3]=255&V}function $e(P,M){return P[M+0]|P[M+1]<<8}function ze(P,M){return $e(P,M)|P[M+2]<<16}function tt(P,M){return $e(P,M)|$e(P,M+2)<<16}function pe(P,M){var V=1<<M;return t(P!=null),t(0<M),P.X=a(V),P.X==null?0:(P.Mb=32-M,P.Xa=M,1)}function ut(P,M){t(P!=null),t(M!=null),t(P.Xa==M.Xa),r(M.X,0,P.X,0,1<<M.Xa)}function be(){this.X=[],this.Xa=this.Mb=0}function ge(P,M,V,ne){t(V!=null),t(ne!=null);var le=V[0],de=ne[0];return le==0&&(le=(P*de+M/2)/M),de==0&&(de=(M*le+P/2)/P),0>=le||0>=de?0:(V[0]=le,ne[0]=de,1)}function xe(P,M){return P+(1<<M)-1>>>M}function Te(P,M){return((4278255360&P)+(4278255360&M)>>>0&4278255360)+((16711935&P)+(16711935&M)>>>0&16711935)>>>0}function Me(P,M){j[M]=function(V,ne,le,de,me,Se,Ee){var Pe;for(Pe=0;Pe<me;++Pe){var De=j[P](Se[Ee+Pe-1],le,de+Pe);Se[Ee+Pe]=Te(V[ne+Pe],De)}}}function ve(){this.ud=this.hd=this.jd=0}function ye(P,M){return((4278124286&(P^M))>>>1)+(P&M)>>>0}function we(P){return 0<=P&&256>P?P:0>P?0:255<P?255:void 0}function je(P,M){return we(P+(P-M+.5>>1))}function Le(P,M,V){return Math.abs(M-V)-Math.abs(P-V)}function Ye(P,M,V,ne,le,de,me){for(ne=de[me-1],V=0;V<le;++V)de[me+V]=ne=Te(P[M+V],ne)}function lt(P,M,V,ne,le){var de;for(de=0;de<V;++de){var me=P[M+de],Se=me>>8&255,Ee=16711935&(Ee=(Ee=16711935&me)+((Se<<16)+Se));ne[le+de]=(4278255360&me)+Ee>>>0}}function rt(P,M){M.jd=255&P,M.hd=P>>8&255,M.ud=P>>16&255}function ot(P,M,V,ne,le,de){var me;for(me=0;me<ne;++me){var Se=M[V+me],Ee=Se>>>8,Pe=Se,De=255&(De=(De=Se>>>16)+((P.jd<<24>>24)*(Ee<<24>>24)>>>5));Pe=255&(Pe=(Pe+=(P.hd<<24>>24)*(Ee<<24>>24)>>>5)+((P.ud<<24>>24)*(De<<24>>24)>>>5)),le[de+me]=(4278255360&Se)+(De<<16)+Pe}}function dt(P,M,V,ne,le){j[M]=function(de,me,Se,Ee,Pe,De,Je,Ae,qe){for(Ee=Je;Ee<Ae;++Ee)for(Je=0;Je<qe;++Je)Pe[De++]=le(Se[ne(de[me++])])},j[P]=function(de,me,Se,Ee,Pe,De,Je){var Ae=8>>de.b,qe=de.Ea,Qe=de.K[0],ht=de.w;if(8>Ae)for(de=(1<<de.b)-1,ht=(1<<Ae)-1;me<Se;++me){var Xe,ct=0;for(Xe=0;Xe<qe;++Xe)Xe&de||(ct=ne(Ee[Pe++])),De[Je++]=le(Qe[ct&ht]),ct>>=Ae}else j["VP8LMapColor"+V](Ee,Pe,Qe,ht,De,Je,me,Se,qe)}}function Ct(P,M,V,ne,le){for(V=M+V;M<V;){var de=P[M++];ne[le++]=de>>16&255,ne[le++]=de>>8&255,ne[le++]=255&de}}function Zt(P,M,V,ne,le){for(V=M+V;M<V;){var de=P[M++];ne[le++]=de>>16&255,ne[le++]=de>>8&255,ne[le++]=255&de,ne[le++]=de>>24&255}}function on(P,M,V,ne,le){for(V=M+V;M<V;){var de=(me=P[M++])>>16&240|me>>12&15,me=240&me|me>>28&15;ne[le++]=de,ne[le++]=me}}function an(P,M,V,ne,le){for(V=M+V;M<V;){var de=(me=P[M++])>>16&248|me>>13&7,me=me>>5&224|me>>3&31;ne[le++]=de,ne[le++]=me}}function We(P,M,V,ne,le){for(V=M+V;M<V;){var de=P[M++];ne[le++]=255&de,ne[le++]=de>>8&255,ne[le++]=de>>16&255}}function Be(P,M,V,ne,le,de){if(de==0)for(V=M+V;M<V;)Ce(ne,((de=P[M++])[0]>>24|de[1]>>8&65280|de[2]<<8&16711680|de[3]<<24)>>>0),le+=32;else r(ne,le,P,M,V)}function $t(P,M){j[M][0]=j[P+"0"],j[M][1]=j[P+"1"],j[M][2]=j[P+"2"],j[M][3]=j[P+"3"],j[M][4]=j[P+"4"],j[M][5]=j[P+"5"],j[M][6]=j[P+"6"],j[M][7]=j[P+"7"],j[M][8]=j[P+"8"],j[M][9]=j[P+"9"],j[M][10]=j[P+"10"],j[M][11]=j[P+"11"],j[M][12]=j[P+"12"],j[M][13]=j[P+"13"],j[M][14]=j[P+"0"],j[M][15]=j[P+"0"]}function At(P){return P==$l||P==Ks||P==wu||P==xu}function Lt(){this.eb=[],this.size=this.A=this.fb=0}function Tt(){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 tn(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Lt,this.f.kb=new Tt,this.sd=null}function Wt(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function hn(){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 bi(P){return alert("todo:WebPSamplerProcessPlane"),P.T}function nr(P,M){var V=P.T,ne=M.ba.f.RGBA,le=ne.eb,de=ne.fb+P.ka*ne.A,me=Ra[M.ba.S],Se=P.y,Ee=P.O,Pe=P.f,De=P.N,Je=P.ea,Ae=P.W,qe=M.cc,Qe=M.dc,ht=M.Mc,Xe=M.Nc,ct=P.ka,Ue=P.ka+P.T,mt=P.U,vt=mt+1>>1;for(ct==0?me(Se,Ee,null,null,Pe,De,Je,Ae,Pe,De,Je,Ae,le,de,null,null,mt):(me(M.ec,M.fc,Se,Ee,qe,Qe,ht,Xe,Pe,De,Je,Ae,le,de-ne.A,le,de,mt),++V);ct+2<Ue;ct+=2)qe=Pe,Qe=De,ht=Je,Xe=Ae,De+=P.Rc,Ae+=P.Rc,de+=2*ne.A,me(Se,(Ee+=2*P.fa)-P.fa,Se,Ee,qe,Qe,ht,Xe,Pe,De,Je,Ae,le,de-ne.A,le,de,mt);return Ee+=P.fa,P.j+Ue<P.o?(r(M.ec,M.fc,Se,Ee,mt),r(M.cc,M.dc,Pe,De,vt),r(M.Mc,M.Nc,Je,Ae,vt),V--):1&Ue||me(Se,Ee,null,null,Pe,De,Je,Ae,Pe,De,Je,Ae,le,de+ne.A,null,null,mt),V}function ei(P,M,V){var ne=P.F,le=[P.J];if(ne!=null){var de=P.U,me=M.ba.S,Se=me==bu||me==wu;M=M.ba.f.RGBA;var Ee=[0],Pe=P.ka;Ee[0]=P.T,P.Kb&&(Pe==0?--Ee[0]:(--Pe,le[0]-=P.width),P.j+P.ka+P.T==P.o&&(Ee[0]=P.o-P.j-Pe));var De=M.eb;Pe=M.fb+Pe*M.A,P=Bl(ne,le[0],P.width,de,Ee,De,Pe+(Se?0:3),M.A),t(V==Ee),P&&At(me)&&Ko(De,Pe,Se,de,Ee,M.A)}return 0}function dr(P){var M=P.ma,V=M.ba.S,ne=11>V,le=V==Qo||V==ql||V==bu||V==gr||V==12||At(V);if(M.memory=null,M.Ib=null,M.Jb=null,M.Nd=null,!yl(M.Oa,P,le?11:12))return 0;if(le&&At(V)&&Vo(),P.da)alert("todo:use_scaling");else{if(ne){if(M.Ib=bi,P.Kb){if(V=P.U+1>>1,M.memory=a(P.U+2*V),M.memory==null)return 0;M.ec=M.memory,M.fc=0,M.cc=M.ec,M.dc=M.fc+P.U,M.Mc=M.cc,M.Nc=M.dc+V,M.Ib=nr,Vo()}}else alert("todo:EmitYUV");le&&(M.Jb=ei,ne&&Ya())}if(ne&&!Gi){for(P=0;256>P;++P)va[P]=89858*(P-128)+Io>>bs,ya[P]=-22014*(P-128)+Io,Gl[P]=-45773*(P-128),_l[P]=113618*(P-128)+Io>>bs;for(P=ir;P<ur;++P)M=76283*(P-16)+Io>>bs,ku[P-ir]=wn(M,255),Bf[P-ir]=wn(M+8>>4,15);Gi=1}return 1}function Jt(P){var M=P.ma,V=P.U,ne=P.T;return t(!(1&P.ka)),0>=V||0>=ne?0:(V=M.Ib(P,M),M.Jb!=null&&M.Jb(P,M,V),M.Dc+=V,1)}function ua(P){P.ma.memory=null}function Fa(P,M,V,ne){return B(P,8)!=47?0:(M[0]=B(P,14)+1,V[0]=B(P,14)+1,ne[0]=B(P,1),B(P,3)!=0?0:!P.h)}function ti(P,M){if(4>P)return P+1;var V=P-2>>1;return(2+(1&P)<<V)+B(M,V)+1}function Ki(P,M){return 120<M?M-120:1<=(V=((V=Th[M-1])>>4)*P+(8-(15&V)))?V:1;var V}function Hn(P,M,V){var ne=Y(V),le=P[M+=255&ne].g-8;return 0<le&&(K(V,V.u+8),ne=Y(V),M+=P[M].value,M+=ne&(1<<le)-1),K(V,V.u+P[M].g),P[M].value}function Or(P,M,V){return V.g+=P.g,V.value+=P.value<<M>>>0,t(8>=V.g),P.g}function Dr(P,M,V){var ne=P.xc;return t((M=ne==0?0:P.vc[P.md*(V>>ne)+(M>>ne)])<P.Wb),P.Ya[M]}function Ea(P,M,V,ne){var le=P.ab,de=P.c*M,me=P.C;M=me+M;var Se=V,Ee=ne;for(ne=P.Ta,V=P.Ua;0<le--;){var Pe=P.gc[le],De=me,Je=M,Ae=Se,qe=Ee,Qe=(Ee=ne,Se=V,Pe.Ea);switch(t(De<Je),t(Je<=Pe.nc),Pe.hc){case 2:ri(Ae,qe,(Je-De)*Qe,Ee,Se);break;case 0:var ht=De,Xe=Je,ct=Ee,Ue=Se,mt=(Ut=Pe).Ea;ht==0&&(ds(Ae,qe,null,null,1,ct,Ue),Ye(Ae,qe+1,0,0,mt-1,ct,Ue+1),qe+=mt,Ue+=mt,++ht);for(var vt=1<<Ut.b,Yt=vt-1,zt=xe(mt,Ut.b),vn=Ut.K,Ut=Ut.w+(ht>>Ut.b)*zt;ht<Xe;){var Nn=vn,Hr=Ut,_n=1;for(go(Ae,qe,ct,Ue-mt,1,ct,Ue);_n<mt;){var Bt=(_n&~Yt)+vt;Bt>mt&&(Bt=mt),(0,pa[Nn[Hr++]>>8&15])(Ae,qe+ +_n,ct,Ue+_n-mt,Bt-_n,ct,Ue+_n),_n=Bt}qe+=mt,Ue+=mt,++ht&Yt||(Ut+=zt)}Je!=Pe.nc&&r(Ee,Se-Qe,Ee,Se+(Je-De-1)*Qe,Qe);break;case 1:for(Qe=Ae,Xe=qe,mt=(Ae=Pe.Ea)-(Ue=Ae&~(ct=(qe=1<<Pe.b)-1)),ht=xe(Ae,Pe.b),vt=Pe.K,Pe=Pe.w+(De>>Pe.b)*ht;De<Je;){for(Yt=vt,zt=Pe,vn=new ve,Ut=Xe+Ue,Nn=Xe+Ae;Xe<Ut;)rt(Yt[zt++],vn),bl(vn,Qe,Xe,qe,Ee,Se),Xe+=qe,Se+=qe;Xe<Nn&&(rt(Yt[zt++],vn),bl(vn,Qe,Xe,mt,Ee,Se),Xe+=mt,Se+=mt),++De&ct||(Pe+=ht)}break;case 3:if(Ae==Ee&&qe==Se&&0<Pe.b){for(Xe=Ee,Ae=Qe=Se+(Je-De)*Qe-(Ue=(Je-De)*xe(Pe.Ea,Pe.b)),qe=Ee,ct=Se,ht=[],Ue=(mt=Ue)-1;0<=Ue;--Ue)ht[Ue]=qe[ct+Ue];for(Ue=mt-1;0<=Ue;--Ue)Xe[Ae+Ue]=ht[Ue];Yo(Pe,De,Je,Ee,Qe,Ee,Se)}else Yo(Pe,De,Je,Ae,qe,Ee,Se)}Se=ne,Ee=V}Ee!=V&&r(ne,V,Se,Ee,de)}function Go(P,M){var V=P.V,ne=P.Ba+P.c*P.C,le=M-P.C;if(t(M<=P.l.o),t(16>=le),0<le){var de=P.l,me=P.Ta,Se=P.Ua,Ee=de.width;if(Ea(P,le,V,ne),le=Se=[Se],t((V=P.C)<(ne=M)),t(de.v<de.va),ne>de.o&&(ne=de.o),V<de.j){var Pe=de.j-V;V=de.j,le[0]+=Pe*Ee}if(V>=ne?V=0:(le[0]+=4*de.v,de.ka=V-de.j,de.U=de.va-de.v,de.T=ne-V,V=1),V){if(Se=Se[0],11>(V=P.ca).S){var De=V.f.RGBA,Je=(ne=V.S,le=de.U,de=de.T,Pe=De.eb,De.A),Ae=de;for(De=De.fb+P.Ma*De.A;0<Ae--;){var qe=me,Qe=Se,ht=le,Xe=Pe,ct=De;switch(ne){case Ul:Xo(qe,Qe,ht,Xe,ct);break;case Qo:ps(qe,Qe,ht,Xe,ct);break;case $l:ps(qe,Qe,ht,Xe,ct),Ko(Xe,ct,0,ht,1,0);break;case jf:ms(qe,Qe,ht,Xe,ct);break;case ql:Be(qe,Qe,ht,Xe,ct,1);break;case Ks:Be(qe,Qe,ht,Xe,ct,1),Ko(Xe,ct,0,ht,1,0);break;case bu:Be(qe,Qe,ht,Xe,ct,0);break;case wu:Be(qe,Qe,ht,Xe,ct,0),Ko(Xe,ct,1,ht,1,0);break;case gr:gs(qe,Qe,ht,Xe,ct);break;case xu:gs(qe,Qe,ht,Xe,ct),Qu(Xe,ct,ht,1,0);break;case Ju:rr(qe,Qe,ht,Xe,ct);break;default:t(0)}Se+=Ee,De+=Je}P.Ma+=de}else alert("todo:EmitRescaledRowsYUVA");t(P.Ma<=V.height)}}P.C=M,t(P.C<=P.i)}function ka(P){var M;if(0<P.ua)return 0;for(M=0;M<P.Wb;++M){var V=P.Ya[M].G,ne=P.Ya[M].H;if(0<V[1][ne[1]+0].g||0<V[2][ne[2]+0].g||0<V[3][ne[3]+0].g)return 0}return 1}function io(P,M,V,ne,le,de){if(P.Z!=0){var me=P.qd,Se=P.rd;for(t(ea[P.Z]!=null);M<V;++M)ea[P.Z](me,Se,ne,le,ne,le,de),me=ne,Se=le,le+=de;P.qd=me,P.rd=Se}}function ui(P,M){var V=P.l.ma,ne=V.Z==0||V.Z==1?P.l.j:P.C;if(ne=P.C<ne?ne:P.C,t(M<=P.l.o),M>ne){var le=P.l.width,de=V.ca,me=V.tb+le*ne,Se=P.V,Ee=P.Ba+P.c*ne,Pe=P.gc;t(P.ab==1),t(Pe[0].hc==3),Ta(Pe[0],ne,M,Se,Ee,de,me),io(V,ne,M,de,me,le)}P.C=P.Ma=M}function Aa(P,M,V,ne,le,de,me){var Se=P.$/ne,Ee=P.$%ne,Pe=P.m,De=P.s,Je=V+P.$,Ae=Je;le=V+ne*le;var qe=V+ne*de,Qe=280+De.ua,ht=P.Pb?Se:16777216,Xe=0<De.ua?De.Wa:null,ct=De.wc,Ue=Je<qe?Dr(De,Ee,Se):null;t(P.C<de),t(qe<=le);var mt=!1;e:for(;;){for(;mt||Je<qe;){var vt=0;if(Se>=ht){var Yt=Je-V;t((ht=P).Pb),ht.wd=ht.m,ht.xd=Yt,0<ht.s.ua&&ut(ht.s.Wa,ht.s.vb),ht=Se+ec}if(Ee&ct||(Ue=Dr(De,Ee,Se)),t(Ue!=null),Ue.Qb&&(M[Je]=Ue.qb,mt=!0),!mt)if(ie(Pe),Ue.jc){vt=Pe,Yt=M;var zt=Je,vn=Ue.pd[Y(vt)&Ni-1];t(Ue.jc),256>vn.g?(K(vt,vt.u+vn.g),Yt[zt]=vn.value,vt=0):(K(vt,vt.u+vn.g-256),t(256<=vn.value),vt=vn.value),vt==0&&(mt=!0)}else vt=Hn(Ue.G[0],Ue.H[0],Pe);if(Pe.h)break;if(mt||256>vt){if(!mt)if(Ue.nd)M[Je]=(Ue.qb|vt<<8)>>>0;else{if(ie(Pe),mt=Hn(Ue.G[1],Ue.H[1],Pe),ie(Pe),Yt=Hn(Ue.G[2],Ue.H[2],Pe),zt=Hn(Ue.G[3],Ue.H[3],Pe),Pe.h)break;M[Je]=(zt<<24|mt<<16|vt<<8|Yt)>>>0}if(mt=!1,++Je,++Ee>=ne&&(Ee=0,++Se,me!=null&&Se<=de&&!(Se%16)&&me(P,Se),Xe!=null))for(;Ae<Je;)vt=M[Ae++],Xe.X[(506832829*vt&4294967295)>>>Xe.Mb]=vt}else if(280>vt){if(vt=ti(vt-256,Pe),Yt=Hn(Ue.G[4],Ue.H[4],Pe),ie(Pe),Yt=Ki(ne,Yt=ti(Yt,Pe)),Pe.h)break;if(Je-V<Yt||le-Je<vt)break e;for(zt=0;zt<vt;++zt)M[Je+zt]=M[Je+zt-Yt];for(Je+=vt,Ee+=vt;Ee>=ne;)Ee-=ne,++Se,me!=null&&Se<=de&&!(Se%16)&&me(P,Se);if(t(Je<=le),Ee&ct&&(Ue=Dr(De,Ee,Se)),Xe!=null)for(;Ae<Je;)vt=M[Ae++],Xe.X[(506832829*vt&4294967295)>>>Xe.Mb]=vt}else{if(!(vt<Qe))break e;for(mt=vt-280,t(Xe!=null);Ae<Je;)vt=M[Ae++],Xe.X[(506832829*vt&4294967295)>>>Xe.Mb]=vt;vt=Je,t(!(mt>>>(Yt=Xe).Xa)),M[vt]=Yt.X[mt],mt=!0}mt||t(Pe.h==J(Pe))}if(P.Pb&&Pe.h&&Je<le)t(P.m.h),P.a=5,P.m=P.wd,P.$=P.xd,0<P.s.ua&&ut(P.s.vb,P.s.Wa);else{if(Pe.h)break e;me?.(P,Se>de?de:Se),P.a=0,P.$=Je-V}return 1}return P.a=3,0}function Pa(P){t(P!=null),P.vc=null,P.yc=null,P.Ya=null;var M=P.Wa;M!=null&&(M.X=null),P.vb=null,t(P!=null)}function Wo(){var P=new mn;return P==null?null:(P.a=0,P.xb=Su,$t("Predictor","VP8LPredictors"),$t("Predictor","VP8LPredictors_C"),$t("PredictorAdd","VP8LPredictorsAdd"),$t("PredictorAdd","VP8LPredictorsAdd_C"),ri=lt,bl=ot,Xo=Ct,ps=Zt,gs=on,rr=an,ms=We,j.VP8LMapColor32b=di,j.VP8LMapColor8b=Ro,P)}function zi(P,M,V,ne,le){var de=1,me=[P],Se=[M],Ee=ne.m,Pe=ne.s,De=null,Je=0;e:for(;;){if(V)for(;de&&B(Ee,1);){var Ae=me,qe=Se,Qe=ne,ht=1,Xe=Qe.m,ct=Qe.gc[Qe.ab],Ue=B(Xe,2);if(Qe.Oc&1<<Ue)de=0;else{switch(Qe.Oc|=1<<Ue,ct.hc=Ue,ct.Ea=Ae[0],ct.nc=qe[0],ct.K=[null],++Qe.ab,t(4>=Qe.ab),Ue){case 0:case 1:ct.b=B(Xe,3)+2,ht=zi(xe(ct.Ea,ct.b),xe(ct.nc,ct.b),0,Qe,ct.K),ct.K=ct.K[0];break;case 3:var mt,vt=B(Xe,8)+1,Yt=16<vt?0:4<vt?1:2<vt?2:3;if(Ae[0]=xe(ct.Ea,Yt),ct.b=Yt,mt=ht=zi(vt,1,0,Qe,ct.K)){var zt,vn=vt,Ut=ct,Nn=1<<(8>>Ut.b),Hr=a(Nn);if(Hr==null)mt=0;else{var _n=Ut.K[0],Bt=Ut.w;for(Hr[0]=Ut.K[0][0],zt=1;zt<1*vn;++zt)Hr[zt]=Te(_n[Bt+zt],Hr[zt-1]);for(;zt<4*Nn;++zt)Hr[zt]=0;Ut.K[0]=null,Ut.K[0]=Hr,mt=1}}ht=mt;break;case 2:break;default:t(0)}de=ht}}if(me=me[0],Se=Se[0],de&&B(Ee,1)&&!(de=1<=(Je=B(Ee,4))&&11>=Je)){ne.a=3;break e}var Et;if(Et=de)t:{var Gr,Ht,yn,Fn=ne,Ai=me,pi=Se,Wn=Je,Pi=V,wr=Fn.m,Br=Fn.s,In=[null],Yn=1,Tr=0,Xn=Df[Wn];n:for(;;){if(Pi&&B(wr,1)){var Rr=B(wr,3)+2,Mr=xe(Ai,Rr),ar=xe(pi,Rr),Ii=Mr*ar;if(!zi(Mr,ar,0,Fn,In))break n;for(In=In[0],Br.xc=Rr,Gr=0;Gr<Ii;++Gr){var Jn=In[Gr]>>8&65535;In[Gr]=Jn,Jn>=Yn&&(Yn=Jn+1)}}if(wr.h)break n;for(Ht=0;5>Ht;++Ht){var er=xl[Ht];!Ht&&0<Wn&&(er+=1<<Wn),Tr<er&&(Tr=er)}var ii=o(Yn*Xn,$),ji=Yn,ba=o(ji,te);if(ba==null)var ai=null;else t(65536>=ji),ai=ba;var Wr=a(Tr);if(ai==null||Wr==null||ii==null){Fn.a=1;break n}var wa=ii;for(Gr=yn=0;Gr<Yn;++Gr){var or=ai[Gr],Wi=or.G,Kn=or.H,dn=0,Bn=1,On=0;for(Ht=0;5>Ht;++Ht){er=xl[Ht],Wi[Ht]=wa,Kn[Ht]=yn,!Ht&&0<Wn&&(er+=1<<Wn);i:{var zr,gi=er,Jo=Fn,mr=Wr,Au=wa,Js=yn,vr=0,yo=Jo.m,Vl=B(yo,1);if(i(mr,0,0,gi),Vl){var xa=B(yo,1)+1,Pu=B(yo,1),Ou=B(yo,Pu==0?1:8);mr[Ou]=1,xa==2&&(mr[Ou=B(yo,8)]=1);var Vi=1}else{var cr=a(19),Vr=B(yo,4)+4;if(19<Vr){Jo.a=3;var Yr=0;break i}for(zr=0;zr<Vr;++zr)cr[Nd[zr]]=B(yo,3);var bo=void 0,jo=void 0,wo=Jo,Hc=cr,Xr=gi,Cu=mr,Sl=0,xo=wo.m,Ar=8,Oi=o(128,$);r:for(;N(Oi,0,7,Hc,19);){if(B(xo,1)){var _a=2+2*B(xo,3);if((bo=2+B(xo,_a))>Xr)break r}else bo=Xr;for(jo=0;jo<Xr&&bo--;){ie(xo);var ta=Oi[0+(127&Y(xo))];K(xo,xo.u+ta.g);var el=ta.value;if(16>el)Cu[jo++]=el,el!=0&&(Ar=el);else{var Gc=el==16,ic=el-16,Fh=zc[ic],Ss=B(xo,_u[ic])+Fh;if(jo+Ss>Xr)break r;for(var zf=Gc?Ar:0;0<Ss--;)Cu[jo++]=zf}}Sl=1;break r}Sl||(wo.a=3),Vi=Sl}(Vi=Vi&&!yo.h)&&(vr=N(Au,Js,8,mr,gi)),Vi&&vr!=0?Yr=vr:(Jo.a=3,Yr=0)}if(Yr==0)break n;if(Bn&&Nh[Ht]==1&&(Bn=wa[yn].g==0),dn+=wa[yn].g,yn+=Yr,3>=Ht){var Yl,Lu=Wr[0];for(Yl=1;Yl<er;++Yl)Wr[Yl]>Lu&&(Lu=Wr[Yl]);On+=Lu}}if(or.nd=Bn,or.Qb=0,Bn&&(or.qb=(Wi[3][Kn[3]+0].value<<24|Wi[1][Kn[1]+0].value<<16|Wi[2][Kn[2]+0].value)>>>0,dn==0&&256>Wi[0][Kn[0]+0].value&&(or.Qb=1,or.qb+=Wi[0][Kn[0]+0].value<<8)),or.jc=!or.Qb&&6>On,or.jc){var es,Ja=or;for(es=0;es<Ni;++es){var Es=es,_o=Ja.pd[Es],ks=Ja.G[0][Ja.H[0]+Es];256<=ks.value?(_o.g=ks.g+256,_o.value=ks.value):(_o.g=0,_o.value=0,Es>>=Or(ks,8,_o),Es>>=Or(Ja.G[1][Ja.H[1]+Es],16,_o),Es>>=Or(Ja.G[2][Ja.H[2]+Es],0,_o),Or(Ja.G[3][Ja.H[3]+Es],24,_o))}}}Br.vc=In,Br.Wb=Yn,Br.Ya=ai,Br.yc=ii,Et=1;break t}Et=0}if(!(de=Et)){ne.a=3;break e}if(0<Je){if(Pe.ua=1<<Je,!pe(Pe.Wa,Je)){ne.a=1,de=0;break e}}else Pe.ua=0;var Wc=ne,Vc=me,Uf=Se,ac=Wc.s,As=ac.xc;if(Wc.c=Vc,Wc.i=Uf,ac.md=xe(Vc,As),ac.wc=As==0?-1:(1<<As)-1,V){ne.xb=Mo;break e}if((De=a(me*Se))==null){ne.a=1,de=0;break e}de=(de=Aa(ne,De,0,me,Se,Se,null))&&!Ee.h;break e}return de?(le!=null?le[0]=De:(t(De==null),t(V)),ne.$=0,V||Pa(Pe)):Pa(Pe),de}function ao(P,M){var V=P.c*P.i,ne=V+M+16*M;return t(P.c<=M),P.V=a(ne),P.V==null?(P.Ta=null,P.Ua=0,P.a=1,0):(P.Ta=P.V,P.Ua=P.Ba+V+M,1)}function Fs(P,M){var V=P.C,ne=M-V,le=P.V,de=P.Ba+P.c*V;for(t(M<=P.l.o);0<ne;){var me=16<ne?16:ne,Se=P.l.ma,Ee=P.l.width,Pe=Ee*me,De=Se.ca,Je=Se.tb+Ee*V,Ae=P.Ta,qe=P.Ua;Ea(P,me,le,de),Mc(Ae,qe,De,Je,Pe),io(Se,V,V+me,De,Je,Ee),ne-=me,le+=me*P.c,V+=me}t(V==M),P.C=P.Ma=M}function as(){this.ub=this.yd=this.td=this.Rb=0}function fu(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function If(){this.Fb=this.Bb=this.Cb=0,this.Zb=a(4),this.Lb=a(4)}function Cr(){this.Yb=(function(){var P=[];return(function M(V,ne,le){for(var de=le[ne],me=0;me<de&&(V.push(le.length>ne+1?[]:0),!(le.length<ne+1));me++)M(V[me],ne+1,le)})(P,0,[3,11]),P})()}function hu(){this.jb=a(3),this.Wc=s([4,8],Cr),this.Xc=s([4,17],Cr)}function os(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new a(4),this.od=new a(4)}function Oa(){this.ld=this.La=this.dd=this.tc=0}function ss(){this.Na=this.la=0}function Cc(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function hl(){this.ad=a(384),this.Za=0,this.Ob=a(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function Po(){this.uc=this.M=this.Nb=0,this.wa=Array(new Oa),this.Y=0,this.ya=Array(new hl),this.aa=0,this.l=new oo}function wi(){this.y=a(16),this.f=a(8),this.ea=a(8)}function pr(){this.cb=this.a=0,this.sc="",this.m=new F,this.Od=new as,this.Kc=new fu,this.ed=new os,this.Qa=new If,this.Ic=this.$c=this.Aa=0,this.D=new Po,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=o(8,F),this.ia=0,this.pb=o(4,Cc),this.Pa=new hu,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new wi),this.Hd=0,this.rb=Array(new ss),this.sb=0,this.wa=Array(new Oa),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 hl),this.L=this.aa=0,this.gd=s([4,2],Oa),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 wn(P,M){return 0>P?0:P>M?M:P}function oo(){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 Ui(){var P=new pr;return P!=null&&(P.a=0,P.sc="OK",P.cb=0,P.Xb=0,Hl||(Hl=qr)),P}function Gn(P,M,V){return P.a==0&&(P.a=M,P.sc=V,P.cb=0),0}function so(P,M,V){return 3<=V&&P[M+0]==157&&P[M+1]==1&&P[M+2]==42}function qi(P,M){if(P==null)return 0;if(P.a=0,P.sc="OK",M==null)return Gn(P,2,"null VP8Io passed to VP8GetHeaders()");var V=M.data,ne=M.w,le=M.ha;if(4>le)return Gn(P,7,"Truncated header.");var de=V[ne+0]|V[ne+1]<<8|V[ne+2]<<16,me=P.Od;if(me.Rb=!(1&de),me.td=de>>1&7,me.yd=de>>4&1,me.ub=de>>5,3<me.td)return Gn(P,3,"Incorrect keyframe parameters.");if(!me.yd)return Gn(P,4,"Frame not displayable.");ne+=3,le-=3;var Se=P.Kc;if(me.Rb){if(7>le)return Gn(P,7,"cannot parse picture header");if(!so(V,ne,le))return Gn(P,3,"Bad code word");Se.c=16383&(V[ne+4]<<8|V[ne+3]),Se.Td=V[ne+4]>>6,Se.i=16383&(V[ne+6]<<8|V[ne+5]),Se.Ud=V[ne+6]>>6,ne+=7,le-=7,P.za=Se.c+15>>4,P.Ub=Se.i+15>>4,M.width=Se.c,M.height=Se.i,M.Da=0,M.j=0,M.v=0,M.va=M.width,M.o=M.height,M.da=0,M.ib=M.width,M.hb=M.height,M.U=M.width,M.T=M.height,i((de=P.Pa).jb,0,255,de.jb.length),t((de=P.Qa)!=null),de.Cb=0,de.Bb=0,de.Fb=1,i(de.Zb,0,0,de.Zb.length),i(de.Lb,0,0,de.Lb)}if(me.ub>le)return Gn(P,7,"bad partition length");se(de=P.m,V,ne,me.ub),ne+=me.ub,le-=me.ub,me.Rb&&(Se.Ld=ue(de),Se.Kd=ue(de)),Se=P.Qa;var Ee,Pe=P.Pa;if(t(de!=null),t(Se!=null),Se.Cb=ue(de),Se.Cb){if(Se.Bb=ue(de),ue(de)){for(Se.Fb=ue(de),Ee=0;4>Ee;++Ee)Se.Zb[Ee]=ue(de)?Q(de,7):0;for(Ee=0;4>Ee;++Ee)Se.Lb[Ee]=ue(de)?Q(de,6):0}if(Se.Bb)for(Ee=0;3>Ee;++Ee)Pe.jb[Ee]=ue(de)?ee(de,8):255}else Se.Bb=0;if(de.Ka)return Gn(P,3,"cannot parse segment header");if((Se=P.ed).zd=ue(de),Se.Tb=ee(de,6),Se.wb=ee(de,3),Se.Pc=ue(de),Se.Pc&&ue(de)){for(Pe=0;4>Pe;++Pe)ue(de)&&(Se.vd[Pe]=Q(de,6));for(Pe=0;4>Pe;++Pe)ue(de)&&(Se.od[Pe]=Q(de,6))}if(P.L=Se.Tb==0?0:Se.zd?1:2,de.Ka)return Gn(P,3,"cannot parse filter header");var De=le;if(le=Ee=ne,ne=Ee+De,Se=De,P.Xb=(1<<ee(P.m,2))-1,De<3*(Pe=P.Xb))V=7;else{for(Ee+=3*Pe,Se-=3*Pe,De=0;De<Pe;++De){var Je=V[le+0]|V[le+1]<<8|V[le+2]<<16;Je>Se&&(Je=Se),se(P.Jc[+De],V,Ee,Je),Ee+=Je,Se-=Je,le+=3}se(P.Jc[+Pe],V,Ee,Se),V=Ee<ne?0:5}if(V!=0)return Gn(P,V,"cannot parse partitions");for(V=ee(Ee=P.m,7),le=ue(Ee)?Q(Ee,4):0,ne=ue(Ee)?Q(Ee,4):0,Se=ue(Ee)?Q(Ee,4):0,Pe=ue(Ee)?Q(Ee,4):0,Ee=ue(Ee)?Q(Ee,4):0,De=P.Qa,Je=0;4>Je;++Je){if(De.Cb){var Ae=De.Zb[Je];De.Fb||(Ae+=V)}else{if(0<Je){P.pb[Je]=P.pb[0];continue}Ae=V}var qe=P.pb[Je];qe.Sc[0]=Zs[wn(Ae+le,127)],qe.Sc[1]=tc[wn(Ae+0,127)],qe.Eb[0]=2*Zs[wn(Ae+ne,127)],qe.Eb[1]=101581*tc[wn(Ae+Se,127)]>>16,8>qe.Eb[1]&&(qe.Eb[1]=8),qe.Qc[0]=Zs[wn(Ae+Pe,117)],qe.Qc[1]=tc[wn(Ae+Ee,127)],qe.lc=Ae+Ee}if(!me.Rb)return Gn(P,4,"Not a key frame.");for(ue(de),me=P.Pa,V=0;4>V;++V){for(le=0;8>le;++le)for(ne=0;3>ne;++ne)for(Se=0;11>Se;++Se)Pe=_e(de,Mh[V][le][ne][Se])?ee(de,8):nc[V][le][ne][Se],me.Wc[V][le].Yb[ne][Se]=Pe;for(le=0;17>le;++le)me.Xc[V][le]=me.Wc[V][qc[le]]}return P.kc=ue(de),P.kc&&(P.Bd=ee(de,8)),P.cb=1}function qr(P,M,V,ne,le,de,me){var Se=M[le].Yb[V];for(V=0;16>le;++le){if(!_e(P,Se[V+0]))return le;for(;!_e(P,Se[V+1]);)if(Se=M[++le].Yb[0],V=0,le==16)return 16;var Ee=M[le+1].Yb;if(_e(P,Se[V+2])){var Pe=P,De=0;if(_e(Pe,(Ae=Se)[(Je=V)+3]))if(_e(Pe,Ae[Je+6])){for(Se=0,Je=2*(De=_e(Pe,Ae[Je+8]))+(Ae=_e(Pe,Ae[Je+9+De])),De=0,Ae=Ff[Je];Ae[Se];++Se)De+=De+_e(Pe,Ae[Se]);De+=3+(8<<Je)}else _e(Pe,Ae[Je+7])?(De=7+2*_e(Pe,165),De+=_e(Pe,145)):De=5+_e(Pe,159);else De=_e(Pe,Ae[Je+4])?3+_e(Pe,Ae[Je+5]):2;Se=Ee[2]}else De=1,Se=Ee[1];Ee=me+vo[le],0>(Pe=P).b&&fe(Pe);var Je,Ae=Pe.b,qe=(Je=Pe.Ca>>1)-(Pe.I>>Ae)>>31;--Pe.b,Pe.Ca+=qe,Pe.Ca|=1,Pe.I-=(Je+1&qe)<<Ae,de[Ee]=((De^qe)-qe)*ne[(0<le)+0]}return 16}function ls(P){var M=P.rb[P.sb-1];M.la=0,M.Na=0,i(P.zc,0,0,P.zc.length),P.ja=0}function lo(P,M,V,ne,le){le=P[M+V+32*ne]+(le>>3),P[M+V+32*ne]=-256&le?0>le?0:255:le}function xi(P,M,V,ne,le,de){lo(P,M,0,V,ne+le),lo(P,M,1,V,ne+de),lo(P,M,2,V,ne-de),lo(P,M,3,V,ne-le)}function Ba(P){return(20091*P>>16)+P}function du(P,M,V,ne){var le,de=0,me=a(16);for(le=0;4>le;++le){var Se=P[M+0]+P[M+8],Ee=P[M+0]-P[M+8],Pe=(35468*P[M+4]>>16)-Ba(P[M+12]),De=Ba(P[M+4])+(35468*P[M+12]>>16);me[de+0]=Se+De,me[de+1]=Ee+Pe,me[de+2]=Ee-Pe,me[de+3]=Se-De,de+=4,M++}for(le=de=0;4>le;++le)Se=(P=me[de+0]+4)+me[de+8],Ee=P-me[de+8],Pe=(35468*me[de+4]>>16)-Ba(me[de+12]),lo(V,ne,0,0,Se+(De=Ba(me[de+4])+(35468*me[de+12]>>16))),lo(V,ne,1,0,Ee+Pe),lo(V,ne,2,0,Ee-Pe),lo(V,ne,3,0,Se-De),de++,ne+=32}function Ca(P,M,V,ne){var le=P[M+0]+4,de=35468*P[M+4]>>16,me=Ba(P[M+4]),Se=35468*P[M+1]>>16;xi(V,ne,0,le+me,P=Ba(P[M+1]),Se),xi(V,ne,1,le+de,P,Se),xi(V,ne,2,le-de,P,Se),xi(V,ne,3,le-me,P,Se)}function Rl(P,M,V,ne,le){du(P,M,V,ne),le&&du(P,M+16,V,ne+4)}function us(P,M,V,ne){Vs(P,M+0,V,ne,1),Vs(P,M+32,V,ne+128,1)}function pu(P,M,V,ne){var le;for(P=P[M+0]+4,le=0;4>le;++le)for(M=0;4>M;++M)lo(V,ne,M,le,P)}function jn(P,M,V,ne){P[M+0]&&Rn(P,M+0,V,ne),P[M+16]&&Rn(P,M+16,V,ne+4),P[M+32]&&Rn(P,M+32,V,ne+128),P[M+48]&&Rn(P,M+48,V,ne+128+4)}function cs(P,M,V,ne){var le,de=a(16);for(le=0;4>le;++le){var me=P[M+0+le]+P[M+12+le],Se=P[M+4+le]+P[M+8+le],Ee=P[M+4+le]-P[M+8+le],Pe=P[M+0+le]-P[M+12+le];de[0+le]=me+Se,de[8+le]=me-Se,de[4+le]=Pe+Ee,de[12+le]=Pe-Ee}for(le=0;4>le;++le)me=(P=de[0+4*le]+3)+de[3+4*le],Se=de[1+4*le]+de[2+4*le],Ee=de[1+4*le]-de[2+4*le],Pe=P-de[3+4*le],V[ne+0]=me+Se>>3,V[ne+16]=Pe+Ee>>3,V[ne+32]=me-Se>>3,V[ne+48]=Pe-Ee>>3,ne+=64}function Oo(P,M,V){var ne,le=M-32,de=Ri,me=255-P[le-1];for(ne=0;ne<V;++ne){var Se,Ee=de,Pe=me+P[M-1];for(Se=0;Se<V;++Se)P[M+Se]=Ee[Pe+P[le+Se]];M+=32}}function dl(P,M){Oo(P,M,4)}function Lc(P,M){Oo(P,M,8)}function Nc(P,M){Oo(P,M,16)}function pl(P,M){var V;for(V=0;16>V;++V)r(P,M+32*V,P,M-32,16)}function Ml(P,M){var V;for(V=16;0<V;--V)i(P,M,P[M-1],16),M+=32}function ca(P,M,V){var ne;for(ne=0;16>ne;++ne)i(M,V+32*ne,P,16)}function za(P,M){var V,ne=16;for(V=0;16>V;++V)ne+=P[M-1+32*V]+P[M+V-32];ca(ne>>5,P,M)}function Ua(P,M){var V,ne=8;for(V=0;16>V;++V)ne+=P[M-1+32*V];ca(ne>>4,P,M)}function qa(P,M){var V,ne=8;for(V=0;16>V;++V)ne+=P[M+V-32];ca(ne>>4,P,M)}function Ln(P,M){ca(128,P,M)}function cn(P,M,V){return P+2*M+V+2>>2}function Co(P,M){var V,ne=M-32;for(ne=new Uint8Array([cn(P[ne-1],P[ne+0],P[ne+1]),cn(P[ne+0],P[ne+1],P[ne+2]),cn(P[ne+1],P[ne+2],P[ne+3]),cn(P[ne+2],P[ne+3],P[ne+4])]),V=0;4>V;++V)r(P,M+32*V,ne,0,ne.length)}function Tc(P,M){var V=P[M-1],ne=P[M-1+32],le=P[M-1+64],de=P[M-1+96];Ce(P,M+0,16843009*cn(P[M-1-32],V,ne)),Ce(P,M+32,16843009*cn(V,ne,le)),Ce(P,M+64,16843009*cn(ne,le,de)),Ce(P,M+96,16843009*cn(le,de,de))}function Rc(P,M){var V,ne=4;for(V=0;4>V;++V)ne+=P[M+V-32]+P[M-1+32*V];for(ne>>=3,V=0;4>V;++V)i(P,M+32*V,ne,4)}function uo(P,M){var V=P[M-1+0],ne=P[M-1+32],le=P[M-1+64],de=P[M-1-32],me=P[M+0-32],Se=P[M+1-32],Ee=P[M+2-32],Pe=P[M+3-32];P[M+0+96]=cn(ne,le,P[M-1+96]),P[M+1+96]=P[M+0+64]=cn(V,ne,le),P[M+2+96]=P[M+1+64]=P[M+0+32]=cn(de,V,ne),P[M+3+96]=P[M+2+64]=P[M+1+32]=P[M+0+0]=cn(me,de,V),P[M+3+64]=P[M+2+32]=P[M+1+0]=cn(Se,me,de),P[M+3+32]=P[M+2+0]=cn(Ee,Se,me),P[M+3+0]=cn(Pe,Ee,Se)}function Er(P,M){var V=P[M+1-32],ne=P[M+2-32],le=P[M+3-32],de=P[M+4-32],me=P[M+5-32],Se=P[M+6-32],Ee=P[M+7-32];P[M+0+0]=cn(P[M+0-32],V,ne),P[M+1+0]=P[M+0+32]=cn(V,ne,le),P[M+2+0]=P[M+1+32]=P[M+0+64]=cn(ne,le,de),P[M+3+0]=P[M+2+32]=P[M+1+64]=P[M+0+96]=cn(le,de,me),P[M+3+32]=P[M+2+64]=P[M+1+96]=cn(de,me,Se),P[M+3+64]=P[M+2+96]=cn(me,Se,Ee),P[M+3+96]=cn(Se,Ee,Ee)}function gu(P,M){var V=P[M-1+0],ne=P[M-1+32],le=P[M-1+64],de=P[M-1-32],me=P[M+0-32],Se=P[M+1-32],Ee=P[M+2-32],Pe=P[M+3-32];P[M+0+0]=P[M+1+64]=de+me+1>>1,P[M+1+0]=P[M+2+64]=me+Se+1>>1,P[M+2+0]=P[M+3+64]=Se+Ee+1>>1,P[M+3+0]=Ee+Pe+1>>1,P[M+0+96]=cn(le,ne,V),P[M+0+64]=cn(ne,V,de),P[M+0+32]=P[M+1+96]=cn(V,de,me),P[M+1+32]=P[M+2+96]=cn(de,me,Se),P[M+2+32]=P[M+3+96]=cn(me,Se,Ee),P[M+3+32]=cn(Se,Ee,Pe)}function mu(P,M){var V=P[M+0-32],ne=P[M+1-32],le=P[M+2-32],de=P[M+3-32],me=P[M+4-32],Se=P[M+5-32],Ee=P[M+6-32],Pe=P[M+7-32];P[M+0+0]=V+ne+1>>1,P[M+1+0]=P[M+0+64]=ne+le+1>>1,P[M+2+0]=P[M+1+64]=le+de+1>>1,P[M+3+0]=P[M+2+64]=de+me+1>>1,P[M+0+32]=cn(V,ne,le),P[M+1+32]=P[M+0+96]=cn(ne,le,de),P[M+2+32]=P[M+1+96]=cn(le,de,me),P[M+3+32]=P[M+2+96]=cn(de,me,Se),P[M+3+64]=cn(me,Se,Ee),P[M+3+96]=cn(Se,Ee,Pe)}function Bs(P,M){var V=P[M-1+0],ne=P[M-1+32],le=P[M-1+64],de=P[M-1+96];P[M+0+0]=V+ne+1>>1,P[M+2+0]=P[M+0+32]=ne+le+1>>1,P[M+2+32]=P[M+0+64]=le+de+1>>1,P[M+1+0]=cn(V,ne,le),P[M+3+0]=P[M+1+32]=cn(ne,le,de),P[M+3+32]=P[M+1+64]=cn(le,de,de),P[M+3+64]=P[M+2+64]=P[M+0+96]=P[M+1+96]=P[M+2+96]=P[M+3+96]=de}function Ku(P,M){var V=P[M-1+0],ne=P[M-1+32],le=P[M-1+64],de=P[M-1+96],me=P[M-1-32],Se=P[M+0-32],Ee=P[M+1-32],Pe=P[M+2-32];P[M+0+0]=P[M+2+32]=V+me+1>>1,P[M+0+32]=P[M+2+64]=ne+V+1>>1,P[M+0+64]=P[M+2+96]=le+ne+1>>1,P[M+0+96]=de+le+1>>1,P[M+3+0]=cn(Se,Ee,Pe),P[M+2+0]=cn(me,Se,Ee),P[M+1+0]=P[M+3+32]=cn(V,me,Se),P[M+1+32]=P[M+3+64]=cn(ne,V,me),P[M+1+64]=P[M+3+96]=cn(le,ne,V),P[M+1+96]=cn(de,le,ne)}function $a(P,M){var V;for(V=0;8>V;++V)r(P,M+32*V,P,M-32,8)}function fa(P,M){var V;for(V=0;8>V;++V)i(P,M,P[M-1],8),M+=32}function Ha(P,M,V){var ne;for(ne=0;8>ne;++ne)i(M,V+32*ne,P,8)}function vu(P,M){var V,ne=8;for(V=0;8>V;++V)ne+=P[M+V-32]+P[M-1+32*V];Ha(ne>>4,P,M)}function La(P,M){var V,ne=4;for(V=0;8>V;++V)ne+=P[M+V-32];Ha(ne>>3,P,M)}function co(P,M){var V,ne=4;for(V=0;8>V;++V)ne+=P[M-1+32*V];Ha(ne>>3,P,M)}function zs(P,M){Ha(128,P,M)}function Ga(P,M,V){var ne=P[M-V],le=P[M+0],de=3*(le-ne)+Zo[1020+P[M-2*V]-P[M+V]],me=zl[112+(de+4>>3)];P[M-V]=Ri[255+ne+zl[112+(de+3>>3)]],P[M+0]=Ri[255+le-me]}function gl(P,M,V,ne){var le=P[M+0],de=P[M+V];return mo[255+P[M-2*V]-P[M-V]]>ne||mo[255+de-le]>ne}function Il(P,M,V,ne){return 4*mo[255+P[M-V]-P[M+0]]+mo[255+P[M-2*V]-P[M+V]]<=ne}function ci(P,M,V,ne,le){var de=P[M-3*V],me=P[M-2*V],Se=P[M-V],Ee=P[M+0],Pe=P[M+V],De=P[M+2*V],Je=P[M+3*V];return 4*mo[255+Se-Ee]+mo[255+me-Pe]>ne?0:mo[255+P[M-4*V]-de]<=le&&mo[255+de-me]<=le&&mo[255+me-Se]<=le&&mo[255+Je-De]<=le&&mo[255+De-Pe]<=le&&mo[255+Pe-Ee]<=le}function Wa(P,M,V,ne){var le=2*ne+1;for(ne=0;16>ne;++ne)Il(P,M+ne,V,le)&&Ga(P,M+ne,V)}function fo(P,M,V,ne){var le=2*ne+1;for(ne=0;16>ne;++ne)Il(P,M+ne*V,1,le)&&Ga(P,M+ne*V,1)}function ml(P,M,V,ne){var le;for(le=3;0<le;--le)Wa(P,M+=4*V,V,ne)}function fs(P,M,V,ne){var le;for(le=3;0<le;--le)fo(P,M+=4,V,ne)}function $r(P,M,V,ne,le,de,me,Se){for(de=2*de+1;0<le--;){if(ci(P,M,V,de,me))if(gl(P,M,V,Se))Ga(P,M,V);else{var Ee=P,Pe=M,De=V,Je=Ee[Pe-2*De],Ae=Ee[Pe-De],qe=Ee[Pe+0],Qe=Ee[Pe+De],ht=Ee[Pe+2*De],Xe=27*(Ue=Zo[1020+3*(qe-Ae)+Zo[1020+Je-Qe]])+63>>7,ct=18*Ue+63>>7,Ue=9*Ue+63>>7;Ee[Pe-3*De]=Ri[255+Ee[Pe-3*De]+Ue],Ee[Pe-2*De]=Ri[255+Je+ct],Ee[Pe-De]=Ri[255+Ae+Xe],Ee[Pe+0]=Ri[255+qe-Xe],Ee[Pe+De]=Ri[255+Qe-ct],Ee[Pe+2*De]=Ri[255+ht-Ue]}M+=ne}}function fi(P,M,V,ne,le,de,me,Se){for(de=2*de+1;0<le--;){if(ci(P,M,V,de,me))if(gl(P,M,V,Se))Ga(P,M,V);else{var Ee=P,Pe=M,De=V,Je=Ee[Pe-De],Ae=Ee[Pe+0],qe=Ee[Pe+De],Qe=zl[112+(4+(ht=3*(Ae-Je))>>3)],ht=zl[112+(ht+3>>3)],Xe=Qe+1>>1;Ee[Pe-2*De]=Ri[255+Ee[Pe-2*De]+Xe],Ee[Pe-De]=Ri[255+Je+ht],Ee[Pe+0]=Ri[255+Ae-Qe],Ee[Pe+De]=Ri[255+qe-Xe]}M+=ne}}function ni(P,M,V,ne,le,de){$r(P,M,V,1,16,ne,le,de)}function _i(P,M,V,ne,le,de){$r(P,M,1,V,16,ne,le,de)}function Va(P,M,V,ne,le,de){var me;for(me=3;0<me;--me)fi(P,M+=4*V,V,1,16,ne,le,de)}function q(P,M,V,ne,le,de){var me;for(me=3;0<me;--me)fi(P,M+=4,1,V,16,ne,le,de)}function ce(P,M,V,ne,le,de,me,Se){$r(P,M,le,1,8,de,me,Se),$r(V,ne,le,1,8,de,me,Se)}function Oe(P,M,V,ne,le,de,me,Se){$r(P,M,1,le,8,de,me,Se),$r(V,ne,1,le,8,de,me,Se)}function Ie(P,M,V,ne,le,de,me,Se){fi(P,M+4*le,le,1,8,de,me,Se),fi(V,ne+4*le,le,1,8,de,me,Se)}function He(P,M,V,ne,le,de,me,Se){fi(P,M+4,1,le,8,de,me,Se),fi(V,ne+4,1,le,8,de,me,Se)}function ft(){this.ba=new tn,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new hn,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function pt(){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 Ft(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function jt(){this.ua=0,this.Wa=new be,this.vb=new be,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new te,this.yc=new $}function mn(){this.xb=this.a=0,this.l=new oo,this.ca=new tn,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 jt,this.ab=0,this.gc=o(4,Ft),this.Oc=0}function xn(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new oo,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Dn(P,M,V,ne,le,de,me){for(P=P==null?0:P[M+0],M=0;M<me;++M)le[de+M]=P+V[ne+M]&255,P=le[de+M]}function Lr(P,M,V,ne,le,de,me){var Se;if(P==null)Dn(null,null,V,ne,le,de,me);else for(Se=0;Se<me;++Se)le[de+Se]=P[M+Se]+V[ne+Se]&255}function hi(P,M,V,ne,le,de,me){if(P==null)Dn(null,null,V,ne,le,de,me);else{var Se,Ee=P[M+0],Pe=Ee,De=Ee;for(Se=0;Se<me;++Se)Pe=De+(Ee=P[M+Se])-Pe,De=V[ne+Se]+(-256&Pe?0>Pe?0:255:Pe)&255,Pe=Ee,le[de+Se]=De}}function lr(P,M,V,ne){var le=M.width,de=M.o;if(t(P!=null&&M!=null),0>V||0>=ne||V+ne>de)return null;if(!P.Cc){if(P.ga==null){var me;if(P.ga=new xn,(me=P.ga==null)||(me=M.width*M.o,t(P.Gb.length==0),P.Gb=a(me),P.Uc=0,P.Gb==null?me=0:(P.mb=P.Gb,P.nb=P.Uc,P.rc=null,me=1),me=!me),!me){me=P.ga;var Se=P.Fa,Ee=P.P,Pe=P.qc,De=P.mb,Je=P.nb,Ae=Ee+1,qe=Pe-1,Qe=me.l;if(t(Se!=null&&De!=null&&M!=null),ea[0]=null,ea[1]=Dn,ea[2]=Lr,ea[3]=hi,me.ca=De,me.tb=Je,me.c=M.width,me.i=M.height,t(0<me.c&&0<me.i),1>=Pe)M=0;else if(me.$a=3&Se[Ee+0],me.Z=Se[Ee+0]>>2&3,me.Lc=Se[Ee+0]>>4&3,Ee=Se[Ee+0]>>6&3,0>me.$a||1<me.$a||4<=me.Z||1<me.Lc||Ee)M=0;else if(Qe.put=Jt,Qe.ac=dr,Qe.bc=ua,Qe.ma=me,Qe.width=M.width,Qe.height=M.height,Qe.Da=M.Da,Qe.v=M.v,Qe.va=M.va,Qe.j=M.j,Qe.o=M.o,me.$a)e:{t(me.$a==1),M=Wo();t:for(;;){if(M==null){M=0;break e}if(t(me!=null),me.mc=M,M.c=me.c,M.i=me.i,M.l=me.l,M.l.ma=me,M.l.width=me.c,M.l.height=me.i,M.a=0,re(M.m,Se,Ae,qe),!zi(me.c,me.i,1,M,null)||(M.ab==1&&M.gc[0].hc==3&&ka(M.s)?(me.ic=1,Se=M.c*M.i,M.Ta=null,M.Ua=0,M.V=a(Se),M.Ba=0,M.V==null?(M.a=1,M=0):M=1):(me.ic=0,M=ao(M,me.c)),!M))break t;M=1;break e}me.mc=null,M=0}else M=qe>=me.c*me.i;me=!M}if(me)return null;P.ga.Lc!=1?P.Ga=0:ne=de-V}t(P.ga!=null),t(V+ne<=de);e:{if(M=(Se=P.ga).c,de=Se.l.o,Se.$a==0){if(Ae=P.rc,qe=P.Vc,Qe=P.Fa,Ee=P.P+1+V*M,Pe=P.mb,De=P.nb+V*M,t(Ee<=P.P+P.qc),Se.Z!=0)for(t(ea[Se.Z]!=null),me=0;me<ne;++me)ea[Se.Z](Ae,qe,Qe,Ee,Pe,De,M),Ae=Pe,qe=De,De+=M,Ee+=M;else for(me=0;me<ne;++me)r(Pe,De,Qe,Ee,M),Ae=Pe,qe=De,De+=M,Ee+=M;P.rc=Ae,P.Vc=qe}else{if(t(Se.mc!=null),M=V+ne,t((me=Se.mc)!=null),t(M<=me.i),me.C>=M)M=1;else if(Se.ic||Ya(),Se.ic){Se=me.V,Ae=me.Ba,qe=me.c;var ht=me.i,Xe=(Qe=1,Ee=me.$/qe,Pe=me.$%qe,De=me.m,Je=me.s,me.$),ct=qe*ht,Ue=qe*M,mt=Je.wc,vt=Xe<Ue?Dr(Je,Pe,Ee):null;t(Xe<=ct),t(M<=ht),t(ka(Je));t:for(;;){for(;!De.h&&Xe<Ue;){if(Pe&mt||(vt=Dr(Je,Pe,Ee)),t(vt!=null),ie(De),256>(ht=Hn(vt.G[0],vt.H[0],De)))Se[Ae+Xe]=ht,++Xe,++Pe>=qe&&(Pe=0,++Ee<=M&&!(Ee%16)&&ui(me,Ee));else{if(!(280>ht)){Qe=0;break t}ht=ti(ht-256,De);var Yt,zt=Hn(vt.G[4],vt.H[4],De);if(ie(De),!(Xe>=(zt=Ki(qe,zt=ti(zt,De)))&&ct-Xe>=ht)){Qe=0;break t}for(Yt=0;Yt<ht;++Yt)Se[Ae+Xe+Yt]=Se[Ae+Xe+Yt-zt];for(Xe+=ht,Pe+=ht;Pe>=qe;)Pe-=qe,++Ee<=M&&!(Ee%16)&&ui(me,Ee);Xe<Ue&&Pe&mt&&(vt=Dr(Je,Pe,Ee))}t(De.h==J(De))}ui(me,Ee>M?M:Ee);break t}!Qe||De.h&&Xe<ct?(Qe=0,me.a=De.h?5:3):me.$=Xe,M=Qe}else M=Aa(me,me.V,me.Ba,me.c,me.i,M,Fs);if(!M){ne=0;break e}}V+ne>=de&&(P.Cc=1),ne=1}if(!ne)return null;if(P.Cc&&((ne=P.ga)!=null&&(ne.mc=null),P.ga=null,0<P.Ga))return alert("todo:WebPDequantizeLevels"),null}return P.nb+V*le}function Si(P,M,V,ne,le,de){for(;0<le--;){var me,Se=P,Ee=M+(V?1:0),Pe=P,De=M+(V?0:3);for(me=0;me<ne;++me){var Je=Pe[De+4*me];Je!=255&&(Je*=32897,Se[Ee+4*me+0]=Se[Ee+4*me+0]*Je>>23,Se[Ee+4*me+1]=Se[Ee+4*me+1]*Je>>23,Se[Ee+4*me+2]=Se[Ee+4*me+2]*Je>>23)}M+=de}}function kr(P,M,V,ne,le){for(;0<ne--;){var de;for(de=0;de<V;++de){var me=P[M+2*de+0],Se=15&(Pe=P[M+2*de+1]),Ee=4369*Se,Pe=(240&Pe|Pe>>4)*Ee>>16;P[M+2*de+0]=(240&me|me>>4)*Ee>>16&240|(15&me|me<<4)*Ee>>16>>4&15,P[M+2*de+1]=240&Pe|Se}M+=le}}function Li(P,M,V,ne,le,de,me,Se){var Ee,Pe,De=255;for(Pe=0;Pe<le;++Pe){for(Ee=0;Ee<ne;++Ee){var Je=P[M+Ee];de[me+4*Ee]=Je,De&=Je}M+=V,me+=Se}return De!=255}function Us(P,M,V,ne,le){var de;for(de=0;de<le;++de)V[ne+de]=P[M+de]>>8}function Ya(){Ko=Si,Qu=kr,Bl=Li,Mc=Us}function qs(P,M,V){j[P]=function(ne,le,de,me,Se,Ee,Pe,De,Je,Ae,qe,Qe,ht,Xe,ct,Ue,mt){var vt,Yt=mt-1>>1,zt=Se[Ee+0]|Pe[De+0]<<16,vn=Je[Ae+0]|qe[Qe+0]<<16;t(ne!=null);var Ut=3*zt+vn+131074>>2;for(M(ne[le+0],255&Ut,Ut>>16,ht,Xe),de!=null&&(Ut=3*vn+zt+131074>>2,M(de[me+0],255&Ut,Ut>>16,ct,Ue)),vt=1;vt<=Yt;++vt){var Nn=Se[Ee+vt]|Pe[De+vt]<<16,Hr=Je[Ae+vt]|qe[Qe+vt]<<16,_n=zt+Nn+vn+Hr+524296,Bt=_n+2*(Nn+vn)>>3;Ut=Bt+zt>>1,zt=(_n=_n+2*(zt+Hr)>>3)+Nn>>1,M(ne[le+2*vt-1],255&Ut,Ut>>16,ht,Xe+(2*vt-1)*V),M(ne[le+2*vt-0],255&zt,zt>>16,ht,Xe+(2*vt-0)*V),de!=null&&(Ut=_n+vn>>1,zt=Bt+Hr>>1,M(de[me+2*vt-1],255&Ut,Ut>>16,ct,Ue+(2*vt-1)*V),M(de[me+2*vt+0],255&zt,zt>>16,ct,Ue+(2*vt+0)*V)),zt=Nn,vn=Hr}1&mt||(Ut=3*zt+vn+131074>>2,M(ne[le+mt-1],255&Ut,Ut>>16,ht,Xe+(mt-1)*V),de!=null&&(Ut=3*vn+zt+131074>>2,M(de[me+mt-1],255&Ut,Ut>>16,ct,Ue+(mt-1)*V)))}}function Vo(){Ra[Ul]=Ih,Ra[Qo]=Qs,Ra[jf]=jh,Ra[ql]=Eu,Ra[bu]=ki,Ra[gr]=Mi,Ra[Ju]=$c,Ra[$l]=Qs,Ra[Ks]=Eu,Ra[wu]=ki,Ra[xu]=Mi}function $s(P){return P&-16384?0>P?0:255:P>>ws}function Hs(P,M){return $s((19077*P>>8)+(26149*M>>8)-14234)}function vl(P,M,V){return $s((19077*P>>8)-(6419*M>>8)-(13320*V>>8)+8708)}function ho(P,M){return $s((19077*P>>8)+(33050*M>>8)-17685)}function Gs(P,M,V,ne,le){ne[le+0]=Hs(P,V),ne[le+1]=vl(P,M,V),ne[le+2]=ho(P,M)}function Ei(P,M,V,ne,le){ne[le+0]=ho(P,M),ne[le+1]=vl(P,M,V),ne[le+2]=Hs(P,V)}function hs(P,M,V,ne,le){var de=vl(P,M,V);M=de<<3&224|ho(P,M)>>3,ne[le+0]=248&Hs(P,V)|de>>5,ne[le+1]=M}function Lo(P,M,V,ne,le){var de=240&ho(P,M)|15;ne[le+0]=240&Hs(P,V)|vl(P,M,V)>>4,ne[le+1]=de}function jl(P,M,V,ne,le){ne[le+0]=255,Gs(P,M,V,ne,le+1)}function Dl(P,M,V,ne,le){Ei(P,M,V,ne,le),ne[le+3]=255}function ha(P,M,V,ne,le){Gs(P,M,V,ne,le),ne[le+3]=255}function po(P,M,V){j[P]=function(ne,le,de,me,Se,Ee,Pe,De,Je){for(var Ae=De+(-2&Je)*V;De!=Ae;)M(ne[le+0],de[me+0],Se[Ee+0],Pe,De),M(ne[le+1],de[me+0],Se[Ee+0],Pe,De+V),le+=2,++me,++Ee,De+=2*V;1&Je&&M(ne[le+0],de[me+0],Se[Ee+0],Pe,De)}}function No(P,M,V){return V==0?P==0?M==0?6:5:M==0?4:0:V}function Ws(P,M,V,ne,le){switch(P>>>30){case 3:Vs(M,V,ne,le,0);break;case 2:Nr(M,V,ne,le);break;case 1:Rn(M,V,ne,le)}}function Fr(P,M){var V,ne,le=M.M,de=M.Nb,me=P.oc,Se=P.pc+40,Ee=P.oc,Pe=P.pc+584,De=P.oc,Je=P.pc+600;for(V=0;16>V;++V)me[Se+32*V-1]=129;for(V=0;8>V;++V)Ee[Pe+32*V-1]=129,De[Je+32*V-1]=129;for(0<le?me[Se-1-32]=Ee[Pe-1-32]=De[Je-1-32]=129:(i(me,Se-32-1,127,21),i(Ee,Pe-32-1,127,9),i(De,Je-32-1,127,9)),ne=0;ne<P.za;++ne){var Ae=M.ya[M.aa+ne];if(0<ne){for(V=-1;16>V;++V)r(me,Se+32*V-4,me,Se+32*V+12,4);for(V=-1;8>V;++V)r(Ee,Pe+32*V-4,Ee,Pe+32*V+4,4),r(De,Je+32*V-4,De,Je+32*V+4,4)}var qe=P.Gd,Qe=P.Hd+ne,ht=Ae.ad,Xe=Ae.Hc;if(0<le&&(r(me,Se-32,qe[Qe].y,0,16),r(Ee,Pe-32,qe[Qe].f,0,8),r(De,Je-32,qe[Qe].ea,0,8)),Ae.Za){var ct=me,Ue=Se-32+16;for(0<le&&(ne>=P.za-1?i(ct,Ue,qe[Qe].y[15],4):r(ct,Ue,qe[Qe+1].y,0,4)),V=0;4>V;V++)ct[Ue+128+V]=ct[Ue+256+V]=ct[Ue+384+V]=ct[Ue+0+V];for(V=0;16>V;++V,Xe<<=2)ct=me,Ue=Se+rc[V],Ji[Ae.Ob[V]](ct,Ue),Ws(Xe,ht,16*+V,ct,Ue)}else if(ct=No(ne,le,Ae.Ob[0]),Qi[ct](me,Se),Xe!=0)for(V=0;16>V;++V,Xe<<=2)Ws(Xe,ht,16*+V,me,Se+rc[V]);for(V=Ae.Gc,ct=No(ne,le,Ae.Dd),ma[ct](Ee,Pe),ma[ct](De,Je),Xe=ht,ct=Ee,Ue=Pe,255&(Ae=0|V)&&(170&Ae?ga(Xe,256,ct,Ue):fn(Xe,256,ct,Ue)),Ae=De,Xe=Je,255&(V>>=8)&&(170&V?ga(ht,320,Ae,Xe):fn(ht,320,Ae,Xe)),le<P.Ub-1&&(r(qe[Qe].y,0,me,Se+480,16),r(qe[Qe].f,0,Ee,Pe+224,8),r(qe[Qe].ea,0,De,Je+224,8)),V=8*de*P.B,qe=P.sa,Qe=P.ta+16*ne+16*de*P.R,ht=P.qa,Ae=P.ra+8*ne+V,Xe=P.Ha,ct=P.Ia+8*ne+V,V=0;16>V;++V)r(qe,Qe+V*P.R,me,Se+32*V,16);for(V=0;8>V;++V)r(ht,Ae+V*P.B,Ee,Pe+32*V,8),r(Xe,ct+V*P.B,De,Je+32*V,8)}}function Xa(P,M,V,ne,le,de,me,Se,Ee){var Pe=[0],De=[0],Je=0,Ae=Ee!=null?Ee.kd:0,qe=Ee??new pt;if(P==null||12>V)return 7;qe.data=P,qe.w=M,qe.ha=V,M=[M],V=[V],qe.gb=[qe.gb];e:{var Qe=M,ht=V,Xe=qe.gb;if(t(P!=null),t(ht!=null),t(Xe!=null),Xe[0]=0,12<=ht[0]&&!n(P,Qe[0],"RIFF")){if(n(P,Qe[0]+8,"WEBP")){Xe=3;break e}var ct=tt(P,Qe[0]+4);if(12>ct||4294967286<ct){Xe=3;break e}if(Ae&&ct>ht[0]-8){Xe=7;break e}Xe[0]=ct,Qe[0]+=12,ht[0]-=12}Xe=0}if(Xe!=0)return Xe;for(ct=0<qe.gb[0],V=V[0];;){e:{var Ue=P;ht=M,Xe=V;var mt=Pe,vt=De,Yt=Qe=[0];if((Ut=Je=[Je])[0]=0,8>Xe[0])Xe=7;else{if(!n(Ue,ht[0],"VP8X")){if(tt(Ue,ht[0]+4)!=10){Xe=3;break e}if(18>Xe[0]){Xe=7;break e}var zt=tt(Ue,ht[0]+8),vn=1+ze(Ue,ht[0]+12);if(2147483648<=vn*(Ue=1+ze(Ue,ht[0]+15))){Xe=3;break e}Yt!=null&&(Yt[0]=zt),mt!=null&&(mt[0]=vn),vt!=null&&(vt[0]=Ue),ht[0]+=18,Xe[0]-=18,Ut[0]=1}Xe=0}}if(Je=Je[0],Qe=Qe[0],Xe!=0)return Xe;if(ht=!!(2&Qe),!ct&&Je)return 3;if(de!=null&&(de[0]=!!(16&Qe)),me!=null&&(me[0]=ht),Se!=null&&(Se[0]=0),me=Pe[0],Qe=De[0],Je&&ht&&Ee==null){Xe=0;break}if(4>V){Xe=7;break}if(ct&&Je||!ct&&!Je&&!n(P,M[0],"ALPH")){V=[V],qe.na=[qe.na],qe.P=[qe.P],qe.Sa=[qe.Sa];e:{zt=P,Xe=M,ct=V;var Ut=qe.gb;mt=qe.na,vt=qe.P,Yt=qe.Sa,vn=22,t(zt!=null),t(ct!=null),Ue=Xe[0];var Nn=ct[0];for(t(mt!=null),t(Yt!=null),mt[0]=null,vt[0]=null,Yt[0]=0;;){if(Xe[0]=Ue,ct[0]=Nn,8>Nn){Xe=7;break e}var Hr=tt(zt,Ue+4);if(4294967286<Hr){Xe=3;break e}var _n=8+Hr+1&-2;if(vn+=_n,0<Ut&&vn>Ut){Xe=3;break e}if(!n(zt,Ue,"VP8 ")||!n(zt,Ue,"VP8L")){Xe=0;break e}if(Nn[0]<_n){Xe=7;break e}n(zt,Ue,"ALPH")||(mt[0]=zt,vt[0]=Ue+8,Yt[0]=Hr),Ue+=_n,Nn-=_n}}if(V=V[0],qe.na=qe.na[0],qe.P=qe.P[0],qe.Sa=qe.Sa[0],Xe!=0)break}V=[V],qe.Ja=[qe.Ja],qe.xa=[qe.xa];e:if(Ut=P,Xe=M,ct=V,mt=qe.gb[0],vt=qe.Ja,Yt=qe.xa,zt=Xe[0],Ue=!n(Ut,zt,"VP8 "),vn=!n(Ut,zt,"VP8L"),t(Ut!=null),t(ct!=null),t(vt!=null),t(Yt!=null),8>ct[0])Xe=7;else{if(Ue||vn){if(Ut=tt(Ut,zt+4),12<=mt&&Ut>mt-12){Xe=3;break e}if(Ae&&Ut>ct[0]-8){Xe=7;break e}vt[0]=Ut,Xe[0]+=8,ct[0]-=8,Yt[0]=vn}else Yt[0]=5<=ct[0]&&Ut[zt+0]==47&&!(Ut[zt+4]>>5),vt[0]=ct[0];Xe=0}if(V=V[0],qe.Ja=qe.Ja[0],qe.xa=qe.xa[0],M=M[0],Xe!=0)break;if(4294967286<qe.Ja)return 3;if(Se==null||ht||(Se[0]=qe.xa?2:1),me=[me],Qe=[Qe],qe.xa){if(5>V){Xe=7;break}Se=me,Ae=Qe,ht=de,P==null||5>V?P=0:5<=V&&P[M+0]==47&&!(P[M+4]>>5)?(ct=[0],Ut=[0],mt=[0],re(vt=new z,P,M,V),Fa(vt,ct,Ut,mt)?(Se!=null&&(Se[0]=ct[0]),Ae!=null&&(Ae[0]=Ut[0]),ht!=null&&(ht[0]=mt[0]),P=1):P=0):P=0}else{if(10>V){Xe=7;break}Se=Qe,P==null||10>V||!so(P,M+3,V-3)?P=0:(Ae=P[M+0]|P[M+1]<<8|P[M+2]<<16,ht=16383&(P[M+7]<<8|P[M+6]),P=16383&(P[M+9]<<8|P[M+8]),1&Ae||3<(Ae>>1&7)||!(Ae>>4&1)||Ae>>5>=qe.Ja||!ht||!P?P=0:(me&&(me[0]=ht),Se&&(Se[0]=P),P=1))}if(!P||(me=me[0],Qe=Qe[0],Je&&(Pe[0]!=me||De[0]!=Qe)))return 3;Ee!=null&&(Ee[0]=qe,Ee.offset=M-Ee.w,t(4294967286>M-Ee.w),t(Ee.offset==Ee.ha-V));break}return Xe==0||Xe==7&&Je&&Ee==null?(de!=null&&(de[0]|=qe.na!=null&&0<qe.na.length),ne!=null&&(ne[0]=me),le!=null&&(le[0]=Qe),0):Xe}function yl(P,M,V){var ne=M.width,le=M.height,de=0,me=0,Se=ne,Ee=le;if(M.Da=P!=null&&0<P.Da,M.Da&&(Se=P.cd,Ee=P.bd,de=P.v,me=P.j,11>V||(de&=-2,me&=-2),0>de||0>me||0>=Se||0>=Ee||de+Se>ne||me+Ee>le))return 0;if(M.v=de,M.j=me,M.va=de+Se,M.o=me+Ee,M.U=Se,M.T=Ee,M.da=P!=null&&0<P.da,M.da){if(!ge(Se,Ee,V=[P.ib],de=[P.hb]))return 0;M.ib=V[0],M.hb=de[0]}return M.ob=P!=null&&P.ob,M.Kb=P==null||!P.Sd,M.da&&(M.ob=M.ib<3*ne/4&&M.hb<3*le/4,M.Kb=0),1}function Fl(P){if(P==null)return 2;if(11>P.S){var M=P.f.RGBA;M.fb+=(P.height-1)*M.A,M.A=-M.A}else M=P.f.kb,P=P.height,M.O+=(P-1)*M.fa,M.fa=-M.fa,M.N+=(P-1>>1)*M.Ab,M.Ab=-M.Ab,M.W+=(P-1>>1)*M.Db,M.Db=-M.Db,M.F!=null&&(M.J+=(P-1)*M.lb,M.lb=-M.lb);return 0}function $i(P,M,V,ne){if(ne==null||0>=P||0>=M)return 2;if(V!=null){if(V.Da){var le=V.cd,de=V.bd,me=-2&V.v,Se=-2&V.j;if(0>me||0>Se||0>=le||0>=de||me+le>P||Se+de>M)return 2;P=le,M=de}if(V.da){if(!ge(P,M,le=[V.ib],de=[V.hb]))return 2;P=le[0],M=de[0]}}ne.width=P,ne.height=M;e:{var Ee=ne.width,Pe=ne.height;if(P=ne.S,0>=Ee||0>=Pe||!(P>=Ul&&13>P))P=2;else{if(0>=ne.Rd&&ne.sd==null){me=de=le=M=0;var De=(Se=Ee*Wl[P])*Pe;if(11>P||(de=(Pe+1)/2*(M=(Ee+1)/2),P==12&&(me=(le=Ee)*Pe)),(Pe=a(De+2*de+me))==null){P=1;break e}ne.sd=Pe,11>P?((Ee=ne.f.RGBA).eb=Pe,Ee.fb=0,Ee.A=Se,Ee.size=De):((Ee=ne.f.kb).y=Pe,Ee.O=0,Ee.fa=Se,Ee.Fd=De,Ee.f=Pe,Ee.N=0+De,Ee.Ab=M,Ee.Cd=de,Ee.ea=Pe,Ee.W=0+De+de,Ee.Db=M,Ee.Ed=de,P==12&&(Ee.F=Pe,Ee.J=0+De+2*de),Ee.Tc=me,Ee.lb=le)}if(M=1,le=ne.S,de=ne.width,me=ne.height,le>=Ul&&13>le)if(11>le)P=ne.f.RGBA,M&=(Se=Math.abs(P.A))*(me-1)+de<=P.size,M&=Se>=de*Wl[le],M&=P.eb!=null;else{P=ne.f.kb,Se=(de+1)/2,De=(me+1)/2,Ee=Math.abs(P.fa),Pe=Math.abs(P.Ab);var Je=Math.abs(P.Db),Ae=Math.abs(P.lb),qe=Ae*(me-1)+de;M&=Ee*(me-1)+de<=P.Fd,M&=Pe*(De-1)+Se<=P.Cd,M=(M&=Je*(De-1)+Se<=P.Ed)&Ee>=de&Pe>=Se&Je>=Se,M&=P.y!=null,M&=P.f!=null,M&=P.ea!=null,le==12&&(M&=Ae>=de,M&=qe<=P.Tc,M&=P.F!=null)}else M=0;P=M?0:2}}return P!=0||V!=null&&V.fd&&(P=Fl(ne)),P}var Ni=64,Na=[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],Ka=24,da=32,Zi=8,To=[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];Me("Predictor0","PredictorAdd0"),j.Predictor0=function(){return 4278190080},j.Predictor1=function(P){return P},j.Predictor2=function(P,M,V){return M[V+0]},j.Predictor3=function(P,M,V){return M[V+1]},j.Predictor4=function(P,M,V){return M[V-1]},j.Predictor5=function(P,M,V){return ye(ye(P,M[V+1]),M[V+0])},j.Predictor6=function(P,M,V){return ye(P,M[V-1])},j.Predictor7=function(P,M,V){return ye(P,M[V+0])},j.Predictor8=function(P,M,V){return ye(M[V-1],M[V+0])},j.Predictor9=function(P,M,V){return ye(M[V+0],M[V+1])},j.Predictor10=function(P,M,V){return ye(ye(P,M[V-1]),ye(M[V+0],M[V+1]))},j.Predictor11=function(P,M,V){var ne=M[V+0];return 0>=Le(ne>>24&255,P>>24&255,(M=M[V-1])>>24&255)+Le(ne>>16&255,P>>16&255,M>>16&255)+Le(ne>>8&255,P>>8&255,M>>8&255)+Le(255&ne,255&P,255&M)?ne:P},j.Predictor12=function(P,M,V){var ne=M[V+0];return(we((P>>24&255)+(ne>>24&255)-((M=M[V-1])>>24&255))<<24|we((P>>16&255)+(ne>>16&255)-(M>>16&255))<<16|we((P>>8&255)+(ne>>8&255)-(M>>8&255))<<8|we((255&P)+(255&ne)-(255&M)))>>>0},j.Predictor13=function(P,M,V){var ne=M[V-1];return(je((P=ye(P,M[V+0]))>>24&255,ne>>24&255)<<24|je(P>>16&255,ne>>16&255)<<16|je(P>>8&255,ne>>8&255)<<8|je(255&P,255&ne))>>>0};var ds=j.PredictorAdd0;j.PredictorAdd1=Ye,Me("Predictor2","PredictorAdd2"),Me("Predictor3","PredictorAdd3"),Me("Predictor4","PredictorAdd4"),Me("Predictor5","PredictorAdd5"),Me("Predictor6","PredictorAdd6"),Me("Predictor7","PredictorAdd7"),Me("Predictor8","PredictorAdd8"),Me("Predictor9","PredictorAdd9"),Me("Predictor10","PredictorAdd10"),Me("Predictor11","PredictorAdd11"),Me("Predictor12","PredictorAdd12"),Me("Predictor13","PredictorAdd13");var go=j.PredictorAdd2;dt("ColorIndexInverseTransform","MapARGB","32b",function(P){return P>>8&255},function(P){return P}),dt("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(P){return P},function(P){return P>>8&255});var ri,Yo=j.ColorIndexInverseTransform,di=j.MapARGB,Ta=j.VP8LColorIndexInverseTransformAlpha,Ro=j.MapAlpha,pa=j.VP8LPredictorsAdd=[];pa.length=16,(j.VP8LPredictors=[]).length=16,(j.VP8LPredictorsAdd_C=[]).length=16,(j.VP8LPredictors_C=[]).length=16;var bl,Xo,ps,gs,rr,ms,vs,Vs,Nr,ga,Rn,fn,Pn,Mn,Za,Ys,ys,Xs,Ti,wl,yu,Zu,Qa,Hi,Ko,Qu,Bl,Mc,Ic=a(511),jc=a(2041),Dc=a(225),Fc=a(767),Bc=0,Zo=jc,zl=Dc,Ri=Fc,mo=Ic,Ul=0,Qo=1,jf=2,ql=3,bu=4,gr=5,Ju=6,$l=7,Ks=8,wu=9,xu=10,_u=[2,3,7],zc=[3,3,11],xl=[280,256,256,256,40],Nh=[0,1,1,1,0],Nd=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Th=[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],Df=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],ec=8,Zs=[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],tc=[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],Hl=null,Ff=[[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]],vo=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],Uc=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],nc=[[[[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]]]],Rh=[[[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]]],Mh=[[[[255,255,255,255,255,255,255,255,255,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]]]],qc=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Qi=[],Ji=[],ma=[],Mo=1,Su=2,ea=[],Ra=[];qs("UpsampleRgbLinePair",Gs,3),qs("UpsampleBgrLinePair",Ei,3),qs("UpsampleRgbaLinePair",ha,4),qs("UpsampleBgraLinePair",Dl,4),qs("UpsampleArgbLinePair",jl,4),qs("UpsampleRgba4444LinePair",Lo,2),qs("UpsampleRgb565LinePair",hs,2);var Ih=j.UpsampleRgbLinePair,jh=j.UpsampleBgrLinePair,Qs=j.UpsampleRgbaLinePair,Eu=j.UpsampleBgraLinePair,ki=j.UpsampleArgbLinePair,Mi=j.UpsampleRgba4444LinePair,$c=j.UpsampleRgb565LinePair,bs=16,Io=1<<bs-1,ir=-227,ur=482,ws=6,Gi=0,va=a(256),_l=a(256),Gl=a(256),ya=a(256),ku=a(ur-ir),Bf=a(ur-ir);po("YuvToRgbRow",Gs,3),po("YuvToBgrRow",Ei,3),po("YuvToRgbaRow",ha,4),po("YuvToBgraRow",Dl,4),po("YuvToArgbRow",jl,4),po("YuvToRgba4444Row",Lo,2),po("YuvToRgb565Row",hs,2);var rc=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],xs=[0,2,8],Dh=[8,7,6,4,4,2,2,2,1,1,1,1],_s=1;this.WebPDecodeRGBA=function(P,M,V,ne,le){var de=Qo,me=new ft,Se=new tn;me.ba=Se,Se.S=de,Se.width=[Se.width],Se.height=[Se.height];var Ee=Se.width,Pe=Se.height,De=new Wt;if(De==null||P==null)var Je=2;else t(De!=null),Je=Xa(P,M,V,De.width,De.height,De.Pd,De.Qd,De.format,null);if(Je!=0?Ee=0:(Ee!=null&&(Ee[0]=De.width[0]),Pe!=null&&(Pe[0]=De.height[0]),Ee=1),Ee){Se.width=Se.width[0],Se.height=Se.height[0],ne!=null&&(ne[0]=Se.width),le!=null&&(le[0]=Se.height);e:{if(ne=new oo,(le=new pt).data=P,le.w=M,le.ha=V,le.kd=1,M=[0],t(le!=null),((P=Xa(le.data,le.w,le.ha,null,null,null,M,null,le))==0||P==7)&&M[0]&&(P=4),(M=P)==0){if(t(me!=null),ne.data=le.data,ne.w=le.w+le.offset,ne.ha=le.ha-le.offset,ne.put=Jt,ne.ac=dr,ne.bc=ua,ne.ma=me,le.xa){if((P=Wo())==null){me=1;break e}if((function(Ae,qe){var Qe=[0],ht=[0],Xe=[0];t:for(;;){if(Ae==null)return 0;if(qe==null)return Ae.a=2,0;if(Ae.l=qe,Ae.a=0,re(Ae.m,qe.data,qe.w,qe.ha),!Fa(Ae.m,Qe,ht,Xe)){Ae.a=3;break t}if(Ae.xb=Su,qe.width=Qe[0],qe.height=ht[0],!zi(Qe[0],ht[0],1,Ae,null))break t;return 1}return t(Ae.a!=0),0})(P,ne)){if(ne=(M=$i(ne.width,ne.height,me.Oa,me.ba))==0){t:{ne=P;n:for(;;){if(ne==null){ne=0;break t}if(t(ne.s.yc!=null),t(ne.s.Ya!=null),t(0<ne.s.Wb),t((V=ne.l)!=null),t((le=V.ma)!=null),ne.xb!=0){if(ne.ca=le.ba,ne.tb=le.tb,t(ne.ca!=null),!yl(le.Oa,V,ql)){ne.a=2;break n}if(!ao(ne,V.width)||V.da)break n;if((V.da||At(ne.ca.S))&&Ya(),11>ne.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),ne.ca.f.kb.F!=null&&Ya()),ne.Pb&&0<ne.s.ua&&ne.s.vb.X==null&&!pe(ne.s.vb,ne.s.Wa.Xa)){ne.a=1;break n}ne.xb=0}if(!Aa(ne,ne.V,ne.Ba,ne.c,ne.i,V.o,Go))break n;le.Dc=ne.Ma,ne=1;break t}t(ne.a!=0),ne=0}ne=!ne}ne&&(M=P.a)}else M=P.a}else{if((P=new Ui)==null){me=1;break e}if(P.Fa=le.na,P.P=le.P,P.qc=le.Sa,qi(P,ne)){if((M=$i(ne.width,ne.height,me.Oa,me.ba))==0){if(P.Aa=0,V=me.Oa,t((le=P)!=null),V!=null){if(0<(Ee=0>(Ee=V.Md)?0:100<Ee?255:255*Ee/100)){for(Pe=De=0;4>Pe;++Pe)12>(Je=le.pb[Pe]).lc&&(Je.ia=Ee*Dh[0>Je.lc?0:Je.lc]>>3),De|=Je.ia;De&&(alert("todo:VP8InitRandom"),le.ia=1)}le.Ga=V.Id,100<le.Ga?le.Ga=100:0>le.Ga&&(le.Ga=0)}(function(Ae,qe){if(Ae==null)return 0;if(qe==null)return Gn(Ae,2,"NULL VP8Io parameter in VP8Decode().");if(!Ae.cb&&!qi(Ae,qe))return 0;if(t(Ae.cb),qe.ac==null||qe.ac(qe)){qe.ob&&(Ae.L=0);var Qe=xs[Ae.L];if(Ae.L==2?(Ae.yb=0,Ae.zb=0):(Ae.yb=qe.v-Qe>>4,Ae.zb=qe.j-Qe>>4,0>Ae.yb&&(Ae.yb=0),0>Ae.zb&&(Ae.zb=0)),Ae.Va=qe.o+15+Qe>>4,Ae.Hb=qe.va+15+Qe>>4,Ae.Hb>Ae.za&&(Ae.Hb=Ae.za),Ae.Va>Ae.Ub&&(Ae.Va=Ae.Ub),0<Ae.L){var ht=Ae.ed;for(Qe=0;4>Qe;++Qe){var Xe;if(Ae.Qa.Cb){var ct=Ae.Qa.Lb[Qe];Ae.Qa.Fb||(ct+=ht.Tb)}else ct=ht.Tb;for(Xe=0;1>=Xe;++Xe){var Ue=Ae.gd[Qe][Xe],mt=ct;if(ht.Pc&&(mt+=ht.vd[0],Xe&&(mt+=ht.od[0])),0<(mt=0>mt?0:63<mt?63:mt)){var vt=mt;0<ht.wb&&(vt=4<ht.wb?vt>>2:vt>>1)>9-ht.wb&&(vt=9-ht.wb),1>vt&&(vt=1),Ue.dd=vt,Ue.tc=2*mt+vt,Ue.ld=40<=mt?2:15<=mt?1:0}else Ue.tc=0;Ue.La=Xe}}}Qe=0}else Gn(Ae,6,"Frame setup failed"),Qe=Ae.a;if(Qe=Qe==0){if(Qe){Ae.$c=0,0<Ae.Aa||(Ae.Ic=_s);t:{Qe=Ae.Ic,ht=4*(vt=Ae.za);var Yt=32*vt,zt=vt+1,vn=0<Ae.L?vt*(0<Ae.Aa?2:1):0,Ut=(Ae.Aa==2?2:1)*vt;if((Ue=ht+832+(Xe=3*(16*Qe+xs[Ae.L])/2*Yt)+(ct=Ae.Fa!=null&&0<Ae.Fa.length?Ae.Kc.c*Ae.Kc.i:0))!=Ue)Qe=0;else{if(Ue>Ae.Vb){if(Ae.Vb=0,Ae.Ec=a(Ue),Ae.Fc=0,Ae.Ec==null){Qe=Gn(Ae,1,"no memory during frame initialization.");break t}Ae.Vb=Ue}Ue=Ae.Ec,mt=Ae.Fc,Ae.Ac=Ue,Ae.Bc=mt,mt+=ht,Ae.Gd=o(Yt,wi),Ae.Hd=0,Ae.rb=o(zt+1,ss),Ae.sb=1,Ae.wa=vn?o(vn,Oa):null,Ae.Y=0,Ae.D.Nb=0,Ae.D.wa=Ae.wa,Ae.D.Y=Ae.Y,0<Ae.Aa&&(Ae.D.Y+=vt),t(!0),Ae.oc=Ue,Ae.pc=mt,mt+=832,Ae.ya=o(Ut,hl),Ae.aa=0,Ae.D.ya=Ae.ya,Ae.D.aa=Ae.aa,Ae.Aa==2&&(Ae.D.aa+=vt),Ae.R=16*vt,Ae.B=8*vt,vt=(Yt=xs[Ae.L])*Ae.R,Yt=Yt/2*Ae.B,Ae.sa=Ue,Ae.ta=mt+vt,Ae.qa=Ae.sa,Ae.ra=Ae.ta+16*Qe*Ae.R+Yt,Ae.Ha=Ae.qa,Ae.Ia=Ae.ra+8*Qe*Ae.B+Yt,Ae.$c=0,mt+=Xe,Ae.mb=ct?Ue:null,Ae.nb=ct?mt:null,t(mt+ct<=Ae.Fc+Ae.Vb),ls(Ae),i(Ae.Ac,Ae.Bc,0,ht),Qe=1}}if(Qe){if(qe.ka=0,qe.y=Ae.sa,qe.O=Ae.ta,qe.f=Ae.qa,qe.N=Ae.ra,qe.ea=Ae.Ha,qe.Vd=Ae.Ia,qe.fa=Ae.R,qe.Rc=Ae.B,qe.F=null,qe.J=0,!Bc){for(Qe=-255;255>=Qe;++Qe)Ic[255+Qe]=0>Qe?-Qe:Qe;for(Qe=-1020;1020>=Qe;++Qe)jc[1020+Qe]=-128>Qe?-128:127<Qe?127:Qe;for(Qe=-112;112>=Qe;++Qe)Dc[112+Qe]=-16>Qe?-16:15<Qe?15:Qe;for(Qe=-255;510>=Qe;++Qe)Fc[255+Qe]=0>Qe?0:255<Qe?255:Qe;Bc=1}vs=cs,Vs=Rl,ga=us,Rn=pu,fn=jn,Nr=Ca,Pn=ni,Mn=_i,Za=ce,Ys=Oe,ys=Va,Xs=q,Ti=Ie,wl=He,yu=Wa,Zu=fo,Qa=ml,Hi=fs,Ji[0]=Rc,Ji[1]=dl,Ji[2]=Co,Ji[3]=Tc,Ji[4]=uo,Ji[5]=gu,Ji[6]=Er,Ji[7]=mu,Ji[8]=Ku,Ji[9]=Bs,Qi[0]=za,Qi[1]=Nc,Qi[2]=pl,Qi[3]=Ml,Qi[4]=Ua,Qi[5]=qa,Qi[6]=Ln,ma[0]=vu,ma[1]=Lc,ma[2]=$a,ma[3]=fa,ma[4]=co,ma[5]=La,ma[6]=zs,Qe=1}else Qe=0}Qe&&(Qe=(function(Nn,Hr){for(Nn.M=0;Nn.M<Nn.Va;++Nn.M){var _n,Bt=Nn.Jc[Nn.M&Nn.Xb],Et=Nn.m,Gr=Nn;for(_n=0;_n<Gr.za;++_n){var Ht=Et,yn=Gr,Fn=yn.Ac,Ai=yn.Bc+4*_n,pi=yn.zc,Wn=yn.ya[yn.aa+_n];if(yn.Qa.Bb?Wn.$b=_e(Ht,yn.Pa.jb[0])?2+_e(Ht,yn.Pa.jb[2]):_e(Ht,yn.Pa.jb[1]):Wn.$b=0,yn.kc&&(Wn.Ad=_e(Ht,yn.Bd)),Wn.Za=!_e(Ht,145)+0,Wn.Za){var Pi=Wn.Ob,wr=0;for(yn=0;4>yn;++yn){var Br,In=pi[0+yn];for(Br=0;4>Br;++Br){In=Rh[Fn[Ai+Br]][In];for(var Yn=Uc[_e(Ht,In[0])];0<Yn;)Yn=Uc[2*Yn+_e(Ht,In[Yn])];In=-Yn,Fn[Ai+Br]=In}r(Pi,wr,Fn,Ai,4),wr+=4,pi[0+yn]=In}}else In=_e(Ht,156)?_e(Ht,128)?1:3:_e(Ht,163)?2:0,Wn.Ob[0]=In,i(Fn,Ai,In,4),i(pi,0,In,4);Wn.Dd=_e(Ht,142)?_e(Ht,114)?_e(Ht,183)?1:3:2:0}if(Gr.m.Ka)return Gn(Nn,7,"Premature end-of-partition0 encountered.");for(;Nn.ja<Nn.za;++Nn.ja){if(Gr=Bt,Ht=(Et=Nn).rb[Et.sb-1],Fn=Et.rb[Et.sb+Et.ja],_n=Et.ya[Et.aa+Et.ja],Ai=Et.kc?_n.Ad:0)Ht.la=Fn.la=0,_n.Za||(Ht.Na=Fn.Na=0),_n.Hc=0,_n.Gc=0,_n.ia=0;else{var Tr,Xn;if(Ht=Fn,Fn=Gr,Ai=Et.Pa.Xc,pi=Et.ya[Et.aa+Et.ja],Wn=Et.pb[pi.$b],yn=pi.ad,Pi=0,wr=Et.rb[Et.sb-1],In=Br=0,i(yn,Pi,0,384),pi.Za)var Rr=0,Mr=Ai[3];else{Yn=a(16);var ar=Ht.Na+wr.Na;if(ar=Hl(Fn,Ai[1],ar,Wn.Eb,0,Yn,0),Ht.Na=wr.Na=(0<ar)+0,1<ar)vs(Yn,0,yn,Pi);else{var Ii=Yn[0]+3>>3;for(Yn=0;256>Yn;Yn+=16)yn[Pi+Yn]=Ii}Rr=1,Mr=Ai[0]}var Jn=15&Ht.la,er=15&wr.la;for(Yn=0;4>Yn;++Yn){var ii=1&er;for(Ii=Xn=0;4>Ii;++Ii)Jn=Jn>>1|(ii=(ar=Hl(Fn,Mr,ar=ii+(1&Jn),Wn.Sc,Rr,yn,Pi))>Rr)<<7,Xn=Xn<<2|(3<ar?3:1<ar?2:yn[Pi+0]!=0),Pi+=16;Jn>>=4,er=er>>1|ii<<7,Br=(Br<<8|Xn)>>>0}for(Mr=Jn,Rr=er>>4,Tr=0;4>Tr;Tr+=2){for(Xn=0,Jn=Ht.la>>4+Tr,er=wr.la>>4+Tr,Yn=0;2>Yn;++Yn){for(ii=1&er,Ii=0;2>Ii;++Ii)ar=ii+(1&Jn),Jn=Jn>>1|(ii=0<(ar=Hl(Fn,Ai[2],ar,Wn.Qc,0,yn,Pi)))<<3,Xn=Xn<<2|(3<ar?3:1<ar?2:yn[Pi+0]!=0),Pi+=16;Jn>>=2,er=er>>1|ii<<5}In|=Xn<<4*Tr,Mr|=Jn<<4<<Tr,Rr|=(240&er)<<Tr}Ht.la=Mr,wr.la=Rr,pi.Hc=Br,pi.Gc=In,pi.ia=43690&In?0:Wn.ia,Ai=!(Br|In)}if(0<Et.L&&(Et.wa[Et.Y+Et.ja]=Et.gd[_n.$b][_n.Za],Et.wa[Et.Y+Et.ja].La|=!Ai),Gr.Ka)return Gn(Nn,7,"Premature end-of-file encountered.")}if(ls(Nn),Et=Hr,Gr=1,_n=(Bt=Nn).D,Ht=0<Bt.L&&Bt.M>=Bt.zb&&Bt.M<=Bt.Va,Bt.Aa==0)t:{if(_n.M=Bt.M,_n.uc=Ht,Fr(Bt,_n),Gr=1,_n=(Xn=Bt.D).Nb,Ht=(In=xs[Bt.L])*Bt.R,Fn=In/2*Bt.B,Yn=16*_n*Bt.R,Ii=8*_n*Bt.B,Ai=Bt.sa,pi=Bt.ta-Ht+Yn,Wn=Bt.qa,yn=Bt.ra-Fn+Ii,Pi=Bt.Ha,wr=Bt.Ia-Fn+Ii,er=(Jn=Xn.M)==0,Br=Jn>=Bt.Va-1,Bt.Aa==2&&Fr(Bt,Xn),Xn.uc)for(ii=(ar=Bt).D.M,t(ar.D.uc),Xn=ar.yb;Xn<ar.Hb;++Xn){Rr=Xn,Mr=ii;var ji=(ba=(On=ar).D).Nb;Tr=On.R;var ba=ba.wa[ba.Y+Rr],ai=On.sa,Wr=On.ta+16*ji*Tr+16*Rr,wa=ba.dd,or=ba.tc;if(or!=0)if(t(3<=or),On.L==1)0<Rr&&Zu(ai,Wr,Tr,or+4),ba.La&&Hi(ai,Wr,Tr,or),0<Mr&&yu(ai,Wr,Tr,or+4),ba.La&&Qa(ai,Wr,Tr,or);else{var Wi=On.B,Kn=On.qa,dn=On.ra+8*ji*Wi+8*Rr,Bn=On.Ha,On=On.Ia+8*ji*Wi+8*Rr;ji=ba.ld,0<Rr&&(Mn(ai,Wr,Tr,or+4,wa,ji),Ys(Kn,dn,Bn,On,Wi,or+4,wa,ji)),ba.La&&(Xs(ai,Wr,Tr,or,wa,ji),wl(Kn,dn,Bn,On,Wi,or,wa,ji)),0<Mr&&(Pn(ai,Wr,Tr,or+4,wa,ji),Za(Kn,dn,Bn,On,Wi,or+4,wa,ji)),ba.La&&(ys(ai,Wr,Tr,or,wa,ji),Ti(Kn,dn,Bn,On,Wi,or,wa,ji))}}if(Bt.ia&&alert("todo:DitherRow"),Et.put!=null){if(Xn=16*Jn,Jn=16*(Jn+1),er?(Et.y=Bt.sa,Et.O=Bt.ta+Yn,Et.f=Bt.qa,Et.N=Bt.ra+Ii,Et.ea=Bt.Ha,Et.W=Bt.Ia+Ii):(Xn-=In,Et.y=Ai,Et.O=pi,Et.f=Wn,Et.N=yn,Et.ea=Pi,Et.W=wr),Br||(Jn-=In),Jn>Et.o&&(Jn=Et.o),Et.F=null,Et.J=null,Bt.Fa!=null&&0<Bt.Fa.length&&Xn<Jn&&(Et.J=lr(Bt,Et,Xn,Jn-Xn),Et.F=Bt.mb,Et.F==null&&Et.F.length==0)){Gr=Gn(Bt,3,"Could not decode alpha data.");break t}Xn<Et.j&&(In=Et.j-Xn,Xn=Et.j,t(!(1&In)),Et.O+=Bt.R*In,Et.N+=Bt.B*(In>>1),Et.W+=Bt.B*(In>>1),Et.F!=null&&(Et.J+=Et.width*In)),Xn<Jn&&(Et.O+=Et.v,Et.N+=Et.v>>1,Et.W+=Et.v>>1,Et.F!=null&&(Et.J+=Et.v),Et.ka=Xn-Et.j,Et.U=Et.va-Et.v,Et.T=Jn-Xn,Gr=Et.put(Et))}_n+1!=Bt.Ic||Br||(r(Bt.sa,Bt.ta-Ht,Ai,pi+16*Bt.R,Ht),r(Bt.qa,Bt.ra-Fn,Wn,yn+8*Bt.B,Fn),r(Bt.Ha,Bt.Ia-Fn,Pi,wr+8*Bt.B,Fn))}if(!Gr)return Gn(Nn,6,"Output aborted.")}return 1})(Ae,qe)),qe.bc!=null&&qe.bc(qe),Qe&=1}return Qe?(Ae.cb=0,Qe):0})(P,ne)||(M=P.a)}}else M=P.a}M==0&&me.Oa!=null&&me.Oa.fd&&(M=Fl(me.ba))}me=M}de=me!=0?null:11>de?Se.f.RGBA.eb:Se.f.kb.y}else de=null;return de};var Wl=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function h(j,D){for(var C="",N=0;N<4;N++)C+=String.fromCharCode(j[D++]);return C}function c(j,D){return j[D+0]|j[D+1]<<8}function m(j,D){return(j[D+0]|j[D+1]<<8|j[D+2]<<16)>>>0}function g(j,D){return(j[D+0]|j[D+1]<<8|j[D+2]<<16|j[D+3]<<24)>>>0}new u;var d=[0],y=[0],_=[],x=new u,b=e,S=(function(j,D){var C={},N=0,$=!1,G=0,te=0;if(C.frames=[],!(function(F,z){for(var Y=0;Y<4;Y++)if(F[z+Y]!="RIFF".charCodeAt(Y))return!0;return!1})(j,D)){for(g(j,D+=4),D+=8;D<j.length;){var se=h(j,D),ee=g(j,D+=4);D+=4;var Q=ee+(1&ee);switch(se){case"VP8 ":case"VP8L":C.frames[N]===void 0&&(C.frames[N]={}),(B=C.frames[N]).src_off=$?te:D-8,B.src_size=G+ee+8,N++,$&&($=!1,G=0,te=0);break;case"VP8X":(B=C.header={}).feature_flags=j[D];var re=D+4;B.canvas_width=1+m(j,re),re+=3,B.canvas_height=1+m(j,re),re+=3;break;case"ALPH":$=!0,G=Q+8,te=D-8;break;case"ANIM":(B=C.header).bgcolor=g(j,D),re=D+4,B.loop_count=c(j,re),re+=2;break;case"ANMF":var X,B;(B=C.frames[N]={}).offset_x=2*m(j,D),D+=3,B.offset_y=2*m(j,D),D+=3,B.width=1+m(j,D),D+=3,B.height=1+m(j,D),D+=3,B.duration=m(j,D),D+=3,X=j[D++],B.dispose=1&X,B.blend=X>>1&1}se!="ANMF"&&(D+=Q)}return C}})(b,0);S.response=b,S.rgbaoutput=!0,S.dataurl=!1;var k=S.header?S.header:null,E=S.frames?S.frames:null;if(k){k.loop_counter=k.loop_count,d=[k.canvas_height],y=[k.canvas_width];for(var A=0;A<E.length&&E[A].blend!=0;A++);}var R=E[0],O=x.WebPDecodeRGBA(b,R.src_off,R.src_size,y,d);R.rgba=O,R.imgwidth=y[0],R.imgheight=d[0];for(var I=0;I<y[0]*d[0]*4;I++)_[I]=O[I];return this.width=y,this.height=d,this.data=_,this}(function(e){var t,n,r,i,a,o,s,u,h,c=function(F){return F=F||{},this.isStrokeTransparent=F.isStrokeTransparent||!1,this.strokeOpacity=F.strokeOpacity||1,this.strokeStyle=F.strokeStyle||"#000000",this.fillStyle=F.fillStyle||"#000000",this.isFillTransparent=F.isFillTransparent||!1,this.fillOpacity=F.fillOpacity||1,this.font=F.font||"10px sans-serif",this.textBaseline=F.textBaseline||"alphabetic",this.textAlign=F.textAlign||"left",this.lineWidth=F.lineWidth||1,this.lineJoin=F.lineJoin||"miter",this.lineCap=F.lineCap||"butt",this.path=F.path||[],this.transform=F.transform!==void 0?F.transform.clone():new u,this.globalCompositeOperation=F.globalCompositeOperation||"normal",this.globalAlpha=F.globalAlpha||1,this.clip_path=F.clip_path||[],this.currentPoint=F.currentPoint||new o,this.miterLimit=F.miterLimit||10,this.lastPoint=F.lastPoint||new o,this.lineDashOffset=F.lineDashOffset||0,this.lineDash=F.lineDash||[],this.margin=F.margin||[0,0,0,0],this.prevPageLastElemOffset=F.prevPageLastElemOffset||0,this.ignoreClearRect=typeof F.ignoreClearRect!="boolean"||F.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new m(this),t=this.internal.f2,n=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,a=this.internal.getVerticalCoordinate,o=this.internal.Point,s=this.internal.Rectangle,u=this.internal.Matrix,h=new c}]);var m=function(F){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var z=F;Object.defineProperty(this,"pdf",{get:function(){return z}});var Y=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return Y},set:function(pe){Y=!!pe}});var J=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return J},set:function(pe){J=!!pe}});var K=0;Object.defineProperty(this,"posX",{get:function(){return K},set:function(pe){isNaN(pe)||(K=pe)}});var ie=0;Object.defineProperty(this,"posY",{get:function(){return ie},set:function(pe){isNaN(pe)||(ie=pe)}}),Object.defineProperty(this,"margin",{get:function(){return h.margin},set:function(pe){var ut;typeof pe=="number"?ut=[pe,pe,pe,pe]:((ut=new Array(4))[0]=pe[0],ut[1]=pe.length>=2?pe[1]:ut[0],ut[2]=pe.length>=3?pe[2]:ut[0],ut[3]=pe.length>=4?pe[3]:ut[1]),h.margin=ut}});var fe=!1;Object.defineProperty(this,"autoPaging",{get:function(){return fe},set:function(pe){fe=pe}});var ue=0;Object.defineProperty(this,"lastBreak",{get:function(){return ue},set:function(pe){ue=pe}});var _e=[];Object.defineProperty(this,"pageBreaks",{get:function(){return _e},set:function(pe){_e=pe}}),Object.defineProperty(this,"ctx",{get:function(){return h},set:function(pe){pe instanceof c&&(h=pe)}}),Object.defineProperty(this,"path",{get:function(){return h.path},set:function(pe){h.path=pe}});var Ce=[];Object.defineProperty(this,"ctxStack",{get:function(){return Ce},set:function(pe){Ce=pe}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(pe){var ut;ut=g(pe),this.ctx.fillStyle=ut.style,this.ctx.isFillTransparent=ut.a===0,this.ctx.fillOpacity=ut.a,this.pdf.setFillColor(ut.r,ut.g,ut.b,{a:ut.a}),this.pdf.setTextColor(ut.r,ut.g,ut.b,{a:ut.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(pe){var ut=g(pe);this.ctx.strokeStyle=ut.style,this.ctx.isStrokeTransparent=ut.a===0,this.ctx.strokeOpacity=ut.a,ut.a===0?this.pdf.setDrawColor(255,255,255):(ut.a,this.pdf.setDrawColor(ut.r,ut.g,ut.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(pe){["butt","round","square"].indexOf(pe)!==-1&&(this.ctx.lineCap=pe,this.pdf.setLineCap(pe))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(pe){isNaN(pe)||(this.ctx.lineWidth=pe,this.pdf.setLineWidth(pe))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(pe){["bevel","round","miter"].indexOf(pe)!==-1&&(this.ctx.lineJoin=pe,this.pdf.setLineJoin(pe))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(pe){isNaN(pe)||(this.ctx.miterLimit=pe,this.pdf.setMiterLimit(pe))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(pe){this.ctx.textBaseline=pe}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(pe){["right","end","center","left","start"].indexOf(pe)!==-1&&(this.ctx.textAlign=pe)}});var $e=null,ze=null,tt=null;Object.defineProperty(this,"fontFaces",{get:function(){return tt},set:function(pe){$e=null,ze=null,tt=pe}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(pe){var ut;if(this.ctx.font=pe,(ut=/^\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-z0-9]+?)\s*$/i.exec(pe))!==null){var be=ut[1];ut[2];var ge=ut[3],xe=ut[4];ut[5];var Te=ut[6],Me=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(xe)[2];xe=Math.floor(Me==="px"?parseFloat(xe)*this.pdf.internal.scaleFactor:Me==="em"?parseFloat(xe)*this.pdf.getFontSize():parseFloat(xe)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(xe);var ve=(function(dt){var Ct,Zt,on=[],an=dt.trim();if(an==="")return Vm;if(an in zw)return[zw[an]];for(;an!=="";){switch(Zt=null,Ct=(an=qw(an)).charAt(0)){case'"':case"'":Zt=hj(an.substring(1),Ct);break;default:Zt=dj(an)}if(Zt===null||(on.push(Zt[0]),(an=qw(Zt[1]))!==""&&an.charAt(0)!==","))return Vm;an=an.replace(/^,/,"")}return on})(Te);if(this.fontFaces){var ye=(function(dt,Ct){var Zt=dt.getFontList(),on=JSON.stringify(Zt);if($e===null||ze!==on){var an=(function(We){var Be=[];return Object.keys(We).forEach(function($t){We[$t].forEach(function(At){var Lt=null;switch(At){case"bold":Lt={family:$t,weight:"bold"};break;case"italic":Lt={family:$t,style:"italic"};break;case"bolditalic":Lt={family:$t,weight:"bold",style:"italic"};break;case"":case"normal":Lt={family:$t}}Lt!==null&&(Lt.ref={name:$t,style:At},Be.push(Lt))})}),Be})(Zt);$e=(function(We){for(var Be={},$t=0;$t<We.length;++$t){var At=Wm(We[$t]),Lt=At.family,Tt=At.stretch,tn=At.style,Wt=At.weight;Be[Lt]=Be[Lt]||{},Be[Lt][Tt]=Be[Lt][Tt]||{},Be[Lt][Tt][tn]=Be[Lt][Tt][tn]||{},Be[Lt][Tt][tn][Wt]=At}return Be})(an.concat(Ct)),ze=on}return $e})(this.pdf,this.fontFaces),we=ve.map(function(dt){return{family:dt,stretch:"normal",weight:ge,style:be}}),je=(function(dt,Ct,Zt){for(var on=(Zt=Zt||{}).defaultFontFamily||"times",an=Object.assign({},fj,Zt.genericFontFamilies||{}),We=null,Be=null,$t=0;$t<Ct.length;++$t)if(an[(We=Wm(Ct[$t])).family]&&(We.family=an[We.family]),dt.hasOwnProperty(We.family)){Be=dt[We.family];break}if(!(Be=Be||dt[on]))throw new Error("Could not find a font-family for the rule '"+Uw(We)+"' and default family '"+on+"'.");if(Be=(function(At,Lt){if(Lt[At])return Lt[At];var Tt=Uv[At],tn=Tt<=Uv.normal?-1:1,Wt=Bw(Lt,v_,Tt,tn);if(!Wt)throw new Error("Could not find a matching font-stretch value for "+At);return Wt})(We.stretch,Be),Be=(function(At,Lt){if(Lt[At])return Lt[At];for(var Tt=m_[At],tn=0;tn<Tt.length;++tn)if(Lt[Tt[tn]])return Lt[Tt[tn]];throw new Error("Could not find a matching font-style for "+At)})(We.style,Be),!(Be=(function(At,Lt){if(Lt[At])return Lt[At];if(At===400&&Lt[500])return Lt[500];if(At===500&&Lt[400])return Lt[400];var Tt=cj[At],tn=Bw(Lt,y_,Tt,At<400?-1:1);if(!tn)throw new Error("Could not find a matching font-weight for value "+At);return tn})(We.weight,Be)))throw new Error("Failed to resolve a font for the rule '"+Uw(We)+"'.");return Be})(ye,we);this.pdf.setFont(je.ref.name,je.ref.style)}else{var Le="";(ge==="bold"||parseInt(ge,10)>=700||be==="bold")&&(Le="bold"),be==="italic"&&(Le+="italic"),Le.length===0&&(Le="normal");for(var Ye="",lt={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"},rt=0;rt<ve.length;rt++){if(this.pdf.internal.getFont(ve[rt],Le,{noFallback:!0,disableWarning:!0})!==void 0){Ye=ve[rt];break}if(Le==="bolditalic"&&this.pdf.internal.getFont(ve[rt],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Ye=ve[rt],Le="bold";else if(this.pdf.internal.getFont(ve[rt],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Ye=ve[rt],Le="normal";break}}if(Ye===""){for(var ot=0;ot<ve.length;ot++)if(lt[ve[ot]]){Ye=lt[ve[ot]];break}}Ye=Ye===""?"Times":Ye,this.pdf.setFont(Ye,Le)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(pe){this.ctx.globalCompositeOperation=pe}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(pe){this.ctx.globalAlpha=pe}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(pe){this.ctx.lineDashOffset=pe,B.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(pe){this.ctx.lineDash=pe,B.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(pe){this.ctx.ignoreClearRect=!!pe}})};m.prototype.setLineDash=function(F){this.lineDash=F},m.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},m.prototype.fill=function(){E.call(this,"fill",!1)},m.prototype.stroke=function(){E.call(this,"stroke",!1)},m.prototype.beginPath=function(){this.path=[{type:"begin"}]},m.prototype.moveTo=function(F,z){if(isNaN(F)||isNaN(z))throw Zr.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var Y=this.ctx.transform.applyToPoint(new o(F,z));this.path.push({type:"mt",x:Y.x,y:Y.y}),this.ctx.lastPoint=new o(F,z)},m.prototype.closePath=function(){var F=new o(0,0),z=0;for(z=this.path.length-1;z!==-1;z--)if(this.path[z].type==="begin"&&jr(this.path[z+1])==="object"&&typeof this.path[z+1].x=="number"){F=new o(this.path[z+1].x,this.path[z+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new o(F.x,F.y)},m.prototype.lineTo=function(F,z){if(isNaN(F)||isNaN(z))throw Zr.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var Y=this.ctx.transform.applyToPoint(new o(F,z));this.path.push({type:"lt",x:Y.x,y:Y.y}),this.ctx.lastPoint=new o(Y.x,Y.y)},m.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),E.call(this,null,!0)},m.prototype.quadraticCurveTo=function(F,z,Y,J){if(isNaN(Y)||isNaN(J)||isNaN(F)||isNaN(z))throw Zr.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var K=this.ctx.transform.applyToPoint(new o(Y,J)),ie=this.ctx.transform.applyToPoint(new o(F,z));this.path.push({type:"qct",x1:ie.x,y1:ie.y,x:K.x,y:K.y}),this.ctx.lastPoint=new o(K.x,K.y)},m.prototype.bezierCurveTo=function(F,z,Y,J,K,ie){if(isNaN(K)||isNaN(ie)||isNaN(F)||isNaN(z)||isNaN(Y)||isNaN(J))throw Zr.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var fe=this.ctx.transform.applyToPoint(new o(K,ie)),ue=this.ctx.transform.applyToPoint(new o(F,z)),_e=this.ctx.transform.applyToPoint(new o(Y,J));this.path.push({type:"bct",x1:ue.x,y1:ue.y,x2:_e.x,y2:_e.y,x:fe.x,y:fe.y}),this.ctx.lastPoint=new o(fe.x,fe.y)},m.prototype.arc=function(F,z,Y,J,K,ie){if(isNaN(F)||isNaN(z)||isNaN(Y)||isNaN(J)||isNaN(K))throw Zr.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(ie=!!ie,!this.ctx.transform.isIdentity){var fe=this.ctx.transform.applyToPoint(new o(F,z));F=fe.x,z=fe.y;var ue=this.ctx.transform.applyToPoint(new o(0,Y)),_e=this.ctx.transform.applyToPoint(new o(0,0));Y=Math.sqrt(Math.pow(ue.x-_e.x,2)+Math.pow(ue.y-_e.y,2))}Math.abs(K-J)>=2*Math.PI&&(J=0,K=2*Math.PI),this.path.push({type:"arc",x:F,y:z,radius:Y,startAngle:J,endAngle:K,counterclockwise:ie})},m.prototype.arcTo=function(F,z,Y,J,K){throw new Error("arcTo not implemented.")},m.prototype.rect=function(F,z,Y,J){if(isNaN(F)||isNaN(z)||isNaN(Y)||isNaN(J))throw Zr.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(F,z),this.lineTo(F+Y,z),this.lineTo(F+Y,z+J),this.lineTo(F,z+J),this.lineTo(F,z),this.lineTo(F+Y,z),this.lineTo(F,z)},m.prototype.fillRect=function(F,z,Y,J){if(isNaN(F)||isNaN(z)||isNaN(Y)||isNaN(J))throw Zr.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!d.call(this)){var K={};this.lineCap!=="butt"&&(K.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(K.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(F,z,Y,J),this.fill(),K.hasOwnProperty("lineCap")&&(this.lineCap=K.lineCap),K.hasOwnProperty("lineJoin")&&(this.lineJoin=K.lineJoin)}},m.prototype.strokeRect=function(F,z,Y,J){if(isNaN(F)||isNaN(z)||isNaN(Y)||isNaN(J))throw Zr.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");y.call(this)||(this.beginPath(),this.rect(F,z,Y,J),this.stroke())},m.prototype.clearRect=function(F,z,Y,J){if(isNaN(F)||isNaN(z)||isNaN(Y)||isNaN(J))throw Zr.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(F,z,Y,J))},m.prototype.save=function(F){F=typeof F!="boolean"||F;for(var z=this.pdf.internal.getCurrentPageInfo().pageNumber,Y=0;Y<this.pdf.internal.getNumberOfPages();Y++)this.pdf.setPage(Y+1),this.pdf.internal.out("q");if(this.pdf.setPage(z),F){this.ctx.fontSize=this.pdf.internal.getFontSize();var J=new c(this.ctx);this.ctxStack.push(this.ctx),this.ctx=J}},m.prototype.restore=function(F){F=typeof F!="boolean"||F;for(var z=this.pdf.internal.getCurrentPageInfo().pageNumber,Y=0;Y<this.pdf.internal.getNumberOfPages();Y++)this.pdf.setPage(Y+1),this.pdf.internal.out("Q");this.pdf.setPage(z),F&&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)},m.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var g=function(F){var z,Y,J,K;if(F.isCanvasGradient===!0&&(F=F.getColor()),!F)return{r:0,g:0,b:0,a:0,style:F};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(F))z=0,Y=0,J=0,K=0;else{var ie=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(F);if(ie!==null)z=parseInt(ie[1]),Y=parseInt(ie[2]),J=parseInt(ie[3]),K=1;else if((ie=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(F))!==null)z=parseInt(ie[1]),Y=parseInt(ie[2]),J=parseInt(ie[3]),K=parseFloat(ie[4]);else{if(K=1,typeof F=="string"&&F.charAt(0)!=="#"){var fe=new u_(F);F=fe.ok?fe.toHex():"#000000"}F.length===4?(z=F.substring(1,2),z+=z,Y=F.substring(2,3),Y+=Y,J=F.substring(3,4),J+=J):(z=F.substring(1,3),Y=F.substring(3,5),J=F.substring(5,7)),z=parseInt(z,16),Y=parseInt(Y,16),J=parseInt(J,16)}}return{r:z,g:Y,b:J,a:K,style:F}},d=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},y=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};m.prototype.fillText=function(F,z,Y,J){if(isNaN(z)||isNaN(Y)||typeof F!="string")throw Zr.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(J=isNaN(J)?void 0:J,!d.call(this)){var K=Q(this.ctx.transform.rotation),ie=this.ctx.transform.scaleX;N.call(this,{text:F,x:z,y:Y,scale:ie,angle:K,align:this.textAlign,maxWidth:J})}},m.prototype.strokeText=function(F,z,Y,J){if(isNaN(z)||isNaN(Y)||typeof F!="string")throw Zr.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!y.call(this)){J=isNaN(J)?void 0:J;var K=Q(this.ctx.transform.rotation),ie=this.ctx.transform.scaleX;N.call(this,{text:F,x:z,y:Y,scale:ie,renderingMode:"stroke",angle:K,align:this.textAlign,maxWidth:J})}},m.prototype.measureText=function(F){if(typeof F!="string")throw Zr.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var z=this.pdf,Y=this.pdf.internal.scaleFactor,J=z.internal.getFontSize(),K=z.getStringUnitWidth(F)*J/z.internal.scaleFactor;return new function(ie){var fe=(ie=ie||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return fe}}),this}({width:K*=Math.round(96*Y/72*1e4)/1e4})},m.prototype.scale=function(F,z){if(isNaN(F)||isNaN(z))throw Zr.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var Y=new u(F,0,0,z,0,0);this.ctx.transform=this.ctx.transform.multiply(Y)},m.prototype.rotate=function(F){if(isNaN(F))throw Zr.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var z=new u(Math.cos(F),Math.sin(F),-Math.sin(F),Math.cos(F),0,0);this.ctx.transform=this.ctx.transform.multiply(z)},m.prototype.translate=function(F,z){if(isNaN(F)||isNaN(z))throw Zr.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var Y=new u(1,0,0,1,F,z);this.ctx.transform=this.ctx.transform.multiply(Y)},m.prototype.transform=function(F,z,Y,J,K,ie){if(isNaN(F)||isNaN(z)||isNaN(Y)||isNaN(J)||isNaN(K)||isNaN(ie))throw Zr.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var fe=new u(F,z,Y,J,K,ie);this.ctx.transform=this.ctx.transform.multiply(fe)},m.prototype.setTransform=function(F,z,Y,J,K,ie){F=isNaN(F)?1:F,z=isNaN(z)?0:z,Y=isNaN(Y)?0:Y,J=isNaN(J)?1:J,K=isNaN(K)?0:K,ie=isNaN(ie)?0:ie,this.ctx.transform=new u(F,z,Y,J,K,ie)};var _=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};m.prototype.drawImage=function(F,z,Y,J,K,ie,fe,ue,_e){var Ce=this.pdf.getImageProperties(F),$e=1,ze=1,tt=1,pe=1;J!==void 0&&ue!==void 0&&(tt=ue/J,pe=_e/K,$e=Ce.width/J*ue/J,ze=Ce.height/K*_e/K),ie===void 0&&(ie=z,fe=Y,z=0,Y=0),J!==void 0&&ue===void 0&&(ue=J,_e=K),J===void 0&&ue===void 0&&(ue=Ce.width,_e=Ce.height);var ut=this.ctx.transform.decompose(),be=Q(ut.rotate.shx),ge=new u,xe=(ge=(ge=(ge=ge.multiply(ut.translate)).multiply(ut.skew)).multiply(ut.scale)).applyToRectangle(new s(ie-z*tt,fe-Y*pe,J*$e,K*ze));if(this.autoPaging){for(var Te,Me=x.call(this,xe),ve=[],ye=0;ye<Me.length;ye+=1)ve.indexOf(Me[ye])===-1&&ve.push(Me[ye]);k(ve);for(var we=ve[0],je=ve[ve.length-1],Le=we;Le<je+1;Le++){this.pdf.setPage(Le);var Ye=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],lt=Le===1?this.posY+this.margin[0]:this.margin[0],rt=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],ot=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],dt=Le===1?0:rt+(Le-2)*ot;if(this.ctx.clip_path.length!==0){var Ct=this.path;Te=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=S(Te,this.posX+this.margin[3],-dt+lt+this.ctx.prevPageLastElemOffset),A.call(this,"fill",!0),this.path=Ct}var Zt=JSON.parse(JSON.stringify(xe));Zt=S([Zt],this.posX+this.margin[3],-dt+lt+this.ctx.prevPageLastElemOffset)[0];var on=(Le>we||Le<je)&&_.call(this);on&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Ye,ot,null).clip().discardPath()),this.pdf.addImage(F,"JPEG",Zt.x,Zt.y,Zt.w,Zt.h,null,null,be),on&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(F,"JPEG",xe.x,xe.y,xe.w,xe.h,null,null,be)};var x=function(F,z,Y){var J=[];z=z||this.pdf.internal.pageSize.width,Y=Y||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var K=this.posY+this.ctx.prevPageLastElemOffset;switch(F.type){default:case"mt":case"lt":J.push(Math.floor((F.y+K)/Y)+1);break;case"arc":J.push(Math.floor((F.y+K-F.radius)/Y)+1),J.push(Math.floor((F.y+K+F.radius)/Y)+1);break;case"qct":var ie=re(this.ctx.lastPoint.x,this.ctx.lastPoint.y,F.x1,F.y1,F.x,F.y);J.push(Math.floor((ie.y+K)/Y)+1),J.push(Math.floor((ie.y+ie.h+K)/Y)+1);break;case"bct":var fe=X(this.ctx.lastPoint.x,this.ctx.lastPoint.y,F.x1,F.y1,F.x2,F.y2,F.x,F.y);J.push(Math.floor((fe.y+K)/Y)+1),J.push(Math.floor((fe.y+fe.h+K)/Y)+1);break;case"rect":J.push(Math.floor((F.y+K)/Y)+1),J.push(Math.floor((F.y+F.h+K)/Y)+1)}for(var ue=0;ue<J.length;ue+=1)for(;this.pdf.internal.getNumberOfPages()<J[ue];)b.call(this);return J},b=function(){var F=this.fillStyle,z=this.strokeStyle,Y=this.font,J=this.lineCap,K=this.lineWidth,ie=this.lineJoin;this.pdf.addPage(),this.fillStyle=F,this.strokeStyle=z,this.font=Y,this.lineCap=J,this.lineWidth=K,this.lineJoin=ie},S=function(F,z,Y){for(var J=0;J<F.length;J++)switch(F[J].type){case"bct":F[J].x2+=z,F[J].y2+=Y;case"qct":F[J].x1+=z,F[J].y1+=Y;default:F[J].x+=z,F[J].y+=Y}return F},k=function(F){return F.sort(function(z,Y){return z-Y})},E=function(F,z){var Y=this.fillStyle,J=this.strokeStyle,K=this.lineCap,ie=this.lineWidth,fe=Math.abs(ie*this.ctx.transform.scaleX),ue=this.lineJoin;if(this.autoPaging){for(var _e,Ce,$e=JSON.parse(JSON.stringify(this.path)),ze=JSON.parse(JSON.stringify(this.path)),tt=[],pe=0;pe<ze.length;pe++)if(ze[pe].x!==void 0)for(var ut=x.call(this,ze[pe]),be=0;be<ut.length;be+=1)tt.indexOf(ut[be])===-1&&tt.push(ut[be]);for(var ge=0;ge<tt.length;ge++)for(;this.pdf.internal.getNumberOfPages()<tt[ge];)b.call(this);k(tt);for(var xe=tt[0],Te=tt[tt.length-1],Me=xe;Me<Te+1;Me++){this.pdf.setPage(Me),this.fillStyle=Y,this.strokeStyle=J,this.lineCap=K,this.lineWidth=fe,this.lineJoin=ue;var ve=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],ye=Me===1?this.posY+this.margin[0]:this.margin[0],we=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],je=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],Le=Me===1?0:we+(Me-2)*je;if(this.ctx.clip_path.length!==0){var Ye=this.path;_e=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=S(_e,this.posX+this.margin[3],-Le+ye+this.ctx.prevPageLastElemOffset),A.call(this,F,!0),this.path=Ye}if(Ce=JSON.parse(JSON.stringify($e)),this.path=S(Ce,this.posX+this.margin[3],-Le+ye+this.ctx.prevPageLastElemOffset),z===!1||Me===0){var lt=(Me>xe||Me<Te)&&_.call(this);lt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ve,je,null).clip().discardPath()),A.call(this,F,z),lt&&this.pdf.restoreGraphicsState()}this.lineWidth=ie}this.path=$e}else this.lineWidth=fe,A.call(this,F,z),this.lineWidth=ie},A=function(F,z){if((F!=="stroke"||z||!y.call(this))&&(F==="stroke"||z||!d.call(this))){for(var Y,J,K=[],ie=this.path,fe=0;fe<ie.length;fe++){var ue=ie[fe];switch(ue.type){case"begin":K.push({begin:!0});break;case"close":K.push({close:!0});break;case"mt":K.push({start:ue,deltas:[],abs:[]});break;case"lt":var _e=K.length;if(ie[fe-1]&&!isNaN(ie[fe-1].x)&&(Y=[ue.x-ie[fe-1].x,ue.y-ie[fe-1].y],_e>0)){for(;_e>=0;_e--)if(K[_e-1].close!==!0&&K[_e-1].begin!==!0){K[_e-1].deltas.push(Y),K[_e-1].abs.push(ue);break}}break;case"bct":Y=[ue.x1-ie[fe-1].x,ue.y1-ie[fe-1].y,ue.x2-ie[fe-1].x,ue.y2-ie[fe-1].y,ue.x-ie[fe-1].x,ue.y-ie[fe-1].y],K[K.length-1].deltas.push(Y);break;case"qct":var Ce=ie[fe-1].x+2/3*(ue.x1-ie[fe-1].x),$e=ie[fe-1].y+2/3*(ue.y1-ie[fe-1].y),ze=ue.x+2/3*(ue.x1-ue.x),tt=ue.y+2/3*(ue.y1-ue.y),pe=ue.x,ut=ue.y;Y=[Ce-ie[fe-1].x,$e-ie[fe-1].y,ze-ie[fe-1].x,tt-ie[fe-1].y,pe-ie[fe-1].x,ut-ie[fe-1].y],K[K.length-1].deltas.push(Y);break;case"arc":K.push({deltas:[],abs:[],arc:!0}),Array.isArray(K[K.length-1].abs)&&K[K.length-1].abs.push(ue)}}J=z?null:F==="stroke"?"stroke":"fill";for(var be=!1,ge=0;ge<K.length;ge++)if(K[ge].arc)for(var xe=K[ge].abs,Te=0;Te<xe.length;Te++){var Me=xe[Te];Me.type==="arc"?I.call(this,Me.x,Me.y,Me.radius,Me.startAngle,Me.endAngle,Me.counterclockwise,void 0,z,!be):$.call(this,Me.x,Me.y),be=!0}else if(K[ge].close===!0)this.pdf.internal.out("h"),be=!1;else if(K[ge].begin!==!0){var ve=K[ge].start.x,ye=K[ge].start.y;G.call(this,K[ge].deltas,ve,ye),be=!0}J&&j.call(this,J),z&&D.call(this)}},R=function(F){var z=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,Y=z*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return F-Y;case"top":return F+z-Y;case"hanging":return F+z-2*Y;case"middle":return F+z/2-Y;default:return F}},O=function(F){return F+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};m.prototype.createLinearGradient=function(){var F=function(){};return F.colorStops=[],F.addColorStop=function(z,Y){this.colorStops.push([z,Y])},F.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},F.isCanvasGradient=!0,F},m.prototype.createPattern=function(){return this.createLinearGradient()},m.prototype.createRadialGradient=function(){return this.createLinearGradient()};var I=function(F,z,Y,J,K,ie,fe,ue,_e){for(var Ce=se.call(this,Y,J,K,ie),$e=0;$e<Ce.length;$e++){var ze=Ce[$e];$e===0&&(_e?C.call(this,ze.x1+F,ze.y1+z):$.call(this,ze.x1+F,ze.y1+z)),te.call(this,F,z,ze.x2,ze.y2,ze.x3,ze.y3,ze.x4,ze.y4)}ue?D.call(this):j.call(this,fe)},j=function(F){switch(F){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},D=function(){this.pdf.clip(),this.pdf.discardPath()},C=function(F,z){this.pdf.internal.out(n(F)+" "+r(z)+" m")},N=function(F){var z;switch(F.align){case"right":case"end":z="right";break;case"center":z="center";break;default:z="left"}var Y,J,K,ie=this.pdf.getTextDimensions(F.text),fe=R.call(this,F.y),ue=O.call(this,fe)-ie.h,_e=this.ctx.transform.applyToPoint(new o(F.x,fe));if(this.autoPaging){var Ce=this.ctx.transform.decompose(),$e=new u;$e=($e=($e=$e.multiply(Ce.translate)).multiply(Ce.skew)).multiply(Ce.scale);for(var ze=this.ctx.transform.applyToRectangle(new s(F.x,fe,ie.w,ie.h)),tt=$e.applyToRectangle(new s(F.x,ue,ie.w,ie.h)),pe=x.call(this,tt),ut=[],be=0;be<pe.length;be+=1)ut.indexOf(pe[be])===-1&&ut.push(pe[be]);k(ut);for(var ge=ut[0],xe=ut[ut.length-1],Te=ge;Te<xe+1;Te++){this.pdf.setPage(Te);var Me=Te===1?this.posY+this.margin[0]:this.margin[0],ve=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],ye=this.pdf.internal.pageSize.height-this.margin[2],we=ye-this.margin[0],je=this.pdf.internal.pageSize.width-this.margin[1],Le=je-this.margin[3],Ye=Te===1?0:ve+(Te-2)*we;if(this.ctx.clip_path.length!==0){var lt=this.path;Y=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=S(Y,this.posX+this.margin[3],-1*Ye+Me),A.call(this,"fill",!0),this.path=lt}var rt=S([JSON.parse(JSON.stringify(tt))],this.posX+this.margin[3],-Ye+Me+this.ctx.prevPageLastElemOffset)[0];F.scale>=.01&&(J=this.pdf.internal.getFontSize(),this.pdf.setFontSize(J*F.scale),K=this.lineWidth,this.lineWidth=K*F.scale);var ot=this.autoPaging!=="text";if(ot||rt.y+rt.h<=ye){if(ot||rt.y>=Me&&rt.x<=je){var dt=ot?F.text:this.pdf.splitTextToSize(F.text,F.maxWidth||je-rt.x)[0],Ct=S([JSON.parse(JSON.stringify(ze))],this.posX+this.margin[3],-Ye+Me+this.ctx.prevPageLastElemOffset)[0],Zt=ot&&(Te>ge||Te<xe)&&_.call(this);Zt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Le,we,null).clip().discardPath()),this.pdf.text(dt,Ct.x,Ct.y,{angle:F.angle,align:z,renderingMode:F.renderingMode}),Zt&&this.pdf.restoreGraphicsState()}}else rt.y<ye&&(this.ctx.prevPageLastElemOffset+=ye-rt.y);F.scale>=.01&&(this.pdf.setFontSize(J),this.lineWidth=K)}}else F.scale>=.01&&(J=this.pdf.internal.getFontSize(),this.pdf.setFontSize(J*F.scale),K=this.lineWidth,this.lineWidth=K*F.scale),this.pdf.text(F.text,_e.x+this.posX,_e.y+this.posY,{angle:F.angle,align:z,renderingMode:F.renderingMode,maxWidth:F.maxWidth}),F.scale>=.01&&(this.pdf.setFontSize(J),this.lineWidth=K)},$=function(F,z,Y,J){Y=Y||0,J=J||0,this.pdf.internal.out(n(F+Y)+" "+r(z+J)+" l")},G=function(F,z,Y){return this.pdf.lines(F,z,Y,null,null)},te=function(F,z,Y,J,K,ie,fe,ue){this.pdf.internal.out([t(i(Y+F)),t(a(J+z)),t(i(K+F)),t(a(ie+z)),t(i(fe+F)),t(a(ue+z)),"c"].join(" "))},se=function(F,z,Y,J){for(var K=2*Math.PI,ie=Math.PI/2;z>Y;)z-=K;var fe=Math.abs(Y-z);fe<K&&J&&(fe=K-fe);for(var ue=[],_e=J?-1:1,Ce=z;fe>1e-5;){var $e=Ce+_e*Math.min(fe,ie);ue.push(ee.call(this,F,Ce,$e)),fe-=Math.abs($e-Ce),Ce=$e}return ue},ee=function(F,z,Y){var J=(Y-z)/2,K=F*Math.cos(J),ie=F*Math.sin(J),fe=K,ue=-ie,_e=fe*fe+ue*ue,Ce=_e+fe*K+ue*ie,$e=4/3*(Math.sqrt(2*_e*Ce)-Ce)/(fe*ie-ue*K),ze=fe-$e*ue,tt=ue+$e*fe,pe=ze,ut=-tt,be=J+z,ge=Math.cos(be),xe=Math.sin(be);return{x1:F*Math.cos(z),y1:F*Math.sin(z),x2:ze*ge-tt*xe,y2:ze*xe+tt*ge,x3:pe*ge-ut*xe,y3:pe*xe+ut*ge,x4:F*Math.cos(Y),y4:F*Math.sin(Y)}},Q=function(F){return 180*F/Math.PI},re=function(F,z,Y,J,K,ie){var fe=F+.5*(Y-F),ue=z+.5*(J-z),_e=K+.5*(Y-K),Ce=ie+.5*(J-ie),$e=Math.min(F,K,fe,_e),ze=Math.max(F,K,fe,_e),tt=Math.min(z,ie,ue,Ce),pe=Math.max(z,ie,ue,Ce);return new s($e,tt,ze-$e,pe-tt)},X=function(F,z,Y,J,K,ie,fe,ue){var _e,Ce,$e,ze,tt,pe,ut,be,ge,xe,Te,Me,ve,ye,we=Y-F,je=J-z,Le=K-Y,Ye=ie-J,lt=fe-K,rt=ue-ie;for(Ce=0;Ce<41;Ce++)ge=(ut=($e=F+(_e=Ce/40)*we)+_e*((tt=Y+_e*Le)-$e))+_e*(tt+_e*(K+_e*lt-tt)-ut),xe=(be=(ze=z+_e*je)+_e*((pe=J+_e*Ye)-ze))+_e*(pe+_e*(ie+_e*rt-pe)-be),Ce==0?(Te=ge,Me=xe,ve=ge,ye=xe):(Te=Math.min(Te,ge),Me=Math.min(Me,xe),ve=Math.max(ve,ge),ye=Math.max(ye,xe));return new s(Math.round(Te),Math.round(Me),Math.round(ve-Te),Math.round(ye-Me))},B=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var F,z,Y=(F=this.ctx.lineDash,z=this.ctx.lineDashOffset,JSON.stringify({lineDash:F,lineDashOffset:z}));this.prevLineDash!==Y&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=Y)}}})(sn.API),(function(e){var t=function(o){var s,u,h,c,m,g,d,y,_,x;for(u=[],h=0,c=(o+=s="\0\0\0\0".slice(o.length%4||4)).length;c>h;h+=4)(m=(o.charCodeAt(h)<<24)+(o.charCodeAt(h+1)<<16)+(o.charCodeAt(h+2)<<8)+o.charCodeAt(h+3))!==0?(g=(m=((m=((m=((m=(m-(x=m%85))/85)-(_=m%85))/85)-(y=m%85))/85)-(d=m%85))/85)%85,u.push(g+33,d+33,y+33,_+33,x+33)):u.push(122);return(function(b,S){for(var k=S;k>0;k--)b.pop()})(u,s.length),String.fromCharCode.apply(String,u)+"~>"},n=function(o){var s,u,h,c,m,g=String,d="length",y=255,_="charCodeAt",x="slice",b="replace";for(o[x](-2),o=o[x](0,-2)[b](/\s/g,"")[b]("z","!!!!!"),h=[],c=0,m=(o+=s="uuuuu"[x](o[d]%5||5))[d];m>c;c+=5)u=52200625*(o[_](c)-33)+614125*(o[_](c+1)-33)+7225*(o[_](c+2)-33)+85*(o[_](c+3)-33)+(o[_](c+4)-33),h.push(y&u>>24,y&u>>16,y&u>>8,y&u);return(function(S,k){for(var E=k;E>0;E--)S.pop()})(h,s[d]),g.fromCharCode.apply(g,h)},r=function(o){return o.split("").map(function(s){return("0"+s.charCodeAt().toString(16)).slice(-2)}).join("")+">"},i=function(o){var s=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((o=o.replace(/\s/g,"")).indexOf(">")!==-1&&(o=o.substr(0,o.indexOf(">"))),o.length%2&&(o+="0"),s.test(o)===!1)return"";for(var u="",h=0;h<o.length;h+=2)u+=String.fromCharCode("0x"+(o[h]+o[h+1]));return u},a=function(o){for(var s=new Uint8Array(o.length),u=o.length;u--;)s[u]=o.charCodeAt(u);return(s=Mv(s)).reduce(function(h,c){return h+String.fromCharCode(c)},"")};e.processDataByFilters=function(o,s){var u=0,h=o||"",c=[];for(typeof(s=s||[])=="string"&&(s=[s]),u=0;u<s.length;u+=1)switch(s[u]){case"ASCII85Decode":case"/ASCII85Decode":h=n(h),c.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":h=t(h),c.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":h=i(h),c.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":h=r(h),c.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":h=a(h),c.push("/FlateDecode");break;default:throw new Error('The filter: "'+s[u]+'" is not implemented')}return{data:h,reverseChain:c.reverse().join(" ")}}})(sn.API),(function(e){e.loadFile=function(t,n,r){return(function(i,a,o){a=a!==!1,o=typeof o=="function"?o:function(){};var s=void 0;try{s=(function(u,h,c){var m=new XMLHttpRequest,g=0,d=function(y){var _=y.length,x=[],b=String.fromCharCode;for(g=0;g<_;g+=1)x.push(b(255&y.charCodeAt(g)));return x.join("")};if(m.open("GET",u,!h),m.overrideMimeType("text/plain; charset=x-user-defined"),h===!1&&(m.onload=function(){m.status===200?c(d(this.responseText)):c(void 0)}),m.send(null),h&&m.status===200)return d(m.responseText)})(i,a,o)}catch{}return s})(t,n,r)},e.loadImageFile=e.loadFile})(sn.API),(function(e){function t(){return(En.html2canvas?Promise.resolve(En.html2canvas):Om(()=>import("./html2canvas.esm-Ge7aVWlp.js"),[],import.meta.url)).catch(function(s){return Promise.reject(new Error("Could not load html2canvas: "+s))}).then(function(s){return s.default?s.default:s})}function n(){return(En.DOMPurify?Promise.resolve(En.DOMPurify):Om(()=>import("./purify.es-C65SP4u9.js"),[],import.meta.url)).catch(function(s){return Promise.reject(new Error("Could not load dompurify: "+s))}).then(function(s){return s.default?s.default:s})}var r=function(s){var u=jr(s);return u==="undefined"?"undefined":u==="string"||s instanceof String?"string":u==="number"||s instanceof Number?"number":u==="function"||s instanceof Function?"function":s&&s.constructor===Array?"array":s&&s.nodeType===1?"element":u==="object"?"object":"unknown"},i=function(s,u){var h=document.createElement(s);for(var c in u.className&&(h.className=u.className),u.innerHTML&&u.dompurify&&(h.innerHTML=u.dompurify.sanitize(u.innerHTML)),u.style)h.style[c]=u.style[c];return h},a=function s(u,h){for(var c=u.nodeType===3?document.createTextNode(u.nodeValue):u.cloneNode(!1),m=u.firstChild;m;m=m.nextSibling)h!==!0&&m.nodeType===1&&m.nodeName==="SCRIPT"||c.appendChild(s(m,h));return u.nodeType===1&&(u.nodeName==="CANVAS"?(c.width=u.width,c.height=u.height,c.getContext("2d").drawImage(u,0,0)):u.nodeName!=="TEXTAREA"&&u.nodeName!=="SELECT"||(c.value=u.value),c.addEventListener("load",function(){c.scrollTop=u.scrollTop,c.scrollLeft=u.scrollLeft},!0)),c},o=function s(u){var h=Object.assign(s.convert(Promise.resolve()),JSON.parse(JSON.stringify(s.template))),c=s.convert(Promise.resolve(),h);return(c=c.setProgress(1,s,1,[s])).set(u)};(o.prototype=Object.create(Promise.prototype)).constructor=o,o.convert=function(s,u){return s.__proto__=u||o.prototype,s},o.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"}},o.prototype.from=function(s,u){return this.then(function(){switch(u=u||(function(h){switch(r(h)){case"string":return"string";case"element":return h.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}})(s),u){case"string":return this.then(n).then(function(h){return this.set({src:i("div",{innerHTML:s,dompurify:h})})});case"element":return this.set({src:s});case"canvas":return this.set({canvas:s});case"img":return this.set({img:s});default:return this.error("Unknown source type.")}})},o.prototype.to=function(s){switch(s){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.")}},o.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 s={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},u=a(this.prop.src,this.opt.html2canvas.javascriptEnabled);u.tagName==="BODY"&&(s.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:s}),this.prop.container.appendChild(u),this.prop.container.firstChild.appendChild(i("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"})},o.prototype.toCanvas=function(){var s=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(s).then(t).then(function(u){var h=Object.assign({},this.opt.html2canvas);return delete h.onrendered,u(this.prop.container,h)}).then(function(u){(this.opt.html2canvas.onrendered||function(){})(u),this.prop.canvas=u,document.body.removeChild(this.prop.overlay)})},o.prototype.toContext2d=function(){var s=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(s).then(t).then(function(u){var h=this.opt.jsPDF,c=this.opt.fontFaces,m=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,g=Object.assign({async:!0,allowTaint:!0,scale:m,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 g.onrendered,h.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,h.context2d.posX=this.opt.x,h.context2d.posY=this.opt.y,h.context2d.margin=this.opt.margin,h.context2d.fontFaces=c,c)for(var d=0;d<c.length;++d){var y=c[d],_=y.src.find(function(x){return x.format==="truetype"});_&&h.addFont(_.url,y.ref.name,y.ref.style)}return g.windowHeight=g.windowHeight||0,g.windowHeight=g.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):g.windowHeight,h.context2d.save(!0),u(this.prop.container,g)}).then(function(u){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(u),this.prop.canvas=u,document.body.removeChild(this.prop.overlay)})},o.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var s=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=s})},o.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},o.prototype.output=function(s,u,h){return(h=h||"pdf").toLowerCase()==="img"||h.toLowerCase()==="image"?this.outputImg(s,u):this.outputPdf(s,u)},o.prototype.outputPdf=function(s,u){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(s,u)})},o.prototype.outputImg=function(s){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(s){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 "'+s+'" is not supported.'}})},o.prototype.save=function(s){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(s?{filename:s}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},o.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},o.prototype.set=function(s){if(r(s)!=="object")return this;var u=Object.keys(s||{}).map(function(h){if(h in o.template.prop)return function(){this.prop[h]=s[h]};switch(h){case"margin":return this.setMargin.bind(this,s.margin);case"jsPDF":return function(){return this.opt.jsPDF=s.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,s.pageSize);default:return function(){this.opt[h]=s[h]}}},this);return this.then(function(){return this.thenList(u)})},o.prototype.get=function(s,u){return this.then(function(){var h=s in o.template.prop?this.prop[s]:this.opt[s];return u?u(h):h})},o.prototype.setMargin=function(s){return this.then(function(){switch(r(s)){case"number":s=[s,s,s,s];case"array":if(s.length===2&&(s=[s[0],s[1],s[0],s[1]]),s.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=s}).then(this.setPageSize)},o.prototype.setPageSize=function(s){function u(h,c){return Math.floor(h*c/72*96)}return this.then(function(){(s=s||sn.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(s.inner={width:s.width-this.opt.margin[1]-this.opt.margin[3],height:s.height-this.opt.margin[0]-this.opt.margin[2]},s.inner.px={width:u(s.inner.width,s.k),height:u(s.inner.height,s.k)},s.inner.ratio=s.inner.height/s.inner.width),this.prop.pageSize=s})},o.prototype.setProgress=function(s,u,h,c){return s!=null&&(this.progress.val=s),u!=null&&(this.progress.state=u),h!=null&&(this.progress.n=h),c!=null&&(this.progress.stack=c),this.progress.ratio=this.progress.val/this.progress.state,this},o.prototype.updateProgress=function(s,u,h,c){return this.setProgress(s?this.progress.val+s:null,u||null,h?this.progress.n+h:null,c?this.progress.stack.concat(c):null)},o.prototype.then=function(s,u){var h=this;return this.thenCore(s,u,function(c,m){return h.updateProgress(null,null,1,[c]),Promise.prototype.then.call(this,function(g){return h.updateProgress(null,c),g}).then(c,m).then(function(g){return h.updateProgress(1),g})})},o.prototype.thenCore=function(s,u,h){h=h||Promise.prototype.then;var c=this;s&&(s=s.bind(c)),u&&(u=u.bind(c));var m=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?c:o.convert(Object.assign({},c),Promise.prototype),g=h.call(m,s,u);return o.convert(g,c.__proto__)},o.prototype.thenExternal=function(s,u){return Promise.prototype.then.call(this,s,u)},o.prototype.thenList=function(s){var u=this;return s.forEach(function(h){u=u.thenCore(h)}),u},o.prototype.catch=function(s){s&&(s=s.bind(this));var u=Promise.prototype.catch.call(this,s);return o.convert(u,this)},o.prototype.catchExternal=function(s){return Promise.prototype.catch.call(this,s)},o.prototype.error=function(s){return this.then(function(){throw new Error(s)})},o.prototype.using=o.prototype.set,o.prototype.saveAs=o.prototype.save,o.prototype.export=o.prototype.output,o.prototype.run=o.prototype.then,sn.getPageSize=function(s,u,h){if(jr(s)==="object"){var c=s;s=c.orientation,u=c.unit||u,h=c.format||h}u=u||"mm",h=h||"a4",s=(""+(s||"P")).toLowerCase();var m,g=(""+h).toLowerCase(),d={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(u){case"pt":m=1;break;case"mm":m=72/25.4;break;case"cm":m=72/2.54;break;case"in":m=72;break;case"px":m=.75;break;case"pc":case"em":m=12;break;case"ex":m=6;break;default:throw"Invalid unit: "+u}var y,_=0,x=0;if(d.hasOwnProperty(g))_=d[g][1]/m,x=d[g][0]/m;else try{_=h[1],x=h[0]}catch{throw new Error("Invalid format: "+h)}if(s==="p"||s==="portrait")s="p",x>_&&(y=x,x=_,_=y);else{if(s!=="l"&&s!=="landscape")throw"Invalid orientation: "+s;s="l",_>x&&(y=x,x=_,_=y)}return{width:x,height:_,unit:u,k:m,orientation:s}},e.html=function(s,u){(u=u||{}).callback=u.callback||function(){},u.html2canvas=u.html2canvas||{},u.html2canvas.canvas=u.html2canvas.canvas||this.canvas,u.jsPDF=u.jsPDF||this,u.fontFaces=u.fontFaces?u.fontFaces.map(Wm):null;var h=new o(u);return u.worker?h:h.from(s).doCallback()}})(sn.API),sn.API.addJS=function(e){return Hw=e,this.internal.events.subscribe("postPutResources",function(){K1=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(K1+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),$w=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+Hw+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){K1!==void 0&&$w!==void 0&&this.internal.out("/Names <</JavaScript "+K1+" 0 R>>")}),this},(function(e){var t;e.events.push(["postPutResources",function(){var n=this,r=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var i=n.outline.render().split(/\r\n/),a=0;a<i.length;a++){var o=i[a],s=r.exec(o);if(s!=null){var u=s[1];n.internal.newObjectDeferredBegin(u,!1)}n.internal.write(o)}if(this.outline.createNamedDestinations){var h=this.internal.pages.length,c=[];for(a=0;a<h;a++){var m=n.internal.newObject();c.push(m);var g=n.internal.getPageInfo(a+1);n.internal.write("<< /D["+g.objId+" 0 R /XYZ null null null]>> endobj")}var d=n.internal.newObject();for(n.internal.write("<< /Names [ "),a=0;a<c.length;a++)n.internal.write("(page_"+(a+1)+")"+c[a]+" 0 R");n.internal.write(" ] >>","endobj"),t=n.internal.newObject(),n.internal.write("<< /Dests "+d+" 0 R"),n.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){var n=this;n.outline.root.children.length>0&&(n.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&n.internal.write("/Names "+t+" 0 R"))}]),e.events.push(["initialized",function(){var n=this;n.outline={createNamedDestinations:!1,root:{children:[]}},n.outline.add=function(r,i,a){var o={title:i,options:a,children:[]};return r==null&&(r=this.root),r.children.push(o),o},n.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=n,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},n.outline.genIds_r=function(r){r.id=n.internal.newObjectDeferred();for(var i=0;i<r.children.length;i++)this.genIds_r(r.children[i])},n.outline.renderRoot=function(r){this.objStart(r),this.line("/Type /Outlines"),r.children.length>0&&(this.line("/First "+this.makeRef(r.children[0])),this.line("/Last "+this.makeRef(r.children[r.children.length-1]))),this.line("/Count "+this.count_r({count:0},r)),this.objEnd()},n.outline.renderItems=function(r){for(var i=this.ctx.pdf.internal.getVerticalCoordinateString,a=0;a<r.children.length;a++){var o=r.children[a];this.objStart(o),this.line("/Title "+this.makeString(o.title)),this.line("/Parent "+this.makeRef(r)),a>0&&this.line("/Prev "+this.makeRef(r.children[a-1])),a<r.children.length-1&&this.line("/Next "+this.makeRef(r.children[a+1])),o.children.length>0&&(this.line("/First "+this.makeRef(o.children[0])),this.line("/Last "+this.makeRef(o.children[o.children.length-1])));var s=this.count=this.count_r({count:0},o);if(s>0&&this.line("/Count "+s),o.options&&o.options.pageNumber){var u=n.internal.getPageInfo(o.options.pageNumber);this.line("/Dest ["+u.objId+" 0 R /XYZ 0 "+i(0)+" 0]")}this.objEnd()}for(var h=0;h<r.children.length;h++)this.renderItems(r.children[h])},n.outline.line=function(r){this.ctx.val+=r+`\r
|
|
484
|
+
`},n.outline.makeRef=function(r){return r.id+" 0 R"},n.outline.makeString=function(r){return"("+n.internal.pdfEscape(r)+")"},n.outline.objStart=function(r){this.ctx.val+=`\r
|
|
485
|
+
`+r.id+` 0 obj\r
|
|
486
|
+
<<\r
|
|
487
|
+
`},n.outline.objEnd=function(){this.ctx.val+=`>> \r
|
|
488
|
+
endobj\r
|
|
489
|
+
`},n.outline.count_r=function(r,i){for(var a=0;a<i.children.length;a++)r.count++,this.count_r(r,i.children[a]);return r.count}}])})(sn.API),(function(e){var t=[192,193,194,195,196,197,198,199];e.processJPEG=function(n,r,i,a,o,s){var u,h=this.decode.DCT_DECODE,c=null;if(typeof n=="string"||this.__addimage__.isArrayBuffer(n)||this.__addimage__.isArrayBufferView(n)){switch(n=o||n,n=this.__addimage__.isArrayBuffer(n)?new Uint8Array(n):n,u=(function(m){for(var g,d=256*m.charCodeAt(4)+m.charCodeAt(5),y=m.length,_={width:0,height:0,numcomponents:1},x=4;x<y;x+=2){if(x+=d,t.indexOf(m.charCodeAt(x+1))!==-1){g=256*m.charCodeAt(x+5)+m.charCodeAt(x+6),_={width:256*m.charCodeAt(x+7)+m.charCodeAt(x+8),height:g,numcomponents:m.charCodeAt(x+9)};break}d=256*m.charCodeAt(x+2)+m.charCodeAt(x+3)}return _})(n=this.__addimage__.isArrayBufferView(n)?this.__addimage__.arrayBufferToBinaryString(n):n),u.numcomponents){case 1:s=this.color_spaces.DEVICE_GRAY;break;case 4:s=this.color_spaces.DEVICE_CMYK;break;case 3:s=this.color_spaces.DEVICE_RGB}c={data:n,width:u.width,height:u.height,colorSpace:s,bitsPerComponent:8,filter:h,index:r,alias:i}}return c}})(sn.API),sn.API.processPNG=function(e,t,n,r){if(this.__addimage__.isArrayBuffer(e)&&(e=new Uint8Array(e)),this.__addimage__.isArrayBufferView(e)){var i,a=KI(e,{checkCrc:!0}),o=a.width,s=a.height,u=a.channels,h=a.palette,c=a.depth;i=h&&u===1?(function(I){for(var j=I.width,D=I.height,C=I.data,N=I.palette,$=I.depth,G=!1,te=[],se=[],ee=void 0,Q=!1,re=0,X=0;X<N.length;X++){var B=Y4(N[X],4),F=B[0],z=B[1],Y=B[2],J=B[3];te.push(F,z,Y),J!=null&&(J===0?(re++,se.length<1&&se.push(X)):J<255&&(Q=!0))}if(Q||re>1){G=!0,se=void 0;var K=j*D;ee=new Uint8Array(K);for(var ie=new DataView(C.buffer),fe=0;fe<K;fe++){var ue=Ym(ie,fe,$),_e=Y4(N[ue],4)[3];ee[fe]=_e}}else re===0&&(se=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:G?8:void 0,colorBytes:C,alphaBytes:ee,needSMask:G,palette:te,mask:se}})(a):u===2||u===4?(function(I){for(var j=I.data,D=I.width,C=I.height,N=I.channels,$=I.depth,G=N===2?"DeviceGray":"DeviceRGB",te=N-1,se=D*C,ee=te,Q=se*ee,re=1*se,X=Math.ceil(Q*$/8),B=Math.ceil(re*$/8),F=new Uint8Array(X),z=new Uint8Array(B),Y=new DataView(j.buffer),J=new DataView(F.buffer),K=new DataView(z.buffer),ie=!1,fe=0;fe<se;fe++){for(var ue=fe*N,_e=0;_e<ee;_e++)Jw(J,Ym(Y,ue+_e,$),fe*ee+_e,$);var Ce=Ym(Y,ue+ee,$);Ce<(1<<$)-1&&(ie=!0),Jw(K,Ce,1*fe,$)}return{colorSpace:G,colorsPerPixel:te,sMaskBitsPerComponent:ie?$:void 0,colorBytes:F,alphaBytes:z,needSMask:ie}})(a):(function(I){var j=I.data,D=I.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:D,colorsPerPixel:D==="DeviceGray"?1:3,colorBytes:j instanceof Uint16Array?(function(C){for(var N=C.length,$=new Uint8Array(2*N),G=new DataView($.buffer,$.byteOffset,$.byteLength),te=0;te<N;te++)G.setUint16(2*te,C[te],!1);return $})(j):j,needSMask:!1}})(a);var m,g,d,y=i,_=y.colorSpace,x=y.colorsPerPixel,b=y.sMaskBitsPerComponent,S=y.colorBytes,k=y.alphaBytes,E=y.needSMask,A=y.palette,R=y.mask,O=null;return r!==sn.API.image_compression.NONE&&typeof Mv=="function"?(O=(function(I){var j;switch(I){case sn.API.image_compression.FAST:j=11;break;case sn.API.image_compression.MEDIUM:j=13;break;case sn.API.image_compression.SLOW:j=14;break;default:j=12}return j})(r),m=this.decode.FLATE_DECODE,g="/Predictor ".concat(O," /Colors ").concat(x," /BitsPerComponent ").concat(c," /Columns ").concat(o),e=Yw(S,Math.ceil(o*x*c/8),x,c,r),E&&(d=Yw(k,Math.ceil(o*b/8),1,b,r))):(m=void 0,g=void 0,e=S,E&&(d=k)),(this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e))&&(e=this.__addimage__.arrayBufferToBinaryString(e)),(d&&this.__addimage__.isArrayBuffer(d)||this.__addimage__.isArrayBufferView(d))&&(d=this.__addimage__.arrayBufferToBinaryString(d)),{alias:n,data:e,index:t,filter:m,decodeParameters:g,transparency:R,palette:A,sMask:d,predictor:O,width:o,height:s,bitsPerComponent:c,sMaskBitsPerComponent:b,colorSpace:_}}},(function(e){e.processGIF89A=function(t,n,r,i){var a=new vj(t),o=a.width,s=a.height,u=[];a.decodeAndBlitFrameRGBA(0,u);var h={data:u,width:o,height:s},c=new Xm(100).encode(h,100);return e.processJPEG.call(this,c,n,r,i)},e.processGIF87A=e.processGIF89A})(sn.API),Jl.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 t=0;t<e;t++){var n=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0);this.palette[t]={red:i,green:r,blue:n,quad:a}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Jl.prototype.parseBGR=function(){this.pos=this.offset;try{var e="bit"+this.bitPP,t=this.width*this.height*4;this.data=new Uint8Array(t),this[e]()}catch(n){Zr.log("bit decode error:"+n)}},Jl.prototype.bit1=function(){var e,t=Math.ceil(this.width/8),n=t%4;for(e=this.height-1;e>=0;e--){for(var r=this.bottom_up?e:this.height-1-e,i=0;i<t;i++)for(var a=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+8*i*4,s=0;s<8&&8*i+s<this.width;s++){var u=this.palette[a>>7-s&1];this.data[o+4*s]=u.blue,this.data[o+4*s+1]=u.green,this.data[o+4*s+2]=u.red,this.data[o+4*s+3]=255}n!==0&&(this.pos+=4-n)}},Jl.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<e;i++){var a=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+2*i*4,s=a>>4,u=15&a,h=this.palette[s];if(this.data[o]=h.blue,this.data[o+1]=h.green,this.data[o+2]=h.red,this.data[o+3]=255,2*i+1>=this.width)break;h=this.palette[u],this.data[o+4]=h.blue,this.data[o+4+1]=h.green,this.data[o+4+2]=h.red,this.data[o+4+3]=255}t!==0&&(this.pos+=4-t)}},Jl.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var i=this.datav.getUint8(this.pos++,!0),a=n*this.width*4+4*r;if(i<this.palette.length){var o=this.palette[i];this.data[a]=o.red,this.data[a+1]=o.green,this.data[a+2]=o.blue,this.data[a+3]=255}else this.data[a]=255,this.data[a+1]=255,this.data[a+2]=255,this.data[a+3]=255}e!==0&&(this.pos+=4-e)}},Jl.prototype.bit15=function(){for(var e=this.width%3,t=parseInt("11111",2),n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(a&t)/t*255|0,s=(a>>5&t)/t*255|0,u=(a>>10&t)/t*255|0,h=a>>15?255:0,c=r*this.width*4+4*i;this.data[c]=u,this.data[c+1]=s,this.data[c+2]=o,this.data[c+3]=h}this.pos+=e}},Jl.prototype.bit16=function(){for(var e=this.width%3,t=parseInt("11111",2),n=parseInt("111111",2),r=this.height-1;r>=0;r--){for(var i=this.bottom_up?r:this.height-1-r,a=0;a<this.width;a++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(o&t)/t*255|0,u=(o>>5&n)/n*255|0,h=(o>>11)/t*255|0,c=i*this.width*4+4*a;this.data[c]=h,this.data[c+1]=u,this.data[c+2]=s,this.data[c+3]=255}this.pos+=e}},Jl.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=t*this.width*4+4*n;this.data[o]=a,this.data[o+1]=i,this.data[o+2]=r,this.data[o+3]=255}this.pos+=this.width%4}},Jl.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),s=t*this.width*4+4*n;this.data[s]=a,this.data[s+1]=i,this.data[s+2]=r,this.data[s+3]=o}},Jl.prototype.getData=function(){return this.data},(function(e){e.processBMP=function(t,n,r,i){var a=new Jl(t,!1),o=a.width,s=a.height,u={data:a.getData(),width:o,height:s},h=new Xm(100).encode(u,100);return e.processJPEG.call(this,h,n,r,i)}})(sn.API),t6.prototype.getData=function(){return this.data},(function(e){e.processWEBP=function(t,n,r,i){var a=new t6(t),o=a.width,s=a.height,u={data:a.getData(),width:o,height:s},h=new Xm(100).encode(u,100);return e.processJPEG.call(this,h,n,r,i)}})(sn.API),sn.API.processRGBA=function(e,t,n){for(var r=e.data,i=r.length,a=new Uint8Array(i/4*3),o=new Uint8Array(i/4),s=0,u=0,h=0;h<i;h+=4){var c=r[h],m=r[h+1],g=r[h+2],d=r[h+3];a[s++]=c,a[s++]=m,a[s++]=g,o[u++]=d}var y=this.__addimage__.arrayBufferToBinaryString(a);return{alpha:this.__addimage__.arrayBufferToBinaryString(o),data:y,index:t,alias:n,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},sn.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},Qh=sn.API,Z1=Qh.getCharWidthsArray=function(e,t){var n,r,i=(t=t||{}).font||this.internal.getFont(),a=t.fontSize||this.internal.getFontSize(),o=t.charSpace||this.internal.getCharSpace(),s=t.widths?t.widths:i.metadata.Unicode.widths,u=s.fof?s.fof:1,h=t.kerning?t.kerning:i.metadata.Unicode.kerning,c=h.fof?h.fof:1,m=t.doKerning!==!1,g=0,d=e.length,y=0,_=s[0]||u,x=[];for(n=0;n<d;n++)r=e.charCodeAt(n),typeof i.metadata.widthOfString=="function"?x.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(r))+o*(1e3/a)||0)/1e3):(g=m&&jr(h[r])==="object"&&!isNaN(parseInt(h[r][y],10))?h[r][y]/c:0,x.push((s[r]||_)/u+g)),y=r;return x},Gw=Qh.getStringUnitWidth=function(e,t){var n=(t=t||{}).fontSize||this.internal.getFontSize(),r=t.font||this.internal.getFont(),i=t.charSpace||this.internal.getCharSpace();return Qh.processArabic&&(e=Qh.processArabic(e)),typeof r.metadata.widthOfString=="function"?r.metadata.widthOfString(e,n,i)/n:Z1.apply(this,arguments).reduce(function(a,o){return a+o},0)},Ww=function(e,t,n,r){for(var i=[],a=0,o=e.length,s=0;a!==o&&s+t[a]<n;)s+=t[a],a++;i.push(e.slice(0,a));var u=a;for(s=0;a!==o;)s+t[a]>r&&(i.push(e.slice(u,a)),s=0,u=a),s+=t[a],a++;return u!==a&&i.push(e.slice(u,a)),i},Vw=function(e,t,n){n||(n={});var r,i,a,o,s,u,h,c=[],m=[c],g=n.textIndent||0,d=0,y=0,_=e.split(" "),x=Z1.apply(this,[" ",n])[0];if(u=n.lineIndent===-1?_[0].length+2:n.lineIndent||0){var b=Array(u).join(" "),S=[];_.map(function(E){(E=E.split(/\s*\n/)).length>1?S=S.concat(E.map(function(A,R){return(R&&A.length?`
|
|
490
|
+
`:"")+A})):S.push(E[0])}),_=S,u=Gw.apply(this,[b,n])}for(a=0,o=_.length;a<o;a++){var k=0;if(r=_[a],u&&r[0]==`
|
|
491
|
+
`&&(r=r.substr(1),k=1),g+d+(y=(i=Z1.apply(this,[r,n])).reduce(function(E,A){return E+A},0))>t||k){if(y>t){for(s=Ww.apply(this,[r,i,t-(g+d),t]),c.push(s.shift()),c=[s.pop()];s.length;)m.push([s.shift()]);y=i.slice(r.length-(c[0]?c[0].length:0)).reduce(function(E,A){return E+A},0)}else c=[r];m.push(c),g=y+u,d=x}else c.push(r),g+=d+y,d=x}return h=u?function(E,A){return(A?b:"")+E.join(" ")}:function(E){return E.join(" ")},m.map(h)},Qh.splitTextToSize=function(e,t,n){var r,i=(n=n||{}).fontSize||this.internal.getFontSize(),a=(function(c){if(c.widths&&c.kerning)return{widths:c.widths,kerning:c.kerning};var m=this.internal.getFont(c.fontName,c.fontStyle),g="Unicode";return m.metadata[g]?{widths:m.metadata[g].widths||{0:1},kerning:m.metadata[g].kerning||{}}:{font:m.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,n);r=Array.isArray(e)?e:String(e).split(/\r?\n/);var o=1*this.internal.scaleFactor*t/i;a.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0,a.lineIndent=n.lineIndent;var s,u,h=[];for(s=0,u=r.length;s<u;s++)h=h.concat(Vw.apply(this,[r[s],o,a]));return h},(function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="0123456789abcdef",n="klmnopqrstuvwxyz",r={},i={},a=0;a<16;a++)r[n[a]]=t[a],i[t[a]]=n[a];var o=function(g){return"0x"+parseInt(g,10).toString(16)},s=e.__fontmetrics__.compress=function(g){var d,y,_,x,b=["{"];for(var S in g){if(d=g[S],isNaN(parseInt(S,10))?y="'"+S+"'":(S=parseInt(S,10),y=(y=o(S).slice(2)).slice(0,-1)+i[y.slice(-1)]),typeof d=="number")d<0?(_=o(d).slice(3),x="-"):(_=o(d).slice(2),x=""),_=x+_.slice(0,-1)+i[_.slice(-1)];else{if(jr(d)!=="object")throw new Error("Don't know what to do with value type "+jr(d)+".");_=s(d)}b.push(y+_)}return b.push("}"),b.join("")},u=e.__fontmetrics__.uncompress=function(g){if(typeof g!="string")throw new Error("Invalid argument passed to uncompress.");for(var d,y,_,x,b={},S=1,k=b,E=[],A="",R="",O=g.length-1,I=1;I<O;I+=1)(x=g[I])=="'"?d?(_=d.join(""),d=void 0):d=[]:d?d.push(x):x=="{"?(E.push([k,_]),k={},_=void 0):x=="}"?((y=E.pop())[0][y[1]]=k,_=void 0,k=y[0]):x=="-"?S=-1:_===void 0?r.hasOwnProperty(x)?(A+=r[x],_=parseInt(A,16)*S,S=1,A=""):A+=x:r.hasOwnProperty(x)?(R+=r[x],k[_]=parseInt(R,16)*S,S=1,_=void 0,R=""):R+=x;return b},h={codePages:["WinAnsiEncoding"],WinAnsiEncoding:u("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},c={Unicode:{Courier:h,"Courier-Bold":h,"Courier-BoldOblique":h,"Courier-Oblique":h,Helvetica:h,"Helvetica-Bold":h,"Helvetica-BoldOblique":h,"Helvetica-Oblique":h,"Times-Roman":h,"Times-Bold":h,"Times-BoldItalic":h,"Times-Italic":h}},m={Unicode:{"Courier-Oblique":u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":u("{'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":u("{'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:u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":u("{'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:u("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:u("{'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":u("{'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:u("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":u("{'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":u("{'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":u("{'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(g){var d=g.font,y=m.Unicode[d.postScriptName];y&&(d.metadata.Unicode={},d.metadata.Unicode.widths=y.widths,d.metadata.Unicode.kerning=y.kerning);var _=c.Unicode[d.postScriptName];_&&(d.metadata.Unicode.encoding=_,d.encoding=_.codePages[0])}])})(sn.API),(function(e){var t=function(n){for(var r=n.length,i=new Uint8Array(r),a=0;a<r;a++)i[a]=n.charCodeAt(a);return i};e.API.events.push(["addFont",function(n){var r=void 0,i=n.font,a=n.instance;if(!i.isStandardFont){if(a===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");if(typeof(r=a.existsFileInVFS(i.postScriptName)===!1?a.loadFile(i.postScriptName):a.getFileFromVFS(i.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");(function(o,s){s=/^\x00\x01\x00\x00/.test(s)?t(s):t(l0(s)),o.metadata=e.API.TTFFont.open(s),o.metadata.Unicode=o.metadata.Unicode||{encoding:{},kerning:{},widths:[]},o.metadata.glyIdsUsed=[0]})(i,r)}}])})(sn),sn.API.addSvgAsImage=function(e,t,n,r,i,a,o,s){if(isNaN(t)||isNaN(n))throw Zr.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(i))throw Zr.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var u=document.createElement("canvas");u.width=r,u.height=i;var h=u.getContext("2d");h.fillStyle="#fff",h.fillRect(0,0,u.width,u.height);var c={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},m=this;return(En.canvg?Promise.resolve(En.canvg):Om(()=>import("./index.es-Bm4liNaR.js"),[],import.meta.url)).catch(function(g){return Promise.reject(new Error("Could not load canvg: "+g))}).then(function(g){return g.default?g.default:g}).then(function(g){return g.fromString(h,e,c)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(g){return g.render(c)}).then(function(){m.addImage(u.toDataURL("image/jpeg",1),t,n,r,i,o,s)})},sn.API.putTotalPages=function(e){var t,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),n=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var i=0;i<this.internal.pages[r].length;i++)this.internal.pages[r][i]=this.internal.pages[r][i].replace(t,n);return this},sn.API.viewerPreferences=function(e,t){var n;e=e||{},t=t||!1;var r,i,a,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},s=Object.keys(o),u=[],h=0,c=0,m=0;function g(y,_){var x,b=!1;for(x=0;x<y.length;x+=1)y[x]===_&&(b=!0);return b}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,e==="reset"||t===!0){var d=s.length;for(m=0;m<d;m+=1)n[s[m]].value=n[s[m]].defaultValue,n[s[m]].explicitSet=!1}if(jr(e)==="object"){for(i in e)if(a=e[i],g(s,i)&&a!==void 0){if(n[i].type==="boolean"&&typeof a=="boolean")n[i].value=a;else if(n[i].type==="name"&&g(n[i].valueSet,a))n[i].value=a;else if(n[i].type==="integer"&&Number.isInteger(a))n[i].value=a;else if(n[i].type==="array"){for(h=0;h<a.length;h+=1)if(r=!0,a[h].length===1&&typeof a[h][0]=="number")u.push(String(a[h]-1));else if(a[h].length>1){for(c=0;c<a[h].length;c+=1)typeof a[h][c]!="number"&&(r=!1);r===!0&&u.push([a[h][0]-1,a[h][1]-1].join(" "))}n[i].value="["+u.join(" ")+"]"}else n[i].value=n[i].defaultValue;n[i].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var y,_=[];for(y in n)n[y].explicitSet===!0&&(n[y].type==="name"?_.push("/"+y+" /"+n[y].value):_.push("/"+y+" "+n[y].value));_.length!==0&&this.internal.write(`/ViewerPreferences
|
|
492
|
+
<<
|
|
493
|
+
`+_.join(`
|
|
494
|
+
`)+`
|
|
495
|
+
>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},(function(e){var t=function(){var r='<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>',i=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),a=unescape(encodeURIComponent(r)),o=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),s=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),u=unescape(encodeURIComponent("</x:xmpmeta>")),h=a.length+o.length+s.length+i.length+u.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+h+" >>"),this.internal.write("stream"),this.internal.write(i+a+o+s+u),this.internal.write("endstream"),this.internal.write("endobj")},n=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")};e.addMetadata=function(r,i){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:r,namespaceuri:i||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",n),this.internal.events.subscribe("postPutResources",t)),this}})(sn.API),(function(e){var t=e.API,n=t.pdfEscape16=function(a,o){for(var s,u=o.metadata.Unicode.widths,h=["","0","00","000","0000"],c=[""],m=0,g=a.length;m<g;++m){if(s=o.metadata.characterToGlyph(a.charCodeAt(m)),o.metadata.glyIdsUsed.push(s),o.metadata.toUnicode[s]=a.charCodeAt(m),u.indexOf(s)==-1&&(u.push(s),u.push([parseInt(o.metadata.widthOfGlyph(s),10)])),s=="0")return c.join("");s=s.toString(16),c.push(h[4-s.length],s)}return c.join("")},r=function(a){var o,s,u,h,c,m,g;for(c=`/CIDInit /ProcSet findresource begin
|
|
496
|
+
12 dict begin
|
|
497
|
+
begincmap
|
|
498
|
+
/CIDSystemInfo <<
|
|
499
|
+
/Registry (Adobe)
|
|
500
|
+
/Ordering (UCS)
|
|
501
|
+
/Supplement 0
|
|
502
|
+
>> def
|
|
503
|
+
/CMapName /Adobe-Identity-UCS def
|
|
504
|
+
/CMapType 2 def
|
|
505
|
+
1 begincodespacerange
|
|
506
|
+
<0000><ffff>
|
|
507
|
+
endcodespacerange`,u=[],m=0,g=(s=Object.keys(a).sort(function(d,y){return d-y})).length;m<g;m++)o=s[m],u.length>=100&&(c+=`
|
|
508
|
+
`+u.length+` beginbfchar
|
|
509
|
+
`+u.join(`
|
|
510
|
+
`)+`
|
|
511
|
+
endbfchar`,u=[]),a[o]!==void 0&&a[o]!==null&&typeof a[o].toString=="function"&&(h=("0000"+a[o].toString(16)).slice(-4),o=("0000"+(+o).toString(16)).slice(-4),u.push("<"+o+"><"+h+">"));return u.length&&(c+=`
|
|
512
|
+
`+u.length+` beginbfchar
|
|
513
|
+
`+u.join(`
|
|
514
|
+
`)+`
|
|
515
|
+
endbfchar
|
|
516
|
+
`),c+`endcmap
|
|
517
|
+
CMapName currentdict /CMap defineresource pop
|
|
518
|
+
end
|
|
519
|
+
end`};t.events.push(["putFont",function(a){(function(o){var s=o.font,u=o.out,h=o.newObject,c=o.putStream;if(s.metadata instanceof e.API.TTFFont&&s.encoding==="Identity-H"){for(var m=s.metadata.Unicode.widths,g=s.metadata.subset.encode(s.metadata.glyIdsUsed,1),d="",y=0;y<g.length;y++)d+=String.fromCharCode(g[y]);var _=h();c({data:d,addLength1:!0,objectId:_}),u("endobj");var x=h();c({data:r(s.metadata.toUnicode),addLength1:!0,objectId:x}),u("endobj");var b=h();u("<<"),u("/Type /FontDescriptor"),u("/FontName /"+td(s.fontName)),u("/FontFile2 "+_+" 0 R"),u("/FontBBox "+e.API.PDFObject.convert(s.metadata.bbox)),u("/Flags "+s.metadata.flags),u("/StemV "+s.metadata.stemV),u("/ItalicAngle "+s.metadata.italicAngle),u("/Ascent "+s.metadata.ascender),u("/Descent "+s.metadata.decender),u("/CapHeight "+s.metadata.capHeight),u(">>"),u("endobj");var S=h();u("<<"),u("/Type /Font"),u("/BaseFont /"+td(s.fontName)),u("/FontDescriptor "+b+" 0 R"),u("/W "+e.API.PDFObject.convert(m)),u("/CIDToGIDMap /Identity"),u("/DW 1000"),u("/Subtype /CIDFontType2"),u("/CIDSystemInfo"),u("<<"),u("/Supplement 0"),u("/Registry (Adobe)"),u("/Ordering ("+s.encoding+")"),u(">>"),u(">>"),u("endobj"),s.objectNumber=h(),u("<<"),u("/Type /Font"),u("/Subtype /Type0"),u("/ToUnicode "+x+" 0 R"),u("/BaseFont /"+td(s.fontName)),u("/Encoding /"+s.encoding),u("/DescendantFonts ["+S+" 0 R]"),u(">>"),u("endobj"),s.isAlreadyPutted=!0}})(a)}]),t.events.push(["putFont",function(a){(function(o){var s=o.font,u=o.out,h=o.newObject,c=o.putStream;if(s.metadata instanceof e.API.TTFFont&&s.encoding==="WinAnsiEncoding"){for(var m=s.metadata.rawData,g="",d=0;d<m.length;d++)g+=String.fromCharCode(m[d]);var y=h();c({data:g,addLength1:!0,objectId:y}),u("endobj");var _=h();c({data:r(s.metadata.toUnicode),addLength1:!0,objectId:_}),u("endobj");var x=h();u("<<"),u("/Descent "+s.metadata.decender),u("/CapHeight "+s.metadata.capHeight),u("/StemV "+s.metadata.stemV),u("/Type /FontDescriptor"),u("/FontFile2 "+y+" 0 R"),u("/Flags 96"),u("/FontBBox "+e.API.PDFObject.convert(s.metadata.bbox)),u("/FontName /"+td(s.fontName)),u("/ItalicAngle "+s.metadata.italicAngle),u("/Ascent "+s.metadata.ascender),u(">>"),u("endobj"),s.objectNumber=h();for(var b=0;b<s.metadata.hmtx.widths.length;b++)s.metadata.hmtx.widths[b]=parseInt(s.metadata.hmtx.widths[b]*(1e3/s.metadata.head.unitsPerEm));u("<</Subtype/TrueType/Type/Font/ToUnicode "+_+" 0 R/BaseFont/"+td(s.fontName)+"/FontDescriptor "+x+" 0 R/Encoding/"+s.encoding+" /FirstChar 29 /LastChar 255 /Widths "+e.API.PDFObject.convert(s.metadata.hmtx.widths)+">>"),u("endobj"),s.isAlreadyPutted=!0}})(a)}]);var i=function(a){var o,s=a.text||"",u=a.x,h=a.y,c=a.options||{},m=a.mutex||{},g=m.pdfEscape,d=m.activeFontKey,y=m.fonts,_=d,x="",b=0,S="",k=y[_].encoding;if(y[_].encoding!=="Identity-H")return{text:s,x:u,y:h,options:c,mutex:m};for(S=s,_=d,Array.isArray(s)&&(S=s[0]),b=0;b<S.length;b+=1)y[_].metadata.hasOwnProperty("cmap")&&(o=y[_].metadata.cmap.unicode.codeMap[S[b].charCodeAt(0)]),o||S[b].charCodeAt(0)<256&&y[_].metadata.hasOwnProperty("Unicode")?x+=S[b]:x+="";var E="";return parseInt(_.slice(1))<14||k==="WinAnsiEncoding"?E=g(x,_).split("").map(function(A){return A.charCodeAt(0).toString(16)}).join(""):k==="Identity-H"&&(E=n(x,y[_])),m.isHex=!0,{text:E,x:u,y:h,options:c,mutex:m}};t.events.push(["postProcessText",function(a){var o=a.text||"",s=[],u={text:o,x:a.x,y:a.y,options:a.options,mutex:a.mutex};if(Array.isArray(o)){var h=0;for(h=0;h<o.length;h+=1)Array.isArray(o[h])&&o[h].length===3?s.push([i(Object.assign({},u,{text:o[h][0]})).text,o[h][1],o[h][2]]):s.push(i(Object.assign({},u,{text:o[h]})).text);a.text=s}else a.text=i(Object.assign({},u,{text:o})).text}])})(sn),(function(e){var t=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(n){return t.call(this),this.internal.vFS[n]!==void 0},e.addFileToVFS=function(n,r){return t.call(this),this.internal.vFS[n]=r,this},e.getFileFromVFS=function(n){return t.call(this),this.internal.vFS[n]!==void 0?this.internal.vFS[n]:null}})(sn.API),(function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(r){var i,a,o,s,u,h,c,m=t,g=[[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]],y={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},_={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},x=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],b=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)$/),S=!1,k=0;this.__bidiEngine__={};var E=function(C){var N=C.charCodeAt(),$=N>>8,G=_[$];return G!==void 0?m[256*G+(255&N)]:$===252||$===253?"AL":b.test($)?"L":$===8?"R":"N"},A=function(C){for(var N,$=0;$<C.length;$++){if((N=E(C.charAt($)))==="L")return!1;if(N==="R")return!0}return!1},R=function(C,N,$,G){var te,se,ee,Q,re=N[G];switch(re){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":S=!1;break;case"N":case"AN":break;case"EN":S&&(re="AN");break;case"AL":S=!0,re="R";break;case"WS":case"BN":re="N";break;case"CS":G<1||G+1>=N.length||(te=$[G-1])!=="EN"&&te!=="AN"||(se=N[G+1])!=="EN"&&se!=="AN"?re="N":S&&(se="AN"),re=se===te?se:"N";break;case"ES":re=(te=G>0?$[G-1]:"B")==="EN"&&G+1<N.length&&N[G+1]==="EN"?"EN":"N";break;case"ET":if(G>0&&$[G-1]==="EN"){re="EN";break}if(S){re="N";break}for(ee=G+1,Q=N.length;ee<Q&&N[ee]==="ET";)ee++;re=ee<Q&&N[ee]==="EN"?"EN":"N";break;case"NSM":if(o&&!s){for(Q=N.length,ee=G+1;ee<Q&&N[ee]==="NSM";)ee++;if(ee<Q){var X=C[G],B=X>=1425&&X<=2303||X===64286;if(te=N[ee],B&&(te==="R"||te==="AL")){re="R";break}}}re=G<1||(te=N[G-1])==="B"?"N":$[G-1];break;case"B":S=!1,i=!0,re=k;break;case"S":a=!0,re="N"}return re},O=function(C,N,$){var G=C.split("");return $&&I(G,$,{hiLevel:k}),G.reverse(),N&&N.reverse(),G.join("")},I=function(C,N,$){var G,te,se,ee,Q,re=-1,X=C.length,B=0,F=[],z=k?d:g,Y=[];for(S=!1,i=!1,a=!1,te=0;te<X;te++)Y[te]=E(C[te]);for(se=0;se<X;se++){if(Q=B,F[se]=R(C,Y,F,se),G=240&(B=z[Q][y[F[se]]]),B&=15,N[se]=ee=z[B][5],G>0)if(G===16){for(te=re;te<se;te++)N[te]=1;re=-1}else re=-1;if(z[B][6])re===-1&&(re=se);else if(re>-1){for(te=re;te<se;te++)N[te]=ee;re=-1}Y[se]==="B"&&(N[se]=0),$.hiLevel|=ee}a&&(function(J,K,ie){for(var fe=0;fe<ie;fe++)if(J[fe]==="S"){K[fe]=k;for(var ue=fe-1;ue>=0&&J[ue]==="WS";ue--)K[ue]=k}})(Y,N,X)},j=function(C,N,$,G,te){if(!(te.hiLevel<C)){if(C===1&&k===1&&!i)return N.reverse(),void($&&$.reverse());for(var se,ee,Q,re,X=N.length,B=0;B<X;){if(G[B]>=C){for(Q=B+1;Q<X&&G[Q]>=C;)Q++;for(re=B,ee=Q-1;re<ee;re++,ee--)se=N[re],N[re]=N[ee],N[ee]=se,$&&(se=$[re],$[re]=$[ee],$[ee]=se);B=Q}B++}}},D=function(C,N,$){var G=C.split(""),te={hiLevel:k};return $||($=[]),I(G,$,te),(function(se,ee,Q){if(Q.hiLevel!==0&&c)for(var re,X=0;X<se.length;X++)ee[X]===1&&(re=x.indexOf(se[X]))>=0&&(se[X]=x[re+1])})(G,$,te),j(2,G,N,$,te),j(1,G,N,$,te),G.join("")};return this.__bidiEngine__.doBidiReorder=function(C,N,$){if((function(te,se){if(se)for(var ee=0;ee<te.length;ee++)se[ee]=ee;s===void 0&&(s=A(te)),h===void 0&&(h=A(te))})(C,N),o||!u||h)if(o&&u&&s^h)k=s?1:0,C=O(C,N,$);else if(!o&&u&&h)k=s?1:0,C=D(C,N,$),C=O(C,N);else if(!o||s||u||h){if(o&&!u&&s^h)C=O(C,N),s?(k=0,C=D(C,N,$)):(k=1,C=D(C,N,$),C=O(C,N));else if(o&&s&&!u&&h)k=1,C=D(C,N,$),C=O(C,N);else if(!o&&!u&&s^h){var G=c;s?(k=1,C=D(C,N,$),k=0,c=!1,C=D(C,N,$),c=G):(k=0,C=D(C,N,$),C=O(C,N),k=1,c=!1,C=D(C,N,$),c=G,C=O(C,N))}}else k=0,C=D(C,N,$);else k=s?1:0,C=D(C,N,$);return C},this.__bidiEngine__.setOptions=function(C){C&&(o=C.isInputVisual,u=C.isOutputVisual,s=C.isInputRtl,h=C.isOutputRtl,c=C.isSymmetricSwapping)},this.__bidiEngine__.setOptions(r),this.__bidiEngine__};var t=["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"],n=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(r){var i=r.text;r.x,r.y;var a=r.options||{};r.mutex,a.lang;var o=[];if(a.isInputVisual=typeof a.isInputVisual!="boolean"||a.isInputVisual,n.setOptions(a),Object.prototype.toString.call(i)==="[object Array]"){var s=0;for(o=[],s=0;s<i.length;s+=1)Object.prototype.toString.call(i[s])==="[object Array]"?o.push([n.doBidiReorder(i[s][0]),i[s][1],i[s][2]]):o.push([n.doBidiReorder(i[s])]);r.text=o}else r.text=n.doBidiReorder(i);n.setOptions({isInputVisual:!0})}])})(sn),sn.API.TTFFont=(function(){function e(t){var n;if(this.rawData=t,n=this.contents=new Ef(t),this.contents.pos=4,n.readString(4)==="ttcf")throw new Error("TTCF not supported.");n.pos=0,this.parse(),this.subset=new Tj(this),this.registerTTF()}return e.open=function(t){return new e(t)},e.prototype.parse=function(){return this.directory=new yj(this.contents),this.head=new wj(this),this.name=new kj(this),this.cmap=new w_(this),this.toUnicode={},this.hhea=new xj(this),this.maxp=new Aj(this),this.hmtx=new Pj(this),this.post=new Sj(this),this.os2=new _j(this),this.loca=new Nj(this),this.glyf=new Oj(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 t,n,r,i,a;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var o,s,u,h;for(h=[],o=0,s=(u=this.bbox).length;o<s;o++)t=u[o],h.push(Math.round(t*this.scaleFactor));return h}).call(this),this.stemV=0,this.post.exists?(r=255&(i=this.post.italic_angle),32768&(n=i>>16)&&(n=-(1+(65535^n))),this.italicAngle=+(n+"."+r)):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=(a=this.familyClass)===1||a===2||a===3||a===4||a===5||a===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(t){var n;return((n=this.cmap.unicode)!=null?n.codeMap[t]:void 0)||0},e.prototype.widthOfGlyph=function(t){var n;return n=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*n},e.prototype.widthOfString=function(t,n,r){var i,a,o,s;for(o=0,a=0,s=(t=""+t).length;0<=s?a<s:a>s;a=0<=s?++a:--a)i=t.charCodeAt(a),o+=this.widthOfGlyph(this.characterToGlyph(i))+r*(1e3/n)||0;return o*(n/1e3)},e.prototype.lineHeight=function(t,n){var r;return n==null&&(n=!1),r=n?this.lineGap:0,(this.ascender+r-this.decender)/1e3*t},e})();var cu,Ef=(function(){function e(t){this.data=t??[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(t){return this.data[this.pos++]=t},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt32=function(){var t;return(t=this.readUInt32())>=2147483648?t-4294967296:t},e.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt16=function(){var t;return(t=this.readUInt16())>=32768?t-65536:t},e.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},e.prototype.readString=function(t){var n,r;for(r=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)r[n]=String.fromCharCode(this.readByte());return r.join("")},e.prototype.writeString=function(t){var n,r,i;for(i=[],n=0,r=t.length;0<=r?n<r:n>r;n=0<=r?++n:--n)i.push(this.writeByte(t.charCodeAt(n)));return i},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(t){return this.writeInt16(t)},e.prototype.readLongLong=function(){var t,n,r,i,a,o,s,u;return t=this.readByte(),n=this.readByte(),r=this.readByte(),i=this.readByte(),a=this.readByte(),o=this.readByte(),s=this.readByte(),u=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^n)+1099511627776*(255^r)+4294967296*(255^i)+16777216*(255^a)+65536*(255^o)+256*(255^s)+(255^u)+1):72057594037927940*t+281474976710656*n+1099511627776*r+4294967296*i+16777216*a+65536*o+256*s+u},e.prototype.writeLongLong=function(t){var n,r;return n=Math.floor(t/4294967296),r=4294967295&t,this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n),this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(t){return this.writeInt32(t)},e.prototype.read=function(t){var n,r;for(n=[],r=0;0<=t?r<t:r>t;r=0<=t?++r:--r)n.push(this.readByte());return n},e.prototype.write=function(t){var n,r,i,a;for(a=[],r=0,i=t.length;r<i;r++)n=t[r],a.push(this.writeByte(n));return a},e})(),yj=(function(){var e;function t(n){var r,i,a;for(this.scalarType=n.readInt(),this.tableCount=n.readShort(),this.searchRange=n.readShort(),this.entrySelector=n.readShort(),this.rangeShift=n.readShort(),this.tables={},i=0,a=this.tableCount;0<=a?i<a:i>a;i=0<=a?++i:--i)r={tag:n.readString(4),checksum:n.readInt(),offset:n.readInt(),length:n.readInt()},this.tables[r.tag]=r}return t.prototype.encode=function(n){var r,i,a,o,s,u,h,c,m,g,d,y,_;for(_ in d=Object.keys(n).length,u=Math.log(2),m=16*Math.floor(Math.log(d)/u),o=Math.floor(m/u),c=16*d-m,(i=new Ef).writeInt(this.scalarType),i.writeShort(d),i.writeShort(m),i.writeShort(o),i.writeShort(c),a=16*d,h=i.pos+a,s=null,y=[],n)for(g=n[_],i.writeString(_),i.writeInt(e(g)),i.writeInt(h),i.writeInt(g.length),y=y.concat(g),_==="head"&&(s=h),h+=g.length;h%4;)y.push(0),h++;return i.write(y),r=2981146554-e(i.data),i.pos=s+8,i.writeUInt32(r),i.data},e=function(n){var r,i,a,o;for(n=x_.call(n);n.length%4;)n.push(0);for(a=new Ef(n),i=0,r=0,o=n.length;r<o;r=r+=4)i+=a.readUInt32();return 4294967295&i},t})(),bj={}.hasOwnProperty,Xu=function(e,t){for(var n in t)bj.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};cu=(function(){function e(t){var n;this.file=t,n=this.file.directory.tables[this.tag],this.exists=!!n,n&&(this.offset=n.offset,this.length=n.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 wj=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Xu(e,cu),e.prototype.tag="head",e.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()},e.prototype.encode=function(t){var n;return(n=new Ef).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},e})(),n6=(function(){function e(t,n){var r,i,a,o,s,u,h,c,m,g,d,y,_,x,b,S,k;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=n+t.readInt(),m=t.pos,t.pos=this.offset,this.format=t.readUInt16(),this.length=t.readUInt16(),this.language=t.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]=t.readByte();break;case 4:for(d=t.readUInt16(),g=d/2,t.pos+=6,a=(function(){var E,A;for(A=[],u=E=0;0<=g?E<g:E>g;u=0<=g?++E:--E)A.push(t.readUInt16());return A})(),t.pos+=2,_=(function(){var E,A;for(A=[],u=E=0;0<=g?E<g:E>g;u=0<=g?++E:--E)A.push(t.readUInt16());return A})(),h=(function(){var E,A;for(A=[],u=E=0;0<=g?E<g:E>g;u=0<=g?++E:--E)A.push(t.readUInt16());return A})(),c=(function(){var E,A;for(A=[],u=E=0;0<=g?E<g:E>g;u=0<=g?++E:--E)A.push(t.readUInt16());return A})(),i=(this.length-t.pos+this.offset)/2,s=(function(){var E,A;for(A=[],u=E=0;0<=i?E<i:E>i;u=0<=i?++E:--E)A.push(t.readUInt16());return A})(),u=b=0,k=a.length;b<k;u=++b)for(x=a[u],r=S=y=_[u];y<=x?S<=x:S>=x;r=y<=x?++S:--S)c[u]===0?o=r+h[u]:(o=s[c[u]/2+(r-y)-(g-u)]||0)!==0&&(o+=h[u]),this.codeMap[r]=65535&o}t.pos=m}return e.encode=function(t,n){var r,i,a,o,s,u,h,c,m,g,d,y,_,x,b,S,k,E,A,R,O,I,j,D,C,N,$,G,te,se,ee,Q,re,X,B,F,z,Y,J,K,ie,fe,ue,_e,Ce,$e;switch(G=new Ef,o=Object.keys(t).sort(function(ze,tt){return ze-tt}),n){case"macroman":for(_=0,x=(function(){var ze=[];for(y=0;y<256;++y)ze.push(0);return ze})(),S={0:0},a={},te=0,re=o.length;te<re;te++)S[ue=t[i=o[te]]]==null&&(S[ue]=++_),a[i]={old:t[i],new:S[t[i]]},x[i]=S[t[i]];return G.writeUInt16(1),G.writeUInt16(0),G.writeUInt32(12),G.writeUInt16(0),G.writeUInt16(262),G.writeUInt16(0),G.write(x),{charMap:a,subtable:G.data,maxGlyphID:_+1};case"unicode":for(N=[],m=[],k=0,S={},r={},b=h=null,se=0,X=o.length;se<X;se++)S[A=t[i=o[se]]]==null&&(S[A]=++k),r[i]={old:A,new:S[A]},s=S[A]-i,b!=null&&s===h||(b&&m.push(b),N.push(i),h=s),b=i;for(b&&m.push(b),m.push(65535),N.push(65535),D=2*(j=N.length),I=2*Math.pow(Math.log(j)/Math.LN2,2),g=Math.log(I/2)/Math.LN2,O=2*j-I,u=[],R=[],d=[],y=ee=0,B=N.length;ee<B;y=++ee){if(C=N[y],c=m[y],C===65535){u.push(0),R.push(0);break}if(C-($=r[C].new)>=32768)for(u.push(0),R.push(2*(d.length+j-y)),i=Q=C;C<=c?Q<=c:Q>=c;i=C<=c?++Q:--Q)d.push(r[i].new);else u.push($-C),R.push(0)}for(G.writeUInt16(3),G.writeUInt16(1),G.writeUInt32(12),G.writeUInt16(4),G.writeUInt16(16+8*j+2*d.length),G.writeUInt16(0),G.writeUInt16(D),G.writeUInt16(I),G.writeUInt16(g),G.writeUInt16(O),ie=0,F=m.length;ie<F;ie++)i=m[ie],G.writeUInt16(i);for(G.writeUInt16(0),fe=0,z=N.length;fe<z;fe++)i=N[fe],G.writeUInt16(i);for(_e=0,Y=u.length;_e<Y;_e++)s=u[_e],G.writeUInt16(s);for(Ce=0,J=R.length;Ce<J;Ce++)E=R[Ce],G.writeUInt16(E);for($e=0,K=d.length;$e<K;$e++)_=d[$e],G.writeUInt16(_);return{charMap:r,subtable:G.data,maxGlyphID:k+1}}},e})(),w_=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Xu(e,cu),e.prototype.tag="cmap",e.prototype.parse=function(t){var n,r,i;for(t.pos=this.offset,this.version=t.readUInt16(),i=t.readUInt16(),this.tables=[],this.unicode=null,r=0;0<=i?r<i:r>i;r=0<=i?++r:--r)n=new n6(t,this.offset),this.tables.push(n),n.isUnicode&&this.unicode==null&&(this.unicode=n);return!0},e.encode=function(t,n){var r,i;return n==null&&(n="macroman"),r=n6.encode(t,n),(i=new Ef).writeUInt16(0),i.writeUInt16(1),r.table=i.data.concat(r.subtable),r},e})(),xj=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Xu(e,cu),e.prototype.tag="hhea",e.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()},e})(),_j=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Xu(e,cu),e.prototype.tag="OS/2",e.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,r;for(r=[],n=0;n<10;++n)r.push(t.readByte());return r})(),this.charRange=(function(){var n,r;for(r=[],n=0;n<4;++n)r.push(t.readInt());return r})(),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,r;for(r=[],n=0;n<2;n=++n)r.push(t.readInt());return r})(),this.version>1))return this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()},e})(),Sj=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Xu(e,cu),e.prototype.tag="post",e.prototype.parse=function(t){var n,r,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:case 196608:break;case 131072:var a;for(r=t.readUInt16(),this.glyphNameIndex=[],a=0;0<=r?a<r:a>r;a=0<=r?++a:--a)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 r=t.readUInt16(),this.offsets=t.read(r);case 262144:return this.map=(function(){var o,s,u;for(u=[],a=o=0,s=this.file.maxp.numGlyphs;0<=s?o<s:o>s;a=0<=s?++o:--o)u.push(t.readUInt32());return u}).call(this)}},e})(),Ej=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},kj=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Xu(e,cu),e.prototype.tag="name",e.prototype.parse=function(t){var n,r,i,a,o,s,u,h,c,m,g;for(t.pos=this.offset,t.readShort(),n=t.readShort(),s=t.readShort(),r=[],a=0;0<=n?a<n:a>n;a=0<=n?++a:--a)r.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+s+t.readShort()});for(u={},a=c=0,m=r.length;c<m;a=++c)i=r[a],t.pos=i.offset,h=t.readString(i.length),o=new Ej(h,i),u[g=i.nameID]==null&&(u[g]=[]),u[i.nameID].push(o);this.strings=u,this.copyright=u[0],this.fontFamily=u[1],this.fontSubfamily=u[2],this.uniqueSubfamily=u[3],this.fontName=u[4],this.version=u[5];try{this.postscriptName=u[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=u[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=u[7],this.manufacturer=u[8],this.designer=u[9],this.description=u[10],this.vendorUrl=u[11],this.designerUrl=u[12],this.license=u[13],this.licenseUrl=u[14],this.preferredFamily=u[15],this.preferredSubfamily=u[17],this.compatibleFull=u[18],this.sampleText=u[19]},e})(),Aj=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Xu(e,cu),e.prototype.tag="maxp",e.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()},e})(),Pj=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Xu(e,cu),e.prototype.tag="hmtx",e.prototype.parse=function(t){var n,r,i,a,o,s,u;for(t.pos=this.offset,this.metrics=[],n=0,s=this.file.hhea.numberOfMetrics;0<=s?n<s:n>s;n=0<=s?++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,c;for(c=[],n=h=0;0<=i?h<i:h>i;n=0<=i?++h:--h)c.push(t.readInt16());return c})(),this.widths=(function(){var h,c,m,g;for(g=[],h=0,c=(m=this.metrics).length;h<c;h++)a=m[h],g.push(a.advance);return g}).call(this),r=this.widths[this.widths.length-1],u=[],n=o=0;0<=i?o<i:o>i;n=0<=i?++o:--o)u.push(this.widths.push(r));return u},e.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]}},e})(),x_=[].slice,Oj=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Xu(e,cu),e.prototype.tag="glyf",e.prototype.parse=function(){return this.cache={}},e.prototype.glyphFor=function(t){var n,r,i,a,o,s,u,h,c,m;return t in this.cache?this.cache[t]:(a=this.file.loca,n=this.file.contents,r=a.indexOf(t),(i=a.lengthOf(t))===0?this.cache[t]=null:(n.pos=this.offset+r,o=(s=new Ef(n.read(i))).readShort(),h=s.readShort(),m=s.readShort(),u=s.readShort(),c=s.readShort(),this.cache[t]=o===-1?new Lj(s,h,m,u,c):new Cj(s,o,h,m,u,c),this.cache[t]))},e.prototype.encode=function(t,n,r){var i,a,o,s,u;for(o=[],a=[],s=0,u=n.length;s<u;s++)i=t[n[s]],a.push(o.length),i&&(o=o.concat(i.encode(r)));return a.push(o.length),{table:o,offsets:a}},e})(),Cj=(function(){function e(t,n,r,i,a,o){this.raw=t,this.numberOfContours=n,this.xMin=r,this.yMin=i,this.xMax=a,this.yMax=o,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e})(),Lj=(function(){function e(t,n,r,i,a){var o,s;for(this.raw=t,this.xMin=n,this.yMin=r,this.xMax=i,this.yMax=a,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],o=this.raw;s=o.readShort(),this.glyphOffsets.push(o.pos),this.glyphIDs.push(o.readUInt16()),32&s;)o.pos+=1&s?4:2,128&s?o.pos+=8:64&s?o.pos+=4:8&s&&(o.pos+=2)}return e.prototype.encode=function(){var t,n,r;for(n=new Ef(x_.call(this.raw.data)),t=0,r=this.glyphIDs.length;t<r;++t)n.pos=this.glyphOffsets[t];return n.data},e})(),Nj=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Xu(e,cu),e.prototype.tag="loca",e.prototype.parse=function(t){var n,r;return t.pos=this.offset,n=this.file.head.indexToLocFormat,this.offsets=n===0?(function(){var i,a;for(a=[],r=0,i=this.length;r<i;r+=2)a.push(2*t.readUInt16());return a}).call(this):(function(){var i,a;for(a=[],r=0,i=this.length;r<i;r+=4)a.push(t.readUInt32());return a}).call(this)},e.prototype.indexOf=function(t){return this.offsets[t]},e.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]},e.prototype.encode=function(t,n){for(var r=new Uint32Array(this.offsets.length),i=0,a=0,o=0;o<r.length;++o)if(r[o]=i,a<n.length&&n[a]==o){++a,r[o]=i;var s=this.offsets[o],u=this.offsets[o+1]-s;u>0&&(i+=u)}for(var h=new Array(4*r.length),c=0;c<r.length;++c)h[4*c+3]=255&r[c],h[4*c+2]=(65280&r[c])>>8,h[4*c+1]=(16711680&r[c])>>16,h[4*c]=(4278190080&r[c])>>24;return h},e})(),Tj=(function(){function e(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var t,n,r,i,a;for(n in i=this.font.cmap.tables[0].codeMap,t={},a=this.subset)r=a[n],t[n]=i[r];return t},e.prototype.glyphsFor=function(t){var n,r,i,a,o,s,u;for(i={},o=0,s=t.length;o<s;o++)i[a=t[o]]=this.font.glyf.glyphFor(a);for(a in n=[],i)(r=i[a])!=null&&r.compound&&n.push.apply(n,r.glyphIDs);if(n.length>0)for(a in u=this.glyphsFor(n))r=u[a],i[a]=r;return i},e.prototype.encode=function(t,n){var r,i,a,o,s,u,h,c,m,g,d,y,_,x,b;for(i in r=w_.encode(this.generateCmap(),"unicode"),o=this.glyphsFor(t),d={0:0},b=r.charMap)d[(u=b[i]).old]=u.new;for(y in g=r.maxGlyphID,o)y in d||(d[y]=g++);return c=(function(S){var k,E;for(k in E={},S)E[S[k]]=k;return E})(d),m=Object.keys(c).sort(function(S,k){return S-k}),_=(function(){var S,k,E;for(E=[],S=0,k=m.length;S<k;S++)s=m[S],E.push(c[s]);return E})(),a=this.font.glyf.encode(o,_,d),h=this.font.loca.encode(a.offsets,_),x={cmap:this.font.cmap.raw(),glyf:a.table,loca:h,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(n)},this.font.os2.exists&&(x["OS/2"]=this.font.os2.raw()),this.font.directory.encode(x)},e})();sn.API.PDFObject=(function(){var e;function t(){}return e=function(n,r){return(Array(r+1).join("0")+n).slice(-r)},t.convert=function(n){var r,i,a,o;if(Array.isArray(n))return"["+(function(){var s,u,h;for(h=[],s=0,u=n.length;s<u;s++)r=n[s],h.push(t.convert(r));return h})().join(" ")+"]";if(typeof n=="string")return"/"+n;if(n?.isString)return"("+n+")";if(n instanceof Date)return"(D:"+e(n.getUTCFullYear(),4)+e(n.getUTCMonth(),2)+e(n.getUTCDate(),2)+e(n.getUTCHours(),2)+e(n.getUTCMinutes(),2)+e(n.getUTCSeconds(),2)+"Z)";if({}.toString.call(n)==="[object Object]"){for(i in a=["<<"],n)o=n[i],a.push("/"+i+" "+t.convert(o));return a.push(">>"),a.join(`
|
|
520
|
+
`)}return""+n},t})();window.jspdf={jsPDF:sn};eO(!1);J8("change-font-size");const Rj=new URLSearchParams(location.search).get("key"),__=HT({key:Rj});window.store=__;window.config={addGlobalFont:sO,setRichTextEnabled:gO,setTextVerticalResizeEnabled:pO,setTextOverflow:J8,onLoadError:oO,setAssetLoadTimeout:nO,setFontLoadTimeout:rO,unstable_setTextSplitAllowed:vO};const Mj=i6.createRoot(document.getElementById("root"));Mj.render(oe.createElement(qR,{visiblePagesOffset:0,renderOnlyActivePage:!0,store:__,components:{PageControls:()=>null,Tooltip:()=>null}}));export{jr as _,d0 as c,yh as g};
|