polotno-node 2.14.5 → 2.14.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,521 +0,0 @@
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)}})();const K_="modulepreload",Z_=function(e,t){return new URL(e,t).href},l5={},Q1=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let h=function(c){return Promise.all(c.map(p=>Promise.resolve(p).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};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=Z_(c,r),c in l5)return;l5[c]=!0;const p=c.endsWith(".css"),m=p?'[rel="stylesheet"]':"";if(r)for(let y=o.length-1;y>=0;y--){const w=o[y];if(w.href===c&&(!p||w.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${m}`))return;const d=document.createElement("link");if(d.rel=p?"stylesheet":K_,p||(d.as="script"),d.crossOrigin="",d.href=c,u&&d.setAttribute("nonce",u),document.head.appendChild(d),p)return new Promise((y,w)=>{d.addEventListener("load",y),d.addEventListener("error",()=>w(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)})};var p0=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 Q_(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 jg={exports:{}},Un={};var u5;function J_(){if(u5)return Un;u5=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"),p=Symbol.iterator;function m(B){return B===null||typeof B!="object"?null:(B=p&&B[p]||B["@@iterator"],typeof B=="function"?B:null)}var d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,w={};function x(B,F,z){this.props=B,this.context=F,this.refs=w,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=w,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,M={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function R(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),we=0;we<fe;we++)ue[we]=arguments[we+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:M.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 L(B){var F={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(z){return F[z]})}var T=/\/+/g;function $(B,F){return typeof B=="object"&&B!==null&&B.key!=null?L(""+B.key):F.toString(36)}function U(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(T,"$&/")+"/"),U(J,F,z,"",function(we){return we})):J!=null&&(D(J)&&(J=j(J,z+(!J.key||ie&&ie.key===J.key?"":(""+J.key).replace(T,"$&/")+"/")+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+=U(K,F,z,ue,J)}else if(ue=m(B),typeof ue=="function")for(B=ue.call(B),fe=0;!(K=B.next()).done;)K=K.value,ue=Y+$(K,fe++),ie+=U(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 U(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:M};function X(){throw Error("act(...) is not supported in production builds of React.")}return Un.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}},Un.Component=x,Un.Fragment=n,Un.Profiler=i,Un.PureComponent=S,Un.StrictMode=r,Un.Suspense=u,Un.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=re,Un.act=X,Un.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=M.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 we=0;we<ue;we++)fe[we]=arguments[we+2];Y.children=fe}return{$$typeof:e,type:B.type,key:J,ref:K,props:Y,_owner:ie}},Un.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},Un.createElement=R,Un.createFactory=function(B){var F=R.bind(null,B);return F.type=B,F},Un.createRef=function(){return{current:null}},Un.forwardRef=function(B){return{$$typeof:s,render:B}},Un.isValidElement=D,Un.lazy=function(B){return{$$typeof:c,_payload:{_status:-1,_result:B},_init:se}},Un.memo=function(B,F){return{$$typeof:h,type:B,compare:F===void 0?null:F}},Un.startTransition=function(B){var F=Q.transition;Q.transition={};try{B()}finally{Q.transition=F}},Un.unstable_act=X,Un.useCallback=function(B,F){return ee.current.useCallback(B,F)},Un.useContext=function(B){return ee.current.useContext(B)},Un.useDebugValue=function(){},Un.useDeferredValue=function(B){return ee.current.useDeferredValue(B)},Un.useEffect=function(B,F){return ee.current.useEffect(B,F)},Un.useId=function(){return ee.current.useId()},Un.useImperativeHandle=function(B,F,z){return ee.current.useImperativeHandle(B,F,z)},Un.useInsertionEffect=function(B,F){return ee.current.useInsertionEffect(B,F)},Un.useLayoutEffect=function(B,F){return ee.current.useLayoutEffect(B,F)},Un.useMemo=function(B,F){return ee.current.useMemo(B,F)},Un.useReducer=function(B,F,z){return ee.current.useReducer(B,F,z)},Un.useRef=function(B){return ee.current.useRef(B)},Un.useState=function(B){return ee.current.useState(B)},Un.useSyncExternalStore=function(B,F,z){return ee.current.useSyncExternalStore(B,F,z)},Un.useTransition=function(){return ee.current.useTransition()},Un.version="18.3.1",Un}var c5;function Mp(){return c5||(c5=1,jg.exports=J_()),jg.exports}var Di=Mp();const oe=yh(Di);var x1={},Dg={exports:{}},Cs={},Fg={exports:{}},Bg={};var f5;function e9(){return f5||(f5=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,p=null,m=3,d=!1,y=!1,w=!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(w=!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,w&&(w=!1,b(R),R=-1),d=!0;var X=m;try{for(k(re),p=n(u);p!==null&&(!(p.expirationTime>re)||Q&&!L());){var B=p.callback;if(typeof B=="function"){p.callback=null,m=p.priorityLevel;var F=B(p.expirationTime<=re);re=e.unstable_now(),typeof F=="function"?p.callback=F:p===n(u)&&r(u),k(re)}else r(u);p=n(u)}if(p!==null)var z=!0;else{var Y=n(h);Y!==null&&ee(E,Y.startTime-re),z=!1}return z}finally{p=null,m=X,d=!1}}var M=!1,O=null,R=-1,j=5,D=-1;function L(){return!(e.unstable_now()-D<j)}function T(){if(O!==null){var Q=e.unstable_now();D=Q;var re=!0;try{re=O(!0,Q)}finally{re?$():(M=!1,O=null)}}else M=!1}var $;if(typeof S=="function")$=function(){S(T)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,te=U.port2;U.port1.onmessage=T,$=function(){te.postMessage(null)}}else $=function(){x(T,0)};function se(Q){O=Q,M||(M=!0,$())}function ee(Q,re){R=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 m},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(Q){switch(m){case 1:case 2:case 3:var re=3;break;default:re=m}var X=m;m=re;try{return Q()}finally{m=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=m;m=Q;try{return re()}finally{m=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)&&(w?(b(R),R=-1):w=!0,ee(E,X-B))):(Q.sortIndex=F,t(u,Q),y||d||(y=!0,se(A))),Q},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(Q){var re=m;return function(){var X=m;m=re;try{return Q.apply(this,arguments)}finally{m=X}}}})(Bg)),Bg}var h5;function Hv(){return h5||(h5=1,Fg.exports=e9()),Fg.exports}var d5;function t9(){if(d5)return Cs;d5=1;var e=Mp(),t=Hv();function n(l){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+l,_=1;_<arguments.length;_++)f+="&args[]="+encodeURIComponent(arguments[_]);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={},p={};function m(l){return u.call(p,l)?!0:u.call(c,l)?!1:h.test(l)?p[l]=!0:(c[l]=!0,!1)}function d(l,f,_,N){if(_!==null&&_.type===0)return!1;switch(typeof f){case"function":case"symbol":return!0;case"boolean":return N?!1:_!==null?!_.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function y(l,f,_,N){if(f===null||typeof f>"u"||d(l,f,_,N))return!0;if(N)return!1;if(_!==null)switch(_.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 w(l,f,_,N,G,Z,de){this.acceptsBooleans=f===2||f===3||f===4,this.attributeName=N,this.attributeNamespace=G,this.mustUseProperty=_,this.propertyName=l,this.type=f,this.sanitizeURL=Z,this.removeEmptyString=de}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){x[l]=new w(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 w(f,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){x[l]=new w(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){x[l]=new w(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 w(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){x[l]=new w(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){x[l]=new w(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){x[l]=new w(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){x[l]=new w(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 w(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 w(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 w(f,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){x[l]=new w(l,1,!1,l.toLowerCase(),null,!1,!1)}),x.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){x[l]=new w(l,1,!1,l.toLowerCase(),null,!0,!0)});function k(l,f,_,N){var G=x.hasOwnProperty(f)?x[f]:null;(G!==null?G.type!==0:N||!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(y(f,_,G,N)&&(_=null),N||G===null?m(f)&&(_===null?l.removeAttribute(f):l.setAttribute(f,""+_)):G.mustUseProperty?l[G.propertyName]=_===null?G.type===3?!1:"":_:(f=G.attributeName,N=G.attributeNamespace,_===null?l.removeAttribute(f):(G=G.type,_=G===3||G===4&&_===!0?"":""+_,N?l.setAttributeNS(N,f,_):l.setAttribute(f,_))))}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),M=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),L=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),U=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(_){var f=_.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 _=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(ot){var N=ot}Reflect.construct(l,[],f)}else{try{f.call()}catch(ot){N=ot}l.call(f.prototype)}else{try{throw Error()}catch(ot){N=ot}l()}}catch(ot){if(ot&&N&&typeof ot.stack=="string"){for(var G=ot.stack.split(`
3
- `),Z=N.stack.split(`
4
- `),de=G.length-1,Ne=Z.length-1;1<=de&&0<=Ne&&G[de]!==Z[Ne];)Ne--;for(;1<=de&&0<=Ne;de--,Ne--)if(G[de]!==Z[Ne]){if(de!==1||Ne!==1)do if(de--,Ne--,0>Ne||G[de]!==Z[Ne]){var Fe=`
5
- `+G[de].replace(" at new "," at ");return l.displayName&&Fe.includes("<anonymous>")&&(Fe=Fe.replace("<anonymous>",l.displayName)),Fe}while(1<=de&&0<=Ne);break}}}finally{z=!1,Error.prepareStackTrace=_}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 M:return"Portal";case j:return"Profiler";case R:return"StrictMode";case $:return"Suspense";case U:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case L:return(l.displayName||"Context")+".Consumer";case D:return(l._context.displayName||"Context")+".Provider";case T: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===R?"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 we(l){var f=ue(l)?"checked":"value",_=Object.getOwnPropertyDescriptor(l.constructor.prototype,f),N=""+l[f];if(!l.hasOwnProperty(f)&&typeof _<"u"&&typeof _.get=="function"&&typeof _.set=="function"){var G=_.get,Z=_.set;return Object.defineProperty(l,f,{configurable:!0,get:function(){return G.call(this)},set:function(de){N=""+de,Z.call(this,de)}}),Object.defineProperty(l,f,{enumerable:_.enumerable}),{getValue:function(){return N},setValue:function(de){N=""+de},stopTracking:function(){l._valueTracker=null,delete l[f]}}}}function Ce(l){l._valueTracker||(l._valueTracker=we(l))}function Ue(l){if(!l)return!1;var f=l._valueTracker;if(!f)return!0;var _=f.getValue(),N="";return l&&(N=ue(l)?l.checked?"true":"false":l.value),l=N,l!==_?(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 _=f.checked;return X({},f,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:_??l._wrapperState.initialChecked})}function ge(l,f){var _=f.defaultValue==null?"":f.defaultValue,N=f.checked!=null?f.checked:f.defaultChecked;_=fe(f.value!=null?f.value:_),l._wrapperState={initialChecked:N,initialValue:_,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 ke(l,f){ut(l,f);var _=fe(f.value),N=f.type;if(_!=null)N==="number"?(_===0&&l.value===""||l.value!=_)&&(l.value=""+_):l.value!==""+_&&(l.value=""+_);else if(N==="submit"||N==="reset"){l.removeAttribute("value");return}f.hasOwnProperty("value")?be(l,f.type,_):f.hasOwnProperty("defaultValue")&&be(l,f.type,fe(f.defaultValue)),f.checked==null&&f.defaultChecked!=null&&(l.defaultChecked=!!f.defaultChecked)}function he(l,f,_){if(f.hasOwnProperty("value")||f.hasOwnProperty("defaultValue")){var N=f.type;if(!(N!=="submit"&&N!=="reset"||f.value!==void 0&&f.value!==null))return;f=""+l._wrapperState.initialValue,_||f===l.value||(l.value=f),l.defaultValue=f}_=l.name,_!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,_!==""&&(l.name=_)}function be(l,f,_){(f!=="number"||ze(l.ownerDocument)!==l)&&(_==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+_&&(l.defaultValue=""+_))}var Le=Array.isArray;function Me(l,f,_,N){if(l=l.options,f){f={};for(var G=0;G<_.length;G++)f["$"+_[G]]=!0;for(_=0;_<l.length;_++)G=f.hasOwnProperty("$"+l[_].value),l[_].selected!==G&&(l[_].selected=G),G&&N&&(l[_].defaultSelected=!0)}else{for(_=""+fe(_),f=null,G=0;G<l.length;G++){if(l[G].value===_){l[G].selected=!0,N&&(l[G].defaultSelected=!0);return}f!==null||l[G].disabled||(f=l[G])}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 _=f.value;if(_==null){if(_=f.children,f=f.defaultValue,_!=null){if(f!=null)throw Error(n(92));if(Le(_)){if(1<_.length)throw Error(n(93));_=_[0]}f=_}f==null&&(f=""),_=f}l._wrapperState={initialValue:fe(_)}}function xe(l,f){var _=fe(f.value),N=fe(f.defaultValue);_!=null&&(_=""+_,_!==l.value&&(l.value=_),f.defaultValue==null&&l.defaultValue!==_&&(l.defaultValue=_)),N!=null&&(l.defaultValue=""+N)}function Ie(l){var f=l.textContent;f===l._wrapperState.initialValue&&f!==""&&f!==null&&(l.value=f)}function Te(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 Je(l,f){return l==null||l==="http://www.w3.org/1999/xhtml"?Te(f):l==="http://www.w3.org/2000/svg"&&f==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var nt,st=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(f,_,N,G){MSApp.execUnsafeLocalFunction(function(){return l(f,_,N,G)})}:l})(function(l,f){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=f;else{for(nt=nt||document.createElement("div"),nt.innerHTML="<svg>"+f.valueOf().toString()+"</svg>",f=nt.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;f.firstChild;)l.appendChild(f.firstChild)}});function at(l,f){if(f){var _=l.firstChild;if(_&&_===l.lastChild&&_.nodeType===3){_.nodeValue=f;return}}l.textContent=f}var ct={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(ct).forEach(function(l){Ct.forEach(function(f){f=f+l.charAt(0).toUpperCase()+l.substring(1),ct[f]=ct[l]})});function rn(l,f,_){return f==null||typeof f=="boolean"||f===""?"":_||typeof f!="number"||f===0||ct.hasOwnProperty(l)&&ct[l]?(""+f).trim():f+"px"}function Zt(l,f){l=l.style;for(var _ in f)if(f.hasOwnProperty(_)){var N=_.indexOf("--")===0,G=rn(_,f[_],N);_==="float"&&(_="cssFloat"),N?l.setProperty(_,G):l[_]=G}}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 Wt=null;function Et(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var Nt=null,Tt=null,on=null;function Ht(l){if(l=ku(l)){if(typeof Nt!="function")throw Error(n(280));var f=l.stateNode;f&&(f=Mi(f),Nt(l.stateNode,l.type,f))}}function hn(l){Tt?on?on.push(l):on=[l]:Tt=l}function ui(){if(Tt){var l=Tt,f=on;if(on=Tt=null,Ht(l),f)for(l=0;l<f.length;l++)Ht(f[l])}}function Ur(l,f){return l(f)}function hr(){}var dr=!1;function Qt(l,f,_){if(dr)return l(f,_);dr=!0;try{return Ur(l,f,_)}finally{dr=!1,(Tt!==null||on!==null)&&(hr(),ui())}}function zi(l,f){var _=l.stateNode;if(_===null)return null;var N=Mi(_);if(N===null)return null;_=N[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":(N=!N.disabled)||(l=l.type,N=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!N;break e;default:l=!1}if(l)return null;if(_&&typeof _!="function")throw Error(n(231,f,typeof _));return _}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 Zi(l,f,_,N,G,Z,de,Ne,Fe){var ot=Array.prototype.slice.call(arguments,3);try{f.apply(_,ot)}catch(bt){this.onError(bt)}}var $n=!1,Or=null,Dr=!1,Ea=null,Go={onError:function(l){$n=!0,Or=l}};function ka(l,f,_,N,G,Z,de,Ne,Fe){$n=!1,Or=null,Zi.apply(Go,arguments)}function io(l,f,_,N,G,Z,de,Ne,Fe){if(ka.apply(this,arguments),$n){if($n){var ot=Or;$n=!1,Or=null}else throw Error(n(198));Dr||(Dr=!0,Ea=ot)}}function ci(l){var f=l,_=l;if(l.alternate)for(;f.return;)f=f.return;else{l=f;do f=l,(f.flags&4098)!==0&&(_=f.return),l=f.return;while(l)}return f.tag===3?_: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(ci(l)!==l)throw Error(n(188))}function Wo(l){var f=l.alternate;if(!f){if(f=ci(l),f===null)throw Error(n(188));return f!==l?null:l}for(var _=l,N=f;;){var G=_.return;if(G===null)break;var Z=G.alternate;if(Z===null){if(N=G.return,N!==null){_=N;continue}break}if(G.child===Z.child){for(Z=G.child;Z;){if(Z===_)return Pa(G),l;if(Z===N)return Pa(G),f;Z=Z.sibling}throw Error(n(188))}if(_.return!==N.return)_=G,N=Z;else{for(var de=!1,Ne=G.child;Ne;){if(Ne===_){de=!0,_=G,N=Z;break}if(Ne===N){de=!0,N=G,_=Z;break}Ne=Ne.sibling}if(!de){for(Ne=Z.child;Ne;){if(Ne===_){de=!0,_=Z,N=G;break}if(Ne===N){de=!0,N=Z,_=G;break}Ne=Ne.sibling}if(!de)throw Error(n(189))}}if(_.alternate!==N)throw Error(n(190))}if(_.tag!==3)throw Error(n(188));return _.stateNode.current===_?l:f}function qi(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,hu=t.unstable_shouldYield,If=t.unstable_requestPaint,Cr=t.unstable_now,du=t.unstable_getCurrentPriorityLevel,os=t.unstable_ImmediatePriority,Oa=t.unstable_UserBlockingPriority,ss=t.unstable_NormalPriority,Lc=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,Hi=4194304;function Hr(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 _=l.pendingLanes;if(_===0)return 0;var N=0,G=l.suspendedLanes,Z=l.pingedLanes,de=_&268435455;if(de!==0){var Ne=de&~G;Ne!==0?N=Hr(Ne):(Z&=de,Z!==0&&(N=Hr(Z)))}else de=_&~G,de!==0?N=Hr(de):Z!==0&&(N=Hr(Z));if(N===0)return 0;if(f!==0&&f!==N&&(f&G)===0&&(G=N&-N,Z=f&-f,G>=Z||G===16&&(Z&4194240)!==0))return f;if((N&4)!==0&&(N|=_&16),f=l.entangledLanes,f!==0)for(l=l.entanglements,f&=N;0<f;)_=31-wn(f),G=1<<_,N|=l[_],f&=~G;return N}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 _=l.suspendedLanes,N=l.pingedLanes,G=l.expirationTimes,Z=l.pendingLanes;0<Z;){var de=31-wn(Z),Ne=1<<de,Fe=G[de];Fe===-1?((Ne&_)===0||(Ne&N)!==0)&&(G[de]=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 pu(){var l=so;return so<<=1,(so&4194240)===0&&(so=64),l}function Ca(l){for(var f=[],_=0;31>_;_++)f.push(l);return f}function Ml(l,f,_){l.pendingLanes|=f,f!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,f=31-wn(f),l[f]=_}function us(l,f){var _=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 N=l.eventTimes;for(l=l.expirationTimes;0<_;){var G=31-wn(_),Z=1<<G;f[G]=0,N[G]=-1,l[G]=-1,_&=~Z}}function gu(l,f){var _=l.entangledLanes|=f;for(l=l.entanglements;_;){var N=31-wn(_),G=1<<N;G&f|l[N]&f&&(l[N]|=f),_&=~G}}var jn=0;function cs(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var Oo,dl,Nc,Tc,pl,Il=!1,ca=[],za=null,qa=null,Ua=null,Ln=new Map,cn=new Map,Co=[],Rc="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 Mc(l,f){switch(l){case"focusin":case"focusout":za=null;break;case"dragenter":case"dragleave":qa=null;break;case"mouseover":case"mouseout":Ua=null;break;case"pointerover":case"pointerout":Ln.delete(f.pointerId);break;case"gotpointercapture":case"lostpointercapture":cn.delete(f.pointerId)}}function uo(l,f,_,N,G,Z){return l===null||l.nativeEvent!==Z?(l={blockedOn:f,domEventName:_,eventSystemFlags:N,nativeEvent:Z,targetContainers:[G]},f!==null&&(f=ku(f),f!==null&&dl(f)),l):(l.eventSystemFlags|=N,f=l.targetContainers,G!==null&&f.indexOf(G)===-1&&f.push(G),l)}function Er(l,f,_,N,G){switch(f){case"focusin":return za=uo(za,l,f,_,N,G),!0;case"dragenter":return qa=uo(qa,l,f,_,N,G),!0;case"mouseover":return Ua=uo(Ua,l,f,_,N,G),!0;case"pointerover":var Z=G.pointerId;return Ln.set(Z,uo(Ln.get(Z)||null,l,f,_,N,G)),!0;case"gotpointercapture":return Z=G.pointerId,cn.set(Z,uo(cn.get(Z)||null,l,f,_,N,G)),!0}return!1}function mu(l){var f=Qs(l.target);if(f!==null){var _=ci(f);if(_!==null){if(f=_.tag,f===13){if(f=Aa(_),f!==null){l.blockedOn=f,pl(l.priority,function(){Nc(_)});return}}else if(f===3&&_.stateNode.current.memoizedState.isDehydrated){l.blockedOn=_.tag===3?_.stateNode.containerInfo:null;return}}}l.blockedOn=null}function vu(l){if(l.blockedOn!==null)return!1;for(var f=l.targetContainers;0<f.length;){var _=gl(l.domEventName,l.eventSystemFlags,f[0],l.nativeEvent);if(_===null){_=l.nativeEvent;var N=new _.constructor(_.type,_);Wt=N,_.target.dispatchEvent(N),Wt=null}else return f=ku(_),f!==null&&dl(f),l.blockedOn=_,!1;f.shift()}return!0}function Bs(l,f,_){vu(l)&&_.delete(f)}function Zu(){Il=!1,za!==null&&vu(za)&&(za=null),qa!==null&&vu(qa)&&(qa=null),Ua!==null&&vu(Ua)&&(Ua=null),Ln.forEach(Bs),cn.forEach(Bs)}function Ha(l,f){l.blockedOn===f&&(l.blockedOn=null,Il||(Il=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Zu)))}function fa(l){function f(G){return Ha(G,l)}if(0<ca.length){Ha(ca[0],l);for(var _=1;_<ca.length;_++){var N=ca[_];N.blockedOn===l&&(N.blockedOn=null)}}for(za!==null&&Ha(za,l),qa!==null&&Ha(qa,l),Ua!==null&&Ha(Ua,l),Ln.forEach(f),cn.forEach(f),_=0;_<Co.length;_++)N=Co[_],N.blockedOn===l&&(N.blockedOn=null);for(;0<Co.length&&(_=Co[0],_.blockedOn===null);)mu(_),_.blockedOn===null&&Co.shift()}var $a=E.ReactCurrentBatchConfig,yu=!0;function La(l,f,_,N){var G=jn,Z=$a.transition;$a.transition=null;try{jn=1,zs(l,f,_,N)}finally{jn=G,$a.transition=Z}}function co(l,f,_,N){var G=jn,Z=$a.transition;$a.transition=null;try{jn=4,zs(l,f,_,N)}finally{jn=G,$a.transition=Z}}function zs(l,f,_,N){if(yu){var G=gl(l,f,_,N);if(G===null)_u(l,f,N,Ga,_),Mc(l,N);else if(Er(G,l,f,_,N))N.stopPropagation();else if(Mc(l,N),f&4&&-1<Rc.indexOf(l)){for(;G!==null;){var Z=ku(G);if(Z!==null&&Oo(Z),Z=gl(l,f,_,N),Z===null&&_u(l,f,N,Ga,_),Z===G)break;G=Z}G!==null&&N.stopPropagation()}else _u(l,f,N,null,_)}}var Ga=null;function gl(l,f,_,N){if(Ga=null,l=Et(N),l=Qs(l),l!==null)if(f=ci(l),f===null)l=null;else if(_=f.tag,_===13){if(l=Aa(f),l!==null)return l;l=null}else if(_===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 jl(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(du()){case os:return 1;case Oa:return 4;case ss:case Lc:return 16;case hl:return 536870912;default:return 16}default:return 16}}var fi=null,Wa=null,fo=null;function ml(){if(fo)return fo;var l,f=Wa,_=f.length,N,G="value"in fi?fi.value:fi.textContent,Z=G.length;for(l=0;l<_&&f[l]===G[l];l++);var de=_-l;for(N=1;N<=de&&f[_-N]===G[Z-N];N++);return fo=G.slice(l,1<N?1-N: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 hi(){return!1}function ni(l){function f(_,N,G,Z,de){this._reactName=_,this._targetInst=G,this.type=N,this.nativeEvent=Z,this.target=de,this.currentTarget=null;for(var Ne in l)l.hasOwnProperty(Ne)&&(_=l[Ne],this[Ne]=_?_(Z):Z[Ne]);return this.isDefaultPrevented=(Z.defaultPrevented!=null?Z.defaultPrevented:Z.returnValue===!1)?$r:hi,this.isPropagationStopped=hi,this}return X(f.prototype,{preventDefault:function(){this.defaultPrevented=!0;var _=this.nativeEvent;_&&(_.preventDefault?_.preventDefault():typeof _.returnValue!="unknown"&&(_.returnValue=!1),this.isDefaultPrevented=$r)},stopPropagation:function(){var _=this.nativeEvent;_&&(_.stopPropagation?_.stopPropagation():typeof _.cancelBubble!="unknown"&&(_.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),H=X({},_i,{view:0,detail:0}),ce=ni(H),Oe,je,$e,ht=X({},H,{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!==$e&&($e&&l.type==="mousemove"?(Oe=l.screenX-$e.screenX,je=l.screenY-$e.screenY):je=Oe=0,$e=l),Oe)},movementY:function(l){return"movementY"in l?l.movementY:je}}),pt=ni(ht),Ft=X({},ht,{dataTransfer:0}),jt=ni(Ft),mn=X({},H,{relatedTarget:0}),xn=ni(mn),Dn=X({},_i,{animationName:0,elapsedTime:0,pseudoElement:0}),Lr=ni(Dn),di=X({},_i,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),sr=ni(di),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"},qs={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 Us(l){var f=this.nativeEvent;return f.getModifierState?f.getModifierState(l):(l=Ya[l])?!!f[l]:!1}function Vo(){return Us}var Hs=X({},H,{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"?qs[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}}),$s=ni(Hs),vl=X({},ht,{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({},H,{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),Dl=X({},ht,{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}),Fl=ni(Dl),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 Bl(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&&Bl(l,f)?(l=ml(),fo=Wa=fi=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 Qi(l){var f=l&&l.nodeName&&l.nodeName.toLowerCase();return f==="input"?!!da[l.type]:f==="textarea"}function To(l,f,_,N){hn(N),f=qc(f,"onChange"),0<f.length&&(_=new Va("onChange","change",null,_,N),l.push({event:_,listeners:f}))}var ds=null,go=null;function ri(l){wu(l,0)}function Yo(l){var f=ki(l);if(Ue(f))return l}function pi(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,Et(l)),Qt(ri,f)}}function gs(l,f,_){l==="focusin"?(Xo(),ds=f,go=_,ds.attachEvent("onpropertychange",ps)):l==="focusout"&&Xo()}function nr(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 _=Object.keys(l),N=Object.keys(f);if(_.length!==N.length)return!1;for(N=0;N<_.length;N++){var G=_[N];if(!u.call(f,G)||!Nr(l[G],f[G]))return!1}return!0}function Rn(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function fn(l,f){var _=Rn(l);l=0;for(var N;_;){if(_.nodeType===3){if(N=l+_.textContent.length,l<=f&&N>=f)return{node:_,offset:f-l};l=N}e:{for(;_;){if(_.nextSibling){_=_.nextSibling;break e}_=_.parentNode}_=void 0}_=Rn(_)}}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 _=typeof f.contentWindow.location.href=="string"}catch{_=!1}if(_)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(),_=l.focusedElem,N=l.selectionRange;if(f!==_&&_&&_.ownerDocument&&Pn(_.ownerDocument.documentElement,_)){if(N!==null&&Za(_)){if(f=N.start,l=N.end,l===void 0&&(l=f),"selectionStart"in _)_.selectionStart=f,_.selectionEnd=Math.min(l,_.value.length);else if(l=(f=_.ownerDocument||document)&&f.defaultView||window,l.getSelection){l=l.getSelection();var G=_.textContent.length,Z=Math.min(N.start,G);N=N.end===void 0?Z:Math.min(N.end,G),!l.extend&&Z>N&&(G=N,N=Z,Z=G),G=fn(_,Z);var de=fn(_,N);G&&de&&(l.rangeCount!==1||l.anchorNode!==G.node||l.anchorOffset!==G.offset||l.focusNode!==de.node||l.focusOffset!==de.offset)&&(f=f.createRange(),f.setStart(G.node,G.offset),l.removeAllRanges(),Z>N?(l.addRange(f),l.extend(de.node,de.offset)):(f.setEnd(de.node,de.offset),l.addRange(f)))}}for(f=[],l=_;l=l.parentNode;)l.nodeType===1&&f.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<f.length;_++)l=f[_],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,bu=!1;function Qu(l,f,_){var N=_.window===_?_.document:_.nodeType===9?_:_.ownerDocument;bu||Xs==null||Xs!==ze(N)||(N=Xs,"selectionStart"in N&&Za(N)?N={start:N.selectionStart,end:N.selectionEnd}:(N=(N.ownerDocument&&N.ownerDocument.defaultView||window).getSelection(),N={anchorNode:N.anchorNode,anchorOffset:N.anchorOffset,focusNode:N.focusNode,focusOffset:N.focusOffset}),wl&&ga(wl,N)||(wl=N,N=qc(Ti,"onSelect"),0<N.length&&(f=new Va("onSelect","select",null,f,_),l.push({event:f,listeners:N}),f.target=Xs)))}function Qa(l,f){var _={};return _[l.toLowerCase()]=f.toLowerCase(),_["Webkit"+l]="webkit"+f,_["Moz"+l]="moz"+f,_}var Gi={animationend:Qa("Animation","AnimationEnd"),animationiteration:Qa("Animation","AnimationIteration"),animationstart:Qa("Animation","AnimationStart"),transitionend:Qa("Transition","TransitionEnd")},Ko={},Ju={};s&&(Ju=document.createElement("div").style,"AnimationEvent"in window||(delete Gi.animationend.animation,delete Gi.animationiteration.animation,delete Gi.animationstart.animation),"TransitionEvent"in window||delete Gi.transitionend.transition);function zl(l){if(Ko[l])return Ko[l];if(!Gi[l])return l;var f=Gi[l],_;for(_ in f)if(f.hasOwnProperty(_)&&_ in Ju)return Ko[l]=f[_];return l}var Ic=zl("animationend"),jc=zl("animationiteration"),Dc=zl("animationstart"),Fc=zl("transitionend"),Bc=new Map,zc="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){Bc.set(l,f),a(f,[l])}for(var ql=0;ql<zc.length;ql++){var Ri=zc[ql],mo=Ri.toLowerCase(),Ul=Ri[0].toUpperCase()+Ri.slice(1);Zo(mo,"on"+Ul)}Zo(Ic,"onAnimationEnd"),Zo(jc,"onAnimationIteration"),Zo(Dc,"onAnimationStart"),Zo("dblclick","onDoubleClick"),Zo("focusin","onFocus"),Zo("focusout","onBlur"),Zo(Fc,"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 Hl(l,f,_){var N=l.type||"unknown-event";l.currentTarget=_,io(N,f,void 0,l),l.currentTarget=null}function wu(l,f){f=(f&4)!==0;for(var _=0;_<l.length;_++){var N=l[_],G=N.event;N=N.listeners;e:{var Z=void 0;if(f)for(var de=N.length-1;0<=de;de--){var Ne=N[de],Fe=Ne.instance,ot=Ne.currentTarget;if(Ne=Ne.listener,Fe!==Z&&G.isPropagationStopped())break e;Hl(G,Ne,ot),Z=Fe}else for(de=0;de<N.length;de++){if(Ne=N[de],Fe=Ne.instance,ot=Ne.currentTarget,Ne=Ne.listener,Fe!==Z&&G.isPropagationStopped())break e;Hl(G,Ne,ot),Z=Fe}}}if(Dr)throw l=Ea,Dr=!1,Ea=null,l}function gr(l,f){var _=f[Ra];_===void 0&&(_=f[Ra]=new Set);var N=l+"__bubble";_.has(N)||(xu(f,l,2,!1),_.add(N))}function ec(l,f,_){var N=0;f&&(N|=4),xu(_,l,N,f)}var $l="_reactListening"+Math.random().toString(36).slice(2);function Ks(l){if(!l[$l]){l[$l]=!0,r.forEach(function(_){_!=="selectionchange"&&(jf.has(_)||ec(_,!1,l),ec(_,!0,l))});var f=l.nodeType===9?l:l.ownerDocument;f===null||f[$l]||(f[$l]=!0,ec("selectionchange",!1,f))}}function xu(l,f,_,N){switch(jl(f)){case 1:var G=La;break;case 4:G=co;break;default:G=zs}_=G.bind(null,f,_,l),G=void 0,!Fa||f!=="touchstart"&&f!=="touchmove"&&f!=="wheel"||(G=!0),N?G!==void 0?l.addEventListener(f,_,{capture:!0,passive:G}):l.addEventListener(f,_,!0):G!==void 0?l.addEventListener(f,_,{passive:G}):l.addEventListener(f,_,!1)}function _u(l,f,_,N,G){var Z=N;if((f&1)===0&&(f&2)===0&&N!==null)e:for(;;){if(N===null)return;var de=N.tag;if(de===3||de===4){var Ne=N.stateNode.containerInfo;if(Ne===G||Ne.nodeType===8&&Ne.parentNode===G)break;if(de===4)for(de=N.return;de!==null;){var Fe=de.tag;if((Fe===3||Fe===4)&&(Fe=de.stateNode.containerInfo,Fe===G||Fe.nodeType===8&&Fe.parentNode===G))return;de=de.return}for(;Ne!==null;){if(de=Qs(Ne),de===null)return;if(Fe=de.tag,Fe===5||Fe===6){N=Z=de;continue e}Ne=Ne.parentNode}}N=N.return}Qt(function(){var ot=Z,bt=Et(_),xt=[];e:{var yt=Bc.get(l);if(yt!==void 0){var Ut=Va,Xt=l;switch(l){case"keypress":if(fs(_)===0)break e;case"keydown":case"keyup":Ut=$s;break;case"focusin":Xt="focus",Ut=xn;break;case"focusout":Xt="blur",Ut=xn;break;case"beforeblur":case"afterblur":Ut=xn;break;case"click":if(_.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ut=pt;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ut=jt;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ut=Ei;break;case Ic:case jc:case Dc:Ut=Lr;break;case Fc:Ut=Lo;break;case"scroll":Ut=ce;break;case"wheel":Ut=Fl;break;case"copy":case"cut":case"paste":Ut=sr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ut=ho}var Jt=(f&4)!==0,ia=!Jt&&l==="scroll",et=Jt?yt!==null?yt+"Capture":null:yt;Jt=[];for(var Ge=ot,rt;Ge!==null;){rt=Ge;var St=rt.stateNode;if(rt.tag===5&&St!==null&&(rt=St,et!==null&&(St=zi(Ge,et),St!=null&&Jt.push(Su(Ge,St,rt)))),ia)break;Ge=Ge.return}0<Jt.length&&(yt=new Ut(yt,Xt,null,_,bt),xt.push({event:yt,listeners:Jt}))}}if((f&7)===0){e:{if(yt=l==="mouseover"||l==="pointerover",Ut=l==="mouseout"||l==="pointerout",yt&&_!==Wt&&(Xt=_.relatedTarget||_.fromElement)&&(Qs(Xt)||Xt[ta]))break e;if((Ut||yt)&&(yt=bt.window===bt?bt:(yt=bt.ownerDocument)?yt.defaultView||yt.parentWindow:window,Ut?(Xt=_.relatedTarget||_.toElement,Ut=ot,Xt=Xt?Qs(Xt):null,Xt!==null&&(ia=ci(Xt),Xt!==ia||Xt.tag!==5&&Xt.tag!==6)&&(Xt=null)):(Ut=null,Xt=ot),Ut!==Xt)){if(Jt=pt,St="onMouseLeave",et="onMouseEnter",Ge="mouse",(l==="pointerout"||l==="pointerover")&&(Jt=ho,St="onPointerLeave",et="onPointerEnter",Ge="pointer"),ia=Ut==null?yt:ki(Ut),rt=Xt==null?yt:ki(Xt),yt=new Jt(St,Ge+"leave",Ut,_,bt),yt.target=ia,yt.relatedTarget=rt,St=null,Qs(bt)===ot&&(Jt=new Jt(et,Ge+"enter",Xt,_,bt),Jt.target=rt,Jt.relatedTarget=ia,St=Jt),ia=St,Ut&&Xt)t:{for(Jt=Ut,et=Xt,Ge=0,rt=Jt;rt;rt=xl(rt))Ge++;for(rt=0,St=et;St;St=xl(St))rt++;for(;0<Ge-rt;)Jt=xl(Jt),Ge--;for(;0<rt-Ge;)et=xl(et),rt--;for(;Ge--;){if(Jt===et||et!==null&&Jt===et.alternate)break t;Jt=xl(Jt),et=xl(et)}Jt=null}else Jt=null;Ut!==null&&Nh(xt,yt,Ut,Jt,!1),Xt!==null&&ia!==null&&Nh(xt,ia,Xt,Jt,!0)}}e:{if(yt=ot?ki(ot):window,Ut=yt.nodeName&&yt.nodeName.toLowerCase(),Ut==="select"||Ut==="input"&&yt.type==="file")var tn=pi;else if(Qi(yt))if(Ta)tn=vs;else{tn=nr;var pn=gs}else(Ut=yt.nodeName)&&Ut.toLowerCase()==="input"&&(yt.type==="checkbox"||yt.type==="radio")&&(tn=ms);if(tn&&(tn=tn(l,ot))){To(xt,tn,_,bt);break e}pn&&pn(l,yt,ot),l==="focusout"&&(pn=yt._wrapperState)&&pn.controlled&&yt.type==="number"&&be(yt,"number",yt.value)}switch(pn=ot?ki(ot):window,l){case"focusin":(Qi(pn)||pn.contentEditable==="true")&&(Xs=pn,Ti=ot,wl=null);break;case"focusout":wl=Ti=Xs=null;break;case"mousedown":bu=!0;break;case"contextmenu":case"mouseup":case"dragend":bu=!1,Qu(xt,_,bt);break;case"selectionchange":if(ys)break;case"keydown":case"keyup":Qu(xt,_,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?Bl(l,_)&&(Sn="onCompositionEnd"):l==="keydown"&&_.keyCode===229&&(Sn="onCompositionStart");Sn&&(Fr&&_.locale!=="ko"&&(Ni||Sn!=="onCompositionStart"?Sn==="onCompositionEnd"&&Ni&&(gn=ml()):(fi=bt,Wa="value"in fi?fi.value:fi.textContent,Ni=!0)),pn=qc(ot,Sn),0<pn.length&&(Sn=new kr(Sn,l,null,_,bt),xt.push({event:Sn,listeners:pn}),gn?Sn.data=gn:(gn=$i(_),gn!==null&&(Sn.data=gn)))),(gn=Ws?Na(l,_):Ka(l,_))&&(ot=qc(ot,"onBeforeInput"),0<ot.length&&(bt=new kr("onBeforeInput","beforeinput",null,_,bt),xt.push({event:bt,listeners:ot}),bt.data=gn))}wu(xt,f)})}function Su(l,f,_){return{instance:l,listener:f,currentTarget:_}}function qc(l,f){for(var _=f+"Capture",N=[];l!==null;){var G=l,Z=G.stateNode;G.tag===5&&Z!==null&&(G=Z,Z=zi(l,_),Z!=null&&N.unshift(Su(l,Z,G)),Z=zi(l,f),Z!=null&&N.push(Su(l,Z,G))),l=l.return}return N}function xl(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function Nh(l,f,_,N,G){for(var Z=f._reactName,de=[];_!==null&&_!==N;){var Ne=_,Fe=Ne.alternate,ot=Ne.stateNode;if(Fe!==null&&Fe===N)break;Ne.tag===5&&ot!==null&&(Ne=ot,G?(Fe=zi(_,Z),Fe!=null&&de.unshift(Su(_,Fe,Ne))):G||(Fe=zi(_,Z),Fe!=null&&de.push(Su(_,Fe,Ne)))),_=_.return}de.length!==0&&l.push({event:f,listeners:de})}var Nd=/\r\n?/g,Th=/\u0000|\uFFFD/g;function Df(l){return(typeof l=="string"?l:""+l).replace(Nd,`
6
- `).replace(Th,"")}function tc(l,f,_){if(f=Df(f),Df(l)!==f&&_)throw Error(n(425))}function Zs(){}var nc=null,Gl=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,rc=typeof Promise=="function"?Promise:void 0,Rh=typeof queueMicrotask=="function"?queueMicrotask:typeof rc<"u"?function(l){return rc.resolve(null).then(l).catch(Mh)}:vo;function Mh(l){setTimeout(function(){throw l})}function Hc(l,f){var _=f,N=0;do{var G=_.nextSibling;if(l.removeChild(_),G&&G.nodeType===8)if(_=G.data,_==="/$"){if(N===0){l.removeChild(G),fa(f);return}N--}else _!=="$"&&_!=="$?"&&_!=="$!"||N++;_=G}while(_);fa(f)}function Ji(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 ea(l){l=l.previousSibling;for(var f=0;l;){if(l.nodeType===8){var _=l.data;if(_==="$"||_==="$!"||_==="$?"){if(f===0)return l;f--}else _==="/$"&&f++}l=l.previousSibling}return null}var ma=Math.random().toString(36).slice(2),Mo="__reactFiber$"+ma,Eu="__reactProps$"+ma,ta="__reactContainer$"+ma,Ra="__reactEvents$"+ma,Ih="__reactListeners$"+ma,jh="__reactHandles$"+ma;function Qs(l){var f=l[Mo];if(f)return f;for(var _=l.parentNode;_;){if(f=_[ta]||_[Mo]){if(_=f.alternate,f.child!==null||_!==null&&_.child!==null)for(l=ea(l);l!==null;){if(_=l[Mo])return _;l=ea(l)}return f}l=_,_=l.parentNode}return null}function ku(l){return l=l[Mo]||l[ta],!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[Eu]||null}var $c=[],bs=-1;function Io(l){return{current:l}}function rr(l){0>bs||(l.current=$c[bs],$c[bs]=null,bs--)}function lr(l,f){bs++,$c[bs]=l.current,l.current=f}var ws={},Wi=Io(ws),va=Io(!1),_l=ws;function Wl(l,f){var _=l.type.contextTypes;if(!_)return ws;var N=l.stateNode;if(N&&N.__reactInternalMemoizedUnmaskedChildContext===f)return N.__reactInternalMemoizedMaskedChildContext;var G={},Z;for(Z in _)G[Z]=f[Z];return N&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=f,l.__reactInternalMemoizedMaskedChildContext=G),G}function ya(l){return l=l.childContextTypes,l!=null}function Au(){rr(va),rr(Wi)}function Bf(l,f,_){if(Wi.current!==ws)throw Error(n(168));lr(Wi,f),lr(va,_)}function ic(l,f,_){var N=l.stateNode;if(f=f.childContextTypes,typeof N.getChildContext!="function")return _;N=N.getChildContext();for(var G in N)if(!(G in f))throw Error(n(108,ie(l)||"Unknown",G));return X({},_,N)}function xs(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||ws,_l=Wi.current,lr(Wi,l),lr(va,va.current),!0}function Dh(l,f,_){var N=l.stateNode;if(!N)throw Error(n(169));_?(l=ic(l,f,_l),N.__reactInternalMemoizedMergedChildContext=l,rr(va),rr(Wi),lr(Wi,l)):rr(va),lr(va,_)}var _s=null,Vl=!1,P=!1;function I(l){_s===null?_s=[l]:_s.push(l)}function V(l){Vl=!0,I(l)}function ne(){if(!P&&_s!==null){P=!0;var l=0,f=jn;try{var _=_s;for(jn=1;l<_.length;l++){var N=_[l];do N=N(!0);while(N!==null)}_s=null,Vl=!1}catch(G){throw _s!==null&&(_s=_s.slice(l+1)),Fs(os,ne),G}finally{jn=f,P=!1}}return null}var le=[],pe=0,me=null,_e=0,Se=[],Pe=0,De=null,Qe=1,Ae="";function He(l,f){le[pe++]=_e,le[pe++]=me,me=l,_e=f}function Ze(l,f,_){Se[Pe++]=Qe,Se[Pe++]=Ae,Se[Pe++]=De,De=l;var N=Qe;l=Ae;var G=32-wn(N)-1;N&=~(1<<G),_+=1;var Z=32-wn(f)+G;if(30<Z){var de=G-G%5;Z=(N&(1<<de)-1).toString(32),N>>=de,G-=de,Qe=1<<32-wn(f)+G|_<<G|N,Ae=Z+l}else Qe=1<<Z|_<<G|N,Ae=l}function dt(l){l.return!==null&&(He(l,1),Ze(l,1,0))}function Ye(l){for(;l===me;)me=le[--pe],le[pe]=null,_e=le[--pe],le[pe]=null;for(;l===De;)De=Se[--Pe],Se[Pe]=null,Ae=Se[--Pe],Se[Pe]=null,Qe=Se[--Pe],Se[Pe]=null}var ft=null,qe=null,mt=!1,vt=null;function Yt(l,f){var _=Al(5,null,null,0);_.elementType="DELETED",_.stateNode=f,_.return=l,f=l.deletions,f===null?(l.deletions=[_],l.flags|=16):f.push(_)}function zt(l,f){switch(l.tag){case 5:var _=l.type;return f=f.nodeType!==1||_.toLowerCase()!==f.nodeName.toLowerCase()?null:f,f!==null?(l.stateNode=f,ft=l,qe=Ji(f.firstChild),!0):!1;case 6:return f=l.pendingProps===""||f.nodeType!==3?null:f,f!==null?(l.stateNode=f,ft=l,qe=null,!0):!1;case 13:return f=f.nodeType!==8?null:f,f!==null?(_=De!==null?{id:Qe,overflow:Ae}:null,l.memoizedState={dehydrated:f,treeContext:_,retryLane:1073741824},_=Al(18,null,null,0),_.stateNode=f,_.return=l,l.child=_,ft=l,qe=null,!0):!1;default:return!1}}function vn(l){return(l.mode&1)!==0&&(l.flags&128)===0}function qt(l){if(mt){var f=qe;if(f){var _=f;if(!zt(l,f)){if(vn(l))throw Error(n(418));f=Ji(_.nextSibling);var N=ft;f&&zt(l,f)?Yt(N,_):(l.flags=l.flags&-4097|2,mt=!1,ft=l)}}else{if(vn(l))throw Error(n(418));l.flags=l.flags&-4097|2,mt=!1,ft=l}}}function Nn(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;ft=l}function Gr(l){if(l!==ft)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=qe)){if(vn(l))throw _n(),Error(n(418));for(;f;)Yt(l,f),f=Ji(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 _=l.data;if(_==="/$"){if(f===0){qe=Ji(l.nextSibling);break e}f--}else _!=="$"&&_!=="$!"&&_!=="$?"||f++}l=l.nextSibling}qe=null}}else qe=ft?Ji(l.stateNode.nextSibling):null;return!0}function _n(){for(var l=qe;l;)l=Ji(l.nextSibling)}function Bt(){qe=ft=null,mt=!1}function kt(l){vt===null?vt=[l]:vt.push(l)}var Wr=E.ReactCurrentBatchConfig;function $t(l,f,_){if(l=_.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(_._owner){if(_=_._owner,_){if(_.tag!==1)throw Error(n(309));var N=_.stateNode}if(!N)throw Error(n(147,l));var G=N,Z=""+l;return f!==null&&f.ref!==null&&typeof f.ref=="function"&&f.ref._stringRef===Z?f.ref:(f=function(de){var Ne=G.refs;de===null?delete Ne[Z]:Ne[Z]=de},f._stringRef=Z,f)}if(typeof l!="string")throw Error(n(284));if(!_._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 rt=et.deletions;rt===null?(et.deletions=[Ge],et.flags|=16):rt.push(Ge)}}function _(et,Ge){if(!l)return null;for(;Ge!==null;)f(et,Ge),Ge=Ge.sibling;return null}function N(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 G(et,Ge){return et=af(et,Ge),et.index=0,et.sibling=null,et}function Z(et,Ge,rt){return et.index=rt,l?(rt=et.alternate,rt!==null?(rt=rt.index,rt<Ge?(et.flags|=2,Ge):rt):(et.flags|=2,Ge)):(et.flags|=1048576,Ge)}function de(et){return l&&et.alternate===null&&(et.flags|=2),et}function Ne(et,Ge,rt,St){return Ge===null||Ge.tag!==6?(Ge=Lg(rt,et.mode,St),Ge.return=et,Ge):(Ge=G(Ge,rt),Ge.return=et,Ge)}function Fe(et,Ge,rt,St){var tn=rt.type;return tn===O?bt(et,Ge,rt.props.children,St,rt.key):Ge!==null&&(Ge.elementType===tn||typeof tn=="object"&&tn!==null&&tn.$$typeof===se&&Fn(tn)===Ge.type)?(St=G(Ge,rt.props),St.ref=$t(et,Ge,rt),St.return=et,St):(St=d1(rt.type,rt.key,rt.props,null,et.mode,St),St.ref=$t(et,Ge,rt),St.return=et,St)}function ot(et,Ge,rt,St){return Ge===null||Ge.tag!==4||Ge.stateNode.containerInfo!==rt.containerInfo||Ge.stateNode.implementation!==rt.implementation?(Ge=Ng(rt,et.mode,St),Ge.return=et,Ge):(Ge=G(Ge,rt.children||[]),Ge.return=et,Ge)}function bt(et,Ge,rt,St,tn){return Ge===null||Ge.tag!==7?(Ge=Wf(rt,et.mode,St,tn),Ge.return=et,Ge):(Ge=G(Ge,rt),Ge.return=et,Ge)}function xt(et,Ge,rt){if(typeof Ge=="string"&&Ge!==""||typeof Ge=="number")return Ge=Lg(""+Ge,et.mode,rt),Ge.return=et,Ge;if(typeof Ge=="object"&&Ge!==null){switch(Ge.$$typeof){case A:return rt=d1(Ge.type,Ge.key,Ge.props,null,et.mode,rt),rt.ref=$t(et,null,Ge),rt.return=et,rt;case M:return Ge=Ng(Ge,et.mode,rt),Ge.return=et,Ge;case se:var St=Ge._init;return xt(et,St(Ge._payload),rt)}if(Le(Ge)||re(Ge))return Ge=Wf(Ge,et.mode,rt,null),Ge.return=et,Ge;yn(et,Ge)}return null}function yt(et,Ge,rt,St){var tn=Ge!==null?Ge.key:null;if(typeof rt=="string"&&rt!==""||typeof rt=="number")return tn!==null?null:Ne(et,Ge,""+rt,St);if(typeof rt=="object"&&rt!==null){switch(rt.$$typeof){case A:return rt.key===tn?Fe(et,Ge,rt,St):null;case M:return rt.key===tn?ot(et,Ge,rt,St):null;case se:return tn=rt._init,yt(et,Ge,tn(rt._payload),St)}if(Le(rt)||re(rt))return tn!==null?null:bt(et,Ge,rt,St,null);yn(et,rt)}return null}function Ut(et,Ge,rt,St,tn){if(typeof St=="string"&&St!==""||typeof St=="number")return et=et.get(rt)||null,Ne(Ge,et,""+St,tn);if(typeof St=="object"&&St!==null){switch(St.$$typeof){case A:return et=et.get(St.key===null?rt:St.key)||null,Fe(Ge,et,St,tn);case M:return et=et.get(St.key===null?rt:St.key)||null,ot(Ge,et,St,tn);case se:var pn=St._init;return Ut(et,Ge,rt,pn(St._payload),tn)}if(Le(St)||re(St))return et=et.get(rt)||null,bt(Ge,et,St,tn,null);yn(Ge,St)}return null}function Xt(et,Ge,rt,St){for(var tn=null,pn=null,gn=Ge,Sn=Ge=0,no=null;gn!==null&&Sn<rt.length;Sn++){gn.index>Sn?(no=gn,gn=null):no=gn.sibling;var yr=yt(et,gn,rt[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?tn=yr:pn.sibling=yr,pn=yr,gn=no}if(Sn===rt.length)return _(et,gn),mt&&He(et,Sn),tn;if(gn===null){for(;Sn<rt.length;Sn++)gn=xt(et,rt[Sn],St),gn!==null&&(Ge=Z(gn,Ge,Sn),pn===null?tn=gn:pn.sibling=gn,pn=gn);return mt&&He(et,Sn),tn}for(gn=N(et,gn);Sn<rt.length;Sn++)no=Ut(gn,et,Sn,rt[Sn],St),no!==null&&(l&&no.alternate!==null&&gn.delete(no.key===null?Sn:no.key),Ge=Z(no,Ge,Sn),pn===null?tn=no:pn.sibling=no,pn=no);return l&&gn.forEach(function(of){return f(et,of)}),mt&&He(et,Sn),tn}function Jt(et,Ge,rt,St){var tn=re(rt);if(typeof tn!="function")throw Error(n(150));if(rt=tn.call(rt),rt==null)throw Error(n(151));for(var pn=tn=null,gn=Ge,Sn=Ge=0,no=null,yr=rt.next();gn!==null&&!yr.done;Sn++,yr=rt.next()){gn.index>Sn?(no=gn,gn=null):no=gn.sibling;var of=yt(et,gn,yr.value,St);if(of===null){gn===null&&(gn=no);break}l&&gn&&of.alternate===null&&f(et,gn),Ge=Z(of,Ge,Sn),pn===null?tn=of:pn.sibling=of,pn=of,gn=no}if(yr.done)return _(et,gn),mt&&He(et,Sn),tn;if(gn===null){for(;!yr.done;Sn++,yr=rt.next())yr=xt(et,yr.value,St),yr!==null&&(Ge=Z(yr,Ge,Sn),pn===null?tn=yr:pn.sibling=yr,pn=yr);return mt&&He(et,Sn),tn}for(gn=N(et,gn);!yr.done;Sn++,yr=rt.next())yr=Ut(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?tn=yr:pn.sibling=yr,pn=yr);return l&&gn.forEach(function(X_){return f(et,X_)}),mt&&He(et,Sn),tn}function ia(et,Ge,rt,St){if(typeof rt=="object"&&rt!==null&&rt.type===O&&rt.key===null&&(rt=rt.props.children),typeof rt=="object"&&rt!==null){switch(rt.$$typeof){case A:e:{for(var tn=rt.key,pn=Ge;pn!==null;){if(pn.key===tn){if(tn=rt.type,tn===O){if(pn.tag===7){_(et,pn.sibling),Ge=G(pn,rt.props.children),Ge.return=et,et=Ge;break e}}else if(pn.elementType===tn||typeof tn=="object"&&tn!==null&&tn.$$typeof===se&&Fn(tn)===pn.type){_(et,pn.sibling),Ge=G(pn,rt.props),Ge.ref=$t(et,pn,rt),Ge.return=et,et=Ge;break e}_(et,pn);break}else f(et,pn);pn=pn.sibling}rt.type===O?(Ge=Wf(rt.props.children,et.mode,St,rt.key),Ge.return=et,et=Ge):(St=d1(rt.type,rt.key,rt.props,null,et.mode,St),St.ref=$t(et,Ge,rt),St.return=et,et=St)}return de(et);case M:e:{for(pn=rt.key;Ge!==null;){if(Ge.key===pn)if(Ge.tag===4&&Ge.stateNode.containerInfo===rt.containerInfo&&Ge.stateNode.implementation===rt.implementation){_(et,Ge.sibling),Ge=G(Ge,rt.children||[]),Ge.return=et,et=Ge;break e}else{_(et,Ge);break}else f(et,Ge);Ge=Ge.sibling}Ge=Ng(rt,et.mode,St),Ge.return=et,et=Ge}return de(et);case se:return pn=rt._init,ia(et,Ge,pn(rt._payload),St)}if(Le(rt))return Xt(et,Ge,rt,St);if(re(rt))return Jt(et,Ge,rt,St);yn(et,rt)}return typeof rt=="string"&&rt!==""||typeof rt=="number"?(rt=""+rt,Ge!==null&&Ge.tag===6?(_(et,Ge.sibling),Ge=G(Ge,rt),Ge.return=et,et=Ge):(_(et,Ge),Ge=Lg(rt,et.mode,St),Ge.return=et,et=Ge),de(et)):_(et,Ge)}return ia}var gi=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;rr(Pi),l._currentValue=f}function Xn(l,f,_){for(;l!==null;){var N=l.alternate;if((l.childLanes&f)!==f?(l.childLanes|=f,N!==null&&(N.childLanes|=f)):N!==null&&(N.childLanes&f)!==f&&(N.childLanes|=f),l===_)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 ir=null;function Ii(l){ir===null?ir=[l]:ir.push(l)}function Jn(l,f,_,N){var G=f.interleaved;return G===null?(_.next=_,Ii(f)):(_.next=G.next,G.next=_),f.interleaved=_,er(l,N)}function er(l,f){l.lanes|=f;var _=l.alternate;for(_!==null&&(_.lanes|=f),_=l,l=l.return;l!==null;)l.childLanes|=f,_=l.alternate,_!==null&&(_.childLanes|=f),_=l,l=l.return;return _.tag===3?_.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 Vr(l,f,_){var N=l.updateQueue;if(N===null)return null;if(N=N.shared,(cr&2)!==0){var G=N.pending;return G===null?f.next=f:(f.next=G.next,G.next=f),N.pending=f,er(l,_)}return G=N.interleaved,G===null?(f.next=f,Ii(N)):(f.next=G.next,G.next=f),N.interleaved=f,er(l,_)}function wa(l,f,_){if(f=f.updateQueue,f!==null&&(f=f.shared,(_&4194240)!==0)){var N=f.lanes;N&=l.pendingLanes,_|=N,f.lanes=_,gu(l,_)}}function ar(l,f){var _=l.updateQueue,N=l.alternate;if(N!==null&&(N=N.updateQueue,_===N)){var G=null,Z=null;if(_=_.firstBaseUpdate,_!==null){do{var de={eventTime:_.eventTime,lane:_.lane,tag:_.tag,payload:_.payload,callback:_.callback,next:null};Z===null?G=Z=de:Z=Z.next=de,_=_.next}while(_!==null);Z===null?G=Z=f:Z=Z.next=f}else G=Z=f;_={baseState:N.baseState,firstBaseUpdate:G,lastBaseUpdate:Z,shared:N.shared,effects:N.effects},l.updateQueue=_;return}l=_.lastBaseUpdate,l===null?_.firstBaseUpdate=f:l.next=f,_.lastBaseUpdate=f}function Vi(l,f,_,N){var G=l.updateQueue;ii=!1;var Z=G.firstBaseUpdate,de=G.lastBaseUpdate,Ne=G.shared.pending;if(Ne!==null){G.shared.pending=null;var Fe=Ne,ot=Fe.next;Fe.next=null,de===null?Z=ot:de.next=ot,de=Fe;var bt=l.alternate;bt!==null&&(bt=bt.updateQueue,Ne=bt.lastBaseUpdate,Ne!==de&&(Ne===null?bt.firstBaseUpdate=ot:Ne.next=ot,bt.lastBaseUpdate=Fe))}if(Z!==null){var xt=G.baseState;de=0,bt=ot=Fe=null,Ne=Z;do{var yt=Ne.lane,Ut=Ne.eventTime;if((N&yt)===yt){bt!==null&&(bt=bt.next={eventTime:Ut,lane:0,tag:Ne.tag,payload:Ne.payload,callback:Ne.callback,next:null});e:{var Xt=l,Jt=Ne;switch(yt=f,Ut=_,Jt.tag){case 1:if(Xt=Jt.payload,typeof Xt=="function"){xt=Xt.call(Ut,xt,yt);break e}xt=Xt;break e;case 3:Xt.flags=Xt.flags&-65537|128;case 0:if(Xt=Jt.payload,yt=typeof Xt=="function"?Xt.call(Ut,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=G.effects,yt===null?G.effects=[Ne]:yt.push(Ne))}else Ut={eventTime:Ut,lane:yt,tag:Ne.tag,payload:Ne.payload,callback:Ne.callback,next:null},bt===null?(ot=bt=Ut,Fe=xt):bt=bt.next=Ut,de|=yt;if(Ne=Ne.next,Ne===null){if(Ne=G.shared.pending,Ne===null)break;yt=Ne,Ne=yt.next,yt.next=null,G.lastBaseUpdate=yt,G.shared.pending=null}}while(!0);if(bt===null&&(Fe=xt),G.baseState=Fe,G.firstBaseUpdate=ot,G.lastBaseUpdate=bt,f=G.shared.interleaved,f!==null){G=f;do de|=G.lane,G=G.next;while(G!==f)}else Z===null&&(G.shared.lanes=0);Uf|=de,l.lanes=de,l.memoizedState=xt}}function Kn(l,f,_){if(l=f.effects,f.effects=null,l!==null)for(f=0;f<l.length;f++){var N=l[f],G=N.callback;if(G!==null){if(N.callback=null,N=_,typeof G!="function")throw Error(n(191,G));G.call(N)}}}var dn={},Bn=Io(dn),On=Io(dn),zr=Io(dn);function mi(l){if(l===dn)throw Error(n(174));return l}function Jo(l,f){switch(lr(zr,f),lr(On,l),lr(Bn,dn),l=f.nodeType,l){case 9:case 11:f=(f=f.documentElement)?f.namespaceURI:Je(null,"");break;default:l=l===8?f.parentNode:f,f=l.namespaceURI||null,l=l.tagName,f=Je(f,l)}rr(Bn),lr(Bn,f)}function mr(){rr(Bn),rr(On),rr(zr)}function Pu(l){mi(zr.current);var f=mi(Bn.current),_=Je(f,l.type);f!==_&&(lr(On,l),lr(Bn,_))}function Js(l){On.current===l&&(rr(Bn),rr(On))}var vr=Io(0);function yo(l){for(var f=l;f!==null;){if(f.tag===13){var _=f.memoizedState;if(_!==null&&(_=_.dehydrated,_===null||_.data==="$?"||_.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 Yl=[];function xa(){for(var l=0;l<Yl.length;l++)Yl[l]._workInProgressVersionPrimary=null;Yl.length=0}var Ou=E.ReactCurrentDispatcher,Cu=E.ReactCurrentBatchConfig,Yi=0,ur=null,Yr=null,Xr=null,bo=!1,jo=!1,wo=0,Gc=0;function Kr(){throw Error(n(321))}function Lu(l,f){if(f===null)return!1;for(var _=0;_<f.length&&_<l.length;_++)if(!Nr(l[_],f[_]))return!1;return!0}function Sl(l,f,_,N,G,Z){if(Yi=Z,ur=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,Ou.current=l===null||l.memoizedState===null?fg:Tu,l=_(N,G),jo){Z=0;do{if(jo=!1,wo=0,25<=Z)throw Error(n(301));Z+=1,Xr=Yr=null,f.updateQueue=null,Ou.current=Bh,l=_(N,G)}while(jo)}if(Ou.current=Xc,f=Yr!==null&&Yr.next!==null,Yi=0,Xr=Yr=ur=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 Xr===null?ur.memoizedState=Xr=l:Xr=Xr.next=l,Xr}function Oi(){if(Yr===null){var l=ur.alternate;l=l!==null?l.memoizedState:null}else l=Yr.next;var f=Xr===null?ur.memoizedState:Xr.next;if(f!==null)Xr=f,Yr=l;else{if(l===null)throw Error(n(310));Yr=l,l={memoizedState:Yr.memoizedState,baseState:Yr.baseState,baseQueue:Yr.baseQueue,queue:Yr.queue,next:null},Xr===null?ur.memoizedState=Xr=l:Xr=Xr.next=l}return Xr}function _a(l,f){return typeof f=="function"?f(l):f}function na(l){var f=Oi(),_=f.queue;if(_===null)throw Error(n(311));_.lastRenderedReducer=l;var N=Yr,G=N.baseQueue,Z=_.pending;if(Z!==null){if(G!==null){var de=G.next;G.next=Z.next,Z.next=de}N.baseQueue=G=Z,_.pending=null}if(G!==null){Z=G.next,N=N.baseState;var Ne=de=null,Fe=null,ot=Z;do{var bt=ot.lane;if((Yi&bt)===bt)Fe!==null&&(Fe=Fe.next={lane:0,action:ot.action,hasEagerState:ot.hasEagerState,eagerState:ot.eagerState,next:null}),N=ot.hasEagerState?ot.eagerState:l(N,ot.action);else{var xt={lane:bt,action:ot.action,hasEagerState:ot.hasEagerState,eagerState:ot.eagerState,next:null};Fe===null?(Ne=Fe=xt,de=N):Fe=Fe.next=xt,ur.lanes|=bt,Uf|=bt}ot=ot.next}while(ot!==null&&ot!==Z);Fe===null?de=N:Fe.next=Ne,Nr(N,f.memoizedState)||(ae=!0),f.memoizedState=N,f.baseState=de,f.baseQueue=Fe,_.lastRenderedState=N}if(l=_.interleaved,l!==null){G=l;do Z=G.lane,ur.lanes|=Z,Uf|=Z,G=G.next;while(G!==l)}else G===null&&(_.lanes=0);return[f.memoizedState,_.dispatch]}function el(l){var f=Oi(),_=f.queue;if(_===null)throw Error(n(311));_.lastRenderedReducer=l;var N=_.dispatch,G=_.pending,Z=f.memoizedState;if(G!==null){_.pending=null;var de=G=G.next;do Z=l(Z,de.action),de=de.next;while(de!==G);Nr(Z,f.memoizedState)||(ae=!0),f.memoizedState=Z,f.baseQueue===null&&(f.baseState=Z),_.lastRenderedState=Z}return[Z,N]}function Wc(){}function ac(l,f){var _=ur,N=Oi(),G=f(),Z=!Nr(N.memoizedState,G);if(Z&&(N.memoizedState=G,ae=!0),N=N.queue,Yc(zf.bind(null,_,N,l),[l]),N.getSnapshot!==f||Z||Xr!==null&&Xr.memoizedState.tag&1){if(_.flags|=2048,Ja(9,Ss.bind(null,_,N,G,f),void 0,null),to===null)throw Error(n(349));(Yi&30)!==0||Fh(_,f,G)}return G}function Fh(l,f,_){l.flags|=16384,l={getSnapshot:f,value:_},f=ur.updateQueue,f===null?(f={lastEffect:null,stores:null},ur.updateQueue=f,f.stores=[l]):(_=f.stores,_===null?f.stores=[l]:_.push(l))}function Ss(l,f,_,N){f.value=_,f.getSnapshot=N,Xl(f)&&Nu(l)}function zf(l,f,_){return _(function(){Xl(f)&&Nu(l)})}function Xl(l){var f=l.getSnapshot;l=l.value;try{var _=f();return!Nr(l,_)}catch{return!0}}function Nu(l){var f=er(l,1);f!==null&&Jl(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,ur,l),[f.memoizedState,l]}function Ja(l,f,_,N){return l={tag:l,create:f,destroy:_,deps:N,next:null},f=ur.updateQueue,f===null?(f={lastEffect:null,stores:null},ur.updateQueue=f,f.lastEffect=l.next=l):(_=f.lastEffect,_===null?f.lastEffect=l.next=l:(N=_.next,_.next=l,l.next=N,f.lastEffect=l)),l}function Es(){return Oi().memoizedState}function _o(l,f,_,N){var G=Ar();ur.flags|=l,G.memoizedState=Ja(1|f,_,void 0,N===void 0?null:N)}function ks(l,f,_,N){var G=Oi();N=N===void 0?null:N;var Z=void 0;if(Yr!==null){var de=Yr.memoizedState;if(Z=de.destroy,N!==null&&Lu(N,de.deps)){G.memoizedState=Ja(f,_,Z,N);return}}ur.flags|=l,G.memoizedState=Ja(1|f,_,Z,N)}function Vc(l,f){return _o(8390656,8,l,f)}function Yc(l,f){return ks(2048,8,l,f)}function qf(l,f){return ks(4,2,l,f)}function oc(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,_){return _=_!=null?_.concat([l]):null,ks(4,4,As.bind(null,f,l),_)}function Kl(){}function Td(l,f){var _=Oi();f=f===void 0?null:f;var N=_.memoizedState;return N!==null&&f!==null&&Lu(f,N[1])?N[0]:(_.memoizedState=[l,f],l)}function Zr(l,f){var _=Oi();f=f===void 0?null:f;var N=_.memoizedState;return N!==null&&f!==null&&Lu(f,N[1])?N[0]:(l=l(),_.memoizedState=[l,f],l)}function Kp(l,f,_){return(Yi&21)===0?(l.baseState&&(l.baseState=!1,ae=!0),l.memoizedState=_):(Nr(_,f)||(_=pu(),ur.lanes|=_,Uf|=_,l.baseState=!0),f)}function Zp(l,f){var _=jn;jn=_!==0&&4>_?_:4,l(!0);var N=Cu.transition;Cu.transition={};try{l(!1),f()}finally{jn=_,Cu.transition=N}}function Qp(){return Oi().memoizedState}function cg(l,f,_){var N=nf(l);if(_={lane:N,action:_,hasEagerState:!1,eagerState:null,next:null},Rd(l))e1(f,_);else if(_=Jn(l,f,_,N),_!==null){var G=ns();Jl(_,l,N,G),ts(_,f,N)}}function Jp(l,f,_){var N=nf(l),G={lane:N,action:_,hasEagerState:!1,eagerState:null,next:null};if(Rd(l))e1(f,G);else{var Z=l.alternate;if(l.lanes===0&&(Z===null||Z.lanes===0)&&(Z=f.lastRenderedReducer,Z!==null))try{var de=f.lastRenderedState,Ne=Z(de,_);if(G.hasEagerState=!0,G.eagerState=Ne,Nr(Ne,de)){var Fe=f.interleaved;Fe===null?(G.next=G,Ii(f)):(G.next=Fe.next,Fe.next=G),f.interleaved=G;return}}catch{}_=Jn(l,f,G,N),_!==null&&(G=ns(),Jl(_,l,N,G),ts(_,f,N))}}function Rd(l){var f=l.alternate;return l===ur||f!==null&&f===ur}function e1(l,f){jo=bo=!0;var _=l.pending;_===null?f.next=f:(f.next=_.next,_.next=f),l.pending=f}function ts(l,f,_){if((_&4194240)!==0){var N=f.lanes;N&=l.pendingLanes,_|=N,f.lanes=_,gu(l,_)}}var Xc={readContext:Mr,useCallback:Kr,useContext:Kr,useEffect:Kr,useImperativeHandle:Kr,useInsertionEffect:Kr,useLayoutEffect:Kr,useMemo:Kr,useReducer:Kr,useRef:Kr,useState:Kr,useDebugValue:Kr,useDeferredValue:Kr,useTransition:Kr,useMutableSource:Kr,useSyncExternalStore:Kr,useId:Kr,unstable_isNewReconciler:!1},fg={readContext:Mr,useCallback:function(l,f){return Ar().memoizedState=[l,f===void 0?null:f],l},useContext:Mr,useEffect:Vc,useImperativeHandle:function(l,f,_){return _=_!=null?_.concat([l]):null,_o(4194308,4,As.bind(null,f,l),_)},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 _=Ar();return f=f===void 0?null:f,l=l(),_.memoizedState=[l,f],l},useReducer:function(l,f,_){var N=Ar();return f=_!==void 0?_(f):f,N.memoizedState=N.baseState=f,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:f},N.queue=l,l=l.dispatch=cg.bind(null,ur,l),[N.memoizedState,l]},useRef:function(l){var f=Ar();return l={current:l},f.memoizedState=l},useState:es,useDebugValue:Kl,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,_){var N=ur,G=Ar();if(mt){if(_===void 0)throw Error(n(407));_=_()}else{if(_=f(),to===null)throw Error(n(349));(Yi&30)!==0||Fh(N,f,_)}G.memoizedState=_;var Z={value:_,getSnapshot:f};return G.queue=Z,Vc(zf.bind(null,N,Z,l),[l]),N.flags|=2048,Ja(9,Ss.bind(null,N,Z,_,f),void 0,null),_},useId:function(){var l=Ar(),f=to.identifierPrefix;if(mt){var _=Ae,N=Qe;_=(N&~(1<<32-wn(N)-1)).toString(32)+_,f=":"+f+"R"+_,_=wo++,0<_&&(f+="H"+_.toString(32)),f+=":"}else _=Gc++,f=":"+f+"r"+_.toString(32)+":";return l.memoizedState=f},unstable_isNewReconciler:!1},Tu={readContext:Mr,useCallback:Td,useContext:Mr,useEffect:Yc,useImperativeHandle:Xp,useInsertionEffect:qf,useLayoutEffect:oc,useMemo:Zr,useReducer:na,useRef:Es,useState:function(){return na(_a)},useDebugValue:Kl,useDeferredValue:function(l){var f=Oi();return Kp(f,Yr.memoizedState,l)},useTransition:function(){var l=na(_a)[0],f=Oi().memoizedState;return[l,f]},useMutableSource:Wc,useSyncExternalStore:ac,useId:Qp,unstable_isNewReconciler:!1},Bh={readContext:Mr,useCallback:Td,useContext:Mr,useEffect:Yc,useImperativeHandle:Xp,useInsertionEffect:qf,useLayoutEffect:oc,useMemo:Zr,useReducer:el,useRef:Es,useState:function(){return el(_a)},useDebugValue:Kl,useDeferredValue:function(l){var f=Oi();return Yr===null?f.memoizedState=l:Kp(f,Yr.memoizedState,l)},useTransition:function(){var l=el(_a)[0],f=Oi().memoizedState;return[l,f]},useMutableSource:Wc,useSyncExternalStore:ac,useId:Qp,unstable_isNewReconciler:!1};function Ma(l,f){if(l&&l.defaultProps){f=X({},f),l=l.defaultProps;for(var _ in l)f[_]===void 0&&(f[_]=l[_]);return f}return f}function Kc(l,f,_,N){f=l.memoizedState,_=_(N,f),_=_==null?f:X({},f,_),l.memoizedState=_,l.lanes===0&&(l.updateQueue.baseState=_)}var Zc={isMounted:function(l){return(l=l._reactInternals)?ci(l)===l:!1},enqueueSetState:function(l,f,_){l=l._reactInternals;var N=ns(),G=nf(l),Z=ai(N,G);Z.payload=f,_!=null&&(Z.callback=_),f=Vr(l,Z,G),f!==null&&(Jl(f,l,G,N),wa(f,l,G))},enqueueReplaceState:function(l,f,_){l=l._reactInternals;var N=ns(),G=nf(l),Z=ai(N,G);Z.tag=1,Z.payload=f,_!=null&&(Z.callback=_),f=Vr(l,Z,G),f!==null&&(Jl(f,l,G,N),wa(f,l,G))},enqueueForceUpdate:function(l,f){l=l._reactInternals;var _=ns(),N=nf(l),G=ai(_,N);G.tag=2,f!=null&&(G.callback=f),f=Vr(l,G,N),f!==null&&(Jl(f,l,N,_),wa(f,l,N))}};function zh(l,f,_,N,G,Z,de){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(N,Z,de):f.prototype&&f.prototype.isPureReactComponent?!ga(_,N)||!ga(G,Z):!0}function t1(l,f,_){var N=!1,G=ws,Z=f.contextType;return typeof Z=="object"&&Z!==null?Z=Mr(Z):(G=ya(f)?_l:Wi.current,N=f.contextTypes,Z=(N=N!=null)?Wl(l,G):ws),f=new f(_,Z),l.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Zc,l.stateNode=f,f._reactInternals=l,N&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=G,l.__reactInternalMemoizedMaskedChildContext=Z),f}function Md(l,f,_,N){l=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(_,N),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(_,N),f.state!==l&&Zc.enqueueReplaceState(f,f.state,null)}function qh(l,f,_,N){var G=l.stateNode;G.props=_,G.state=l.memoizedState,G.refs={},ji(l);var Z=f.contextType;typeof Z=="object"&&Z!==null?G.context=Mr(Z):(Z=ya(f)?_l:Wi.current,G.context=Wl(l,Z)),G.state=l.memoizedState,Z=f.getDerivedStateFromProps,typeof Z=="function"&&(Kc(l,f,Z,_),G.state=l.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof G.getSnapshotBeforeUpdate=="function"||typeof G.UNSAFE_componentWillMount!="function"&&typeof G.componentWillMount!="function"||(f=G.state,typeof G.componentWillMount=="function"&&G.componentWillMount(),typeof G.UNSAFE_componentWillMount=="function"&&G.UNSAFE_componentWillMount(),f!==G.state&&Zc.enqueueReplaceState(G,G.state,null),Vi(l,_,G,N),G.state=l.memoizedState),typeof G.componentDidMount=="function"&&(l.flags|=4194308)}function sc(l,f){try{var _="",N=f;do _+=J(N),N=N.return;while(N);var G=_}catch(Z){G=`
7
- Error generating stack: `+Z.message+`
8
- `+Z.stack}return{value:l,source:f,stack:G,digest:null}}function Uh(l,f,_){return{value:l,source:null,stack:_??null,digest:f??null}}function Qc(l,f){try{console.error(f.value)}catch(_){setTimeout(function(){throw _})}}var hg=typeof WeakMap=="function"?WeakMap:Map;function n1(l,f,_){_=ai(-1,_),_.tag=3,_.payload={element:null};var N=f.value;return _.callback=function(){s1||(s1=!0,_g=N),Qc(l,f)},_}function g(l,f,_){_=ai(-1,_),_.tag=3;var N=l.type.getDerivedStateFromError;if(typeof N=="function"){var G=f.value;_.payload=function(){return N(G)},_.callback=function(){Qc(l,f)}}var Z=l.stateNode;return Z!==null&&typeof Z.componentDidCatch=="function"&&(_.callback=function(){Qc(l,f),typeof N!="function"&&(ef===null?ef=new Set([this]):ef.add(this));var de=f.stack;this.componentDidCatch(f.value,{componentStack:de!==null?de:""})}),_}function v(l,f,_){var N=l.pingCache;if(N===null){N=l.pingCache=new hg;var G=new Set;N.set(f,G)}else G=N.get(f),G===void 0&&(G=new Set,N.set(f,G));G.has(_)||(G.add(_),l=F_.bind(null,l,f,_),f.then(l,l))}function C(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 q(l,f,_,N,G){return(l.mode&1)===0?(l===f?l.flags|=65536:(l.flags|=128,_.flags|=131072,_.flags&=-52805,_.tag===1&&(_.alternate===null?_.tag=17:(f=ai(-1,1),f.tag=2,Vr(_,f,1))),_.lanes|=1),l):(l.flags|=65536,l.lanes=G,l)}var W=E.ReactCurrentOwner,ae=!1;function Ee(l,f,_,N){f.child=l===null?Wn(f,null,_,N):gi(f,l.child,_,N)}function Ve(l,f,_,N,G){_=_.render;var Z=f.ref;return Rr(f,G),N=Sl(l,f,_,N,Z,G),_=xo(),l!==null&&!ae?(f.updateQueue=l.updateQueue,f.flags&=-2053,l.lanes&=~G,eo(l,f,G)):(mt&&_&&dt(f),f.flags|=1,Ee(l,f,N,G),f.child)}function lt(l,f,_,N,G){if(l===null){var Z=_.type;return typeof Z=="function"&&!Cg(Z)&&Z.defaultProps===void 0&&_.compare===null&&_.defaultProps===void 0?(f.tag=15,f.type=Z,_t(l,f,Z,N,G)):(l=d1(_.type,null,N,f,f.mode,G),l.ref=f.ref,l.return=f,f.child=l)}if(Z=l.child,(l.lanes&G)===0){var de=Z.memoizedProps;if(_=_.compare,_=_!==null?_:ga,_(de,N)&&l.ref===f.ref)return eo(l,f,G)}return f.flags|=1,l=af(Z,N),l.ref=f.ref,l.return=f,f.child=l}function _t(l,f,_,N,G){if(l!==null){var Z=l.memoizedProps;if(ga(Z,N)&&l.ref===f.ref)if(ae=!1,f.pendingProps=N=Z,(l.lanes&G)!==0)(l.flags&131072)!==0&&(ae=!0);else return f.lanes=l.lanes,eo(l,f,G)}return Rt(l,f,_,N,G)}function Gt(l,f,_){var N=f.pendingProps,G=N.children,Z=l!==null?l.memoizedState:null;if(N.mode==="hidden")if((f.mode&1)===0)f.memoizedState={baseLanes:0,cachePool:null,transitions:null},lr($h,tl),tl|=_;else{if((_&1073741824)===0)return l=Z!==null?Z.baseLanes|_:_,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:l,cachePool:null,transitions:null},f.updateQueue=null,lr($h,tl),tl|=l,null;f.memoizedState={baseLanes:0,cachePool:null,transitions:null},N=Z!==null?Z.baseLanes:_,lr($h,tl),tl|=N}else Z!==null?(N=Z.baseLanes|_,f.memoizedState=null):N=_,lr($h,tl),tl|=N;return Ee(l,f,G,_),f.child}function kn(l,f){var _=f.ref;(l===null&&_!==null||l!==null&&l.ref!==_)&&(f.flags|=512,f.flags|=2097152)}function Rt(l,f,_,N,G){var Z=ya(_)?_l:Wi.current;return Z=Wl(f,Z),Rr(f,G),_=Sl(l,f,_,N,Z,G),N=xo(),l!==null&&!ae?(f.updateQueue=l.updateQueue,f.flags&=-2053,l.lanes&=~G,eo(l,f,G)):(mt&&N&&dt(f),f.flags|=1,Ee(l,f,_,G),f.child)}function qr(l,f,_,N,G){if(ya(_)){var Z=!0;xs(f)}else Z=!1;if(Rr(f,G),f.stateNode===null)Vn(l,f),t1(f,_,N),qh(f,_,N,G),N=!0;else if(l===null){var de=f.stateNode,Ne=f.memoizedProps;de.props=Ne;var Fe=de.context,ot=_.contextType;typeof ot=="object"&&ot!==null?ot=Mr(ot):(ot=ya(_)?_l:Wi.current,ot=Wl(f,ot));var bt=_.getDerivedStateFromProps,xt=typeof bt=="function"||typeof de.getSnapshotBeforeUpdate=="function";xt||typeof de.UNSAFE_componentWillReceiveProps!="function"&&typeof de.componentWillReceiveProps!="function"||(Ne!==N||Fe!==ot)&&Md(f,de,N,ot),ii=!1;var yt=f.memoizedState;de.state=yt,Vi(f,N,de,G),Fe=f.memoizedState,Ne!==N||yt!==Fe||va.current||ii?(typeof bt=="function"&&(Kc(f,_,bt,N),Fe=f.memoizedState),(Ne=ii||zh(f,_,Ne,N,yt,Fe,ot))?(xt||typeof de.UNSAFE_componentWillMount!="function"&&typeof de.componentWillMount!="function"||(typeof de.componentWillMount=="function"&&de.componentWillMount(),typeof de.UNSAFE_componentWillMount=="function"&&de.UNSAFE_componentWillMount()),typeof de.componentDidMount=="function"&&(f.flags|=4194308)):(typeof de.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=N,f.memoizedState=Fe),de.props=N,de.state=Fe,de.context=ot,N=Ne):(typeof de.componentDidMount=="function"&&(f.flags|=4194308),N=!1)}else{de=f.stateNode,ba(l,f),Ne=f.memoizedProps,ot=f.type===f.elementType?Ne:Ma(f.type,Ne),de.props=ot,xt=f.pendingProps,yt=de.context,Fe=_.contextType,typeof Fe=="object"&&Fe!==null?Fe=Mr(Fe):(Fe=ya(_)?_l:Wi.current,Fe=Wl(f,Fe));var Ut=_.getDerivedStateFromProps;(bt=typeof Ut=="function"||typeof de.getSnapshotBeforeUpdate=="function")||typeof de.UNSAFE_componentWillReceiveProps!="function"&&typeof de.componentWillReceiveProps!="function"||(Ne!==xt||yt!==Fe)&&Md(f,de,N,Fe),ii=!1,yt=f.memoizedState,de.state=yt,Vi(f,N,de,G);var Xt=f.memoizedState;Ne!==xt||yt!==Xt||va.current||ii?(typeof Ut=="function"&&(Kc(f,_,Ut,N),Xt=f.memoizedState),(ot=ii||zh(f,_,ot,N,yt,Xt,Fe)||!1)?(bt||typeof de.UNSAFE_componentWillUpdate!="function"&&typeof de.componentWillUpdate!="function"||(typeof de.componentWillUpdate=="function"&&de.componentWillUpdate(N,Xt,Fe),typeof de.UNSAFE_componentWillUpdate=="function"&&de.UNSAFE_componentWillUpdate(N,Xt,Fe)),typeof de.componentDidUpdate=="function"&&(f.flags|=4),typeof de.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof de.componentDidUpdate!="function"||Ne===l.memoizedProps&&yt===l.memoizedState||(f.flags|=4),typeof de.getSnapshotBeforeUpdate!="function"||Ne===l.memoizedProps&&yt===l.memoizedState||(f.flags|=1024),f.memoizedProps=N,f.memoizedState=Xt),de.props=N,de.state=Xt,de.context=Fe,N=ot):(typeof de.componentDidUpdate!="function"||Ne===l.memoizedProps&&yt===l.memoizedState||(f.flags|=4),typeof de.getSnapshotBeforeUpdate!="function"||Ne===l.memoizedProps&&yt===l.memoizedState||(f.flags|=1024),N=!1)}return xr(l,f,_,N,Z,G)}function xr(l,f,_,N,G,Z){kn(l,f);var de=(f.flags&128)!==0;if(!N&&!de)return G&&Dh(f,_,!1),eo(l,f,Z);N=f.stateNode,W.current=f;var Ne=de&&typeof _.getDerivedStateFromError!="function"?null:N.render();return f.flags|=1,l!==null&&de?(f.child=gi(f,l.child,null,Z),f.child=gi(f,null,Ne,Z)):Ee(l,f,Ne,Z),f.memoizedState=N.state,G&&Dh(f,_,!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,_,N,G){return Bt(),kt(G),f.flags|=256,Ee(l,f,_,N),f.child}var it={dehydrated:null,treeContext:null,retryLane:0};function Xe(l){return{baseLanes:l,cachePool:null,transitions:null}}function gt(l,f,_){var N=f.pendingProps,G=vr.current,Z=!1,de=(f.flags&128)!==0,Ne;if((Ne=de)||(Ne=l!==null&&l.memoizedState===null?!1:(G&2)!==0),Ne?(Z=!0,f.flags&=-129):(l===null||l.memoizedState!==null)&&(G|=1),lr(vr,G&1),l===null)return qt(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):(de=N.children,l=N.fallback,Z?(N=f.mode,Z=f.child,de={mode:"hidden",children:de},(N&1)===0&&Z!==null?(Z.childLanes=0,Z.pendingProps=de):Z=p1(de,N,0,null),l=Wf(l,N,_,null),Z.return=f,l.return=f,Z.sibling=l,f.child=Z,f.child.memoizedState=Xe(_),f.memoizedState=it,l):Mt(f,de));if(G=l.memoizedState,G!==null&&(Ne=G.dehydrated,Ne!==null))return Tn(l,f,de,N,Ne,G,_);if(Z){Z=N.fallback,de=f.mode,G=l.child,Ne=G.sibling;var Fe={mode:"hidden",children:N.children};return(de&1)===0&&f.child!==G?(N=f.child,N.childLanes=0,N.pendingProps=Fe,f.deletions=null):(N=af(G,Fe),N.subtreeFlags=G.subtreeFlags&14680064),Ne!==null?Z=af(Ne,Z):(Z=Wf(Z,de,_,null),Z.flags|=2),Z.return=f,N.return=f,N.sibling=Z,f.child=N,N=Z,Z=f.child,de=l.child.memoizedState,de=de===null?Xe(_):{baseLanes:de.baseLanes|_,cachePool:null,transitions:de.transitions},Z.memoizedState=de,Z.childLanes=l.childLanes&~_,f.memoizedState=it,N}return Z=l.child,l=Z.sibling,N=af(Z,{mode:"visible",children:N.children}),(f.mode&1)===0&&(N.lanes=_),N.return=f,N.sibling=null,l!==null&&(_=f.deletions,_===null?(f.deletions=[l],f.flags|=16):_.push(l)),f.child=N,f.memoizedState=null,N}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,_,N){return N!==null&&kt(N),gi(f,l.child,null,_),l=Mt(f,f.pendingProps.children),l.flags|=2,f.memoizedState=null,l}function Tn(l,f,_,N,G,Z,de){if(_)return f.flags&256?(f.flags&=-257,N=Uh(Error(n(422))),ln(l,f,de,N)):f.memoizedState!==null?(f.child=l.child,f.flags|=128,null):(Z=N.fallback,G=f.mode,N=p1({mode:"visible",children:N.children},G,0,null),Z=Wf(Z,G,de,null),Z.flags|=2,N.return=f,Z.return=f,N.sibling=Z,f.child=N,(f.mode&1)!==0&&gi(f,l.child,null,de),f.child.memoizedState=Xe(de),f.memoizedState=it,Z);if((f.mode&1)===0)return ln(l,f,de,null);if(G.data==="$!"){if(N=G.nextSibling&&G.nextSibling.dataset,N)var Ne=N.dgst;return N=Ne,Z=Error(n(419)),N=Uh(Z,N,void 0),ln(l,f,de,N)}if(Ne=(de&l.childLanes)!==0,ae||Ne){if(N=to,N!==null){switch(de&-de){case 4:G=2;break;case 16:G=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:G=32;break;case 536870912:G=268435456;break;default:G=0}G=(G&(N.suspendedLanes|de))!==0?0:G,G!==0&&G!==Z.retryLane&&(Z.retryLane=G,er(l,G),Jl(N,l,G,-1))}return Og(),N=Uh(Error(n(421))),ln(l,f,de,N)}return G.data==="$?"?(f.flags|=128,f.child=l.child,f=B_.bind(null,l),G._reactRetry=f,null):(l=Z.treeContext,qe=Ji(G.nextSibling),ft=f,mt=!0,vt=null,l!==null&&(Se[Pe++]=Qe,Se[Pe++]=Ae,Se[Pe++]=De,Qe=l.id,Ae=l.overflow,De=f),f=Mt(f,N.children),f.flags|=4096,f)}function An(l,f,_){l.lanes|=f;var N=l.alternate;N!==null&&(N.lanes|=f),Xn(l.return,f,_)}function Zn(l,f,_,N,G){var Z=l.memoizedState;Z===null?l.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:N,tail:_,tailMode:G}:(Z.isBackwards=f,Z.rendering=null,Z.renderingStartTime=0,Z.last=N,Z.tail=_,Z.tailMode=G)}function ra(l,f,_){var N=f.pendingProps,G=N.revealOrder,Z=N.tail;if(Ee(l,f,N.children,_),N=vr.current,(N&2)!==0)N=N&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,_,f);else if(l.tag===19)An(l,_,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}N&=1}if(lr(vr,N),(f.mode&1)===0)f.memoizedState=null;else switch(G){case"forwards":for(_=f.child,G=null;_!==null;)l=_.alternate,l!==null&&yo(l)===null&&(G=_),_=_.sibling;_=G,_===null?(G=f.child,f.child=null):(G=_.sibling,_.sibling=null),Zn(f,!1,G,_,Z);break;case"backwards":for(_=null,G=f.child,f.child=null;G!==null;){if(l=G.alternate,l!==null&&yo(l)===null){f.child=G;break}l=G.sibling,G.sibling=_,_=G,G=l}Zn(f,!0,_,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,_){if(l!==null&&(f.dependencies=l.dependencies),Uf|=f.lanes,(_&f.childLanes)===0)return null;if(l!==null&&f.child!==l.child)throw Error(n(153));if(f.child!==null){for(l=f.child,_=af(l,l.pendingProps),f.child=_,_.return=f;l.sibling!==null;)l=l.sibling,_=_.sibling=af(l,l.pendingProps),_.return=f;_.sibling=null}return f.child}function dg(l,f,_){switch(f.tag){case 3:So(f),Bt();break;case 5:Pu(f);break;case 1:ya(f.type)&&xs(f);break;case 4:Jo(f,f.stateNode.containerInfo);break;case 10:var N=f.type._context,G=f.memoizedProps.value;lr(Pi,N._currentValue),N._currentValue=G;break;case 13:if(N=f.memoizedState,N!==null)return N.dehydrated!==null?(lr(vr,vr.current&1),f.flags|=128,null):(_&f.child.childLanes)!==0?gt(l,f,_):(lr(vr,vr.current&1),l=eo(l,f,_),l!==null?l.sibling:null);lr(vr,vr.current&1);break;case 19:if(N=(_&f.childLanes)!==0,(l.flags&128)!==0){if(N)return ra(l,f,_);f.flags|=128}if(G=f.memoizedState,G!==null&&(G.rendering=null,G.tail=null,G.lastEffect=null),lr(vr,vr.current),N)break;return null;case 22:case 23:return f.lanes=0,Gt(l,f,_)}return eo(l,f,_)}var Ry,pg,My,Iy;Ry=function(l,f){for(var _=f.child;_!==null;){if(_.tag===5||_.tag===6)l.appendChild(_.stateNode);else if(_.tag!==4&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===f)break;for(;_.sibling===null;){if(_.return===null||_.return===f)return;_=_.return}_.sibling.return=_.return,_=_.sibling}},pg=function(){},My=function(l,f,_,N){var G=l.memoizedProps;if(G!==N){l=f.stateNode,mi(Bn.current);var Z=null;switch(_){case"input":G=tt(l,G),N=tt(l,N),Z=[];break;case"select":G=X({},G,{value:void 0}),N=X({},N,{value:void 0}),Z=[];break;case"textarea":G=ve(l,G),N=ve(l,N),Z=[];break;default:typeof G.onClick!="function"&&typeof N.onClick=="function"&&(l.onclick=Zs)}We(_,N);var de;_=null;for(ot in G)if(!N.hasOwnProperty(ot)&&G.hasOwnProperty(ot)&&G[ot]!=null)if(ot==="style"){var Ne=G[ot];for(de in Ne)Ne.hasOwnProperty(de)&&(_||(_={}),_[de]="")}else ot!=="dangerouslySetInnerHTML"&&ot!=="children"&&ot!=="suppressContentEditableWarning"&&ot!=="suppressHydrationWarning"&&ot!=="autoFocus"&&(i.hasOwnProperty(ot)?Z||(Z=[]):(Z=Z||[]).push(ot,null));for(ot in N){var Fe=N[ot];if(Ne=G?.[ot],N.hasOwnProperty(ot)&&Fe!==Ne&&(Fe!=null||Ne!=null))if(ot==="style")if(Ne){for(de in Ne)!Ne.hasOwnProperty(de)||Fe&&Fe.hasOwnProperty(de)||(_||(_={}),_[de]="");for(de in Fe)Fe.hasOwnProperty(de)&&Ne[de]!==Fe[de]&&(_||(_={}),_[de]=Fe[de])}else _||(Z||(Z=[]),Z.push(ot,_)),_=Fe;else ot==="dangerouslySetInnerHTML"?(Fe=Fe?Fe.__html:void 0,Ne=Ne?Ne.__html:void 0,Fe!=null&&Ne!==Fe&&(Z=Z||[]).push(ot,Fe)):ot==="children"?typeof Fe!="string"&&typeof Fe!="number"||(Z=Z||[]).push(ot,""+Fe):ot!=="suppressContentEditableWarning"&&ot!=="suppressHydrationWarning"&&(i.hasOwnProperty(ot)?(Fe!=null&&ot==="onScroll"&&gr("scroll",l),Z||Ne===Fe||(Z=[])):(Z=Z||[]).push(ot,Fe))}_&&(Z=Z||[]).push("style",_);var ot=Z;(f.updateQueue=ot)&&(f.flags|=4)}},Iy=function(l,f,_,N){_!==N&&(f.flags|=4)};function Id(l,f){if(!mt)switch(l.tailMode){case"hidden":f=l.tail;for(var _=null;f!==null;)f.alternate!==null&&(_=f),f=f.sibling;_===null?l.tail=null:_.sibling=null;break;case"collapsed":_=l.tail;for(var N=null;_!==null;)_.alternate!==null&&(N=_),_=_.sibling;N===null?f||l.tail===null?l.tail=null:l.tail.sibling=null:N.sibling=null}}function Do(l){var f=l.alternate!==null&&l.alternate.child===l.child,_=0,N=0;if(f)for(var G=l.child;G!==null;)_|=G.lanes|G.childLanes,N|=G.subtreeFlags&14680064,N|=G.flags&14680064,G.return=l,G=G.sibling;else for(G=l.child;G!==null;)_|=G.lanes|G.childLanes,N|=G.subtreeFlags,N|=G.flags,G.return=l,G=G.sibling;return l.subtreeFlags|=N,l.childLanes=_,f}function O_(l,f,_){var N=f.pendingProps;switch(Ye(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)&&Au(),Do(f),null;case 3:return N=f.stateNode,mr(),rr(va),rr(Wi),xa(),N.pendingContext&&(N.context=N.pendingContext,N.pendingContext=null),(l===null||l.child===null)&&(Gr(f)?f.flags|=4:l===null||l.memoizedState.isDehydrated&&(f.flags&256)===0||(f.flags|=1024,vt!==null&&(kg(vt),vt=null))),pg(l,f),Do(f),null;case 5:Js(f);var G=mi(zr.current);if(_=f.type,l!==null&&f.stateNode!=null)My(l,f,_,N,G),l.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!N){if(f.stateNode===null)throw Error(n(166));return Do(f),null}if(l=mi(Bn.current),Gr(f)){N=f.stateNode,_=f.type;var Z=f.memoizedProps;switch(N[Mo]=f,N[Eu]=Z,l=(f.mode&1)!==0,_){case"dialog":gr("cancel",N),gr("close",N);break;case"iframe":case"object":case"embed":gr("load",N);break;case"video":case"audio":for(G=0;G<Qo.length;G++)gr(Qo[G],N);break;case"source":gr("error",N);break;case"img":case"image":case"link":gr("error",N),gr("load",N);break;case"details":gr("toggle",N);break;case"input":ge(N,Z),gr("invalid",N);break;case"select":N._wrapperState={wasMultiple:!!Z.multiple},gr("invalid",N);break;case"textarea":ye(N,Z),gr("invalid",N)}We(_,Z),G=null;for(var de in Z)if(Z.hasOwnProperty(de)){var Ne=Z[de];de==="children"?typeof Ne=="string"?N.textContent!==Ne&&(Z.suppressHydrationWarning!==!0&&tc(N.textContent,Ne,l),G=["children",Ne]):typeof Ne=="number"&&N.textContent!==""+Ne&&(Z.suppressHydrationWarning!==!0&&tc(N.textContent,Ne,l),G=["children",""+Ne]):i.hasOwnProperty(de)&&Ne!=null&&de==="onScroll"&&gr("scroll",N)}switch(_){case"input":Ce(N),he(N,Z,!0);break;case"textarea":Ce(N),Ie(N);break;case"select":case"option":break;default:typeof Z.onClick=="function"&&(N.onclick=Zs)}N=G,f.updateQueue=N,N!==null&&(f.flags|=4)}else{de=G.nodeType===9?G:G.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=Te(_)),l==="http://www.w3.org/1999/xhtml"?_==="script"?(l=de.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof N.is=="string"?l=de.createElement(_,{is:N.is}):(l=de.createElement(_),_==="select"&&(de=l,N.multiple?de.multiple=!0:N.size&&(de.size=N.size))):l=de.createElementNS(l,_),l[Mo]=f,l[Eu]=N,Ry(l,f,!1,!1),f.stateNode=l;e:{switch(de=Be(_,N),_){case"dialog":gr("cancel",l),gr("close",l),G=N;break;case"iframe":case"object":case"embed":gr("load",l),G=N;break;case"video":case"audio":for(G=0;G<Qo.length;G++)gr(Qo[G],l);G=N;break;case"source":gr("error",l),G=N;break;case"img":case"image":case"link":gr("error",l),gr("load",l),G=N;break;case"details":gr("toggle",l),G=N;break;case"input":ge(l,N),G=tt(l,N),gr("invalid",l);break;case"option":G=N;break;case"select":l._wrapperState={wasMultiple:!!N.multiple},G=X({},N,{value:void 0}),gr("invalid",l);break;case"textarea":ye(l,N),G=ve(l,N),gr("invalid",l);break;default:G=N}We(_,G),Ne=G;for(Z in Ne)if(Ne.hasOwnProperty(Z)){var Fe=Ne[Z];Z==="style"?Zt(l,Fe):Z==="dangerouslySetInnerHTML"?(Fe=Fe?Fe.__html:void 0,Fe!=null&&st(l,Fe)):Z==="children"?typeof Fe=="string"?(_!=="textarea"||Fe!=="")&&at(l,Fe):typeof Fe=="number"&&at(l,""+Fe):Z!=="suppressContentEditableWarning"&&Z!=="suppressHydrationWarning"&&Z!=="autoFocus"&&(i.hasOwnProperty(Z)?Fe!=null&&Z==="onScroll"&&gr("scroll",l):Fe!=null&&k(l,Z,Fe,de))}switch(_){case"input":Ce(l),he(l,N,!1);break;case"textarea":Ce(l),Ie(l);break;case"option":N.value!=null&&l.setAttribute("value",""+fe(N.value));break;case"select":l.multiple=!!N.multiple,Z=N.value,Z!=null?Me(l,!!N.multiple,Z,!1):N.defaultValue!=null&&Me(l,!!N.multiple,N.defaultValue,!0);break;default:typeof G.onClick=="function"&&(l.onclick=Zs)}switch(_){case"button":case"input":case"select":case"textarea":N=!!N.autoFocus;break e;case"img":N=!0;break e;default:N=!1}}N&&(f.flags|=4)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return Do(f),null;case 6:if(l&&f.stateNode!=null)Iy(l,f,l.memoizedProps,N);else{if(typeof N!="string"&&f.stateNode===null)throw Error(n(166));if(_=mi(zr.current),mi(Bn.current),Gr(f)){if(N=f.stateNode,_=f.memoizedProps,N[Mo]=f,(Z=N.nodeValue!==_)&&(l=ft,l!==null))switch(l.tag){case 3:tc(N.nodeValue,_,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&tc(N.nodeValue,_,(l.mode&1)!==0)}Z&&(f.flags|=4)}else N=(_.nodeType===9?_:_.ownerDocument).createTextNode(N),N[Mo]=f,f.stateNode=N}return Do(f),null;case 13:if(rr(vr),N=f.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(mt&&qe!==null&&(f.mode&1)!==0&&(f.flags&128)===0)_n(),Bt(),f.flags|=98560,Z=!1;else if(Z=Gr(f),N!==null&&N.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&&(kg(vt),vt=null),Z=!0;if(!Z)return f.flags&65536?f:null}return(f.flags&128)!==0?(f.lanes=_,f):(N=N!==null,N!==(l!==null&&l.memoizedState!==null)&&N&&(f.child.flags|=8192,(f.mode&1)!==0&&(l===null||(vr.current&1)!==0?Ia===0&&(Ia=3):Og())),f.updateQueue!==null&&(f.flags|=4),Do(f),null);case 4:return mr(),pg(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)&&Au(),Do(f),null;case 19:if(rr(vr),Z=f.memoizedState,Z===null)return Do(f),null;if(N=(f.flags&128)!==0,de=Z.rendering,de===null)if(N)Id(Z,!1);else{if(Ia!==0||l!==null&&(l.flags&128)!==0)for(l=f.child;l!==null;){if(de=yo(l),de!==null){for(f.flags|=128,Id(Z,!1),N=de.updateQueue,N!==null&&(f.updateQueue=N,f.flags|=4),f.subtreeFlags=0,N=_,_=f.child;_!==null;)Z=_,l=N,Z.flags&=14680066,de=Z.alternate,de===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=de.childLanes,Z.lanes=de.lanes,Z.child=de.child,Z.subtreeFlags=0,Z.deletions=null,Z.memoizedProps=de.memoizedProps,Z.memoizedState=de.memoizedState,Z.updateQueue=de.updateQueue,Z.type=de.type,l=de.dependencies,Z.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),_=_.sibling;return lr(vr,vr.current&1|2),f.child}l=l.sibling}Z.tail!==null&&Cr()>Gh&&(f.flags|=128,N=!0,Id(Z,!1),f.lanes=4194304)}else{if(!N)if(l=yo(de),l!==null){if(f.flags|=128,N=!0,_=l.updateQueue,_!==null&&(f.updateQueue=_,f.flags|=4),Id(Z,!0),Z.tail===null&&Z.tailMode==="hidden"&&!de.alternate&&!mt)return Do(f),null}else 2*Cr()-Z.renderingStartTime>Gh&&_!==1073741824&&(f.flags|=128,N=!0,Id(Z,!1),f.lanes=4194304);Z.isBackwards?(de.sibling=f.child,f.child=de):(_=Z.last,_!==null?_.sibling=de:f.child=de,Z.last=de)}return Z.tail!==null?(f=Z.tail,Z.rendering=f,Z.tail=f.sibling,Z.renderingStartTime=Cr(),f.sibling=null,_=vr.current,lr(vr,N?_&1|2:_&1),f):(Do(f),null);case 22:case 23:return Pg(),N=f.memoizedState!==null,l!==null&&l.memoizedState!==null!==N&&(f.flags|=8192),N&&(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 C_(l,f){switch(Ye(f),f.tag){case 1:return ya(f.type)&&Au(),l=f.flags,l&65536?(f.flags=l&-65537|128,f):null;case 3:return mr(),rr(va),rr(Wi),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(rr(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 rr(vr),null;case 4:return mr(),null;case 10:return Tr(f.type._context),null;case 22:case 23:return Pg(),null;case 24:return null;default:return null}}var r1=!1,Fo=!1,L_=typeof WeakSet=="function"?WeakSet:Set,Vt=null;function Hh(l,f){var _=l.ref;if(_!==null)if(typeof _=="function")try{_(null)}catch(N){Xi(l,f,N)}else _.current=null}function gg(l,f,_){try{_()}catch(N){Xi(l,f,N)}}var jy=!1;function N_(l,f){if(nc=yu,l=Mn(),Za(l)){if("selectionStart"in l)var _={start:l.selectionStart,end:l.selectionEnd};else e:{_=(_=l.ownerDocument)&&_.defaultView||window;var N=_.getSelection&&_.getSelection();if(N&&N.rangeCount!==0){_=N.anchorNode;var G=N.anchorOffset,Z=N.focusNode;N=N.focusOffset;try{_.nodeType,Z.nodeType}catch{_=null;break e}var de=0,Ne=-1,Fe=-1,ot=0,bt=0,xt=l,yt=null;t:for(;;){for(var Ut;xt!==_||G!==0&&xt.nodeType!==3||(Ne=de+G),xt!==Z||N!==0&&xt.nodeType!==3||(Fe=de+N),xt.nodeType===3&&(de+=xt.nodeValue.length),(Ut=xt.firstChild)!==null;)yt=xt,xt=Ut;for(;;){if(xt===l)break t;if(yt===_&&++ot===G&&(Ne=de),yt===Z&&++bt===N&&(Fe=de),(Ut=xt.nextSibling)!==null)break;xt=yt,yt=xt.parentNode}xt=Ut}_=Ne===-1||Fe===-1?null:{start:Ne,end:Fe}}else _=null}_=_||{start:0,end:0}}else _=null;for(Gl={focusedElem:l,selectionRange:_},yu=!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 Jt=Xt.memoizedProps,ia=Xt.memoizedState,et=f.stateNode,Ge=et.getSnapshotBeforeUpdate(f.elementType===f.type?Jt:Ma(f.type,Jt),ia);et.__reactInternalSnapshotBeforeUpdate=Ge}break;case 3:var rt=f.stateNode.containerInfo;rt.nodeType===1?rt.textContent="":rt.nodeType===9&&rt.documentElement&&rt.removeChild(rt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(St){Xi(f,f.return,St)}if(l=f.sibling,l!==null){l.return=f.return,Vt=l;break}Vt=f.return}return Xt=jy,jy=!1,Xt}function jd(l,f,_){var N=f.updateQueue;if(N=N!==null?N.lastEffect:null,N!==null){var G=N=N.next;do{if((G.tag&l)===l){var Z=G.destroy;G.destroy=void 0,Z!==void 0&&gg(f,_,Z)}G=G.next}while(G!==N)}}function i1(l,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var _=f=f.next;do{if((_.tag&l)===l){var N=_.create;_.destroy=N()}_=_.next}while(_!==f)}}function mg(l){var f=l.ref;if(f!==null){var _=l.stateNode;l.tag,l=_,typeof f=="function"?f(l):f.current=l}}function Dy(l){var f=l.alternate;f!==null&&(l.alternate=null,Dy(f)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(f=l.stateNode,f!==null&&(delete f[Mo],delete f[Eu],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 Fy(l){return l.tag===5||l.tag===3||l.tag===4}function By(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Fy(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 vg(l,f,_){var N=l.tag;if(N===5||N===6)l=l.stateNode,f?_.nodeType===8?_.parentNode.insertBefore(l,f):_.insertBefore(l,f):(_.nodeType===8?(f=_.parentNode,f.insertBefore(l,_)):(f=_,f.appendChild(l)),_=_._reactRootContainer,_!=null||f.onclick!==null||(f.onclick=Zs));else if(N!==4&&(l=l.child,l!==null))for(vg(l,f,_),l=l.sibling;l!==null;)vg(l,f,_),l=l.sibling}function yg(l,f,_){var N=l.tag;if(N===5||N===6)l=l.stateNode,f?_.insertBefore(l,f):_.appendChild(l);else if(N!==4&&(l=l.child,l!==null))for(yg(l,f,_),l=l.sibling;l!==null;)yg(l,f,_),l=l.sibling}var Eo=null,Zl=!1;function Jc(l,f,_){for(_=_.child;_!==null;)zy(l,f,_),_=_.sibling}function zy(l,f,_){if(wi&&typeof wi.onCommitFiberUnmount=="function")try{wi.onCommitFiberUnmount(Po,_)}catch{}switch(_.tag){case 5:Fo||Hh(_,f);case 6:var N=Eo,G=Zl;Eo=null,Jc(l,f,_),Eo=N,Zl=G,Eo!==null&&(Zl?(l=Eo,_=_.stateNode,l.nodeType===8?l.parentNode.removeChild(_):l.removeChild(_)):Eo.removeChild(_.stateNode));break;case 18:Eo!==null&&(Zl?(l=Eo,_=_.stateNode,l.nodeType===8?Hc(l.parentNode,_):l.nodeType===1&&Hc(l,_),fa(l)):Hc(Eo,_.stateNode));break;case 4:N=Eo,G=Zl,Eo=_.stateNode.containerInfo,Zl=!0,Jc(l,f,_),Eo=N,Zl=G;break;case 0:case 11:case 14:case 15:if(!Fo&&(N=_.updateQueue,N!==null&&(N=N.lastEffect,N!==null))){G=N=N.next;do{var Z=G,de=Z.destroy;Z=Z.tag,de!==void 0&&((Z&2)!==0||(Z&4)!==0)&&gg(_,f,de),G=G.next}while(G!==N)}Jc(l,f,_);break;case 1:if(!Fo&&(Hh(_,f),N=_.stateNode,typeof N.componentWillUnmount=="function"))try{N.props=_.memoizedProps,N.state=_.memoizedState,N.componentWillUnmount()}catch(Ne){Xi(_,f,Ne)}Jc(l,f,_);break;case 21:Jc(l,f,_);break;case 22:_.mode&1?(Fo=(N=Fo)||_.memoizedState!==null,Jc(l,f,_),Fo=N):Jc(l,f,_);break;default:Jc(l,f,_)}}function qy(l){var f=l.updateQueue;if(f!==null){l.updateQueue=null;var _=l.stateNode;_===null&&(_=l.stateNode=new L_),f.forEach(function(N){var G=z_.bind(null,l,N);_.has(N)||(_.add(N),N.then(G,G))})}}function Ql(l,f){var _=f.deletions;if(_!==null)for(var N=0;N<_.length;N++){var G=_[N];try{var Z=l,de=f,Ne=de;e:for(;Ne!==null;){switch(Ne.tag){case 5:Eo=Ne.stateNode,Zl=!1;break e;case 3:Eo=Ne.stateNode.containerInfo,Zl=!0;break e;case 4:Eo=Ne.stateNode.containerInfo,Zl=!0;break e}Ne=Ne.return}if(Eo===null)throw Error(n(160));zy(Z,de,G),Eo=null,Zl=!1;var Fe=G.alternate;Fe!==null&&(Fe.return=null),G.return=null}catch(ot){Xi(G,f,ot)}}if(f.subtreeFlags&12854)for(f=f.child;f!==null;)Uy(f,l),f=f.sibling}function Uy(l,f){var _=l.alternate,N=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Ql(f,l),Ru(l),N&4){try{jd(3,l,l.return),i1(3,l)}catch(Jt){Xi(l,l.return,Jt)}try{jd(5,l,l.return)}catch(Jt){Xi(l,l.return,Jt)}}break;case 1:Ql(f,l),Ru(l),N&512&&_!==null&&Hh(_,_.return);break;case 5:if(Ql(f,l),Ru(l),N&512&&_!==null&&Hh(_,_.return),l.flags&32){var G=l.stateNode;try{at(G,"")}catch(Jt){Xi(l,l.return,Jt)}}if(N&4&&(G=l.stateNode,G!=null)){var Z=l.memoizedProps,de=_!==null?_.memoizedProps:Z,Ne=l.type,Fe=l.updateQueue;if(l.updateQueue=null,Fe!==null)try{Ne==="input"&&Z.type==="radio"&&Z.name!=null&&ut(G,Z),Be(Ne,de);var ot=Be(Ne,Z);for(de=0;de<Fe.length;de+=2){var bt=Fe[de],xt=Fe[de+1];bt==="style"?Zt(G,xt):bt==="dangerouslySetInnerHTML"?st(G,xt):bt==="children"?at(G,xt):k(G,bt,xt,ot)}switch(Ne){case"input":ke(G,Z);break;case"textarea":xe(G,Z);break;case"select":var yt=G._wrapperState.wasMultiple;G._wrapperState.wasMultiple=!!Z.multiple;var Ut=Z.value;Ut!=null?Me(G,!!Z.multiple,Ut,!1):yt!==!!Z.multiple&&(Z.defaultValue!=null?Me(G,!!Z.multiple,Z.defaultValue,!0):Me(G,!!Z.multiple,Z.multiple?[]:"",!1))}G[Eu]=Z}catch(Jt){Xi(l,l.return,Jt)}}break;case 6:if(Ql(f,l),Ru(l),N&4){if(l.stateNode===null)throw Error(n(162));G=l.stateNode,Z=l.memoizedProps;try{G.nodeValue=Z}catch(Jt){Xi(l,l.return,Jt)}}break;case 3:if(Ql(f,l),Ru(l),N&4&&_!==null&&_.memoizedState.isDehydrated)try{fa(f.containerInfo)}catch(Jt){Xi(l,l.return,Jt)}break;case 4:Ql(f,l),Ru(l);break;case 13:Ql(f,l),Ru(l),G=l.child,G.flags&8192&&(Z=G.memoizedState!==null,G.stateNode.isHidden=Z,!Z||G.alternate!==null&&G.alternate.memoizedState!==null||(xg=Cr())),N&4&&qy(l);break;case 22:if(bt=_!==null&&_.memoizedState!==null,l.mode&1?(Fo=(ot=Fo)||bt,Ql(f,l),Fo=ot):Ql(f,l),Ru(l),N&8192){if(ot=l.memoizedState!==null,(l.stateNode.isHidden=ot)&&!bt&&(l.mode&1)!==0)for(Vt=l,bt=l.child;bt!==null;){for(xt=Vt=bt;Vt!==null;){switch(yt=Vt,Ut=yt.child,yt.tag){case 0:case 11:case 14:case 15:jd(4,yt,yt.return);break;case 1:Hh(yt,yt.return);var Xt=yt.stateNode;if(typeof Xt.componentWillUnmount=="function"){N=yt,_=yt.return;try{f=N,Xt.props=f.memoizedProps,Xt.state=f.memoizedState,Xt.componentWillUnmount()}catch(Jt){Xi(N,_,Jt)}}break;case 5:Hh(yt,yt.return);break;case 22:if(yt.memoizedState!==null){Gy(xt);continue}}Ut!==null?(Ut.return=yt,Vt=Ut):Gy(xt)}bt=bt.sibling}e:for(bt=null,xt=l;;){if(xt.tag===5){if(bt===null){bt=xt;try{G=xt.stateNode,ot?(Z=G.style,typeof Z.setProperty=="function"?Z.setProperty("display","none","important"):Z.display="none"):(Ne=xt.stateNode,Fe=xt.memoizedProps.style,de=Fe!=null&&Fe.hasOwnProperty("display")?Fe.display:null,Ne.style.display=rn("display",de))}catch(Jt){Xi(l,l.return,Jt)}}}else if(xt.tag===6){if(bt===null)try{xt.stateNode.nodeValue=ot?"":xt.memoizedProps}catch(Jt){Xi(l,l.return,Jt)}}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:Ql(f,l),Ru(l),N&4&&qy(l);break;case 21:break;default:Ql(f,l),Ru(l)}}function Ru(l){var f=l.flags;if(f&2){try{e:{for(var _=l.return;_!==null;){if(Fy(_)){var N=_;break e}_=_.return}throw Error(n(160))}switch(N.tag){case 5:var G=N.stateNode;N.flags&32&&(at(G,""),N.flags&=-33);var Z=By(l);yg(l,Z,G);break;case 3:case 4:var de=N.stateNode.containerInfo,Ne=By(l);vg(l,Ne,de);break;default:throw Error(n(161))}}catch(Fe){Xi(l,l.return,Fe)}l.flags&=-3}f&4096&&(l.flags&=-4097)}function T_(l,f,_){Vt=l,Hy(l)}function Hy(l,f,_){for(var N=(l.mode&1)!==0;Vt!==null;){var G=Vt,Z=G.child;if(G.tag===22&&N){var de=G.memoizedState!==null||r1;if(!de){var Ne=G.alternate,Fe=Ne!==null&&Ne.memoizedState!==null||Fo;Ne=r1;var ot=Fo;if(r1=de,(Fo=Fe)&&!ot)for(Vt=G;Vt!==null;)de=Vt,Fe=de.child,de.tag===22&&de.memoizedState!==null?Wy(G):Fe!==null?(Fe.return=de,Vt=Fe):Wy(G);for(;Z!==null;)Vt=Z,Hy(Z),Z=Z.sibling;Vt=G,r1=Ne,Fo=ot}$y(l)}else(G.subtreeFlags&8772)!==0&&Z!==null?(Z.return=G,Vt=Z):$y(l)}}function $y(l){for(;Vt!==null;){var f=Vt;if((f.flags&8772)!==0){var _=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 N=f.stateNode;if(f.flags&4&&!Fo)if(_===null)N.componentDidMount();else{var G=f.elementType===f.type?_.memoizedProps:Ma(f.type,_.memoizedProps);N.componentDidUpdate(G,_.memoizedState,N.__reactInternalSnapshotBeforeUpdate)}var Z=f.updateQueue;Z!==null&&Kn(f,Z,N);break;case 3:var de=f.updateQueue;if(de!==null){if(_=null,f.child!==null)switch(f.child.tag){case 5:_=f.child.stateNode;break;case 1:_=f.child.stateNode}Kn(f,de,_)}break;case 5:var Ne=f.stateNode;if(_===null&&f.flags&4){_=Ne;var Fe=f.memoizedProps;switch(f.type){case"button":case"input":case"select":case"textarea":Fe.autoFocus&&_.focus();break;case"img":Fe.src&&(_.src=Fe.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(f.memoizedState===null){var ot=f.alternate;if(ot!==null){var bt=ot.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&&mg(f)}catch(yt){Xi(f,f.return,yt)}}if(f===l){Vt=null;break}if(_=f.sibling,_!==null){_.return=f.return,Vt=_;break}Vt=f.return}}function Gy(l){for(;Vt!==null;){var f=Vt;if(f===l){Vt=null;break}var _=f.sibling;if(_!==null){_.return=f.return,Vt=_;break}Vt=f.return}}function Wy(l){for(;Vt!==null;){var f=Vt;try{switch(f.tag){case 0:case 11:case 15:var _=f.return;try{i1(4,f)}catch(Fe){Xi(f,_,Fe)}break;case 1:var N=f.stateNode;if(typeof N.componentDidMount=="function"){var G=f.return;try{N.componentDidMount()}catch(Fe){Xi(f,G,Fe)}}var Z=f.return;try{mg(f)}catch(Fe){Xi(f,Z,Fe)}break;case 5:var de=f.return;try{mg(f)}catch(Fe){Xi(f,de,Fe)}}}catch(Fe){Xi(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 R_=Math.ceil,a1=E.ReactCurrentDispatcher,bg=E.ReactCurrentOwner,kl=E.ReactCurrentBatchConfig,cr=0,to=null,Sa=null,ko=0,tl=0,$h=Io(0),Ia=0,Dd=null,Uf=0,o1=0,wg=0,Fd=null,Ps=null,xg=0,Gh=1/0,lc=null,s1=!1,_g=null,ef=null,l1=!1,tf=null,u1=0,Bd=0,Sg=null,c1=-1,f1=0;function ns(){return(cr&6)!==0?Cr():c1!==-1?c1:c1=Cr()}function nf(l){return(l.mode&1)===0?1:(cr&2)!==0&&ko!==0?ko&-ko:Wr.transition!==null?(f1===0&&(f1=pu()),f1):(l=jn,l!==0||(l=window.event,l=l===void 0?16:jl(l.type)),l)}function Jl(l,f,_,N){if(50<Bd)throw Bd=0,Sg=null,Error(n(185));Ml(l,_,N),((cr&2)===0||l!==to)&&(l===to&&((cr&2)===0&&(o1|=_),Ia===4&&rf(l,ko)),Os(l,N),_===1&&cr===0&&(f.mode&1)===0&&(Gh=Cr()+500,Vl&&ne()))}function Os(l,f){var _=l.callbackNode;xi(l,f);var N=ls(l,l===to?ko:0);if(N===0)_!==null&&as(_),l.callbackNode=null,l.callbackPriority=0;else if(f=N&-N,l.callbackPriority!==f){if(_!=null&&as(_),f===1)l.tag===0?V(Yy.bind(null,l)):I(Yy.bind(null,l)),Rh(function(){(cr&6)===0&&ne()}),_=null;else{switch(cs(N)){case 1:_=os;break;case 4:_=Oa;break;case 16:_=ss;break;case 536870912:_=hl;break;default:_=ss}_=n5(_,Vy.bind(null,l))}l.callbackPriority=f,l.callbackNode=_}}function Vy(l,f){if(c1=-1,f1=0,(cr&6)!==0)throw Error(n(327));var _=l.callbackNode;if(Wh()&&l.callbackNode!==_)return null;var N=ls(l,l===to?ko:0);if(N===0)return null;if((N&30)!==0||(N&l.expiredLanes)!==0||f)f=h1(l,N);else{f=N;var G=cr;cr|=2;var Z=Ky();(to!==l||ko!==f)&&(lc=null,Gh=Cr()+500,$f(l,f));do try{j_();break}catch(Ne){Xy(l,Ne)}while(!0);Yn(),a1.current=Z,cr=G,Sa!==null?f=0:(to=null,ko=0,f=Ia)}if(f!==0){if(f===2&&(G=Ba(l),G!==0&&(N=G,f=Eg(l,G))),f===1)throw _=Dd,$f(l,0),rf(l,N),Os(l,Cr()),_;if(f===6)rf(l,N);else{if(G=l.current.alternate,(N&30)===0&&!M_(G)&&(f=h1(l,N),f===2&&(Z=Ba(l),Z!==0&&(N=Z,f=Eg(l,Z))),f===1))throw _=Dd,$f(l,0),rf(l,N),Os(l,Cr()),_;switch(l.finishedWork=G,l.finishedLanes=N,f){case 0:case 1:throw Error(n(345));case 2:Gf(l,Ps,lc);break;case 3:if(rf(l,N),(N&130023424)===N&&(f=xg+500-Cr(),10<f)){if(ls(l,0)!==0)break;if(G=l.suspendedLanes,(G&N)!==N){ns(),l.pingedLanes|=l.suspendedLanes&G;break}l.timeoutHandle=vo(Gf.bind(null,l,Ps,lc),f);break}Gf(l,Ps,lc);break;case 4:if(rf(l,N),(N&4194240)===N)break;for(f=l.eventTimes,G=-1;0<N;){var de=31-wn(N);Z=1<<de,de=f[de],de>G&&(G=de),N&=~Z}if(N=G,N=Cr()-N,N=(120>N?120:480>N?480:1080>N?1080:1920>N?1920:3e3>N?3e3:4320>N?4320:1960*R_(N/1960))-N,10<N){l.timeoutHandle=vo(Gf.bind(null,l,Ps,lc),N);break}Gf(l,Ps,lc);break;case 5:Gf(l,Ps,lc);break;default:throw Error(n(329))}}}return Os(l,Cr()),l.callbackNode===_?Vy.bind(null,l):null}function Eg(l,f){var _=Fd;return l.current.memoizedState.isDehydrated&&($f(l,f).flags|=256),l=h1(l,f),l!==2&&(f=Ps,Ps=_,f!==null&&kg(f)),l}function kg(l){Ps===null?Ps=l:Ps.push.apply(Ps,l)}function M_(l){for(var f=l;;){if(f.flags&16384){var _=f.updateQueue;if(_!==null&&(_=_.stores,_!==null))for(var N=0;N<_.length;N++){var G=_[N],Z=G.getSnapshot;G=G.value;try{if(!Nr(Z(),G))return!1}catch{return!1}}}if(_=f.child,f.subtreeFlags&16384&&_!==null)_.return=f,f=_;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 rf(l,f){for(f&=~wg,f&=~o1,l.suspendedLanes|=f,l.pingedLanes&=~f,l=l.expirationTimes;0<f;){var _=31-wn(f),N=1<<_;l[_]=-1,f&=~N}}function Yy(l){if((cr&6)!==0)throw Error(n(327));Wh();var f=ls(l,0);if((f&1)===0)return Os(l,Cr()),null;var _=h1(l,f);if(l.tag!==0&&_===2){var N=Ba(l);N!==0&&(f=N,_=Eg(l,N))}if(_===1)throw _=Dd,$f(l,0),rf(l,f),Os(l,Cr()),_;if(_===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=f,Gf(l,Ps,lc),Os(l,Cr()),null}function Ag(l,f){var _=cr;cr|=1;try{return l(f)}finally{cr=_,cr===0&&(Gh=Cr()+500,Vl&&ne())}}function Hf(l){tf!==null&&tf.tag===0&&(cr&6)===0&&Wh();var f=cr;cr|=1;var _=kl.transition,N=jn;try{if(kl.transition=null,jn=1,l)return l()}finally{jn=N,kl.transition=_,cr=f,(cr&6)===0&&ne()}}function Pg(){tl=$h.current,rr($h)}function $f(l,f){l.finishedWork=null,l.finishedLanes=0;var _=l.timeoutHandle;if(_!==-1&&(l.timeoutHandle=-1,Uc(_)),Sa!==null)for(_=Sa.return;_!==null;){var N=_;switch(Ye(N),N.tag){case 1:N=N.type.childContextTypes,N!=null&&Au();break;case 3:mr(),rr(va),rr(Wi),xa();break;case 5:Js(N);break;case 4:mr();break;case 13:rr(vr);break;case 19:rr(vr);break;case 10:Tr(N.type._context);break;case 22:case 23:Pg()}_=_.return}if(to=l,Sa=l=af(l.current,null),ko=tl=f,Ia=0,Dd=null,wg=o1=Uf=0,Ps=Fd=null,ir!==null){for(f=0;f<ir.length;f++)if(_=ir[f],N=_.interleaved,N!==null){_.interleaved=null;var G=N.next,Z=_.pending;if(Z!==null){var de=Z.next;Z.next=G,N.next=de}_.pending=N}ir=null}return l}function Xy(l,f){do{var _=Sa;try{if(Yn(),Ou.current=Xc,bo){for(var N=ur.memoizedState;N!==null;){var G=N.queue;G!==null&&(G.pending=null),N=N.next}bo=!1}if(Yi=0,Xr=Yr=ur=null,jo=!1,wo=0,bg.current=null,_===null||_.return===null){Ia=1,Dd=f,Sa=null;break}e:{var Z=l,de=_.return,Ne=_,Fe=f;if(f=ko,Ne.flags|=32768,Fe!==null&&typeof Fe=="object"&&typeof Fe.then=="function"){var ot=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 Ut=C(de);if(Ut!==null){Ut.flags&=-257,q(Ut,de,Ne,Z,f),Ut.mode&1&&v(Z,ot,f),f=Ut,Fe=ot;var Xt=f.updateQueue;if(Xt===null){var Jt=new Set;Jt.add(Fe),f.updateQueue=Jt}else Xt.add(Fe);break e}else{if((f&1)===0){v(Z,ot,f),Og();break e}Fe=Error(n(426))}}else if(mt&&Ne.mode&1){var ia=C(de);if(ia!==null){(ia.flags&65536)===0&&(ia.flags|=256),q(ia,de,Ne,Z,f),kt(sc(Fe,Ne));break e}}Z=Fe=sc(Fe,Ne),Ia!==4&&(Ia=2),Fd===null?Fd=[Z]:Fd.push(Z),Z=de;do{switch(Z.tag){case 3:Z.flags|=65536,f&=-f,Z.lanes|=f;var et=n1(Z,Fe,f);ar(Z,et);break e;case 1:Ne=Fe;var Ge=Z.type,rt=Z.stateNode;if((Z.flags&128)===0&&(typeof Ge.getDerivedStateFromError=="function"||rt!==null&&typeof rt.componentDidCatch=="function"&&(ef===null||!ef.has(rt)))){Z.flags|=65536,f&=-f,Z.lanes|=f;var St=g(Z,Ne,f);ar(Z,St);break e}}Z=Z.return}while(Z!==null)}Qy(_)}catch(tn){f=tn,Sa===_&&_!==null&&(Sa=_=_.return);continue}break}while(!0)}function Ky(){var l=a1.current;return a1.current=Xc,l===null?Xc:l}function Og(){(Ia===0||Ia===3||Ia===2)&&(Ia=4),to===null||(Uf&268435455)===0&&(o1&268435455)===0||rf(to,ko)}function h1(l,f){var _=cr;cr|=2;var N=Ky();(to!==l||ko!==f)&&(lc=null,$f(l,f));do try{I_();break}catch(G){Xy(l,G)}while(!0);if(Yn(),cr=_,a1.current=N,Sa!==null)throw Error(n(261));return to=null,ko=0,Ia}function I_(){for(;Sa!==null;)Zy(Sa)}function j_(){for(;Sa!==null&&!hu();)Zy(Sa)}function Zy(l){var f=t5(l.alternate,l,tl);l.memoizedProps=l.pendingProps,f===null?Qy(l):Sa=f,bg.current=null}function Qy(l){var f=l;do{var _=f.alternate;if(l=f.return,(f.flags&32768)===0){if(_=O_(_,f,tl),_!==null){Sa=_;return}}else{if(_=C_(_,f),_!==null){_.flags&=32767,Sa=_;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,_){var N=jn,G=kl.transition;try{kl.transition=null,jn=1,D_(l,f,_,N)}finally{kl.transition=G,jn=N}return null}function D_(l,f,_,N){do Wh();while(tf!==null);if((cr&6)!==0)throw Error(n(327));_=l.finishedWork;var G=l.finishedLanes;if(_===null)return null;if(l.finishedWork=null,l.finishedLanes=0,_===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var Z=_.lanes|_.childLanes;if(us(l,Z),l===to&&(Sa=to=null,ko=0),(_.subtreeFlags&2064)===0&&(_.flags&2064)===0||l1||(l1=!0,n5(ss,function(){return Wh(),null})),Z=(_.flags&15990)!==0,(_.subtreeFlags&15990)!==0||Z){Z=kl.transition,kl.transition=null;var de=jn;jn=1;var Ne=cr;cr|=4,bg.current=null,N_(l,_),Uy(_,l),Ys(Gl),yu=!!nc,Gl=nc=null,l.current=_,T_(_),If(),cr=Ne,jn=de,kl.transition=Z}else l.current=_;if(l1&&(l1=!1,tf=l,u1=G),Z=l.pendingLanes,Z===0&&(ef=null),pr(_.stateNode),Os(l,Cr()),f!==null)for(N=l.onRecoverableError,_=0;_<f.length;_++)G=f[_],N(G.value,{componentStack:G.stack,digest:G.digest});if(s1)throw s1=!1,l=_g,_g=null,l;return(u1&1)!==0&&l.tag!==0&&Wh(),Z=l.pendingLanes,(Z&1)!==0?l===Sg?Bd++:(Bd=0,Sg=l):Bd=0,ne(),null}function Wh(){if(tf!==null){var l=cs(u1),f=kl.transition,_=jn;try{if(kl.transition=null,jn=16>l?16:l,tf===null)var N=!1;else{if(l=tf,tf=null,u1=0,(cr&6)!==0)throw Error(n(331));var G=cr;for(cr|=4,Vt=l.current;Vt!==null;){var Z=Vt,de=Z.child;if((Vt.flags&16)!==0){var Ne=Z.deletions;if(Ne!==null){for(var Fe=0;Fe<Ne.length;Fe++){var ot=Ne[Fe];for(Vt=ot;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,Ut=bt.return;if(Dy(bt),bt===ot){Vt=null;break}if(yt!==null){yt.return=Ut,Vt=yt;break}Vt=Ut}}}var Xt=Z.alternate;if(Xt!==null){var Jt=Xt.child;if(Jt!==null){Xt.child=null;do{var ia=Jt.sibling;Jt.sibling=null,Jt=ia}while(Jt!==null)}}Vt=Z}}if((Z.subtreeFlags&2064)!==0&&de!==null)de.return=Z,Vt=de;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;){de=Vt;var rt=de.child;if((de.subtreeFlags&2064)!==0&&rt!==null)rt.return=de,Vt=rt;else e:for(de=Ge;Vt!==null;){if(Ne=Vt,(Ne.flags&2048)!==0)try{switch(Ne.tag){case 0:case 11:case 15:i1(9,Ne)}}catch(tn){Xi(Ne,Ne.return,tn)}if(Ne===de){Vt=null;break e}var St=Ne.sibling;if(St!==null){St.return=Ne.return,Vt=St;break e}Vt=Ne.return}}if(cr=G,ne(),wi&&typeof wi.onPostCommitFiberRoot=="function")try{wi.onPostCommitFiberRoot(Po,l)}catch{}N=!0}return N}finally{jn=_,kl.transition=f}}return!1}function Jy(l,f,_){f=sc(_,f),f=n1(l,f,1),l=Vr(l,f,1),f=ns(),l!==null&&(Ml(l,1,f),Os(l,f))}function Xi(l,f,_){if(l.tag===3)Jy(l,l,_);else for(;f!==null;){if(f.tag===3){Jy(f,l,_);break}else if(f.tag===1){var N=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof N.componentDidCatch=="function"&&(ef===null||!ef.has(N))){l=sc(_,l),l=g(f,l,1),f=Vr(f,l,1),l=ns(),f!==null&&(Ml(f,1,l),Os(f,l));break}}f=f.return}}function F_(l,f,_){var N=l.pingCache;N!==null&&N.delete(f),f=ns(),l.pingedLanes|=l.suspendedLanes&_,to===l&&(ko&_)===_&&(Ia===4||Ia===3&&(ko&130023424)===ko&&500>Cr()-xg?$f(l,0):wg|=_),Os(l,f)}function e5(l,f){f===0&&((l.mode&1)===0?f=1:(f=Hi,Hi<<=1,(Hi&130023424)===0&&(Hi=4194304)));var _=ns();l=er(l,f),l!==null&&(Ml(l,f,_),Os(l,_))}function B_(l){var f=l.memoizedState,_=0;f!==null&&(_=f.retryLane),e5(l,_)}function z_(l,f){var _=0;switch(l.tag){case 13:var N=l.stateNode,G=l.memoizedState;G!==null&&(_=G.retryLane);break;case 19:N=l.stateNode;break;default:throw Error(n(314))}N!==null&&N.delete(f),e5(l,_)}var t5;t5=function(l,f,_){if(l!==null)if(l.memoizedProps!==f.pendingProps||va.current)ae=!0;else{if((l.lanes&_)===0&&(f.flags&128)===0)return ae=!1,dg(l,f,_);ae=(l.flags&131072)!==0}else ae=!1,mt&&(f.flags&1048576)!==0&&Ze(f,_e,f.index);switch(f.lanes=0,f.tag){case 2:var N=f.type;Vn(l,f),l=f.pendingProps;var G=Wl(f,Wi.current);Rr(f,_),G=Sl(null,f,N,l,G,_);var Z=xo();return f.flags|=1,typeof G=="object"&&G!==null&&typeof G.render=="function"&&G.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,ya(N)?(Z=!0,xs(f)):Z=!1,f.memoizedState=G.state!==null&&G.state!==void 0?G.state:null,ji(f),G.updater=Zc,f.stateNode=G,G._reactInternals=f,qh(f,N,l,_),f=xr(null,f,N,!0,Z,_)):(f.tag=0,mt&&Z&&dt(f),Ee(null,f,G,_),f=f.child),f;case 16:N=f.elementType;e:{switch(Vn(l,f),l=f.pendingProps,G=N._init,N=G(N._payload),f.type=N,G=f.tag=U_(N),l=Ma(N,l),G){case 0:f=Rt(null,f,N,l,_);break e;case 1:f=qr(null,f,N,l,_);break e;case 11:f=Ve(null,f,N,l,_);break e;case 14:f=lt(null,f,N,Ma(N.type,l),_);break e}throw Error(n(306,N,""))}return f;case 0:return N=f.type,G=f.pendingProps,G=f.elementType===N?G:Ma(N,G),Rt(l,f,N,G,_);case 1:return N=f.type,G=f.pendingProps,G=f.elementType===N?G:Ma(N,G),qr(l,f,N,G,_);case 3:e:{if(So(f),l===null)throw Error(n(387));N=f.pendingProps,Z=f.memoizedState,G=Z.element,ba(l,f),Vi(f,N,null,_);var de=f.memoizedState;if(N=de.element,Z.isDehydrated)if(Z={element:N,isDehydrated:!1,cache:de.cache,pendingSuspenseBoundaries:de.pendingSuspenseBoundaries,transitions:de.transitions},f.updateQueue.baseState=Z,f.memoizedState=Z,f.flags&256){G=sc(Error(n(423)),f),f=El(l,f,N,_,G);break e}else if(N!==G){G=sc(Error(n(424)),f),f=El(l,f,N,_,G);break e}else for(qe=Ji(f.stateNode.containerInfo.firstChild),ft=f,mt=!0,vt=null,_=Wn(f,null,N,_),f.child=_;_;)_.flags=_.flags&-3|4096,_=_.sibling;else{if(Bt(),N===G){f=eo(l,f,_);break e}Ee(l,f,N,_)}f=f.child}return f;case 5:return Pu(f),l===null&&qt(f),N=f.type,G=f.pendingProps,Z=l!==null?l.memoizedProps:null,de=G.children,Ff(N,G)?de=null:Z!==null&&Ff(N,Z)&&(f.flags|=32),kn(l,f),Ee(l,f,de,_),f.child;case 6:return l===null&&qt(f),null;case 13:return gt(l,f,_);case 4:return Jo(f,f.stateNode.containerInfo),N=f.pendingProps,l===null?f.child=gi(f,null,N,_):Ee(l,f,N,_),f.child;case 11:return N=f.type,G=f.pendingProps,G=f.elementType===N?G:Ma(N,G),Ve(l,f,N,G,_);case 7:return Ee(l,f,f.pendingProps,_),f.child;case 8:return Ee(l,f,f.pendingProps.children,_),f.child;case 12:return Ee(l,f,f.pendingProps.children,_),f.child;case 10:e:{if(N=f.type._context,G=f.pendingProps,Z=f.memoizedProps,de=G.value,lr(Pi,N._currentValue),N._currentValue=de,Z!==null)if(Nr(Z.value,de)){if(Z.children===G.children&&!va.current){f=eo(l,f,_);break e}}else for(Z=f.child,Z!==null&&(Z.return=f);Z!==null;){var Ne=Z.dependencies;if(Ne!==null){de=Z.child;for(var Fe=Ne.firstContext;Fe!==null;){if(Fe.context===N){if(Z.tag===1){Fe=ai(-1,_&-_),Fe.tag=2;var ot=Z.updateQueue;if(ot!==null){ot=ot.shared;var bt=ot.pending;bt===null?Fe.next=Fe:(Fe.next=bt.next,bt.next=Fe),ot.pending=Fe}}Z.lanes|=_,Fe=Z.alternate,Fe!==null&&(Fe.lanes|=_),Xn(Z.return,_,f),Ne.lanes|=_;break}Fe=Fe.next}}else if(Z.tag===10)de=Z.type===f.type?null:Z.child;else if(Z.tag===18){if(de=Z.return,de===null)throw Error(n(341));de.lanes|=_,Ne=de.alternate,Ne!==null&&(Ne.lanes|=_),Xn(de,_,f),de=Z.sibling}else de=Z.child;if(de!==null)de.return=Z;else for(de=Z;de!==null;){if(de===f){de=null;break}if(Z=de.sibling,Z!==null){Z.return=de.return,de=Z;break}de=de.return}Z=de}Ee(l,f,G.children,_),f=f.child}return f;case 9:return G=f.type,N=f.pendingProps.children,Rr(f,_),G=Mr(G),N=N(G),f.flags|=1,Ee(l,f,N,_),f.child;case 14:return N=f.type,G=Ma(N,f.pendingProps),G=Ma(N.type,G),lt(l,f,N,G,_);case 15:return _t(l,f,f.type,f.pendingProps,_);case 17:return N=f.type,G=f.pendingProps,G=f.elementType===N?G:Ma(N,G),Vn(l,f),f.tag=1,ya(N)?(l=!0,xs(f)):l=!1,Rr(f,_),t1(f,N,G),qh(f,N,G,_),xr(null,f,N,!0,l,_);case 19:return ra(l,f,_);case 22:return Gt(l,f,_)}throw Error(n(156,f.tag))};function n5(l,f){return Fs(l,f)}function q_(l,f,_,N){this.tag=l,this.key=_,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=N,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Al(l,f,_,N){return new q_(l,f,_,N)}function Cg(l){return l=l.prototype,!(!l||!l.isReactComponent)}function U_(l){if(typeof l=="function")return Cg(l)?1:0;if(l!=null){if(l=l.$$typeof,l===T)return 11;if(l===te)return 14}return 2}function af(l,f){var _=l.alternate;return _===null?(_=Al(l.tag,f,l.key,l.mode),_.elementType=l.elementType,_.type=l.type,_.stateNode=l.stateNode,_.alternate=l,l.alternate=_):(_.pendingProps=f,_.type=l.type,_.flags=0,_.subtreeFlags=0,_.deletions=null),_.flags=l.flags&14680064,_.childLanes=l.childLanes,_.lanes=l.lanes,_.child=l.child,_.memoizedProps=l.memoizedProps,_.memoizedState=l.memoizedState,_.updateQueue=l.updateQueue,f=l.dependencies,_.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},_.sibling=l.sibling,_.index=l.index,_.ref=l.ref,_}function d1(l,f,_,N,G,Z){var de=2;if(N=l,typeof l=="function")Cg(l)&&(de=1);else if(typeof l=="string")de=5;else e:switch(l){case O:return Wf(_.children,G,Z,f);case R:de=8,G|=8;break;case j:return l=Al(12,_,f,G|2),l.elementType=j,l.lanes=Z,l;case $:return l=Al(13,_,f,G),l.elementType=$,l.lanes=Z,l;case U:return l=Al(19,_,f,G),l.elementType=U,l.lanes=Z,l;case ee:return p1(_,G,Z,f);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case D:de=10;break e;case L:de=9;break e;case T:de=11;break e;case te:de=14;break e;case se:de=16,N=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return f=Al(de,_,f,G),f.elementType=l,f.type=N,f.lanes=Z,f}function Wf(l,f,_,N){return l=Al(7,l,N,f),l.lanes=_,l}function p1(l,f,_,N){return l=Al(22,l,N,f),l.elementType=ee,l.lanes=_,l.stateNode={isHidden:!1},l}function Lg(l,f,_){return l=Al(6,l,null,f),l.lanes=_,l}function Ng(l,f,_){return f=Al(4,l.children!==null?l.children:[],l.key,f),f.lanes=_,f.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},f}function H_(l,f,_,N,G){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=N,this.onRecoverableError=G,this.mutableSourceEagerHydrationData=null}function Tg(l,f,_,N,G,Z,de,Ne,Fe){return l=new H_(l,f,_,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:N,isDehydrated:_,cache:null,transitions:null,pendingSuspenseBoundaries:null},ji(Z),l}function $_(l,f,_){var N=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:N==null?null:""+N,children:l,containerInfo:f,implementation:_}}function r5(l){if(!l)return ws;l=l._reactInternals;e:{if(ci(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 _=l.type;if(ya(_))return ic(l,_,f)}return f}function i5(l,f,_,N,G,Z,de,Ne,Fe){return l=Tg(_,N,!0,l,G,Z,de,Ne,Fe),l.context=r5(null),_=l.current,N=ns(),G=nf(_),Z=ai(N,G),Z.callback=f??null,Vr(_,Z,G),l.current.lanes=G,Ml(l,G,N),Os(l,N),l}function g1(l,f,_,N){var G=f.current,Z=ns(),de=nf(G);return _=r5(_),f.context===null?f.context=_:f.pendingContext=_,f=ai(Z,de),f.payload={element:l},N=N===void 0?null:N,N!==null&&(f.callback=N),l=Vr(G,f,de),l!==null&&(Jl(l,G,de,Z),wa(l,G,de)),de}function m1(l){return l=l.current,l.child?(l.child.tag===5,l.child.stateNode):null}function a5(l,f){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var _=l.retryLane;l.retryLane=_!==0&&_<f?_:f}}function Rg(l,f){a5(l,f),(l=l.alternate)&&a5(l,f)}function G_(){return null}var o5=typeof reportError=="function"?reportError:function(l){console.error(l)};function Mg(l){this._internalRoot=l}v1.prototype.render=Mg.prototype.render=function(l){var f=this._internalRoot;if(f===null)throw Error(n(409));g1(l,f,null,null)},v1.prototype.unmount=Mg.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var f=l.containerInfo;Hf(function(){g1(null,l,null,null)}),f[ta]=null}};function v1(l){this._internalRoot=l}v1.prototype.unstable_scheduleHydration=function(l){if(l){var f=Tc();l={blockedOn:null,target:l,priority:f};for(var _=0;_<Co.length&&f!==0&&f<Co[_].priority;_++);Co.splice(_,0,l),_===0&&mu(l)}};function Ig(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 s5(){}function W_(l,f,_,N,G){if(G){if(typeof N=="function"){var Z=N;N=function(){var ot=m1(de);Z.call(ot)}}var de=i5(f,N,l,0,null,!1,!1,"",s5);return l._reactRootContainer=de,l[ta]=de.current,Ks(l.nodeType===8?l.parentNode:l),Hf(),de}for(;G=l.lastChild;)l.removeChild(G);if(typeof N=="function"){var Ne=N;N=function(){var ot=m1(Fe);Ne.call(ot)}}var Fe=Tg(l,0,!1,null,null,!1,!1,"",s5);return l._reactRootContainer=Fe,l[ta]=Fe.current,Ks(l.nodeType===8?l.parentNode:l),Hf(function(){g1(f,Fe,_,N)}),Fe}function b1(l,f,_,N,G){var Z=_._reactRootContainer;if(Z){var de=Z;if(typeof G=="function"){var Ne=G;G=function(){var Fe=m1(de);Ne.call(Fe)}}g1(f,de,l,G)}else de=W_(_,f,l,G,N);return m1(de)}Oo=function(l){switch(l.tag){case 3:var f=l.stateNode;if(f.current.memoizedState.isDehydrated){var _=Hr(f.pendingLanes);_!==0&&(gu(f,_|1),Os(f,Cr()),(cr&6)===0&&(Gh=Cr()+500,ne()))}break;case 13:Hf(function(){var N=er(l,1);if(N!==null){var G=ns();Jl(N,l,1,G)}}),Rg(l,1)}},dl=function(l){if(l.tag===13){var f=er(l,134217728);if(f!==null){var _=ns();Jl(f,l,134217728,_)}Rg(l,134217728)}},Nc=function(l){if(l.tag===13){var f=nf(l),_=er(l,f);if(_!==null){var N=ns();Jl(_,l,f,N)}Rg(l,f)}},Tc=function(){return jn},pl=function(l,f){var _=jn;try{return jn=l,f()}finally{jn=_}},Nt=function(l,f,_){switch(f){case"input":if(ke(l,_),f=_.name,_.type==="radio"&&f!=null){for(_=l;_.parentNode;)_=_.parentNode;for(_=_.querySelectorAll("input[name="+JSON.stringify(""+f)+'][type="radio"]'),f=0;f<_.length;f++){var N=_[f];if(N!==l&&N.form===l.form){var G=Mi(N);if(!G)throw Error(n(90));Ue(N),ke(N,G)}}}break;case"textarea":xe(l,_);break;case"select":f=_.value,f!=null&&Me(l,!!_.multiple,f,!1)}},Ur=Ag,hr=Hf;var V_={usingClientEntryPoint:!1,Events:[ku,ki,Mi,hn,ui,Ag]},zd={findFiberByHostInstance:Qs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Y_={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=qi(l),l===null?null:l.stateNode},findFiberByHostInstance:zd.findFiberByHostInstance||G_,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(Y_),wi=w1}catch{}}return Cs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V_,Cs.createPortal=function(l,f){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ig(f))throw Error(n(200));return $_(l,f,null,_)},Cs.createRoot=function(l,f){if(!Ig(l))throw Error(n(299));var _=!1,N="",G=o5;return f!=null&&(f.unstable_strictMode===!0&&(_=!0),f.identifierPrefix!==void 0&&(N=f.identifierPrefix),f.onRecoverableError!==void 0&&(G=f.onRecoverableError)),f=Tg(l,1,!1,null,null,_,!1,N,G),l[ta]=f.current,Ks(l.nodeType===8?l.parentNode:l),new Mg(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=qi(f),l=l===null?null:l.stateNode,l},Cs.flushSync=function(l){return Hf(l)},Cs.hydrate=function(l,f,_){if(!y1(f))throw Error(n(200));return b1(null,l,f,!0,_)},Cs.hydrateRoot=function(l,f,_){if(!Ig(l))throw Error(n(405));var N=_!=null&&_.hydratedSources||null,G=!1,Z="",de=o5;if(_!=null&&(_.unstable_strictMode===!0&&(G=!0),_.identifierPrefix!==void 0&&(Z=_.identifierPrefix),_.onRecoverableError!==void 0&&(de=_.onRecoverableError)),f=i5(f,null,l,1,_??null,G,!1,Z,de),l[ta]=f.current,Ks(l),N)for(l=0;l<N.length;l++)_=N[l],G=_._getVersion,G=G(_._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[_,G]:f.mutableSourceEagerHydrationData.push(_,G);return new v1(f)},Cs.render=function(l,f,_){if(!y1(f))throw Error(n(200));return b1(null,l,f,!1,_)},Cs.unmountComponentAtNode=function(l){if(!y1(l))throw Error(n(40));return l._reactRootContainer?(Hf(function(){b1(null,null,l,!1,function(){l._reactRootContainer=null,l[ta]=null})}),!0):!1},Cs.unstable_batchedUpdates=Ag,Cs.unstable_renderSubtreeIntoContainer=function(l,f,_,N){if(!y1(_))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return b1(l,f,_,!1,N)},Cs.version="18.3.1-next-f1338f8080-20240426",Cs}var p5;function l6(){if(p5)return Dg.exports;p5=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(),Dg.exports=t9(),Dg.exports}var g5;function n9(){if(g5)return x1;g5=1;var e=l6();return x1.createRoot=e.createRoot,x1.hydrateRoot=e.hydrateRoot,x1}var r9=n9();const u6=yh(r9);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 i9={};function B0(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:i9}var c6=Object.assign,g0=Object.getOwnPropertyDescriptor,Bu=Object.defineProperty,z0=Object.prototype,Zm=[];Object.freeze(Zm);var $v={};Object.freeze($v);var a9=typeof Proxy<"u",o9=Object.toString();function f6(){a9||zn("Proxy not available")}function h6(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 q0(e){return e!==null&&typeof e=="object"}function wf(e){if(!q0(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()===o9}function d6(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function U0(e,t,n){Bu(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function p6(e,t,n){Bu(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 q0(r)&&r[n]===!0}}function _d(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function s9(e){var t=Object.getPrototypeOf(e),n=Object.getPrototypeOf(t),r=Object.getPrototypeOf(n);return r===null}function mc(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var g6=typeof Object.getOwnPropertySymbols<"u";function l9(e){var t=Object.keys(e);if(!g6)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter(function(r){return z0.propertyIsEnumerable.call(e,r)})):t}var H0=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:g6?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function m6(e){return e===null?null:typeof e=="object"?""+e:e}function xc(e,t){return z0.hasOwnProperty.call(e,t)}var u9=Object.getOwnPropertyDescriptors||function(t){var n={};return H0(t).forEach(function(r){n[r]=g0(t,r)}),n};function al(e,t){return!!(e&t)}function ol(e,t,n){return n?e|=t:e&=~t,e}function m5(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 c9(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,h9(r.key),r)}}function Sd(e,t,n){return t&&c9(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=d9(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 v6(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Qm(e,t)}function Qm(e,t){return Qm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Qm(e,t)}function f9(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 h9(e){var t=f9(e,"string");return typeof t=="symbol"?t:t+""}function d9(e,t){if(e){if(typeof e=="string")return m5(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)?m5(e,t):void 0}}var ju=Symbol("mobx-stored-annotations");function zu(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){xc(e,ju)||U0(e,ju,xf({},e[ju])),w9(n)||(e[ju][t]=n)}function p9(e){return xc(e,ju)||U0(e,ju,xf({},e[ju])),e[ju]}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 M6(this)},t.reportChanged=function(){Ns(),I6(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 Gv=kf("Atom",Af);function m0(e,t,n){t===void 0&&(t=nd),n===void 0&&(n=nd);var r=new Af(e);return t!==nd&&SS(r,t),n!==nd&&H6(r,n),r}function g9(e,t){return o8(e,t)}function m9(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var pd={structural:g9,default:m9};function fh(e,t,n){return Y6(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}):mc(e)?Qn.set(e,{name:n}):typeof e=="function"&&!gd(e)&&!_p(e)?d6(e)?md(e):xp(n,e):e}function v9(e,t,n){if(e==null||su(e)||Yu(e)||Rl(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(mc(e))return Qn.set(e,{name:n,deep:!1})}function $0(e){return e}function y9(e,t){return o8(e,t)?t:e}var b9="override";function w9(e){return e.annotationType_===b9}function Dp(e,t){return{annotationType_:e,options_:t,make_:x9,extend_:_9,decorate_20223_:S9}}function x9(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=y6(e,this,t,n,!1);return Bu(r,t,a),2}function _9(e,t,n,r){var i=y6(e,this,t,n);return e.defineProperty_(t,i,r)}function S9(e,t){var n=t.kind,r=t.name,i=t.addInitializer,a=this,o=function(h){var c,p,m,d;return _f((c=(p=a.options_)==null?void 0:p.name)!=null?c:r.toString(),h,(m=(d=a.options_)==null?void 0:d.autoAction)!=null?m:!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 E9(e,t,n,r){t.annotationType_,r.value}function y6(e,t,n,r,i){var a,o,s,u,h,c,p;i===void 0&&(i=Lt.safeDescriptors),E9(e,t,n,r);var m=r.value;if((a=t.options_)!=null&&a.bound){var d;m=m.bind((d=e.proxy_)!=null?d:e.target_)}return{value:_f((o=(s=t.options_)==null?void 0:s.name)!=null?o:n.toString(),m,(u=(h=t.options_)==null?void 0:h.autoAction)!=null?u:!1,(c=t.options_)!=null&&c.bound?(p=e.proxy_)!=null?p:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function b6(e,t){return{annotationType_:e,options_:t,make_:k9,extend_:A9,decorate_20223_:P9}}function k9(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&&(!xc(e.target_,t)||!_p(e.target_[t]))&&this.extend_(e,t,n,!1)===null)return 0;if(_p(n.value))return 1;var a=w6(e,this,t,n,!1,!1);return Bu(r,t,a),2}function A9(e,t,n,r){var i,a=w6(e,this,t,n,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,a,r)}function P9(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 O9(e,t,n,r){t.annotationType_,r.value}function w6(e,t,n,r,i,a){a===void 0&&(a=Lt.safeDescriptors),O9(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 Wv(e,t){return{annotationType_:e,options_:t,make_:C9,extend_:L9,decorate_20223_:N9}}function C9(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function L9(e,t,n,r){return T9(e,this,t,n),e.defineComputedProperty_(t,xf({},this.options_,{get:n.get,set:n.set}),r)}function N9(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 iu(o))}),function(){return this[bn].getObservablePropValue_(r)}}function T9(e,t,n,r){t.annotationType_,r.get}function G0(e,t){return{annotationType_:e,options_:t,make_:R9,extend_:M9,decorate_20223_:I9}}function R9(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function M9(e,t,n,r){var i,a;return j9(e,this),e.defineObservableProperty_(t,n.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:fh,r)}function I9(e,t){var n=this,r=t.kind,i=t.name,a=new WeakSet;function o(s,u){var h,c,p=Ed(s)[bn],m=new bf(u,(h=(c=n.options_)==null?void 0:c.enhancer)!=null?h:fh,"ObservableObject."+i.toString(),!1);p.values_.set(i,m),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 j9(e,t,n,r){t.annotationType_}var D9="true",F9=x6();function x6(e){return{annotationType_:D9,options_:e,make_:B9,extend_:z9,decorate_20223_:q9}}function B9(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:Lt.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(Bu(r,t,{configurable:!0,set:o}),2)}if(r!==e.target_&&typeof n.value=="function"){var s;if(d6(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 p=((i=this.options_)==null?void 0:i.deep)===!1?Qn.ref:Qn;if(typeof n.value=="function"&&(a=this.options_)!=null&&a.autoBind){var m;n.value=n.value.bind((m=e.proxy_)!=null?m:e.target_)}return p.make_(e,t,n,r)}function z9(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:Lt.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 q9(e,t){zn("'"+this.annotationType_+"' cannot be used as a decorator")}var U9="observable",H9="observable.ref",$9="observable.shallow",G9="observable.struct",_6={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(_6);function _1(e){return e||_6}var Jm=G0(U9),W9=G0(H9,{enhancer:$0}),V9=G0($9,{enhancer:v9}),Y9=G0(G9,{enhancer:y9}),S6=zu(Jm);function S1(e){return e.deep===!0?fh:e.deep===!1?$0:K9(e.defaultDecorator)}function X9(e){var t;return e?(t=e.defaultDecorator)!=null?t:x6(e):void 0}function K9(e){var t,n;return e&&(t=(n=e.options_)==null?void 0:n.enhancer)!=null?t:fh}function E6(e,t,n){if(jp(t))return Jm.decorate_20223_(e,t);if(ch(t)){Ip(e,t,Jm);return}return Y6(e)?e:wf(e)?Qn.object(e,t,n):Array.isArray(e)?Qn.array(e,t):_d(e)?Qn.map(e,t):mc(e)?Qn.set(e,t):typeof e=="object"&&e!==null?e:Qn.box(e,t)}c6(E6,S6);var Z9={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(Lt.useProxies===!1||r.proxy===!1?JS:HS)(t,S1(r),r.name)},map:function(t,n){var r=_1(n);return new Zv(t,S1(r),r.name)},set:function(t,n){var r=_1(n);return new t8(t,S1(r),r.name)},object:function(t,n,r){return xh(function(){return PS(Lt.useProxies===!1||r?.proxy===!1?Ed({},r):zS({},r),t,n)})},ref:zu(W9),shallow:zu(V9),deep:S6,struct:zu(Y9)},Qn=c6(E6,Z9),k6="computed",Q9="computed.struct",ev=Wv(k6),J9=Wv(Q9,{equals:pd.structural}),bh=function(t,n){if(jp(n))return ev.decorate_20223_(t,n);if(ch(n))return Ip(t,n,ev);if(wf(t))return zu(Wv(k6,t));var r=wf(n)?n:{};return r.get=t,r.name||(r.name=t.name||""),new iu(r)};Object.assign(bh,ev);bh.struct=zu(J9);var v5,y5,v0=0,eS=1,tS=(v5=(y5=g0(function(){},"name"))==null?void 0:y5.configurable)!=null?v5:!1,b5={value:"action",configurable:!0,writable:!1,enumerable:!1};function _f(e,t,n,r){n===void 0&&(n=!1);function i(){return A6(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},tS&&(b5.value=e,Bu(i,"name",b5)),i}function A6(e,t,n,r,i){var a=nS(e,t);try{return n.apply(r,i)}catch(o){throw a.error_=o,o}finally{rS(a)}}function nS(e,t,n,r){var i=!1,a=0,o=Lt.trackingDerivation,s=!t||!o;Ns();var u=Lt.allowStateChanges;s&&(wh(),u=W0(!0));var h=Vv(!0),c={runAsAction_:s,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:h,notifySpy_:i,startTime_:a,actionId_:eS++,parentActionId_:v0};return v0=c.actionId_,c}function rS(e){v0!==e.actionId_&&zn(30),v0=e.parentActionId_,e.error_!==void 0&&(Lt.suppressReactionErrors=!0),V0(e.prevAllowStateChanges_),sp(e.prevAllowStateReads_),Ts(),e.runAsAction_&&_c(e.prevDerivation_),Lt.suppressReactionErrors=!1}function P6(e,t){var n=W0(e);try{return t()}finally{V0(n)}}function W0(e){var t=Lt.allowStateChanges;return Lt.allowStateChanges=e,t}function V0(e){Lt.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}v6(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!==Lt.UNCHANGED&&this.setNewValue_(i)},n.prepareNewValue_=function(i){if(Pl(this)){var a=Ol(this,{object:this,type:qu,newValue:i});if(!a)return Lt.UNCHANGED;i=a.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?Lt.UNCHANGED:i},n.setNewValue_=function(i){var a=this.value_;this.value_=i,this.reportChanged(),nu(this)&&ru(this,{type:qu,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:qu,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 m6(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},t})(Af),iS=kf("ObservableValue",bf),iu=(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 b0(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=y0.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(){cS(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),Lt.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)tv(this)&&(this.warnAboutUntrackedRead_(),Ns(),this.value_=this.computeValue_(!1),Ts());else if(M6(this),tv(this)){var r=Lt.trackingContext;this.keepAlive_&&!r&&(Lt.trackingContext=this),this.trackAndCompute()&&uS(this),Lt.trackingContext=r}var i=this.value_;if(J1(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||J1(r)||J1(a)||!this.equals_(r,a);return o&&(this.value_=a),o},t.computeValue_=function(r){this.isComputing=!0;var i=W0(!1),a;if(r)a=O6(this,this.derivation,this.scope_);else if(Lt.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(o){a=new b0(o)}return V0(i),this.isComputing=!1,a},t.suspend_=function(){this.keepAlive_||(nv(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:qu,object:a,newValue:u,oldValue:s}),_c(h)}o=!1,s=u})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return m6(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)}}])})();iu.isComputingMask_=1;iu.isRunningSetterMask_=2;iu.isBeingObservedMask_=4;iu.isPendingUnobservationMask_=8;iu.diffValueMask_=16;var Y0=kf("ComputedValue",iu),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 y0;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(y0||(y0={}));var b0=function(t){this.cause=void 0,this.cause=t};function J1(e){return e instanceof b0}function tv(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=Vv(!0),n=wh(),r=e.observing_,i=r.length,a=0;a<i;a++){var o=r[a];if(Y0(o)){if(Lt.disableErrorBoundaries)o.get();else try{o.get()}catch{return _c(n),sp(t),!0}if(e.dependenciesState_===br.STALE_)return _c(n),sp(t),!0}}return L6(e),_c(n),sp(t),!1}}}function O6(e,t,n){var r=Vv(!0);L6(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++Lt.runId;var i=Lt.trackingDerivation;Lt.trackingDerivation=e,Lt.inBatch++;var a;if(Lt.disableErrorBoundaries===!0)a=t.call(n);else try{a=t.call(n)}catch(o){a=new b0(o)}return Lt.inBatch--,Lt.trackingDerivation=i,aS(e),sp(r),a}function aS(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&&T6(u,e),u.diffValue=0}for(;i--;){var h=n[i];h.diffValue===1&&(h.diffValue=0,lS(h,e))}r!==br.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function nv(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)T6(t[n],e);e.dependenciesState_=br.NOT_TRACKING_}function C6(e){var t=wh();try{return e()}finally{_c(t)}}function wh(){var e=Lt.trackingDerivation;return Lt.trackingDerivation=null,e}function _c(e){Lt.trackingDerivation=e}function Vv(e){var t=Lt.allowStateReads;return Lt.allowStateReads=e,t}function sp(e){Lt.allowStateReads=e}function L6(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 e0=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},t0=!0,N6=!1,Lt=(function(){var e=B0();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(t0=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new e0().version&&(t0=!1),t0?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new e0):(setTimeout(function(){N6||zn(35)},1),new e0)})();function oS(){if((Lt.pendingReactions.length||Lt.inBatch||Lt.isRunningReactions)&&zn(36),N6=!0,t0){var e=B0();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Lt=new e0}}function sS(){return Lt}function lS(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function T6(e,t){e.observers_.delete(t),e.observers_.size===0&&R6(e)}function R6(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,Lt.pendingUnobservations.push(e))}function Ns(){Lt.inBatch++}function Ts(){if(--Lt.inBatch===0){j6();for(var e=Lt.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 iu&&n.suspend_())}Lt.pendingUnobservations=[]}}function M6(e){var t=Lt.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&Lt.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&Lt.inBatch>0&&R6(e),!1)}function I6(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 uS(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 cS(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 Hu=(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_=y0.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,Lt.pendingReactions.push(this),j6())},t.runReaction_=function(){if(!this.isDisposed){Ns(),this.isScheduled=!1;var r=Lt.trackingContext;if(Lt.trackingContext=this,tv(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}Lt.trackingContext=r,Ts()}},t.track=function(r){if(!this.isDisposed){Ns(),this.isRunning=!0;var i=Lt.trackingContext;Lt.trackingContext=this;var a=O6(this,r,void 0);Lt.trackingContext=i,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&nv(this),J1(a)&&this.reportExceptionInDerivation_(a.cause),Ts()}},t.reportExceptionInDerivation_=function(r){var i=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(Lt.disableErrorBoundaries)throw r;var a="[mobx] uncaught error in '"+this+"'";Lt.suppressReactionErrors||console.error(a,r),Lt.globalReactionErrorHandlers.forEach(function(o){return o(r,i)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Ns(),nv(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)}}])})();Hu.isDisposedMask_=1;Hu.isScheduledMask_=2;Hu.isTrackPendingMask_=4;Hu.isRunningMask_=8;Hu.diffValueMask_=16;var fS=100,rv=function(t){return t()};function j6(){Lt.inBatch>0||Lt.isRunningReactions||rv(hS)}function hS(){Lt.isRunningReactions=!0;for(var e=Lt.pendingReactions,t=0;e.length>0;){++t===fS&&(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_()}Lt.isRunningReactions=!1}var w0=kf("Reaction",Hu);function dS(e){var t=rv;rv=function(r){return e(function(){return t(r)})}}function lp(){return!1}function pS(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var D6="action",gS="action.bound",F6="autoAction",mS="autoAction.bound",B6="<unnamed action>",iv=Dp(D6),vS=Dp(gS,{bound:!0}),av=Dp(F6,{autoAction:!0}),yS=Dp(mS,{autoAction:!0,bound:!0});function z6(e){var t=function(r,i){if(cl(r))return _f(r.name||B6,r,e);if(cl(i))return _f(r,i,e);if(jp(i))return(e?av:iv).decorate_20223_(r,i);if(ch(i))return Ip(r,i,e?av:iv);if(ch(r))return zu(Dp(e?F6:D6,{name:r,autoAction:e}))};return t}var qn=z6(!1);Object.assign(qn,iv);var xp=z6(!0);Object.assign(xp,av);qn.bound=zu(vS);xp.bound=zu(yS);function vc(e){return A6(e.name||B6,!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 Hu(o,function(){this.track(p)},t.onError,t.requiresObservable);else{var h=q6(t),c=!1;u=new Hu(o,function(){c||(c=!0,h(function(){c=!1,u.isDisposed||u.track(p)}))},t.onError,t.requiresObservable)}function p(){e(u)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||u.schedule_(),u.getDisposer_((a=t)==null?void 0:a.signal)}var bS=function(t){return t()};function q6(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:bS}function U6(e,t,n){var r,i,a;n===void 0&&(n=$v);var o=(r=n.name)!=null?r:"Reaction",s=qn(o,n.onError?wS(n.onError,t):t),u=!n.scheduler&&!n.delay,h=q6(n),c=!0,p=!1,m,d=n.compareStructural?pd.structural:n.equals||pd.default,y=new Hu(o,function(){c||u?w():p||(p=!0,h(w))},n.onError,n.requiresObservable);function w(){if(p=!1,!y.isDisposed){var x=!1,b=m;y.track(function(){var S=P6(!1,function(){return e(y)});x=c||!d(m,S),m=S}),(c&&n.fireImmediately||!c&&x)&&s(m,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 wS(e,t){return function(){try{return t.apply(this,arguments)}catch(n){e.call(this,n)}}}var xS="onBO",_S="onBUO";function SS(e,t,n){return $6(xS,e,t,n)}function H6(e,t,n){return $6(_S,e,t,n)}function $6(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 ES="never",E1="always",kS="observed";function AS(e){e.isolateGlobalState===!0&&oS();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&(Lt.useProxies=t===E1?!0:t===ES?!1:typeof Proxy<"u"),t==="ifavailable"&&(Lt.verifyProxies=!0),n!==void 0){var r=n===E1?E1:n===kS;Lt.enforceActions=r,Lt.allowStateChanges=!(r===!0||r===E1)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(Lt[i]=!!e[i])}),Lt.allowStateReads=!Lt.observableRequiresReaction,e.reactionScheduler&&dS(e.reactionScheduler)}function PS(e,t,n,r){var i=u9(t);return xh(function(){var a=Ed(e,r)[bn];H0(i).forEach(function(o){a.extend_(o,i[o],n&&o in n?n[o]:!0)})}),e}function OS(e,t){return G6(vd(e,t))}function G6(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=CS(e.observing_).map(G6)),t}function CS(e){return Array.from(new Set(e))}var LS=0;function W6(){this.message="FLOW_CANCELLED"}W6.prototype=Object.create(Error.prototype);var zg=b6("flow"),NS=b6("flow.bound",{bound:!0}),md=Object.assign(function(t,n){if(jp(n))return zg.decorate_20223_(t,n);if(ch(n))return Ip(t,n,zg);var r=t,i=r.name||"<unnamed flow>",a=function(){var s=this,u=arguments,h=++LS,c=qn(i+" - runid: "+h+" - init",r).apply(s,u),p,m=void 0,d=new Promise(function(y,w){var x=0;p=w;function b(E){m=void 0;var A;try{A=qn(i+" - runid: "+h+" - yield "+x++,c.next).call(c,E)}catch(M){return w(M)}k(A)}function S(E){m=void 0;var A;try{A=qn(i+" - runid: "+h+" - yield "+x++,c.throw).call(c,E)}catch(M){return w(M)}k(A)}function k(E){if(cl(E?.then)){E.then(k,w);return}return E.done?y(E.value):(m=Promise.resolve(E.value),m.then(b,S))}b(void 0)});return d.cancel=qn(i+" - runid: "+h+" - cancel",function(){try{m&&w5(m);var y=c.return(void 0),w=Promise.resolve(y.value);w.then(nd,nd),w5(w),p(new W6)}catch(x){p(x)}}),d};return a.isMobXFlow=!0,a},zg);md.bound=zu(NS);function w5(e){cl(e.cancel)&&e.cancel()}function _p(e){return e?.isMobXFlow===!0}function V6(e,t,n){var r;return Rl(e)||Yu(e)||iS(e)?r=Gu(e):su(e)&&(r=Gu(e,t)),r.dehancer=typeof t=="function"?t:n,function(){r.dehancer=void 0}}function Yv(e,t,n){return cl(n)?RS(e,t,n):TS(e,t)}function TS(e,t){return Gu(e).intercept_(t)}function RS(e,t,n){return Gu(e,t).intercept_(n)}function MS(e,t){return e?su(e)||!!e[bn]||Gv(e)||w0(e)||Y0(e):!1}function Y6(e){return MS(e)}function x0(e){if(su(e))return e[bn].keys_();if(Rl(e)||is(e))return Array.from(e.keys());if(Yu(e))return e.map(function(t,n){return n});zn(5)}function X6(e){if(su(e))return x0(e).map(function(t){return e[t]});if(Rl(e))return x0(e).map(function(t){return e.get(t)});if(is(e))return Array.from(e.values());if(Yu(e))return e.slice();zn(6)}function IS(e){if(su(e))return x0(e).map(function(t){return[t,e[t]]});if(Rl(e))return x0(e).map(function(t){return[t,e.get(t)]});if(is(e))return Array.from(e.entries());if(Yu(e))return e.map(function(t,n){return[n,t]});zn(7)}function K6(e,t,n){if(arguments.length===2&&!is(e)){Ns();var r=t;try{for(var i in r)K6(e,i,r[i])}finally{Ts()}return}su(e)?e[bn].set_(t,n):Rl(e)?e.set(t,n):is(e)?e.add(t):Yu(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 Z6(e,t,n){if(su(e))return e[bn].defineProperty_(t,n);zn(39)}function Xv(e,t,n,r){return cl(n)?DS(e,t,n,r):jS(e,t,n)}function jS(e,t,n){return Gu(e).observe_(t,n)}function DS(e,t,n,r){return Gu(e,t).observe_(n,r)}function yc(e,t){t===void 0&&(t=void 0),Ns();try{return e.apply(t)}finally{Ts()}}function x5(e,t,n){return arguments.length===1||t&&typeof t=="object"?FS(e,t):Q6(e,t,{})}function Q6(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=P6(!1,e);u&&(s.dispose(),r&&clearTimeout(r),a())},n);return o}function FS(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=Q6(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 BS={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 zS(e,t){var n,r;return f6(),e=Ed(e,t),(r=(n=e[bn]).proxy_)!=null?r:n.proxy_=new Proxy(e,BS)}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),h6(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{_c(n)}}function nu(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Bp(e,t){var n=e.changeListeners_||(e.changeListeners_=[]);return n.push(t),h6(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function ru(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);_c(n)}}function J6(e,t,n){return xh(function(){var r,i=Ed(e,n)[bn];(r=t)!=null||(t=p9(e)),H0(t).forEach(function(a){return i.make_(a,t[a])})}),e}var _5="splice",qu="update",qS=1e4,US={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)):xc(_0,n)?_0[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)}},Kv=(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&&a8(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=Zm),Pl(this)){var u=Ol(this,{object:this.proxy_,type:_5,index:r,removedCount:i,added:a});if(!u)return Zm;i=u.removedCount,a=u.added}if(a=a.length===0?a:a.map(function(p){return o.enhancer_(p,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<qS){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=nu(this),u=s||o?{observableKind:"array",object:this.proxy_,type:qu,debugObjectName:this.atom_.name_,index:r,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),s&&ru(this,u)},t.notifyArraySplice_=function(r,i,a){var o=!this.owned_&&lp(),s=nu(this),u=s||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:_5,index:r,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),s&&ru(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:qu,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 HS(e,t,n,r){return n===void 0&&(n="ObservableArray"),r===void 0&&(r=!1),f6(),xh(function(){var i=new Kv(n,t,r,!1);p6(i.values_,bn,i);var a=new Proxy(i.values_,US);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}var _0={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 Lt.trackingDerivation&&zn(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Lt.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",ou);si("filter",ou);si("find",ou);si("findIndex",ou);si("findLast",ou);si("findLastIndex",ou);si("flatMap",ou);si("forEach",ou);si("map",ou);si("some",ou);si("toReversed",ou);si("reduce",e8);si("reduceRight",e8);function si(e,t){typeof Array.prototype[e]=="function"&&(_0[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 ou(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 e8(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 $S=kf("ObservableArrayAdministration",Kv);function Yu(e){return q0(e)&&$S(e[bn])}var GS={},mf="add",S0="delete",Zv=(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]=GS,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_=m0("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(!Lt.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),H6(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?qu: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:S0,object:this,name:r});if(!a)return!1}if(this.has_(r)){var o=lp(),s=nu(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:S0,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return yc(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&&ru(this,u),!0}return!1},t.updateValue_=function(r,i){var a=this.data_.get(r);if(i=a.prepareNewValue_(i),i!==Lt.UNCHANGED){var o=lp(),s=nu(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:qu,object:this,oldValue:a.value_,name:r,newValue:i}:null;a.setNewValue_(i),s&&ru(this,u)}},t.addValue_=function(r,i){var a=this;this.keysAtom_,yc(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=nu(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:mf,object:this,name:r,newValue:i}:null;s&&ru(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 S5({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 S5({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 Rl(r)&&(r=new Map(r)),yc(function(){wf(r)?l9(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)?(s9(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;yc(function(){C6(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 yc(function(){for(var a=WS(r),o=new Map,s=!1,u=rd(i.data_.keys()),h;!(h=u()).done;){var c=h.value;if(!a.has(c)){var p=i.delete(c);if(p)s=!0;else{var m=i.data_.get(c);o.set(c,m)}}}for(var d=rd(a.entries()),y;!(y=d()).done;){var w=y.value,x=w[0],b=w[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(),M=E.next(),O=A.next();!M.done;){if(M.value!==O.value){i.keysAtom_.reportChanged();break}M=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"}}])})(),Rl=kf("ObservableMap",Zv);function S5(e){return e[Symbol.toStringTag]="MapIterator",Jv(e)}function WS(e){if(_d(e)||Rl(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 VS={},t8=(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]=VS,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_=m0(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;yc(function(){C6(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)){yc(function(){i.data_.add(i.enhancer_(r,void 0)),i.atom_.reportChanged()});var o=!1,s=nu(this),u=s||o?{observableKind:"set",debugObjectName:this.name_,type:mf,object:this,newValue:r}:null;s&&ru(this,u)}return this},t.delete=function(r){var i=this;if(Pl(this)){var a=Ol(this,{type:S0,object:this,oldValue:r});if(!a)return!1}if(this.has(r)){var o=!1,s=nu(this),u=s||o?{observableKind:"set",debugObjectName:this.name_,type:S0,object:this,oldValue:r}:null;return yc(function(){i.atom_.reportChanged(),i.data_.delete(r)}),s&&ru(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 E5({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 E5({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(mc(r)&&!is(r))return r.intersection(this);var i=new Set(this);return i.intersection(r)},t.union=function(r){if(mc(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(mc(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(mc(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)),yc(function(){Array.isArray(r)?(i.clear(),r.forEach(function(a){return i.add(a)})):mc(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",t8);function E5(e){return e[Symbol.toStringTag]="SetIterator",Jv(e)}var k5=Object.create(null),A5="remove",n8=(function(){function e(n,r,i,a){r===void 0&&(r=new Map),a===void 0&&(a=F9),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 iu)return a.set(i),!0;if(Pl(this)){var o=Ol(this,{type:qu,object:this.proxy_||this.target_,name:r,newValue:i});if(!o)return null;i=o.newValue}if(i=a.prepareNewValue_(i),i!==Lt.UNCHANGED){var s=nu(this),u=!1,h=s||u?{type:qu,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:r,newValue:i}:null;a.setNewValue_(i),s&&ru(this,h)}return!0},t.get_=function(r){return Lt.trackingDerivation&&!xc(this.target_,r)&&this.has_(r),this.target_[r]},t.set_=function(r,i,a){return a===void 0&&(a=!1),xc(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(!Lt.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_[ju])!=null&&a[r])return;zn(1,i.annotationType_,this.name_+"."+r.toString())}for(var o=this.target_;o&&o!==z0;){var s=g0(o,r);if(s){var u=i.make_(this,r,s,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}O5(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&&O5(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 Bu(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=P5(r),c={configurable:Lt.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:h.get,set:h.set};if(o){if(!Reflect.defineProperty(this.target_,r,c))return!1}else Bu(this.target_,r,c);var p=new bf(i,a,"ObservableObject.key",!1);this.values_.set(r,p),this.notifyPropertyAddition_(r,p.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=P5(r),h={configurable:Lt.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:u.get,set:u.set};if(a){if(!Reflect.defineProperty(this.target_,r,h))return!1}else Bu(this.target_,r,h);this.values_.set(r,new iu(i)),this.notifyPropertyAddition_(r,void 0)}finally{Ts()}return!0},t.delete_=function(r,i){if(i===void 0&&(i=!1),this.keysAtom_,!xc(this.target_,r))return!0;if(Pl(this)){var a=Ol(this,{object:this.proxy_||this.target_,name:r,type:A5});if(!a)return null}try{var o;Ns();var s=nu(this),u=!1,h=this.values_.get(r),c=void 0;if(!h&&(s||u)){var p;c=(p=g0(this.target_,r))==null?void 0:p.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_),I6(h)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(r))==null||o.set(r in this.target_),s||u){var m={type:A5,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:c,name:r};s&&ru(this,m)}}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=nu(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&&ru(this,u)}(a=this.pendingKeys_)==null||(a=a.get(r))==null||a.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),H0(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e})();function Ed(e,t){var n;if(xc(e,bn))return e;var r=(n=t?.name)!=null?n:"ObservableObject",i=new n8(e,new Map,String(r),X9(t));return U0(e,bn,i),e}var YS=kf("ObservableObjectAdministration",n8);function P5(e){return k5[e]||(k5[e]={get:function(){return this[bn].getObservablePropValue_(e)},set:function(n){return this[bn].setObservablePropValue_(e,n)}})}function su(e){return q0(e)?YS(e[bn]):!1}function O5(e,t,n){var r;(r=e.target_[ju])==null||delete r[n]}var XS=i8(0),KS=(function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1})(),qg=0,r8=function(){};function ZS(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}ZS(r8,Array.prototype);var Qv=(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 Kv(a,i,o,!0);u.proxy_=s,p6(s,bn,u),r&&r.length&&s.spliceWithArray(0,0,r),KS&&Object.defineProperty(s,"0",XS)}),s}v6(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 Yu(s)?s.slice():s}))},n[Symbol.iterator]=function(){var r=this,i=0;return Jv({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"}}])})(r8);Object.entries(_0).forEach(function(e){var t=e[0],n=e[1];t!=="concat"&&U0(Qv.prototype,t,n)});function i8(e){return{enumerable:!1,configurable:!0,get:function(){return this[bn].get_(e)},set:function(n){this[bn].set_(e,n)}}}function QS(e){Bu(Qv.prototype,""+e,i8(e))}function a8(e){if(e>qg){for(var t=qg;t<e+100;t++)QS(t);qg=e}}a8(1e3);function JS(e,t,n){return new Qv(e,t,n)}function vd(e,t){if(typeof e=="object"&&e!==null){if(Yu(e))return t!==void 0&&zn(23),e[bn].atom_;if(is(e))return e.atom_;if(Rl(e)){if(t===void 0)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||zn(25,t,ov(e)),n}if(su(e)){if(!t)return zn(26);var r=e[bn].values_.get(t);return r||zn(27,t,ov(e)),r}if(Gv(e)||Y0(e)||w0(e))return e}else if(cl(e)&&w0(e[bn]))return e[bn];zn(28)}function Gu(e,t){if(e||zn(29),t!==void 0)return Gu(vd(e,t));if(Gv(e)||Y0(e)||w0(e)||Rl(e)||is(e))return e;if(e[bn])return e[bn];zn(24,e)}function ov(e,t){var n;if(t!==void 0)n=vd(e,t);else{if(gd(e))return e.name;su(e)||Rl(e)||is(e)?n=Gu(e):n=vd(e)}return n.name_}function xh(e){var t=wh(),n=W0(!0);Ns();try{return e()}finally{Ts(),V0(n),_c(t)}}var C5=z0.toString;function o8(e,t,n){return n===void 0&&(n=-1),sv(e,t,n)}function sv(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=C5.call(e);if(o!==C5.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=L5(e),t=L5(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(!sv(e[c],t[c],n-1,r,i))return!1}else{var p=Object.keys(e),m=p.length;if(Object.keys(t).length!==m)return!1;for(var d=0;d<m;d++){var y=p[d];if(!(xc(t,y)&&sv(e[y],t[y],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function L5(e){return Yu(e)?e.slice():_d(e)||Rl(e)||mc(e)||is(e)?Array.from(e.entries()):e}var N5,eE=((N5=B0().Iterator)==null?void 0:N5.prototype)||{};function Jv(e){return e[Symbol.iterator]=tE,Object.assign(Object.create(eE),e)}function tE(){return this}["Symbol","Map","Set"].forEach(function(e){var t=B0();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:pS,extras:{getDebugName:ov},$mobx:bn});if(!Di.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!J6)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var s8=l6();function nE(e){e()}function rE(e){e||(e=nE),AS({reactionScheduler:e})}function iE(e){return OS(e)}var aE=1e4,oE=1e4,sE=(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=aE),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,oE))}}),e})(),lE=typeof FinalizationRegistry<"u"?FinalizationRegistry:sE,lv=new lE(function(e){var t;(t=e.reaction)===null||t===void 0||t.dispose(),e.reaction=null}),Ug={exports:{}},Hg={};var T5;function uE(){if(T5)return Hg;T5=1;var e=Mp();function t(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function s(p,m){var d=m(),y=r({inst:{value:d,getSnapshot:m}}),w=y[0].inst,x=y[1];return a(function(){w.value=d,w.getSnapshot=m,u(w)&&x({inst:w})},[p,d,m]),i(function(){return u(w)&&x({inst:w}),p(function(){u(w)&&x({inst:w})})},[p]),o(d),d}function u(p){var m=p.getSnapshot;p=p.value;try{var d=m();return!n(p,d)}catch{return!0}}function h(p,m){return m()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:s;return Hg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:c,Hg}var R5;function cE(){return R5||(R5=1,Ug.exports=uE()),Ug.exports}var fE=cE();function M5(e){e.reaction=new Hu("observer".concat(e.name),function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)===null||t===void 0||t.call(e)})}function hE(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 lv.unregister(r),r.onStoreChange=s,r.reaction||(M5(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||(M5(i),lv.register(n,i,i)),oe.useDebugValue(i.reaction,iE),fE.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,Gg,l8=typeof Symbol=="function"&&Symbol.for,dE=(Gg=($g=Object.getOwnPropertyDescriptor(function(){},"name"))===null||$g===void 0?void 0:$g.configurable)!==null&&Gg!==void 0?Gg:!1,I5=l8?Symbol.for("react.forward_ref"):typeof Di.forwardRef=="function"&&Di.forwardRef(function(e){return null}).$$typeof,j5=l8?Symbol.for("react.memo"):typeof Di.memo=="function"&&Di.memo(function(e){return null}).$$typeof;function Jr(e,t){var n;if(j5&&e.$$typeof===j5)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(I5&&e.$$typeof===I5&&(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 hE(function(){return i(s,u)},a)};return o.displayName=e.displayName,dE&&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),gE(e,o),o}var pE={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function gE(e,t){Object.keys(e).forEach(function(n){pE[n]||Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}function mE(e,t){return Di.useState(function(){return Qn(e(),t,{autoBind:!0})})[0]}var Wg;rE(s8.unstable_batchedUpdates);Wg=lv.finalizeAllImmediately;const vE=Math.PI/180;function yE(){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:yE(),isUnminified:/param/.test((function(e){}).toString()),dblClickWindow:400,getAngle(e){return Ot.angleDeg?e*vE: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 bE=`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
- `,D5=()=>{if(typeof document>"u")throw new Error(bE)};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=Ke._getRotation(u.rotation),u}}const wE="[object Array]",xE="[object Number]",_E="[object String]",SE="[object Boolean]",EE=Math.PI/180,kE=180/Math.PI,qd="#",AE="",PE="0",OE="Konva warning: ",F5="Konva error: ",CE="rgb(",Vg={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]},LE=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let k1=[],Ud=null;const NE=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(e){setTimeout(e,60)},Ke={_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)===wE},_isNumber(e){return Object.prototype.toString.call(e)===xE&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===_E},_isBoolean(e){return Object.prototype.toString.call(e)===SE},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&&NE(function(){const t=k1;k1=[],t.forEach(function(n){n()})})},createCanvasElement(){D5();const e=document.createElement("canvas");try{e.style=e.style||{}}catch{}return e},createImageElement(){return D5(),document.createElement("img")},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){const n=Ke.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(qd,AE);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=PE+e;return qd+e},isCanvasFarblingActive(){if(Ud!==null)return Ud;if(typeof document>"u")return Ud=!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 Ud=r,this.releaseCanvas(e),Ud},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),qd+this._rgbToHex(e,t,n)},getSnappedHexColor(e){const t=this._hexToRgb(e);return qd+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 Vg?(t=Vg[e],{r:t[0],g:t[1],b:t[2]}):e[0]===qd?this._hexToRgb(e.substring(1)):e.substr(0,4)===CE?(t=LE.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",Ke._namedColorToRBA(e)||Ke._hex3ColorToRGBA(e)||Ke._hex4ColorToRGBA(e)||Ke._hex6ColorToRGBA(e)||Ke._hex8ColorToRGBA(e)||Ke._rgbColorToRGBA(e)||Ke._rgbaColorToRGBA(e)||Ke._hslColorToRGBA(e)},_namedColorToRBA(e){const t=Vg[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 p=0;p<3;p++)s=r+1/3*-(p-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[p]=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*EE},radToDeg(e){return e*kE},_degToRad(e){return Ke.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),Ke.degToRad(e)},_radToDeg(e){return Ke.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),Ke.radToDeg(e)},_getRotation(e){return Ot.angleDeg?Ke.radToDeg(e):e},_capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)},throw(e){throw new Error(F5+e)},error(e){console.error(F5+e)},warn(e){Ot.showWarnings&&console.warn(OE+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=Ke.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=Ke._getProjectionToSegment(a.x,a.y,s.x,s.y,e.x,e.y),h=u[0],c=u[1],p=u[2];p<i&&(r.x=h,r.y=c,i=p)}),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=Ke._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||Ke._isElement(e[n]))if(t.configurable)delete e[n];else return null;else if(Ke._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},p=Math.hypot(h.x,h.y),m=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 w={x:h.x/p,y:h.y/p},x={x:c.x/m,y:c.y/m},b={x:s.x-w.x*d,y:s.y-w.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 TE(e){const t=[],n=e.length,r=Ke;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 B5=",",RE="(",ME=")",IE="([",jE="])",DE=";",FE="()",BE="=",z5=["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"],zE=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],qE=100;let A1=null;function q5(){if(A1!==null)return A1;try{const t=Ke.createCanvasElement().getContext("2d");return t?!!t&&"filter"in t:(A1=!1,!1)}catch{return A1=!1,!1}}class X0{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+=FE:Ke._isArray(h[0])?a+=IE+h.join(B5)+jE:(n&&(h=h.map(c=>typeof c=="number"?Math.floor(c):c)),a+=RE+h.join(B5)+ME)):(a+=s.property,t||(a+=BE+s.val)),a+=DE;return a}clearTrace(){this.traceArr=[]}_trace(t){let n=this.traceArr,r;n.push(t),r=n.length,r>=qE&&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,p=this._context;c.length===3?p.drawImage(t,n,r):c.length===5?p.drawImage(t,n,r,i,a):c.length===9&&p.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=z5.length,r=this.setAttr,i,a;const o=function(s){let u=t[s],h;t[s]=function(){return a=TE(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(z5[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)}}zE.forEach(function(e){Object.defineProperty(X0.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class UE extends X0{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,p=u.y*h;this.setAttr("shadowColor",a),this.setAttr("shadowBlur",o*Math.min(Math.abs(c),Math.abs(p))),this.setAttr("shadowOffsetX",s.x*c),this.setAttr("shadowOffsetY",s.y*p)}}class HE extends X0{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 $E(){if(P1)return P1;const e=Ke.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})(),Ke.releaseCanvas(e),P1}class ey{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const r=(t||{}).pixelRatio||Ot.pixelRatio||$E();this.pixelRatio=r,this._canvas=Ke.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 Ke.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}class Cl extends ey{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new UE(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}class ty extends ey{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new HE(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=Ke._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 Ke._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||Ke._isBoolean(e)?e:Object.prototype.toString.call(e)}function u8(e){return e>255?255:e<0?0:Math.round(e)}function At(){if(Ot.isUnminified)return function(e,t){return Ke._isNumber(e)||Ke.warn(Pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function K0(e){if(Ot.isUnminified)return function(t,n){let r=Ke._isNumber(t),i=Ke._isArray(t)&&t.length==e;return!r&&!i&&Ke.warn(Pf(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+e+")"),t}}function ny(){if(Ot.isUnminified)return function(e,t){return Ke._isNumber(e)||e==="auto"||Ke.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 Ke._isString(e)||Ke.warn(Pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function c8(){if(Ot.isUnminified)return function(e,t){const n=Ke._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||Ke.warn(Pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function GE(){if(Ot.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(Ke._isArray(e)?e.forEach(function(r){Ke._isNumber(r)||Ke.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):Ke.warn(Pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function lu(){if(Ot.isUnminified)return function(e,t){return e===!0||e===!1||Ke.warn(Pf(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}function WE(e){if(Ot.isUnminified)return function(t,n){return t==null||Ke.isObject(t)||Ke.warn(Pf(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}const Hd="get",$d="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=Hd+Ke._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=$d+Ke._capitalize(t);e.prototype[i]||Re.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){const i=$d+Ke._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=Ke._capitalize,s=Hd+o(t),u=$d+o(t);e.prototype[s]=function(){const c={};for(let p=0;p<a;p++){const m=n[p];c[m]=this.getAttr(t+o(m))}return c};const h=WE(n);e.prototype[u]=function(c){const p=this.attrs[t];r&&(c=r.call(this,c,t)),h&&h.call(this,c,t);for(const m in c)c.hasOwnProperty(m)&&this._setAttr(t+o(m),c[m]);return c||n.forEach(m=>{this._setAttr(t+o(m),void 0)}),this._fireChangeEvent(t,p,c),i&&i.call(this),this},Re.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){const n=Ke._capitalize(t),r=$d+n,i=Hd+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){Ke.error("Adding deprecated "+t);const i=Hd+Ke._capitalize(t),a=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[i]=function(){Ke.error(a);const o=this.attrs[t];return o===void 0?n:o},Re.addSetter(e,t,r,function(){Ke.error(a)}),Re.addOverloadedGetterSetter(e,t)},backCompat(e,t){Ke.each(t,function(n,r){const i=e.prototype[r],a=Hd+Ke._capitalize(n),o=$d+Ke._capitalize(n);function s(){i.apply(this,arguments),Ke.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 VE(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:Ke.warn(`CSS filter "${r}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}const n0="absoluteOpacity",O1="allEventListeners",dc="absoluteTransform",U5="absoluteScale",Vf="canvas",YE="Change",XE="children",KE="konva",uv="listening",ZE="mouseenter",QE="mouseleave",JE="pointerenter",ek="pointerleave",tk="touchenter",nk="touchleave",H5="set",$5="Shape",r0=" ",G5="stage",ff="transform",rk="Stage",cv="visible",ik=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(r0);let ak=1,Pt=class fv{constructor(t){this._id=ak++,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===ff||t===dc)&&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===ff||t===dc)&&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(r0);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===dc&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Vf)){const{scene:t,filter:n,hit:r,buffer:i}=this._cache.get(Vf);Ke.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,p=n.hitCanvasPixelRatio||1;if(!i||!a){Ke.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const m=Math.abs(Math.round(r.x)-s)>.5?1:0,d=Math.abs(Math.round(r.y)-u)>.5?1:0;i+=h*2+m,a+=h*2+d,s-=h,u-=h;const y=new Cl({pixelRatio:o,width:i,height:a}),w=new Cl({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),x=new ty({pixelRatio:p,width:i,height:a}),b=y.getContext(),S=x.getContext(),k=new Cl({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,w.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(n0),this._clearSelfAndDescendantCache(U5),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:w,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 m=0;m<t.length;m++)if(typeof t[m]=="string"&&q5(),typeof t[m]!="string"||!q5()){c=!1;break}const p=r.pixelRatio;if(i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio),c){const m=t.join(" ");return a.save(),a.setAttr("filter",m),a.drawImage(r._canvas,0,0,r.getWidth()/p,r.getHeight()/p),a.restore(),this._filterUpToDate=!0,i}try{for(o=t.length,a.clear(),a.drawImage(r._canvas,0,0,r.getWidth()/p,r.getHeight()/p),s=a.getImageData(0,0,i.getWidth(),i.getHeight()),u=0;u<o;u++)h=t[u],typeof h=="string"&&(h=VE(h)),h.call(this,s),a.putImageData(s,0,0)}catch(m){Ke.error("Unable to apply filter. "+m.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(r0);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(r0),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=Ke.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(dc),this._clearSelfAndDescendantCache(n0),this._clearSelfAndDescendantCache(U5),this._clearSelfAndDescendantCache(G5),this._clearSelfAndDescendantCache(cv),this._clearSelfAndDescendantCache(uv)}_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"+Ke._capitalize(t);return Ke._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!==XE&&(r=H5+Ke._capitalize(n),Ke._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(uv,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(cv,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!==$5&&(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!==rk&&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(ff),this._clearSelfAndDescendantCache(dc)),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(ff);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(ff),this._clearSelfAndDescendantCache(dc),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 Ke.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 Ke.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 Ke.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 Ke.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 Ke.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&Ke.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(n0,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=Ke.isObject(r)&&!Ke._isPlainObject(r)&&!Ke._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 Ke._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],Ke.isValidSelector(a)||(Ke.warn('Selector "'+a+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),Ke.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),Ke.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(G5,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(dc,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(dc)||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(ff,this._getTransform)}_getTransform(){var t,n;const r=this._cache.get(ff)||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,p=this.attrs.offsetX||0,m=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),(p!==0||m!==0)&&r.translate(-1*p,-1*m),r.dirty=!1,r}clone(t){let n=Ke.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(KE)<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 Cl({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 Cl({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,Ke._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+YE,{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[H5+Ke._capitalize(t)];return Ke._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&&!Ke.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===$5&&(n.target=this);const i=[ZE,QE,JE,ek,tk,nk];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:Ke.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 Ke.haveIntersection(r,this.getClientRect())}static create(t,n){return Ke._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){let r=fv.prototype.getClassName.call(t),i=t.children,a,o,s;n&&(t.attrs.container=n),Ot[r]||(Ke.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(fv._createNode(i[s]));return a}};Pt.prototype.nodeType="Node";Pt.prototype._attrsAffectingSize=[];Pt.prototype.eventListeners={};Pt.prototype.on.call(Pt.prototype,ik,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(ff),this._clearSelfAndDescendantCache(dc)});Pt.prototype.on.call(Pt.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(cv)});Pt.prototype.on.call(Pt.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(uv)});Pt.prototype.on.call(Pt.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(n0)});const ei=Re.addGetterSetter;ei(Pt,"zIndex");ei(Pt,"absolutePosition");ei(Pt,"position");ei(Pt,"x",0,At());ei(Pt,"y",0,At());ei(Pt,"globalCompositeOperation","source-over",_h());ei(Pt,"opacity",1,At());ei(Pt,"name","",_h());ei(Pt,"id","",_h());ei(Pt,"rotation",0,At());Re.addComponentsGetterSetter(Pt,"scale",["x","y"]);ei(Pt,"scaleX",1,At());ei(Pt,"scaleY",1,At());Re.addComponentsGetterSetter(Pt,"skew",["x","y"]);ei(Pt,"skewX",0,At());ei(Pt,"skewY",0,At());Re.addComponentsGetterSetter(Pt,"offset",["x","y"]);ei(Pt,"offsetX",0,At());ei(Pt,"offsetY",0,At());ei(Pt,"dragDistance",void 0,At());ei(Pt,"width",0,At());ei(Pt,"height",0,At());ei(Pt,"listening",!0,lu());ei(Pt,"preventDefault",!0,lu());ei(Pt,"filters",void 0,function(e){return this._filterUpToDate=!1,e});ei(Pt,"visible",!0,lu());ei(Pt,"transformsEnabled","all",_h());ei(Pt,"size");ei(Pt,"dragBoundFunc");ei(Pt,"draggable",!1,lu());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,p=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 w;if(h)w=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,w),y=d.copy().invert().getMatrix(),o.transform(y[0],y[1],y[2],y[3],y[4],y[5])}const m=!p&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";m&&(o.save(),o._applyGlobalCompositeOperation(this)),(a=this.children)===null||a===void 0||a.forEach(function(d){d[t](n,r,i)}),m&&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 p=this.find("Shape");let m=!1;for(let d=0;d<p.length;d++)if(p[d]._isVisible(this)){m=!0;break}return m&&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,At());Re.addGetterSetter(ul,"clipY",void 0,At());Re.addGetterSetter(ul,"clipWidth",void 0,At());Re.addGetterSetter(ul,"clipHeight",void 0,At());Re.addGetterSetter(ul,"clipFunc");const Sp=new Map,f8=Ot._global.PointerEvent!==void 0;function Yg(e){return Sp.get(e)}function ry(e){return{evt:e,pointerId:e.pointerId}}function h8(e,t){return Sp.get(e)===t}function d8(e,t){up(e),t.getStage()&&(Sp.set(e,t),f8&&t._fire("gotpointercapture",ry(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),f8&&n._fire("lostpointercapture",ry(new PointerEvent("lostpointercapture")))}const ok="Stage",sk="string",W5="px",lk="mouseout",p8="mouseleave",g8="mouseover",m8="mouseenter",v8="mousemove",y8="mousedown",b8="mouseup",Jd="pointermove",ep="pointerdown",id="pointerup",tp="pointercancel",uk="lostpointercapture",C1="pointerout",np="pointerleave",L1="pointerover",N1="pointerenter",hv="contextmenu",w8="touchstart",x8="touchend",_8="touchmove",S8="touchcancel",dv="wheel",ck=5,fk=[[m8,"_pointerenter"],[y8,"_pointerdown"],[v8,"_pointermove"],[b8,"_pointerup"],[p8,"_pointerleave"],[w8,"_pointerdown"],[_8,"_pointermove"],[x8,"_pointerup"],[S8,"_pointercancel"],[g8,"_pointerover"],[dv,"_wheel"],[hv,"_contextmenu"],[ep,"_pointerdown"],[Jd,"_pointermove"],[id,"_pointerup"],[tp,"_pointercancel"],[np,"_pointerleave"],[uk,"_lostpointercapture"]],Xg={mouse:{[C1]:lk,[np]:p8,[L1]:g8,[N1]:m8,[Jd]:v8,[ep]:y8,[id]:b8,[tp]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[C1]:"touchout",[np]:"touchleave",[L1]:"touchover",[N1]:"touchenter",[Jd]:_8,[ep]:w8,[id]:x8,[tp]:S8,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&&Xg.pointer;if(t==="touch")return Xg.touch;if(t==="mouse")return Xg.mouse};function V5(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&Ke.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const hk="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 Z0=class extends ul{constructor(t){super(V5(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",()=>{V5(this.attrs)}),this._checkVisibility()}_validateAdd(t){const n=t.getType()==="Layer",r=t.getType()==="FastLayer";n||r||Ke.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===sk){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&&Ke._isInDocument(t)&&this.container().removeChild(t);const n=cp.indexOf(this);return n>-1&&cp.splice(n,1),Ke.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}:(Ke.warn(hk),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 Cl({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+W5,this.content.style.height=n+W5),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>ck&&Ke.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 h8(t,this)}setPointerCapture(t){d8(t,this)}releaseCapture(t){up(t)}getLayers(){return this.children}_bindContentEvents(){Ot.isBrowser&&fk.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=Yg(h.id)||this.getIntersection(h),p=h.id,m={evt:t,pointerId:p},d=u!==c;if(d&&u&&(u._fireAndBubble(n.pointerout,{...m},c),u._fireAndBubble(n.pointerleave,{...m},c)),c){if(o[c._id])return;o[c._id]=!0}c&&c.isListening()?(s=!0,d&&(c._fireAndBubble(n.pointerover,{...m},u),c._fireAndBubble(n.pointerenter,{...m},u),this[r+"targetShape"]=c),c._fireAndBubble(n.pointermove,{...m})):u&&(this._fire(n.pointerover,{evt:t,target:this,currentTarget:this,pointerId:p}),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=Yg(u.id)||this.getIntersection(u);if(h){if(h.releaseCapture(u.id),o[h._id])return;o[h._id]=!0}const c=u.id,p={evt:t,pointerId:c};let m=!1;Ot["_"+r+"InDblClickWindow"]?(m=!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,{...p}),Ot["_"+r+"ListenClick"]&&i&&i===h&&(h._fireAndBubble(n.pointerclick,{...p}),m&&a&&a===h&&h._fireAndBubble(n.pointerdblclick,{...p}))):(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}),m&&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(hv,{evt:t}):this._fire(hv,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);const n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(dv,{evt:t}):this._fire(dv,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const n=Yg(t.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(id,ry(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:Ke._getFirstPointerId(t)}],this._changedPointerPositions=[{x:r,y:i,id:Ke._getFirstPointerId(t)}])}_setPointerPosition(t){Ke.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 Cl({width:this.width(),height:this.height()}),this.bufferHitCanvas=new ty({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 Ke.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}};Z0.prototype.nodeType=ok;Bi(Z0);Re.addGetterSetter(Z0,"container");Ot.isBrowser&&document.addEventListener("visibilitychange",()=>{cp.forEach(e=>{e.batchDraw()})});const E8="hasShadow",k8="shadowRGBA",A8="patternImage",P8="linearGradient",O8="radialGradient";let T1;function Kg(){return T1||(T1=Ke.createCanvasElement().getContext("2d"),T1)}const fp={};function dk(e){const t=this.attrs.fillRule;t?e.fill(t):e.fill()}function pk(e){e.stroke()}function gk(e){const t=this.attrs.fillRule;t?e.fill(t):e.fill()}function mk(e){e.stroke()}function vk(){this._clearCache(E8)}function yk(){this._clearCache(k8)}function bk(){this._clearCache(A8)}function wk(){this._clearCache(P8)}function xk(){this._clearCache(O8)}let wt=class extends Pt{constructor(t){super(t);let n,r=0;for(;n=Ke.getHitColor(),!(n&&!(n in fp));)if(r++,r>=1e4){Ke.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=Ke.getRandomColor();break}this.colorKey=n,fp[n]=this}getContext(){return Ke.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return Ke.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(E8,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(A8,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const n=Kg().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(P8,this.__getLinearGradient)}__getLinearGradient(){const t=this.fillLinearGradientColorStops();if(t){const n=Kg(),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(O8,this.__getRadialGradient)}__getRadialGradient(){const t=this.fillRadialGradientColorStops();if(t){const n=Kg(),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(k8,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const t=Ke.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){Ke.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,p=!t.skipShadow&&this.hasShadow(),m=p?this.shadowOffsetX():0,d=p?this.shadowOffsetY():0,y=h+Math.abs(m),w=c+Math.abs(d),x=p&&this.shadowBlur()||0,b=y+x*2,S=w+x*2,k={width:b,height:S,x:-(u/2+x)+Math.min(m,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 p=n===this;if(!this.isVisible()&&!p)return this;if(s){o.save();const m=this.getAbsoluteTransform(n).getMatrix();return o.transform(m[0],m[1],m[2],m[3],m[4],m[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!u)return this;if(o.save(),this._useBufferCanvas()){c=this.getStage();const m=r||c.bufferCanvas,d=m.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 w=m.pixelRatio;h&&o._applyShadow(this),p||(o._applyOpacity(this),o._applyGlobalCompositeOperation(this)),o.drawImage(m._canvas,m.x||0,m.y||0,m.width/w,m.height/w)}else{if(o._applyLineJoin(this),o._applyMiterLimit(this),!p){const m=this.getAbsoluteTransform(n).getMatrix();o.transform(m[0],m[1],m[2],m[3],m[4],m[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||Ke.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 p=this.getAbsoluteTransform(n).getMatrix();return o.transform(p[0],p[1],p[2],p[3],p[4],p[5]),this._drawCachedHitCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),o._applyLineJoin(this),o._applyMiterLimit(this),!(this===n)){const p=this.getAbsoluteTransform(n).getMatrix();o.transform(p[0],p[1],p[2],p[3],p[4],p[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,p=Ke._hexToRgb(this.colorKey);for(let m=0;m<c;m+=4)h[m+3]>t?(h[m]=p.r,h[m+1]=p.g,h[m+2]=p.b,h[m+3]=255):h[m+3]=0;a.putImageData(u,0,0)}catch(u){Ke.error("Unable to draw hit graph from cached scene canvas. "+u.message)}return this}hasPointerCapture(t){return h8(t,this)}setPointerCapture(t){d8(t,this)}releaseCapture(t){up(t)}};wt.prototype._fillFunc=dk;wt.prototype._strokeFunc=pk;wt.prototype._fillFuncHit=gk;wt.prototype._strokeFuncHit=mk;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",vk);wt.prototype.on.call(wt.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",yk);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",bk);wt.prototype.on.call(wt.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",wk);wt.prototype.on.call(wt.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",xk);Re.addGetterSetter(wt,"stroke",void 0,c8());Re.addGetterSetter(wt,"strokeWidth",2,At());Re.addGetterSetter(wt,"fillAfterStrokeEnabled",!1);Re.addGetterSetter(wt,"hitStrokeWidth","auto",ny());Re.addGetterSetter(wt,"strokeHitEnabled",!0,lu());Re.addGetterSetter(wt,"perfectDrawEnabled",!0,lu());Re.addGetterSetter(wt,"shadowForStrokeEnabled",!0,lu());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,At());Re.addGetterSetter(wt,"shadowColor",void 0,_h());Re.addGetterSetter(wt,"shadowBlur",0,At());Re.addGetterSetter(wt,"shadowOpacity",1,At());Re.addComponentsGetterSetter(wt,"shadowOffset",["x","y"]);Re.addGetterSetter(wt,"shadowOffsetX",0,At());Re.addGetterSetter(wt,"shadowOffsetY",0,At());Re.addGetterSetter(wt,"fillPatternImage");Re.addGetterSetter(wt,"fill",void 0,c8());Re.addGetterSetter(wt,"fillPatternX",0,At());Re.addGetterSetter(wt,"fillPatternY",0,At());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,At());Re.addGetterSetter(wt,"fillPatternOffsetY",0,At());Re.addComponentsGetterSetter(wt,"fillPatternScale",["x","y"]);Re.addGetterSetter(wt,"fillPatternScaleX",1,At());Re.addGetterSetter(wt,"fillPatternScaleY",1,At());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 _k="beforeDraw",Sk="draw",C8=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],Ek=C8.length;let Sh=class extends ul{constructor(t){super(t),this.canvas=new Cl,this.hitCanvas=new ty({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&&Ke._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"&&Ke.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(){Ke.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){Ke.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,Ke.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<Ek;i++){const a=C8[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=Ke.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(_k,{node:this}),this.clearBeforeDraw()&&a.getContext().clear(),ul.prototype.drawScene.call(this,a,n,r),this._fire(Sk,{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){Ke.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return Ke.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 Ke.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,lu());class iy extends Sh{constructor(t){super(t),this.listening(!1),Ke.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}iy.prototype.nodeType="FastLayer";Bi(iy);let yd=class extends ul{_validateAdd(t){const n=t.getType();n!=="Group"&&n!=="Shape"&&Ke.throw("You may only add groups and shapes to groups.")}};yd.prototype.nodeType="Group";Bi(yd);const Zg=(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:Zg(),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=Zg(),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(Zg());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(),Ke.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,Ke.requestAnimFrame(this._animationLoop))}};kd.animations=[];kd.animIdCounter=0;kd.animRunning=!1;const kk={node:1,duration:1,easing:1,onFinish:1,yoyo:1},Ak=1,Y5=2,X5=3,K5=["fill","stroke","shadowColor"];let Pk=0;class Ok{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=Y5,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=X5,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===Y5?this.setTime(t):this.state===X5&&this.setTime(this.duration-t)}pause(){this.state=Ak,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=Pk++;const h=r.getLayer()||(r instanceof Ot.Stage?r.getLayers():null);h||Ke.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 Ok(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)kk[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 p=r.getAttr(t);if(Ke._isArray(n))if(a=[],o=Math.max(n.length,p.length),t==="points"&&n.length!==p.length&&(n.length>p.length?(u=p,p=Ke._prepareArrayForTween(p,n,r.closed())):(s=n,n=Ke._prepareArrayForTween(n,p,r.closed()))),t.indexOf("fill")===0)for(let m=0;m<o;m++)if(m%2===0)a.push(n[m]-p[m]);else{const d=Ke.colorToRGBA(p[m]);h=Ke.colorToRGBA(n[m]),p[m]=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 m=0;m<o;m++)a.push(n[m]-p[m]);else K5.indexOf(t)!==-1?(p=Ke.colorToRGBA(p),h=Ke.colorToRGBA(n),a={r:h.r-p.r,g:h.g-p.g,b:h.b-p.b,a:h.a-p.a}):a=n-p;oi.attrs[i][this._id][t]={start:p,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,p;for(i in r){if(a=r[i],o=a.start,s=a.diff,p=a.end,Ke._isArray(o))if(u=[],c=Math.max(o.length,p.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 K5.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=Ke._assign(Ot,{Util:Ke,Transform:sl,Node:Pt,Container:ul,Stage:Z0,stages:cp,Layer:Sh,FastLayer:iy,Group:yd,DD:Sr,Shape:wt,shapes:fp,Animation:kd,Tween:oi,Easings:hp,Context:X0,Canvas:ey});let Ac=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,p=s*(s>0?t:n),m=u*(u>0?n:t);return{x:h,y:r?-1*m:p,width:c-h,height:m-p}}};Ac.prototype._centroid=!0;Ac.prototype.className="Arc";Ac.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"];Bi(Ac);Re.addGetterSetter(Ac,"innerRadius",0,At());Re.addGetterSetter(Ac,"outerRadius",0,At());Re.addGetterSetter(Ac,"angle",0,At());Re.addGetterSetter(Ac,"clockwise",!1,lu());function pv(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),p=n-h*(i-e),m=r-h*(a-t),d=n+c*(i-e),y=r+c*(a-t);return[p,m,d,y]}function Z5(e,t){const n=e.length,r=[];for(let i=2;i<n-2;i+=2){const a=pv(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 Pc=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():Z5(this.points(),this.tension())}_getTensionPointsClosed(){const t=this.points(),n=t.length,r=this.tension(),i=pv(t[n-2],t[n-1],t[0],t[1],t[2],t[3],r),a=pv(t[n-4],t[n-3],t[n-2],t[n-1],t[0],t[1],r),o=Z5(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}}};Pc.prototype.className="Line";Pc.prototype._attrsAffectingSize=["points","bezier","tension"];Bi(Pc);Re.addGetterSetter(Pc,"closed",!1);Re.addGetterSetter(Pc,"bezier",!1);Re.addGetterSetter(Pc,"tension",0,At());Re.addGetterSetter(Pc,"points",[],GE());const Ck=[[],[],[-.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]],Lk=[[],[],[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]],Nk=[[1],[1,1],[1,2,1],[1,3,3,1]],Q5=(e,t,n)=>{let r,i;const o=n/2;r=0;for(let s=0;s<20;s++)i=o*Ck[20][s]+o,r+=Lk[20][s]*Tk(e,t,i);return o*r},J5=(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),p=h/s,m=n+c,d=p-c*c,y=m*m+d>0?Math.sqrt(m*m+d):0,w=c*c+d>0?Math.sqrt(c*c+d):0,x=c+Math.sqrt(c*c+d)!==0?d*Math.log(Math.abs((m+y)/(c+w))):0;return Math.sqrt(s)/2*(m*y-c*w+x)};function Tk(e,t,n){const r=gv(1,n,e),i=gv(1,n,t),a=r*r+i*i;return Math.sqrt(a)}const gv=(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+=Nk[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 gv(e-1,t,i)}},eb=(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 Ll=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],p=o[4],m=o[5],d=o[6],y=o[7],w=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,w,p,p+m,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],p=u.points[4]+c;let m=Math.PI/180;if(Math.abs(h-p)<m&&(m=Math.abs(h-p)),c<0)for(let d=h-m;d>p;d-=m){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+m;d<p;d+=m){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(eb(t,Ls.getPathLength(n),w=>Q5([o.start.x,s[0],s[2],s[4]],[o.start.y,s[1],s[3],s[5]],w)),o.start.x,o.start.y,s[0],s[1],s[2],s[3],s[4],s[5]);case"Q":return Ls.getPointOnQuadraticBezier(eb(t,Ls.getPathLength(n),w=>J5([o.start.x,s[0],s[2]],[o.start.y,s[1],s[3]],w)),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],p=s[3],m=s[5],d=s[6];let y=s[4];return y+=m*t/o.pathLength,Ls.getPointOnEllipticalArc(u,h,c,p,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),p=h*c;if(Math.abs(s-r-h*(o-n))<1e-10)return{x:o+c,y:s+p};const m=((o-n)*(i-n)+(s-r)*(a-r))/(u*u),d=n+m*(i-n),y=r+m*(a-r),w=this.getLineLength(o,s,d,y),x=Math.sqrt(t*t-w*w),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 p(x){return 3*x*x*(1-x)}function m(x){return 3*x*(1-x)*(1-x)}function d(x){return(1-x)*(1-x)*(1-x)}const y=u*c(t)+o*p(t)+i*m(t)+n*d(t),w=h*c(t)+s*p(t)+a*m(t)+r*d(t);return{x:y,y:w}}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 p=o*u(t)+i*h(t)+n*c(t),m=s*u(t)+a*h(t)+r*c(t);return{x:p,y:m}}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 p=0;p<r.length;p++)n=n.replace(new RegExp(r[p],"g"),"|"+r[p]);const i=n.split("|"),a=[],o=[];let s=0,u=0;const h=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let c;for(let p=1;p<i.length;p++){let m=i[p],d=m.charAt(0);for(m=m.slice(1),o.length=0;c=h.exec(m);)o.push(c[0]);let y=[],w=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),w>=0&&(w+=2,w>=7&&(w-=7));continue}if(w>=0){if(w===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))),w+=3,w>=7&&(w-=7);continue}if(S==="11"||S==="10"||S==="01"){y.push(parseInt(S[0],10)),y.push(parseInt(S[1],10)),w+=2,w>=7&&(w-=7);continue}if(S==="0"||S==="1"){y.push(parseInt(S,10)),w+=1,w>=7&&(w-=7);continue}}else if(w===4){if(/^[01]\d+(?:\.\d+)?$/.test(S)){y.push(parseInt(S[0],10)),y.push(parseFloat(S.slice(1))),w+=2,w>=7&&(w-=7);continue}if(S==="0"||S==="1"){y.push(parseInt(S,10)),w+=1,w>=7&&(w-=7);continue}}const k=parseFloat(S);isNaN(k)?y.push(0):y.push(k),w+=1,w>=7&&(w-=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,M,O,R,j,D,L,T,$;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 U=y.shift(),te=y.shift();if(s+=U,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]+U,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,M=u,E=a[a.length-1],E.command==="C"&&(A=s+(s-E.points[2]),M=u+(u-E.points[3])),b.push(A,M,y.shift(),y.shift()),s=y.shift(),u=y.shift(),x="C",b.push(s,u);break;case"s":A=s,M=u,E=a[a.length-1],E.command==="C"&&(A=s+(s-E.points[2]),M=u+(u-E.points[3])),b.push(A,M,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,M=u,E=a[a.length-1],E.command==="Q"&&(A=s+(s-E.points[0]),M=u+(u-E.points[1])),s=y.shift(),u=y.shift(),x="Q",b.push(A,M,s,u);break;case"t":A=s,M=u,E=a[a.length-1],E.command==="Q"&&(A=s+(s-E.points[0]),M=u+(u-E.points[1])),s+=y.shift(),u+=y.shift(),x="Q",b.push(A,M,s,u);break;case"A":O=y.shift(),R=y.shift(),j=y.shift(),D=y.shift(),L=y.shift(),T=s,$=u,s=y.shift(),u=y.shift(),x="A",b=this.convertEndpointToCenterParameterization(T,$,s,u,D,L,O,R,j);break;case"a":O=y.shift(),R=y.shift(),j=y.shift(),D=y.shift(),L=y.shift(),T=s,$=u,s+=y.shift(),u+=y.shift(),x="A",b=this.convertEndpointToCenterParameterization(T,$,s,u,D,L,O,R,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 Q5([t,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return J5([t,i[0],i[2]],[n,i[1],i[3]],1);case"A":a=0;const c=i[4],p=i[5],m=i[4]+p;let d=Math.PI/180;if(Math.abs(c-m)<d&&(d=Math.abs(c-m)),o=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],c,0),p<0)for(u=c-d;u>m;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<m;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],m,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),p=Math.cos(c)*(t-r)/2+Math.sin(c)*(n-i)/2,m=-1*Math.sin(c)*(t-r)/2+Math.cos(c)*(n-i)/2,d=p*p/(s*s)+m*m/(u*u);d>1&&(s*=Math.sqrt(d),u*=Math.sqrt(d));let y=Math.sqrt((s*s*(u*u)-s*s*(m*m)-u*u*(p*p))/(s*s*(m*m)+u*u*(p*p)));a===o&&(y*=-1),isNaN(y)&&(y=0);const w=y*s*m/u,x=y*-u*p/s,b=(t+r)/2+Math.cos(c)*w-Math.sin(c)*x,S=(n+i)/2+Math.sin(c)*w+Math.cos(c)*x,k=function(D){return Math.sqrt(D[0]*D[0]+D[1]*D[1])},E=function(D,L){return(D[0]*L[0]+D[1]*L[1])/(k(D)*k(L))},A=function(D,L){return(D[0]*L[1]<D[1]*L[0]?-1:1)*Math.acos(E(D,L))},M=A([1,0],[(p-w)/s,(m-x)/u]),O=[(p-w)/s,(m-x)/u],R=[(-1*p-w)/s,(-1*m-x)/u];let j=A(O,R);return E(O,R)<=-1&&(j=Math.PI),E(O,R)>=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,M,j,c,o]}};Ll.prototype.className="Path";Ll.prototype._attrsAffectingSize=["data"];Bi(Ll);Re.addGetterSetter(Ll,"data");class Eh extends Pc{_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 m=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],d=Ll.calcLength(i[i.length-4],i[i.length-3],"C",m),y=Ll.getPointOnQuadraticBezier(Math.min(1,1-o/d),m[0],m[1],m[2],m[3],m[4],m[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,p=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,p/2),t.lineTo(-o,-p/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,p/2),t.lineTo(-o,-p/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,At());Re.addGetterSetter(Eh,"pointerWidth",10,At());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,At());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,At());Re.addGetterSetter(Of,"radiusY",0,At());let uu=class L8 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?Ke.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?Ke.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=Ke.createImageElement();i.onload=function(){const a=new L8({image:i});n(a)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};uu.prototype.className="Image";uu.prototype._attrsAffectingSize=["image"];Bi(uu);Re.addGetterSetter(uu,"cornerRadius",0,K0(4));Re.addGetterSetter(uu,"image");Re.addComponentsGetterSetter(uu,"crop",["x","y","width","height"]);Re.addGetterSetter(uu,"cropX",0,At());Re.addGetterSetter(uu,"cropY",0,At());Re.addGetterSetter(uu,"cropWidth",0,At());Re.addGetterSetter(uu,"cropHeight",0,At());const N8=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],Rk="Change.konva",Mk="none",mv="up",vv="right",yv="down",bv="left",Ik=N8.length;let ay=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<Ik;r++)t.on(N8[r]+Rk,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 mv:s=r/2,u=-1*h;break;case vv:s=r+o,u=i/2;break;case yv:s=r/2,u=i+h;break;case bv: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})}}};ay.prototype.className="Label";Bi(ay);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,p=0;typeof s=="number"?u=h=c=p=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),p=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===mv&&(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===vv&&(t.lineTo(n,(r-o)/2),t.lineTo(n+a,r/2),t.lineTo(n,(r+o)/2)),t.lineTo(n,r-p),t.arc(n-p,r-p,p,0,Math.PI/2,!1),i===yv&&(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===bv&&(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===mv?(n-=i,s+=i):a===yv?s+=i:a===bv?(t-=r*1.5,o+=r):a===vv&&(o+=r*1.5),{x:t,y:n,width:o,height:s}}};kh.prototype.className="Tag";Bi(kh);Re.addGetterSetter(kh,"pointerDirection",Mk);Re.addGetterSetter(kh,"pointerWidth",0,At());Re.addGetterSetter(kh,"pointerHeight",0,At());Re.addGetterSetter(kh,"cornerRadius",0,K0(4));let zp=class extends wt{_sceneFunc(t){const n=this.cornerRadius(),r=this.width(),i=this.height();t.beginPath(),n?Ke.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,K0(4));class Cf extends wt{_sceneFunc(t){const n=this._getPoints(),r=this.radius(),i=this.sides(),a=this.cornerRadius();if(t.beginPath(),a)Ke.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,At());Re.addGetterSetter(Cf,"sides",0,At());Re.addGetterSetter(Cf,"cornerRadius",0,K0(4));const tb=Math.PI*2;class Ah extends wt{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,tb,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),tb,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,At());Re.addGetterSetter(Ah,"outerRadius",0,At());class Xu 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],p=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,h,c),t.closePath(),t.fillStrokeShape(this)),p)if(o){const m=o[n],d=r*2;t.drawImage(p,s,u,h,c,m[d+0],m[d+1],h,c)}else t.drawImage(p,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)}}Xu.prototype.className="Sprite";Bi(Xu);Re.addGetterSetter(Xu,"animation");Re.addGetterSetter(Xu,"animations");Re.addGetterSetter(Xu,"frameOffsets");Re.addGetterSetter(Xu,"image");Re.addGetterSetter(Xu,"frameIndex",0,At());Re.addGetterSetter(Xu,"frameRate",17,At());Re.backCompat(Xu,{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,At());Re.addGetterSetter(Lf,"innerRadius",0,At());Re.addGetterSetter(Lf,"outerRadius",0,At());function hf(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",jk="center",T8="inherit",Gd="justify",Dk="Change.konva",Fk="2d",nb="-",R8="left",Bk="text",zk="Text",qk="top",Uk="bottom",rb="middle",M8="normal",Hk="px ",R1=" ",$k="right",ib="rtl",Gk="word",Wk="char",ab="none",Qg="…",I8=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],Vk=I8.length;function Yk(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 Jg(){return M1||(M1=Ke.createCanvasElement().getContext(Fk),M1)}function Xk(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function Kk(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function Zk(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}let bi=class extends wt{constructor(t){super(Zk(t)),this._partialTextX=0,this._partialTextY=0;for(let n=0;n<Vk;n++)this.on(I8[n]+Dk,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(),p=0,m=this.align(),d=this.getWidth(),y=this.letterSpacing(),w=this.charRenderFunc(),x=this.fill(),b=this.textDecoration(),S=b.indexOf("underline")!==-1,k=b.indexOf("line-through")!==-1,E;c=c===T8?t.direction:c;let A=u/2,M=rb;if(!Ot.legacyTextRendering){const O=this.measureSize("M");M="alphabetic";const R=(n=O.fontBoundingBoxAscent)!==null&&n!==void 0?n:O.actualBoundingBoxAscent,j=(r=O.fontBoundingBoxDescent)!==null&&r!==void 0?r:O.actualBoundingBoxDescent;A=(R-j)/2+u/2}for(c===ib&&t.setAttr("direction",c),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",M),t.setAttr("textAlign",R8),h===rb?p=(this.getHeight()-a*u-o*2)/2:h===Uk&&(p=this.getHeight()-a*u-o*2),t.translate(o,p+o),E=0;E<a;E++){let O=0,R=0;const j=i[E],D=j.text,L=j.width,T=j.lastInParagraph;if(t.save(),m===$k?O+=d-L-o*2:m===jk&&(O+=(d-L-o*2)/2),S){t.save(),t.beginPath();const U=Ot.legacyTextRendering?Math.round(s/2):Math.round(s/4),te=O,se=A+R+U;t.moveTo(te,se);const ee=m===Gd&&!T?d-o*2:L;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!==ib&&(y!==0||m===Gd||w)){const U=D.split(" ").length-1,te=hf(D);for(let se=0;se<te.length;se++){const ee=te[se];if(ee===" "&&!T&&m===Gd&&(O+=(d-o*2-L)/U),this._partialTextX=O,this._partialTextY=A+R,this._partialText=ee,w){t.save();const re=i.slice(0,E).reduce((B,F)=>B+hf(F.text).length,0),X=se+re;w({char:ee,index:X,x:O,y:A+R,lineIndex:E,column:se,isLastInLine:T,width:this.measureSize(ee).width,context:t})}t.fillStrokeShape(this),w&&t.restore(),O+=this.measureSize(ee).width+y}}else y!==0&&t.setAttr("letterSpacing",`${y}px`),this._partialTextX=O,this._partialTextY=A+R,this._partialText=D,t.fillStrokeShape(this);if(k){t.save(),t.beginPath();const U=Ot.legacyTextRendering?0:-Math.round(s/4),te=$;t.moveTo(te,A+R+U);const se=m===Gd&&!T?d-o*2:L;t.lineTo(te+Math.round(se),A+R+U),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=Ke._isString(t)?t:t==null?"":t+"";return this._setAttr(Bk,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 Ke.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,p,m;let d=Jg(),y=this.fontSize(),w;d.save(),d.font=this._getContextFont(),w=d.measureText(t),d.restore();const x=y/100;return{actualBoundingBoxAscent:(n=w.actualBoundingBoxAscent)!==null&&n!==void 0?n:71.58203125*x,actualBoundingBoxDescent:(r=w.actualBoundingBoxDescent)!==null&&r!==void 0?r:0,actualBoundingBoxLeft:(i=w.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*x,actualBoundingBoxRight:(a=w.actualBoundingBoxRight)!==null&&a!==void 0?a:75.732421875*x,alphabeticBaseline:(o=w.alphabeticBaseline)!==null&&o!==void 0?o:0,emHeightAscent:(s=w.emHeightAscent)!==null&&s!==void 0?s:100*x,emHeightDescent:(u=w.emHeightDescent)!==null&&u!==void 0?u:-20*x,fontBoundingBoxAscent:(h=w.fontBoundingBoxAscent)!==null&&h!==void 0?h:91*x,fontBoundingBoxDescent:(c=w.fontBoundingBoxDescent)!==null&&c!==void 0?c:21*x,hangingBaseline:(p=w.hangingBaseline)!==null&&p!==void 0?p:72.80000305175781*x,ideographicBaseline:(m=w.ideographicBaseline)!==null&&m!==void 0?m:-21*x,width:w.width,height:y}}_getContextFont(){return this.fontStyle()+R1+this.fontVariant()+R1+(this.fontSize()+Hk)+Yk(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 Jg().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,p=o-h*2,m=0,d=this.wrap(),y=d!==ab,w=d!==Wk&&y,x=this.ellipsis();this.textArr=[],Jg().font=this._getContextFont();const b=x?this._getTextWidth(Qg):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 M=0,O=hf(E).length,R="",j=0;for(;M<O;){const D=M+O>>>1,L=hf(E),T=L.slice(0,D+1).join(""),$=this._getTextWidth(T);(x&&u&&m+i>p?$+b:$)<=c?(M=D+1,R=T,j=$):O=D}if(R){if(w){const T=hf(E),$=hf(R),U=T[$.length],te=U===R1||U===nb;let se;if(te&&j<=c)se=$.length;else{const ee=$.lastIndexOf(R1),Q=$.lastIndexOf(nb);se=Math.max(ee,Q)+1}se>0&&(M=se,R=T.slice(0,M).join(""),j=this._getTextWidth(R))}if(R=R.trimRight(),this._addTextLine(R),r=Math.max(r,j),m+=i,this._shouldHandleEllipsis(m)){this._tryToAddEllipsisToLastLine();break}if(E=hf(E).slice(M).join("").trimLeft(),E.length>0&&(A=this._getTextWidth(E),A<=c)){this._addTextLine(E),m+=i,r=Math.max(r,A);break}}else break}else this._addTextLine(E),m+=i,r=Math.max(r,A),this._shouldHandleEllipsis(m)&&S<k-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),u&&m+i>p)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()!==ab)||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+Qg)<i||(o.text=o.text.slice(0,o.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(o.text+Qg))}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()}};bi.prototype._fillFunc=Xk;bi.prototype._strokeFunc=Kk;bi.prototype.className=zk;bi.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];Bi(bi);Re.overWriteSetter(bi,"width",ny());Re.overWriteSetter(bi,"height",ny());Re.addGetterSetter(bi,"direction",T8);Re.addGetterSetter(bi,"fontFamily","Arial");Re.addGetterSetter(bi,"fontSize",12,At());Re.addGetterSetter(bi,"fontStyle",M8);Re.addGetterSetter(bi,"fontVariant",M8);Re.addGetterSetter(bi,"padding",0,At());Re.addGetterSetter(bi,"align",R8);Re.addGetterSetter(bi,"verticalAlign",qk);Re.addGetterSetter(bi,"lineHeight",1,At());Re.addGetterSetter(bi,"wrap",Gk);Re.addGetterSetter(bi,"ellipsis",!1,lu());Re.addGetterSetter(bi,"letterSpacing",0,At());Re.addGetterSetter(bi,"text","",_h());Re.addGetterSetter(bi,"textDecoration","");Re.addGetterSetter(bi,"charRenderFunc",void 0);const Qk="",j8="normal";function D8(e){e.fillText(this.partialText,0,0)}function F8(e){e.strokeText(this.partialText,0,0)}let Da=class extends wt{constructor(t){super(t),this.dummyCanvas=Ke.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 Ll.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const n=this.pathLength;return t>n?null:Ll.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=Ll.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 Ke.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(t){return bi.prototype.setText.call(this,t)}_getContextFont(){return bi.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=hf(this.text()),n=[];let r=0;for(let p=0;p<t.length;p++)n.push({char:t[p],width:this._getTextSize(t[p]).width}),r+=n[p].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 p=0;p<n.length;p++){const m=this._getPointAtLength(c);if(!m)return;const d=n[p].char;let y=n[p].width+a;if(d===" "&&o==="justify"){const E=this.text().split(" ").length-1;y+=(this.pathLength-u)/E}const w=this._getPointAtLength(c+y);if(!w)return;const x=Ll.getLineLength(m.x,m.y,w.x,w.y);let b=0;if(s)try{b=s(n[p-1].char,d)*this.fontSize()}catch{b=0}m.x+=b,w.x+=b,this.textWidth+=b;const S=Ll.getPointOnLine(b+x/2,m.x,m.y,w.x,w.y),k=Math.atan2(w.y-m.y,w.x-m.x);this.glyphInfo.push({transposeX:S.x,transposeY:S.y,text:t[p],rotation:k,p0:m,p1:w,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 Ke.releaseCanvas(this.dummyCanvas),super.destroy()}};Da.prototype._fillFunc=D8;Da.prototype._strokeFunc=F8;Da.prototype._fillFuncHit=D8;Da.prototype._strokeFuncHit=F8;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,At());Re.addGetterSetter(Da,"fontStyle",j8);Re.addGetterSetter(Da,"align","left");Re.addGetterSetter(Da,"letterSpacing",0,At());Re.addGetterSetter(Da,"textBaseline","middle");Re.addGetterSetter(Da,"fontVariant",j8);Re.addGetterSetter(Da,"text",Qk);Re.addGetterSetter(Da,"textDecoration","");Re.addGetterSetter(Da,"kerningFunc",void 0);const B8="tr-konva",Jk=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${B8}`).join(" "),ob="nodesRect",eA=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],tA={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},nA="ontouchstart"in Ot._global;function rA(e,t,n){if(e==="rotater")return n;t+=Ke.degToRad(tA[e]||0);const r=(Ke.radToDeg(t)%360+360)%360;return Ke._inRange(r,315+22.5,360)||Ke._inRange(r,0,22.5)?"ns-resize":Ke._inRange(r,45-22.5,45+22.5)?"nesw-resize":Ke._inRange(r,90-22.5,90+22.5)?"ew-resize":Ke._inRange(r,135-22.5,135+22.5)?"nwse-resize":Ke._inRange(r,180-22.5,180+22.5)?"ns-resize":Ke._inRange(r,225-22.5,225+22.5)?"nesw-resize":Ke._inRange(r,270-22.5,270+22.5)?"ew-resize":Ke._inRange(r,315-22.5,315+22.5)?"nwse-resize":(Ke.error("Transformer has unknown angle for cursor detection: "+r),"pointer")}const E0=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function iA(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 z8(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 aA(e,t){const n=iA(e);return z8(e,t,n)}function oA(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 wv=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(Jk,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return Ke.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 B8+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const n=t.filter(i=>i.isAncestorOf(this)?(Ke.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(eA.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(ob),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(ob,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 z8(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()}),p=[{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}],m=h.getAbsoluteTransform();p.forEach(function(d){const y=m.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(),E0.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:nA?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=rA(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()*Ke._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},wv++,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,M=Ot.getAngle(this.rotationSnapTolerance()),R=oA(this.rotationSnaps(),A,M)-S.rotation,j=aA(S,R);this._fitNodesInto(j,t);return}const p=this.shiftBehavior();let m;p==="inverted"?m=this.keepRatio()&&!t.shiftKey:p==="none"?m=this.keepRatio():m=this.keepRatio()||t.shiftKey;let d=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(m){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(m){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(m){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(m){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(),M=this.getWidth()-k.x(),O=this.getHeight()-k.y();k.move({x:-E,y:-A}),S.move({x:M,y:O})}const w=this.findOne(".top-left").getAbsolutePosition();n=w.x,r=w.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();wv--,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(Ke._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(Ke._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 m=a.point({x:-this.padding()*2,y:0});t.x+=m.x,t.y+=m.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=m.x,this._anchorDragOffset.y-=m.y}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const m=a.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=m.x,this._anchorDragOffset.y-=m.y,t.width+=this.padding()*2}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const m=a.point({x:0,y:-this.padding()*2});t.x+=m.x,t.y+=m.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=m.x,this._anchorDragOffset.y-=m.y,t.height+=this.padding()*2}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const m=a.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=m.x,this._anchorDragOffset.y-=m.y,t.height+=this.padding()*2}if(this.boundBoxFunc()){const m=this.boundBoxFunc()(r,t);m?t=m:Ke.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 p=u.multiply(s.invert());this._nodes.forEach(m=>{var d;if(!m.getStage())return;const y=m.getParent().getAbsoluteTransform(),w=m.getTransform().copy();w.translate(m.offsetX(),m.offsetY());const x=new sl;x.multiply(y.copy().invert()).multiply(p).multiply(y).multiply(w);const b=x.decompose();m.setAttrs(b),(d=m.getLayer())===null||d===void 0||d.batchDraw()}),this.rotation(Ke._getRotation(t.rotation)),this._nodes.forEach(m=>{this._fire("transform",{evt:n,target:m}),m._fire("transform",{evt:n,target:m})}),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(Ke._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(p=>{p.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()*Ke._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(p=>p.draggable()),x:0,y:0});const c=this.anchorStyleFunc();c&&h.forEach(p=>{c(p)}),(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=()=>wv>0;function sA(e){return e instanceof Array||Ke.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){E0.indexOf(t)===-1&&Ke.warn("Unknown anchor name: "+t+". Available names are: "+E0.join(", "))}),e||[]}tr.prototype.className="Transformer";Bi(tr);Re.addGetterSetter(tr,"enabledAnchors",E0,sA);Re.addGetterSetter(tr,"flipEnabled",!0,lu());Re.addGetterSetter(tr,"resizeEnabled",!0);Re.addGetterSetter(tr,"anchorSize",10,At());Re.addGetterSetter(tr,"rotateEnabled",!0);Re.addGetterSetter(tr,"rotateLineVisible",!0);Re.addGetterSetter(tr,"rotationSnaps",[]);Re.addGetterSetter(tr,"rotateAnchorOffset",50,At());Re.addGetterSetter(tr,"rotateAnchorCursor","crosshair");Re.addGetterSetter(tr,"rotationSnapTolerance",5,At());Re.addGetterSetter(tr,"borderEnabled",!0);Re.addGetterSetter(tr,"anchorStroke","rgb(0, 161, 255)");Re.addGetterSetter(tr,"anchorStrokeWidth",1,At());Re.addGetterSetter(tr,"anchorFill","white");Re.addGetterSetter(tr,"anchorCornerRadius",0,At());Re.addGetterSetter(tr,"borderStroke","rgb(0, 161, 255)");Re.addGetterSetter(tr,"borderStrokeWidth",1,At());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,At());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 Oc 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)}}Oc.prototype.className="Wedge";Oc.prototype._centroid=!0;Oc.prototype._attrsAffectingSize=["radius"];Bi(Oc);Re.addGetterSetter(Oc,"radius",0,At());Re.addGetterSetter(Oc,"angle",0,At());Re.addGetterSetter(Oc,"clockwise",!1);Re.backCompat(Oc,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function sb(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const lA=[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],uA=[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 cA(e,t){const n=e.data,r=e.width,i=e.height;let a,o,s,u,h,c,p,m,d,y,w,x,b,S,k,E,A,M,O,R;const j=t+t+1,D=r-1,L=i-1,T=t+1,$=T*(T+1)/2,U=new sb,te=lA[t],se=uA[t];let ee=null,Q=U,re=null,X=null;for(let B=1;B<j;B++)Q=Q.next=new sb,B===T&&(ee=Q);Q.next=U,s=o=0;for(let B=0;B<i;B++){x=b=S=k=u=h=c=p=0,m=T*(E=n[o]),d=T*(A=n[o+1]),y=T*(M=n[o+2]),w=T*(O=n[o+3]),u+=$*E,h+=$*A,c+=$*M,p+=$*O,Q=U;for(let F=0;F<T;F++)Q.r=E,Q.g=A,Q.b=M,Q.a=O,Q=Q.next;for(let F=1;F<T;F++)a=o+((D<F?D:F)<<2),u+=(Q.r=E=n[a])*(R=T-F),h+=(Q.g=A=n[a+1])*R,c+=(Q.b=M=n[a+2])*R,p+=(Q.a=O=n[a+3])*R,x+=E,b+=A,S+=M,k+=O,Q=Q.next;re=U,X=ee;for(let F=0;F<r;F++)n[o+3]=O=p*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-=m,h-=d,c-=y,p-=w,m-=re.r,d-=re.g,y-=re.b,w-=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,p+=k,re=re.next,m+=E=X.r,d+=A=X.g,y+=M=X.b,w+=O=X.a,x-=E,b-=A,S-=M,k-=O,X=X.next,o+=4;s+=r}for(let B=0;B<r;B++){b=S=k=x=h=c=p=u=0,o=B<<2,m=T*(E=n[o]),d=T*(A=n[o+1]),y=T*(M=n[o+2]),w=T*(O=n[o+3]),u+=$*E,h+=$*A,c+=$*M,p+=$*O,Q=U;for(let z=0;z<T;z++)Q.r=E,Q.g=A,Q.b=M,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])*(R=T-z),h+=(Q.g=A=n[o+1])*R,c+=(Q.b=M=n[o+2])*R,p+=(Q.a=O=n[o+3])*R,x+=E,b+=A,S+=M,k+=O,Q=Q.next,z<L&&(F+=r);o=B,re=U,X=ee;for(let z=0;z<i;z++)a=o<<2,n[a+3]=O=p*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-=m,h-=d,c-=y,p-=w,m-=re.r,d-=re.g,y-=re.b,w-=re.a,a=B+((a=z+T)<L?a:L)*r<<2,u+=x+=re.r=n[a],h+=b+=re.g=n[a+1],c+=S+=re.b=n[a+2],p+=k+=re.a=n[a+3],re=re.next,m+=E=X.r,d+=A=X.g,y+=M=X.b,w+=O=X.a,x-=E,b-=A,S-=M,k-=O,X=X.next,o+=r}}const fA=function(t){const n=Math.round(this.blurRadius());n>0&&cA(t,n)};Re.addGetterSetter(Pt,"blurRadius",0,At(),Re.afterSetFilter);const hA=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,At(),Re.afterSetFilter);const dA=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)},pA=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,At(),Re.afterSetFilter);const gA=function(e){var t,n,r,i,a,o,s,u,h;const c=e.data,p=e.width,m=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),M=Math.sin(E),O=128/1020*S,R=new Uint8ClampedArray(c),j=new Float32Array(p*m);for(let U=0,te=0;te<c.length;te+=4,U++)j[U]=.2126*R[te]+.7152*R[te+1]+.0722*R[te+2];const D=[-1,0,1,-2,0,2,-1,0,1],L=[-1,-2,-1,0,0,0,1,2,1],T=[-p-1,-p,-p+1,-1,0,1,p-1,p,p+1],$=U=>U<0?0:U>255?255:U;for(let U=1;U<m-1;U++)for(let te=1;te<p-1;te++){const se=U*p+te;let ee=0,Q=0;ee+=j[se+T[0]]*D[0],Q+=j[se+T[0]]*L[0],ee+=j[se+T[1]]*D[1],Q+=j[se+T[1]]*L[1],ee+=j[se+T[2]]*D[2],Q+=j[se+T[2]]*L[2],ee+=j[se+T[3]]*D[3],Q+=j[se+T[3]]*L[3],ee+=j[se+T[5]]*D[5],Q+=j[se+T[5]]*L[5],ee+=j[se+T[6]]*D[6],Q+=j[se+T[6]]*L[6],ee+=j[se+T[7]]*D[7],Q+=j[se+T[7]]*L[7],ee+=j[se+T[8]]*D[8],Q+=j[se+T[8]]*L[8];const re=A*ee+M*Q,X=$(k+re*O),B=se*4;if(b){const F=X-k;c[B]=$(R[B]+F),c[B+1]=$(R[B+1]+F),c[B+2]=$(R[B+2]+F),c[B+3]=R[B+3]}else c[B]=c[B+1]=c[B+2]=X,c[B+3]=R[B+3]}for(let U=0;U<p;U++){let te=U*4,se=((m-1)*p+U)*4;c[te]=R[te],c[te+1]=R[te+1],c[te+2]=R[te+2],c[te+3]=R[te+3],c[se]=R[se],c[se+1]=R[se+1],c[se+2]=R[se+2],c[se+3]=R[se+3]}for(let U=1;U<m-1;U++){let te=U*p*4,se=(U*p+(p-1))*4;c[te]=R[te],c[te+1]=R[te+1],c[te+2]=R[te+2],c[te+3]=R[te+3],c[se]=R[se],c[se+1]=R[se+1],c[se+2]=R[se+2],c[se+3]=R[se+3]}return e};Re.addGetterSetter(Pt,"embossStrength",.5,At(),Re.afterSetFilter);Re.addGetterSetter(Pt,"embossWhiteLevel",.5,At(),Re.afterSetFilter);Re.addGetterSetter(Pt,"embossDirection","top-left",void 0,Re.afterSetFilter);Re.addGetterSetter(Pt,"embossBlend",!1,void 0,Re.afterSetFilter);function e2(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 mA=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,p;const m=this.enhance();if(m===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),p=t[k+2],p<h?h=p:p>c&&(c=p);i===r&&(i=255,r=0),s===o&&(s=255,o=0),c===h&&(c=255,h=0);let d,y,w,x,b,S;if(m>0)d=i+m*(255-i),y=r-m*(r-0),w=s+m*(255-s),x=o-m*(o-0),b=c+m*(255-c),S=h-m*(h-0);else{const k=(i+r)*.5;d=i+m*(i-k),y=r+m*(r-k);const E=(s+o)*.5;w=s+m*(s-E),x=o+m*(o-E);const A=(c+h)*.5;b=c+m*(c-A),S=h+m*(h-A)}for(let k=0;k<n;k+=4)t[k+0]=e2(t[k+0],r,i,y,d),t[k+1]=e2(t[k+1],o,s,x,w),t[k+2]=e2(t[k+2],h,c,S,b)};Re.addGetterSetter(Pt,"enhance",0,At(),Re.afterSetFilter);const vA=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,At(),Re.afterSetFilter);Re.addGetterSetter(Pt,"saturation",0,At(),Re.afterSetFilter);Re.addGetterSetter(Pt,"luminance",0,At(),Re.afterSetFilter);const yA=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,p=.114*r-.114*s-.497*u,m=.299*r-.299*s-.328*u,d=.587*r+.413*s+.035*u,y=.114*r-.114*s+.293*u,w=.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 M=0;M<n;M+=4)S=t[M+0],k=t[M+1],E=t[M+2],A=t[M+3],t[M+0]=h*S+c*k+p*E+o,t[M+1]=m*S+d*k+y*E+o,t[M+2]=w*S+x*k+b*E+o,t[M+3]=A},bA=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,p=.299*r-.299*o-.328*s,m=.587*r+.413*o+.035*s,d=.114*r-.114*o+.293*s,y=.299*r-.3*o+1.25*s,w=.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]=p*S+m*k+d*E,t[b+2]=y*S+w*k+x*E,t[b+3]=A}};Re.addGetterSetter(Pt,"hue",0,At(),Re.afterSetFilter);Re.addGetterSetter(Pt,"saturation",0,At(),Re.afterSetFilter);Re.addGetterSetter(Pt,"value",0,At(),Re.afterSetFilter);const wA=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]},xA=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,p=o-u;const m=Math.sqrt(c*c+p*p);h=m>h?m:h;const d=o,y=a,w=360/y*Math.PI/180;for(let x=0;x<y;x+=1){const b=Math.sin(x*w),S=Math.cos(x*w);for(let k=0;k<d;k+=1){c=Math.floor(s+h*k/d*S),p=Math.floor(u+h*k/d*b);let E=(p*a+c)*4;const A=r[E+0],M=r[E+1],O=r[E+2],R=r[E+3];E=(x+k*a)*4,i[E+0]=A,i[E+1]=M,i[E+2]=O,i[E+3]=R}}},_A=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,p=o-u;const m=Math.sqrt(c*c+p*p);h=m>h?m:h;const d=o,y=a,w=0;let x,b;for(c=0;c<a;c+=1)for(p=0;p<o;p+=1){const S=c-s,k=p-u,E=Math.sqrt(S*S+k*k)*d/h;let A=(Math.atan2(k,S)*180/Math.PI+360+w)%360;A=A*y/360,x=Math.floor(A),b=Math.floor(E);let M=(b*a+x)*4;const O=r[M+0],R=r[M+1],j=r[M+2],D=r[M+3];M=(p*a+c)*4,i[M+0]=O,i[M+1]=R,i[M+2]=j,i[M+3]=D}},SA=function(e){const t=e.width,n=e.height;let r,i,a,o,s,u,h,c,p,m,d=Math.round(this.kaleidoscopePower());const y=Math.round(this.kaleidoscopeAngle()),w=Math.floor(t*(y%360)/360);if(d<1)return;const x=Ke.createCanvasElement();x.width=t,x.height=n;const b=x.getContext("2d").getImageData(0,0,t,n);Ke.releaseCanvas(x),xA(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,M=1;for(w+S>t&&(E=k,A=0,M=-1),i=0;i<n;i+=1)for(r=E;r!==A;r+=M)a=Math.round(r+w)%t,p=(t*i+a)*4,s=b.data[p+0],u=b.data[p+1],h=b.data[p+2],c=b.data[p+3],m=(t*i+r)*4,b.data[m+0]=s,b.data[m+1]=u,b.data[m+2]=h,b.data[m+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)p=(t*i+r)*4,s=b.data[p+0],u=b.data[p+1],h=b.data[p+2],c=b.data[p+3],m=(t*i+k*2-r-1)*4,b.data[m+0]=s,b.data[m+1]=u,b.data[m+2]=h,b.data[m+3]=c;k*=2}_A(b,e,{})};Re.addGetterSetter(Pt,"kaleidoscopePower",2,At(),Re.afterSetFilter);Re.addGetterSetter(Pt,"kaleidoscopeAngle",0,At(),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 EA(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 kA(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=EA([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 AA(e,t){for(let n=0;n<e.width*e.height;n++)e.data[4*n+3]=t[n]}function PA(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 p=0;p<i;p++)for(let m=0;m<i;m++){const d=s+p-a,y=u+m-a;if(d>=0&&d<n&&y>=0&&y<t){const w=d*t+y,x=r[p*i+m];c+=e[w]*x}}o[h]=c===2040?255:0}return o}function OA(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 p=0;p<i;p++)for(let m=0;m<i;m++){const d=s+p-a,y=u+m-a;if(d>=0&&d<n&&y>=0&&y<t){const w=d*t+y,x=r[p*i+m];c+=e[w]*x}}o[h]=c>=1020?255:0}return o}function CA(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 p=0;p<i;p++)for(let m=0;m<i;m++){const d=s+p-a,y=u+m-a;if(d>=0&&d<n&&y>=0&&y<t){const w=d*t+y,x=r[p*i+m];c+=e[w]*x}}o[h]=c}return o}const LA=function(e){const t=this.threshold();let n=kA(e,t);return n&&(n=PA(n,e.width,e.height),n=OA(n,e.width,e.height),n=CA(n,e.width,e.height),AA(e,n)),e};Re.addGetterSetter(Pt,"threshold",0,At(),Re.afterSetFilter);const NA=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,At(),Re.afterSetFilter);const TA=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){Ke.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,p=0,m=0;const d=s*t,y=d+t,w=u*t,x=w+t;let b=0;for(let S=d;S<y;S+=1)if(!(S>=n))for(let k=w;k<x;k+=1){if(k>=r)continue;const E=(n*k+S)*4;h+=o[E+0],c+=o[E+1],p+=o[E+2],m+=o[E+3],b+=1}h=h/b,c=c/b,p=p/b,m=m/b;for(let S=d;S<y;S+=1)if(!(S>=n))for(let k=w;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]=p,o[E+3]=m}}};Re.addGetterSetter(Pt,"pixelSize",8,At(),Re.afterSetFilter);const RA=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,At(),Re.afterSetFilter);const MA=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,u8,Re.afterSetFilter);const IA=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,u8,Re.afterSetFilter);Re.addGetterSetter(Pt,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});const jA=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)}},DA=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},FA=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,At(),Re.afterSetFilter);const un=hh.Util._assign(hh,{Arc:Ac,Arrow:Eh,Circle:Ad,Ellipse:Of,Image:uu,Label:ay,Tag:kh,Line:Pc,Path:Ll,Rect:zp,RegularPolygon:Cf,Ring:Ah,Sprite:Xu,Star:Lf,Text:bi,TextPath:Da,Transformer:tr,Wedge:Oc,Filters:{Blur:fA,Brightness:dA,Brighten:hA,Contrast:pA,Emboss:gA,Enhance:mA,Grayscale:vA,HSL:yA,HSV:bA,Invert:wA,Kaleidoscope:SA,Mask:LA,Noise:NA,Pixelate:TA,Posterize:RA,RGB:MA,RGBA:IA,Sepia:jA,Solarize:DA,Threshold:FA}});var t2={exports:{}};var n2,lb;function BA(){return lb||(lb=1,n2=function(t){var n={},r=Mp(),i=Hv(),a=Object.assign;function o(g){for(var v="https://reactjs.org/docs/error-decoder.html?invariant="+g,C=1;C<arguments.length;C++)v+="&args[]="+encodeURIComponent(arguments[C]);return"Minified React error #"+g+"; 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"),p=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),y=Symbol.for("react.context"),w=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 M(g){return g===null||typeof g!="object"?null:(g=A&&g[A]||g["@@iterator"],typeof g=="function"?g:null)}function O(g){if(g==null)return null;if(typeof g=="function")return g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case c:return"Fragment";case h:return"Portal";case m:return"Profiler";case p:return"StrictMode";case x:return"Suspense";case b:return"SuspenseList"}if(typeof g=="object")switch(g.$$typeof){case y:return(g.displayName||"Context")+".Consumer";case d:return(g._context.displayName||"Context")+".Provider";case w:var v=g.render;return g=g.displayName,g||(g=v.displayName||v.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case S:return v=g.displayName||null,v!==null?v:O(g.type)||"Memo";case k:v=g._payload,g=g._init;try{return O(g(v))}catch{}}return null}function R(g){var v=g.type;switch(g.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 g=v.render,g=g.displayName||g.name||"",v.displayName||(g!==""?"ForwardRef("+g+")":"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===p?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof v=="function")return v.displayName||v.name||null;if(typeof v=="string")return v}return null}function j(g){var v=g,C=g;if(g.alternate)for(;v.return;)v=v.return;else{g=v;do v=g,(v.flags&4098)!==0&&(C=v.return),g=v.return;while(g)}return v.tag===3?C:null}function D(g){if(j(g)!==g)throw Error(o(188))}function L(g){var v=g.alternate;if(!v){if(v=j(g),v===null)throw Error(o(188));return v!==g?null:g}for(var C=g,q=v;;){var W=C.return;if(W===null)break;var ae=W.alternate;if(ae===null){if(q=W.return,q!==null){C=q;continue}break}if(W.child===ae.child){for(ae=W.child;ae;){if(ae===C)return D(W),g;if(ae===q)return D(W),v;ae=ae.sibling}throw Error(o(188))}if(C.return!==q.return)C=W,q=ae;else{for(var Ee=!1,Ve=W.child;Ve;){if(Ve===C){Ee=!0,C=W,q=ae;break}if(Ve===q){Ee=!0,q=W,C=ae;break}Ve=Ve.sibling}if(!Ee){for(Ve=ae.child;Ve;){if(Ve===C){Ee=!0,C=ae,q=W;break}if(Ve===q){Ee=!0,q=ae,C=W;break}Ve=Ve.sibling}if(!Ee)throw Error(o(189))}}if(C.alternate!==q)throw Error(o(190))}if(C.tag!==3)throw Error(o(188));return C.stateNode.current===C?g:v}function T(g){return g=L(g),g!==null?$(g):null}function $(g){if(g.tag===5||g.tag===6)return g;for(g=g.child;g!==null;){var v=$(g);if(v!==null)return v;g=g.sibling}return null}function U(g){if(g.tag===5||g.tag===6)return g;for(g=g.child;g!==null;){if(g.tag!==4){var v=U(g);if(v!==null)return v}g=g.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,we=t.isPrimaryRenderer,Ce=t.supportsMutation,Ue=t.supportsPersistence,ze=t.supportsHydration,tt=t.getInstanceFromNode,ge=t.preparePortalMount,ut=t.getCurrentEventPriority,ke=t.detachDeletedInstance,he=t.supportsMicrotasks,be=t.scheduleMicrotask,Le=t.supportsTestSelectors,Me=t.findFiberRoot,ve=t.getBoundingRect,ye=t.getTextContent,xe=t.isHiddenSubtree,Ie=t.matchAccessibilityRole,Te=t.setFocusIfFocusable,Je=t.setupIntersectionObserver,nt=t.appendChild,st=t.appendChildToContainer,at=t.commitTextUpdate,ct=t.commitMount,Ct=t.commitUpdate,rn=t.insertBefore,Zt=t.insertInContainerBefore,an=t.removeChild,We=t.removeChildFromContainer,Be=t.resetTextContent,Wt=t.hideInstance,Et=t.hideTextInstance,Nt=t.unhideInstance,Tt=t.unhideTextInstance,on=t.clearContainer,Ht=t.cloneInstance,hn=t.createContainerChildSet,ui=t.appendChildToContainerChildSet,Ur=t.finalizeContainerChildren,hr=t.replaceContainerChildren,dr=t.cloneHiddenInstance,Qt=t.cloneHiddenTextInstance,zi=t.canHydrateInstance,Fa=t.canHydrateTextInstance,ti=t.canHydrateSuspenseInstance,Zi=t.isSuspenseInstancePending,$n=t.isSuspenseInstanceFallback,Or=t.getSuspenseInstanceFallbackErrorDetails,Dr=t.registerSuspenseInstanceRetry,Ea=t.getNextHydratableSibling,Go=t.getFirstHydratableChild,ka=t.getFirstHydratableChildWithinContainer,io=t.getFirstHydratableChildWithinSuspenseInstance,ci=t.hydrateInstance,Aa=t.hydrateTextInstance,Pa=t.hydrateSuspenseInstance,Wo=t.getNextHydratableInstanceAfterSuspenseInstance,qi=t.commitHydratedContainer,ao=t.commitHydratedSuspenseInstance,Fs=t.clearSuspenseBoundary,as=t.clearSuspenseBoundaryFromContainer,hu=t.shouldDeleteUnhydratedTailInstances,If=t.didNotMatchHydratedContainerTextInstance,Cr=t.didNotMatchHydratedTextInstance,du;function os(g){if(du===void 0)try{throw Error()}catch(C){var v=C.stack.trim().match(/\n( *(at )?)/);du=v&&v[1]||""}return`
25
- `+du+g}var Oa=!1;function ss(g,v){if(!g||Oa)return"";Oa=!0;var C=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 q=_t}Reflect.construct(g,[],v)}else{try{v.call()}catch(_t){q=_t}g.call(v.prototype)}else{try{throw Error()}catch(_t){q=_t}g()}}catch(_t){if(_t&&q&&typeof _t.stack=="string"){for(var W=_t.stack.split(`
26
- `),ae=q.stack.split(`
27
- `),Ee=W.length-1,Ve=ae.length-1;1<=Ee&&0<=Ve&&W[Ee]!==ae[Ve];)Ve--;for(;1<=Ee&&0<=Ve;Ee--,Ve--)if(W[Ee]!==ae[Ve]){if(Ee!==1||Ve!==1)do if(Ee--,Ve--,0>Ve||W[Ee]!==ae[Ve]){var lt=`
28
- `+W[Ee].replace(" at new "," at ");return g.displayName&&lt.includes("<anonymous>")&&(lt=lt.replace("<anonymous>",g.displayName)),lt}while(1<=Ee&&0<=Ve);break}}}finally{Oa=!1,Error.prepareStackTrace=C}return(g=g?g.displayName||g.name:"")?os(g):""}var Lc=Object.prototype.hasOwnProperty,hl=[],Po=-1;function wi(g){return{current:g}}function pr(g){0>Po||(g.current=hl[Po],hl[Po]=null,Po--)}function wn(g,v){Po++,hl[Po]=g.current,g.current=v}var oo={},Ui=wi(oo),Gn=wi(!1),so=oo;function Hi(g,v){var C=g.type.contextTypes;if(!C)return oo;var q=g.stateNode;if(q&&q.__reactInternalMemoizedUnmaskedChildContext===v)return q.__reactInternalMemoizedMaskedChildContext;var W={},ae;for(ae in C)W[ae]=v[ae];return q&&(g=g.stateNode,g.__reactInternalMemoizedUnmaskedChildContext=v,g.__reactInternalMemoizedMaskedChildContext=W),W}function Hr(g){return g=g.childContextTypes,g!=null}function ls(){pr(Gn),pr(Ui)}function lo(g,v,C){if(Ui.current!==oo)throw Error(o(168));wn(Ui,v),wn(Gn,C)}function xi(g,v,C){var q=g.stateNode;if(v=v.childContextTypes,typeof q.getChildContext!="function")return C;q=q.getChildContext();for(var W in q)if(!(W in v))throw Error(o(108,R(g)||"Unknown",W));return a({},C,q)}function Ba(g){return g=(g=g.stateNode)&&g.__reactInternalMemoizedMergedChildContext||oo,so=Ui.current,wn(Ui,g),wn(Gn,Gn.current),!0}function pu(g,v,C){var q=g.stateNode;if(!q)throw Error(o(169));C?(g=xi(g,v,so),q.__reactInternalMemoizedMergedChildContext=g,pr(Gn),pr(Ui),wn(Ui,g)):pr(Gn),wn(Gn,C)}var Ca=Math.clz32?Math.clz32:gu,Ml=Math.log,us=Math.LN2;function gu(g){return g>>>=0,g===0?32:31-(Ml(g)/us|0)|0}var jn=64,cs=4194304;function Oo(g){switch(g&-g){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 g&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return g&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return g}}function dl(g,v){var C=g.pendingLanes;if(C===0)return 0;var q=0,W=g.suspendedLanes,ae=g.pingedLanes,Ee=C&268435455;if(Ee!==0){var Ve=Ee&~W;Ve!==0?q=Oo(Ve):(ae&=Ee,ae!==0&&(q=Oo(ae)))}else Ee=C&~W,Ee!==0?q=Oo(Ee):ae!==0&&(q=Oo(ae));if(q===0)return 0;if(v!==0&&v!==q&&(v&W)===0&&(W=q&-q,ae=v&-v,W>=ae||W===16&&(ae&4194240)!==0))return v;if((q&4)!==0&&(q|=C&16),v=g.entangledLanes,v!==0)for(g=g.entanglements,v&=q;0<v;)C=31-Ca(v),W=1<<C,q|=g[C],v&=~W;return q}function Nc(g,v){switch(g){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 Tc(g,v){for(var C=g.suspendedLanes,q=g.pingedLanes,W=g.expirationTimes,ae=g.pendingLanes;0<ae;){var Ee=31-Ca(ae),Ve=1<<Ee,lt=W[Ee];lt===-1?((Ve&C)===0||(Ve&q)!==0)&&(W[Ee]=Nc(Ve,v)):lt<=v&&(g.expiredLanes|=Ve),ae&=~Ve}}function pl(g){return g=g.pendingLanes&-1073741825,g!==0?g:g&1073741824?1073741824:0}function Il(){var g=jn;return jn<<=1,(jn&4194240)===0&&(jn=64),g}function ca(g){for(var v=[],C=0;31>C;C++)v.push(g);return v}function za(g,v,C){g.pendingLanes|=v,v!==536870912&&(g.suspendedLanes=0,g.pingedLanes=0),g=g.eventTimes,v=31-Ca(v),g[v]=C}function qa(g,v){var C=g.pendingLanes&~v;g.pendingLanes=v,g.suspendedLanes=0,g.pingedLanes=0,g.expiredLanes&=v,g.mutableReadLanes&=v,g.entangledLanes&=v,v=g.entanglements;var q=g.eventTimes;for(g=g.expirationTimes;0<C;){var W=31-Ca(C),ae=1<<W;v[W]=0,q[W]=-1,g[W]=-1,C&=~ae}}function Ua(g,v){var C=g.entangledLanes|=v;for(g=g.entanglements;C;){var q=31-Ca(C),W=1<<q;W&v|g[q]&v&&(g[q]|=v),C&=~W}}var Ln=0;function cn(g){return g&=-g,1<g?4<g?(g&268435455)!==0?16:536870912:4:1}var Co=i.unstable_scheduleCallback,Rc=i.unstable_cancelCallback,Mc=i.unstable_shouldYield,uo=i.unstable_requestPaint,Er=i.unstable_now,mu=i.unstable_ImmediatePriority,vu=i.unstable_UserBlockingPriority,Bs=i.unstable_NormalPriority,Zu=i.unstable_IdlePriority,Ha=null,fa=null;function $a(g){if(fa&&typeof fa.onCommitFiberRoot=="function")try{fa.onCommitFiberRoot(Ha,g,void 0,(g.current.flags&128)===128)}catch{}}function yu(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var La=typeof Object.is=="function"?Object.is:yu,co=null,zs=!1,Ga=!1;function gl(g){co===null?co=[g]:co.push(g)}function jl(g){zs=!0,gl(g)}function fi(){if(!Ga&&co!==null){Ga=!0;var g=0,v=Ln;try{var C=co;for(Ln=1;g<C.length;g++){var q=C[g];do q=q(!0);while(q!==null)}co=null,zs=!1}catch(W){throw co!==null&&(co=co.slice(g+1)),Co(mu,fi),W}finally{Ln=v,Ga=!1}}return null}var Wa=[],fo=0,ml=null,fs=0,$r=[],hi=0,ni=null,_i=1,Va="";function H(g,v){Wa[fo++]=fs,Wa[fo++]=ml,ml=g,fs=v}function ce(g,v,C){$r[hi++]=_i,$r[hi++]=Va,$r[hi++]=ni,ni=g;var q=_i;g=Va;var W=32-Ca(q)-1;q&=~(1<<W),C+=1;var ae=32-Ca(v)+W;if(30<ae){var Ee=W-W%5;ae=(q&(1<<Ee)-1).toString(32),q>>=Ee,W-=Ee,_i=1<<32-Ca(v)+W|C<<W|q,Va=ae+g}else _i=1<<ae|C<<W|q,Va=g}function Oe(g){g.return!==null&&(H(g,1),ce(g,1,0))}function je(g){for(;g===ml;)ml=Wa[--fo],Wa[fo]=null,fs=Wa[--fo],Wa[fo]=null;for(;g===ni;)ni=$r[--hi],$r[hi]=null,Va=$r[--hi],$r[hi]=null,_i=$r[--hi],$r[hi]=null}var $e=null,ht=null,pt=!1,Ft=!1,jt=null;function mn(g,v){var C=ts(5,null,null,0);C.elementType="DELETED",C.stateNode=v,C.return=g,v=g.deletions,v===null?(g.deletions=[C],g.flags|=16):v.push(C)}function xn(g,v){switch(g.tag){case 5:return v=zi(v,g.type,g.pendingProps),v!==null?(g.stateNode=v,$e=g,ht=Go(v),!0):!1;case 6:return v=Fa(v,g.pendingProps),v!==null?(g.stateNode=v,$e=g,ht=null,!0):!1;case 13:if(v=ti(v),v!==null){var C=ni!==null?{id:_i,overflow:Va}:null;return g.memoizedState={dehydrated:v,treeContext:C,retryLane:1073741824},C=ts(18,null,null,0),C.stateNode=v,C.return=g,g.child=C,$e=g,ht=null,!0}return!1;default:return!1}}function Dn(g){return(g.mode&1)!==0&&(g.flags&128)===0}function Lr(g){if(pt){var v=ht;if(v){var C=v;if(!xn(g,v)){if(Dn(g))throw Error(o(418));v=Ea(C);var q=$e;v&&xn(g,v)?mn(q,C):(g.flags=g.flags&-4097|2,pt=!1,$e=g)}}else{if(Dn(g))throw Error(o(418));g.flags=g.flags&-4097|2,pt=!1,$e=g}}}function di(g){for(g=g.return;g!==null&&g.tag!==5&&g.tag!==3&&g.tag!==13;)g=g.return;$e=g}function sr(g){if(!ze||g!==$e)return!1;if(!pt)return di(g),pt=!0,!1;if(g.tag!==3&&(g.tag!==5||hu(g.type)&&!J(g.type,g.memoizedProps))){var v=ht;if(v){if(Dn(g))throw Si(),Error(o(418));for(;v;)mn(g,v),v=Ea(v)}}if(di(g),g.tag===13){if(!ze)throw Error(o(316));if(g=g.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(o(317));ht=Wo(g)}else ht=$e?Ea(g.stateNode):null;return!0}function Si(){for(var g=ht;g;)g=Ea(g)}function kr(){ze&&(ht=$e=null,Ft=pt=!1)}function Li(g){jt===null?jt=[g]:jt.push(g)}var qs=s.ReactCurrentBatchConfig;function Ya(g,v){if(La(g,v))return!0;if(typeof g!="object"||g===null||typeof v!="object"||v===null)return!1;var C=Object.keys(g),q=Object.keys(v);if(C.length!==q.length)return!1;for(q=0;q<C.length;q++){var W=C[q];if(!Lc.call(v,W)||!La(g[W],v[W]))return!1}return!0}function Us(g){switch(g.tag){case 5:return os(g.type);case 16:return os("Lazy");case 13:return os("Suspense");case 19:return os("SuspenseList");case 0:case 2:case 15:return g=ss(g.type,!1),g;case 11:return g=ss(g.type.render,!1),g;case 1:return g=ss(g.type,!0),g;default:return""}}function Vo(g,v,C){if(g=C.ref,g!==null&&typeof g!="function"&&typeof g!="object"){if(C._owner){if(C=C._owner,C){if(C.tag!==1)throw Error(o(309));var q=C.stateNode}if(!q)throw Error(o(147,g));var W=q,ae=""+g;return v!==null&&v.ref!==null&&typeof v.ref=="function"&&v.ref._stringRef===ae?v.ref:(v=function(Ee){var Ve=W.refs;Ee===null?delete Ve[ae]:Ve[ae]=Ee},v._stringRef=ae,v)}if(typeof g!="string")throw Error(o(284));if(!C._owner)throw Error(o(290,g))}return g}function Hs(g,v){throw g=Object.prototype.toString.call(v),Error(o(31,g==="[object Object]"?"object with keys {"+Object.keys(v).join(", ")+"}":g))}function $s(g){var v=g._init;return v(g._payload)}function vl(g){function v(it,Xe){if(g){var gt=it.deletions;gt===null?(it.deletions=[Xe],it.flags|=16):gt.push(Xe)}}function C(it,Xe){if(!g)return null;for(;Xe!==null;)v(it,Xe),Xe=Xe.sibling;return null}function q(it,Xe){for(it=new Map;Xe!==null;)Xe.key!==null?it.set(Xe.key,Xe):it.set(Xe.index,Xe),Xe=Xe.sibling;return it}function W(it,Xe){return it=Tu(it,Xe),it.index=0,it.sibling=null,it}function ae(it,Xe,gt){return it.index=gt,g?(gt=it.alternate,gt!==null?(gt=gt.index,gt<Xe?(it.flags|=2,Xe):gt):(it.flags|=2,Xe)):(it.flags|=1048576,Xe)}function Ee(it){return g&&it.alternate===null&&(it.flags|=2),it}function Ve(it,Xe,gt,Mt){return Xe===null||Xe.tag!==6?(Xe=Zc(gt,it.mode,Mt),Xe.return=it,Xe):(Xe=W(Xe,gt),Xe.return=it,Xe)}function lt(it,Xe,gt,Mt){var ln=gt.type;return ln===c?Gt(it,Xe,gt.props.children,Mt,gt.key):Xe!==null&&(Xe.elementType===ln||typeof ln=="object"&&ln!==null&&ln.$$typeof===k&&$s(ln)===Xe.type)?(Mt=W(Xe,gt.props),Mt.ref=Vo(it,Xe,gt),Mt.return=it,Mt):(Mt=Bh(gt.type,gt.key,gt.props,null,it.mode,Mt),Mt.ref=Vo(it,Xe,gt),Mt.return=it,Mt)}function _t(it,Xe,gt,Mt){return Xe===null||Xe.tag!==4||Xe.stateNode.containerInfo!==gt.containerInfo||Xe.stateNode.implementation!==gt.implementation?(Xe=zh(gt,it.mode,Mt),Xe.return=it,Xe):(Xe=W(Xe,gt.children||[]),Xe.return=it,Xe)}function Gt(it,Xe,gt,Mt,ln){return Xe===null||Xe.tag!==7?(Xe=Ma(gt,it.mode,Mt,ln),Xe.return=it,Xe):(Xe=W(Xe,gt),Xe.return=it,Xe)}function kn(it,Xe,gt){if(typeof Xe=="string"&&Xe!==""||typeof Xe=="number")return Xe=Zc(""+Xe,it.mode,gt),Xe.return=it,Xe;if(typeof Xe=="object"&&Xe!==null){switch(Xe.$$typeof){case u:return gt=Bh(Xe.type,Xe.key,Xe.props,null,it.mode,gt),gt.ref=Vo(it,null,Xe),gt.return=it,gt;case h:return Xe=zh(Xe,it.mode,gt),Xe.return=it,Xe;case k:var Mt=Xe._init;return kn(it,Mt(Xe._payload),gt)}if(te(Xe)||M(Xe))return Xe=Ma(Xe,it.mode,gt,null),Xe.return=it,Xe;Hs(it,Xe)}return null}function Rt(it,Xe,gt,Mt){var ln=Xe!==null?Xe.key:null;if(typeof gt=="string"&&gt!==""||typeof gt=="number")return ln!==null?null:Ve(it,Xe,""+gt,Mt);if(typeof gt=="object"&&gt!==null){switch(gt.$$typeof){case u:return gt.key===ln?lt(it,Xe,gt,Mt):null;case h:return gt.key===ln?_t(it,Xe,gt,Mt):null;case k:return ln=gt._init,Rt(it,Xe,ln(gt._payload),Mt)}if(te(gt)||M(gt))return ln!==null?null:Gt(it,Xe,gt,Mt,null);Hs(it,gt)}return null}function qr(it,Xe,gt,Mt,ln){if(typeof Mt=="string"&&Mt!==""||typeof Mt=="number")return it=it.get(gt)||null,Ve(Xe,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,lt(Xe,it,Mt,ln);case h:return it=it.get(Mt.key===null?gt:Mt.key)||null,_t(Xe,it,Mt,ln);case k:var Tn=Mt._init;return qr(it,Xe,gt,Tn(Mt._payload),ln)}if(te(Mt)||M(Mt))return it=it.get(gt)||null,Gt(Xe,it,Mt,ln,null);Hs(Xe,Mt)}return null}function xr(it,Xe,gt,Mt){for(var ln=null,Tn=null,An=Xe,Zn=Xe=0,ra=null;An!==null&&Zn<gt.length;Zn++){An.index>Zn?(ra=An,An=null):ra=An.sibling;var Vn=Rt(it,An,gt[Zn],Mt);if(Vn===null){An===null&&(An=ra);break}g&&An&&Vn.alternate===null&&v(it,An),Xe=ae(Vn,Xe,Zn),Tn===null?ln=Vn:Tn.sibling=Vn,Tn=Vn,An=ra}if(Zn===gt.length)return C(it,An),pt&&H(it,Zn),ln;if(An===null){for(;Zn<gt.length;Zn++)An=kn(it,gt[Zn],Mt),An!==null&&(Xe=ae(An,Xe,Zn),Tn===null?ln=An:Tn.sibling=An,Tn=An);return pt&&H(it,Zn),ln}for(An=q(it,An);Zn<gt.length;Zn++)ra=qr(An,it,Zn,gt[Zn],Mt),ra!==null&&(g&&ra.alternate!==null&&An.delete(ra.key===null?Zn:ra.key),Xe=ae(ra,Xe,Zn),Tn===null?ln=ra:Tn.sibling=ra,Tn=ra);return g&&An.forEach(function(eo){return v(it,eo)}),pt&&H(it,Zn),ln}function So(it,Xe,gt,Mt){var ln=M(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=Xe,Zn=Xe=0,ra=null,Vn=gt.next();An!==null&&!Vn.done;Zn++,Vn=gt.next()){An.index>Zn?(ra=An,An=null):ra=An.sibling;var eo=Rt(it,An,Vn.value,Mt);if(eo===null){An===null&&(An=ra);break}g&&An&&eo.alternate===null&&v(it,An),Xe=ae(eo,Xe,Zn),Tn===null?ln=eo:Tn.sibling=eo,Tn=eo,An=ra}if(Vn.done)return C(it,An),pt&&H(it,Zn),ln;if(An===null){for(;!Vn.done;Zn++,Vn=gt.next())Vn=kn(it,Vn.value,Mt),Vn!==null&&(Xe=ae(Vn,Xe,Zn),Tn===null?ln=Vn:Tn.sibling=Vn,Tn=Vn);return pt&&H(it,Zn),ln}for(An=q(it,An);!Vn.done;Zn++,Vn=gt.next())Vn=qr(An,it,Zn,Vn.value,Mt),Vn!==null&&(g&&Vn.alternate!==null&&An.delete(Vn.key===null?Zn:Vn.key),Xe=ae(Vn,Xe,Zn),Tn===null?ln=Vn:Tn.sibling=Vn,Tn=Vn);return g&&An.forEach(function(dg){return v(it,dg)}),pt&&H(it,Zn),ln}function El(it,Xe,gt,Mt){if(typeof gt=="object"&&gt!==null&&gt.type===c&&gt.key===null&&(gt=gt.props.children),typeof gt=="object"&&gt!==null){switch(gt.$$typeof){case u:e:{for(var ln=gt.key,Tn=Xe;Tn!==null;){if(Tn.key===ln){if(ln=gt.type,ln===c){if(Tn.tag===7){C(it,Tn.sibling),Xe=W(Tn,gt.props.children),Xe.return=it,it=Xe;break e}}else if(Tn.elementType===ln||typeof ln=="object"&&ln!==null&&ln.$$typeof===k&&$s(ln)===Tn.type){C(it,Tn.sibling),Xe=W(Tn,gt.props),Xe.ref=Vo(it,Tn,gt),Xe.return=it,it=Xe;break e}C(it,Tn);break}else v(it,Tn);Tn=Tn.sibling}gt.type===c?(Xe=Ma(gt.props.children,it.mode,Mt,gt.key),Xe.return=it,it=Xe):(Mt=Bh(gt.type,gt.key,gt.props,null,it.mode,Mt),Mt.ref=Vo(it,Xe,gt),Mt.return=it,it=Mt)}return Ee(it);case h:e:{for(Tn=gt.key;Xe!==null;){if(Xe.key===Tn)if(Xe.tag===4&&Xe.stateNode.containerInfo===gt.containerInfo&&Xe.stateNode.implementation===gt.implementation){C(it,Xe.sibling),Xe=W(Xe,gt.children||[]),Xe.return=it,it=Xe;break e}else{C(it,Xe);break}else v(it,Xe);Xe=Xe.sibling}Xe=zh(gt,it.mode,Mt),Xe.return=it,it=Xe}return Ee(it);case k:return Tn=gt._init,El(it,Xe,Tn(gt._payload),Mt)}if(te(gt))return xr(it,Xe,gt,Mt);if(M(gt))return So(it,Xe,gt,Mt);Hs(it,gt)}return typeof gt=="string"&&gt!==""||typeof gt=="number"?(gt=""+gt,Xe!==null&&Xe.tag===6?(C(it,Xe.sibling),Xe=W(Xe,gt),Xe.return=it,it=Xe):(C(it,Xe),Xe=Zc(gt,it.mode,Mt),Xe.return=it,it=Xe),Ee(it)):C(it,Xe)}return El}var ho=vl(!0),Gs=vl(!1),Ei=wi(null),hs=null,Lo=null,Dl=null;function Fl(){Dl=Lo=hs=null}function ha(g,v,C){we?(wn(Ei,v._currentValue),v._currentValue=C):(wn(Ei,v._currentValue2),v._currentValue2=C)}function po(g){var v=Ei.current;pr(Ei),we?g._currentValue=v:g._currentValue2=v}function No(g,v,C){for(;g!==null;){var q=g.alternate;if((g.childLanes&v)!==v?(g.childLanes|=v,q!==null&&(q.childLanes|=v)):q!==null&&(q.childLanes&v)!==v&&(q.childLanes|=v),g===C)break;g=g.return}}function Ws(g,v){hs=g,Dl=Lo=null,g=g.dependencies,g!==null&&g.firstContext!==null&&((g.lanes&v)!==0&&(ki=!0),g.firstContext=null)}function Fr(g){var v=we?g._currentValue:g._currentValue2;if(Dl!==g)if(g={context:g,memoizedValue:v,next:null},Lo===null){if(hs===null)throw Error(o(308));Lo=g,hs.dependencies={lanes:0,firstContext:g}}else Lo=Lo.next=g;return v}var Xa=null;function yl(g){Xa===null?Xa=[g]:Xa.push(g)}function Bl(g,v,C,q){var W=v.interleaved;return W===null?(C.next=C,yl(v)):(C.next=W.next,W.next=C),v.interleaved=C,$i(g,q)}function $i(g,v){g.lanes|=v;var C=g.alternate;for(C!==null&&(C.lanes|=v),C=g,g=g.return;g!==null;)g.childLanes|=v,C=g.alternate,C!==null&&(C.childLanes|=v),C=g,g=g.return;return C.tag===3?C.stateNode:null}var Ni=!1;function Na(g){g.updateQueue={baseState:g.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ka(g,v){g=g.updateQueue,v.updateQueue===g&&(v.updateQueue={baseState:g.baseState,firstBaseUpdate:g.firstBaseUpdate,lastBaseUpdate:g.lastBaseUpdate,shared:g.shared,effects:g.effects})}function da(g,v){return{eventTime:g,lane:v,tag:0,payload:null,callback:null,next:null}}function Qi(g,v,C){var q=g.updateQueue;if(q===null)return null;if(q=q.shared,(dn&2)!==0){var W=q.pending;return W===null?v.next=v:(v.next=W.next,W.next=v),q.pending=v,$i(g,C)}return W=q.interleaved,W===null?(v.next=v,yl(q)):(v.next=W.next,W.next=v),q.interleaved=v,$i(g,C)}function To(g,v,C){if(v=v.updateQueue,v!==null&&(v=v.shared,(C&4194240)!==0)){var q=v.lanes;q&=g.pendingLanes,C|=q,v.lanes=C,Ua(g,C)}}function ds(g,v){var C=g.updateQueue,q=g.alternate;if(q!==null&&(q=q.updateQueue,C===q)){var W=null,ae=null;if(C=C.firstBaseUpdate,C!==null){do{var Ee={eventTime:C.eventTime,lane:C.lane,tag:C.tag,payload:C.payload,callback:C.callback,next:null};ae===null?W=ae=Ee:ae=ae.next=Ee,C=C.next}while(C!==null);ae===null?W=ae=v:ae=ae.next=v}else W=ae=v;C={baseState:q.baseState,firstBaseUpdate:W,lastBaseUpdate:ae,shared:q.shared,effects:q.effects},g.updateQueue=C;return}g=C.lastBaseUpdate,g===null?C.firstBaseUpdate=v:g.next=v,C.lastBaseUpdate=v}function go(g,v,C,q){var W=g.updateQueue;Ni=!1;var ae=W.firstBaseUpdate,Ee=W.lastBaseUpdate,Ve=W.shared.pending;if(Ve!==null){W.shared.pending=null;var lt=Ve,_t=lt.next;lt.next=null,Ee===null?ae=_t:Ee.next=_t,Ee=lt;var Gt=g.alternate;Gt!==null&&(Gt=Gt.updateQueue,Ve=Gt.lastBaseUpdate,Ve!==Ee&&(Ve===null?Gt.firstBaseUpdate=_t:Ve.next=_t,Gt.lastBaseUpdate=lt))}if(ae!==null){var kn=W.baseState;Ee=0,Gt=_t=lt=null,Ve=ae;do{var Rt=Ve.lane,qr=Ve.eventTime;if((q&Rt)===Rt){Gt!==null&&(Gt=Gt.next={eventTime:qr,lane:0,tag:Ve.tag,payload:Ve.payload,callback:Ve.callback,next:null});e:{var xr=g,So=Ve;switch(Rt=v,qr=C,So.tag){case 1:if(xr=So.payload,typeof xr=="function"){kn=xr.call(qr,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(qr,kn,Rt):xr,Rt==null)break e;kn=a({},kn,Rt);break e;case 2:Ni=!0}}Ve.callback!==null&&Ve.lane!==0&&(g.flags|=64,Rt=W.effects,Rt===null?W.effects=[Ve]:Rt.push(Ve))}else qr={eventTime:qr,lane:Rt,tag:Ve.tag,payload:Ve.payload,callback:Ve.callback,next:null},Gt===null?(_t=Gt=qr,lt=kn):Gt=Gt.next=qr,Ee|=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&&(lt=kn),W.baseState=lt,W.firstBaseUpdate=_t,W.lastBaseUpdate=Gt,v=W.shared.interleaved,v!==null){W=v;do Ee|=W.lane,W=W.next;while(W!==v)}else ae===null&&(W.shared.lanes=0);Js|=Ee,g.lanes=Ee,g.memoizedState=kn}}function ri(g,v,C){if(g=v.effects,v.effects=null,g!==null)for(v=0;v<g.length;v++){var q=g[v],W=q.callback;if(W!==null){if(q.callback=null,q=C,typeof W!="function")throw Error(o(191,W));W.call(q)}}}var Yo={},pi=wi(Yo),Ta=wi(Yo),Ro=wi(Yo);function pa(g){if(g===Yo)throw Error(o(174));return g}function bl(g,v){wn(Ro,v),wn(Ta,g),wn(pi,Yo),g=ee(v),pr(pi),wn(pi,g)}function Xo(){pr(pi),pr(Ta),pr(Ro)}function ps(g){var v=pa(Ro.current),C=pa(pi.current);v=Q(C,g.type,v),C!==v&&(wn(Ta,g),wn(pi,v))}function gs(g){Ta.current===g&&(pr(pi),pr(Ta))}var nr=wi(0);function ms(g){for(var v=g;v!==null;){if(v.tag===13){var C=v.memoizedState;if(C!==null&&(C=C.dehydrated,C===null||Zi(C)||$n(C)))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===g)break;for(;v.sibling===null;){if(v.return===null||v.return===g)return null;v=v.return}v.sibling.return=v.return,v=v.sibling}return null}var vs=[];function Vs(){for(var g=0;g<vs.length;g++){var v=vs[g];we?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(g,v){if(v===null)return!1;for(var C=0;C<v.length&&C<g.length;C++)if(!La(g[C],v[C]))return!1;return!0}function bu(g,v,C,q,W,ae){if(Rn=ae,fn=v,v.memoizedState=null,v.updateQueue=null,v.lanes=0,Nr.current=g===null||g.memoizedState===null?nc:Gl,g=C(q,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,g=C(q,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 g}function Qu(){var g=ys!==0;return ys=0,g}function Qa(){var g={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mn===null?fn.memoizedState=Mn=g:Mn=Mn.next=g,Mn}function Gi(){if(Pn===null){var g=fn.alternate;g=g!==null?g.memoizedState:null}else g=Pn.next;var v=Mn===null?fn.memoizedState:Mn.next;if(v!==null)Mn=v,Pn=g;else{if(g===null)throw Error(o(310));Pn=g,g={memoizedState:Pn.memoizedState,baseState:Pn.baseState,baseQueue:Pn.baseQueue,queue:Pn.queue,next:null},Mn===null?fn.memoizedState=Mn=g:Mn=Mn.next=g}return Mn}function Ko(g,v){return typeof v=="function"?v(g):v}function Ju(g){var v=Gi(),C=v.queue;if(C===null)throw Error(o(311));C.lastRenderedReducer=g;var q=Pn,W=q.baseQueue,ae=C.pending;if(ae!==null){if(W!==null){var Ee=W.next;W.next=ae.next,ae.next=Ee}q.baseQueue=W=ae,C.pending=null}if(W!==null){ae=W.next,q=q.baseState;var Ve=Ee=null,lt=null,_t=ae;do{var Gt=_t.lane;if((Rn&Gt)===Gt)lt!==null&&(lt=lt.next={lane:0,action:_t.action,hasEagerState:_t.hasEagerState,eagerState:_t.eagerState,next:null}),q=_t.hasEagerState?_t.eagerState:g(q,_t.action);else{var kn={lane:Gt,action:_t.action,hasEagerState:_t.hasEagerState,eagerState:_t.eagerState,next:null};lt===null?(Ve=lt=kn,Ee=q):lt=lt.next=kn,fn.lanes|=Gt,Js|=Gt}_t=_t.next}while(_t!==null&&_t!==ae);lt===null?Ee=q:lt.next=Ve,La(q,v.memoizedState)||(ki=!0),v.memoizedState=q,v.baseState=Ee,v.baseQueue=lt,C.lastRenderedState=q}if(g=C.interleaved,g!==null){W=g;do ae=W.lane,fn.lanes|=ae,Js|=ae,W=W.next;while(W!==g)}else W===null&&(C.lanes=0);return[v.memoizedState,C.dispatch]}function zl(g){var v=Gi(),C=v.queue;if(C===null)throw Error(o(311));C.lastRenderedReducer=g;var q=C.dispatch,W=C.pending,ae=v.memoizedState;if(W!==null){C.pending=null;var Ee=W=W.next;do ae=g(ae,Ee.action),Ee=Ee.next;while(Ee!==W);La(ae,v.memoizedState)||(ki=!0),v.memoizedState=ae,v.baseQueue===null&&(v.baseState=ae),C.lastRenderedState=ae}return[ae,q]}function Ic(){}function jc(g,v){var C=fn,q=Gi(),W=v(),ae=!La(q.memoizedState,W);if(ae&&(q.memoizedState=W,ki=!0),q=q.queue,Hl(Bc.bind(null,C,q,g),[g]),q.getSnapshot!==v||ae||Mn!==null&&Mn.memoizedState.tag&1){if(C.flags|=2048,Ri(9,Fc.bind(null,C,q,W,v),void 0,null),Bn===null)throw Error(o(349));(Rn&30)!==0||Dc(C,v,W)}return W}function Dc(g,v,C){g.flags|=16384,g={getSnapshot:v,value:C},v=fn.updateQueue,v===null?(v={lastEffect:null,stores:null},fn.updateQueue=v,v.stores=[g]):(C=v.stores,C===null?v.stores=[g]:C.push(g))}function Fc(g,v,C,q){v.value=C,v.getSnapshot=q,zc(v)&&Zo(g)}function Bc(g,v,C){return C(function(){zc(v)&&Zo(g)})}function zc(g){var v=g.getSnapshot;g=g.value;try{var C=v();return!La(g,C)}catch{return!0}}function Zo(g){var v=$i(g,1);v!==null&&_a(v,g,1,-1)}function ql(g){var v=Qa();return typeof g=="function"&&(g=g()),v.memoizedState=v.baseState=g,g={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:g},v.queue=g,g=g.dispatch=Nd.bind(null,fn,g),[v.memoizedState,g]}function Ri(g,v,C,q){return g={tag:g,create:v,destroy:C,deps:q,next:null},v=fn.updateQueue,v===null?(v={lastEffect:null,stores:null},fn.updateQueue=v,v.lastEffect=g.next=g):(C=v.lastEffect,C===null?v.lastEffect=g.next=g:(q=C.next,C.next=g,g.next=q,v.lastEffect=g)),g}function mo(){return Gi().memoizedState}function Ul(g,v,C,q){var W=Qa();fn.flags|=g,W.memoizedState=Ri(1|v,C,void 0,q===void 0?null:q)}function Qo(g,v,C,q){var W=Gi();q=q===void 0?null:q;var ae=void 0;if(Pn!==null){var Ee=Pn.memoizedState;if(ae=Ee.destroy,q!==null&&wl(q,Ee.deps)){W.memoizedState=Ri(v,C,ae,q);return}}fn.flags|=g,W.memoizedState=Ri(1|v,C,ae,q)}function jf(g,v){return Ul(8390656,8,g,v)}function Hl(g,v){return Qo(2048,8,g,v)}function wu(g,v){return Qo(4,2,g,v)}function gr(g,v){return Qo(4,4,g,v)}function ec(g,v){if(typeof v=="function")return g=g(),v(g),function(){v(null)};if(v!=null)return g=g(),v.current=g,function(){v.current=null}}function $l(g,v,C){return C=C!=null?C.concat([g]):null,Qo(4,4,ec.bind(null,v,g),C)}function Ks(){}function xu(g,v){var C=Gi();v=v===void 0?null:v;var q=C.memoizedState;return q!==null&&v!==null&&wl(v,q[1])?q[0]:(C.memoizedState=[g,v],g)}function _u(g,v){var C=Gi();v=v===void 0?null:v;var q=C.memoizedState;return q!==null&&v!==null&&wl(v,q[1])?q[0]:(g=g(),C.memoizedState=[g,v],g)}function Su(g,v,C){return(Rn&21)===0?(g.baseState&&(g.baseState=!1,ki=!0),g.memoizedState=C):(La(C,v)||(C=Il(),fn.lanes|=C,Js|=C,g.baseState=!0),v)}function qc(g,v){var C=Ln;Ln=C!==0&&4>C?C:4,g(!0);var q=ga.transition;ga.transition={};try{g(!1),v()}finally{Ln=C,ga.transition=q}}function xl(){return Gi().memoizedState}function Nh(g,v,C){var q=Oi(g);if(C={lane:q,action:C,hasEagerState:!1,eagerState:null,next:null},Th(g))Df(v,C);else if(C=Bl(g,v,C,q),C!==null){var W=Ar();_a(C,g,q,W),tc(C,v,q)}}function Nd(g,v,C){var q=Oi(g),W={lane:q,action:C,hasEagerState:!1,eagerState:null,next:null};if(Th(g))Df(v,W);else{var ae=g.alternate;if(g.lanes===0&&(ae===null||ae.lanes===0)&&(ae=v.lastRenderedReducer,ae!==null))try{var Ee=v.lastRenderedState,Ve=ae(Ee,C);if(W.hasEagerState=!0,W.eagerState=Ve,La(Ve,Ee)){var lt=v.interleaved;lt===null?(W.next=W,yl(v)):(W.next=lt.next,lt.next=W),v.interleaved=W;return}}catch{}C=Bl(g,v,W,q),C!==null&&(W=Ar(),_a(C,g,q,W),tc(C,v,q))}}function Th(g){var v=g.alternate;return g===fn||v!==null&&v===fn}function Df(g,v){Ys=Za=!0;var C=g.pending;C===null?v.next=v:(v.next=C.next,C.next=v),g.pending=v}function tc(g,v,C){if((C&4194240)!==0){var q=v.lanes;q&=g.pendingLanes,C|=q,v.lanes=C,Ua(g,C)}}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},nc={readContext:Fr,useCallback:function(g,v){return Qa().memoizedState=[g,v===void 0?null:v],g},useContext:Fr,useEffect:jf,useImperativeHandle:function(g,v,C){return C=C!=null?C.concat([g]):null,Ul(4194308,4,ec.bind(null,v,g),C)},useLayoutEffect:function(g,v){return Ul(4194308,4,g,v)},useInsertionEffect:function(g,v){return Ul(4,2,g,v)},useMemo:function(g,v){var C=Qa();return v=v===void 0?null:v,g=g(),C.memoizedState=[g,v],g},useReducer:function(g,v,C){var q=Qa();return v=C!==void 0?C(v):v,q.memoizedState=q.baseState=v,g={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:g,lastRenderedState:v},q.queue=g,g=g.dispatch=Nh.bind(null,fn,g),[q.memoizedState,g]},useRef:function(g){var v=Qa();return g={current:g},v.memoizedState=g},useState:ql,useDebugValue:Ks,useDeferredValue:function(g){return Qa().memoizedState=g},useTransition:function(){var g=ql(!1),v=g[0];return g=qc.bind(null,g[1]),Qa().memoizedState=g,[v,g]},useMutableSource:function(){},useSyncExternalStore:function(g,v,C){var q=fn,W=Qa();if(pt){if(C===void 0)throw Error(o(407));C=C()}else{if(C=v(),Bn===null)throw Error(o(349));(Rn&30)!==0||Dc(q,v,C)}W.memoizedState=C;var ae={value:C,getSnapshot:v};return W.queue=ae,jf(Bc.bind(null,q,ae,g),[g]),q.flags|=2048,Ri(9,Fc.bind(null,q,ae,C,v),void 0,null),C},useId:function(){var g=Qa(),v=Bn.identifierPrefix;if(pt){var C=Va,q=_i;C=(q&~(1<<32-Ca(q)-1)).toString(32)+C,v=":"+v+"R"+C,C=ys++,0<C&&(v+="H"+C.toString(32)),v+=":"}else C=Xs++,v=":"+v+"r"+C.toString(32)+":";return g.memoizedState=v},unstable_isNewReconciler:!1},Gl={readContext:Fr,useCallback:xu,useContext:Fr,useEffect:Hl,useImperativeHandle:$l,useInsertionEffect:wu,useLayoutEffect:gr,useMemo:_u,useReducer:Ju,useRef:mo,useState:function(){return Ju(Ko)},useDebugValue:Ks,useDeferredValue:function(g){var v=Gi();return Su(v,Pn.memoizedState,g)},useTransition:function(){var g=Ju(Ko)[0],v=Gi().memoizedState;return[g,v]},useMutableSource:Ic,useSyncExternalStore:jc,useId:xl,unstable_isNewReconciler:!1},Ff={readContext:Fr,useCallback:xu,useContext:Fr,useEffect:Hl,useImperativeHandle:$l,useInsertionEffect:wu,useLayoutEffect:gr,useMemo:_u,useReducer:zl,useRef:mo,useState:function(){return zl(Ko)},useDebugValue:Ks,useDeferredValue:function(g){var v=Gi();return Pn===null?v.memoizedState=g:Su(v,Pn.memoizedState,g)},useTransition:function(){var g=zl(Ko)[0],v=Gi().memoizedState;return[g,v]},useMutableSource:Ic,useSyncExternalStore:jc,useId:xl,unstable_isNewReconciler:!1};function vo(g,v){if(g&&g.defaultProps){v=a({},v),g=g.defaultProps;for(var C in g)v[C]===void 0&&(v[C]=g[C]);return v}return v}function Uc(g,v,C,q){v=g.memoizedState,C=C(q,v),C=C==null?v:a({},v,C),g.memoizedState=C,g.lanes===0&&(g.updateQueue.baseState=C)}var rc={isMounted:function(g){return(g=g._reactInternals)?j(g)===g:!1},enqueueSetState:function(g,v,C){g=g._reactInternals;var q=Ar(),W=Oi(g),ae=da(q,W);ae.payload=v,C!=null&&(ae.callback=C),v=Qi(g,ae,W),v!==null&&(_a(v,g,W,q),To(v,g,W))},enqueueReplaceState:function(g,v,C){g=g._reactInternals;var q=Ar(),W=Oi(g),ae=da(q,W);ae.tag=1,ae.payload=v,C!=null&&(ae.callback=C),v=Qi(g,ae,W),v!==null&&(_a(v,g,W,q),To(v,g,W))},enqueueForceUpdate:function(g,v){g=g._reactInternals;var C=Ar(),q=Oi(g),W=da(C,q);W.tag=2,v!=null&&(W.callback=v),v=Qi(g,W,q),v!==null&&(_a(v,g,q,C),To(v,g,q))}};function Rh(g,v,C,q,W,ae,Ee){return g=g.stateNode,typeof g.shouldComponentUpdate=="function"?g.shouldComponentUpdate(q,ae,Ee):v.prototype&&v.prototype.isPureReactComponent?!Ya(C,q)||!Ya(W,ae):!0}function Mh(g,v,C){var q=!1,W=oo,ae=v.contextType;return typeof ae=="object"&&ae!==null?ae=Fr(ae):(W=Hr(v)?so:Ui.current,q=v.contextTypes,ae=(q=q!=null)?Hi(g,W):oo),v=new v(C,ae),g.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=rc,g.stateNode=v,v._reactInternals=g,q&&(g=g.stateNode,g.__reactInternalMemoizedUnmaskedChildContext=W,g.__reactInternalMemoizedMaskedChildContext=ae),v}function Hc(g,v,C,q){g=v.state,typeof v.componentWillReceiveProps=="function"&&v.componentWillReceiveProps(C,q),typeof v.UNSAFE_componentWillReceiveProps=="function"&&v.UNSAFE_componentWillReceiveProps(C,q),v.state!==g&&rc.enqueueReplaceState(v,v.state,null)}function Ji(g,v,C,q){var W=g.stateNode;W.props=C,W.state=g.memoizedState,W.refs={},Na(g);var ae=v.contextType;typeof ae=="object"&&ae!==null?W.context=Fr(ae):(ae=Hr(v)?so:Ui.current,W.context=Hi(g,ae)),W.state=g.memoizedState,ae=v.getDerivedStateFromProps,typeof ae=="function"&&(Uc(g,v,ae,C),W.state=g.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&&rc.enqueueReplaceState(W,W.state,null),go(g,C,W,q),W.state=g.memoizedState),typeof W.componentDidMount=="function"&&(g.flags|=4194308)}function ea(g,v){try{var C="",q=v;do C+=Us(q),q=q.return;while(q);var W=C}catch(ae){W=`
29
- Error generating stack: `+ae.message+`
30
- `+ae.stack}return{value:g,source:v,stack:W,digest:null}}function ma(g,v,C){return{value:g,source:null,stack:C??null,digest:v??null}}function Mo(g,v){try{console.error(v.value)}catch(C){setTimeout(function(){throw C})}}var Eu=typeof WeakMap=="function"?WeakMap:Map;function ta(g,v,C){C=da(-1,C),C.tag=3,C.payload={element:null};var q=v.value;return C.callback=function(){Yr||(Yr=!0,Xr=q),Mo(g,v)},C}function Ra(g,v,C){C=da(-1,C),C.tag=3;var q=g.type.getDerivedStateFromError;if(typeof q=="function"){var W=v.value;C.payload=function(){return q(W)},C.callback=function(){Mo(g,v)}}var ae=g.stateNode;return ae!==null&&typeof ae.componentDidCatch=="function"&&(C.callback=function(){Mo(g,v),typeof q!="function"&&(bo===null?bo=new Set([this]):bo.add(this));var Ee=v.stack;this.componentDidCatch(v.value,{componentStack:Ee!==null?Ee:""})}),C}function Ih(g,v,C){var q=g.pingCache;if(q===null){q=g.pingCache=new Eu;var W=new Set;q.set(v,W)}else W=q.get(v),W===void 0&&(W=new Set,q.set(v,W));W.has(C)||(W.add(C),g=Kp.bind(null,g,v,C),v.then(g,g))}function jh(g){do{var v;if((v=g.tag===13)&&(v=g.memoizedState,v=v!==null?v.dehydrated!==null:!0),v)return g;g=g.return}while(g!==null);return null}function Qs(g,v,C,q,W){return(g.mode&1)===0?(g===v?g.flags|=65536:(g.flags|=128,C.flags|=131072,C.flags&=-52805,C.tag===1&&(C.alternate===null?C.tag=17:(v=da(-1,1),v.tag=2,Qi(C,v,1))),C.lanes|=1),g):(g.flags|=65536,g.lanes=W,g)}var ku=s.ReactCurrentOwner,ki=!1;function Mi(g,v,C,q){v.child=g===null?Gs(v,null,C,q):ho(v,g.child,C,q)}function $c(g,v,C,q,W){C=C.render;var ae=v.ref;return Ws(v,W),q=bu(g,v,C,q,ae,W),C=Qu(),g!==null&&!ki?(v.updateQueue=g.updateQueue,v.flags&=-2053,g.lanes&=~W,V(g,v,W)):(pt&&C&&Oe(v),v.flags|=1,Mi(g,v,q,W),v.child)}function bs(g,v,C,q,W){if(g===null){var ae=C.type;return typeof ae=="function"&&!Xc(ae)&&ae.defaultProps===void 0&&C.compare===null&&C.defaultProps===void 0?(v.tag=15,v.type=ae,Io(g,v,ae,q,W)):(g=Bh(C.type,null,q,v,v.mode,W),g.ref=v.ref,g.return=v,v.child=g)}if(ae=g.child,(g.lanes&W)===0){var Ee=ae.memoizedProps;if(C=C.compare,C=C!==null?C:Ya,C(Ee,q)&&g.ref===v.ref)return V(g,v,W)}return v.flags|=1,g=Tu(ae,q),g.ref=v.ref,g.return=v,v.child=g}function Io(g,v,C,q,W){if(g!==null){var ae=g.memoizedProps;if(Ya(ae,q)&&g.ref===v.ref)if(ki=!1,v.pendingProps=q=ae,(g.lanes&W)!==0)(g.flags&131072)!==0&&(ki=!0);else return v.lanes=g.lanes,V(g,v,W)}return ws(g,v,C,q,W)}function rr(g,v,C){var q=v.pendingProps,W=q.children,ae=g!==null?g.memoizedState:null;if(q.mode==="hidden")if((v.mode&1)===0)v.memoizedState={baseLanes:0,cachePool:null,transitions:null},wn(Jo,mi),mi|=C;else{if((C&1073741824)===0)return g=ae!==null?ae.baseLanes|C:C,v.lanes=v.childLanes=1073741824,v.memoizedState={baseLanes:g,cachePool:null,transitions:null},v.updateQueue=null,wn(Jo,mi),mi|=g,null;v.memoizedState={baseLanes:0,cachePool:null,transitions:null},q=ae!==null?ae.baseLanes:C,wn(Jo,mi),mi|=q}else ae!==null?(q=ae.baseLanes|C,v.memoizedState=null):q=C,wn(Jo,mi),mi|=q;return Mi(g,v,W,C),v.child}function lr(g,v){var C=v.ref;(g===null&&C!==null||g!==null&&g.ref!==C)&&(v.flags|=512,v.flags|=2097152)}function ws(g,v,C,q,W){var ae=Hr(C)?so:Ui.current;return ae=Hi(v,ae),Ws(v,W),C=bu(g,v,C,q,ae,W),q=Qu(),g!==null&&!ki?(v.updateQueue=g.updateQueue,v.flags&=-2053,g.lanes&=~W,V(g,v,W)):(pt&&q&&Oe(v),v.flags|=1,Mi(g,v,C,W),v.child)}function Wi(g,v,C,q,W){if(Hr(C)){var ae=!0;Ba(v)}else ae=!1;if(Ws(v,W),v.stateNode===null)I(g,v),Mh(v,C,q),Ji(v,C,q,W),q=!0;else if(g===null){var Ee=v.stateNode,Ve=v.memoizedProps;Ee.props=Ve;var lt=Ee.context,_t=C.contextType;typeof _t=="object"&&_t!==null?_t=Fr(_t):(_t=Hr(C)?so:Ui.current,_t=Hi(v,_t));var Gt=C.getDerivedStateFromProps,kn=typeof Gt=="function"||typeof Ee.getSnapshotBeforeUpdate=="function";kn||typeof Ee.UNSAFE_componentWillReceiveProps!="function"&&typeof Ee.componentWillReceiveProps!="function"||(Ve!==q||lt!==_t)&&Hc(v,Ee,q,_t),Ni=!1;var Rt=v.memoizedState;Ee.state=Rt,go(v,q,Ee,W),lt=v.memoizedState,Ve!==q||Rt!==lt||Gn.current||Ni?(typeof Gt=="function"&&(Uc(v,C,Gt,q),lt=v.memoizedState),(Ve=Ni||Rh(v,C,Ve,q,Rt,lt,_t))?(kn||typeof Ee.UNSAFE_componentWillMount!="function"&&typeof Ee.componentWillMount!="function"||(typeof Ee.componentWillMount=="function"&&Ee.componentWillMount(),typeof Ee.UNSAFE_componentWillMount=="function"&&Ee.UNSAFE_componentWillMount()),typeof Ee.componentDidMount=="function"&&(v.flags|=4194308)):(typeof Ee.componentDidMount=="function"&&(v.flags|=4194308),v.memoizedProps=q,v.memoizedState=lt),Ee.props=q,Ee.state=lt,Ee.context=_t,q=Ve):(typeof Ee.componentDidMount=="function"&&(v.flags|=4194308),q=!1)}else{Ee=v.stateNode,Ka(g,v),Ve=v.memoizedProps,_t=v.type===v.elementType?Ve:vo(v.type,Ve),Ee.props=_t,kn=v.pendingProps,Rt=Ee.context,lt=C.contextType,typeof lt=="object"&&lt!==null?lt=Fr(lt):(lt=Hr(C)?so:Ui.current,lt=Hi(v,lt));var qr=C.getDerivedStateFromProps;(Gt=typeof qr=="function"||typeof Ee.getSnapshotBeforeUpdate=="function")||typeof Ee.UNSAFE_componentWillReceiveProps!="function"&&typeof Ee.componentWillReceiveProps!="function"||(Ve!==kn||Rt!==lt)&&Hc(v,Ee,q,lt),Ni=!1,Rt=v.memoizedState,Ee.state=Rt,go(v,q,Ee,W);var xr=v.memoizedState;Ve!==kn||Rt!==xr||Gn.current||Ni?(typeof qr=="function"&&(Uc(v,C,qr,q),xr=v.memoizedState),(_t=Ni||Rh(v,C,_t,q,Rt,xr,lt)||!1)?(Gt||typeof Ee.UNSAFE_componentWillUpdate!="function"&&typeof Ee.componentWillUpdate!="function"||(typeof Ee.componentWillUpdate=="function"&&Ee.componentWillUpdate(q,xr,lt),typeof Ee.UNSAFE_componentWillUpdate=="function"&&Ee.UNSAFE_componentWillUpdate(q,xr,lt)),typeof Ee.componentDidUpdate=="function"&&(v.flags|=4),typeof Ee.getSnapshotBeforeUpdate=="function"&&(v.flags|=1024)):(typeof Ee.componentDidUpdate!="function"||Ve===g.memoizedProps&&Rt===g.memoizedState||(v.flags|=4),typeof Ee.getSnapshotBeforeUpdate!="function"||Ve===g.memoizedProps&&Rt===g.memoizedState||(v.flags|=1024),v.memoizedProps=q,v.memoizedState=xr),Ee.props=q,Ee.state=xr,Ee.context=lt,q=_t):(typeof Ee.componentDidUpdate!="function"||Ve===g.memoizedProps&&Rt===g.memoizedState||(v.flags|=4),typeof Ee.getSnapshotBeforeUpdate!="function"||Ve===g.memoizedProps&&Rt===g.memoizedState||(v.flags|=1024),q=!1)}return va(g,v,C,q,ae,W)}function va(g,v,C,q,W,ae){lr(g,v);var Ee=(v.flags&128)!==0;if(!q&&!Ee)return W&&pu(v,C,!1),V(g,v,ae);q=v.stateNode,ku.current=v;var Ve=Ee&&typeof C.getDerivedStateFromError!="function"?null:q.render();return v.flags|=1,g!==null&&Ee?(v.child=ho(v,g.child,null,ae),v.child=ho(v,null,Ve,ae)):Mi(g,v,Ve,ae),v.memoizedState=q.state,W&&pu(v,C,!0),v.child}function _l(g){var v=g.stateNode;v.pendingContext?lo(g,v.pendingContext,v.pendingContext!==v.context):v.context&&lo(g,v.context,!1),bl(g,v.containerInfo)}function Wl(g,v,C,q,W){return kr(),Li(W),v.flags|=256,Mi(g,v,C,q),v.child}var ya={dehydrated:null,treeContext:null,retryLane:0};function Au(g){return{baseLanes:g,cachePool:null,transitions:null}}function Bf(g,v,C){var q=v.pendingProps,W=nr.current,ae=!1,Ee=(v.flags&128)!==0,Ve;if((Ve=Ee)||(Ve=g!==null&&g.memoizedState===null?!1:(W&2)!==0),Ve?(ae=!0,v.flags&=-129):(g===null||g.memoizedState!==null)&&(W|=1),wn(nr,W&1),g===null)return Lr(v),g=v.memoizedState,g!==null&&(g=g.dehydrated,g!==null)?((v.mode&1)===0?v.lanes=1:$n(g)?v.lanes=8:v.lanes=1073741824,null):(Ee=q.children,g=q.fallback,ae?(q=v.mode,ae=v.child,Ee={mode:"hidden",children:Ee},(q&1)===0&&ae!==null?(ae.childLanes=0,ae.pendingProps=Ee):ae=Kc(Ee,q,0,null),g=Ma(g,q,C,null),ae.return=v,g.return=v,ae.sibling=g,v.child=ae,v.child.memoizedState=Au(C),v.memoizedState=ya,g):ic(v,Ee));if(W=g.memoizedState,W!==null&&(Ve=W.dehydrated,Ve!==null))return Dh(g,v,Ee,q,Ve,W,C);if(ae){ae=q.fallback,Ee=v.mode,W=g.child,Ve=W.sibling;var lt={mode:"hidden",children:q.children};return(Ee&1)===0&&v.child!==W?(q=v.child,q.childLanes=0,q.pendingProps=lt,v.deletions=null):(q=Tu(W,lt),q.subtreeFlags=W.subtreeFlags&14680064),Ve!==null?ae=Tu(Ve,ae):(ae=Ma(ae,Ee,C,null),ae.flags|=2),ae.return=v,q.return=v,q.sibling=ae,v.child=q,q=ae,ae=v.child,Ee=g.child.memoizedState,Ee=Ee===null?Au(C):{baseLanes:Ee.baseLanes|C,cachePool:null,transitions:Ee.transitions},ae.memoizedState=Ee,ae.childLanes=g.childLanes&~C,v.memoizedState=ya,q}return ae=g.child,g=ae.sibling,q=Tu(ae,{mode:"visible",children:q.children}),(v.mode&1)===0&&(q.lanes=C),q.return=v,q.sibling=null,g!==null&&(C=v.deletions,C===null?(v.deletions=[g],v.flags|=16):C.push(g)),v.child=q,v.memoizedState=null,q}function ic(g,v){return v=Kc({mode:"visible",children:v},g.mode,0,null),v.return=g,g.child=v}function xs(g,v,C,q){return q!==null&&Li(q),ho(v,g.child,null,C),g=ic(v,v.pendingProps.children),g.flags|=2,v.memoizedState=null,g}function Dh(g,v,C,q,W,ae,Ee){if(C)return v.flags&256?(v.flags&=-257,q=ma(Error(o(422))),xs(g,v,Ee,q)):v.memoizedState!==null?(v.child=g.child,v.flags|=128,null):(ae=q.fallback,W=v.mode,q=Kc({mode:"visible",children:q.children},W,0,null),ae=Ma(ae,W,Ee,null),ae.flags|=2,q.return=v,ae.return=v,q.sibling=ae,v.child=q,(v.mode&1)!==0&&ho(v,g.child,null,Ee),v.child.memoizedState=Au(Ee),v.memoizedState=ya,ae);if((v.mode&1)===0)return xs(g,v,Ee,null);if($n(W))return q=Or(W).digest,ae=Error(o(419)),q=ma(ae,q,void 0),xs(g,v,Ee,q);if(C=(Ee&g.childLanes)!==0,ki||C){if(q=Bn,q!==null){switch(Ee&-Ee){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&(q.suspendedLanes|Ee))!==0?0:W,W!==0&&W!==ae.retryLane&&(ae.retryLane=W,$i(g,W),_a(q,g,W,-1))}return _o(),q=ma(Error(o(421))),xs(g,v,Ee,q)}return Zi(W)?(v.flags|=128,v.child=g.child,v=Qp.bind(null,g),Dr(W,v),null):(g=ae.treeContext,ze&&(ht=io(W),$e=v,pt=!0,jt=null,Ft=!1,g!==null&&($r[hi++]=_i,$r[hi++]=Va,$r[hi++]=ni,_i=g.id,Va=g.overflow,ni=v)),v=ic(v,q.children),v.flags|=4096,v)}function _s(g,v,C){g.lanes|=v;var q=g.alternate;q!==null&&(q.lanes|=v),No(g.return,v,C)}function Vl(g,v,C,q,W){var ae=g.memoizedState;ae===null?g.memoizedState={isBackwards:v,rendering:null,renderingStartTime:0,last:q,tail:C,tailMode:W}:(ae.isBackwards=v,ae.rendering=null,ae.renderingStartTime=0,ae.last=q,ae.tail=C,ae.tailMode=W)}function P(g,v,C){var q=v.pendingProps,W=q.revealOrder,ae=q.tail;if(Mi(g,v,q.children,C),q=nr.current,(q&2)!==0)q=q&1|2,v.flags|=128;else{if(g!==null&&(g.flags&128)!==0)e:for(g=v.child;g!==null;){if(g.tag===13)g.memoizedState!==null&&_s(g,C,v);else if(g.tag===19)_s(g,C,v);else if(g.child!==null){g.child.return=g,g=g.child;continue}if(g===v)break e;for(;g.sibling===null;){if(g.return===null||g.return===v)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}q&=1}if(wn(nr,q),(v.mode&1)===0)v.memoizedState=null;else switch(W){case"forwards":for(C=v.child,W=null;C!==null;)g=C.alternate,g!==null&&ms(g)===null&&(W=C),C=C.sibling;C=W,C===null?(W=v.child,v.child=null):(W=C.sibling,C.sibling=null),Vl(v,!1,W,C,ae);break;case"backwards":for(C=null,W=v.child,v.child=null;W!==null;){if(g=W.alternate,g!==null&&ms(g)===null){v.child=W;break}g=W.sibling,W.sibling=C,C=W,W=g}Vl(v,!0,C,null,ae);break;case"together":Vl(v,!1,null,null,void 0);break;default:v.memoizedState=null}return v.child}function I(g,v){(v.mode&1)===0&&g!==null&&(g.alternate=null,v.alternate=null,v.flags|=2)}function V(g,v,C){if(g!==null&&(v.dependencies=g.dependencies),Js|=v.lanes,(C&v.childLanes)===0)return null;if(g!==null&&v.child!==g.child)throw Error(o(153));if(v.child!==null){for(g=v.child,C=Tu(g,g.pendingProps),v.child=C,C.return=v;g.sibling!==null;)g=g.sibling,C=C.sibling=Tu(g,g.pendingProps),C.return=v;C.sibling=null}return v.child}function ne(g,v,C){switch(v.tag){case 3:_l(v),kr();break;case 5:ps(v);break;case 1:Hr(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 q=v.memoizedState;if(q!==null)return q.dehydrated!==null?(wn(nr,nr.current&1),v.flags|=128,null):(C&v.child.childLanes)!==0?Bf(g,v,C):(wn(nr,nr.current&1),g=V(g,v,C),g!==null?g.sibling:null);wn(nr,nr.current&1);break;case 19:if(q=(C&v.childLanes)!==0,(g.flags&128)!==0){if(q)return P(g,v,C);v.flags|=128}var W=v.memoizedState;if(W!==null&&(W.rendering=null,W.tail=null,W.lastEffect=null),wn(nr,nr.current),q)break;return null;case 22:case 23:return v.lanes=0,rr(g,v,C)}return V(g,v,C)}function le(g){g.flags|=4}function pe(g,v){if(g!==null&&g.child===v.child)return!0;if((v.flags&16)!==0)return!1;for(g=v.child;g!==null;){if((g.flags&12854)!==0||(g.subtreeFlags&12854)!==0)return!1;g=g.sibling}return!0}var me,_e,Se,Pe;if(Ce)me=function(g,v){for(var C=v.child;C!==null;){if(C.tag===5||C.tag===6)F(g,C.stateNode);else if(C.tag!==4&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===v)break;for(;C.sibling===null;){if(C.return===null||C.return===v)return;C=C.return}C.sibling.return=C.return,C=C.sibling}},_e=function(){},Se=function(g,v,C,q,W){if(g=g.memoizedProps,g!==q){var ae=v.stateNode,Ee=pa(pi.current);C=Y(ae,C,g,q,W,Ee),(v.updateQueue=C)&&le(v)}},Pe=function(g,v,C,q){C!==q&&le(v)};else if(Ue){me=function(g,v,C,q){for(var W=v.child;W!==null;){if(W.tag===5){var ae=W.stateNode;C&&q&&(ae=dr(ae,W.type,W.memoizedProps,W)),F(g,ae)}else if(W.tag===6)ae=W.stateNode,C&&q&&(ae=Qt(ae,W.memoizedProps,W)),F(g,ae);else if(W.tag!==4){if(W.tag===22&&W.memoizedState!==null)ae=W.child,ae!==null&&(ae.return=W),me(g,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(g,v,C,q){for(var W=v.child;W!==null;){if(W.tag===5){var ae=W.stateNode;C&&q&&(ae=dr(ae,W.type,W.memoizedProps,W)),ui(g,ae)}else if(W.tag===6)ae=W.stateNode,C&&q&&(ae=Qt(ae,W.memoizedProps,W)),ui(g,ae);else if(W.tag!==4){if(W.tag===22&&W.memoizedState!==null)ae=W.child,ae!==null&&(ae.return=W),De(g,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}};_e=function(g,v){var C=v.stateNode;if(!pe(g,v)){g=C.containerInfo;var q=hn(g);De(q,v,!1,!1),C.pendingChildren=q,le(v),Ur(g,q)}},Se=function(g,v,C,q,W){var ae=g.stateNode,Ee=g.memoizedProps;if((g=pe(g,v))&&Ee===q)v.stateNode=ae;else{var Ve=v.stateNode,lt=pa(pi.current),_t=null;Ee!==q&&(_t=Y(Ve,C,Ee,q,W,lt)),g&&_t===null?v.stateNode=ae:(ae=Ht(ae,_t,C,Ee,q,v,g,Ve),z(ae,C,q,W,lt)&&le(v),v.stateNode=ae,g?le(v):me(ae,v,!1,!1))}},Pe=function(g,v,C,q){C!==q?(g=pa(Ro.current),C=pa(pi.current),v.stateNode=K(q,g,C,v),le(v)):v.stateNode=g.stateNode}}else _e=function(){},Se=function(){},Pe=function(){};function Qe(g,v){if(!pt)switch(g.tailMode){case"hidden":v=g.tail;for(var C=null;v!==null;)v.alternate!==null&&(C=v),v=v.sibling;C===null?g.tail=null:C.sibling=null;break;case"collapsed":C=g.tail;for(var q=null;C!==null;)C.alternate!==null&&(q=C),C=C.sibling;q===null?v||g.tail===null?g.tail=null:g.tail.sibling=null:q.sibling=null}}function Ae(g){var v=g.alternate!==null&&g.alternate.child===g.child,C=0,q=0;if(v)for(var W=g.child;W!==null;)C|=W.lanes|W.childLanes,q|=W.subtreeFlags&14680064,q|=W.flags&14680064,W.return=g,W=W.sibling;else for(W=g.child;W!==null;)C|=W.lanes|W.childLanes,q|=W.subtreeFlags,q|=W.flags,W.return=g,W=W.sibling;return g.subtreeFlags|=q,g.childLanes=C,v}function He(g,v,C){var q=v.pendingProps;switch(je(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 Hr(v.type)&&ls(),Ae(v),null;case 3:return C=v.stateNode,Xo(),pr(Gn),pr(Ui),Vs(),C.pendingContext&&(C.context=C.pendingContext,C.pendingContext=null),(g===null||g.child===null)&&(sr(v)?le(v):g===null||g.memoizedState.isDehydrated&&(v.flags&256)===0||(v.flags|=1024,jt!==null&&(ac(jt),jt=null))),_e(g,v),Ae(v),null;case 5:gs(v),C=pa(Ro.current);var W=v.type;if(g!==null&&v.stateNode!=null)Se(g,v,W,q,C),g.ref!==v.ref&&(v.flags|=512,v.flags|=2097152);else{if(!q){if(v.stateNode===null)throw Error(o(166));return Ae(v),null}if(g=pa(pi.current),sr(v)){if(!ze)throw Error(o(175));g=ci(v.stateNode,v.type,v.memoizedProps,C,g,v,!Ft),v.updateQueue=g,g!==null&&le(v)}else{var ae=B(W,q,C,g,v);me(ae,v,!1,!1),v.stateNode=ae,z(ae,W,q,C,g)&&le(v)}v.ref!==null&&(v.flags|=512,v.flags|=2097152)}return Ae(v),null;case 6:if(g&&v.stateNode!=null)Pe(g,v,g.memoizedProps,q);else{if(typeof q!="string"&&v.stateNode===null)throw Error(o(166));if(g=pa(Ro.current),C=pa(pi.current),sr(v)){if(!ze)throw Error(o(176));if(g=v.stateNode,C=v.memoizedProps,(q=Aa(g,C,v,!Ft))&&(W=$e,W!==null))switch(W.tag){case 3:If(W.stateNode.containerInfo,g,C,(W.mode&1)!==0);break;case 5:Cr(W.type,W.memoizedProps,W.stateNode,g,C,(W.mode&1)!==0)}q&&le(v)}else v.stateNode=K(q,g,C,v)}return Ae(v),null;case 13:if(pr(nr),q=v.memoizedState,g===null||g.memoizedState!==null&&g.memoizedState.dehydrated!==null){if(pt&&ht!==null&&(v.mode&1)!==0&&(v.flags&128)===0)Si(),kr(),v.flags|=98560,W=!1;else if(W=sr(v),q!==null&&q.dehydrated!==null){if(g===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&&(ac(jt),jt=null),W=!0;if(!W)return v.flags&65536?v:null}return(v.flags&128)!==0?(v.lanes=C,v):(C=q!==null,C!==(g!==null&&g.memoizedState!==null)&&C&&(v.child.flags|=8192,(v.mode&1)!==0&&(g===null||(nr.current&1)!==0?mr===0&&(mr=3):_o())),v.updateQueue!==null&&(v.flags|=4),Ae(v),null);case 4:return Xo(),_e(g,v),g===null&&ge(v.stateNode.containerInfo),Ae(v),null;case 10:return po(v.type._context),Ae(v),null;case 17:return Hr(v.type)&&ls(),Ae(v),null;case 19:if(pr(nr),W=v.memoizedState,W===null)return Ae(v),null;if(q=(v.flags&128)!==0,ae=W.rendering,ae===null)if(q)Qe(W,!1);else{if(mr!==0||g!==null&&(g.flags&128)!==0)for(g=v.child;g!==null;){if(ae=ms(g),ae!==null){for(v.flags|=128,Qe(W,!1),g=ae.updateQueue,g!==null&&(v.updateQueue=g,v.flags|=4),v.subtreeFlags=0,g=C,C=v.child;C!==null;)q=C,W=g,q.flags&=14680066,ae=q.alternate,ae===null?(q.childLanes=0,q.lanes=W,q.child=null,q.subtreeFlags=0,q.memoizedProps=null,q.memoizedState=null,q.updateQueue=null,q.dependencies=null,q.stateNode=null):(q.childLanes=ae.childLanes,q.lanes=ae.lanes,q.child=ae.child,q.subtreeFlags=0,q.deletions=null,q.memoizedProps=ae.memoizedProps,q.memoizedState=ae.memoizedState,q.updateQueue=ae.updateQueue,q.type=ae.type,W=ae.dependencies,q.dependencies=W===null?null:{lanes:W.lanes,firstContext:W.firstContext}),C=C.sibling;return wn(nr,nr.current&1|2),v.child}g=g.sibling}W.tail!==null&&Er()>Cu&&(v.flags|=128,q=!0,Qe(W,!1),v.lanes=4194304)}else{if(!q)if(g=ms(ae),g!==null){if(v.flags|=128,q=!0,g=g.updateQueue,g!==null&&(v.updateQueue=g,v.flags|=4),Qe(W,!0),W.tail===null&&W.tailMode==="hidden"&&!ae.alternate&&!pt)return Ae(v),null}else 2*Er()-W.renderingStartTime>Cu&&C!==1073741824&&(v.flags|=128,q=!0,Qe(W,!1),v.lanes=4194304);W.isBackwards?(ae.sibling=v.child,v.child=ae):(g=W.last,g!==null?g.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,g=nr.current,wn(nr,q?g&1|2:g&1),v):(Ae(v),null);case 22:case 23:return Nu(),C=v.memoizedState!==null,g!==null&&g.memoizedState!==null!==C&&(v.flags|=8192),C&&(v.mode&1)!==0?(mi&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 Ze(g,v){switch(je(v),v.tag){case 1:return Hr(v.type)&&ls(),g=v.flags,g&65536?(v.flags=g&-65537|128,v):null;case 3:return Xo(),pr(Gn),pr(Ui),Vs(),g=v.flags,(g&65536)!==0&&(g&128)===0?(v.flags=g&-65537|128,v):null;case 5:return gs(v),null;case 13:if(pr(nr),g=v.memoizedState,g!==null&&g.dehydrated!==null){if(v.alternate===null)throw Error(o(340));kr()}return g=v.flags,g&65536?(v.flags=g&-65537|128,v):null;case 19:return pr(nr),null;case 4:return Xo(),null;case 10:return po(v.type._context),null;case 22:case 23:return Nu(),null;case 24:return null;default:return null}}var dt=!1,Ye=!1,ft=typeof WeakSet=="function"?WeakSet:Set,qe=null;function mt(g,v){var C=g.ref;if(C!==null)if(typeof C=="function")try{C(null)}catch(q){Zr(g,v,q)}else C.current=null}function vt(g,v,C){try{C()}catch(q){Zr(g,v,q)}}var Yt=!1;function zt(g,v){for(re(g.containerInfo),qe=v;qe!==null;)if(g=qe,v=g.child,(g.subtreeFlags&1028)!==0&&v!==null)v.return=g,qe=v;else for(;qe!==null;){g=qe;try{var C=g.alternate;if((g.flags&1024)!==0)switch(g.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var q=C.memoizedProps,W=C.memoizedState,ae=g.stateNode,Ee=ae.getSnapshotBeforeUpdate(g.elementType===g.type?q:vo(g.type,q),W);ae.__reactInternalSnapshotBeforeUpdate=Ee}break;case 3:Ce&&on(g.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Ve){Zr(g,g.return,Ve)}if(v=g.sibling,v!==null){v.return=g.return,qe=v;break}qe=g.return}return C=Yt,Yt=!1,C}function vn(g,v,C){var q=v.updateQueue;if(q=q!==null?q.lastEffect:null,q!==null){var W=q=q.next;do{if((W.tag&g)===g){var ae=W.destroy;W.destroy=void 0,ae!==void 0&&vt(v,C,ae)}W=W.next}while(W!==q)}}function qt(g,v){if(v=v.updateQueue,v=v!==null?v.lastEffect:null,v!==null){var C=v=v.next;do{if((C.tag&g)===g){var q=C.create;C.destroy=q()}C=C.next}while(C!==v)}}function Nn(g){var v=g.ref;if(v!==null){var C=g.stateNode;g.tag===5?g=se(C):g=C,typeof v=="function"?v(g):v.current=g}}function Gr(g){var v=g.alternate;v!==null&&(g.alternate=null,Gr(v)),g.child=null,g.deletions=null,g.sibling=null,g.tag===5&&(v=g.stateNode,v!==null&&ke(v)),g.stateNode=null,g.return=null,g.dependencies=null,g.memoizedProps=null,g.memoizedState=null,g.pendingProps=null,g.stateNode=null,g.updateQueue=null}function _n(g){return g.tag===5||g.tag===3||g.tag===4}function Bt(g){e:for(;;){for(;g.sibling===null;){if(g.return===null||_n(g.return))return null;g=g.return}for(g.sibling.return=g.return,g=g.sibling;g.tag!==5&&g.tag!==6&&g.tag!==18;){if(g.flags&2||g.child===null||g.tag===4)continue e;g.child.return=g,g=g.child}if(!(g.flags&2))return g.stateNode}}function kt(g,v,C){var q=g.tag;if(q===5||q===6)g=g.stateNode,v?Zt(C,g,v):st(C,g);else if(q!==4&&(g=g.child,g!==null))for(kt(g,v,C),g=g.sibling;g!==null;)kt(g,v,C),g=g.sibling}function Wr(g,v,C){var q=g.tag;if(q===5||q===6)g=g.stateNode,v?rn(C,g,v):nt(C,g);else if(q!==4&&(g=g.child,g!==null))for(Wr(g,v,C),g=g.sibling;g!==null;)Wr(g,v,C),g=g.sibling}var $t=null,yn=!1;function Fn(g,v,C){for(C=C.child;C!==null;)Ai(g,v,C),C=C.sibling}function Ai(g,v,C){if(fa&&typeof fa.onCommitFiberUnmount=="function")try{fa.onCommitFiberUnmount(Ha,C)}catch{}switch(C.tag){case 5:Ye||mt(C,v);case 6:if(Ce){var q=$t,W=yn;$t=null,Fn(g,v,C),$t=q,yn=W,$t!==null&&(yn?We($t,C.stateNode):an($t,C.stateNode))}else Fn(g,v,C);break;case 18:Ce&&$t!==null&&(yn?as($t,C.stateNode):Fs($t,C.stateNode));break;case 4:Ce?(q=$t,W=yn,$t=C.stateNode.containerInfo,yn=!0,Fn(g,v,C),$t=q,yn=W):(Ue&&(q=C.stateNode.containerInfo,W=hn(q),hr(q,W)),Fn(g,v,C));break;case 0:case 11:case 14:case 15:if(!Ye&&(q=C.updateQueue,q!==null&&(q=q.lastEffect,q!==null))){W=q=q.next;do{var ae=W,Ee=ae.destroy;ae=ae.tag,Ee!==void 0&&((ae&2)!==0||(ae&4)!==0)&&vt(C,v,Ee),W=W.next}while(W!==q)}Fn(g,v,C);break;case 1:if(!Ye&&(mt(C,v),q=C.stateNode,typeof q.componentWillUnmount=="function"))try{q.props=C.memoizedProps,q.state=C.memoizedState,q.componentWillUnmount()}catch(Ve){Zr(C,v,Ve)}Fn(g,v,C);break;case 21:Fn(g,v,C);break;case 22:C.mode&1?(Ye=(q=Ye)||C.memoizedState!==null,Fn(g,v,C),Ye=q):Fn(g,v,C);break;default:Fn(g,v,C)}}function gi(g){var v=g.updateQueue;if(v!==null){g.updateQueue=null;var C=g.stateNode;C===null&&(C=g.stateNode=new ft),v.forEach(function(q){var W=cg.bind(null,g,q);C.has(q)||(C.add(q),q.then(W,W))})}}function Wn(g,v){var C=v.deletions;if(C!==null)for(var q=0;q<C.length;q++){var W=C[q];try{var ae=g,Ee=v;if(Ce){var Ve=Ee;e:for(;Ve!==null;){switch(Ve.tag){case 5:$t=Ve.stateNode,yn=!1;break e;case 3:$t=Ve.stateNode.containerInfo,yn=!0;break e;case 4:$t=Ve.stateNode.containerInfo,yn=!0;break e}Ve=Ve.return}if($t===null)throw Error(o(160));Ai(ae,Ee,W),$t=null,yn=!1}else Ai(ae,Ee,W);var lt=W.alternate;lt!==null&&(lt.return=null),W.return=null}catch(_t){Zr(W,v,_t)}}if(v.subtreeFlags&12854)for(v=v.child;v!==null;)Pi(v,g),v=v.sibling}function Pi(g,v){var C=g.alternate,q=g.flags;switch(g.tag){case 0:case 11:case 14:case 15:if(Wn(v,g),wr(g),q&4){try{vn(3,g,g.return),qt(3,g)}catch(Rt){Zr(g,g.return,Rt)}try{vn(5,g,g.return)}catch(Rt){Zr(g,g.return,Rt)}}break;case 1:Wn(v,g),wr(g),q&512&&C!==null&&mt(C,C.return);break;case 5:if(Wn(v,g),wr(g),q&512&&C!==null&&mt(C,C.return),Ce){if(g.flags&32){var W=g.stateNode;try{Be(W)}catch(Rt){Zr(g,g.return,Rt)}}if(q&4&&(W=g.stateNode,W!=null)){var ae=g.memoizedProps;if(C=C!==null?C.memoizedProps:ae,q=g.type,v=g.updateQueue,g.updateQueue=null,v!==null)try{Ct(W,v,q,C,ae,g)}catch(Rt){Zr(g,g.return,Rt)}}}break;case 6:if(Wn(v,g),wr(g),q&4&&Ce){if(g.stateNode===null)throw Error(o(162));W=g.stateNode,ae=g.memoizedProps,C=C!==null?C.memoizedProps:ae;try{at(W,C,ae)}catch(Rt){Zr(g,g.return,Rt)}}break;case 3:if(Wn(v,g),wr(g),q&4){if(Ce&&ze&&C!==null&&C.memoizedState.isDehydrated)try{qi(v.containerInfo)}catch(Rt){Zr(g,g.return,Rt)}if(Ue){W=v.containerInfo,ae=v.pendingChildren;try{hr(W,ae)}catch(Rt){Zr(g,g.return,Rt)}}}break;case 4:if(Wn(v,g),wr(g),q&4&&Ue){ae=g.stateNode,W=ae.containerInfo,ae=ae.pendingChildren;try{hr(W,ae)}catch(Rt){Zr(g,g.return,Rt)}}break;case 13:Wn(v,g),wr(g),W=g.child,W.flags&8192&&(ae=W.memoizedState!==null,W.stateNode.isHidden=ae,!ae||W.alternate!==null&&W.alternate.memoizedState!==null||(Ou=Er())),q&4&&gi(g);break;case 22:var Ee=C!==null&&C.memoizedState!==null;if(g.mode&1?(Ye=(C=Ye)||Ee,Wn(v,g),Ye=C):Wn(v,g),wr(g),q&8192){if(C=g.memoizedState!==null,(g.stateNode.isHidden=C)&&!Ee&&(g.mode&1)!==0)for(qe=g,q=g.child;q!==null;){for(v=qe=q;qe!==null;){Ee=qe;var Ve=Ee.child;switch(Ee.tag){case 0:case 11:case 14:case 15:vn(4,Ee,Ee.return);break;case 1:mt(Ee,Ee.return);var lt=Ee.stateNode;if(typeof lt.componentWillUnmount=="function"){var _t=Ee,Gt=Ee.return;try{var kn=_t;lt.props=kn.memoizedProps,lt.state=kn.memoizedState,lt.componentWillUnmount()}catch(Rt){Zr(_t,Gt,Rt)}}break;case 5:mt(Ee,Ee.return);break;case 22:if(Ee.memoizedState!==null){Tr(v);continue}}Ve!==null?(Ve.return=Ee,qe=Ve):Tr(v)}q=q.sibling}if(Ce){e:if(q=null,Ce)for(v=g;;){if(v.tag===5){if(q===null){q=v;try{W=v.stateNode,C?Wt(W):Nt(v.stateNode,v.memoizedProps)}catch(Rt){Zr(g,g.return,Rt)}}}else if(v.tag===6){if(q===null)try{ae=v.stateNode,C?Et(ae):Tt(ae,v.memoizedProps)}catch(Rt){Zr(g,g.return,Rt)}}else if((v.tag!==22&&v.tag!==23||v.memoizedState===null||v===g)&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===g)break e;for(;v.sibling===null;){if(v.return===null||v.return===g)break e;q===v&&(q=null),v=v.return}q===v&&(q=null),v.sibling.return=v.return,v=v.sibling}}}break;case 19:Wn(v,g),wr(g),q&4&&gi(g);break;case 21:break;default:Wn(v,g),wr(g)}}function wr(g){var v=g.flags;if(v&2){try{if(Ce){e:{for(var C=g.return;C!==null;){if(_n(C)){var q=C;break e}C=C.return}throw Error(o(160))}switch(q.tag){case 5:var W=q.stateNode;q.flags&32&&(Be(W),q.flags&=-33);var ae=Bt(g);Wr(g,ae,W);break;case 3:case 4:var Ee=q.stateNode.containerInfo,Ve=Bt(g);kt(g,Ve,Ee);break;default:throw Error(o(161))}}}catch(lt){Zr(g,g.return,lt)}g.flags&=-3}v&4096&&(g.flags&=-4097)}function Br(g,v,C){qe=g,In(g)}function In(g,v,C){for(var q=(g.mode&1)!==0;qe!==null;){var W=qe,ae=W.child;if(W.tag===22&&q){var Ee=W.memoizedState!==null||dt;if(!Ee){var Ve=W.alternate,lt=Ve!==null&&Ve.memoizedState!==null||Ye;Ve=dt;var _t=Ye;if(dt=Ee,(Ye=lt)&&!_t)for(qe=W;qe!==null;)Ee=qe,lt=Ee.child,Ee.tag===22&&Ee.memoizedState!==null?Xn(W):lt!==null?(lt.return=Ee,qe=lt):Xn(W);for(;ae!==null;)qe=ae,In(ae),ae=ae.sibling;qe=W,dt=Ve,Ye=_t}Yn(g)}else(W.subtreeFlags&8772)!==0&&ae!==null?(ae.return=W,qe=ae):Yn(g)}}function Yn(g){for(;qe!==null;){var v=qe;if((v.flags&8772)!==0){var C=v.alternate;try{if((v.flags&8772)!==0)switch(v.tag){case 0:case 11:case 15:Ye||qt(5,v);break;case 1:var q=v.stateNode;if(v.flags&4&&!Ye)if(C===null)q.componentDidMount();else{var W=v.elementType===v.type?C.memoizedProps:vo(v.type,C.memoizedProps);q.componentDidUpdate(W,C.memoizedState,q.__reactInternalSnapshotBeforeUpdate)}var ae=v.updateQueue;ae!==null&&ri(v,ae,q);break;case 3:var Ee=v.updateQueue;if(Ee!==null){if(C=null,v.child!==null)switch(v.child.tag){case 5:C=se(v.child.stateNode);break;case 1:C=v.child.stateNode}ri(v,Ee,C)}break;case 5:var Ve=v.stateNode;C===null&&v.flags&4&&ct(Ve,v.type,v.memoizedProps,v);break;case 6:break;case 4:break;case 12:break;case 13:if(ze&&v.memoizedState===null){var lt=v.alternate;if(lt!==null){var _t=lt.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))}Ye||v.flags&512&&Nn(v)}catch(kn){Zr(v,v.return,kn)}}if(v===g){qe=null;break}if(C=v.sibling,C!==null){C.return=v.return,qe=C;break}qe=v.return}}function Tr(g){for(;qe!==null;){var v=qe;if(v===g){qe=null;break}var C=v.sibling;if(C!==null){C.return=v.return,qe=C;break}qe=v.return}}function Xn(g){for(;qe!==null;){var v=qe;try{switch(v.tag){case 0:case 11:case 15:var C=v.return;try{qt(4,v)}catch(lt){Zr(v,C,lt)}break;case 1:var q=v.stateNode;if(typeof q.componentDidMount=="function"){var W=v.return;try{q.componentDidMount()}catch(lt){Zr(v,W,lt)}}var ae=v.return;try{Nn(v)}catch(lt){Zr(v,ae,lt)}break;case 5:var Ee=v.return;try{Nn(v)}catch(lt){Zr(v,Ee,lt)}}}catch(lt){Zr(v,v.return,lt)}if(v===g){qe=null;break}var Ve=v.sibling;if(Ve!==null){Ve.return=v.return,qe=Ve;break}qe=v.return}}var Rr=0,Mr=1,ir=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"),ir=er("selector.role"),Ii=er("selector.test_id"),Jn=er("selector.text")}function ii(g){var v=tt(g);if(v!=null){if(typeof v.memoizedProps["data-testname"]!="string")throw Error(o(364));return v}if(g=Me(g),g===null)throw Error(o(362));return g.stateNode.current}function ji(g,v){switch(v.$$typeof){case Rr:if(g.type===v.value)return!0;break;case Mr:e:{v=v.value,g=[g,0];for(var C=0;C<g.length;){var q=g[C++],W=g[C++],ae=v[W];if(q.tag!==5||!xe(q)){for(;ae!=null&&ji(q,ae);)W++,ae=v[W];if(W===v.length){v=!0;break e}else for(q=q.child;q!==null;)g.push(q,W),q=q.sibling}}v=!1}return v;case ir:if(g.tag===5&&Ie(g.stateNode,v.value))return!0;break;case Jn:if((g.tag===5||g.tag===6)&&(g=ye(g),g!==null&&0<=g.indexOf(v.value)))return!0;break;case Ii:if(g.tag===5&&(g=g.memoizedProps["data-testname"],typeof g=="string"&&g.toLowerCase()===v.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function ba(g){switch(g.$$typeof){case Rr:return"<"+(O(g.value)||"Unknown")+">";case Mr:return":has("+(ba(g)||"")+")";case ir:return'[role="'+g.value+'"]';case Jn:return'"'+g.value+'"';case Ii:return'[data-testname="'+g.value+'"]';default:throw Error(o(365))}}function ai(g,v){var C=[];g=[g,0];for(var q=0;q<g.length;){var W=g[q++],ae=g[q++],Ee=v[ae];if(W.tag!==5||!xe(W)){for(;Ee!=null&&ji(W,Ee);)ae++,Ee=v[ae];if(ae===v.length)C.push(W);else for(W=W.child;W!==null;)g.push(W,ae),W=W.sibling}}return C}function Vr(g,v){if(!Le)throw Error(o(363));g=ii(g),g=ai(g,v),v=[],g=Array.from(g);for(var C=0;C<g.length;){var q=g[C++];if(q.tag===5)xe(q)||v.push(q.stateNode);else for(q=q.child;q!==null;)g.push(q),q=q.sibling}return v}var wa=Math.ceil,ar=s.ReactCurrentDispatcher,Vi=s.ReactCurrentOwner,Kn=s.ReactCurrentBatchConfig,dn=0,Bn=null,On=null,zr=0,mi=0,Jo=wi(0),mr=0,Pu=null,Js=0,vr=0,yo=0,Yl=null,xa=null,Ou=0,Cu=1/0,Yi=null;function ur(){Cu=Er()+500}var Yr=!1,Xr=null,bo=null,jo=!1,wo=null,Gc=0,Kr=0,Lu=null,Sl=-1,xo=0;function Ar(){return(dn&6)!==0?Er():Sl!==-1?Sl:Sl=Er()}function Oi(g){return(g.mode&1)===0?1:(dn&2)!==0&&zr!==0?zr&-zr:qs.transition!==null?(xo===0&&(xo=Il()),xo):(g=Ln,g!==0?g:ut())}function _a(g,v,C,q){if(50<Kr)throw Kr=0,Lu=null,Error(o(185));za(g,C,q),((dn&2)===0||g!==Bn)&&(g===Bn&&((dn&2)===0&&(vr|=C),mr===4&&Ss(g,zr)),na(g,q),C===1&&dn===0&&(v.mode&1)===0&&(ur(),zs&&fi()))}function na(g,v){var C=g.callbackNode;Tc(g,v);var q=dl(g,g===Bn?zr:0);if(q===0)C!==null&&Rc(C),g.callbackNode=null,g.callbackPriority=0;else if(v=q&-q,g.callbackPriority!==v){if(C!=null&&Rc(C),v===1)g.tag===0?jl(zf.bind(null,g)):gl(zf.bind(null,g)),he?be(function(){(dn&6)===0&&fi()}):Co(mu,fi),C=null;else{switch(cn(q)){case 1:C=mu;break;case 4:C=vu;break;case 16:C=Bs;break;case 536870912:C=Zu;break;default:C=Bs}C=Rd(C,el.bind(null,g))}g.callbackPriority=v,g.callbackNode=C}}function el(g,v){if(Sl=-1,xo=0,(dn&6)!==0)throw Error(o(327));var C=g.callbackNode;if(Kl()&&g.callbackNode!==C)return null;var q=dl(g,g===Bn?zr:0);if(q===0)return null;if((q&30)!==0||(q&g.expiredLanes)!==0||v)v=ks(g,q);else{v=q;var W=dn;dn|=2;var ae=Es();(Bn!==g||zr!==v)&&(Yi=null,ur(),es(g,v));do try{Yc();break}catch(Ve){Ja(g,Ve)}while(!0);Fl(),ar.current=ae,dn=W,On!==null?v=0:(Bn=null,zr=0,v=mr)}if(v!==0){if(v===2&&(W=pl(g),W!==0&&(q=W,v=Wc(g,W))),v===1)throw C=Pu,es(g,0),Ss(g,q),na(g,Er()),C;if(v===6)Ss(g,q);else{if(W=g.current.alternate,(q&30)===0&&!Fh(W)&&(v=ks(g,q),v===2&&(ae=pl(g),ae!==0&&(q=ae,v=Wc(g,ae))),v===1))throw C=Pu,es(g,0),Ss(g,q),na(g,Er()),C;switch(g.finishedWork=W,g.finishedLanes=q,v){case 0:case 1:throw Error(o(345));case 2:As(g,xa,Yi);break;case 3:if(Ss(g,q),(q&130023424)===q&&(v=Ou+500-Er(),10<v)){if(dl(g,0)!==0)break;if(W=g.suspendedLanes,(W&q)!==q){Ar(),g.pingedLanes|=g.suspendedLanes&W;break}g.timeoutHandle=ie(As.bind(null,g,xa,Yi),v);break}As(g,xa,Yi);break;case 4:if(Ss(g,q),(q&4194240)===q)break;for(v=g.eventTimes,W=-1;0<q;){var Ee=31-Ca(q);ae=1<<Ee,Ee=v[Ee],Ee>W&&(W=Ee),q&=~ae}if(q=W,q=Er()-q,q=(120>q?120:480>q?480:1080>q?1080:1920>q?1920:3e3>q?3e3:4320>q?4320:1960*wa(q/1960))-q,10<q){g.timeoutHandle=ie(As.bind(null,g,xa,Yi),q);break}As(g,xa,Yi);break;case 5:As(g,xa,Yi);break;default:throw Error(o(329))}}}return na(g,Er()),g.callbackNode===C?el.bind(null,g):null}function Wc(g,v){var C=Yl;return g.current.memoizedState.isDehydrated&&(es(g,v).flags|=256),g=ks(g,v),g!==2&&(v=xa,xa=C,v!==null&&ac(v)),g}function ac(g){xa===null?xa=g:xa.push.apply(xa,g)}function Fh(g){for(var v=g;;){if(v.flags&16384){var C=v.updateQueue;if(C!==null&&(C=C.stores,C!==null))for(var q=0;q<C.length;q++){var W=C[q],ae=W.getSnapshot;W=W.value;try{if(!La(ae(),W))return!1}catch{return!1}}}if(C=v.child,v.subtreeFlags&16384&&C!==null)C.return=v,v=C;else{if(v===g)break;for(;v.sibling===null;){if(v.return===null||v.return===g)return!0;v=v.return}v.sibling.return=v.return,v=v.sibling}}return!0}function Ss(g,v){for(v&=~yo,v&=~vr,g.suspendedLanes|=v,g.pingedLanes&=~v,g=g.expirationTimes;0<v;){var C=31-Ca(v),q=1<<C;g[C]=-1,v&=~q}}function zf(g){if((dn&6)!==0)throw Error(o(327));Kl();var v=dl(g,0);if((v&1)===0)return na(g,Er()),null;var C=ks(g,v);if(g.tag!==0&&C===2){var q=pl(g);q!==0&&(v=q,C=Wc(g,q))}if(C===1)throw C=Pu,es(g,0),Ss(g,v),na(g,Er()),C;if(C===6)throw Error(o(345));return g.finishedWork=g.current.alternate,g.finishedLanes=v,As(g,xa,Yi),na(g,Er()),null}function Xl(g){wo!==null&&wo.tag===0&&(dn&6)===0&&Kl();var v=dn;dn|=1;var C=Kn.transition,q=Ln;try{if(Kn.transition=null,Ln=1,g)return g()}finally{Ln=q,Kn.transition=C,dn=v,(dn&6)===0&&fi()}}function Nu(){mi=Jo.current,pr(Jo)}function es(g,v){g.finishedWork=null,g.finishedLanes=0;var C=g.timeoutHandle;if(C!==ue&&(g.timeoutHandle=ue,fe(C)),On!==null)for(C=On.return;C!==null;){var q=C;switch(je(q),q.tag){case 1:q=q.type.childContextTypes,q!=null&&ls();break;case 3:Xo(),pr(Gn),pr(Ui),Vs();break;case 5:gs(q);break;case 4:Xo();break;case 13:pr(nr);break;case 19:pr(nr);break;case 10:po(q.type._context);break;case 22:case 23:Nu()}C=C.return}if(Bn=g,On=g=Tu(g.current,null),zr=mi=v,mr=0,Pu=null,yo=vr=Js=0,xa=Yl=null,Xa!==null){for(v=0;v<Xa.length;v++)if(C=Xa[v],q=C.interleaved,q!==null){C.interleaved=null;var W=q.next,ae=C.pending;if(ae!==null){var Ee=ae.next;ae.next=W,q.next=Ee}C.pending=q}Xa=null}return g}function Ja(g,v){do{var C=On;try{if(Fl(),Nr.current=Zs,Za){for(var q=fn.memoizedState;q!==null;){var W=q.queue;W!==null&&(W.pending=null),q=q.next}Za=!1}if(Rn=0,Mn=Pn=fn=null,Ys=!1,ys=0,Vi.current=null,C===null||C.return===null){mr=1,Pu=v,On=null;break}e:{var ae=g,Ee=C.return,Ve=C,lt=v;if(v=zr,Ve.flags|=32768,lt!==null&&typeof lt=="object"&&typeof lt.then=="function"){var _t=lt,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 qr=jh(Ee);if(qr!==null){qr.flags&=-257,Qs(qr,Ee,Ve,ae,v),qr.mode&1&&Ih(ae,_t,v),v=qr,lt=_t;var xr=v.updateQueue;if(xr===null){var So=new Set;So.add(lt),v.updateQueue=So}else xr.add(lt);break e}else{if((v&1)===0){Ih(ae,_t,v),_o();break e}lt=Error(o(426))}}else if(pt&&Ve.mode&1){var El=jh(Ee);if(El!==null){(El.flags&65536)===0&&(El.flags|=256),Qs(El,Ee,Ve,ae,v),Li(ea(lt,Ve));break e}}ae=lt=ea(lt,Ve),mr!==4&&(mr=2),Yl===null?Yl=[ae]:Yl.push(ae),ae=Ee;do{switch(ae.tag){case 3:ae.flags|=65536,v&=-v,ae.lanes|=v;var it=ta(ae,lt,v);ds(ae,it);break e;case 1:Ve=lt;var Xe=ae.type,gt=ae.stateNode;if((ae.flags&128)===0&&(typeof Xe.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)}oc(C)}catch(ln){v=ln,On===C&&C!==null&&(On=C=C.return);continue}break}while(!0)}function Es(){var g=ar.current;return ar.current=Zs,g===null?Zs:g}function _o(){(mr===0||mr===3||mr===2)&&(mr=4),Bn===null||(Js&268435455)===0&&(vr&268435455)===0||Ss(Bn,zr)}function ks(g,v){var C=dn;dn|=2;var q=Es();(Bn!==g||zr!==v)&&(Yi=null,es(g,v));do try{Vc();break}catch(W){Ja(g,W)}while(!0);if(Fl(),dn=C,ar.current=q,On!==null)throw Error(o(261));return Bn=null,zr=0,mr}function Vc(){for(;On!==null;)qf(On)}function Yc(){for(;On!==null&&!Mc();)qf(On)}function qf(g){var v=Jp(g.alternate,g,mi);g.memoizedProps=g.pendingProps,v===null?oc(g):On=v,Vi.current=null}function oc(g){var v=g;do{var C=v.alternate;if(g=v.return,(v.flags&32768)===0){if(C=He(C,v,mi),C!==null){On=C;return}}else{if(C=Ze(C,v),C!==null){C.flags&=32767,On=C;return}if(g!==null)g.flags|=32768,g.subtreeFlags=0,g.deletions=null;else{mr=6,On=null;return}}if(v=v.sibling,v!==null){On=v;return}On=v=g}while(v!==null);mr===0&&(mr=5)}function As(g,v,C){var q=Ln,W=Kn.transition;try{Kn.transition=null,Ln=1,Xp(g,v,C,q)}finally{Kn.transition=W,Ln=q}return null}function Xp(g,v,C,q){do Kl();while(wo!==null);if((dn&6)!==0)throw Error(o(327));C=g.finishedWork;var W=g.finishedLanes;if(C===null)return null;if(g.finishedWork=null,g.finishedLanes=0,C===g.current)throw Error(o(177));g.callbackNode=null,g.callbackPriority=0;var ae=C.lanes|C.childLanes;if(qa(g,ae),g===Bn&&(On=Bn=null,zr=0),(C.subtreeFlags&2064)===0&&(C.flags&2064)===0||jo||(jo=!0,Rd(Bs,function(){return Kl(),null})),ae=(C.flags&15990)!==0,(C.subtreeFlags&15990)!==0||ae){ae=Kn.transition,Kn.transition=null;var Ee=Ln;Ln=1;var Ve=dn;dn|=4,Vi.current=null,zt(g,C),Pi(C,g),X(g.containerInfo),g.current=C,Br(C),uo(),dn=Ve,Ln=Ee,Kn.transition=ae}else g.current=C;if(jo&&(jo=!1,wo=g,Gc=W),ae=g.pendingLanes,ae===0&&(bo=null),$a(C.stateNode),na(g,Er()),v!==null)for(q=g.onRecoverableError,C=0;C<v.length;C++)W=v[C],q(W.value,{componentStack:W.stack,digest:W.digest});if(Yr)throw Yr=!1,g=Xr,Xr=null,g;return(Gc&1)!==0&&g.tag!==0&&Kl(),ae=g.pendingLanes,(ae&1)!==0?g===Lu?Kr++:(Kr=0,Lu=g):Kr=0,fi(),null}function Kl(){if(wo!==null){var g=cn(Gc),v=Kn.transition,C=Ln;try{if(Kn.transition=null,Ln=16>g?16:g,wo===null)var q=!1;else{if(g=wo,wo=null,Gc=0,(dn&6)!==0)throw Error(o(331));var W=dn;for(dn|=4,qe=g.current;qe!==null;){var ae=qe,Ee=ae.child;if((qe.flags&16)!==0){var Ve=ae.deletions;if(Ve!==null){for(var lt=0;lt<Ve.length;lt++){var _t=Ve[lt];for(qe=_t;qe!==null;){var Gt=qe;switch(Gt.tag){case 0:case 11:case 15:vn(8,Gt,ae)}var kn=Gt.child;if(kn!==null)kn.return=Gt,qe=kn;else for(;qe!==null;){Gt=qe;var Rt=Gt.sibling,qr=Gt.return;if(Gr(Gt),Gt===_t){qe=null;break}if(Rt!==null){Rt.return=qr,qe=Rt;break}qe=qr}}}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)}}qe=ae}}if((ae.subtreeFlags&2064)!==0&&Ee!==null)Ee.return=ae,qe=Ee;else e:for(;qe!==null;){if(ae=qe,(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,qe=it;break e}qe=ae.return}}var Xe=g.current;for(qe=Xe;qe!==null;){Ee=qe;var gt=Ee.child;if((Ee.subtreeFlags&2064)!==0&&gt!==null)gt.return=Ee,qe=gt;else e:for(Ee=Xe;qe!==null;){if(Ve=qe,(Ve.flags&2048)!==0)try{switch(Ve.tag){case 0:case 11:case 15:qt(9,Ve)}}catch(ln){Zr(Ve,Ve.return,ln)}if(Ve===Ee){qe=null;break e}var Mt=Ve.sibling;if(Mt!==null){Mt.return=Ve.return,qe=Mt;break e}qe=Ve.return}}if(dn=W,fi(),fa&&typeof fa.onPostCommitFiberRoot=="function")try{fa.onPostCommitFiberRoot(Ha,g)}catch{}q=!0}return q}finally{Ln=C,Kn.transition=v}}return!1}function Td(g,v,C){v=ea(C,v),v=ta(g,v,1),g=Qi(g,v,1),v=Ar(),g!==null&&(za(g,1,v),na(g,v))}function Zr(g,v,C){if(g.tag===3)Td(g,g,C);else for(;v!==null;){if(v.tag===3){Td(v,g,C);break}else if(v.tag===1){var q=v.stateNode;if(typeof v.type.getDerivedStateFromError=="function"||typeof q.componentDidCatch=="function"&&(bo===null||!bo.has(q))){g=ea(C,g),g=Ra(v,g,1),v=Qi(v,g,1),g=Ar(),v!==null&&(za(v,1,g),na(v,g));break}}v=v.return}}function Kp(g,v,C){var q=g.pingCache;q!==null&&q.delete(v),v=Ar(),g.pingedLanes|=g.suspendedLanes&C,Bn===g&&(zr&C)===C&&(mr===4||mr===3&&(zr&130023424)===zr&&500>Er()-Ou?es(g,0):yo|=C),na(g,v)}function Zp(g,v){v===0&&((g.mode&1)===0?v=1:(v=cs,cs<<=1,(cs&130023424)===0&&(cs=4194304)));var C=Ar();g=$i(g,v),g!==null&&(za(g,v,C),na(g,C))}function Qp(g){var v=g.memoizedState,C=0;v!==null&&(C=v.retryLane),Zp(g,C)}function cg(g,v){var C=0;switch(g.tag){case 13:var q=g.stateNode,W=g.memoizedState;W!==null&&(C=W.retryLane);break;case 19:q=g.stateNode;break;default:throw Error(o(314))}q!==null&&q.delete(v),Zp(g,C)}var Jp;Jp=function(g,v,C){if(g!==null)if(g.memoizedProps!==v.pendingProps||Gn.current)ki=!0;else{if((g.lanes&C)===0&&(v.flags&128)===0)return ki=!1,ne(g,v,C);ki=(g.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 q=v.type;I(g,v),g=v.pendingProps;var W=Hi(v,Ui.current);Ws(v,C),W=bu(null,v,q,g,W,C);var ae=Qu();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,Hr(q)?(ae=!0,Ba(v)):ae=!1,v.memoizedState=W.state!==null&&W.state!==void 0?W.state:null,Na(v),W.updater=rc,v.stateNode=W,W._reactInternals=v,Ji(v,q,g,C),v=va(null,v,q,!0,ae,C)):(v.tag=0,pt&&ae&&Oe(v),Mi(null,v,W,C),v=v.child),v;case 16:q=v.elementType;e:{switch(I(g,v),g=v.pendingProps,W=q._init,q=W(q._payload),v.type=q,W=v.tag=fg(q),g=vo(q,g),W){case 0:v=ws(null,v,q,g,C);break e;case 1:v=Wi(null,v,q,g,C);break e;case 11:v=$c(null,v,q,g,C);break e;case 14:v=bs(null,v,q,vo(q.type,g),C);break e}throw Error(o(306,q,""))}return v;case 0:return q=v.type,W=v.pendingProps,W=v.elementType===q?W:vo(q,W),ws(g,v,q,W,C);case 1:return q=v.type,W=v.pendingProps,W=v.elementType===q?W:vo(q,W),Wi(g,v,q,W,C);case 3:e:{if(_l(v),g===null)throw Error(o(387));q=v.pendingProps,ae=v.memoizedState,W=ae.element,Ka(g,v),go(v,q,null,C);var Ee=v.memoizedState;if(q=Ee.element,ze&&ae.isDehydrated)if(ae={element:q,isDehydrated:!1,cache:Ee.cache,pendingSuspenseBoundaries:Ee.pendingSuspenseBoundaries,transitions:Ee.transitions},v.updateQueue.baseState=ae,v.memoizedState=ae,v.flags&256){W=ea(Error(o(423)),v),v=Wl(g,v,q,C,W);break e}else if(q!==W){W=ea(Error(o(424)),v),v=Wl(g,v,q,C,W);break e}else for(ze&&(ht=ka(v.stateNode.containerInfo),$e=v,pt=!0,jt=null,Ft=!1),C=Gs(v,null,q,C),v.child=C;C;)C.flags=C.flags&-3|4096,C=C.sibling;else{if(kr(),q===W){v=V(g,v,C);break e}Mi(g,v,q,C)}v=v.child}return v;case 5:return ps(v),g===null&&Lr(v),q=v.type,W=v.pendingProps,ae=g!==null?g.memoizedProps:null,Ee=W.children,J(q,W)?Ee=null:ae!==null&&J(q,ae)&&(v.flags|=32),lr(g,v),Mi(g,v,Ee,C),v.child;case 6:return g===null&&Lr(v),null;case 13:return Bf(g,v,C);case 4:return bl(v,v.stateNode.containerInfo),q=v.pendingProps,g===null?v.child=ho(v,null,q,C):Mi(g,v,q,C),v.child;case 11:return q=v.type,W=v.pendingProps,W=v.elementType===q?W:vo(q,W),$c(g,v,q,W,C);case 7:return Mi(g,v,v.pendingProps,C),v.child;case 8:return Mi(g,v,v.pendingProps.children,C),v.child;case 12:return Mi(g,v,v.pendingProps.children,C),v.child;case 10:e:{if(q=v.type._context,W=v.pendingProps,ae=v.memoizedProps,Ee=W.value,ha(v,q,Ee),ae!==null)if(La(ae.value,Ee)){if(ae.children===W.children&&!Gn.current){v=V(g,v,C);break e}}else for(ae=v.child,ae!==null&&(ae.return=v);ae!==null;){var Ve=ae.dependencies;if(Ve!==null){Ee=ae.child;for(var lt=Ve.firstContext;lt!==null;){if(lt.context===q){if(ae.tag===1){lt=da(-1,C&-C),lt.tag=2;var _t=ae.updateQueue;if(_t!==null){_t=_t.shared;var Gt=_t.pending;Gt===null?lt.next=lt:(lt.next=Gt.next,Gt.next=lt),_t.pending=lt}}ae.lanes|=C,lt=ae.alternate,lt!==null&&(lt.lanes|=C),No(ae.return,C,v),Ve.lanes|=C;break}lt=lt.next}}else if(ae.tag===10)Ee=ae.type===v.type?null:ae.child;else if(ae.tag===18){if(Ee=ae.return,Ee===null)throw Error(o(341));Ee.lanes|=C,Ve=Ee.alternate,Ve!==null&&(Ve.lanes|=C),No(Ee,C,v),Ee=ae.sibling}else Ee=ae.child;if(Ee!==null)Ee.return=ae;else for(Ee=ae;Ee!==null;){if(Ee===v){Ee=null;break}if(ae=Ee.sibling,ae!==null){ae.return=Ee.return,Ee=ae;break}Ee=Ee.return}ae=Ee}Mi(g,v,W.children,C),v=v.child}return v;case 9:return W=v.type,q=v.pendingProps.children,Ws(v,C),W=Fr(W),q=q(W),v.flags|=1,Mi(g,v,q,C),v.child;case 14:return q=v.type,W=vo(q,v.pendingProps),W=vo(q.type,W),bs(g,v,q,W,C);case 15:return Io(g,v,v.type,v.pendingProps,C);case 17:return q=v.type,W=v.pendingProps,W=v.elementType===q?W:vo(q,W),I(g,v),v.tag=1,Hr(q)?(g=!0,Ba(v)):g=!1,Ws(v,C),Mh(v,q,W),Ji(v,q,W,C),va(null,v,q,!0,g,C);case 19:return P(g,v,C);case 22:return rr(g,v,C)}throw Error(o(156,v.tag))};function Rd(g,v){return Co(g,v)}function e1(g,v,C,q){this.tag=g,this.key=C,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=q,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ts(g,v,C,q){return new e1(g,v,C,q)}function Xc(g){return g=g.prototype,!(!g||!g.isReactComponent)}function fg(g){if(typeof g=="function")return Xc(g)?1:0;if(g!=null){if(g=g.$$typeof,g===w)return 11;if(g===S)return 14}return 2}function Tu(g,v){var C=g.alternate;return C===null?(C=ts(g.tag,v,g.key,g.mode),C.elementType=g.elementType,C.type=g.type,C.stateNode=g.stateNode,C.alternate=g,g.alternate=C):(C.pendingProps=v,C.type=g.type,C.flags=0,C.subtreeFlags=0,C.deletions=null),C.flags=g.flags&14680064,C.childLanes=g.childLanes,C.lanes=g.lanes,C.child=g.child,C.memoizedProps=g.memoizedProps,C.memoizedState=g.memoizedState,C.updateQueue=g.updateQueue,v=g.dependencies,C.dependencies=v===null?null:{lanes:v.lanes,firstContext:v.firstContext},C.sibling=g.sibling,C.index=g.index,C.ref=g.ref,C}function Bh(g,v,C,q,W,ae){var Ee=2;if(q=g,typeof g=="function")Xc(g)&&(Ee=1);else if(typeof g=="string")Ee=5;else e:switch(g){case c:return Ma(C.children,W,ae,v);case p:Ee=8,W|=8;break;case m:return g=ts(12,C,v,W|2),g.elementType=m,g.lanes=ae,g;case x:return g=ts(13,C,v,W),g.elementType=x,g.lanes=ae,g;case b:return g=ts(19,C,v,W),g.elementType=b,g.lanes=ae,g;case E:return Kc(C,W,ae,v);default:if(typeof g=="object"&&g!==null)switch(g.$$typeof){case d:Ee=10;break e;case y:Ee=9;break e;case w:Ee=11;break e;case S:Ee=14;break e;case k:Ee=16,q=null;break e}throw Error(o(130,g==null?g:typeof g,""))}return v=ts(Ee,C,v,W),v.elementType=g,v.type=q,v.lanes=ae,v}function Ma(g,v,C,q){return g=ts(7,g,q,v),g.lanes=C,g}function Kc(g,v,C,q){return g=ts(22,g,q,v),g.elementType=E,g.lanes=C,g.stateNode={isHidden:!1},g}function Zc(g,v,C){return g=ts(6,g,null,v),g.lanes=C,g}function zh(g,v,C){return v=ts(4,g.children!==null?g.children:[],g.key,v),v.lanes=C,v.stateNode={containerInfo:g.containerInfo,pendingChildren:null,implementation:g.implementation},v}function t1(g,v,C,q,W){this.tag=v,this.containerInfo=g,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=q,this.onRecoverableError=W,ze&&(this.mutableSourceEagerHydrationData=null)}function Md(g,v,C,q,W,ae,Ee,Ve,lt){return g=new t1(g,v,C,Ve,lt),v===1?(v=1,ae===!0&&(v|=8)):v=0,ae=ts(3,null,null,v),g.current=ae,ae.stateNode=g,ae.memoizedState={element:q,isDehydrated:C,cache:null,transitions:null,pendingSuspenseBoundaries:null},Na(ae),g}function qh(g){if(!g)return oo;g=g._reactInternals;e:{if(j(g)!==g||g.tag!==1)throw Error(o(170));var v=g;do{switch(v.tag){case 3:v=v.stateNode.context;break e;case 1:if(Hr(v.type)){v=v.stateNode.__reactInternalMemoizedMergedChildContext;break e}}v=v.return}while(v!==null);throw Error(o(171))}if(g.tag===1){var C=g.type;if(Hr(C))return xi(g,C,v)}return v}function sc(g){var v=g._reactInternals;if(v===void 0)throw typeof g.render=="function"?Error(o(188)):(g=Object.keys(g).join(","),Error(o(268,g)));return g=T(v),g===null?null:g.stateNode}function Uh(g,v){if(g=g.memoizedState,g!==null&&g.dehydrated!==null){var C=g.retryLane;g.retryLane=C!==0&&C<v?C:v}}function Qc(g,v){Uh(g,v),(g=g.alternate)&&Uh(g,v)}function hg(g){return g=T(g),g===null?null:g.stateNode}function n1(){return null}return n.attemptContinuousHydration=function(g){if(g.tag===13){var v=$i(g,134217728);if(v!==null){var C=Ar();_a(v,g,134217728,C)}Qc(g,134217728)}},n.attemptDiscreteHydration=function(g){if(g.tag===13){var v=$i(g,1);if(v!==null){var C=Ar();_a(v,g,1,C)}Qc(g,1)}},n.attemptHydrationAtCurrentPriority=function(g){if(g.tag===13){var v=Oi(g),C=$i(g,v);if(C!==null){var q=Ar();_a(C,g,v,q)}Qc(g,v)}},n.attemptSynchronousHydration=function(g){switch(g.tag){case 3:var v=g.stateNode;if(v.current.memoizedState.isDehydrated){var C=Oo(v.pendingLanes);C!==0&&(Ua(v,C|1),na(v,Er()),(dn&6)===0&&(ur(),fi()))}break;case 13:Xl(function(){var q=$i(g,1);if(q!==null){var W=Ar();_a(q,g,1,W)}}),Qc(g,1)}},n.batchedUpdates=function(g,v){var C=dn;dn|=1;try{return g(v)}finally{dn=C,dn===0&&(ur(),zs&&fi())}},n.createComponentSelector=function(g){return{$$typeof:Rr,value:g}},n.createContainer=function(g,v,C,q,W,ae,Ee){return Md(g,v,!1,null,C,q,W,ae,Ee)},n.createHasPseudoClassSelector=function(g){return{$$typeof:Mr,value:g}},n.createHydrationContainer=function(g,v,C,q,W,ae,Ee,Ve,lt){return g=Md(C,q,!0,g,W,ae,Ee,Ve,lt),g.context=qh(null),C=g.current,q=Ar(),W=Oi(C),ae=da(q,W),ae.callback=v??null,Qi(C,ae,W),g.current.lanes=W,za(g,W,q),na(g,q),g},n.createPortal=function(g,v,C){var q=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:q==null?null:""+q,children:g,containerInfo:v,implementation:C}},n.createRoleSelector=function(g){return{$$typeof:ir,value:g}},n.createTestNameSelector=function(g){return{$$typeof:Ii,value:g}},n.createTextSelector=function(g){return{$$typeof:Jn,value:g}},n.deferredUpdates=function(g){var v=Ln,C=Kn.transition;try{return Kn.transition=null,Ln=16,g()}finally{Ln=v,Kn.transition=C}},n.discreteUpdates=function(g,v,C,q,W){var ae=Ln,Ee=Kn.transition;try{return Kn.transition=null,Ln=1,g(v,C,q,W)}finally{Ln=ae,Kn.transition=Ee,dn===0&&ur()}},n.findAllNodes=Vr,n.findBoundingRects=function(g,v){if(!Le)throw Error(o(363));v=Vr(g,v),g=[];for(var C=0;C<v.length;C++)g.push(ve(v[C]));for(v=g.length-1;0<v;v--){C=g[v];for(var q=C.x,W=q+C.width,ae=C.y,Ee=ae+C.height,Ve=v-1;0<=Ve;Ve--)if(v!==Ve){var lt=g[Ve],_t=lt.x,Gt=_t+lt.width,kn=lt.y,Rt=kn+lt.height;if(q>=_t&&ae>=kn&&W<=Gt&&Ee<=Rt){g.splice(v,1);break}else if(q!==_t||C.width!==lt.width||Rt<ae||kn>Ee){if(!(ae!==kn||C.height!==lt.height||Gt<q||_t>W)){_t>q&&(lt.width+=_t-q,lt.x=q),Gt<W&&(lt.width=W-_t),g.splice(v,1);break}}else{kn>ae&&(lt.height+=kn-ae,lt.y=ae),Rt<Ee&&(lt.height=Ee-kn),g.splice(v,1);break}}}return g},n.findHostInstance=sc,n.findHostInstanceWithNoPortals=function(g){return g=L(g),g=g!==null?U(g):null,g===null?null:g.stateNode},n.findHostInstanceWithWarning=function(g){return sc(g)},n.flushControlled=function(g){var v=dn;dn|=1;var C=Kn.transition,q=Ln;try{Kn.transition=null,Ln=1,g()}finally{Ln=q,Kn.transition=C,dn=v,dn===0&&(ur(),fi())}},n.flushPassiveEffects=Kl,n.flushSync=Xl,n.focusWithin=function(g,v){if(!Le)throw Error(o(363));for(g=ii(g),v=ai(g,v),v=Array.from(v),g=0;g<v.length;){var C=v[g++];if(!xe(C)){if(C.tag===5&&Te(C.stateNode))return!0;for(C=C.child;C!==null;)v.push(C),C=C.sibling}}return!1},n.getCurrentUpdatePriority=function(){return Ln},n.getFindAllNodesFailureDescription=function(g,v){if(!Le)throw Error(o(363));var C=0,q=[];g=[ii(g),0];for(var W=0;W<g.length;){var ae=g[W++],Ee=g[W++],Ve=v[Ee];if((ae.tag!==5||!xe(ae))&&(ji(ae,Ve)&&(q.push(ba(Ve)),Ee++,Ee>C&&(C=Ee)),Ee<v.length))for(ae=ae.child;ae!==null;)g.push(ae,Ee),ae=ae.sibling}if(C<v.length){for(g=[];C<v.length;C++)g.push(ba(v[C]));return`findAllNodes was able to match part of the selector:
31
- `+(q.join(" > ")+`
32
-
33
- No matching component was found for:
34
- `)+g.join(" > ")}return null},n.getPublicRootInstance=function(g){return g=g.current,g.child?g.child.tag===5?se(g.child.stateNode):g.child.stateNode:null},n.injectIntoDevTools=function(g){if(g={bundleType:g.bundleType,version:g.version,rendererPackageName:g.rendererPackageName,rendererConfig:g.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:hg,findFiberByHostInstance:g.findFiberByHostInstance||n1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")g=!1;else{var v=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(v.isDisabled||!v.supportsFiber)g=!0;else{try{Ha=v.inject(g),fa=v}catch{}g=!!v.checkDCE}}return g},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(g,v,C,q){if(!Le)throw Error(o(363));g=Vr(g,v);var W=Je(g,C,q).disconnect;return{disconnect:function(){W()}}},n.registerMutableSourceForHydration=function(g,v){var C=v._getVersion;C=C(v._source),g.mutableSourceEagerHydrationData==null?g.mutableSourceEagerHydrationData=[v,C]:g.mutableSourceEagerHydrationData.push(v,C)},n.runWithPriority=function(g,v){var C=Ln;try{return Ln=g,v()}finally{Ln=C}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(g,v,C,q){var W=v.current,ae=Ar(),Ee=Oi(W);return C=qh(C),v.context===null?v.context=C:v.pendingContext=C,v=da(ae,Ee),v.payload={element:g},q=q===void 0?null:q,q!==null&&(v.callback=q),g=Qi(W,v,Ee),g!==null&&(_a(g,W,Ee,ae),To(g,W,Ee)),Ee},n}),n2}var ub;function zA(){return ub||(ub=1,t2.exports=BA()),t2.exports}var qA=zA();const UA=yh(qA);var r2={exports:{}},sf={};var cb;function HA(){return cb||(cb=1,sf.ConcurrentRoot=1,sf.ContinuousEventPriority=4,sf.DefaultEventPriority=16,sf.DiscreteEventPriority=1,sf.IdleEventPriority=536870912,sf.LegacyRoot=0),sf}var fb;function $A(){return fb||(fb=1,r2.exports=HA()),r2.exports}var q8=$A();const hb={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let db=!1,pb=!1;const oy=".react-konva-event",GA=`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
- `,WA=`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
- `,VA={};function Q0(e,t,n=VA){if(!db&&"zIndex"in t&&(console.warn(WA),db=!0),!pb&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(GA),pb=!0)}for(var a in n)if(!hb[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,p={},m=!1;const d={};for(var a in t)if(!hb[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))&&(m=!0,p[a]=t[a])}m&&(e.setAttrs(p),Nf(e));for(var u in d)e.on(u+oy,d[u])}function Nf(e){if(!Ot.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}var i2=Hv();const U8={},YA={};hh.Node.prototype._applyProps=Q0;function XA(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 KA(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 Q0(u,a),u}function ZA(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function QA(e,t,n){return!1}function JA(e){return e}function eP(){return null}function tP(){return null}function nP(e,t,n,r){return YA}function rP(){}function iP(e){}function aP(e,t){return!1}function oP(){return U8}function sP(){return U8}const lP=setTimeout,uP=clearTimeout,cP=-1;function fP(e,t){return!1}const hP=!1,dP=!0,pP=!0;function gP(e,t){t.parent===e?t.moveToTop():e.add(t),Nf(e)}function mP(e,t){t.parent===e?t.moveToTop():e.add(t),Nf(e)}function H8(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),Nf(e)}function vP(e,t,n){H8(e,t,n)}function yP(e,t){t.destroy(),t.off(oy),Nf(e)}function bP(e,t){t.destroy(),t.off(oy),Nf(e)}function wP(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function xP(e,t,n){}function _P(e,t,n,r,i){Q0(e,i,r)}function SP(e){e.hide(),Nf(e)}function EP(e){}function kP(e,t){(t.visible==null||t.visible)&&e.show()}function AP(e,t){}function PP(e){}function OP(){}const CP=()=>q8.DefaultEventPriority,LP=Object.freeze(Object.defineProperty({__proto__:null,appendChild:gP,appendChildToContainer:mP,appendInitialChild:XA,cancelTimeout:uP,clearContainer:PP,commitMount:xP,commitTextUpdate:wP,commitUpdate:_P,createInstance:KA,createTextInstance:ZA,detachDeletedInstance:OP,finalizeInitialChildren:QA,getChildHostContext:sP,getCurrentEventPriority:CP,getPublicInstance:JA,getRootHostContext:oP,hideInstance:SP,hideTextInstance:EP,idlePriority:i2.unstable_IdlePriority,insertBefore:H8,insertInContainerBefore:vP,isPrimaryRenderer:hP,noTimeout:cP,now:i2.unstable_now,prepareForCommit:eP,preparePortalMount:tP,prepareUpdate:nP,removeChild:yP,removeChildFromContainer:bP,resetAfterCommit:rP,resetTextContent:iP,run:i2.unstable_runWithPriority,scheduleTimeout:lP,shouldDeprioritizeSubtree:aP,shouldSetTextContent:fP,supportsMutation:pP,unhideInstance:kP,unhideTextInstance:AP,warnsIfNotActing:dP},Symbol.toStringTag,{value:"Module"}));var NP=Object.defineProperty,TP=Object.defineProperties,RP=Object.getOwnPropertyDescriptors,gb=Object.getOwnPropertySymbols,MP=Object.prototype.hasOwnProperty,IP=Object.prototype.propertyIsEnumerable,mb=(e,t,n)=>t in e?NP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vb=(e,t)=>{for(var n in t||(t={}))MP.call(t,n)&&mb(e,n,t[n]);if(gb)for(var n of gb(t))IP.call(t,n)&&mb(e,n,t[n]);return e},jP=(e,t)=>TP(e,RP(t)),yb,bb;typeof window<"u"&&((yb=window.document)!=null&&yb.createElement||((bb=window.navigator)==null?void 0:bb.product)==="ReactNative")?Di.useLayoutEffect:Di.useEffect;function $8(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=e.child;for(;r;){const i=$8(r,t,n);if(i)return i;r=r.sibling}}function G8(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const wb=console.error;console.error=function(){const e=[...arguments].join("");if(e?.startsWith("Warning:")&&e.includes("useContext")){console.error=wb;return}return wb.apply(this,arguments)};const sy=G8(Di.createContext(null));class W8 extends Di.Component{render(){return Di.createElement(sy.Provider,{value:this._reactInternals},this.props.children)}}function DP(){const e=Di.useContext(sy);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=$8(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 FP(){const e=DP(),[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!==sy&&!t.has(i)&&t.set(i,Di.useContext(G8(i)))}n=n.return}return t}function V8(){const e=FP();return Di.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>Di.createElement(t,null,Di.createElement(n.Provider,jP(vb({},r),{value:e.get(n)}))),t=>Di.createElement(W8,vb({},t))),[e])}function BP(e){const t=oe.useRef({});return oe.useLayoutEffect(()=>{t.current=e}),oe.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const zP=e=>{const t=oe.useRef(null),n=oe.useRef(null),r=oe.useRef(null),i=BP(e),a=V8(),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,q8.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),Q0(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})},qP="Layer",fr="Group",k0="Label",Pr="Rect",UP="Circle",bc="Line",Du="Image",Uu="Text",HP="TextPath",ly="Arc",A0="Tag",Ep="Path",kp="Transformer",ip=UA(LP);ip.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:oe.version,rendererPackageName:"react-konva"});const $P=oe.forwardRef((e,t)=>oe.createElement(W8,{},oe.createElement(zP,{...e,forwardedRef:t})));var a2,xb;function GP(){if(xb)return a2;xb=1;var e=Mp();return a2=function(n,r,i){const a=e.useRef("loading"),o=e.useRef(),[s,u]=e.useState(0),h=e.useRef(),c=e.useRef(),p=e.useRef();return(h.current!==n||c.current!==r||p.current!==i)&&(a.current="loading",o.current=void 0,h.current=n,c.current=r,p.current=i),e.useLayoutEffect(function(){if(!n)return;var m=document.createElement("img");function d(){m.decode().catch(()=>{}).finally(()=>{a.current="loaded",o.current=m,u(Math.random())})}function y(){a.current="failed",o.current=void 0,u(Math.random())}return m.addEventListener("load",d),m.addEventListener("error",y),r&&(m.crossOrigin=r),i&&(m.referrerPolicy=i),m.src=n,function(){m.removeEventListener("load",d),m.removeEventListener("error",y)}},[n,r,i]),[o.current,a.current]},a2}var WP=GP();const uy=yh(WP);var VP=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 YP=e=>{const t=window.getComputedStyle(e).position;return!(t==="absolute"||t==="relative")};function XP(e=()=>{}){const t=oe.useRef(e);return t.current=e,oe.useCallback((...n)=>t.current.apply(null,n),[])}const P0=({children:e,groupProps:t,divProps:n,transform:r,transformFunc:i,parentNodeFunc:a})=>{const o=V8(),s=oe.useRef(null),[u]=oe.useState(()=>document.createElement("div")),h=oe.useMemo(()=>u6.createRoot(u),[u]),c=r??!0,p=XP(()=>{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 m=n||{},{style:d}=m,y=VP(m,["style"]);Object.assign(u.style,d),Object.assign(u,y)});return oe.useLayoutEffect(()=>{var m;const d=s.current;if(!d)return;const y=a?a({stage:d.getStage()}):(m=d.getStage())===null||m===void 0?void 0:m.container();if(y)return y.appendChild(u),c&&YP(y)&&(y.style.position="relative"),d.on("absoluteTransformChange",p),p(),()=>{var w;d.off("absoluteTransformChange",p),(w=u.parentNode)===null||w===void 0||w.removeChild(u)}},[c,a]),oe.useLayoutEffect(()=>{p()},[n,i]),oe.useLayoutEffect(()=>{queueMicrotask(()=>{s8.flushSync(()=>{h.render(oe.createElement(o,null,e))})})}),oe.useLayoutEffect(()=>()=>{setTimeout(()=>{h.unmount()})},[]),oe.createElement(fr,Object.assign({ref:s},t))},cy=({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(fr,{name:"_outer_portal",ref:r},oe.createElement(fr,{name:"_inner_portal",ref:i},n))};function Y8(e,t,n){const r=t-1,i=n[K8(r,n.length)];return i.marker!=="Z"?i:Y8(e,r,n)}function X8(e,t,n){const r=t+1,i=n[K8(r,n.length)];return i.marker==="Z"?X8(e,r,n):i}function KP(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 ZP(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 K8(e,t){return(e%t+t)%t}function QP(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 xv(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,xv(e,t-1)),e[t].marker==="Z"&&xv(e,t-1)}function JP(e,t,n){const r=Sb(e.values,n.values),i=Sb(t.values,e.values);return Math.min(i,r)}function _b(e,t){return Math.atan2(t.x-e.x,t.y-e.y)}function Sb(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 Eb(e,t){return Math.sin(e)*t}function kb(e,t){return Math.cos(e)*t}function Ab(e,t){const n=t/Math.tan(e);return n===1/0||n===-1/0||isNaN(n)?t:n}function eO(e,t){return t*Math.tan(e)}function tO(e,t){let n,r=0,i=e*(180/Math.PI);return i<0&&i>=-180||i>180&&i<360?n=Ab(e/2,-t):(n=Ab(e/2,t),r=1,n===1/0&&(n=t)),{offset:n,sweepFlag:r}}function nO(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 Pb(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 ZP(r.marker,a)}).map(KP)}function Ob(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(QP),xv(a,a.length-1);const o=a[a.length-1].marker=="Z";a.filter(s=>!s.overlap).map((s,u,h)=>{const p=Y8(s,u,h),m=X8(s,u,h),d=_b(s.values,p.values),y=_b(s.values,m.values),w=y-d,x=w*(180/Math.PI),b=JP(s,p,m),S=Math.abs(eO(w/2,b/2)),k=Math.min(t,S),E=tO(w,k),A=E.offset,M=E.sweepFlag,O=(u==0||u==h.length-1)&&!o;switch(s.marker){case"M":case"L":const R=[s.values.x+Eb(d,A),s.values.y+kb(d,A)],j=[s.values.x+Eb(y,A),s.values.y+kb(y,A)];O?i.push({marker:s.marker,values:s.values}):i.push({marker:s.marker,values:{x:parseFloat(R[0].toFixed(3)),y:parseFloat(R[1].toFixed(3))}}),!O&&(m.marker==="L"||m.marker==="M")&&i.push({marker:"A",radius:k,values:{radiusX:parseFloat(k.toFixed(3)),radiusY:parseFloat(k.toFixed(3)),rotation:x,largeArc:0,sweep:M,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:nO(i),commands:i}}var j1={},Cb;function rO(){if(Cb)return j1;Cb=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,m)||s("repeating-radial-gradient",t.repeatingRadialGradient,m)}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}:p()}function c(){return X("directional",t.sideOrCorner,1)}function p(){return X("angular",t.angleValue,1)||X("angular",t.radianValue,1)}function m(){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()||w();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 w(){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=M();return z||r("Expected color definition"),z.length=se(),z}function M(){return R()||$()||T()||D()||j()||L()||O()}function O(){return X("literal",t.literalColor,0)}function R(){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 L(){return u(t.varColor,function(){return{type:"var",value:U()}})}function T(){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 U(){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 iO=rO();const aO=yh(iO),ua=e=>e.indexOf("linear-gradient")>=0,oO=e=>e.type==="hex"?"#"+e.value:e.type==="literal"?e.value:`${e.type}(${e.value.join(",")})`,qp=e=>{if(!ua(e))return{rotation:0,stops:[{offset:0,color:e},{offset:1,color:e}]};const t=aO.parse(e)[0];return{rotation:parseFloat(t.orientation.value),stops:t.colorStops.map((n,r)=>({color:oO(n),offset:n.length?parseFloat(n.length.value)/100:r/(t.colorStops.length-1)}))}},Wu=(e,t=e.fill,n="fill")=>oe.useMemo(()=>{if(!ua(t))return{[n]:t};const{stops:r,rotation:i}=qp(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:p,color:m})=>{c.push(p,m)}),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 O0=!1;const sO=(e=!O0)=>{O0=e},lO=()=>O0;function Up(e,t){const n=oe.useRef();oe.useLayoutEffect(()=>{n.current&&n.current.destroy()},[t]),oe.useLayoutEffect(()=>{if(!O0)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 C0=0,_v=[],Z8=3e4;const uO=e=>{Z8=e};let Q8=6e3;const cO=e=>{Q8=e},fO=()=>Q8;function dh(e){C0+=1;let t=!1,n=!1;const r=setTimeout(()=>{t||(Hp(`Timeout loading asset ${e}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",e),t=!0,Lb())},Z8);return()=>{n?console.error("Finish called twice! That is not expected. id: ",e):(n=!0,t||(clearTimeout(r),Lb()))}}function Lb(){C0-=1,C0===0&&(_v.forEach(e=>e()),_v=[])}function hO(){return new Promise(e=>{return t=()=>{lO()?setTimeout(e,300):e(!0)},void(C0===0?t():_v.push(t));var t})}let J8=[];function dO(e){J8.push(e)}function Hp(e){J8.forEach(t=>t(e))}Qn(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]);Qn({value:!1});const fy=Qn([]);function pO(e){fy.push(e)}var Sv="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1";let pc;function D1(e,t="sans-serif",n="normal",r="normal"){pc||(pc=document.createElement("canvas"));var i=pc.getContext("2d");return i.font=`${n} ${r} 40px '${e}', ${t}`,i.measureText(Sv).width}const dp={Arial:!0},Nb=e=>Object.keys(dp).some(t=>t.startsWith(e+"_"))||!!dp[e];async function gO(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(p="normal",m="normal"){pc||(pc=document.createElement("canvas"));var d=pc.getContext("2d");return d.font=`${p} ${m} 40px sans-serif`,d.measureText(Sv).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(p="normal",m="normal"){pc||(pc=document.createElement("canvas"));var d=pc.getContext("2d");return d.font=`${p} ${m} 40px serif`,d.measureText(Sv).width})(t,n),h=D1(e,"sans-serif",t,n),c=Math.min(6e3,fO())/60;for(let p=0;p<c;p++){const m=D1(e,"sans-serif",t,n),d=D1(e,"serif",t,n);if(m!==h||m!==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?`),Hp(`Timeout for loading font "${e}"`)}const Tb={};let ex="400,400italic,700,700italic";function mO(){return ex}function tx(e){return`https://fonts.googleapis.com/css?family=${e.replace(/ /g,"+")}:${ex}`}function vO(e){if(Tb[e])return;const t=tx(e),n=document.createElement("link");n.type="text/css",n.href=t,n.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(n),Tb[e]=!0}const Rb={};let Yf;function yO(e){const t=e.fontFamily;if(Rb[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)}),Rb[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}),bO=typeof window<"u"&&window.location.hostname==="localhost",wO=typeof process<"u"&&!1,nx=bO||wO,xO=qn(e=>{Ir.textVerticalResizeEnabled=e}),rx=qn(e=>{Ir.removeBackgroundEnabled=e});qn(e=>{nx&&console.warn("useRemoveBackground is deprecated. Use setRemoveBackgroundEnabled instead."),rx(e)});qn(e=>{Ir.aiTextEnabled=e});qn(e=>{nx&&console.warn("useHtmlTextRender is deprecated. Use setRichTextEnabled instead."),Ir.htmlRenderEnabled=e});const _O=qn(e=>{Ir.htmlRenderEnabled=e}),SO=qn(e=>{Ir.imageDownScalingEnabled=e});qn(e=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),SO(e)});qn(e=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),Ir.textOverflow="change-font-size"});const ix=qn(e=>{Ir.textOverflow=e}),EO=qn(e=>{Ir.textSplitAllowed=e});qn(e=>{Ir.animationsEnabled=e});qn(e=>{Ir.autoDeleteEmptyText=e});function Ho(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(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&nbsp;/g," ")}function Mb(e){return e?/<[a-z][a-z0-9]*(\s[^>]*)?>[^<]*<\/[a-z][a-z0-9]*>/i.test(e)?e=(e=e.replace(/<(?![a-z/!])/gi,"&lt;")).replace(/([^a-z0-9"'\s/])>/gi,"$1&gt;"):e.replace(/</g,"&lt;").replace(/>/g,"&gt;"):""}const kO={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 ax(e){return Object.assign(Object.assign({},kO),e)}function AO(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++)AO(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(!ua(e))return"";const{stops:i,rotation:a}=qp(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 PO(e){var t,n,r,i,a,o;const s=e.a?e.a:e,u=ax(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:Ho(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 o2(e,{fontFamily:t="",color:n="black",forEditor:r=!1}={}){const i=ax(e),a=t||i.fontFamily,o=ua(i.fill),s=ua(i.stroke),u=m=>`
50
- background-image: ${m};
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 p=["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 m=PO(e),d=Math.round(i.width||100),y=ph(d,m,i.curvePower,i.fontSize),w=Ho(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="${m}">
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%">${w}</textPath>
70
- </text>`,S+=`
71
- <text ${k} fill="${o?`url(#curve-fill-grad-${i.id||"temp"})`:n}">
72
- <textPath href="#${x}" startOffset="50%">${w}</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%">${w}</textPath>
84
- </text>`}return S+="</svg>",S}if(i.strokeWidth&&(s||o&&!s)&&!r){const m=Mb(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 w;return w=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="${w}; position: absolute; top: 0; left: 0; pointer-events: none;" aria-hidden="true">${m}</div>
87
- <div style="${y}; ${o?u(i.fill):`color: ${n||i.fill}`}; position: relative;" contentEditable dir="${Ap(Ho(i.text))}">${m}</div>
88
- </div>
89
- `}return`<div style="${p}" contentEditable dir="${Ap(Ho(i.text))}">${Mb(i.text).replace(/\n/g,"</br>")}</div>`}function OO({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 CO={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=CO[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 Ib={},ox="warn";function LO(e){ox=e}function NO(){return ox}var ja;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(ja||(ja={}));var Ev=function(e,t){return Ev=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])},Ev(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");Ev(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Vu=function(){return Vu=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},Vu.apply(this,arguments)};function TO(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 sx(e){return Hn(e).type}function lx(e,t){return Hn(e).onSnapshot(t)}function jb(e,t){Hn(e).applyPatches(vx(t))}function kv(e,t){return Hn(e).applySnapshot(t)}function wc(e,t){t===void 0&&(t=!0);var n=Hn(e);return t?n.snapshot:n.type.getSnapshot(n,!1)}function F1(e,t){for(var n=Hn(e).parent;n;){if(t.is(n.storedValue))return!0;n=n.parent}return!1}function Qf(e,t){for(var n=Hn(e).parent;n;){if(t.is(n.storedValue))return n.storedValue;n=n.parent}throw new nn("Failed to find the parent of ".concat(Hn(e)," of a given type"))}function RO(e){return Hn(e).root.storedValue}function MO(e){return Hn(e).path}function IO(e,t){var n=nC(Hn(e),t);return n?n.value:void 0}function jO(e){return Hn(e).identifier}function ih(e){return Hn(e).detach(),e}function s2(e){var t=Hn(e);t.isRoot?t.die():t.parent.removeChild(t.subpath)}function Db(e){return Hn(e).observableIsAlive}var ux=(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 wx),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=m0("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=m0("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 nn("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})(ux);Pp.prototype.die=qn(Pp.prototype.die);var DO=1,tu;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(tu||(tu={}));var rl;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(rl||(rl={}));var FO={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:++DO}),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:tu.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 JO),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 nn("Instance identifier '".concat(s.identifierAttribute,"' for type '").concat(s.type.name,"' must be a string or a number"));s.identifier=$p(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===tu.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=tu.CREATING;for(var s=[],u=this.parent;u&&u._observableInstanceState===tu.UNINITIALIZED;)s.unshift(u),u=u.parent;try{for(var h=pp(s),c=h.next();!c.done;c=h.next()){var p=c.value;p.createObservableInstanceIfNeeded(!1)}}catch(w){r={error:w}}finally{try{c&&!c.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}var m=this.type;try{this.storedValue=m.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,m.finalizeNewInstance(this,this.storedValue)}catch(w){throw this.state=Ao.DEAD,w}finally{this._isRunningAction=!1}if(this._observableInstanceState=tu.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 p=y.value;p.fireHook(ja.afterCreate),p.finalizeCreation()}}catch(w){a={error:w}}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"&&(vc?vc(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===tu.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=NO();if(!this.isAlive&&r!=="ignore"){var i=this._getAssertAliveError(n);switch(r){case"error":throw new nn(i);case"warn":hC(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||qO();a&&a.type!=="action"&&a.parentActionEvent&&(a=a.parentActionEvent);var o="";if(a&&a.name!=null){var s=a&&a.context&&MO(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===tu.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===tu.CREATED?this.type.getChildren(this):gx(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 nn("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 nn("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=xx(i.path),o=px(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",tC)}}),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!==tu.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=lC({},n,{path:i}),o=Sf(pC(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 nn("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 nn("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=U6(function(){return n.snapshot},function(i){return n.emitSnapshot(i)},FO);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 wx),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})(ux);Ms.prototype.createObservableInstance=qn(Ms.prototype.createObservableInstance);Ms.prototype.detach=qn(Ms.prototype.detach);Ms.prototype.die=qn(Ms.prototype.die);var cx,or;(function(e){e[e.String=1]="String",e[e.Number=2]="Number",e[e.Boolean=4]="Boolean",e[e.Date=8]="Date",e[e.Literal=16]="Literal",e[e.Array=32]="Array",e[e.Map=64]="Map",e[e.Object=128]="Object",e[e.Frozen=256]="Frozen",e[e.Optional=512]="Optional",e[e.Reference=1024]="Reference",e[e.Identifier=2048]="Identifier",e[e.Late=4096]="Late",e[e.Refinement=8192]="Refinement",e[e.Union=16384]="Union",e[e.Null=32768]="Null",e[e.Undefined=65536]="Undefined",e[e.Integer=131072]="Integer",e[e.Custom=262144]="Custom",e[e.SnapshotProcessor=524288]="SnapshotProcessor",e[e.Lazy=1048576]="Lazy",e[e.Finite=2097152]="Finite",e[e.Float=4194304]="Float"})(or||(or={}));var fx="cannotDetermine",BO=Symbol("$type"),Ec=(function(){function e(t){Object.defineProperty(this,cx,{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 Sc(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 nn("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=dx(t);if(r){var i=sx(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 nn("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 nn("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 nn("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 nn("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})();cx=BO;Ec.prototype.create=qn(Ec.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===$p(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)&&Hn(r)===n?!0:n.type===this&&yx(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(sx(r))){var s=Hn(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})(Ec);bd.prototype.create=qn(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})(Ec);function kc(e){return typeof e=="object"&&e&&e.isType===!0}var zO=1,gp;function qO(){return gp}function UO(){return zO++}function HO(e,t){var n=Hn(e.context);e.type==="action"&&n.assertAlive({actionContext:e});var r=n._isRunningAction;n._isRunningAction=!0;var i=gp;gp=e;try{return WO(n,e,t)}finally{gp=i,n._isRunningAction=r}}function $O(e){if(e)return e.type==="action"?e:e.parentActionEvent}function Op(e,t,n){var r=function(){var i=UO(),a=gp,o=$O(a);return HO({type:"action",name:t,id:i,args:fC(arguments),context:e,tree:RO(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 GO=(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 WO(e,t,n){var r=new GO(e,n);if(r.isEmpty)return qn(n).apply(null,t.args);var i=null;function a(o){var s=r.getNextMiddleware(),u=s&&s.handler;if(!u)return qn(n).apply(null,o.args);if(!s.includeHooks&&ja[o.name])return a(o);function h(p,m){i=a(p),m&&(i=m(i))}function c(p){i=p}return u(o,h,c),i}return a(t)}function VO(e){try{return JSON.stringify(e)}catch(t){return"<Unserializable: ".concat(t,">")}}function hx(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):Fi(e)?"<".concat(e,">"):"`".concat(VO(e),"`")}function YO(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function XO(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(Hn(t).type.name,":"):Cp(t)?"value":"snapshot",o=n&&Fi(t)&&n.is(Hn(t).snapshot);return"".concat(i).concat(a," ").concat(hx(t)," is not assignable ").concat(n?"to type: `".concat(n.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(n?MC(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 hy(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 J0(e){return e.reduce(function(t,n){return t.concat(n)},[])}function Sc(e,t){dC()&&KO(e,t)}function KO(e,t){var n=e.validate(t,[{path:"",type:e}]);if(n.length>0)throw new nn(ZO(e,t,n))}function ZO(e,t,n){if(n.length!==0)return"Error while converting ".concat(YO(hx(t))," to `").concat(e.name,`\`:
90
-
91
- `)+n.map(XO).join(`
92
- `)}var QO=0,JO=(function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:QO++}),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([],eg));var i=this.cache.get(r);if(i.indexOf(t)!==-1)throw new nn("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;X6(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 IS(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 p=u[c];(p===t||p.path.indexOf(i)===0)&&(r.addNodeToCache(p,!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 nn("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 dy(e,t,n,r,i){var a=dx(i);if(a){if(a.parent)throw new nn("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 eC(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 Hn(e){if(!Fi(e))throw new nn("Value ".concat(e," is no MST Node"));return e.$treenode}function dx(e){return e&&e.$treenode||null}function tC(){return Hn(this).snapshot}function nC(e,t,n){return n===void 0&&(n=!0),px(e,xx(t),n)}function px(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=Hn(o))}if(r instanceof Ms){var s=r.getChildType(a);if(s&&(r=r.getChildNode(a),r))continue}}}throw new nn("Could not resolve '".concat(a,"' in path '").concat(Fb(t.slice(0,i))||"/","' while resolving '").concat(Fb(t),"'"))}}catch(u){if(!n)return;throw u}return r}function gx(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 rC=Object.toString(),wd=Object.freeze([]),xd=Object.freeze({}),eg=sS().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(eg);var nn=(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 iC(e){return e}var aC=Number.isInteger;function oC(e){return Number(e)===e&&e%1!==0}function sC(e){return Number.isFinite(e)}function mx(e){return Array.isArray(e)||Yu(e)}function vx(e){return e?mx(e)?e:[e]:wd}function lC(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())===rC}function yx(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 bx(e){return typeof e!="function"}function uC(e,t,n){su(e)?Z6(e,t,n):Object.defineProperty(e,t,n)}function ah(e,t,n){uC(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}var cC=(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})(),wx=(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 cC),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 fC(e){for(var t=new Array(e.length),n=0;n<e.length;n++)t[n]=e[n];return t}function l2(e,t){return e.indexOf(t)===0}function hC(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function dC(){return typeof process<"u"&&Ib&&Ib.ENABLE_TYPE_CHECK==="true"}function pC(e){if(!("oldValue"in e))throw new nn("Patches without `oldValue` field cannot be inversed");return[gC(e),mC(e)]}function gC(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 mC(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 vC(e){return typeof e=="number"}function oh(e){return vC(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function yC(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Fb(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 xx(e){var t=e.split("/").map(yC),n=e===""||e==="."||e===".."||l2(e,"/")||l2(e,"./")||l2(e,"../");if(!n)throw new nn("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return t[0]===""&&t.shift(),t}var u2=Symbol("$preProcessorFailed"),bC=(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|or.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 u2}}}),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;wC(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)},zC(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===u2?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=kc(n)?this._subtype:Fi(n)?n:this.preProcessSnapshotSafe(n);return r===u2?!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})(Ec);function wC(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 xC(e,t,n){return new bC(e,t,n)}var Bb="Map.put can only be used to store complex values that have an identifier type attribute";function _x(e,t){var n,r,i=e.getSubTypes();if(i===fx)return!1;if(i){var a=vx(i);try{for(var o=pp(a),s=o.next();!s.done;s=o.next()){var u=s.value;if(!_x(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 _C=(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 nn("Map.put cannot be used to set empty values");if(Fi(n)){var r=Hn(n);if(r.identifier===null)throw new nn(Bb);return this.set(r.identifier,n),n}else if(yx(n)){var i=Hn(this),a=i.type;if(a.identifierMode!==df.YES)throw new nn(Bb);var o=a.mapIdentifierAttribute,s=n[o];if(!py(s)){var u=this.put(a.getChildType().create(n,i.environment));return this.put(wc(u))}var h=$p(s);return this.set(h,n),this.get(h)}else throw new nn("Map.put can only be used to store complex values")}}),t})(Zv),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,"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:or.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(),dy(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(_x(this._subType,n)){var r=n.reduce(function(i,a){if(!a.identifierAttribute)return i;if(i&&i!==a.identifierAttribute)throw new nn("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 _C(n,this.name)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){V6(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)})}),Yv(r,this.willChange),Xv(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 X6(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 nn("Not a child "+r);return i}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=Hn(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;Sc(o,s),n.newValue=o.reconcile(r.getChildNode(i),n.newValue,r,i),a.processIdentifier(i,n.newValue)}break;case"add":Sc(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 nn("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=Hn(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){Sc(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)?J0(Object.keys(n).map(function(a){return i._subType.validate(n[a],hy(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);L0.prototype.applySnapshot=qn(L0.prototype.applySnapshot);function SC(e){return new L0("Map<string, ".concat(e.name,">"),e)}var N0=(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:or.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 dy(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=Vu(Vu({},eg),{name:this.name});return Qn.array(gx(n),r)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){Gu(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)})}),Yv(r,this.willChange),Xv(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 nn("Not a child: "+r)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=Hn(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=zb(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=zb(r,i,a.slice(s,s+u),h,h.map(function(m,d){return s+d}));if(!c)return null;n.added=c;for(var p=s+u;p<a.length;p++)a[p].setParent(r,""+(p+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=Hn(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){Sc(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 mx(n)?J0(n.map(function(a,o){return i._subType.validate(a,hy(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);N0.prototype.applySnapshot=qn(N0.prototype.applySnapshot);function EC(e){return new N0("".concat(e.name,"[]"),e)}function zb(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(eC(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(qb(u,h))n[o]=c2(t,e,c,h,u);else{for(var m=void 0,d=o;d<n.length;d++)if(qb(n[d],h)){m=n.splice(d,1)[0];break}a=!1;var p=c2(t,e,c,h,m);n.splice(o,0,p)}else{if(Fi(h)&&Hn(h).parent===e)throw new nn("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(Hn(h).path,"'"));a=!1;var p=c2(t,e,c,h);n.splice(o,0,p)}}return a?null:n}function c2(e,t,n,r,i){Sc(e,r);function a(){if(Fi(r)){var s=Hn(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 qb(e,t){if(!e.isAlive)return!1;if(Fi(t)){var n=Hn(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 Ub="preProcessSnapshot",Hb="postProcessSnapshot";function kC(){return Hn(this).toString()}var $b={name:"AnonymousModel",properties:{},initializers:wd};function AC(e){var t=Object.keys(e),n=new Set;return t.forEach(function(r){if(n.has(r))throw new nn("".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 nn("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 nn("Getters are not supported as properties. Please use views instead");var o=a.value;if(o==null)throw new nn("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(RC(o),o);else if(o instanceof L0)r[i]=sh(o,{});else if(o instanceof N0)r[i]=sh(o,[]);else if(!kc(o))throw new nn("Invalid type definition for property '".concat(i,"', cannot infer a type from a value like '").concat(o,"' (").concat(typeof o,")"));return r},Vu({},e))}var Lp=(function(e){li(t,e);function t(n){var r=e.call(this,n.name||$b.name)||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:or.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,$b,n),r.properties=AC(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&or.Identifier){if(n)throw new nn("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 nn("actions initializer should return a plain object containing actions");Object.getOwnPropertyNames(r).forEach(function(a){if(a in i.properties)throw new nn("'".concat(a,"' is a property and cannot be declared as an action"));if(a===Ub)throw new nn("Cannot define action '".concat(Ub,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(a===Hb)throw new nn("Cannot define action '".concat(Hb,"', 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 p=Op(n,a,c);r[a]=p,ah(n,a,p)})}}),Object.defineProperty(t.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this;if(typeof n!="function")throw new nn("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 nn("volatile state initializer should return a plain object containing state");Object.getOwnPropertyNames(r).forEach(function(a){if(a in i.properties)throw new nn("'".concat(a,"' is a property and cannot be declared as volatile state"));K6(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=TO(o,["actions","views","state"]);for(var p in c)throw new nn("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(p,"'"));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 nn("views initializer should return a plain object containing views");Object.getOwnPropertyNames(r).forEach(function(a){var o;if(a in i.properties)throw new nn("'".concat(a,"' is a property and cannot be declared as a view"));var s=Object.getOwnPropertyDescriptor(r,a);if("get"in s)Z6(n,a,s),J6(n,(o={},o[a]=bh,o));else if(typeof s.value=="function")ah(n,a,s.value);else throw new nn("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 dy(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=Vu(Vu({},eg),{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",kC),this.forAllProps(function(i){V6(r,i,n.unbox)}),this.initializers.reduce(function(i,a){return a(i)},r),Yv(r,this.willChange),Xv(r,this.didChange)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=n,i=Hn(r.object),a=r.name;i.assertWritable({subpath:a});var o=i.type.properties[a];return o&&(Sc(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=Hn(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 nn("Not a value property: "+r);var a=Gu(n.storedValue,r),o=(i=a.raw)===null||i===void 0?void 0:i.call(a);if(!o)throw new nn("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 nn("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){Sc(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)?J0(this.propertyNames.map(function(o){return i.properties[o].validate(a[o],hy(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=qn(Lp.prototype.applySnapshot);function PC(){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 OC(){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 CC(e){return kc(e)&&(e.flags&or.Object)>0}var Cc=(function(e){li(t,e);function t(n,r,i,a){a===void 0&&(a=iC);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),Sx=new Cc("string",or.String,function(e){return typeof e=="string"}),Ex=new Cc("number",or.Number,function(e){return typeof e=="number"}),LC=new Cc("integer",or.Integer,function(e){return aC(e)}),NC=new Cc("float",or.Float,function(e){return oC(e)}),TC=new Cc("finite",or.Finite,function(e){return sC(e)}),kx=new Cc("boolean",or.Boolean,function(e){return typeof e=="boolean"}),Ax=new Cc("null",or.Null,function(e){return e===null}),Px=new Cc("undefined",or.Undefined,function(e){return e===void 0}),Ox=new Cc("Date",or.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});Ox.getSnapshot=function(e){return e.storedValue.getTime()};var Cx=Ox;function RC(e){switch(typeof e){case"string":return Sx;case"number":return Ex;case"boolean":return kx;case"object":if(e instanceof Date)return Cx}throw new nn("Cannot determine primitive type from value "+e)}function MC(e){return kc(e)&&(e.flags&(or.String|or.Number|or.Integer|or.Boolean|or.Date))>0}var IC=(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:or.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 Lx(e){return new IC(e)}var jC=(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|or.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)?Hn(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})(Ec);function DC(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=typeof e[0]=="string"?e.shift():kc(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 jC(n,r,i,a)}function FC(e,t){var n=typeof e=="string"?t:e,r=tg.apply(void 0,gh([],Sf(n.map(function(i){return Lx(""+i)})),!1));return typeof e=="string"&&(r.name=e),r}var BC=(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=Vu({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=or.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 nn("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 nn("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(J0(i))}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),t})(Ec);function tg(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=kc(e)?void 0:e,i=kc(e)?gh([e],Sf(t),!1):t,a="("+i.map(function(o){return o.name}).join(" | ")+")";return new BC(a,i,r)}function zC(e){return kc(e)&&(e.flags&or.Union)>0}var qC=(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|or.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"&&Sc(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})(Ec);function UC(e,t){if(typeof t!="function"&&Fi(t))throw new nn("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function sh(e,t,n){return UC(e,t),new qC(e,t,n||HC)}var HC=[void 0],$C=sh(Px,void 0),GC=sh(Ax,null);function Nx(e){return tg(e,$C)}function WC(e){return tg(e,GC)}var VC=(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)|or.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 nn("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||fx}}),t})(Ec);function YC(e,t){var n=typeof e=="string"?e:"late(".concat(e.toString(),")"),r=typeof e=="string"?t:e;return new VC(n,r)}function XC(e,t){return new KC(e,t)}var KC=(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:or.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()}),x5(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(qn(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),x5(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):bx(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),Tx=(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:or.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 bx(n)?this.subType?this.subType.validate(n,r):Is():js(r,n,"Value is not serializable and cannot be frozen")}}),t})(Ph),Gb=new Tx;function ZC(e){return arguments.length===0?Gb:kc(e)?new Tx(e):sh(Gb,e)}function QC(e){switch(e){case ja.beforeDestroy:return"destroy";case ja.beforeDetach:return"detach";default:return}}var JC=(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}),py(t))this.identifier=t;else if(Fi(t)){var r=Hn(t);if(!r.identifierAttribute)throw new nn("Can only store references with a defined identifier attribute.");var i=r.unnormalizedIdentifier;if(i==null)throw new nn("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw new nn("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=$p(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 eL("[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})(),eL=(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),Rx=(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:or.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 py(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){jb(r.root.storedValue,{op:"replace",value:u,path:r.path})},removeRef:function(){CC(o.type)?this.replaceRef(void 0):jb(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=Hn(a),s=function(c,p){var m=QC(p);m&&i.fireInvalidated(m,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 p=void 0;i?p=!!i.get(r,c):p=n.root.identifierCache.has(a.targetType,$p(r)),p?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),tL=(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)?jO(a):a,s=new JC(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})(Rx),nL=(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})(Rx);function Mx(e,t){var n=t||void 0,r=t?t.onInvalidated:void 0;return n&&(n.get||n.set)?new nL(e,{get:n.get,set:n.set},r):new tL(e,r)}function rL(e,t){var n=Mx(e,Vu(Vu({},t),{onInvalidated:function(r){t&&t.onInvalidated&&t.onInvalidated(r),r.removeRef()}}));return t&&t.acceptsUndefined===!1?n:Nx(n)}var Ix=(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:or.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 nn("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 nn("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),iL=(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:or.Identifier}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),t})(Ix),aL=(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})(Ix),oL=new iL,sL=new aL;function $p(e){return""+e}function py(e){return typeof e=="string"||typeof e=="number"}function lL(e){return new uL(e)}var uL=(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:or.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:FC,model:PC,compose:OC,custom:lL,reference:Mx,safeReference:rL,union:tg,optional:sh,literal:Lx,maybe:Nx,maybeNull:WC,refinement:DC,string:Sx,boolean:kx,number:Ex,integer:LC,float:NC,finite:TC,Date:Cx,map:SC,array:EC,frozen:ZC,identifier:oL,identifierNumber:sL,late:YC,lazy:XC,undefined:Px,null:Ax,snapshotProcessor:xC};function jx({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 cL(e){try{const{stops:t}=qp(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 Wb(e){if(ua(e))return cL(e);const{r:t,g:n,b:r}=un.Util.colorToRGBA(e);return(299*t+587*n+114*r)/1e3}function Dx(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=Wb(e.fill),i=Wb(n);return Math.abs(r-i)>=50?n:e.fill}let Xf;function fL(){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 Vb={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal",textTransform:"none"},hL=Jr(({textNodeRef:e,element:t,onBlur:n,selectAll:r,cursorPosition:i})=>{const[a,o]=oe.useState(Vb),s=e.current;oe.useLayoutEffect(()=>{const m={};m.width=s.width()-2*s.padding()+"px",m.height=s.height()-2*s.padding()+s.fontSize()*s.lineHeight()+"px",m.fontSize=s.fontSize()+"px",m.lineHeight=s.lineHeight()+.01,m.fontFamily=s.fontFamily(),m.textAlign=s.align(),m.color=s.fill(),m.fontWeight=t.fontWeight,m.fontStyle=t.fontStyle,m.letterSpacing=t.letterSpacing+"em",m.opacity=Math.max(t.a.opacity,.2),m.textTransform=t.textTransform,m.caretColor=Dx(t);const d=`
93
- .polotno-input::placeholder {
94
- color: ${a.color};
95
- opacity: 0.6;
96
- }
97
- `,y=fL();y.innerHTML="",y.appendChild(document.createTextNode(d)),JSON.stringify(m)!==JSON.stringify(a)&&o(m)});const u=oe.useRef(null);if(oe.useLayoutEffect(()=>{var m;const d=u.current;if(!d)return;(m=u.current)===null||m===void 0||m.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 m=d=>{var y;!((y=u.current)===null||y===void 0)&&y.contains(d.target)||n()};return window.addEventListener("touchstart",m),()=>{window.removeEventListener("blur",n),window.removeEventListener("touchstart",m)}},[]),!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 p=Ho(t.text);return oe.createElement("textarea",{className:"polotno-input",ref:u,dir:Ap(p),style:Object.assign(Object.assign(Object.assign({},Vb),a),{paddingTop:h+"px"}),value:p,onChange:m=>{const d=jx({oldText:t.text,newText:m.target.value,element:t});t.set({text:m.target.value,fontSize:d})},placeholder:t.placeholder,onBlur:n})}),dL=e=>oe.createElement(P0,null,oe.createElement(hL,Object.assign({},e))),Fx=(e,t)=>{const[n,r]=oe.useReducer(o=>o+1,0),i=oe.useRef(Nb(t)),a=oe.useRef(null);return oe.useLayoutEffect(()=>{if(i.current=Nb(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]},Bx=({fontLoaded:e,fontFamily:t,fontSize:n,lineHeight:r})=>oe.useMemo(()=>OO({fontFamily:t,fontSize:n,lineHeight:r}),[e,t,n,r]);function T0(e){const t=oe.useRef(e),n=oe.useRef(e);return oe.useMemo(()=>{n.current=t.current,t.current=e},[e]),n.current}const pL=Jr(({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,p=T0(c),{textVerticalResizeEnabled:m}=Ir,d=Ir.autoDeleteEmptyText,y=T0(e.fontFamily),[w,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(w)&&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(()=>{p&&!c&&d&&e.text===""&&e.removable&&!e.placeholder&&t.deleteElements([e.id])},[d,e.placeholder,e.removable,e.text,c,p]),oe.useLayoutEffect(()=>$u(()=>{const ee=n.current;Rs(ee,e)}));const[b]=Fx(t,e.fontFamily);let S=Ho(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();m&&e.a.height<X&&!s&&re(()=>{var B;Db(e)&&e.set({height:X}),(B=n.current)===null||B===void 0||B.height(X)},!1,!0),m||e.a.height===X||s||re(()=>{var B;Db(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=Ho(z.text);let fe=z.a.fontSize;F.height(void 0);const ue=Math.round(2*z.a.fontSize)-1;for(let we=1;we<ue;we++){const Ce=z.a.height&&F.height()>z.a.height;let Ue=ie.split(`
98
- `).join(" ").split(/[\s-]+/).reduce((ge,ut)=>(ut=ut.toLowerCase(),/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(ut)?ge.concat(ut.split("")):ge.concat(ut)),[]),ze=F.textArr.map(ge=>ge.text.toLowerCase()).join(";");const tt=Ue.find(ge=>!ze.includes(ge)||(ze=ze.replace(ge,""),!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||m||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),M=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 we=fe.getStage().getPointerPosition();return ue.point(we)})(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;Up(n,O);const R=Bx({fontLoaded:b,fontFamily:e.fontFamily,fontSize:e.a.fontSize,lineHeight:e.lineHeight}),j=e.selectable||t.role==="admin",D=Wu(e),L=Wu(e,e.stroke,"stroke"),T=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=Pb(`M ${B} ${F} L ${z} ${F} L ${z} ${Y} L ${B} ${Y} Z`);return Ob(J,X).path})({width:e.a.width,height:e.a.height,cornerRadius:e.backgroundCornerRadius*(e.a.fontSize*R*.5),padding:e.backgroundPadding*(e.a.fontSize*R*.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,we=ee[fe-1];we&&we.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 we=ee[J-1];we&&we.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=Pb(Y);return Ob(K,F).path})({lines:JSON.parse(JSON.stringify(w)),cornerRadius:e.backgroundCornerRadius*(e.a.fontSize*R*.5),lineHeight:R*e.a.fontSize,padding:e.backgroundPadding*(e.a.fontSize*R*.5),width:e.a.width,align:e.align}):"",[e.backgroundEnabled,e.curveEnabled,e.backgroundCornerRadius,e.a.fontSize,e.a.height,R,e.backgroundPadding,e.a.width,e.align,w]),$=Tf();let U=0;e.curveEnabled||(e.verticalAlign==="middle"?U=(e.a.height-w.length*R*e.a.fontSize)/2:e.verticalAlign==="bottom"&&(U=e.a.height-w.length*R*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:T,fill:e.backgroundColor,offsetY:-U}),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(HP,Object.assign({ref:r,visible:e.curveEnabled,data:te,text:S||e.placeholder,listening:!1,align:"center",textBaseline:"middle"},D,L,{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,L,{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:R,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:M,onTap:M,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 we=Math.max(fe,h.current);B.height(we),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():R*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(fr,{x:e.a.x,y:e.a.y,rotation:e.a.rotation},oe.createElement(dL,{textNodeRef:n,element:e,selectAll:o,cursorPosition:A.current,onBlur:()=>{e.toggleEditMode(!1)}})))});var f2={exports:{}},h2={exports:{}},Yb;function gy(){return Yb||(Yb=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
- `)}})(h2)),h2.exports}var Xb;function zx(){return Xb||(Xb=1,(function(e,t){gy()("lex"),e.exports=n;function n(r){var i="",a,o=0,s=-1,u=0,h=1,c="before-selector",p=[c],m={},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 w(){return R(),r[s]}function x(ee){return ee?p[p.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=p.pop();return c=p[p.length-1],ee}function M(ee){return c=ee,p.push(c),p.length}function O(ee){var Q=c;return p[p.length-1]=c=ee,Q}function R(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(){m.end={line:h,col:o},d.push(m),i="",m={}}function D(ee){m={type:ee,start:{line:h,col:o}}}for(;a=w();)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
- `&&(m.value=i.trim(),j(),A());break}break;case":":switch(x()){case"name":m.name=i.trim(),i="",O("before-value");break;case"before-selector":i+=a,D("selector"),M("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&&(m.value=i.trim(),j()),O("before-name");break;case"value-paren":i+=a;break;case"at-value":m.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}m.text=i.trim(),j(),O("before-name"),u=u+1;break;case"at-group":switch(m.name=i.trim(),m.type){case"font-face":case"viewport":case"page":M("before-name");break;default:M("before-selector")}j(),u=u+1;break;case"name":case"at-rule":m.name=i.trim(),j(),M("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&&(m.value=i.trim()),m.name&&m.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"),M(a==='"'?"double-string":"single-string");break;case"before-value":O("value"),M(a==='"'?"double-string":"single-string");break;case"comment":break;default:E(-1)!=="\\"&&M(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 L=S("*/");L&&R(L+1)}else x()=="before-value"&&O("value"),i+=a;break;default:k("*")?(D("comment"),M("comment"),R()):i+=a;break}break;case"*":switch(x()){case"comment":k("/")?(m.text=i,R(),j(),A()):i+=a;break;case"before-selector":i+=a,D("selector"),M("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 T=!1,$,U,te=0,se=y.length;!T&&te<se;++te)U=y[te],$=U.name||U,b($)&&(T=!0,D($),M(U.state||"at-group"),R($.length),U.prefix&&(m.prefix=U.prefix),U.type&&(m.type=U.type));T||(i+=a);break}break;case"(":switch(x()){case"value":M("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"),M("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}})(f2)),f2.exports}var d2={exports:{}},Kb;function gL(){return Kb||(Kb=1,(function(e,t){gy()("parse");var n=zx();e.exports=s;var r,i,a,o;function s(A,M){M||(M={}),r=!!M.comments,a=!!M.position,i=0,o=Array.isArray(A)?A.slice():n(A);for(var O,R=[],j;j=h();)O=b(j),O&&R.push(O);return{type:"stylesheet",stylesheet:{rules:R}}}function u(A,M){M||(M={});for(var O,R=["type","name","value"],j={},D=0;D<R.length;++D)O=R[D],A[O]&&(j[O]=M[O]||A[O]);for(R=Object.keys(M),D=0;D<R.length;++D)O=R[D],j[O]||(j[O]=M[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 M={};switch(A.type){case"font-face":case"viewport":M.declarations=k();break;case"page":M.prefix=A.prefix,M.declarations=k();break;default:M.prefix=A.prefix,M.rules=E()}return u(A,M)}function p(A){return u(A)}function m(A){return u(A)}function d(A){return u(A,{text:A.text})}function y(A){return u(A)}function w(A){return u(A)}function x(A){function M(O){return O.trim()}return u(A,{type:"rule",selectors:A.text.split(",").map(M),declarations:k()})}function b(A){switch(A.type){case"property":return w(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 m(A);case"import":return p(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 M,O=[],R;(R=h())&&A&&A(R);)M=b(R),M&&O.push(M);return R&&R.type!=="end"&&o.unshift(R),O}function k(){return S(function(A){return A.type==="property"||A.type==="comment"})}function E(){return S(function(){return i})}})(d2)),d2.exports}var p2={exports:{}},Zb;function mL(){return Zb||(Zb=1,(function(e,t){gy()("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 M=y(E.stylesheet.rules,S).join(`
105
- `).trim();return M}function h(E){if(E){a+=E;return}return r?"":Array(a).join(i||"")}function c(E){return"@"+E.type+" "+E.value+";"+o}function p(E){var A="",M=E.prefix||"";E.name&&(A=" "+E.name);var O=E.type!=="page";return"@"+M+E.type+A+s+w(E,O)+o}function m(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+w(E)+o}function y(E,A){return E.reduce(function(M,O){var R=O.type==="comment"?m(O):A(O);return R&&M.push(R),M},[])}function w(E,A){var M=E.declarations,O=b;return E.rules&&(M=E.rules,O=d),M=x(M,O),M&&(M=o+M+(A?"":o)),"{"+M+h()+"}"}function x(E,A){if(!E)return"";h(1);var M=y(E,A);return h(-1),M.length?M.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 p(E);case"comment":return m(E);case"import":case"charset":case"namespace":return c(E);case"font-face":case"supports":case"viewport":case"document":case"page":return p(E)}}function k(E){var A=E.name?E.name+":"+s:"";return h()+A+E.value+";"}})(p2)),p2.exports}var g2,Qb;function vL(){return Qb||(Qb=1,g2={lex:zx(),parse:gL(),stringify:mL()}),g2}var yL=vL();const bL=yh(yL);function wL(e){for(;e.parentNode;){if(e.nodeName==="defs")return!0;e=e.parentNode}return!1}function xL(e){const t={};return e.querySelectorAll("style").forEach(n=>{const r=bL.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 qx(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&&qx(s,t);u?.fill==="currentColor"||u?.stroke==="currentColor"||(r.fill="black")}return r}const _L=["path","rect","circle","line","polygon","polyline","ellipse","text"];function SL(e){for(var t=[],n=e.getElementsByTagName("*"),r=0,i=n.length;r<i;r++){const a=n[r];wL(a)||(a.getAttribute("fill")!==null&&t.push(a),(a.getAttribute("stroke")!==null||a.style&&a.style.fill||_L.indexOf(a.nodeName)>=0)&&t.push(a))}return t}async function Jb(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 my(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 EL=(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 vy(e,t){var n=new DOMParser().parseFromString(e,"image/svg+xml");const r=SL(n),i=Array.from(t.keys()),a=xL(n);return r.forEach(o=>{const{fill:s,stroke:u}=qx(o,a);[{prop:"fill",color:s},{prop:"stroke",color:u}].forEach(({prop:h,color:c})=>{const p=i.find(m=>EL(m,c));if(p){const m=t.get(p);if(ua(m)){const{rotation:d,stops:y}=qp(m),w=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,M=document.createElementNS(A,"linearGradient");const O=un.Util.degToRad(k+90),R=(Math.cos(O)+1)/2,j=(Math.sin(O)+1)/2,D=(Math.cos(O+Math.PI)+1)/2,L=(Math.sin(O+Math.PI)+1)/2;M.setAttribute("x1",100*R+"%"),M.setAttribute("y1",100*j+"%"),M.setAttribute("x2",100*D+"%"),M.setAttribute("y2",100*L+"%"),M.setAttribute("gradientUnits","userSpaceOnUse"),M.setAttribute("id",S);for(var T=0;T<E.length;T++){var $=E[T],U=document.createElementNS(A,"stop");for(var te in $)$.hasOwnProperty(te)&&U.setAttribute(te,$[te]);M.appendChild(U)}(b.querySelector("defs")||b.insertBefore(document.createElementNS(A,"defs"),b.firstChild)).appendChild(M)})(n.children[0],x,d,w),o.style[h]=null,o.setAttribute(h,`url('#${x}')`)}else o.style[h]=t.get(p)}})}),Mf(new XMLSerializer().serializeToString(n))}const yy=(e,t,n)=>{let r=t,i=n,a=1;for(;r>0&&i>0;){if(e.width=r,e.height=i,r+i<4e3)return;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)}};function kL(e,t){var n,r;const i=(n=t.x)!==null&&n!==void 0?n:0,a=(r=t.y)!==null&&r!==void 0?r:0,o=t.pixelRatio||1,s=Math.round(t.width*o),u=Math.round(t.height*o),h=s/o,c=u/o;let p=t.sceneCanvas;p?(p.width!==s||p.height!==u||p.pixelRatio!==o)&&(p.setSize(h,c),p.setPixelRatio(o)):p=new Cl({width:h,height:c,pixelRatio:o});const m=p.getContext(),d=p.width/p.pixelRatio+Math.abs(i),y=p.height/p.pixelRatio+Math.abs(a);let w=t.bufferCanvas;if(w){const x=Math.round(d*p.pixelRatio),b=Math.round(y*p.pixelRatio);(w.width!==x||w.height!==b||w.pixelRatio!==p.pixelRatio)&&(w.setSize(d,y),w.setPixelRatio(p.pixelRatio))}else w=new Cl({width:d,height:y,pixelRatio:p.pixelRatio});return t.imageSmoothingEnabled===!1&&(m._context.imageSmoothingEnabled=!1),m.save(),(i||a)&&m.translate(-1*i,-1*a),e.drawScene(p,void 0,w),m.restore(),p}function Kj(){return{sceneCanvas:new Cl({width:1,height:1,pixelRatio:1}),bufferCanvas:new Cl({width:1,height:1,pixelRatio:1})}}const Av=(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 Ux=e=>e.indexOf("data:image/svg+xml")>=0||e.indexOf(".svg")>=0,e3=e=>{const[t,n]=oe.useState(e);return oe.useEffect(()=>{(async()=>{const r=await(async function(i){if(!Ux(i))return i;const a=await Gp(i),o=my(a);return Mf(o)})(e);r!==t&&n(r)})()},[e]),t};function t3(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}const AL={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},PL={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},n3=(e,t,n)=>Math.max(t,Math.min(n,e)),OL=(e,t,n,r,i=0,a=!1,o=!0)=>{const s=Math.floor(n3(e.a.width*r,1,1e4)),u=Math.floor(n3(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,p=e.page._exportingOrRendering&&Ir.imageDownScalingEnabled&&c<1&&!a,m=n.x===0&&n.y===0&&n.width===t?.width&&n.height===t?.height,d=oe.useMemo(()=>{if(t&&t.width&&t.height)return m&&h===0&&!p?void 0:rh()},[t,h,p,m]);return oe.useLayoutEffect(()=>{if(!d||!t)return;yy(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 w=p?(function(b,S){var k,E;const A=rh();A.width=b.width,A.height=b.height;const M=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 R=(function(j,D,L,T,$,U,te){for(var se=new ImageData(D,L),ee=new Int32Array(j.data.buffer),Q=j.width,re=new Int32Array(se.data.buffer),X=se.width,B=D/U,F=L/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,we=0,Ce=0,Ue=0,ze=0;ze<Y;ze++)for(var tt=0;tt<z;tt++){var ge=ee[fe+tt+ze*Q];ue+=ge<<24>>>24,we+=ge<<16>>>24,Ce+=ge<<8>>>24,Ue+=ge>>>24}ue=Math.round(ue/J),we=Math.round(we/J),Ce=Math.round(Ce/J),Ue=Math.round(Ue/J),re[ie+K*X]=Ue<<24|Ce<<16|we<<8|ue}return se})(A.getContext("2d").getImageData(0,0,A.width,A.height),M,O,0,0,A.width,A.height);return A.width=M,A.height=O,(E=A.getContext("2d"))===null||E===void 0||E.putImageData(R,0,0),A})(t,c):t,x=p?{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(w,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,p]),oe.useEffect(()=>()=>{d&&d.nodeName==="CANVAS"&&un.Util.releaseCanvas(d)},[d]),d||t},CL=rh(),LL=Jr(({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(fr,{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(ly,{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}))}),NL=Jr(({element:e})=>{const t=Math.max(10,Math.min(30,e.a.width/25));return oe.createElement(fr,{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 m2=uy;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"&&Hp(o)},[e])},r3=Jr(({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]=(ke=>{const[he,be]=oe.useReducer(xe=>xe+1,0),Le=oe.useRef("loading"),Me=oe.useRef(ke.src),ve=oe.useRef(ke.src);ve.current!==ke.src&&(ve.current=ke.src,Le.current="loading");const ye=oe.useMemo(()=>Ux(ke.src)||ke.type==="svg",[ke.src,ke.type]);return oe.useEffect(()=>{if(!ye||!ke.src)return;let xe=!1;return(async()=>{Le.current="loading",be();const Ie=await Gp(ke.src),Te=my(Ie);let Je;Je=ke.colorsReplace?vy(Te,ke.colorsReplace||new Map):Mf(Te),xe||(Me.current=Je,Le.current="loaded",be())})(),()=>{xe=!0}},[ke.src,JSON.stringify(ke.colorsReplace)]),ye?[Me.current,Le.current]:[ke.src,"loaded"]})(e),[c,p]=m2(u,"anonymous"),m=e.type!=="svg"||h==="loaded"?p:"loading";mp(m,e.src,e.id);const d=e.page._exportingOrRendering?1:Math.max(1,t.scale),y=t._elementsPixelRatio*d,w=(({image:ke,status:he,type:be})=>{const Le=oe.useRef();return oe.useEffect(()=>{Le.current=ke||Le.current},[ke]),he!=="failed"||he!=="failed"&&be==="svg"?Le.current:void 0})({image:c,status:p,type:e.type}),x=((ke,he,be)=>{const Le=oe.useMemo(()=>{var Me,ve;const{flipX:ye,flipY:xe}=ke,Ie=ke.type==="svg"||ke.src.indexOf("data:image/svg+xml")>=0||ke.src.indexOf(".svg")>=0,Te=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,Je=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||Te)&&Ie||ke.maskSrc;if(!ye&&!xe&&!Je)return he;if(!he||!he.width||!he.height)return null;const nt=rh();let st=1;ke.type==="svg"&&(st=Math.max(ke.a.width/he.width*be,ke.a.height/he.height*be)),yy(nt,Math.max(he.width*st,1),Math.max(he.height*st,1));let at=ye?-nt.width:0,ct=xe?-nt.height:0;return(Me=nt.getContext("2d"))===null||Me===void 0||Me.scale(ye?-1:1,xe?-1:1),(ve=nt.getContext("2d"))===null||ve===void 0||ve.drawImage(he,at,ct,nt.width,nt.height),nt},[ke.maskSrc,ke.flipX,ke.flipY,he,ke.a.width,ke.a.height,be]);return oe.useEffect(()=>()=>{Le&&Le.nodeName==="CANVAS"&&un.Util.releaseCanvas(Le)},[Le]),Le})(e,c||w,y),b=((ke,he)=>{const be=e3(ke.maskSrc||""),[Le,Me]=m2(be,"anonymous");return mp(be?Me:"loaded",be||"",ke.id),oe.useMemo(()=>{if(!Le||!he||!he.width||!he.height)return he;const ve=rh();ve.width=Math.max(he.width,1),ve.height=Math.max(he.height,1);const ye=ve.getContext("2d");if(!ye)return he;ye.drawImage(he,0,0),ye.globalCompositeOperation="source-in";const xe=(function(Ie,Te){const Je=Te.width/Te.height;let nt,st;return Je>=Ie.width/Ie.height?(nt=Ie.width,st=Ie.width/Je):(nt=Ie.height*Je,st=Ie.height),{x:(Ie.width-nt)/2,y:(Ie.height-st)/2,width:nt,height:st}})(Le,ke);return ye.drawImage(Le,xe.x,xe.y,xe.width,xe.height,0,0,he.width,he.height),ve},[he,Le,ke.a.width,ke.a.height])})(e,x)||CL;let{cropX:S,cropY:k,cropWidth:E,cropHeight:A}=e.a;p!=="loaded"&&(S=k=0,E=A=1);const M=b.width*E,O=b.height*A,R=e.a.width/e.a.height;let j,D;const L=M/O,T=e.stretchEnabled;T?(j=M,D=O):R>=L?(j=M,D=M/R):(j=O*R,D=O);const $={x:b.width*S,y:b.height*k,width:j,height:D},U=(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=((ke,he,be,Le)=>{const Me=e3(ke.clipSrc||""),[ve,ye]=m2(Me,"anonymous"),xe=ke.clipSrc?ye:"loaded";mp(xe,ke.clipSrc,ke.id);const Ie=oe.useMemo(()=>{if(he&&ve)return rh()},[he,ve]);return oe.useLayoutEffect(()=>{var Te;if(!ve||!he||!he.width||!he.height||!ve||!ve.width||!ve.height||!Ie)return;const Je=rh(),nt=Math.max(ke.a.width/ve.width*be,ke.a.height/ve.height*be);Je.width=Math.max(ve.width*nt,1),Je.height=Math.max(ve.height*nt,1),(Te=Je.getContext("2d"))===null||Te===void 0||Te.drawImage(ve,0,0,Je.width,Je.height),Ie.width=Math.max(he.width,1),Ie.height=Math.max(he.height,1);const st=Ie.getContext("2d");st&&(st.save(),st.drawImage(Je,0,0,he.width,he.height),un.Util.releaseCanvas(Je),st.globalCompositeOperation="source-in",st.drawImage(he,0,0,Ie.width,Ie.height),st.restore())},[Ie,he,ve,ke.a.width,ke.a.height,be,...Le]),ke.clipSrc&&ve?Ie:he})(e,OL(e,b,$,se,U,r||e._cropModeEnabled||e.type==="svg",!0),se,[$,U,se]);const Q=Math.max(e.a.width/j,e.a.height/D);oe.useEffect(()=>{var ke;if(!e._cropModeEnabled)return;const he=(ke=a.current)===null||ke===void 0?void 0:ke.getStage();function be(Me){e._cropModeEnabled&&Me.target!==o.current&&e.toggleCropMode(!1)}function Le(Me){e._cropModeEnabled&&Me.target.parentNode!==he.content&&e.toggleCropMode(!1)}return document.body.addEventListener("click",Le),he?.on("click",be),he?.on("tap",be),()=>{document.body.removeEventListener("click",Le),document.body.removeEventListener("touchstart",Le),he?.off("click",be),he?.off("click",be)}},[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 ke;r||e._cropModeEnabled?(ke=a.current)===null||ke===void 0||ke.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=ke=>{var he;((he=ke.evt.touches)===null||he===void 0?void 0:he.length)>2&&ke.target.stopDrag(),Math.round(ke.target.x())>0&&(ke.target.x(0),ke.target.scaleX(1)),Math.round(ke.target.y())>0&&(ke.target.y(0),ke.target.scaleY(1));const be=ke.target.width()*ke.target.scaleX(),Le=ke.target.height()*ke.target.scaleY(),Me=Math.min(1,j/be),ve=Math.min(1,D/Le),ye=1-Me,xe=Math.min(ye,Math.max(0,Math.round(-ke.target.x())/be)),Ie=1-ve,Te=Math.min(Ie,Math.max(0,Math.round(-ke.target.y())/Le));ke.target.setAttrs({x:-xe*b.width,y:-Te*b.height,scaleX:1,scaleY:1}),e.set({cropX:xe,cropY:Te,cropWidth:Me,cropHeight:ve})},K=()=>{e.type!=="svg"&&e.contentEditable&&(e.stretchEnabled||setTimeout(()=>{e.toggleCropMode(!0)}))},ie=e.type==="svg"&&w,fe=p==="loading"&&!ie,[ue]=Av(fe,100,!1,!1),we=p==="failed",Ce=!ue&&!we,Ue=oe.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),ze=Ce?e.a.opacity:0;Up(a,ze);const tt=e.selectable||t.role==="admin",ge=Tf(),ut=Wu(e,e.borderColor,"stroke");return oe.createElement(oe.Fragment,null,ue&&oe.createElement(LL,{element:e}),we&&oe.createElement(NL,{element:e}),oe.createElement(Du,{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:ge?e.draggable&&s:e.draggable,preventDefault:!ge||s,hideInExport:!e.showInExport,onDragMove:ke=>{e.set({x:ke.target.x(),y:ke.target.y()})},onDragEnd:ke=>{e.set({x:ke.target.x(),y:ke.target.y()})},onDblClick:K,onDblTap:K,onTransformStart:()=>{i(!0),Ue.current={cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight}},onTransform:ke=>{var he;const be=ke.currentTarget,Le=Math.abs(be.scaleX()-1)<1e-7?1:be.scaleX(),Me=Math.abs(be.scaleY()-1)<1e-7?1:be.scaleY();be.scaleX(1),be.scaleY(1);const ve=(he=ke.target.getStage())===null||he===void 0?void 0:he.findOne("Transformer"),ye=1-j/b.width,xe=Math.min(ye,Math.max(0,e.cropX)),Ie=1-D/b.height,Te=Math.min(Ie,Math.max(0,e.cropY)),Je=ve.getActiveAnchor(),nt=!(Je.indexOf("middle")>=0||Je.indexOf("center")>=0),st=!nt&&Le<1&&Ue.current.cropHeight>D/b.height;let at=nt?e.cropWidth:e.cropWidth*Le;st&&(at=e.cropWidth);const ct=!nt&&Me<1&&Ue.current.cropWidth>j/b.width;let Ct=nt?e.cropHeight:e.cropHeight*Me;ct&&(Ct=e.cropHeight),T&&(at=e.cropWidth,Ct=e.cropHeight),e.set({cropX:xe,cropY:Te,x:be.x(),y:be.y(),width:be.width()*Le,height:be.height()*Me,rotation:ke.target.rotation(),cropWidth:Math.min(at,1-xe),cropHeight:Math.min(Ct,1-Te)})},onTransformEnd:ke=>{const he=ke.currentTarget;e.set({width:he.width(),height:he.height(),x:he.x(),y:he.y(),rotation:ke.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,U-e.borderSize),hideInExport:!e.showInExport})),e._cropModeEnabled&&oe.createElement(cy,{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(Du,{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(fr,{x:e.x,y:e.y,rotation:e.rotation,scaleX:Q,scaleY:Q},oe.createElement(Du,{image:b,ref:o,opacity:.4,draggable:!0,x:-e.cropX*b.width,y:-e.cropY*b.height,onDragMove:J,onTransform:J,onTouchMove:ke=>{ke.evt.preventDefault();const he=ke.target.getStage().getPointersPositions();var be=he[0],Le=he[1];const Me=ke.target;if(be&&!Le&&!Me.isDragging()&&Y.current&&(Me.startDrag(),Y.current=!1),be&&Le){un.hitOnDragEnabled=!0,Me.isDragging()&&(Y.current=!0,Me.stopDrag());const ct=ke.target.getAbsoluteTransform().copy();ct.invert();var ve={x:be.x,y:be.y},ye={x:Le.x,y:Le.y};if(!F.current)return void(F.current=t3(ve,ye));var xe=t3(ve,ye),Ie=(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=Ie);const Ct=Me.position();var Te={x:xe.x-Ct.x,y:xe.y-Ct.y},Je=Ie/z.current;Me.scaleX(Je),Me.scaleY(Je);const rn=ct.point(xe),Zt=ct.point(F.current);var nt=rn.x-Zt.x,st=rn.y-Zt.y,at={x:Math.min(0,xe.x-Te.x*Je+nt),y:Math.min(0,xe.y-Te.y*Je+st)};Me.position(at),z.current=Ie,F.current=xe,J(ke)}},onTouchEnd:ke=>{z.current=0,F.current=null,un.hitOnDragEnabled=!1}}),oe.createElement(kp,Object.assign({ref:B},PL)),oe.createElement(Pr,{width:j,height:D,ref:re,listening:!1,onTransform:ke=>{if(e.cropX<Math.abs(ke.target.x()/b.width)&&ke.target.x()<0&&e.cropX>0){const Ie=(e.cropWidth+e.cropX)*b.width;ke.target.scaleX(1),ke.target.width(Ie)}if(e.cropY<Math.abs(ke.target.y()/b.height)&&ke.target.y()<0&&e.cropY>0){const Ie=(e.cropHeight+e.cropY)*b.height;ke.target.scaleY(1),ke.target.height(Ie)}ke.target.x()<-e.cropX*b.width-1e-9&&(ke.target.x(-e.cropX*b.width),ke.target.scaleX(1)),ke.target.y()<-e.cropY*b.height-1e-9&&(ke.target.y(-e.cropY*b.height),ke.target.scaleY(1));const he=Math.min(1,Math.max(0,e.cropX+ke.target.x()/b.width)),be=Math.min(1,Math.max(0,ke.target.y()/b.height+e.cropY)),Le=ke.target.width()*ke.target.scaleX(),Me=ke.target.height()*ke.target.scaleY(),ve=Math.min(1-he,Le/b.width),ye=Math.min(1-be,Me/b.height),xe=ke.target.getAbsolutePosition(ke.target.getParent().getParent());ke.target.scale({x:1,y:1}),ke.target.position({x:0,y:0}),e.set({x:xe.x,y:xe.y,cropX:he,cropY:be,cropWidth:ve,cropHeight:ye,width:Math.min(Le*Q,b.width*(1-he)*Q),height:Math.min(Me*Q,b.height*(1-be)*Q)})}}),oe.createElement(kp,Object.assign({ref:X},AL,{visible:e.resizable})))))});var i0={exports:{}};var TL=i0.exports,i3;function RL(){return i3||(i3=1,(function(e,t){(function(r,i){e.exports=i()})(typeof self<"u"?self:TL,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),p=i(48),m=i(49),d=i(12),y=i(32),w=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:p.default,Scroll:u.default,Block:c.default,Inline:h.default,Text:m.default,Attributor:{Attribute:d.default,Class:y.default,Style:w.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 p;(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"})(p=r.Scope||(r.Scope={}));function m(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=m;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=p.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&p.LEVEL&p.BLOCK?S=c.block:x&p.LEVEL&p.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&p.LEVEL&S.scope&&b&p.TYPE&S.scope?S:null}r.query=y;function w(){for(var x=[],b=0;b<arguments.length;b++)x[b]=arguments[b];if(x.length>1)return x.map(function(E){return w(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=w}),(function(n,r,i){var a=i(51),o=i(11),s=i(3),u=i(20),h="\0",c=function(p){Array.isArray(p)?this.ops=p:p!=null&&Array.isArray(p.ops)?this.ops=p.ops:this.ops=[]};c.prototype.insert=function(p,m){var d={};return p.length===0?this:(d.insert=p,m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(d.attributes=m),this.push(d))},c.prototype.delete=function(p){return p<=0?this:this.push({delete:p})},c.prototype.retain=function(p,m){if(p<=0)return this;var d={retain:p};return m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(d.attributes=m),this.push(d)},c.prototype.push=function(p){var m=this.ops.length,d=this.ops[m-1];if(p=s(!0,{},p),typeof d=="object"){if(typeof p.delete=="number"&&typeof d.delete=="number")return this.ops[m-1]={delete:d.delete+p.delete},this;if(typeof d.delete=="number"&&p.insert!=null&&(m-=1,d=this.ops[m-1],typeof d!="object"))return this.ops.unshift(p),this;if(o(p.attributes,d.attributes)){if(typeof p.insert=="string"&&typeof d.insert=="string")return this.ops[m-1]={insert:d.insert+p.insert},typeof p.attributes=="object"&&(this.ops[m-1].attributes=p.attributes),this;if(typeof p.retain=="number"&&typeof d.retain=="number")return this.ops[m-1]={retain:d.retain+p.retain},typeof p.attributes=="object"&&(this.ops[m-1].attributes=p.attributes),this}}return m===this.ops.length?this.ops.push(p):this.ops.splice(m,0,p),this},c.prototype.chop=function(){var p=this.ops[this.ops.length-1];return p&&p.retain&&!p.attributes&&this.ops.pop(),this},c.prototype.filter=function(p){return this.ops.filter(p)},c.prototype.forEach=function(p){this.ops.forEach(p)},c.prototype.map=function(p){return this.ops.map(p)},c.prototype.partition=function(p){var m=[],d=[];return this.forEach(function(y){var w=p(y)?m:d;w.push(y)}),[m,d]},c.prototype.reduce=function(p,m){return this.ops.reduce(p,m)},c.prototype.changeLength=function(){return this.reduce(function(p,m){return m.insert?p+u.length(m):m.delete?p-m.delete:p},0)},c.prototype.length=function(){return this.reduce(function(p,m){return p+u.length(m)},0)},c.prototype.slice=function(p,m){p=p||0,typeof m!="number"&&(m=1/0);for(var d=[],y=u.iterator(this.ops),w=0;w<m&&y.hasNext();){var x;w<p?x=y.next(p-w):(x=y.next(m-w),d.push(x)),w+=u.length(x)}return new c(d)},c.prototype.compose=function(p){var m=u.iterator(this.ops),d=u.iterator(p.ops),y=[],w=d.peek();if(w!=null&&typeof w.retain=="number"&&w.attributes==null){for(var x=w.retain;m.peekType()==="insert"&&m.peekLength()<=x;)x-=m.peekLength(),y.push(m.next());w.retain-x>0&&d.next(w.retain-x)}for(var b=new c(y);m.hasNext()||d.hasNext();)if(d.peekType()==="insert")b.push(d.next());else if(m.peekType()==="delete")b.push(m.next());else{var S=Math.min(m.peekLength(),d.peekLength()),k=m.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 M=u.attributes.compose(k.attributes,E.attributes,typeof k.retain=="number");if(M&&(A.attributes=M),b.push(A),!d.hasNext()&&o(b.ops[b.ops.length-1],A)){var O=new c(m.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(p){var m=new c(this.ops.slice());return p.ops.length>0&&(m.push(p.ops[0]),m.ops=m.ops.concat(p.ops.slice(1))),m},c.prototype.diff=function(p,m){if(this.ops===p.ops)return new c;var d=[this,p].map(function(S){return S.map(function(k){if(k.insert!=null)return typeof k.insert=="string"?k.insert:h;var E=S===p?"on":"with";throw new Error("diff() called "+E+" non-document")}).join("")}),y=new c,w=a(d[0],d[1],m),x=u.iterator(this.ops),b=u.iterator(p.ops);return w.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),M=b.next(E);o(A.insert,M.insert)?y.retain(E,u.attributes.diff(A.attributes,M.attributes)):y.push(M).delete(E);break}k-=E}}),y.chop()},c.prototype.eachLine=function(p,m){m=m||`
106
- `;for(var d=u.iterator(this.ops),y=new c,w=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(m,b)-b:-1;if(S<0)y.push(d.next());else if(S>0)y.push(d.next(S));else{if(p(y,d.next(1).attributes||{},w)===!1)return;w+=1,y=new c}}y.length()>0&&p(y,{},w)},c.prototype.transform=function(p,m){if(m=!!m,typeof p=="number")return this.transformPosition(p,m);for(var d=u.iterator(this.ops),y=u.iterator(p.ops),w=new c;d.hasNext()||y.hasNext();)if(d.peekType()==="insert"&&(m||y.peekType()!=="insert"))w.retain(u.length(d.next()));else if(y.peekType()==="insert")w.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?w.push(S):w.retain(x,u.attributes.transform(b.attributes,S.attributes,m))}return w.chop()},c.prototype.transformPosition=function(p,m){m=!!m;for(var d=u.iterator(this.ops),y=0;d.hasNext()&&y<=p;){var w=d.peekLength(),x=d.peekType();if(d.next(),x==="delete"){p-=Math.min(w,p-y);continue}else x==="insert"&&(y<p||!m)&&(p+=w);y+=w}return p},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"),w=d.constructor&&d.constructor.prototype&&i.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!y&&!w)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},p=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 m(){var d,y,w,x,b,S,k=arguments[0],E=1,A=arguments.length,M=!1;for(typeof k=="boolean"&&(M=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)w=p(k,y),x=p(d,y),k!==x&&(M&&x&&(h(x)||(b=u(x)))?(b?(b=!1,S=w&&u(w)?w:[]):S=w&&h(w)?w:{},c(k,{name:y,newValue:m(M,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 L(T,$){for(var U=0;U<$.length;U++){var te=$[U];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(T,te.key,te)}}return function(T,$,U){return $&&L(T.prototype,$),U&&L(T,U),T}})(),o=function L(T,$,U){T===null&&(T=Function.prototype);var te=Object.getOwnPropertyDescriptor(T,$);if(te===void 0){var se=Object.getPrototypeOf(T);return se===null?void 0:L(se,$,U)}else{if("value"in te)return te.value;var ee=te.get;return ee===void 0?void 0:ee.call(U)}},s=i(3),u=k(s),h=i(2),c=k(h),p=i(0),m=k(p),d=i(16),y=k(d),w=i(6),x=k(w),b=i(7),S=k(b);function k(L){return L&&L.__esModule?L:{default:L}}function E(L,T){if(!(L instanceof T))throw new TypeError("Cannot call a class as a function")}function A(L,T){if(!L)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:L}function M(L,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);L.prototype=Object.create(T&&T.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(L,T):L.__proto__=T)}var O=1,R=(function(L){M(T,L);function T(){return E(this,T),A(this,(T.__proto__||Object.getPrototypeOf(T)).apply(this,arguments))}return a(T,[{key:"attach",value:function(){o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"attach",this).call(this),this.attributes=new m.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(U,te){var se=m.default.query(U,m.default.Scope.BLOCK_ATTRIBUTE);se!=null&&this.attributes.attribute(se,te)}},{key:"formatAt",value:function(U,te,se,ee){this.format(se,ee)}},{key:"insertAt",value:function(U,te,se){if(typeof te=="string"&&te.endsWith(`
107
- `)){var ee=m.default.create(j.blotName);this.parent.insertBefore(ee,U===0?this:this.next),ee.insertAt(0,te.slice(0,-1))}else o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"insertAt",this).call(this,U,te,se)}}]),T})(m.default.Embed);R.scope=m.default.Scope.BLOCK_BLOT;var j=(function(L){M(T,L);function T($){E(this,T);var U=A(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,$));return U.cache={},U}return a(T,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(m.default.Leaf).reduce(function(U,te){return te.length()===0?U:U.insert(te.value(),D(te))},new c.default).insert(`
108
- `,D(this))),this.cache.delta}},{key:"deleteAt",value:function(U,te){o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"deleteAt",this).call(this,U,te),this.cache={}}},{key:"formatAt",value:function(U,te,se,ee){te<=0||(m.default.query(se,m.default.Scope.BLOCK)?U+te===this.length()&&this.format(se,ee):o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"formatAt",this).call(this,U,Math.min(te,this.length()-U-1),se,ee),this.cache={})}},{key:"insertAt",value:function(U,te,se){if(se!=null)return o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"insertAt",this).call(this,U,te,se);if(te.length!==0){var ee=te.split(`
109
- `),Q=ee.shift();Q.length>0&&(U<this.length()-1||this.children.tail==null?o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"insertAt",this).call(this,Math.min(U,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},U+Q.length)}}},{key:"insertBefore",value:function(U,te){var se=this.children.head;o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"insertBefore",this).call(this,U,te),se instanceof y.default&&se.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"length",this).call(this)+O),this.cache.length}},{key:"moveChildren",value:function(U,te){o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"moveChildren",this).call(this,U,te),this.cache={}}},{key:"optimize",value:function(U){o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"optimize",this).call(this,U),this.cache={}}},{key:"path",value:function(U){return o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"path",this).call(this,U,!0)}},{key:"removeChild",value:function(U){o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"removeChild",this).call(this,U),this.cache={}}},{key:"split",value:function(U){var te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(te&&(U===0||U>=this.length()-O)){var se=this.clone();return U===0?(this.parent.insertBefore(se,this),this):(this.parent.insertBefore(se,this.next),se)}else{var ee=o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"split",this).call(this,U,te);return this.cache={},ee}}}]),T})(m.default.Block);j.blotName="block",j.tagName="P",j.defaultChild="break",j.allowedChildren=[x.default,m.default.Embed,S.default];function D(L){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return L==null||(typeof L.formats=="function"&&(T=(0,u.default)(T,L.formats())),L.parent==null||L.parent.blotName=="scroll"||L.parent.statics.scope!==L.statics.scope)?T:D(L.parent,T)}r.bubbleFormats=D,r.BlockEmbed=R,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),p=D(c),m=i(8),d=D(m),y=i(9),w=D(y),x=i(0),b=D(x),S=i(15),k=D(S),E=i(3),A=D(E),M=i(10),O=D(M),R=i(34),j=D(R);function D(re){return re&&re.__esModule?re:{default:re}}function L(re,X,B){return X in re?Object.defineProperty(re,X,{value:B,enumerable:!0,configurable:!0,writable:!0}):re[X]=B,re}function T(re,X){if(!(re instanceof X))throw new TypeError("Cannot call a class as a function")}var $=(0,O.default)("quill"),U=(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(T(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 p.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,L({},B,F));else{if(J.length===0)return z.selection.format(B,F),K;K=z.editor.formatText(J.index,J.length,L({},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})();U.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},U.events=d.default.events,U.sources=d.default.sources,U.version="1.3.7",U.imports={delta:h.default,parchment:b.default,"core/module":w.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===U.DEFAULTS.theme)X.theme=j.default;else if(X.theme=U.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=U.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,{},U.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=U}),(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 M=E.get;return M===void 0?void 0:M.call(k)}},s=i(7),u=p(s),h=i(0),c=p(h);function p(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 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 w=(function(x){y(b,x);function b(){return m(this,b),d(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"formatAt",value:function(k,E,A,M){if(b.compare(this.statics.blotName,A)<0&&c.default.query(A,c.default.Scope.BLOT)){var O=this.isolate(k,E);M&&O.wrap(A,M)}else o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"formatAt",this).call(this,k,E,A,M)}},{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),M=b.order.indexOf(E);return A>=0||M>=0?A-M:k===E?0:k<E?-1:1}}]),b})(c.default.Inline);w.allowedChildren=[w,c.default.Embed,u.default],w.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],r.default=w}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(0),o=s(a);function s(m){return m&&m.__esModule?m:{default:m}}function u(m,d){if(!(m instanceof d))throw new TypeError("Cannot call a class as a function")}function h(m,d){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:m}function c(m,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);m.prototype=Object.create(d&&d.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(m,d):m.__proto__=d)}var p=(function(m){c(d,m);function d(){return u(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d})(o.default.Text);r.default=p}),(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 M=E[A];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(k,M.key,M)}}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 M=Object.getOwnPropertyDescriptor(k,E);if(M===void 0){var O=Object.getPrototypeOf(k);return O===null?void 0:S(O,E,A)}else{if("value"in M)return M.value;var R=M.get;return R===void 0?void 0:R.call(A)}},s=i(54),u=p(s),h=i(10),c=p(h);function p(S){return S&&S.__esModule?S:{default:S}}function m(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 w=(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(M){if(M.__quill&&M.__quill.emitter){var O;(O=M.__quill.emitter).handleDOM.apply(O,E)}})})});var b=(function(S){y(k,S);function k(){m(this,k);var E=d(this,(k.__proto__||Object.getPrototypeOf(k)).call(this));return E.listeners={},E.on("error",w.error),E}return a(k,[{key:"emit",value:function(){w.log.apply(w,arguments),o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(A){for(var M=arguments.length,O=Array(M>1?M-1:0),R=1;R<M;R++)O[R-1]=arguments[R];(this.listeners[A.type]||[]).forEach(function(j){var D=j.node,L=j.handler;(A.target===D||D.contains(A.target))&&L.apply(void 0,[A].concat(O))})}},{key:"listenDOM",value:function(A,M,O){this.listeners[A]||(this.listeners[A]=[]),this.listeners[A].push({node:M,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,p=arguments.length,m=Array(p>1?p-1:0),d=1;d<p;d++)m[d-1]=arguments[d];(c=console)[h].apply(c,m)}}function u(h){return a.reduce(function(c,p){return c[p]=s.bind(console,p,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(m,d,y){return y||(y={}),m===d?!0:m instanceof Date&&d instanceof Date?m.getTime()===d.getTime():!m||!d||typeof m!="object"&&typeof d!="object"?y.strict?m===d:m==d:p(m,d,y)};function h(m){return m==null}function c(m){return!(!m||typeof m!="object"||typeof m.length!="number"||typeof m.copy!="function"||typeof m.slice!="function"||m.length>0&&typeof m[0]!="number")}function p(m,d,y){var w,x;if(h(m)||h(d)||m.prototype!==d.prototype)return!1;if(s(m))return s(d)?(m=a.call(m),d=a.call(d),u(m,d,y)):!1;if(c(m)){if(!c(d)||m.length!==d.length)return!1;for(w=0;w<m.length;w++)if(m[w]!==d[w])return!1;return!0}try{var b=o(m),S=o(d)}catch{return!1}if(b.length!=S.length)return!1;for(b.sort(),S.sort(),w=b.length-1;w>=0;w--)if(b[w]!=S[w])return!1;for(w=b.length-1;w>=0;w--)if(x=b[w],!u(m[x],d[x],y))return!1;return typeof m==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 p=a.Scope.TYPE&a.Scope.ATTRIBUTE;c.scope!=null?this.scope=c.scope&a.Scope.LEVEL|p: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 R(j,D){var L=[],T=!0,$=!1,U=void 0;try{for(var te=j[Symbol.iterator](),se;!(T=(se=te.next()).done)&&(L.push(se.value),!(D&&L.length===D));T=!0);}catch(ee){$=!0,U=ee}finally{try{!T&&te.return&&te.return()}finally{if($)throw U}}return L}return function(j,D){if(Array.isArray(j))return j;if(Symbol.iterator in Object(j))return R(j,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function R(j,D){for(var L=0;L<D.length;L++){var T=D[L];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(j,T.key,T)}}return function(j,D,L){return D&&R(j.prototype,D),L&&R(j,L),j}})(),s=function R(j,D,L){j===null&&(j=Function.prototype);var T=Object.getOwnPropertyDescriptor(j,D);if(T===void 0){var $=Object.getPrototypeOf(j);return $===null?void 0:R($,D,L)}else{if("value"in T)return T.value;var U=T.get;return U===void 0?void 0:U.call(L)}},u=i(2),h=S(u),c=i(0),p=S(c),m=i(4),d=S(m),y=i(6),w=S(y),x=i(7),b=S(x);function S(R){return R&&R.__esModule?R:{default:R}}function k(R,j){if(!(R instanceof j))throw new TypeError("Cannot call a class as a function")}function E(R,j){if(!R)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j&&(typeof j=="object"||typeof j=="function")?j:R}function A(R,j){if(typeof j!="function"&&j!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof j);R.prototype=Object.create(j&&j.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),j&&(Object.setPrototypeOf?Object.setPrototypeOf(R,j):R.__proto__=j)}var M=(function(R){A(j,R);function j(){return k(this,j),E(this,(j.__proto__||Object.getPrototypeOf(j)).apply(this,arguments))}return j})(w.default);M.blotName="code",M.tagName="CODE";var O=(function(R){A(j,R);function j(){return k(this,j),E(this,(j.__proto__||Object.getPrototypeOf(j)).apply(this,arguments))}return o(j,[{key:"delta",value:function(){var L=this,T=this.domNode.textContent;return T.endsWith(`
111
- `)&&(T=T.slice(0,-1)),T.split(`
112
- `).reduce(function($,U){return $.insert(U).insert(`
113
- `,L.formats())},new h.default)}},{key:"format",value:function(L,T){if(!(L===this.statics.blotName&&T)){var $=this.descendant(b.default,this.length()-1),U=a($,1),te=U[0];te?.deleteAt(te.length()-1,1),s(j.prototype.__proto__||Object.getPrototypeOf(j.prototype),"format",this).call(this,L,T)}}},{key:"formatAt",value:function(L,T,$,U){if(T!==0&&!(p.default.query($,p.default.Scope.BLOCK)==null||$===this.statics.blotName&&U===this.statics.formats(this.domNode))){var te=this.newlineIndex(L);if(!(te<0||te>=L+T)){var se=this.newlineIndex(L,!0)+1,ee=te-se+1,Q=this.isolate(se,ee),re=Q.next;Q.format($,U),re instanceof j&&re.formatAt(0,L-se+T-ee,$,U)}}}},{key:"insertAt",value:function(L,T,$){if($==null){var U=this.descendant(b.default,L),te=a(U,2),se=te[0],ee=te[1];se.insertAt(ee,T)}}},{key:"length",value:function(){var L=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
114
- `)?L:L+1}},{key:"newlineIndex",value:function(L){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(T)return this.domNode.textContent.slice(0,L).lastIndexOf(`
115
- `);var $=this.domNode.textContent.slice(L).indexOf(`
116
- `);return $>-1?L+$:-1}},{key:"optimize",value:function(L){this.domNode.textContent.endsWith(`
117
- `)||this.appendChild(p.default.create("text",`
118
- `)),s(j.prototype.__proto__||Object.getPrototypeOf(j.prototype),"optimize",this).call(this,L);var T=this.next;T!=null&&T.prev===this&&T.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===T.statics.formats(T.domNode)&&(T.optimize(L),T.moveChildren(this),T.remove())}},{key:"replace",value:function(L){s(j.prototype.__proto__||Object.getPrototypeOf(j.prototype),"replace",this).call(this,L),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(T){var $=p.default.find(T);$==null?T.parentNode.removeChild(T):$ instanceof p.default.Embed?$.remove():$.unwrap()})}}],[{key:"create",value:function(L){var T=s(j.__proto__||Object.getPrototypeOf(j),"create",this).call(this,L);return T.setAttribute("spellcheck",!1),T}},{key:"formats",value:function(){return!0}}]),j})(d.default);O.blotName="code-block",O.tagName="PRE",O.TAB=" ",r.Code=M,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=T(u),c=i(20),p=T(c),m=i(0),d=T(m),y=i(13),w=T(y),x=i(24),b=T(x),S=i(4),k=T(S),E=i(16),A=T(E),M=i(21),O=T(M),R=i(11),j=T(R),D=i(3),L=T(D);function T(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 U(re,X){if(!(re instanceof X))throw new TypeError("Cannot call a class as a function")}var te=/^[ -~]*$/,se=(function(){function re(X){U(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 we=F.scroll.line(J),Ce=o(we,2),Ue=Ce[0],ze=Ce[1],tt=(0,L.default)({},(0,S.bubbleFormats)(Ue));if(Ue instanceof k.default){var ge=Ue.descendant(d.default.Leaf,ze),ut=o(ge,1),ke=ut[0];tt=(0,L.default)(tt,(0,S.bubbleFormats)(ke))}fe=p.default.attributes.diff(tt,fe)||{}}else if(a(K.insert)==="object"){var he=Object.keys(K.insert)[0];if(he==null)return J;F.scroll.insertAt(J,he,K.insert[he])}Y+=ie}return Object.keys(fe).forEach(function(be){F.scroll.formatAt(J,ie,be,fe[be])}),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 w.default))fe.format(J,Y[J]);else{var we=B-fe.offset(z.scroll),Ce=fe.newlineIndex(we+ie)-we+1;fe.formatAt(we,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 L.default.apply(L.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 w.default?fe=K.newlineIndex(ie)-ie+1:fe=K.length()-ie,ue=K.delta().slice(ie,ie+fe-1).insert(`
123
- `));var we=this.getContents(B,F+fe),Ce=we.diff(new h.default().insert(z).concat(ue)),Ue=new h.default().retain(B).concat(Ce);return this.applyDelta(Ue)}},{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),we=new h.default().insert(J.value()),Ce=new h.default().retain(ie).concat(ue.diff(we,z));B=Ce.reduce(function(Ue,ze){return ze.insert?Ue.insert(ze.insert,K):Ue.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 R(j,D){var L=[],T=!0,$=!1,U=void 0;try{for(var te=j[Symbol.iterator](),se;!(T=(se=te.next()).done)&&(L.push(se.value),!(D&&L.length===D));T=!0);}catch(ee){$=!0,U=ee}finally{try{!T&&te.return&&te.return()}finally{if($)throw U}}return L}return function(j,D){if(Array.isArray(j))return j;if(Symbol.iterator in Object(j))return R(j,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function R(j,D){for(var L=0;L<D.length;L++){var T=D[L];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(j,T.key,T)}}return function(j,D,L){return D&&R(j.prototype,D),L&&R(j,L),j}})(),s=i(0),u=b(s),h=i(21),c=b(h),p=i(11),m=b(p),d=i(8),y=b(d),w=i(10),x=b(w);function b(R){return R&&R.__esModule?R:{default:R}}function S(R){if(Array.isArray(R)){for(var j=0,D=Array(R.length);j<R.length;j++)D[j]=R[j];return D}else return Array.from(R)}function k(R,j){if(!(R instanceof j))throw new TypeError("Cannot call a class as a function")}var E=(0,x.default)("quill:selection"),A=function R(j){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;k(this,R),this.index=j,this.length=D},M=(function(){function R(j,D){var L=this;k(this,R),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(){L.mouseDown||setTimeout(L.update.bind(L,y.default.sources.USER),1)}),this.emitter.on(y.default.events.EDITOR_CHANGE,function(T,$){T===y.default.events.TEXT_CHANGE&&$.length()>0&&L.update(y.default.sources.SILENT)}),this.emitter.on(y.default.events.SCROLL_BEFORE_UPDATE,function(){if(L.hasFocus()){var T=L.getNativeRange();T!=null&&T.start.node!==L.cursor.textNode&&L.emitter.once(y.default.events.SCROLL_UPDATE,function(){try{L.setNativeRange(T.start.node,T.start.offset,T.end.node,T.end.offset)}catch{}})}}),this.emitter.on(y.default.events.SCROLL_OPTIMIZE,function(T,$){if($.range){var U=$.range,te=U.startNode,se=U.startOffset,ee=U.endNode,Q=U.endOffset;L.setNativeRange(te,se,ee,Q)}}),this.update(y.default.sources.SILENT)}return o(R,[{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 L=D.cursor.restore();if(!L)return;setTimeout(function(){D.setNativeRange(L.startNode,L.startOffset,L.endNode,L.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,L){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[D])){this.scroll.update();var T=this.getNativeRange();if(!(T==null||!T.native.collapsed||u.default.query(D,u.default.Scope.BLOCK))){if(T.start.node!==this.cursor.textNode){var $=u.default.find(T.start.node,!1);if($==null)return;if($ instanceof u.default.Leaf){var U=$.split(T.start.offset);$.parent.insertBefore(this.cursor,U)}else $.insertBefore(this.cursor,T.start.node);this.cursor.attach()}this.cursor.format(D,L),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(D){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,T=this.scroll.length();D=Math.min(D,T-1),L=Math.min(D+L,T-1)-D;var $=void 0,U=this.scroll.leaf(D),te=a(U,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(L>0){X.setStart($,ee);var B=this.scroll.leaf(D+L),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 L=D.getRangeAt(0);if(L==null)return null;var T=this.normalizeNative(L);return E.info("getNativeRange",T),T}},{key:"getRange",value:function(){var D=this.getNativeRange();if(D==null)return[null,null];var L=this.normalizedToRange(D);return[L,D]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(D){var L=this,T=[[D.start.node,D.start.offset]];D.native.collapsed||T.push([D.end.node,D.end.offset]);var $=T.map(function(se){var ee=a(se,2),Q=ee[0],re=ee[1],X=u.default.find(Q,!0),B=X.offset(L.scroll);return re===0?B:X instanceof u.default.Container?B+X.length():B+X.index(Q,re)}),U=Math.min(Math.max.apply(Math,S($)),this.scroll.length()-1),te=Math.min.apply(Math,[U].concat(S($)));return new A(te,U-te)}},{key:"normalizeNative",value:function(D){if(!O(this.root,D.startContainer)||!D.collapsed&&!O(this.root,D.endContainer))return null;var L={start:{node:D.startContainer,offset:D.startOffset},end:{node:D.endContainer,offset:D.endOffset},native:D};return[L.start,L.end].forEach(function(T){for(var $=T.node,U=T.offset;!($ instanceof Text)&&$.childNodes.length>0;)if($.childNodes.length>U)$=$.childNodes[U],U=0;else if($.childNodes.length===U)$=$.lastChild,U=$ instanceof Text?$.data.length:$.childNodes.length+1;else break;T.node=$,T.offset=U}),L}},{key:"rangeToNative",value:function(D){var L=this,T=D.collapsed?[D.index]:[D.index,D.index+D.length],$=[],U=this.scroll.length();return T.forEach(function(te,se){te=Math.min(U-1,te);var ee=void 0,Q=L.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 L=this.lastRange;if(L!=null){var T=this.getBounds(L.index,L.length);if(T!=null){var $=this.scroll.length()-1,U=this.scroll.line(Math.min(L.index,$)),te=a(U,1),se=te[0],ee=se;if(L.length>0){var Q=this.scroll.line(Math.min(L.index+L.length,$)),re=a(Q,1);ee=re[0]}if(!(se==null||ee==null)){var X=D.getBoundingClientRect();T.top<X.top?D.scrollTop-=X.top-T.top:T.bottom>X.bottom&&(D.scrollTop+=T.bottom-X.bottom)}}}}},{key:"setNativeRange",value:function(D,L){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:D,$=arguments.length>3&&arguments[3]!==void 0?arguments[3]:L,U=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(E.info("setNativeRange",D,L,T,$),!(D!=null&&(this.root.parentNode==null||D.parentNode==null||T.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||U||D!==se.startContainer||L!==se.startOffset||T!==se.endContainer||$!==se.endOffset){D.tagName=="BR"&&(L=[].indexOf.call(D.parentNode.childNodes,D),D=D.parentNode),T.tagName=="BR"&&($=[].indexOf.call(T.parentNode.childNodes,T),T=T.parentNode);var ee=document.createRange();ee.setStart(D,L),ee.setEnd(T,$),te.removeAllRanges(),te.addRange(ee)}}else te.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(D){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y.default.sources.API;if(typeof L=="string"&&(T=L,L=!1),E.info("setRange",D),D!=null){var $=this.rangeToNative(D);this.setNativeRange.apply(this,S($).concat([L]))}else this.setNativeRange(null);this.update(T)}},{key:"update",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y.default.sources.USER,L=this.lastRange,T=this.getRange(),$=a(T,2),U=$[0],te=$[1];if(this.lastRange=U,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,m.default)(L,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)(L),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)}}}}]),R})();function O(R,j){try{j.parentNode}catch{return!1}return j instanceof Text&&(j=j.parentNode),R.contains(j)}r.Range=A,r.default=M}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function y(w,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(w,S.key,S)}}return function(w,x,b){return x&&y(w.prototype,x),b&&y(w,b),w}})(),o=function y(w,x,b){w===null&&(w=Function.prototype);var S=Object.getOwnPropertyDescriptor(w,x);if(S===void 0){var k=Object.getPrototypeOf(w);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,w){if(!(y instanceof w))throw new TypeError("Cannot call a class as a function")}function p(y,w){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:y}function m(y,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);y.prototype=Object.create(w&&w.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(y,w):y.__proto__=w)}var d=(function(y){m(w,y);function w(){return c(this,w),p(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return a(w,[{key:"insertInto",value:function(b,S){b.children.length===0?o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"insertInto",this).call(this,b,S):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),w})(u.default.Embed);d.blotName="break",d.tagName="BR",r.default=d}),(function(n,r,i){var a=this&&this.__extends||(function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,d){m.__proto__=d}||function(m,d){for(var y in d)d.hasOwnProperty(y)&&(m[y]=d[y])};return function(m,d){p(m,d);function y(){this.constructor=m}m.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(p){a(m,p);function m(d){var y=p.call(this,d)||this;return y.build(),y}return m.prototype.appendChild=function(d){this.insertBefore(d)},m.prototype.attach=function(){p.prototype.attach.call(this),this.children.forEach(function(d){d.attach()})},m.prototype.build=function(){var d=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(y){try{var w=c(y);d.insertBefore(w,d.children.head||void 0)}catch(x){if(x instanceof u.ParchmentError)return;throw x}})},m.prototype.deleteAt=function(d,y){if(d===0&&y===this.length())return this.remove();this.children.forEachAt(d,y,function(w,x,b){w.deleteAt(x,b)})},m.prototype.descendant=function(d,y){var w=this.children.find(y),x=w[0],b=w[1];return d.blotName==null&&d(x)||d.blotName!=null&&x instanceof d?[x,b]:x instanceof m?x.descendant(d,b):[null,-1]},m.prototype.descendants=function(d,y,w){y===void 0&&(y=0),w===void 0&&(w=Number.MAX_VALUE);var x=[],b=w;return this.children.forEachAt(y,w,function(S,k,E){(d.blotName==null&&d(S)||d.blotName!=null&&S instanceof d)&&x.push(S),S instanceof m&&(x=x.concat(S.descendants(d,k,b))),b-=E}),x},m.prototype.detach=function(){this.children.forEach(function(d){d.detach()}),p.prototype.detach.call(this)},m.prototype.formatAt=function(d,y,w,x){this.children.forEachAt(d,y,function(b,S,k){b.formatAt(S,k,w,x)})},m.prototype.insertAt=function(d,y,w){var x=this.children.find(d),b=x[0],S=x[1];if(b)b.insertAt(S,y,w);else{var k=w==null?u.create("text",y):u.create(y,w);this.appendChild(k)}},m.prototype.insertBefore=function(d,y){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(w){return d instanceof w}))throw new u.ParchmentError("Cannot insert "+d.statics.blotName+" into "+this.statics.blotName);d.insertInto(this,y)},m.prototype.length=function(){return this.children.reduce(function(d,y){return d+y.length()},0)},m.prototype.moveChildren=function(d,y){this.children.forEach(function(w){d.insertBefore(w,y)})},m.prototype.optimize=function(d){if(p.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()},m.prototype.path=function(d,y){y===void 0&&(y=!1);var w=this.children.find(d,y),x=w[0],b=w[1],S=[[this,d]];return x instanceof m?S.concat(x.path(b,y)):(x!=null&&S.push([x,b]),S)},m.prototype.removeChild=function(d){this.children.remove(d)},m.prototype.replace=function(d){d instanceof m&&d.moveChildren(this),p.prototype.replace.call(this,d)},m.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 w=this.clone();return this.parent.insertBefore(w,this.next),this.children.forEachAt(d,this.length(),function(x,b,S){x=x.split(b,y),w.appendChild(x)}),w},m.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},m.prototype.update=function(d,y){var w=this,x=[],b=[];d.forEach(function(S){S.target===w.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===w.domNode)&&k.detach()}}),x.filter(function(S){return S.parentNode==w.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(w),w.insertBefore(E,k||void 0))})},m})(s.default);function c(p){var m=u.find(p);if(m==null)try{m=u.create(p)}catch{m=u.create(u.Scope.INLINE),[].slice.call(p.childNodes).forEach(function(y){m.domNode.appendChild(y)}),p.parentNode&&p.parentNode.replaceChild(m.domNode,p),m.attach()}return m}r.default=h}),(function(n,r,i){var a=this&&this.__extends||(function(){var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,d){m.__proto__=d}||function(m,d){for(var y in d)d.hasOwnProperty(y)&&(m[y]=d[y])};return function(m,d){p(m,d);function y(){this.constructor=m}m.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(p){a(m,p);function m(d){var y=p.call(this,d)||this;return y.attributes=new s.default(y.domNode),y}return m.formats=function(d){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return d.tagName.toLowerCase()},m.prototype.format=function(d,y){var w=h.query(d);w instanceof o.default?this.attributes.attribute(w,y):y&&w!=null&&(d!==this.statics.blotName||this.formats()[d]!==y)&&this.replaceWith(d,y)},m.prototype.formats=function(){var d=this.attributes.values(),y=this.statics.formats(this.domNode);return y!=null&&(d[this.statics.blotName]=y),d},m.prototype.replaceWith=function(d,y){var w=p.prototype.replaceWith.call(this,d,y);return this.attributes.copy(w),w},m.prototype.update=function(d,y){var w=this;p.prototype.update.call(this,d,y),d.some(function(x){return x.target===w.domNode&&x.type==="attributes"})&&this.attributes.build()},m.prototype.wrap=function(d,y){var w=p.prototype.wrap.call(this,d,y);return w instanceof m&&w.statics.scope===this.statics.scope&&this.attributes.move(w),w},m})(u.default);r.default=c}),(function(n,r,i){var a=this&&this.__extends||(function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,p){c.__proto__=p}||function(c,p){for(var m in p)p.hasOwnProperty(m)&&(c[m]=p[m])};return function(c,p){h(c,p);function m(){this.constructor=c}c.prototype=p===null?Object.create(p):(m.prototype=p.prototype,new m)}})();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(p){return!0},c.prototype.index=function(p,m){return this.domNode===p||this.domNode.compareDocumentPosition(p)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(m,1):-1},c.prototype.position=function(p,m){var d=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return p>0&&(d+=1),[this.parent.domNode,d]},c.prototype.value=function(){var p;return p={},p[this.statics.blotName]=this.statics.value(this.domNode)||!0,p},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,p){typeof h!="object"&&(h={}),typeof c!="object"&&(c={});var m=o(!0,{},c);p||(m=Object.keys(m).reduce(function(y,w){return m[w]!=null&&(y[w]=m[w]),y},{}));for(var d in h)h[d]!==void 0&&c[d]===void 0&&(m[d]=h[d]);return Object.keys(m).length>0?m:void 0},diff:function(h,c){typeof h!="object"&&(h={}),typeof c!="object"&&(c={});var p=Object.keys(h).concat(Object.keys(c)).reduce(function(m,d){return a(h[d],c[d])||(m[d]=c[d]===void 0?null:c[d]),m},{});return Object.keys(p).length>0?p:void 0},transform:function(h,c,p){if(typeof h!="object")return c;if(typeof c=="object"){if(!p)return c;var m=Object.keys(c).reduce(function(d,y){return h[y]===void 0&&(d[y]=c[y]),d},{});return Object.keys(m).length>0?m: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 p=this.offset,m=s.length(c);if(h>=m-p?(h=m-p,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(p,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,p=this.next(),m=this.ops.slice(this.index);return this.offset=h,this.index=c,[p].concat(m)}else return[]},n.exports=s}),(function(n,r){var i=(function(){function a(w,x){return x!=null&&w 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(w,x,b,S,k){typeof x=="object"&&(b=x.depth,S=x.prototype,k=x.includeNonEnumerable,x=x.circular);var E=[],A=[],M=typeof Buffer<"u";typeof x>"u"&&(x=!0),typeof b>"u"&&(b=1/0);function O(R,j){if(R===null)return null;if(j===0)return R;var D,L;if(typeof R!="object")return R;if(a(R,o))D=new o;else if(a(R,s))D=new s;else if(a(R,u))D=new u(function(X,B){R.then(function(F){X(O(F,j-1))},function(F){B(O(F,j-1))})});else if(h.__isArray(R))D=[];else if(h.__isRegExp(R))D=new RegExp(R.source,y(R)),R.lastIndex&&(D.lastIndex=R.lastIndex);else if(h.__isDate(R))D=new Date(R.getTime());else{if(M&&Buffer.isBuffer(R))return Buffer.allocUnsafe?D=Buffer.allocUnsafe(R.length):D=new Buffer(R.length),R.copy(D),D;a(R,Error)?D=Object.create(R):typeof S>"u"?(L=Object.getPrototypeOf(R),D=Object.create(L)):(D=Object.create(S),L=S)}if(x){var T=E.indexOf(R);if(T!=-1)return A[T];E.push(R),A.push(D)}a(R,o)&&R.forEach(function(X,B){var F=O(B,j-1),z=O(X,j-1);D.set(F,z)}),a(R,s)&&R.forEach(function(X){var B=O(X,j-1);D.add(B)});for(var $ in R){var U;L&&(U=Object.getOwnPropertyDescriptor(L,$)),!(U&&U.set==null)&&(D[$]=O(R[$],j-1))}if(Object.getOwnPropertySymbols)for(var te=Object.getOwnPropertySymbols(R),$=0;$<te.length;$++){var se=te[$],ee=Object.getOwnPropertyDescriptor(R,se);ee&&!ee.enumerable&&!k||(D[se]=O(R[se],j-1),ee.enumerable||Object.defineProperty(D,se,{enumerable:!1}))}if(k)for(var Q=Object.getOwnPropertyNames(R),$=0;$<Q.length;$++){var re=Q[$],ee=Object.getOwnPropertyDescriptor(R,re);ee&&ee.enumerable||(D[re]=O(R[re],j-1),Object.defineProperty(D,re,{enumerable:!1}))}return D}return O(w,b)}h.clonePrototype=function(x){if(x===null)return null;var b=function(){};return b.prototype=x,new b};function c(w){return Object.prototype.toString.call(w)}h.__objToStr=c;function p(w){return typeof w=="object"&&c(w)==="[object Date]"}h.__isDate=p;function m(w){return typeof w=="object"&&c(w)==="[object Array]"}h.__isArray=m;function d(w){return typeof w=="object"&&c(w)==="[object RegExp]"}h.__isRegExp=d;function y(w){var x="";return w.global&&(x+="g"),w.ignoreCase&&(x+="i"),w.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(L,T){var $=[],U=!0,te=!1,se=void 0;try{for(var ee=L[Symbol.iterator](),Q;!(U=(Q=ee.next()).done)&&($.push(Q.value),!(T&&$.length===T));U=!0);}catch(re){te=!0,se=re}finally{try{!U&&ee.return&&ee.return()}finally{if(te)throw se}}return $}return function(L,T){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return D(L,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function D(L,T){for(var $=0;$<T.length;$++){var U=T[$];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(L,U.key,U)}}return function(L,T,$){return T&&D(L.prototype,T),$&&D(L,$),L}})(),s=function D(L,T,$){L===null&&(L=Function.prototype);var U=Object.getOwnPropertyDescriptor(L,T);if(U===void 0){var te=Object.getPrototypeOf(L);return te===null?void 0:D(te,T,$)}else{if("value"in U)return U.value;var se=U.get;return se===void 0?void 0:se.call($)}},u=i(0),h=E(u),c=i(8),p=E(c),m=i(4),d=E(m),y=i(16),w=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,L){if(!(D instanceof L))throw new TypeError("Cannot call a class as a function")}function M(D,L){if(!D)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:D}function O(D,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);D.prototype=Object.create(L&&L.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(D,L):D.__proto__=L)}function R(D){return D instanceof d.default||D instanceof m.BlockEmbed}var j=(function(D){O(L,D);function L(T,$){A(this,L);var U=M(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,T));return U.emitter=$.emitter,Array.isArray($.whitelist)&&(U.whitelist=$.whitelist.reduce(function(te,se){return te[se]=!0,te},{})),U.domNode.addEventListener("DOMNodeInserted",function(){}),U.optimize(),U.enable(),U}return o(L,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function($,U){var te=this.line($),se=a(te,2),ee=se[0],Q=se[1],re=this.line($+U),X=a(re,1),B=X[0];if(s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"deleteAt",this).call(this,$,U),B!=null&&ee!==B&&Q>0){if(ee instanceof m.BlockEmbed||B instanceof m.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 w.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($,U,te,se){this.whitelist!=null&&!this.whitelist[te]||(s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"formatAt",this).call(this,$,U,te,se),this.optimize())}},{key:"insertAt",value:function($,U,te){if(!(te!=null&&this.whitelist!=null&&!this.whitelist[U])){if($>=this.length())if(te==null||h.default.query(U,h.default.Scope.BLOCK)==null){var se=h.default.create(this.statics.defaultChild);this.appendChild(se),te==null&&U.endsWith(`
126
- `)&&(U=U.slice(0,-1)),se.insertAt(0,U,te)}else{var ee=h.default.create(U,te);this.appendChild(ee)}else s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,$,U,te);this.optimize()}}},{key:"insertBefore",value:function($,U){if($.statics.scope===h.default.Scope.INLINE_BLOT){var te=h.default.create(this.statics.defaultChild);te.appendChild($),$=te}s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertBefore",this).call(this,$,U)}},{key:"leaf",value:function($){return this.path($).pop()||[null,-1]}},{key:"line",value:function($){return $===this.length()?this.line($-1):this.descendant(R,$)}},{key:"lines",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=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){R(F)?X.push(F):F instanceof h.default.Container&&(X=X.concat(se(F,z,B))),B-=Y}),X};return te(this,$,U)}},{key:"optimize",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"optimize",this).call(this,$,U),$.length>0&&this.emitter.emit(p.default.events.SCROLL_OPTIMIZE,$,U))}},{key:"path",value:function($){return s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"path",this).call(this,$).slice(1)}},{key:"update",value:function($){if(this.batch!==!0){var U=p.default.sources.USER;typeof $=="string"&&(U=$),Array.isArray($)||($=this.observer.takeRecords()),$.length>0&&this.emitter.emit(p.default.events.SCROLL_BEFORE_UPDATE,U,$),s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"update",this).call(this,$.concat([])),$.length>0&&this.emitter.emit(p.default.events.SCROLL_UPDATE,U,$)}}}]),L})(h.default.Scroll);j.blotName="scroll",j.className="ql-editor",j.tagName="DIV",j.defaultChild="block",j.allowedChildren=[d.default,m.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=[],we=!0,Ce=!1,Ue=void 0;try{for(var ze=ie[Symbol.iterator](),tt;!(we=(tt=ze.next()).done)&&(ue.push(tt.value),!(fe&&ue.length===fe));we=!0);}catch(ge){Ce=!0,Ue=ge}finally{try{!we&&ze.return&&ze.return()}finally{if(Ce)throw Ue}}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 we=fe[ue];we.enumerable=we.enumerable||!1,we.configurable=!0,"value"in we&&(we.writable=!0),Object.defineProperty(ie,we.key,we)}}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),p=D(c),m=i(3),d=D(m),y=i(2),w=D(y),x=i(20),b=D(x),S=i(0),k=D(S),E=i(5),A=D(E),M=i(10),O=D(M),R=i(9),j=D(R);function D(K){return K&&K.__esModule?K:{default:K}}function L(K,ie,fe){return ie in K?Object.defineProperty(K,ie,{value:fe,enumerable:!0,configurable:!0,writable:!0}):K[ie]=fe,K}function T(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 U(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){U(ie,K),s(ie,null,[{key:"match",value:function(ue,we){return we=J(we),["altKey","ctrlKey","metaKey","shiftKey"].some(function(Ce){return!!we[Ce]!==ue[Ce]&&we[Ce]!==null})?!1:we.key===(ue.which||ue.keyCode)}}]);function ie(fe,ue){T(this,ie);var we=$(this,(ie.__proto__||Object.getPrototypeOf(ie)).call(this,fe,ue));return we.bindings={},Object.keys(we.options.bindings).forEach(function(Ce){Ce==="list autofill"&&fe.scroll.whitelist!=null&&!fe.scroll.whitelist.list||we.options.bindings[Ce]&&we.addBinding(we.options.bindings[Ce])}),we.addBinding({key:ie.keys.ENTER,shiftKey:null},F),we.addBinding({key:ie.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(we.addBinding({key:ie.keys.BACKSPACE},{collapsed:!0},re),we.addBinding({key:ie.keys.DELETE},{collapsed:!0},X)):(we.addBinding({key:ie.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},re),we.addBinding({key:ie.keys.DELETE},{collapsed:!0,suffix:/^.?$/},X)),we.addBinding({key:ie.keys.BACKSPACE},{collapsed:!1},B),we.addBinding({key:ie.keys.DELETE},{collapsed:!1},B),we.addBinding({key:ie.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},re),we.listen(),we}return s(ie,[{key:"addBinding",value:function(ue){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ue=J(ue);if(Ue==null||Ue.key==null)return te.warn("Attempted to add invalid keyboard binding",Ue);typeof we=="function"&&(we={handler:we}),typeof Ce=="function"&&(Ce={handler:Ce}),Ue=(0,d.default)(Ue,we,Ce),this.bindings[Ue.key]=this.bindings[Ue.key]||[],this.bindings[Ue.key].push(Ue)}},{key:"listen",value:function(){var ue=this;this.quill.root.addEventListener("keydown",function(we){if(!we.defaultPrevented){var Ce=we.which||we.keyCode,Ue=(ue.bindings[Ce]||[]).filter(function(at){return ie.match(we,at)});if(Ue.length!==0){var ze=ue.quill.getSelection();if(!(ze==null||!ue.quill.hasFocus())){var tt=ue.quill.getLine(ze.index),ge=o(tt,2),ut=ge[0],ke=ge[1],he=ue.quill.getLeaf(ze.index),be=o(he,2),Le=be[0],Me=be[1],ve=ze.length===0?[Le,Me]:ue.quill.getLeaf(ze.index+ze.length),ye=o(ve,2),xe=ye[0],Ie=ye[1],Te=Le instanceof k.default.Text?Le.value().slice(0,Me):"",Je=xe instanceof k.default.Text?xe.value().slice(Ie):"",nt={collapsed:ze.length===0,empty:ze.length===0&&ut.length()<=1,format:ue.quill.getFormat(ze),offset:ke,prefix:Te,suffix:Je},st=Ue.some(function(at){if(at.collapsed!=null&&at.collapsed!==nt.collapsed||at.empty!=null&&at.empty!==nt.empty||at.offset!=null&&at.offset!==nt.offset)return!1;if(Array.isArray(at.format)){if(at.format.every(function(ct){return nt.format[ct]==null}))return!1}else if(a(at.format)==="object"&&!Object.keys(at.format).every(function(ct){return at.format[ct]===!0?nt.format[ct]!=null:at.format[ct]===!1?nt.format[ct]==null:(0,p.default)(at.format[ct],nt.format[ct])}))return!1;return at.prefix!=null&&!at.prefix.test(nt.prefix)||at.suffix!=null&&!at.suffix.test(nt.suffix)?!1:at.handler.call(ue,ze,nt)!==!0});st&&we.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 w.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),we=ue[0],Ce=ue[1],Ue=(0,d.default)({},we.formats(),{list:"checked"}),ze=new w.default().retain(ie.index).insert(`
127
- `,Ue).retain(we.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),we=o(ue,2),Ce=we[0],Ue=we[1],ze=new w.default().retain(ie.index).insert(`
128
- `,fe.format).retain(Ce.length()-Ue-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,we=this.quill.getLine(ie.index),Ce=o(we,2),Ue=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 ge=new w.default().retain(ie.index-ze).delete(ue+1).retain(Ue.length()-2-ze).retain(1,{list:tt});this.quill.updateContents(ge,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),we=ue[0],Ce=ue[1],Ue=new w.default().retain(ie.index+we.length()-Ce-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(Ue,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},L(fe,ue,/^$/),L(fe,"handler",function(Ce){var Ue=Ce.index;K===ee.keys.RIGHT&&(Ue+=Ce.length+1);var ze=this.quill.getLeaf(Ue),tt=o(ze,1),ge=tt[0];return ge 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),we=ue[0],Ce={};if(ie.offset===0){var Ue=this.quill.getLine(K.index-1),ze=o(Ue,1),tt=ze[0];if(tt!=null&&tt.length()>1){var ge=we.formats(),ut=this.quill.getFormat(K.index-1,1);Ce=b.default.attributes.diff(ge,ut)||{}}}var ke=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(ie.prefix)?2:1;this.quill.deleteText(K.index-ke,ke,A.default.sources.USER),Object.keys(Ce).length>0&&this.quill.formatLine(K.index-ke,ke,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={},we=0,Ce=this.quill.getLine(K.index),Ue=o(Ce,1),ze=Ue[0];if(ie.offset>=ze.length()-1){var tt=this.quill.getLine(K.index+1),ge=o(tt,1),ut=ge[0];if(ut){var ke=ze.formats(),he=this.quill.getFormat(K.index,1);ue=b.default.attributes.diff(ke,he)||{},we=ut.length()}}this.quill.deleteText(K.index,fe,A.default.sources.USER),Object.keys(ue).length>0&&this.quill.formatLine(K.index+we-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(),we=ie[ie.length-1].formats();fe=b.default.attributes.diff(we,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(we,Ce){return k.default.query(Ce,k.default.Scope.BLOCK)&&!Array.isArray(ie.format[Ce])&&(we[Ce]=ie.format[Ce]),we},{});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(we){ue[we]==null&&(Array.isArray(ie.format[we])||we!=="link"&&fe.quill.format(we,ie.format[we],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"),we=fe.index,Ce=fe.length,Ue=this.quill.scroll.descendant(ue,we),ze=o(Ue,2),tt=ze[0],ge=ze[1];if(tt!=null){var ut=this.quill.getIndex(tt),ke=tt.newlineIndex(ge,!0)+1,he=tt.newlineIndex(ut+ge+Ce),be=tt.domNode.textContent.slice(ke,he).split(`
130
- `);ge=0,be.forEach(function(Le,Me){K?(tt.insertAt(ke+ge,ue.TAB),ge+=ue.TAB.length,Me===0?we+=ue.TAB.length:Ce+=ue.TAB.length):Le.startsWith(ue.TAB)&&(tt.deleteAt(ke+ge,ue.TAB.length),ge-=ue.TAB.length,Me===0?we-=ue.TAB.length:Ce-=ue.TAB.length),ge+=Le.length+1}),this.quill.update(A.default.sources.USER),this.quill.setSelection(we,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,M=!1,O=void 0;try{for(var R=S[Symbol.iterator](),j;!(A=(j=R.next()).done)&&(E.push(j.value),!(k&&E.length===k));A=!0);}catch(D){M=!0,O=D}finally{try{!A&&R.return&&R.return()}finally{if(M)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 M=Object.getPrototypeOf(S);return M===null?void 0:b(M,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=m(u),c=i(7),p=m(c);function m(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 w(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){w(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 M=this,O=0;M!=null&&M.statics.scope!==h.default.Scope.BLOCK_BLOT;)O+=M.offset(M.parent),M=M.parent;M!=null&&(this._length=S.CONTENTS.length,M.optimize(),M.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(),M=void 0,O=void 0,R=void 0;if(A!=null&&A.start.node===E&&A.end.node===E){var j=[E,A.start.offset,A.end.offset];M=j[0],O=j[1],R=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 p.default?(M=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 L=[O,R].map(function($){return Math.max(0,Math.min(M.data.length,$-1))}),T=a(L,2);return O=T[0],R=T[1],{startNode:M,startOffset:O,endNode:M,endOffset:R}}}}},{key:"update",value:function(E,A){var M=this;if(E.some(function(R){return R.type==="characterData"&&R.target===M.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,w){if(!(y instanceof w))throw new TypeError("Cannot call a class as a function")}function p(y,w){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:y}function m(y,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);y.prototype=Object.create(w&&w.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(y,w):y.__proto__=w)}var d=(function(y){m(w,y);function w(){return c(this,w),p(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return w})(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 M=E.get;return M===void 0?void 0:M.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 p(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 m(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){m(b,x);function b(){return c(this,b),p(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}),w=new d("color","color",{scope:u.default.Scope.INLINE});r.ColorAttributor=d,r.ColorClass=y,r.ColorStyle=w}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.sanitize=r.default=void 0;var a=(function(){function w(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&&w(x.prototype,b),S&&w(x,S),x}})(),o=function w(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:w(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(w){return w&&w.__esModule?w:{default:w}}function c(w,x){if(!(w instanceof x))throw new TypeError("Cannot call a class as a function")}function p(w,x){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:w}function m(w,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);w.prototype=Object.create(x&&x.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(w,x):w.__proto__=x)}var d=(function(w){m(x,w);function x(){return c(this,x),p(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(w,x){var b=document.createElement("a");b.href=w;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=p(s),h=i(107),c=p(h);function p(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")}var d=0;function y(x,b){x.setAttribute(b,x.getAttribute(b)!=="true")}var w=(function(){function x(b){var S=this;m(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=w}),(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),p=i(16),m=te(p),d=i(25),y=te(d),w=i(24),x=te(w),b=i(35),S=te(b),k=i(6),E=te(k),A=i(22),M=te(A),O=i(7),R=te(O),j=i(55),D=te(j),L=i(42),T=te(L),$=i(23),U=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":m.default,"blots/container":y.default,"blots/cursor":x.default,"blots/embed":S.default,"blots/inline":E.default,"blots/scroll":M.default,"blots/text":R.default,"modules/clipboard":D.default,"modules/history":T.default,"modules/keyboard":U.default}),o.default.register(c.default,m.default,x.default,E.default,M.default,R.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,p){var m=this.isolate(u,h);if(a.query(c,a.Scope.BLOT)!=null&&p)m.wrap(c,p);else if(a.query(c,a.Scope.ATTRIBUTE)!=null){var d=a.create(this.statics.scope);m.wrap(d),d.format(c,p)}},s.prototype.insertAt=function(u,h,c){var p=c==null?a.create("text",h):a.create(h,c),m=this.split(u);this.parent.insertBefore(p,m)},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(p){this.attributes={},this.domNode=p,this.build()}return c.prototype.attribute=function(p,m){m?p.add(this.domNode,m)&&(p.value(this.domNode)!=null?this.attributes[p.attrName]=p:delete this.attributes[p.attrName]):(p.remove(this.domNode),delete this.attributes[p.attrName])},c.prototype.build=function(){var p=this;this.attributes={};var m=a.default.keys(this.domNode),d=o.default.keys(this.domNode),y=s.default.keys(this.domNode);m.concat(d).concat(y).forEach(function(w){var x=u.query(w,u.Scope.ATTRIBUTE);x instanceof a.default&&(p.attributes[x.attrName]=x)})},c.prototype.copy=function(p){var m=this;Object.keys(this.attributes).forEach(function(d){var y=m.attributes[d].value(m.domNode);p.format(d,y)})},c.prototype.move=function(p){var m=this;this.copy(p),Object.keys(this.attributes).forEach(function(d){m.attributes[d].remove(m.domNode)}),this.attributes={}},c.prototype.values=function(){var p=this;return Object.keys(this.attributes).reduce(function(m,d){return m[d]=p.attributes[d].value(p.domNode),m},{})},c})();r.default=h}),(function(n,r,i){var a=this&&this.__extends||(function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,p){c.__proto__=p}||function(c,p){for(var m in p)p.hasOwnProperty(m)&&(c[m]=p[m])};return function(c,p){h(c,p);function m(){this.constructor=c}c.prototype=p===null?Object.create(p):(m.prototype=p.prototype,new m)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(12);function s(h,c){var p=h.getAttribute("class")||"";return p.split(/\s+/).filter(function(m){return m.indexOf(c+"-")===0})}var u=(function(h){a(c,h);function c(){return h!==null&&h.apply(this,arguments)||this}return c.keys=function(p){return(p.getAttribute("class")||"").split(/\s+/).map(function(m){return m.split("-").slice(0,-1).join("-")})},c.prototype.add=function(p,m){return this.canAdd(p,m)?(this.remove(p),p.classList.add(this.keyName+"-"+m),!0):!1},c.prototype.remove=function(p){var m=s(p,this.keyName);m.forEach(function(d){p.classList.remove(d)}),p.classList.length===0&&p.removeAttribute("class")},c.prototype.value=function(p){var m=s(p,this.keyName)[0]||"",d=m.slice(this.keyName.length+1);return this.canAdd(p,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,p){c.__proto__=p}||function(c,p){for(var m in p)p.hasOwnProperty(m)&&(c[m]=p[m])};return function(c,p){h(c,p);function m(){this.constructor=c}c.prototype=p===null?Object.create(p):(m.prototype=p.prototype,new m)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(12);function s(h){var c=h.split("-"),p=c.slice(1).map(function(m){return m[0].toUpperCase()+m.slice(1)}).join("");return c[0]+p}var u=(function(h){a(c,h);function c(){return h!==null&&h.apply(this,arguments)||this}return c.keys=function(p){return(p.getAttribute("style")||"").split(";").map(function(m){var d=m.split(":");return d[0].trim()})},c.prototype.add=function(p,m){return this.canAdd(p,m)?(p.style[s(this.keyName)]=m,!0):!1},c.prototype.remove=function(p){p.style[s(this.keyName)]="",p.getAttribute("style")||p.removeAttribute("style")},c.prototype.value=function(p){var m=p.style[s(this.keyName)];return this.canAdd(p,m)?m:""},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 p=0;p<c.length;p++){var m=c[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(h,m.key,m)}}return function(h,c,p){return c&&u(h.prototype,c),p&&u(h,p),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(p){c.modules[p]==null&&c.addModule(p)})}},{key:"addModule",value:function(c){var p=this.quill.constructor.import("modules/"+c);return this.modules[c]=new p(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 M=Object.getPrototypeOf(S);return M===null?void 0:b(M,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=p(s),h=i(7),c=p(h);function p(b){return b&&b.__esModule?b:{default:b}}function m(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 w="\uFEFF",x=(function(b){y(S,b);function S(k){m(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(w),E.rightGuard=document.createTextNode(w),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,M=void 0,O=E.data.split(w).join("");if(E===this.leftGuard)if(this.prev instanceof c.default){var R=this.prev.length();this.prev.insertAt(R,O),A={startNode:this.prev.domNode,startOffset:R+O.length}}else M=document.createTextNode(O),this.parent.insertBefore(u.default.create(M),this),A={startNode:M,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}):(M=document.createTextNode(O),this.parent.insertBefore(u.default.create(M),this.next),A={startNode:M,startOffset:O.length}));return E.data=w,A}},{key:"update",value:function(E,A){var M=this;E.forEach(function(O){if(O.type==="characterData"&&(O.target===M.leftGuard||O.target===M.rightGuard)){var R=M.restore(O.target);R&&(A.range=R)}})}}]),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(m){return m&&m.__esModule?m:{default:m}}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),p=new o.default.Attributor.Style("align","text-align",u);r.AlignAttribute=h,r.AlignClass=c,r.AlignStyle=p}),(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(p){return p&&p.__esModule?p:{default:p}}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(m){return m&&m.__esModule?m:{default:m}}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),p=new o.default.Attributor.Style("direction","direction",u);r.DirectionAttribute=h,r.DirectionClass=c,r.DirectionStyle=p}),(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 M=Object.getPrototypeOf(S);return M===null?void 0:b(M,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 p(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 m(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),w=(function(b){m(S,b);function S(){return c(this,S),p(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 w("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 M=0;M<A.length;M++){var O=A[M];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(E,O.key,O)}}return function(E,A,M){return A&&k(E.prototype,A),M&&k(E,M),E}})(),o=i(0),s=m(o),u=i(5),h=m(u),c=i(9),p=m(c);function m(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 w(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){w(E,k);function E(A,M){d(this,E);var O=y(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,A,M));return O.lastRecorded=0,O.ignoreChange=!1,O.clear(),O.quill.on(h.default.events.EDITOR_CHANGE,function(R,j,D,L){R!==h.default.events.TEXT_CHANGE||O.ignoreChange||(!O.options.userOnly||L===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(M,O){if(this.stack[M].length!==0){var R=this.stack[M].pop();this.stack[O].push(R),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(R[M],h.default.sources.USER),this.ignoreChange=!1;var j=S(R[M]);this.quill.setSelection(j)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(M,O){if(M.ops.length!==0){this.stack.redo=[];var R=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();R=R.compose(D.undo),M=D.redo.compose(M)}else this.lastRecorded=j;this.stack.undo.push({redo:M,undo:R}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(M){this.stack.undo.forEach(function(O){O.undo=M.transform(O.undo,!0),O.redo=M.transform(O.redo,!0)}),this.stack.redo.forEach(function(O){O.undo=M.transform(O.undo,!0),O.redo=M.transform(O.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),E})(p.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(M,O){return M+=O.delete||0,M},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),p=i(8),m=j(p),d=i(23),y=j(d),w=i(34),x=j(w),b=i(59),S=j(b),k=i(60),E=j(k),A=i(28),M=j(A),O=i(61),R=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 L(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 T(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"],U=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],te=[!1,"serif","monospace"],se=["1","2","3",!1],ee=["small",!1,"large","huge"],Q=(function(F){T(z,F);function z(Y,J){D(this,z);var K=L(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(we){we.container.contains(ue.target)||we.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 we=ie.value||"";we!=null&&K[ue][we]&&(ie.innerHTML=K[ue][we])}})})}},{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 we=ue.classList.contains("ql-background")?"background":"color";return ue.querySelector("option")==null&&B(ue,U,we==="background"?"#ffffff":"#000000"),new S.default(ue,K[we])}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 M.default(ue)});var fe=function(){ie.pickers.forEach(function(we){we.update()})};this.quill.on(m.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}),m.default.sources.USER),z.quill.setSelection(ie.index+1,m.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){T(z,F);function z(Y,J){D(this,z);var K=L(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,m.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",J,m.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,m.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(fe+1," ",m.default.sources.USER),this.quill.setSelection(fe+2,m.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),z})(R.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 p=h.length();if(s<p||u&&s===p&&(h.next==null||h.next.length()!==0))return[h,s];s-=p}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),p=c[0],m=c[1],d,y=s-m,w=this.iterator(p);(d=w())&&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 p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,d){m.__proto__=d}||function(m,d){for(var y in d)d.hasOwnProperty(y)&&(m[y]=d[y])};return function(m,d){p(m,d);function y(){this.constructor=m}m.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(p){a(m,p);function m(d){var y=p.call(this,d)||this;return y.scroll=y,y.observer=new MutationObserver(function(w){y.update(w)}),y.observer.observe(y.domNode,u),y.attach(),y}return m.prototype.detach=function(){p.prototype.detach.call(this),this.observer.disconnect()},m.prototype.deleteAt=function(d,y){this.update(),d===0&&y===this.length()?this.children.forEach(function(w){w.remove()}):p.prototype.deleteAt.call(this,d,y)},m.prototype.formatAt=function(d,y,w,x){this.update(),p.prototype.formatAt.call(this,d,y,w,x)},m.prototype.insertAt=function(d,y,w){this.update(),p.prototype.insertAt.call(this,d,y,w)},m.prototype.optimize=function(d,y){var w=this;d===void 0&&(d=[]),y===void 0&&(y={}),p.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,M){M===void 0&&(M=!0),!(A==null||A===w)&&A.domNode.parentNode!=null&&(A.domNode[s.DATA_KEY].mutations==null&&(A.domNode[s.DATA_KEY].mutations=[]),M&&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 M=s.find(A.target,!0);M!=null&&(M.domNode===A.target&&(A.type==="childList"?(b(s.find(A.previousSibling,!1)),[].forEach.call(A.addedNodes,function(O){var R=s.find(O,!1);b(R,!1),R instanceof o.default&&R.children.forEach(function(j){b(j,!1)})})):A.type==="attributes"&&b(M.prev)),b(M))}),this.children.forEach(S),k=[].slice.call(this.observer.takeRecords()),x=k.slice();x.length>0;)d.push(x.pop())}},m.prototype.update=function(d,y){var w=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===w||x.domNode[s.DATA_KEY]==null||x.update(x.domNode[s.DATA_KEY].mutations||[],y)}),this.domNode[s.DATA_KEY].mutations!=null&&p.prototype.update.call(this,this.domNode[s.DATA_KEY].mutations,y),this.optimize(d,y)},m.blotName="scroll",m.defaultChild="block",m.scope=s.Scope.BLOCK_BLOT,m.tagName="DIV",m})(o.default);r.default=c}),(function(n,r,i){var a=this&&this.__extends||(function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,m){p.__proto__=m}||function(p,m){for(var d in m)m.hasOwnProperty(d)&&(p[d]=m[d])};return function(p,m){c(p,m);function d(){this.constructor=p}p.prototype=m===null?Object.create(m):(d.prototype=m.prototype,new d)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(18),s=i(1);function u(c,p){if(Object.keys(c).length!==Object.keys(p).length)return!1;for(var m in c)if(c[m]!==p[m])return!1;return!0}var h=(function(c){a(p,c);function p(){return c!==null&&c.apply(this,arguments)||this}return p.formats=function(m){if(m.tagName!==p.tagName)return c.formats.call(this,m)},p.prototype.format=function(m,d){var y=this;m===this.statics.blotName&&!d?(this.children.forEach(function(w){w instanceof o.default||(w=w.wrap(p.blotName,!0)),y.attributes.copy(w)}),this.unwrap()):c.prototype.format.call(this,m,d)},p.prototype.formatAt=function(m,d,y,w){if(this.formats()[y]!=null||s.query(y,s.Scope.ATTRIBUTE)){var x=this.isolate(m,d);x.format(y,w)}else c.prototype.formatAt.call(this,m,d,y,w)},p.prototype.optimize=function(m){c.prototype.optimize.call(this,m);var d=this.formats();if(Object.keys(d).length===0)return this.unwrap();var y=this.next;y instanceof p&&y.prev===this&&u(d,y.formats())&&(y.moveChildren(this),y.remove())},p.blotName="inline",p.scope=s.Scope.INLINE_BLOT,p.tagName="SPAN",p})(o.default);r.default=h}),(function(n,r,i){var a=this&&this.__extends||(function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,p){c.__proto__=p}||function(c,p){for(var m in p)p.hasOwnProperty(m)&&(c[m]=p[m])};return function(c,p){h(c,p);function m(){this.constructor=c}c.prototype=p===null?Object.create(p):(m.prototype=p.prototype,new m)}})();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(p){var m=s.query(c.blotName).tagName;if(p.tagName!==m)return h.formats.call(this,p)},c.prototype.format=function(p,m){s.query(p,s.Scope.BLOCK)!=null&&(p===this.statics.blotName&&!m?this.replaceWith(c.blotName):h.prototype.format.call(this,p,m))},c.prototype.formatAt=function(p,m,d,y){s.query(d,s.Scope.BLOCK)!=null?this.format(d,y):h.prototype.formatAt.call(this,p,m,d,y)},c.prototype.insertAt=function(p,m,d){if(d==null||s.query(m,s.Scope.INLINE)!=null)h.prototype.insertAt.call(this,p,m,d);else{var y=this.split(p),w=s.create(m,d);y.parent.insertBefore(w,y)}},c.prototype.update=function(p,m){navigator.userAgent.match(/Trident/)?this.build():h.prototype.update.call(this,p,m)},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 p in c)c.hasOwnProperty(p)&&(h[p]=c[p])};return function(h,c){u(h,c);function p(){this.constructor=h}h.prototype=c===null?Object.create(c):(p.prototype=c.prototype,new p)}})();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,p){u.prototype.formatAt.call(this,0,this.length(),c,p)},h.prototype.formatAt=function(c,p,m,d){c===0&&p===this.length()?this.format(m,d):u.prototype.formatAt.call(this,c,p,m,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,p){c.__proto__=p}||function(c,p){for(var m in p)p.hasOwnProperty(m)&&(c[m]=p[m])};return function(c,p){h(c,p);function m(){this.constructor=c}c.prototype=p===null?Object.create(p):(m.prototype=p.prototype,new m)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(19),s=i(1),u=(function(h){a(c,h);function c(p){var m=h.call(this,p)||this;return m.text=m.statics.value(m.domNode),m}return c.create=function(p){return document.createTextNode(p)},c.value=function(p){var m=p.data;return m.normalize&&(m=m.normalize()),m},c.prototype.deleteAt=function(p,m){this.domNode.data=this.text=this.text.slice(0,p)+this.text.slice(p+m)},c.prototype.index=function(p,m){return this.domNode===p?m:-1},c.prototype.insertAt=function(p,m,d){d==null?(this.text=this.text.slice(0,p)+m+this.text.slice(p),this.domNode.data=this.text):h.prototype.insertAt.call(this,p,m,d)},c.prototype.length=function(){return this.text.length},c.prototype.optimize=function(p){h.prototype.optimize.call(this,p),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(p,m){return[this.domNode,p]},c.prototype.split=function(p,m){if(m===void 0&&(m=!1),!m){if(p===0)return this;if(p===this.length())return this.next}var d=s.create(this.domNode.splitText(p));return this.parent.insertBefore(d,this.next),this.text=this.statics.value(this.domNode),d},c.prototype.update=function(p,m){var d=this;p.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,p=arguments[1],m,d=0;d<c;d++)if(m=h[d],u.call(p,m,d,h))return m}}),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,M){if(E==A)return E?[[o,E]]:[];(M<0||E.length<M)&&(M=null);var O=p(E,A),R=E.substring(0,O);E=E.substring(O),A=A.substring(O),O=m(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 R&&D.unshift([o,R]),j&&D.push([o,j]),y(D),M!=null&&(D=b(D,M)),D=S(D),D}function u(E,A){var M;if(!E)return[[a,A]];if(!A)return[[i,E]];var O=E.length>A.length?E:A,R=E.length>A.length?A:E,j=O.indexOf(R);if(j!=-1)return M=[[a,O.substring(0,j)],[o,R],[a,O.substring(j+R.length)]],E.length>A.length&&(M[0][0]=M[2][0]=i),M;if(R.length==1)return[[i,E],[a,A]];var D=d(E,A);if(D){var L=D[0],T=D[1],$=D[2],U=D[3],te=D[4],se=s(L,$),ee=s(T,U);return se.concat([[o,te]],ee)}return h(E,A)}function h(E,A){for(var M=E.length,O=A.length,R=Math.ceil((M+O)/2),j=R,D=2*R,L=new Array(D),T=new Array(D),$=0;$<D;$++)L[$]=-1,T[$]=-1;L[j+1]=0,T[j+1]=0;for(var U=M-O,te=U%2!=0,se=0,ee=0,Q=0,re=0,X=0;X<R;X++){for(var B=-X+se;B<=X-ee;B+=2){var F=j+B,z;B==-X||B!=X&&L[F-1]<L[F+1]?z=L[F+1]:z=L[F-1]+1;for(var Y=z-B;z<M&&Y<O&&E.charAt(z)==A.charAt(Y);)z++,Y++;if(L[F]=z,z>M)ee+=2;else if(Y>O)se+=2;else if(te){var J=j+U-B;if(J>=0&&J<D&&T[J]!=-1){var K=M-T[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&&T[J-1]<T[J+1]?K=T[J+1]:K=T[J-1]+1;for(var fe=K-ie;K<M&&fe<O&&E.charAt(M-K-1)==A.charAt(O-fe-1);)K++,fe++;if(T[J]=K,K>M)re+=2;else if(fe>O)Q+=2;else if(!te){var F=j+U-ie;if(F>=0&&F<D&&L[F]!=-1){var z=L[F],Y=j+z-F;if(K=M-K,z>=K)return c(E,A,z,Y)}}}}return[[i,E],[a,A]]}function c(E,A,M,O){var R=E.substring(0,M),j=A.substring(0,O),D=E.substring(M),L=A.substring(O),T=s(R,j),$=s(D,L);return T.concat($)}function p(E,A){if(!E||!A||E.charAt(0)!=A.charAt(0))return 0;for(var M=0,O=Math.min(E.length,A.length),R=O,j=0;M<R;)E.substring(j,R)==A.substring(j,R)?(M=R,j=M):O=R,R=Math.floor((O-M)/2+M);return R}function m(E,A){if(!E||!A||E.charAt(E.length-1)!=A.charAt(A.length-1))return 0;for(var M=0,O=Math.min(E.length,A.length),R=O,j=0;M<R;)E.substring(E.length-R,E.length-j)==A.substring(A.length-R,A.length-j)?(M=R,j=M):O=R,R=Math.floor((O-M)/2+M);return R}function d(E,A){var M=E.length>A.length?E:A,O=E.length>A.length?A:E;if(M.length<4||O.length*2<M.length)return null;function R(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=p(ee.substring(re),Q.substring(B)),fe=m(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=R(M,O,Math.ceil(M.length/4)),D=R(M,O,Math.ceil(M.length/2)),L;if(!j&&!D)return null;D?j?L=j[4].length>D[4].length?j:D:L=D:L=j;var T,$,U,te;E.length>A.length?(T=L[0],$=L[1],U=L[2],te=L[3]):(U=L[0],te=L[1],T=L[2],$=L[3]);var se=L[4];return[T,$,U,te,se]}function y(E){E.push([o,""]);for(var A=0,M=0,O=0,R="",j="",D;A<E.length;)switch(E[A][0]){case a:O++,j+=E[A][1],A++;break;case i:M++,R+=E[A][1],A++;break;case o:M+O>1?(M!==0&&O!==0&&(D=p(j,R),D!==0&&(A-M-O>0&&E[A-M-O-1][0]==o?E[A-M-O-1][1]+=j.substring(0,D):(E.splice(0,0,[o,j.substring(0,D)]),A++),j=j.substring(D),R=R.substring(D)),D=m(j,R),D!==0&&(E[A][1]=j.substring(j.length-D)+E[A][1],j=j.substring(0,j.length-D),R=R.substring(0,R.length-D))),M===0?E.splice(A-O,M+O,[a,j]):O===0?E.splice(A-M,M+O,[i,R]):E.splice(A-M-O,M+O,[i,R],[a,j]),A=A-M-O+(M?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,M=0,R="",j="";break}E[E.length-1][1]===""&&E.pop();var L=!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),L=!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),L=!0)),A++;L&&y(E)}var w=s;w.INSERT=a,w.DELETE=i,w.EQUAL=o,n.exports=w;function x(E,A){if(A===0)return[o,E];for(var M=0,O=0;O<E.length;O++){var R=E[O];if(R[0]===i||R[0]===o){var j=M+R[1].length;if(A===j)return[O+1,E];if(A<j){E=E.slice();var D=A-M,L=[R[0],R[1].slice(0,D)],T=[R[0],R[1].slice(D)];return E.splice(O,1,L,T),[O+1,E]}else M=j}}throw new Error("cursor_pos is out of bounds!")}function b(E,A){var M=x(E,A),O=M[1],R=M[0],j=O[R],D=O[R+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(R,2,D,j),k(O,R,2);if(D!=null&&D[1].indexOf(j[1])===0){O.splice(R,2,[D[0],j[1]],[0,j[1]]);var L=D[1].slice(j[1].length);return L.length>0&&O.splice(R+2,0,[D[0],L]),k(O,R,3)}else return E}function S(E){for(var A=!1,M=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},R=2;R<E.length;R+=1)E[R-2][0]===o&&O(E[R-2][1])&&E[R-1][0]===i&&M(E[R-1][1])&&E[R][0]===a&&M(E[R][1])&&(A=!0,E[R-1][1]=E[R-2][1].slice(-1)+E[R-1][1],E[R][1]=E[R-2][1].slice(-1)+E[R][1],E[R-2][1]=E[R-2][1].slice(0,-1));if(!A)return E;for(var j=[],R=0;R<E.length;R+=1)E[R][1].length>0&&j.push(E[R]);return j}function k(E,A,M){for(var O=A+M-1;O>=0&&O>=A-1;O--)if(O+1<E.length){var R=E[O],j=E[O+1];R[0]===j[1]&&E.splice(O,2,[R[0],R[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,p){this.fn=h,this.context=c,this.once=p||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var c=[],p,m;if(this._eventsCount===0)return c;for(m in p=this._events)i.call(p,m)&&c.push(a?m.slice(1):m);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(p)):c},u.prototype.listeners=function(c,p){var m=a?a+c:c,d=this._events[m];if(p)return!!d;if(!d)return[];if(d.fn)return[d.fn];for(var y=0,w=d.length,x=new Array(w);y<w;y++)x[y]=d[y].fn;return x},u.prototype.emit=function(c,p,m,d,y,w){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,p),!0;case 3:return b.fn.call(b.context,p,m),!0;case 4:return b.fn.call(b.context,p,m,d),!0;case 5:return b.fn.call(b.context,p,m,d,y),!0;case 6:return b.fn.call(b.context,p,m,d,y,w),!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,M;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,p);break;case 3:b[E].fn.call(b[E].context,p,m);break;case 4:b[E].fn.call(b[E].context,p,m,d);break;default:if(!k)for(M=1,k=new Array(S-1);M<S;M++)k[M-1]=arguments[M];b[E].fn.apply(b[E].context,k)}}return!0},u.prototype.on=function(c,p,m){var d=new s(p,m||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,p,m){var d=new s(p,m||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,p,m,d){var y=a?a+c:c;if(!this._events[y])return this;if(!p)return--this._eventsCount===0?this._events=new o:delete this._events[y],this;var w=this._events[y];if(w.fn)w.fn===p&&(!d||w.once)&&(!m||w.context===m)&&(--this._eventsCount===0?this._events=new o:delete this._events[y]);else{for(var x=0,b=[],S=w.length;x<S;x++)(w[x].fn!==p||d&&!w[x].once||m&&w[x].context!==m)&&b.push(w[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 p;return c?(p=a?a+c:c,this._events[p]&&(--this._eventsCount===0?this._events=new o:delete this._events[p])):(this._events=new o,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prototype.setMaxListeners=function(){return this},u.prefixed=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(he){return typeof he}:function(he){return he&&typeof Symbol=="function"&&he.constructor===Symbol&&he!==Symbol.prototype?"symbol":typeof he},o=(function(){function he(be,Le){var Me=[],ve=!0,ye=!1,xe=void 0;try{for(var Ie=be[Symbol.iterator](),Te;!(ve=(Te=Ie.next()).done)&&(Me.push(Te.value),!(Le&&Me.length===Le));ve=!0);}catch(Je){ye=!0,xe=Je}finally{try{!ve&&Ie.return&&Ie.return()}finally{if(ye)throw xe}}return Me}return function(be,Le){if(Array.isArray(be))return be;if(Symbol.iterator in Object(be))return he(be,Le);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),s=(function(){function he(be,Le){for(var Me=0;Me<Le.length;Me++){var ve=Le[Me];ve.enumerable=ve.enumerable||!1,ve.configurable=!0,"value"in ve&&(ve.writable=!0),Object.defineProperty(be,ve.key,ve)}}return function(be,Le,Me){return Le&&he(be.prototype,Le),Me&&he(be,Me),be}})(),u=i(3),h=T(u),c=i(2),p=T(c),m=i(0),d=T(m),y=i(5),w=T(y),x=i(10),b=T(x),S=i(9),k=T(S),E=i(36),A=i(37),M=i(13),O=T(M),R=i(26),j=i(38),D=i(39),L=i(40);function T(he){return he&&he.__esModule?he:{default:he}}function $(he,be,Le){return be in he?Object.defineProperty(he,be,{value:Le,enumerable:!0,configurable:!0,writable:!0}):he[be]=Le,he}function U(he,be){if(!(he instanceof be))throw new TypeError("Cannot call a class as a function")}function te(he,be){if(!he)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return be&&(typeof be=="object"||typeof be=="function")?be:he}function se(he,be){if(typeof be!="function"&&be!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof be);he.prototype=Object.create(be&&be.prototype,{constructor:{value:he,enumerable:!1,writable:!0,configurable:!0}}),be&&(Object.setPrototypeOf?Object.setPrototypeOf(he,be):he.__proto__=be)}var ee=(0,b.default)("quill:clipboard"),Q="__ql-matcher",re=[[Node.TEXT_NODE,ke],[Node.TEXT_NODE,tt],["br",Ce],[Node.ELEMENT_NODE,tt],[Node.ELEMENT_NODE,we],[Node.ELEMENT_NODE,ge],[Node.ELEMENT_NODE,ue],[Node.ELEMENT_NODE,ut],["li",ze],["b",fe.bind(fe,"bold")],["i",fe.bind(fe,"italic")],["style",Ue]],X=[E.AlignAttribute,j.DirectionAttribute].reduce(function(he,be){return he[be.keyName]=be,he},{}),B=[E.AlignStyle,A.BackgroundStyle,R.ColorStyle,j.DirectionStyle,D.FontStyle,L.SizeStyle].reduce(function(he,be){return he[be.keyName]=be,he},{}),F=(function(he){se(be,he);function be(Le,Me){U(this,be);var ve=te(this,(be.__proto__||Object.getPrototypeOf(be)).call(this,Le,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 xe=o(ye,2),Ie=xe[0],Te=xe[1];!Me.matchVisual&&Te===ge||ve.addMatcher(Ie,Te)}),ve}return s(be,[{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 p.default().insert(ye,$({},O.default.blotName,ve[O.default.blotName]))}var xe=this.prepareMatching(),Ie=o(xe,2),Te=Ie[0],Je=Ie[1],nt=ie(this.container,Te,Je);return J(nt,`
132
- `)&&nt.ops[nt.ops.length-1].attributes==null&&(nt=nt.compose(new p.default().retain(nt.length()-1).delete(1))),ee.log("convert",this.container.innerHTML,nt),this.container.innerHTML="",nt}},{key:"dangerouslyPasteHTML",value:function(Me,ve){var ye=arguments.length>2&&arguments[2]!==void 0?arguments[2]:w.default.sources.API;if(typeof Me=="string")this.quill.setContents(this.convert(Me),ve),this.quill.setSelection(0,w.default.sources.SILENT);else{var xe=this.convert(ve);this.quill.updateContents(new p.default().retain(Me).concat(xe),ye),this.quill.setSelection(Me+xe.length(),w.default.sources.SILENT)}}},{key:"onPaste",value:function(Me){var ve=this;if(!(Me.defaultPrevented||!this.quill.isEnabled())){var ye=this.quill.getSelection(),xe=new p.default().retain(ye.index),Ie=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(w.default.sources.SILENT),setTimeout(function(){xe=xe.concat(ve.convert()).delete(ye.length),ve.quill.updateContents(xe,w.default.sources.USER),ve.quill.setSelection(xe.length()-ye.length,w.default.sources.SILENT),ve.quill.scrollingContainer.scrollTop=Ie,ve.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var Me=this,ve=[],ye=[];return this.matchers.forEach(function(xe){var Ie=o(xe,2),Te=Ie[0],Je=Ie[1];switch(Te){case Node.TEXT_NODE:ye.push(Je);break;case Node.ELEMENT_NODE:ve.push(Je);break;default:[].forEach.call(Me.container.querySelectorAll(Te),function(nt){nt[Q]=nt[Q]||[],nt[Q].push(Je)});break}}),[ve,ye]}}]),be})(k.default);F.DEFAULTS={matchers:[],matchVisual:!0};function z(he,be,Le){return(typeof be>"u"?"undefined":a(be))==="object"?Object.keys(be).reduce(function(Me,ve){return z(Me,ve,be[ve])},he):he.reduce(function(Me,ve){return ve.attributes&&ve.attributes[be]?Me.push(ve):Me.insert(ve.insert,(0,h.default)({},$({},be,Le),ve.attributes))},new p.default)}function Y(he){if(he.nodeType!==Node.ELEMENT_NODE)return{};var be="__ql-computed-style";return he[be]||(he[be]=window.getComputedStyle(he))}function J(he,be){for(var Le="",Me=he.ops.length-1;Me>=0&&Le.length<be.length;--Me){var ve=he.ops[Me];if(typeof ve.insert!="string")break;Le=ve.insert+Le}return Le.slice(-1*be.length)===be}function K(he){if(he.childNodes.length===0)return!1;var be=Y(he);return["block","list-item"].indexOf(be.display)>-1}function ie(he,be,Le){return he.nodeType===he.TEXT_NODE?Le.reduce(function(Me,ve){return ve(he,Me)},new p.default):he.nodeType===he.ELEMENT_NODE?[].reduce.call(he.childNodes||[],function(Me,ve){var ye=ie(ve,be,Le);return ve.nodeType===he.ELEMENT_NODE&&(ye=be.reduce(function(xe,Ie){return Ie(ve,xe)},ye),ye=(ve[Q]||[]).reduce(function(xe,Ie){return Ie(ve,xe)},ye)),Me.concat(ye)},new p.default):new p.default}function fe(he,be,Le){return z(Le,he,!0)}function ue(he,be){var Le=d.default.Attributor.Attribute.keys(he),Me=d.default.Attributor.Class.keys(he),ve=d.default.Attributor.Style.keys(he),ye={};return Le.concat(Me).concat(ve).forEach(function(xe){var Ie=d.default.query(xe,d.default.Scope.ATTRIBUTE);Ie!=null&&(ye[Ie.attrName]=Ie.value(he),ye[Ie.attrName])||(Ie=X[xe],Ie!=null&&(Ie.attrName===xe||Ie.keyName===xe)&&(ye[Ie.attrName]=Ie.value(he)||void 0),Ie=B[xe],Ie!=null&&(Ie.attrName===xe||Ie.keyName===xe)&&(Ie=B[xe],ye[Ie.attrName]=Ie.value(he)||void 0))}),Object.keys(ye).length>0&&(be=z(be,ye)),be}function we(he,be){var Le=d.default.query(he);if(Le==null)return be;if(Le.prototype instanceof d.default.Embed){var Me={},ve=Le.value(he);ve!=null&&(Me[Le.blotName]=ve,be=new p.default().insert(Me,Le.formats(he)))}else typeof Le.formats=="function"&&(be=z(be,Le.blotName,Le.formats(he)));return be}function Ce(he,be){return J(be,`
133
- `)||be.insert(`
134
- `),be}function Ue(){return new p.default}function ze(he,be){var Le=d.default.query(he);if(Le==null||Le.blotName!=="list-item"||!J(be,`
135
- `))return be;for(var Me=-1,ve=he.parentNode;!ve.classList.contains("ql-clipboard");)(d.default.query(ve)||{}).blotName==="list"&&(Me+=1),ve=ve.parentNode;return Me<=0?be:be.compose(new p.default().retain(be.length()-1).retain(1,{indent:Me}))}function tt(he,be){return J(be,`
136
- `)||(K(he)||be.length()>0&&he.nextSibling&&K(he.nextSibling))&&be.insert(`
137
- `),be}function ge(he,be){if(K(he)&&he.nextElementSibling!=null&&!J(be,`
138
-
139
- `)){var Le=he.offsetHeight+parseFloat(Y(he).marginTop)+parseFloat(Y(he).marginBottom);he.nextElementSibling.offsetTop>he.offsetTop+Le*1.5&&be.insert(`
140
- `)}return be}function ut(he,be){var Le={},Me=he.style||{};return Me.fontStyle&&Y(he).fontStyle==="italic"&&(Le.italic=!0),Me.fontWeight&&(Y(he).fontWeight.startsWith("bold")||parseInt(Y(he).fontWeight)>=700)&&(Le.bold=!0),Object.keys(Le).length>0&&(be=z(be,Le)),parseFloat(Me.textIndent||0)>0&&(be=new p.default().insert(" ").concat(be)),be}function ke(he,be){var Le=he.data;if(he.parentNode.tagName==="O:P")return be.insert(Le.trim());if(Le.trim().length===0&&he.parentNode.classList.contains("ql-clipboard"))return be;if(!Y(he.parentNode).whiteSpace.startsWith("pre")){var Me=function(ye,xe){return xe=xe.replace(/[^\u00a0]/g,""),xe.length<1&&ye?" ":xe};Le=Le.replace(/\r\n/g," ").replace(/\n/g," "),Le=Le.replace(/\s\s+/g,Me.bind(Me,!0)),(he.previousSibling==null&&K(he.parentNode)||he.previousSibling!=null&&K(he.previousSibling))&&(Le=Le.replace(/^\s+/,Me.bind(Me,!1))),(he.nextSibling==null&&K(he.parentNode)||he.nextSibling!=null&&K(he.nextSibling))&&(Le=Le.replace(/\s+$/,Me.bind(Me,!1)))}return be.insert(Le)}r.default=F,r.matchAttributor=ue,r.matchBlot=we,r.matchNewline=tt,r.matchSpacing=ge,r.matchText=ke}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function y(w,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(w,S.key,S)}}return function(w,x,b){return x&&y(w.prototype,x),b&&y(w,b),w}})(),o=function y(w,x,b){w===null&&(w=Function.prototype);var S=Object.getOwnPropertyDescriptor(w,x);if(S===void 0){var k=Object.getPrototypeOf(w);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,w){if(!(y instanceof w))throw new TypeError("Cannot call a class as a function")}function p(y,w){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:y}function m(y,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);y.prototype=Object.create(w&&w.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(y,w):y.__proto__=w)}var d=(function(y){m(w,y);function w(){return c(this,w),p(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return a(w,[{key:"optimize",value:function(b){o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"optimize",this).call(this,b),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(w.__proto__||Object.getPrototypeOf(w),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),w})(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 L(T,$){var U=[],te=!0,se=!1,ee=void 0;try{for(var Q=T[Symbol.iterator](),re;!(te=(re=Q.next()).done)&&(U.push(re.value),!($&&U.length===$));te=!0);}catch(X){se=!0,ee=X}finally{try{!te&&Q.return&&Q.return()}finally{if(se)throw ee}}return U}return function(T,$){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return L(T,$);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function L(T,$){for(var U=0;U<$.length;U++){var te=$[U];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(T,te.key,te)}}return function(T,$,U){return $&&L(T.prototype,$),U&&L(T,U),T}})(),s=i(2),u=b(s),h=i(0),c=b(h),p=i(5),m=b(p),d=i(10),y=b(d),w=i(9),x=b(w);function b(L){return L&&L.__esModule?L:{default:L}}function S(L,T,$){return T in L?Object.defineProperty(L,T,{value:$,enumerable:!0,configurable:!0,writable:!0}):L[T]=$,L}function k(L,T){if(!(L instanceof T))throw new TypeError("Cannot call a class as a function")}function E(L,T){if(!L)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:L}function A(L,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);L.prototype=Object.create(T&&T.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(L,T):L.__proto__=T)}var M=(0,y.default)("quill:toolbar"),O=(function(L){A(T,L);function T($,U){k(this,T);var te=E(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,$,U));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=M.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(m.default.events.EDITOR_CHANGE,function(Q,re){Q===m.default.events.SELECTION_CHANGE&&te.update(re)}),te.quill.on(m.default.events.SCROLL_OPTIMIZE,function(){var Q=te.quill.selection.getRange(),re=a(Q,1),X=re[0];te.update(X)}),te}return o(T,[{key:"addHandler",value:function(U,te){this.handlers[U]=te}},{key:"attach",value:function(U){var te=this,se=[].find.call(U.classList,function(Q){return Q.indexOf("ql-")===0});if(se){if(se=se.slice(3),U.tagName==="BUTTON"&&U.setAttribute("type","button"),this.handlers[se]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[se]==null){M.warn("ignoring attaching to disabled format",se,U);return}if(c.default.query(se)==null){M.warn("ignoring attaching to nonexistent format",se,U);return}}var ee=U.tagName==="SELECT"?"change":"click";U.addEventListener(ee,function(Q){var re=void 0;if(U.tagName==="SELECT"){if(U.selectedIndex<0)return;var X=U.options[U.selectedIndex];X.hasAttribute("selected")?re=!1:re=X.value||!1}else U.classList.contains("ql-active")?re=!1:re=U.value||!U.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)),m.default.sources.USER)}else te.quill.format(se,re,m.default.sources.USER);te.update(z)}),this.controls.push([se,U])}}},{key:"update",value:function(U){var te=U==null?{}:this.quill.getFormat(U);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(U==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(U==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)})}}]),T})(x.default);O.DEFAULTS={};function R(L,T,$){var U=document.createElement("button");U.setAttribute("type","button"),U.classList.add("ql-"+T),$!=null&&(U.value=$),L.appendChild(U)}function j(L,T){Array.isArray(T[0])||(T=[T]),T.forEach(function($){var U=document.createElement("span");U.classList.add("ql-formats"),$.forEach(function(te){if(typeof te=="string")R(U,te);else{var se=Object.keys(te)[0],ee=te[se];Array.isArray(ee)?D(U,se,ee):R(U,se,ee)}}),L.appendChild(U)})}function D(L,T,$){var U=document.createElement("select");U.classList.add("ql-"+T),$.forEach(function(te){var se=document.createElement("option");te!==!1?se.setAttribute("value",te):se.setAttribute("selected","selected"),U.appendChild(se)}),L.appendChild(U)}O.DEFAULTS={container:null,handlers:{clean:function(){var T=this,$=this.quill.getSelection();if($!=null)if($.length==0){var U=this.quill.getFormat();Object.keys(U).forEach(function(te){c.default.query(te,c.default.Scope.INLINE)!=null&&T.quill.format(te,!1)})}else this.quill.removeFormat($,m.default.sources.USER)},direction:function(T){var $=this.quill.getFormat().align;T==="rtl"&&$==null?this.quill.format("align","right",m.default.sources.USER):!T&&$==="right"&&this.quill.format("align",!1,m.default.sources.USER),this.quill.format("direction",T,m.default.sources.USER)},indent:function(T){var $=this.quill.getSelection(),U=this.quill.getFormat($),te=parseInt(U.indent||0);if(T==="+1"||T==="-1"){var se=T==="+1"?1:-1;U.direction==="rtl"&&(se*=-1),this.quill.format("indent",te+se,m.default.sources.USER)}},link:function(T){T===!0&&(T=prompt("Enter link URL:")),this.quill.format("link",T,m.default.sources.USER)},list:function(T){var $=this.quill.getSelection(),U=this.quill.getFormat($);T==="check"?U.list==="checked"||U.list==="unchecked"?this.quill.format("list",!1,m.default.sources.USER):this.quill.format("list","unchecked",m.default.sources.USER):this.quill.format("list",T,m.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(w,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(w,S.key,S)}}return function(w,x,b){return x&&y(w.prototype,x),b&&y(w,b),w}})(),o=function y(w,x,b){w===null&&(w=Function.prototype);var S=Object.getOwnPropertyDescriptor(w,x);if(S===void 0){var k=Object.getPrototypeOf(w);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,w){if(!(y instanceof w))throw new TypeError("Cannot call a class as a function")}function p(y,w){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:y}function m(y,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);y.prototype=Object.create(w&&w.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(y,w):y.__proto__=w)}var d=(function(y){m(w,y);function w(x,b){c(this,w);var S=p(this,(w.__proto__||Object.getPrototypeOf(w)).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(w,[{key:"buildItem",value:function(b){var S=o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"buildItem",this).call(this,b);return S.style.backgroundColor=b.getAttribute("value")||"",S}},{key:"selectItem",value:function(b,S){o(w.prototype.__proto__||Object.getPrototypeOf(w.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)}}]),w})(u.default);r.default=d}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function y(w,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(w,S.key,S)}}return function(w,x,b){return x&&y(w.prototype,x),b&&y(w,b),w}})(),o=function y(w,x,b){w===null&&(w=Function.prototype);var S=Object.getOwnPropertyDescriptor(w,x);if(S===void 0){var k=Object.getPrototypeOf(w);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,w){if(!(y instanceof w))throw new TypeError("Cannot call a class as a function")}function p(y,w){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:y}function m(y,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);y.prototype=Object.create(w&&w.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(y,w):y.__proto__=w)}var d=(function(y){m(w,y);function w(x,b){c(this,w);var S=p(this,(w.__proto__||Object.getPrototypeOf(w)).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(w,[{key:"selectItem",value:function(b,S){o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"selectItem",this).call(this,b,S),b=b||this.defaultItem,this.label.innerHTML=b.innerHTML}}]),w})(u.default);r.default=d}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function u(h,c){for(var p=0;p<c.length;p++){var m=c[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(h,m.key,m)}}return function(h,c,p){return c&&u(h.prototype,c),p&&u(h,p),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 p=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(){p.root.style.marginTop=-1*p.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 p=c.left+c.width/2-this.root.offsetWidth/2,m=c.bottom+this.quill.root.scrollTop;this.root.style.left=p+"px",this.root.style.top=m+"px",this.root.classList.remove("ql-flip");var d=this.boundsContainer.getBoundingClientRect(),y=this.root.getBoundingClientRect(),w=0;if(y.right>d.right&&(w=d.right-y.right,this.root.style.left=p+w+"px"),y.left<d.left&&(w=d.left-y.left,this.root.style.left=p+w+"px"),y.bottom>d.bottom){var x=y.bottom-y.top,b=c.bottom-c.top+x;this.root.style.top=m-b+"px",this.root.classList.add("ql-flip")}return w}},{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(L,T){var $=[],U=!0,te=!1,se=void 0;try{for(var ee=L[Symbol.iterator](),Q;!(U=(Q=ee.next()).done)&&($.push(Q.value),!(T&&$.length===T));U=!0);}catch(re){te=!0,se=re}finally{try{!U&&ee.return&&ee.return()}finally{if(te)throw se}}return $}return function(L,T){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return D(L,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=function D(L,T,$){L===null&&(L=Function.prototype);var U=Object.getOwnPropertyDescriptor(L,T);if(U===void 0){var te=Object.getPrototypeOf(L);return te===null?void 0:D(te,T,$)}else{if("value"in U)return U.value;var se=U.get;return se===void 0?void 0:se.call($)}},s=(function(){function D(L,T){for(var $=0;$<T.length;$++){var U=T[$];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(L,U.key,U)}}return function(L,T,$){return T&&D(L.prototype,T),$&&D(L,$),L}})(),u=i(3),h=k(u),c=i(8),p=k(c),m=i(43),d=k(m),y=i(27),w=k(y),x=i(15),b=i(41),S=k(b);function k(D){return D&&D.__esModule?D:{default:D}}function E(D,L){if(!(D instanceof L))throw new TypeError("Cannot call a class as a function")}function A(D,L){if(!D)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:D}function M(D,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);D.prototype=Object.create(L&&L.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(D,L):D.__proto__=L)}var O=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],R=(function(D){M(L,D);function L(T,$){E(this,L),$.modules.toolbar!=null&&$.modules.toolbar.container==null&&($.modules.toolbar.container=O);var U=A(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,T,$));return U.quill.container.classList.add("ql-snow"),U}return s(L,[{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(U,te){$.handlers.link.call($,!te.format.link)})}}]),L})(d.default);R.DEFAULTS=(0,h.default)(!0,{},d.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(L){if(L){var T=this.quill.getSelection();if(T==null||T.length==0)return;var $=this.quill.getText(T);/^\S+@\S+\.\S+$/.test($)&&$.indexOf("mailto:")!==0&&($="mailto:"+$);var U=this.quill.theme.tooltip;U.edit("link",$)}else this.quill.format("link",!1)}}}}});var j=(function(D){M(L,D);function L(T,$){E(this,L);var U=A(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,T,$));return U.preview=U.root.querySelector("a.ql-preview"),U}return s(L,[{key:"listen",value:function(){var $=this;o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(U){$.root.classList.contains("ql-editing")?$.save():$.edit("link",$.preview.textContent),U.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(U){if($.linkRange!=null){var te=$.linkRange;$.restoreFocus(),$.quill.formatText(te,"link",!1,p.default.sources.USER),delete $.linkRange}U.preventDefault(),$.hide()}),this.quill.on(p.default.events.SELECTION_CHANGE,function(U,te,se){if(U!=null){if(U.length===0&&se===p.default.sources.USER){var ee=$.quill.scroll.descendant(w.default,U.index),Q=a(ee,2),re=Q[0],X=Q[1];if(re!=null){$.linkRange=new x.Range(U.index-X,re.length());var B=w.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(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),L})(m.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=R}),(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),p=ve(c),m=i(66),d=ve(m),y=i(67),w=ve(y),x=i(37),b=i(26),S=i(39),k=i(40),E=i(56),A=ve(E),M=i(68),O=ve(M),R=i(27),j=ve(R),D=i(69),L=ve(D),T=i(70),$=ve(T),U=i(71),te=ve(U),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),we=i(28),Ce=ve(we),Ue=i(59),ze=ve(Ue),tt=i(60),ge=ve(tt),ut=i(61),ke=ve(ut),he=i(108),be=ve(he),Le=i(62),Me=ve(Le);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":p.default,"formats/code-block":B.default,"formats/header":d.default,"formats/list":w.default,"formats/bold":A.default,"formats/code":X.Code,"formats/italic":O.default,"formats/link":j.default,"formats/script":L.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":be.default,"themes/snow":Me.default,"ui/icons":ue.default,"ui/picker":Ce.default,"ui/icon-picker":ge.default,"ui/color-picker":ze.default,"ui/tooltip":ke.default},!0),r.default=o.default}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.IndentClass=void 0;var a=(function(){function w(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&&w(x.prototype,b),S&&w(x,S),x}})(),o=function w(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:w(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(w){return w&&w.__esModule?w:{default:w}}function c(w,x){if(!(w instanceof x))throw new TypeError("Cannot call a class as a function")}function p(w,x){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:w}function m(w,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);w.prototype=Object.create(x&&x.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(w,x):w.__proto__=x)}var d=(function(w){m(x,w);function x(){return c(this,x),p(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(m){return m&&m.__esModule?m:{default:m}}function u(m,d){if(!(m instanceof d))throw new TypeError("Cannot call a class as a function")}function h(m,d){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:m}function c(m,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);m.prototype=Object.create(d&&d.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(m,d):m.__proto__=d)}var p=(function(m){c(d,m);function d(){return u(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d})(o.default);p.blotName="blockquote",p.tagName="blockquote",r.default=p}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function d(y,w){for(var x=0;x<w.length;x++){var b=w[x];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,w,x){return w&&d(y.prototype,w),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 p(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 m=(function(d){p(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);m.blotName="header",m.tagName=["H1","H2","H3","H4","H5","H6"],r.default=m}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.ListItem=void 0;var a=(function(){function E(A,M){for(var O=0;O<M.length;O++){var R=M[O];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(A,R.key,R)}}return function(A,M,O){return M&&E(A.prototype,M),O&&E(A,O),A}})(),o=function E(A,M,O){A===null&&(A=Function.prototype);var R=Object.getOwnPropertyDescriptor(A,M);if(R===void 0){var j=Object.getPrototypeOf(A);return j===null?void 0:E(j,M,O)}else{if("value"in R)return R.value;var D=R.get;return D===void 0?void 0:D.call(O)}},s=i(0),u=d(s),h=i(4),c=d(h),p=i(25),m=d(p);function d(E){return E&&E.__esModule?E:{default:E}}function y(E,A,M){return A in E?Object.defineProperty(E,A,{value:M,enumerable:!0,configurable:!0,writable:!0}):E[A]=M,E}function w(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 w(this,A),x(this,(A.__proto__||Object.getPrototypeOf(A)).apply(this,arguments))}return a(A,[{key:"format",value:function(O,R){O===k.blotName&&!R?this.replaceWith(u.default.create(this.statics.scope)):o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"format",this).call(this,O,R)}},{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,R){return this.parent.isolate(this.offset(this.parent),this.length()),O===this.parent.statics.blotName?(this.parent.replaceWith(O,R),this):(this.parent.unwrap(),o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"replaceWith",this).call(this,O,R))}}],[{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 R=O==="ordered"?"OL":"UL",j=o(A.__proto__||Object.getPrototypeOf(A),"create",this).call(this,R);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(M){w(this,A);var O=x(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,M)),R=function(D){if(D.target.parentNode===M){var L=O.statics.formats(M),T=u.default.find(D.target);L==="checked"?T.format("list","unchecked"):L==="unchecked"&&T.format("list","checked")}};return M.addEventListener("touchstart",R),M.addEventListener("mousedown",R),O}return a(A,[{key:"format",value:function(O,R){this.children.length>0&&this.children.tail.format(O,R)}},{key:"formats",value:function(){return y({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(O,R){if(O instanceof S)o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertBefore",this).call(this,O,R);else{var j=R==null?this.length():R.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 R=this.next;R!=null&&R.prev===this&&R.statics.blotName===this.statics.blotName&&R.domNode.tagName===this.domNode.tagName&&R.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(R.moveChildren(this),R.remove())}},{key:"replace",value:function(O){if(O.statics.blotName!==this.statics.blotName){var R=u.default.create(this.statics.defaultChild);O.moveChildren(R),this.appendChild(R)}o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"replace",this).call(this,O)}}]),A})(m.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(m){return m&&m.__esModule?m:{default:m}}function u(m,d){if(!(m instanceof d))throw new TypeError("Cannot call a class as a function")}function h(m,d){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:m}function c(m,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);m.prototype=Object.create(d&&d.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(m,d):m.__proto__=d)}var p=(function(m){c(d,m);function d(){return u(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d})(o.default);p.blotName="italic",p.tagName=["EM","I"],r.default=p}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function y(w,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(w,S.key,S)}}return function(w,x,b){return x&&y(w.prototype,x),b&&y(w,b),w}})(),o=function y(w,x,b){w===null&&(w=Function.prototype);var S=Object.getOwnPropertyDescriptor(w,x);if(S===void 0){var k=Object.getPrototypeOf(w);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,w){if(!(y instanceof w))throw new TypeError("Cannot call a class as a function")}function p(y,w){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:y}function m(y,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);y.prototype=Object.create(w&&w.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(y,w):y.__proto__=w)}var d=(function(y){m(w,y);function w(){return c(this,w),p(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return a(w,null,[{key:"create",value:function(b){return b==="super"?document.createElement("sup"):b==="sub"?document.createElement("sub"):o(w.__proto__||Object.getPrototypeOf(w),"create",this).call(this,b)}},{key:"formats",value:function(b){if(b.tagName==="SUB")return"sub";if(b.tagName==="SUP")return"super"}}]),w})(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(m){return m&&m.__esModule?m:{default:m}}function u(m,d){if(!(m instanceof d))throw new TypeError("Cannot call a class as a function")}function h(m,d){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:m}function c(m,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);m.prototype=Object.create(d&&d.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(m,d):m.__proto__=d)}var p=(function(m){c(d,m);function d(){return u(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d})(o.default);p.blotName="strike",p.tagName="S",r.default=p}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(6),o=s(a);function s(m){return m&&m.__esModule?m:{default:m}}function u(m,d){if(!(m instanceof d))throw new TypeError("Cannot call a class as a function")}function h(m,d){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:m}function c(m,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);m.prototype=Object.create(d&&d.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(m,d):m.__proto__=d)}var p=(function(m){c(d,m);function d(){return u(this,d),h(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return d})(o.default);p.blotName="underline",p.tagName="U",r.default=p}),(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 M=E.get;return M===void 0?void 0:M.call(k)}},s=i(0),u=c(s),h=i(27);function c(x){return x&&x.__esModule?x:{default:x}}function p(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 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"],w=(function(x){d(b,x);function b(){return p(this,b),m(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);w.blotName="image",w.tagName="IMG",r.default=w}),(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 M=E.get;return M===void 0?void 0:M.call(k)}},s=i(4),u=i(27),h=c(u);function c(x){return x&&x.__esModule?x:{default:x}}function p(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 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"],w=(function(x){d(b,x);function b(){return p(this,b),m(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);w.blotName="video",w.className="ql-video",w.tagName="IFRAME",r.default=w}),(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 M=0;M<A.length;M++){var O=A[M];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(E,O.key,O)}}return function(E,A,M){return A&&k(E.prototype,A),M&&k(E,M),E}})(),o=function k(E,A,M){E===null&&(E=Function.prototype);var O=Object.getOwnPropertyDescriptor(E,A);if(O===void 0){var R=Object.getPrototypeOf(E);return R===null?void 0:k(R,A,M)}else{if("value"in O)return O.value;var j=O.get;return j===void 0?void 0:j.call(M)}},s=i(35),u=d(s),h=i(5),c=d(h),p=i(9),m=d(p);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 w(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),w(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return a(E,null,[{key:"create",value:function(M){var O=o(E.__proto__||Object.getPrototypeOf(E),"create",this).call(this,M);return typeof M=="string"&&(window.katex.render(M,O,{throwOnError:!1,errorColor:"#f00"}),O.setAttribute("data-value",M)),O}},{key:"value",value:function(M){return M.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=w(this,(E.__proto__||Object.getPrototypeOf(E)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return A}return E})(m.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 M(O,R){for(var j=0;j<R.length;j++){var D=R[j];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(O,D.key,D)}}return function(O,R,j){return R&&M(O.prototype,R),j&&M(O,j),O}})(),o=function M(O,R,j){O===null&&(O=Function.prototype);var D=Object.getOwnPropertyDescriptor(O,R);if(D===void 0){var L=Object.getPrototypeOf(O);return L===null?void 0:M(L,R,j)}else{if("value"in D)return D.value;var T=D.get;return T===void 0?void 0:T.call(j)}},s=i(0),u=w(s),h=i(5),c=w(h),p=i(9),m=w(p),d=i(13),y=w(d);function w(M){return M&&M.__esModule?M:{default:M}}function x(M,O){if(!(M instanceof O))throw new TypeError("Cannot call a class as a function")}function b(M,O){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:M}function S(M,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);M.prototype=Object.create(O&&O.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(M,O):M.__proto__=O)}var k=(function(M){S(O,M);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(M){S(O,M),a(O,null,[{key:"register",value:function(){c.default.register(E,!0),c.default.register(k,!0)}}]);function O(R,j){x(this,O);var D=b(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,R,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 L=null;return D.quill.on(c.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(L),L=setTimeout(function(){D.highlight(),L=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(L){L.highlight(j.options.highlight)}),this.quill.update(c.default.sources.SILENT),D!=null&&this.quill.setSelection(D,c.default.sources.SILENT)}}}]),O})(m.default);A.DEFAULTS={highlight:(function(){return window.hljs==null?null:function(M){var O=window.hljs.highlightAuto(M);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(R,j,D){R===null&&(R=Function.prototype);var L=Object.getOwnPropertyDescriptor(R,j);if(L===void 0){var T=Object.getPrototypeOf(R);return T===null?void 0:O(T,j,D)}else{if("value"in L)return L.value;var $=L.get;return $===void 0?void 0:$.call(D)}},o=(function(){function O(R,j){for(var D=0;D<j.length;D++){var L=j[D];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(R,L.key,L)}}return function(R,j,D){return j&&O(R.prototype,j),D&&O(R,D),R}})(),s=i(3),u=x(s),h=i(8),c=x(h),p=i(43),m=x(p),d=i(15),y=i(41),w=x(y);function x(O){return O&&O.__esModule?O:{default:O}}function b(O,R){if(!(O instanceof R))throw new TypeError("Cannot call a class as a function")}function S(O,R){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:O}function k(O,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);O.prototype=Object.create(R&&R.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(O,R):O.__proto__=R)}var E=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],A=(function(O){k(R,O);function R(j,D){b(this,R),D.modules.toolbar!=null&&D.modules.toolbar.container==null&&(D.modules.toolbar.container=E);var L=S(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,j,D));return L.quill.container.classList.add("ql-bubble"),L}return o(R,[{key:"extendToolbar",value:function(D){this.tooltip=new M(this.quill,this.options.bounds),this.tooltip.root.appendChild(D.container),this.buildButtons([].slice.call(D.container.querySelectorAll("button")),w.default),this.buildPickers([].slice.call(D.container.querySelectorAll("select")),w.default)}}]),R})(m.default);A.DEFAULTS=(0,u.default)(!0,{},m.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(R){R?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var M=(function(O){k(R,O);function R(j,D){b(this,R);var L=S(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,j,D));return L.quill.on(c.default.events.EDITOR_CHANGE,function(T,$,U,te){if(T===c.default.events.SELECTION_CHANGE)if($!=null&&$.length>0&&te===c.default.sources.USER){L.show(),L.root.style.left="0px",L.root.style.width="",L.root.style.width=L.root.offsetWidth+"px";var se=L.quill.getLines($.index,$.length);if(se.length===1)L.position(L.quill.getBounds($));else{var ee=se[se.length-1],Q=L.quill.getIndex(ee),re=Math.min(ee.length()-1,$.index+$.length-Q),X=L.quill.getBounds(new d.Range(Q,re));L.position(X)}}else document.activeElement!==L.textbox&&L.quill.hasFocus()&&L.hide()}),L}return o(R,[{key:"listen",value:function(){var D=this;a(R.prototype.__proto__||Object.getPrototypeOf(R.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 L=D.quill.getSelection();L!=null&&D.position(D.quill.getBounds(L))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(D){var L=a(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"position",this).call(this,D),T=this.root.querySelector(".ql-tooltip-arrow");if(T.style.marginLeft="",L===0)return L;T.style.marginLeft=-1*L-T.offsetWidth/2+"px"}}]),R})(p.BaseTooltip);M.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=M,r.default=A}),(function(n,r,i){n.exports=i(63)})]).default})})(i0)),i0.exports}var ML=RL();const Hx=yh(ML);var a0={exports:{}},Kf={},ap={exports:{}};var IL=ap.exports,a3;function jL(){return a3||(a3=1,(function(e,t){(function(n){var r=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,a=typeof p0=="object"&&p0;(a.global===a||a.window===a||a.self===a)&&(n=a);var o,s=2147483647,u=36,h=1,c=26,p=38,m=700,d=72,y=128,w="-",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,M=String.fromCharCode,O;function R(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 L(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 T(X){return j(X,function(B){var F="";return B>65535&&(B-=65536,F+=M(B>>>10&1023|55296),B=56320|B&1023),F+=M(B),F}).join("")}function $(X){return X-48<10?X-22:X-65<26?X-65:X-97<26?X-97:u}function U(X,B){return X+22+75*(X<26)-((B!=0)<<5)}function te(X,B,F){var z=0;for(X=F?A(X/m):X>>1,X+=A(X/B);X>E*c>>1;z+=u)X=A(X/E);return A(z+(E+1)*X/(X+p))}function se(X){var B=[],F=X.length,z,Y=0,J=y,K=d,ie,fe,ue,we,Ce,Ue,ze,tt,ge;for(ie=X.lastIndexOf(w),ie<0&&(ie=0),fe=0;fe<ie;++fe)X.charCodeAt(fe)>=128&&R("not-basic"),B.push(X.charCodeAt(fe));for(ue=ie>0?ie+1:0;ue<F;){for(we=Y,Ce=1,Ue=u;ue>=F&&R("invalid-input"),ze=$(X.charCodeAt(ue++)),(ze>=u||ze>A((s-Y)/Ce))&&R("overflow"),Y+=ze*Ce,tt=Ue<=K?h:Ue>=K+c?c:Ue-K,!(ze<tt);Ue+=u)ge=u-tt,Ce>A(s/ge)&&R("overflow"),Ce*=ge;z=B.length+1,K=te(Y-we,z,we==0),A(Y/z)>s-J&&R("overflow"),J+=A(Y/z),Y%=z,B.splice(Y++,0,J)}return T(B)}function ee(X){var B,F,z,Y,J,K,ie,fe,ue,we,Ce,Ue=[],ze,tt,ge,ut;for(X=L(X),ze=X.length,B=y,F=0,J=d,K=0;K<ze;++K)Ce=X[K],Ce<128&&Ue.push(M(Ce));for(z=Y=Ue.length,Y&&Ue.push(w);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)&&R("overflow"),F+=(ie-B)*tt,B=ie,K=0;K<ze;++K)if(Ce=X[K],Ce<B&&++F>s&&R("overflow"),Ce==B){for(fe=F,ue=u;we=ue<=J?h:ue>=J+c?c:ue-J,!(fe<we);ue+=u)ut=fe-we,ge=u-we,Ue.push(M(U(we+ut%ge,0))),fe=A(ut/ge);Ue.push(M(U(fe,0))),J=te(F,tt,z==Y),F=0,++z}++F,++B}return Ue.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:L,encode:T},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})(IL)})(ap,ap.exports)),ap.exports}var v2,o3;function Pd(){return o3||(o3=1,v2=TypeError),v2}const DL={},FL=Object.freeze(Object.defineProperty({__proto__:null,default:DL},Symbol.toStringTag,{value:"Module"})),BL=Q_(FL);var y2,s3;function ng(){if(s3)return y2;s3=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,p=c?WeakSet.prototype.has:null,m=typeof WeakRef=="function"&&WeakRef.prototype,d=m?WeakRef.prototype.deref:null,y=Boolean.prototype.valueOf,w=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,M=RegExp.prototype.test,O=Array.prototype.concat,R=Array.prototype.join,j=Array.prototype.slice,D=Math.floor,L=typeof BigInt=="function"?BigInt.prototype.valueOf:null,T=Object.getOwnPropertySymbols,$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,U=typeof Symbol=="function"&&typeof Symbol.iterator=="object",te=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===U||!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||M.call(/e/,Be))return Be;var Wt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof We=="number"){var Et=We<0?-D(-We):D(We);if(Et!==We){var Nt=String(Et),Tt=S.call(Be,Nt.length+1);return k.call(Nt,Wt,"$&_")+"."+k.call(k.call(Tt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return k.call(Be,Wt,"$&_")}var re=BL,X=re.custom,B=tt(X)?X:null,F={__proto__:null,double:'"',single:"'"},z={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};y2=function We(Be,Wt,Et,Nt){var Tt=Wt||{};if(ke(Tt,"quoteStyle")&&!ke(F,Tt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ke(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 on=ke(Tt,"customInspect")?Tt.customInspect:!0;if(typeof on!="boolean"&&on!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ke(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(ke(Tt,"numericSeparator")&&typeof Tt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Ht=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 Je(Be,Tt);if(typeof Be=="number"){if(Be===0)return 1/0/Be>0?"0":"-0";var hn=String(Be);return Ht?Q(Be,hn):hn}if(typeof Be=="bigint"){var ui=String(Be)+"n";return Ht?Q(Be,ui):ui}var Ur=typeof Tt.depth>"u"?5:Tt.depth;if(typeof Et>"u"&&(Et=0),Et>=Ur&&Ur>0&&typeof Be=="object")return ie(Be)?"[Array]":"[Object]";var hr=rn(Tt,Et);if(typeof Nt>"u")Nt=[];else if(Le(Nt,Be)>=0)return"[Circular]";function dr(qi,ao,Fs){if(ao&&(Nt=j.call(Nt),Nt.push(ao)),Fs){var as={depth:Tt.depth};return ke(Tt,"quoteStyle")&&(as.quoteStyle=Tt.quoteStyle),We(qi,as,Et+1,Nt)}return We(qi,Tt,Et+1,Nt)}if(typeof Be=="function"&&!ue(Be)){var Qt=be(Be),zi=an(Be,dr);return"[Function"+(Qt?": "+Qt:" (anonymous)")+"]"+(zi.length>0?" { "+R.call(zi,", ")+" }":"")}if(tt(Be)){var Fa=U?k.call(String(Be),/^(Symbol\(.*\))_[^)]*$/,"$1"):$.call(Be);return typeof Be=="object"&&!U?st(Fa):Fa}if(Te(Be)){for(var ti="<"+A.call(String(Be.nodeName)),Zi=Be.attributes||[],$n=0;$n<Zi.length;$n++)ti+=" "+Zi[$n].name+"="+Y(J(Zi[$n].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 hr&&!Ct(Or)?"["+Zt(Or,hr)+"]":"[ "+R.call(Or,", ")+" ]"}if(we(Be)){var Dr=an(Be,dr);return!("cause"in Error.prototype)&&"cause"in Be&&!se.call(Be,"cause")?"{ ["+String(Be)+"] "+R.call(O.call("[cause]: "+dr(Be.cause),Dr),", ")+" }":Dr.length===0?"["+String(Be)+"]":"{ ["+String(Be)+"] "+R.call(Dr,", ")+" }"}if(typeof Be=="object"&&on){if(B&&typeof Be[B]=="function"&&re)return re(Be,{depth:Ur-Et});if(on!=="symbol"&&typeof Be.inspect=="function")return Be.inspect()}if(Me(Be)){var Ea=[];return r&&r.call(Be,function(qi,ao){Ea.push(dr(ao,Be,!0)+" => "+dr(qi,Be))}),ct("Map",n.call(Be),Ea,hr)}if(xe(Be)){var Go=[];return s&&s.call(Be,function(qi){Go.push(dr(qi,Be))}),ct("Set",o.call(Be),Go,hr)}if(ve(Be))return at("WeakMap");if(Ie(Be))return at("WeakSet");if(ye(Be))return at("WeakRef");if(Ue(Be))return st(dr(Number(Be)));if(ge(Be))return st(dr(L.call(Be)));if(ze(Be))return st(y.call(Be));if(Ce(Be))return st(dr(String(Be)));if(typeof window<"u"&&Be===window)return"{ [object Window] }";if(typeof globalThis<"u"&&Be===globalThis||typeof p0<"u"&&Be===p0)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,ci=Be instanceof Object?"":"null prototype",Aa=!io&&te&&Object(Be)===Be&&te in Be?S.call(he(Be),8,-1):ci?"Object":"",Pa=io||typeof Be.constructor!="function"?"":Be.constructor.name?Be.constructor.name+" ":"",Wo=Pa+(Aa||ci?"["+R.call(O.call([],Aa||[],ci||[]),": ")+"] ":"");return ka.length===0?Wo+"{}":hr?Wo+"{"+Zt(ka,hr)+"}":Wo+"{ "+R.call(ka,", ")+" }"}return String(Be)};function Y(We,Be,Wt){var Et=Wt.quoteStyle||Be,Nt=F[Et];return Nt+We+Nt}function J(We){return k.call(String(We),/"/g,"&quot;")}function K(We){return!te||!(typeof We=="object"&&(te in We||typeof We[te]<"u"))}function ie(We){return he(We)==="[object Array]"&&K(We)}function fe(We){return he(We)==="[object Date]"&&K(We)}function ue(We){return he(We)==="[object RegExp]"&&K(We)}function we(We){return he(We)==="[object Error]"&&K(We)}function Ce(We){return he(We)==="[object String]"&&K(We)}function Ue(We){return he(We)==="[object Number]"&&K(We)}function ze(We){return he(We)==="[object Boolean]"&&K(We)}function tt(We){if(U)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 ge(We){if(!We||typeof We!="object"||!L)return!1;try{return L.call(We),!0}catch{}return!1}var ut=Object.prototype.hasOwnProperty||function(We){return We in this};function ke(We,Be){return ut.call(We,Be)}function he(We){return w.call(We)}function be(We){if(We.name)return We.name;var Be=b.call(x.call(We),/^function\s*([\w$]+)/);return Be?Be[1]:null}function Le(We,Be){if(We.indexOf)return We.indexOf(Be);for(var Wt=0,Et=We.length;Wt<Et;Wt++)if(We[Wt]===Be)return Wt;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{p.call(We,p)}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 xe(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 Ie(We){if(!p||!We||typeof We!="object")return!1;try{p.call(We,p);try{h.call(We,h)}catch{return!0}return We instanceof WeakSet}catch{}return!1}function Te(We){return!We||typeof We!="object"?!1:typeof HTMLElement<"u"&&We instanceof HTMLElement?!0:typeof We.nodeName=="string"&&typeof We.getAttribute=="function"}function Je(We,Be){if(We.length>Be.maxStringLength){var Wt=We.length-Be.maxStringLength,Et="... "+Wt+" more character"+(Wt>1?"s":"");return Je(S.call(We,0,Be.maxStringLength),Be)+Et}var Nt=z[Be.quoteStyle||"single"];Nt.lastIndex=0;var Tt=k.call(k.call(We,Nt,"\\$1"),/[\x00-\x1f]/g,nt);return Y(Tt,"single",Be)}function nt(We){var Be=We.charCodeAt(0),Wt={8:"b",9:"t",10:"n",12:"f",13:"r"}[Be];return Wt?"\\"+Wt:"\\x"+(Be<16?"0":"")+E.call(Be.toString(16))}function st(We){return"Object("+We+")"}function at(We){return We+" { ? }"}function ct(We,Be,Wt,Et){var Nt=Et?Zt(Wt,Et):R.call(Wt,", ");return We+" ("+Be+") {"+Nt+"}"}function Ct(We){for(var Be=0;Be<We.length;Be++)if(Le(We[Be],`
141
- `)>=0)return!1;return!0}function rn(We,Be){var Wt;if(We.indent===" ")Wt=" ";else if(typeof We.indent=="number"&&We.indent>0)Wt=R.call(Array(We.indent+1)," ");else return null;return{base:Wt,prev:R.call(Array(Be+1),Wt)}}function Zt(We,Be){if(We.length===0)return"";var Wt=`
142
- `+Be.prev+Be.base;return Wt+R.call(We,","+Wt)+`
143
- `+Be.prev}function an(We,Be){var Wt=ie(We),Et=[];if(Wt){Et.length=We.length;for(var Nt=0;Nt<We.length;Nt++)Et[Nt]=ke(We,Nt)?Be(We[Nt],We):""}var Tt=typeof T=="function"?T(We):[],on;if(U){on={};for(var Ht=0;Ht<Tt.length;Ht++)on["$"+Tt[Ht]]=Tt[Ht]}for(var hn in We)ke(We,hn)&&(Wt&&String(Number(hn))===hn&&hn<We.length||U&&on["$"+hn]instanceof Symbol||(M.call(/[^\w$]/,hn)?Et.push(Be(hn,We)+": "+Be(We[hn],We)):Et.push(hn+": "+Be(We[hn],We))));if(typeof T=="function")for(var ui=0;ui<Tt.length;ui++)se.call(We,Tt[ui])&&Et.push("["+Be(Tt[ui])+"]: "+Be(We[Tt[ui]],We));return Et}return y2}var b2,l3;function zL(){if(l3)return b2;l3=1;var e=ng(),t=Pd(),n=function(s,u,h){for(var c=s,p;(p=c.next)!=null;c=p)if(p.key===u)return c.next=p.next,h||(p.next=s.next,s.next=p),p},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 b2=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 p=u&&u.next,m=o(u,c);return m&&p&&p===m&&(u=void 0),!!m},get:function(c){return r(u,c)},has:function(c){return a(u,c)},set:function(c,p){u||(u={next:void 0}),i(u,c,p)}};return h},b2}var w2,u3;function $x(){return u3||(u3=1,w2=Object),w2}var x2,c3;function qL(){return c3||(c3=1,x2=Error),x2}var _2,f3;function UL(){return f3||(f3=1,_2=EvalError),_2}var S2,h3;function HL(){return h3||(h3=1,S2=RangeError),S2}var E2,d3;function $L(){return d3||(d3=1,E2=ReferenceError),E2}var k2,p3;function GL(){return p3||(p3=1,k2=SyntaxError),k2}var A2,g3;function WL(){return g3||(g3=1,A2=URIError),A2}var P2,m3;function VL(){return m3||(m3=1,P2=Math.abs),P2}var O2,v3;function YL(){return v3||(v3=1,O2=Math.floor),O2}var C2,y3;function XL(){return y3||(y3=1,C2=Math.max),C2}var L2,b3;function KL(){return b3||(b3=1,L2=Math.min),L2}var N2,w3;function ZL(){return w3||(w3=1,N2=Math.pow),N2}var T2,x3;function QL(){return x3||(x3=1,T2=Math.round),T2}var R2,_3;function JL(){return _3||(_3=1,R2=Number.isNaN||function(t){return t!==t}),R2}var M2,S3;function eN(){if(S3)return M2;S3=1;var e=JL();return M2=function(n){return e(n)||n===0?n:n<0?-1:1},M2}var I2,E3;function tN(){return E3||(E3=1,I2=Object.getOwnPropertyDescriptor),I2}var j2,k3;function Gx(){if(k3)return j2;k3=1;var e=tN();if(e)try{e([],"length")}catch{e=null}return j2=e,j2}var D2,A3;function nN(){if(A3)return D2;A3=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return D2=e,D2}var F2,P3;function rN(){return P3||(P3=1,F2=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}),F2}var B2,O3;function iN(){if(O3)return B2;O3=1;var e=typeof Symbol<"u"&&Symbol,t=rN();return B2=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},B2}var z2,C3;function Wx(){return C3||(C3=1,z2=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),z2}var q2,L3;function Vx(){if(L3)return q2;L3=1;var e=$x();return q2=e.getPrototypeOf||null,q2}var U2,N3;function aN(){if(N3)return U2;N3=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=[],p=0;p<u.length;p+=1)c[p]=u[p];for(var m=0;m<h.length;m+=1)c[m+u.length]=h[m];return c},a=function(u,h){for(var c=[],p=h,m=0;p<u.length;p+=1,m+=1)c[m]=u[p];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),p,m=function(){if(this instanceof p){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=[],w=0;w<d;w++)y[w]="$"+w;if(p=Function("binder","return function ("+o(y,",")+"){ return binder.apply(this,arguments); }")(m),h.prototype){var x=function(){};x.prototype=h.prototype,p.prototype=new x,x.prototype=null}return p},U2}var H2,T3;function rg(){if(T3)return H2;T3=1;var e=aN();return H2=Function.prototype.bind||e,H2}var $2,R3;function by(){return R3||(R3=1,$2=Function.prototype.call),$2}var G2,M3;function Yx(){return M3||(M3=1,G2=Function.prototype.apply),G2}var W2,I3;function oN(){return I3||(I3=1,W2=typeof Reflect<"u"&&Reflect&&Reflect.apply),W2}var V2,j3;function sN(){if(j3)return V2;j3=1;var e=rg(),t=Yx(),n=by(),r=oN();return V2=r||e.call(n,t),V2}var Y2,D3;function Xx(){if(D3)return Y2;D3=1;var e=rg(),t=Pd(),n=by(),r=sN();return Y2=function(a){if(a.length<1||typeof a[0]!="function")throw new t("a function is required");return r(e,n,a)},Y2}var X2,F3;function lN(){if(F3)return X2;F3=1;var e=Xx(),t=Gx(),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 X2=r&&typeof r.get=="function"?e([r.get]):typeof a=="function"?function(s){return a(s==null?s:i(s))}:!1,X2}var K2,B3;function uN(){if(B3)return K2;B3=1;var e=Wx(),t=Vx(),n=lN();return K2=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,K2}var Z2,z3;function cN(){if(z3)return Z2;z3=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,n=rg();return Z2=n.call(e,t),Z2}var Q2,q3;function wy(){if(q3)return Q2;q3=1;var e,t=$x(),n=qL(),r=UL(),i=HL(),a=$L(),o=GL(),s=Pd(),u=WL(),h=VL(),c=YL(),p=XL(),m=KL(),d=ZL(),y=QL(),w=eN(),x=Function,b=function(ue){try{return x('"use strict"; return ('+ue+").constructor;")()}catch{}},S=Gx(),k=nN(),E=function(){throw new s},A=S?(function(){try{return arguments.callee,E}catch{try{return S(arguments,"callee").get}catch{return E}}})():E,M=iN()(),O=uN(),R=Vx(),j=Wx(),D=Yx(),L=by(),T={},$=typeof Uint8Array>"u"||!O?e:O(Uint8Array),U={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":M&&O?O([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":T,"%AsyncGenerator%":T,"%AsyncGeneratorFunction%":T,"%AsyncIteratorPrototype%":T,"%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%":T,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&O?O(O([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!M||!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"||!M||!O?e:O(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&O?O(""[Symbol.iterator]()):e,"%Symbol%":M?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%":L,"%Function.prototype.apply%":D,"%Object.defineProperty%":k,"%Object.getPrototypeOf%":R,"%Math.abs%":h,"%Math.floor%":c,"%Math.max%":p,"%Math.min%":m,"%Math.pow%":d,"%Math.round%":y,"%Math.sign%":w,"%Reflect.getPrototypeOf%":j};if(O)try{null.error}catch(ue){var te=O(O(ue));U["%Error.prototype%"]=te}var se=function ue(we){var Ce;if(we==="%AsyncFunction%")Ce=b("async function () {}");else if(we==="%GeneratorFunction%")Ce=b("function* () {}");else if(we==="%AsyncGeneratorFunction%")Ce=b("async function* () {}");else if(we==="%AsyncGenerator%"){var Ue=ue("%AsyncGeneratorFunction%");Ue&&(Ce=Ue.prototype)}else if(we==="%AsyncIteratorPrototype%"){var ze=ue("%AsyncGenerator%");ze&&O&&(Ce=O(ze.prototype))}return U[we]=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=rg(),re=cN(),X=Q.call(L,Array.prototype.concat),B=Q.call(D,Array.prototype.splice),F=Q.call(L,String.prototype.replace),z=Q.call(L,String.prototype.slice),Y=Q.call(L,RegExp.prototype.exec),J=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,K=/\\(\\)?/g,ie=function(we){var Ce=z(we,0,1),Ue=z(we,-1);if(Ce==="%"&&Ue!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(Ue==="%"&&Ce!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var ze=[];return F(we,J,function(tt,ge,ut,ke){ze[ze.length]=ut?F(ke,K,"$1"):ge||tt}),ze},fe=function(we,Ce){var Ue=we,ze;if(re(ee,Ue)&&(ze=ee[Ue],Ue="%"+ze[0]+"%"),re(U,Ue)){var tt=U[Ue];if(tt===T&&(tt=se(Ue)),typeof tt>"u"&&!Ce)throw new s("intrinsic "+we+" exists, but is not available. Please file an issue!");return{alias:ze,name:Ue,value:tt}}throw new o("intrinsic "+we+" does not exist!")};return Q2=function(we,Ce){if(typeof we!="string"||we.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(/^%?[^%]*%?$/,we)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Ue=ie(we),ze=Ue.length>0?Ue[0]:"",tt=fe("%"+ze+"%",Ce),ge=tt.name,ut=tt.value,ke=!1,he=tt.alias;he&&(ze=he[0],B(Ue,X([0,1],he)));for(var be=1,Le=!0;be<Ue.length;be+=1){var Me=Ue[be],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"||!Le)&&(ke=!0),ze+="."+Me,ge="%"+ze+"%",re(U,ge))ut=U[ge];else if(ut!=null){if(!(Me in ut)){if(!Ce)throw new s("base intrinsic for "+we+" exists, but the property is not available.");return}if(S&&be+1>=Ue.length){var xe=S(ut,Me);Le=!!xe,Le&&"get"in xe&&!("originalValue"in xe.get)?ut=xe.get:ut=ut[Me]}else Le=re(ut,Me),ut=ut[Me];Le&&!ke&&(U[ge]=ut)}}return ut},Q2}var J2,U3;function Kx(){if(U3)return J2;U3=1;var e=wy(),t=Xx(),n=t([e("%String.prototype.indexOf%")]);return J2=function(i,a){var o=e(i,!!a);return typeof o=="function"&&n(i,".prototype.")>-1?t([o]):o},J2}var em,H3;function Zx(){if(H3)return em;H3=1;var e=wy(),t=Kx(),n=ng(),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 em=!!i&&function(){var p,m={assert:function(d){if(!m.has(d))throw new r("Side channel does not contain "+n(d))},delete:function(d){if(p){var y=u(p,d);return h(p)===0&&(p=void 0),y}return!1},get:function(d){if(p)return a(p,d)},has:function(d){return p?s(p,d):!1},set:function(d,y){p||(p=new i),o(p,d,y)}};return m},em}var tm,$3;function fN(){if($3)return tm;$3=1;var e=wy(),t=Kx(),n=ng(),r=Zx(),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 tm=a?function(){var p,m,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(p)return h(p,y)}else if(r&&m)return m.delete(y);return!1},get:function(y){return a&&y&&(typeof y=="object"||typeof y=="function")&&p?o(p,y):m&&m.get(y)},has:function(y){return a&&y&&(typeof y=="object"||typeof y=="function")&&p?u(p,y):!!m&&m.has(y)},set:function(y,w){a&&y&&(typeof y=="object"||typeof y=="function")?(p||(p=new a),s(p,y,w)):r&&(m||(m=r()),m.set(y,w))}};return d}:r,tm}var nm,G3;function hN(){if(G3)return nm;G3=1;var e=Pd(),t=ng(),n=zL(),r=Zx(),i=fN(),a=i||r||n;return nm=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},nm}var rm,W3;function xy(){if(W3)return rm;W3=1;var e=String.prototype.replace,t=/%20/g,n={RFC1738:"RFC1738",RFC3986:"RFC3986"};return rm={default:n.RFC3986,formatters:{RFC1738:function(r){return e.call(r,t,"+")},RFC3986:function(r){return String(r)}},RFC1738:n.RFC1738,RFC3986:n.RFC3986},rm}var im,V3;function Qx(){if(V3)return im;V3=1;var e=xy(),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,M){if(t.call(b,M)){var O=b[M];O&&typeof O=="object"&&A&&typeof A=="object"?b[M]=x(O,A,k):b.push(A)}else b[M]=A}),b):Object.keys(S).reduce(function(A,M){var O=S[M];return t.call(A,M)?A[M]=x(A[M],O,k):A[M]=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 M=b;if(typeof b=="symbol"?M=Symbol.prototype.toString.call(b):typeof b!="string"&&(M=String(b)),k==="iso-8859-1")return escape(M).replace(/%u[0-9a-f]{4}/gi,function($){return"%26%23"+parseInt($.slice(2),16)+"%3B"});for(var O="",R=0;R<M.length;R+=h){for(var j=M.length>=h?M.slice(R,R+h):M,D=[],L=0;L<j.length;++L){var T=j.charCodeAt(L);if(T===45||T===46||T===95||T===126||T>=48&&T<=57||T>=65&&T<=90||T>=97&&T<=122||A===e.RFC1738&&(T===40||T===41)){D[D.length]=j.charAt(L);continue}if(T<128){D[D.length]=r[T];continue}if(T<2048){D[D.length]=r[192|T>>6]+r[128|T&63];continue}if(T<55296||T>=57344){D[D.length]=r[224|T>>12]+r[128|T>>6&63]+r[128|T&63];continue}L+=1,T=65536+((T&1023)<<10|j.charCodeAt(L)&1023),D[D.length]=r[240|T>>18]+r[128|T>>12&63]+r[128|T>>6&63]+r[128|T&63]}O+=D.join("")}return O},p=function(b){for(var S=[{obj:{o:b},prop:"o"}],k=[],E=0;E<S.length;++E)for(var A=S[E],M=A.obj[A.prop],O=Object.keys(M),R=0;R<O.length;++R){var j=O[R],D=M[j];typeof D=="object"&&D!==null&&k.indexOf(D)===-1&&(S.push({obj:M,prop:j}),k.push(D))}return i(S),b},m=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)},w=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 im={arrayToObject:a,assign:s,combine:y,compact:p,decode:u,encode:c,isBuffer:d,isRegExp:m,maybeMap:w,merge:o},im}var am,Y3;function dN(){if(Y3)return am;Y3=1;var e=hN(),t=Qx(),n=xy(),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(w,x){o.apply(w,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},p=function(x){return typeof x=="string"||typeof x=="number"||typeof x=="boolean"||typeof x=="symbol"||typeof x=="bigint"},m={},d=function w(x,b,S,k,E,A,M,O,R,j,D,L,T,$,U,te,se,ee){for(var Q=x,re=ee,X=0,B=!1;(re=re.get(m))!==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(m)>"u"&&(X=0)}if(typeof j=="function"?Q=j(b,Q):Q instanceof Date?Q=T(Q):S==="comma"&&a(Q)&&(Q=t.maybeMap(Q,function(ge){return ge instanceof Date?T(ge):ge})),Q===null){if(A)return R&&!te?R(b,c.encoder,se,"key",$):b;Q=""}if(p(Q)||t.isBuffer(Q)){if(R){var z=te?b:R(b,c.encoder,se,"key",$);return[U(z)+"="+U(R(Q,c.encoder,se,"value",$))]}return[U(b)+"="+U(String(Q))]}var Y=[];if(typeof Q>"u")return Y;var J;if(S==="comma"&&a(Q))te&&R&&(Q=t.maybeMap(Q,R)),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 we=J[ue],Ce=typeof we=="object"&&we&&typeof we.value<"u"?we.value:Q[we];if(!(M&&Ce===null)){var Ue=L&&O?String(we).replace(/\./g,"%2E"):String(we),ze=a(Q)?typeof S=="function"?S(fe,Ue):fe:fe+(L?"."+Ue:"["+Ue+"]");ee.set(x,X);var tt=e();tt.set(m,ee),s(Y,w(Ce,ze,S,k,E,A,M,O,S==="comma"&&te&&a(Q)?null:R,j,D,L,T,$,U,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 M=typeof x.allowDots>"u"?x.encodeDotInKeys===!0?!0:c.allowDots:!!x.allowDots;return{addQueryPrefix:typeof x.addQueryPrefix=="boolean"?x.addQueryPrefix:c.addQueryPrefix,allowDots:M,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 am=function(w,x){var b=w,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 M=i[S.arrayFormat],O=M==="comma"&&S.commaRoundTrip;k||(k=Object.keys(b)),S.sort&&k.sort(S.sort);for(var R=e(),j=0;j<k.length;++j){var D=k[j],L=b[D];S.skipNulls&&L===null||s(A,d(L,D,M,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,R))}var T=A.join(S.delimiter),$=S.addQueryPrefix===!0?"?":"";return S.charsetSentinel&&(S.charset==="iso-8859-1"?$+="utf8=%26%2310003%3B&":$+="utf8=%E2%9C%93&"),T.length>0?$+T:""},am}var om,X3;function pN(){if(X3)return om;X3=1;var e=Qx(),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(m){return m.replace(/&#(\d+);/g,function(d,y){return String.fromCharCode(parseInt(y,10))})},a=function(m,d,y){if(m&&typeof m=="string"&&d.comma&&m.indexOf(",")>-1)return m.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 m},o="utf8=%26%2310003%3B",s="utf8=%E2%9C%93",u=function(d,y){var w={__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 M=S[E],O=M.indexOf("]="),R=O===-1?M.indexOf("="):O+1,j,D;R===-1?(j=y.decoder(M,r.decoder,A,"key"),D=y.strictNullHandling?null:""):(j=y.decoder(M.slice(0,R),r.decoder,A,"key"),D=e.maybeMap(a(M.slice(R+1),y,n(w[j])?w[j].length:0),function(T){return y.decoder(T,r.decoder,A,"value")})),D&&y.interpretNumericEntities&&A==="iso-8859-1"&&(D=i(String(D))),M.indexOf("[]=")>-1&&(D=n(D)?[D]:D);var L=t.call(w,j);L&&y.duplicates==="combine"?w[j]=e.combine(w[j],D):(!L||y.duplicates==="last")&&(w[j]=D)}return w},h=function(m,d,y,w){var x=0;if(m.length>0&&m[m.length-1]==="[]"){var b=m.slice(0,-1).join("");x=Array.isArray(d)&&d[b]?d[b].length:0}for(var S=w?d:a(d,y,x),k=m.length-1;k>=0;--k){var E,A=m[k];if(A==="[]"&&y.parseArrays)E=y.allowEmptyArrays&&(S===""||y.strictNullHandling&&S===null)?[]:e.combine([],S);else{E=y.plainObjects?{__proto__:null}:{};var M=A.charAt(0)==="["&&A.charAt(A.length-1)==="]"?A.slice(1,-1):A,O=y.decodeDotInKeys?M.replace(/%2E/g,"."):M,R=parseInt(O,10);!y.parseArrays&&O===""?E={0:S}:!isNaN(R)&&A!==O&&String(R)===O&&R>=0&&y.parseArrays&&R<=y.arrayLimit?(E=[],E[R]=S):O!=="__proto__"&&(E[O]=S)}S=E}return S},c=function(d,y,w,x){if(d){var b=w.allowDots?d.replace(/\.([^.[]+)/g,"[$1]"):d,S=/(\[[^[\]]*])/,k=/(\[[^[\]]*])/g,E=w.depth>0&&S.exec(b),A=E?b.slice(0,E.index):b,M=[];if(A){if(!w.plainObjects&&t.call(Object.prototype,A)&&!w.allowPrototypes)return;M.push(A)}for(var O=0;w.depth>0&&(E=k.exec(b))!==null&&O<w.depth;){if(O+=1,!w.plainObjects&&t.call(Object.prototype,E[1].slice(1,-1))&&!w.allowPrototypes)return;M.push(E[1])}if(E){if(w.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+w.depth+" and strictDepth is true");M.push("["+b.slice(E.index)+"]")}return h(M,y,w,x)}},p=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,w=typeof d.duplicates>"u"?r.duplicates:d.duplicates;if(w!=="combine"&&w!=="first"&&w!=="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:w,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 om=function(m,d){var y=p(d);if(m===""||m===null||typeof m>"u")return y.plainObjects?{__proto__:null}:{};for(var w=typeof m=="string"?u(m,y):m,x=y.plainObjects?{__proto__:null}:{},b=Object.keys(w),S=0;S<b.length;++S){var k=b[S],E=c(k,w[k],y,typeof m=="string");x=e.merge(x,E,y)}return y.allowSparse===!0?x:e.compact(x)},om}var sm,K3;function gN(){if(K3)return sm;K3=1;var e=dN(),t=pN(),n=xy();return sm={formats:n,parse:t,stringify:e},sm}var Z3;function Jx(){if(Z3)return Kf;Z3=1;var e=jL();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,p=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,d={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},x=gN();function b(A,M,O){if(A&&typeof A=="object"&&A instanceof t)return A;var R=new t;return R.parse(A,M,O),R}t.prototype.parse=function(A,M,O){if(typeof A!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof A);var R=A.indexOf("?"),j=R!==-1&&R<A.indexOf("#")?"?":"#",D=A.split(j),L=/\\/g;D[0]=D[0].replace(L,"/"),A=D.join(j);var T=A;if(T=T.trim(),!O&&A.split("#").length===1){var $=i.exec(T);if($)return this.path=T,this.href=T,this.pathname=$[1],$[2]?(this.search=$[2],M?this.query=x.parse(this.search.substr(1)):this.query=this.search.substr(1)):M&&(this.search="",this.query={}),this}var U=n.exec(T);if(U){U=U[0];var te=U.toLowerCase();this.protocol=te,T=T.substr(U.length)}if(O||U||T.match(/^\/\/[^@/]+@[^@/]+/)){var se=T.substr(0,2)==="//";se&&!(U&&y[U])&&(T=T.substr(2),this.slashes=!0)}if(!y[U]&&(se||U&&!w[U])){for(var ee=-1,Q=0;Q<h.length;Q++){var re=T.indexOf(h[Q]);re!==-1&&(ee===-1||re<ee)&&(ee=re)}var X,B;ee===-1?B=T.lastIndexOf("@"):B=T.lastIndexOf("@",ee),B!==-1&&(X=T.slice(0,B),T=T.slice(B+1),this.auth=decodeURIComponent(X)),ee=-1;for(var Q=0;Q<u.length;Q++){var re=T.indexOf(u[Q]);re!==-1&&(ee===-1||re<ee)&&(ee=re)}ee===-1&&(ee=T.length),this.host=T.slice(0,ee),T=T.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(p)){for(var K="",ie=0,fe=J.length;ie<fe;ie++)J.charCodeAt(ie)>127?K+="x":K+=J[ie];if(!K.match(p)){var ue=z.slice(0,Q),we=z.slice(Q+1),Ce=J.match(m);Ce&&(ue.push(Ce[1]),we.unshift(Ce[2])),we.length&&(T="/"+we.join(".")+T),this.hostname=ue.join(".");break}}}this.hostname.length>c?this.hostname="":this.hostname=this.hostname.toLowerCase(),F||(this.hostname=e.toASCII(this.hostname));var Ue=this.port?":"+this.port:"",ze=this.hostname||"";this.host=ze+Ue,this.href+=this.host,F&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),T[0]!=="/"&&(T="/"+T))}if(!d[te])for(var Q=0,Y=s.length;Q<Y;Q++){var tt=s[Q];if(T.indexOf(tt)!==-1){var ge=encodeURIComponent(tt);ge===tt&&(ge=escape(tt)),T=T.split(tt).join(ge)}}var ut=T.indexOf("#");ut!==-1&&(this.hash=T.substr(ut),T=T.slice(0,ut));var ke=T.indexOf("?");if(ke!==-1?(this.search=T.substr(ke),this.query=T.substr(ke+1),M&&(this.query=x.parse(this.query)),T=T.slice(0,ke)):M&&(this.search="",this.query={}),T&&(this.pathname=T),w[te]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var Ue=this.pathname||"",he=this.search||"";this.path=Ue+he}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 M=this.protocol||"",O=this.pathname||"",R=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 L=this.search||D&&"?"+D||"";return M&&M.substr(-1)!==":"&&(M+=":"),this.slashes||(!M||w[M])&&j!==!1?(j="//"+(j||""),O&&O.charAt(0)!=="/"&&(O="/"+O)):j||(j=""),R&&R.charAt(0)!=="#"&&(R="#"+R),L&&L.charAt(0)!=="?"&&(L="?"+L),O=O.replace(/[?#]/g,function(T){return encodeURIComponent(T)}),L=L.replace("#","%23"),M+j+O+L+R};function k(A,M){return b(A,!1,!0).resolve(M)}t.prototype.resolve=function(A){return this.resolveObject(b(A,!1,!0)).format()};function E(A,M){return A?b(A,!1,!0).resolveObject(M):M}return t.prototype.resolveObject=function(A){if(typeof A=="string"){var M=new t;M.parse(A,!1,!0),A=M}for(var O=new t,R=Object.keys(this),j=0;j<R.length;j++){var D=R[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 L=Object.keys(A),T=0;T<L.length;T++){var $=L[T];$!=="protocol"&&(O[$]=A[$])}return w[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(!w[A.protocol]){for(var U=Object.keys(A),te=0;te<U.length;te++){var se=U[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&&!w[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,we=z.length;we>=0;we--)ie=z[we],ie==="."?z.splice(we,1):ie===".."?(z.splice(we,1),ue++):ue&&(z.splice(we,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,M=r.exec(A);M&&(M=M[0],M!==":"&&(this.port=M.substr(1)),A=A.substr(0,A.length-M.length)),A&&(this.hostname=A)},Kf.parse=b,Kf.resolve=k,Kf.resolveObject=E,Kf.format=S,Kf.Url=t,Kf}var o0={exports:{}},mN=o0.exports,Q3;function vN(){return Q3||(Q3=1,(function(e){(function(t,n){e.exports?e.exports=n():t.xmlserializer=n()})(mN,function(){var t=function(d){return d.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},n=function(d){return d.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},r=function(d){return d.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},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 w=Array.prototype.map.call(d.attributes||d.attrs,function(x){return x.name}).indexOf("xmlns")>=0;return!w&&(y||d.namespaceURI!==d.parentNode.namespaceURI)?' xmlns="'+d.namespaceURI+'"':""},s=function(d){return Array.prototype.map.call(d.childNodes,function(y){return m(y)}).join("")},u=function(d,y){var w="<"+a(d);return w+=o(d,y),Array.prototype.forEach.call(d.attributes||d.attrs,function(x){w+=i(x)}),d.childNodes.length>0?(w+=">",w+=s(d),w+="</"+a(d)+">"):w+="/>",w},h=function(d){var y=d.nodeValue||d.value||"";return r(y)},c=function(d){return"<!--"+d.data.replace(/-/g,"&#45;")+"-->"},p=function(d){return"<![CDATA["+d.nodeValue+"]]>"},m=function(d,y){var w=y&&y.rootNode;if(d.nodeName==="#document"||d.nodeName==="#document-fragment")return s(d);if(d.tagName)return u(d,w);if(d.nodeName==="#text")return h(d);if(d.nodeName==="#comment")return c(d);if(d.nodeName==="#cdata-section")return p(d)};return{serializeToString:function(d){return t(m(d,{rootNode:!0}))}}})})(o0)),o0.exports}var lm={},J3;function yN(){if(J3)return lm;J3=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 lm.failOnParseError=function(a){return i(a),a},lm}var um={},cm={},e4;function ig(){return e4||(e4=1,(function(e){var t=Jx();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 p=new window.XMLHttpRequest,m=e.joinUrl(u.baseUrl,s),d,y=function(){c({msg:"Unable to load url",url:m})};d=r(m,u.cache),p.addEventListener("load",function(){p.status===200||p.status===0?h(p.response):y()},!1),p.addEventListener("error",y,!1);try{p.open("GET",d,!0),p.overrideMimeType(u.mimeType),p.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 p="",m=0;m<c.length;m++)p+=String.fromCharCode(c.charCodeAt(m)&255);return p})};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),p=i(h);return"data:"+p+";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),p=u(c),m=o(s),d;return h[m]&&h[m][p]?h[m][p]:(d=s.apply(null,c),h[m]=h[m]||{},h[m][p]=d,d)}}})(cm)),cm}var fm={},t4;function bN(){if(t4)return fm;t4=1;var e=ig(),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 fm.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(p){return t(p,o).then(function(m){p.attributes.src?p.attributes.src.value=m:p.attributes["xlink:href"]?p.attributes["xlink:href"].value=m:p.attributes.href&&(p.attributes.href.value=m)})}))},fm}var hm={},n4;function wN(){if(n4)return hm;n4=1;var e=ig(),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 hm.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)})}))},hm}var dm={},pm={},r4;function _y(){return r4||(r4=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,n){var r=document.implementation.createHTMLDocument(""),i=document.createElement("style"),a;return i.textContent=t,n&&n.nonce&&(i.nonce=n.nonce),r.body.appendChild(i),a=i.sheet.cssRules,Array.prototype.slice.call(a)},e.cssRulesToText=function(t){return t.reduce(function(n,r){return n+r.cssText},"")},e.exchangeRule=function(t,n,r,i){var a=t.indexOf(n);t[a]=e.rulesForCssText(r,i)[0]},e.changeFontFaceRuleSrc=function(t,n,r,i){var a="@font-face { font-family: "+n.style.getPropertyValue("font-family")+"; ";n.style.getPropertyValue("font-style")&&(a+="font-style: "+n.style.getPropertyValue("font-style")+"; "),n.style.getPropertyValue("font-weight")&&(a+="font-weight: "+n.style.getPropertyValue("font-weight")+"; "),n.style.getPropertyValue("unicode-range")&&(a+="unicode-range: "+n.style.getPropertyValue("unicode-range")+"; "),a+="src: "+r+"}",e.exchangeRule(t,n,a,i)}})(pm)),pm}var gm={},i4;function xN(){return i4||(i4=1,(function(e){var t=_y(),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"),p,m=[],d=function(y){var w=new RegExp(s,"g"),x=[],b;for(b=w.exec(y);b;)x.push(b[1]),b=w.exec(y);return x};if(a.match(new RegExp(h))){for(p=c.exec(a);p;)m.push(d(p[0])),p=c.exec(a);return m}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(", ")}})(gm)),gm}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 mm={exports:{}},a4;function _N(){return a4||(a4=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 p=typeof B1=="function"&&B1;if(!c&&p)return p(h,!0);if(s)return s(h,!0);var m=new Error("Cannot find module '"+h+"'");throw m.code="MODULE_NOT_FOUND",m}var d=i[h]={exports:{}};r[h][0].call(d.exports,function(y){var w=r[h][1][y];return o(w||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,p){this.message=u,this.expected=h,this.found=c,this.location=p,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'"'+m(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 p(b){return b.charCodeAt(0).toString(16).toUpperCase()}function m(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"+p(S)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(S){return"\\x"+p(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"+p(S)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(S){return"\\x"+p(S)})}function y(b){return c[b.type](b)}function w(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?'"'+m(b)+'"':"end of input"}return"Expected "+w(u)+" but "+x(h)+" found."};function s(u,h){h=h!==void 0?h:{};var c={},p={start:Ue},m=Ue,d="",y=function(){return[]},w=",",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(",M=J("url(",!1),O=")",R=J(")",!1),j=function(ve){return ve},D="format(",L=J("format(",!1),T="local(",$=J("local(",!1),U=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 p))throw new Error(`Can't start parsing from rule "`+h.startRule+'".');m=p[h.startRule]}function J(ve,ye){return{type:"literal",text:ve,ignoreCase:ye}}function K(ve,ye,xe){return{type:"class",parts:ve,inverted:ye,ignoreCase:xe}}function ie(){return{type:"end"}}function fe(ve){var ye=B[ve],xe;if(ye)return ye;for(xe=ve-1;!B[xe];)xe--;for(ye=B[xe],ye={line:ye.line,column:ye.column};xe<ve;)u.charCodeAt(xe)===10?(ye.line++,ye.column=1):ye.column++,xe++;return B[ve]=ye,ye}function ue(ve,ye){var xe=fe(ve),Ie=fe(ye);return{start:{offset:ve,line:xe.line,column:xe.column},end:{offset:ye,line:Ie.line,column:Ie.column}}}function we(ve){X<F||(X>F&&(F=X,z=[]),z.push(ve))}function Ce(ve,ye,xe){return new o(o.buildMessage(ve,ye),ve,ye,xe)}function Ue(){var ve,ye;return ve=ze(),ve===c&&(ve=X,ye=d,ye!==c&&(ye=y()),ve=ye),ve}function ze(){var ve,ye,xe,Ie,Te,Je;if(ve=X,ye=tt(),ye!==c){for(xe=[],Ie=Le();Ie!==c;)xe.push(Ie),Ie=Le();if(xe!==c)if(u.charCodeAt(X)===44?(Ie=w,X++):(Ie=c,we(x)),Ie!==c){for(Te=[],Je=Le();Je!==c;)Te.push(Je),Je=Le();Te!==c?(Je=ze(),Je!==c?(ye=b(ye,Je),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=ge(),ve===c&&(ve=he()),ve}function ge(){var ve,ye,xe,Ie;if(ve=X,ye=ut(),ye!==c){if(xe=[],Ie=Le(),Ie!==c)for(;Ie!==c;)xe.push(Ie),Ie=Le();else xe=c;xe!==c?(Ie=ke(),Ie!==c?(ye=k(ye,Ie),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,xe,Ie;return ve=X,u.substr(X,4)===A?(ye=A,X+=4):(ye=c,we(M)),ye!==c?(xe=be(),xe!==c?(u.charCodeAt(X)===41?(Ie=O,X++):(Ie=c,we(R)),Ie!==c?(ye=j(xe),ve=ye):(X=ve,ve=c)):(X=ve,ve=c)):(X=ve,ve=c),ve}function ke(){var ve,ye,xe,Ie;return ve=X,u.substr(X,7)===D?(ye=D,X+=7):(ye=c,we(L)),ye!==c?(xe=be(),xe!==c?(u.charCodeAt(X)===41?(Ie=O,X++):(Ie=c,we(R)),Ie!==c?(ye=j(xe),ve=ye):(X=ve,ve=c)):(X=ve,ve=c)):(X=ve,ve=c),ve}function he(){var ve,ye,xe,Ie;return ve=X,u.substr(X,6)===T?(ye=T,X+=6):(ye=c,we($)),ye!==c?(xe=be(),xe!==c?(u.charCodeAt(X)===41?(Ie=O,X++):(Ie=c,we(R)),Ie!==c?(ye=U(xe),ve=ye):(X=ve,ve=c)):(X=ve,ve=c)):(X=ve,ve=c),ve}function be(){var ve,ye,xe;if(ve=X,ye=[],te.test(u.charAt(X))?(xe=u.charAt(X),X++):(xe=c,we(se)),xe!==c)for(;xe!==c;)ye.push(xe),te.test(u.charAt(X))?(xe=u.charAt(X),X++):(xe=c,we(se));else ye=c;return ye!==c&&(ye=ee(ye)),ve=ye,ve}function Le(){var ve;return Q.test(u.charAt(X))?(ve=u.charAt(X),X++):(ve=c,we(re)),ve}var Me=n("../util");if(Y=m(),Y!==c&&X===u.length)return Y;throw Y!==c&&X<u.length&&we(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)})})(mm)),mm.exports}var o4;function SN(){return o4||(o4=1,(function(e){var t=ig(),n=_y(),r=xN(),i=_N(),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},p=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,E){var A=o(k),M=s(A),O=!1;return M.forEach(function(R){var j=r.parse(R.value),D=c(j),L;D.length>0&&(D.forEach(function(T){var $=j[T].url,U=t.joinUrl(S,$);j[T].url=U}),L=r.serialize(j),a(R.rule,R.property,L),O=!0)}),u(k).forEach(function(R){var j=R.style.getPropertyValue("src"),D,L;try{D=i.parse(j)}catch{return}L=p(D),L.length>0&&(L.forEach(function(T){var $=D[T].url,U=t.joinUrl(S,$);D[T].url=U}),n.changeFontFaceRuleSrc(k,R,i.serialize(D,E),E),O=!0)}),h(k).forEach(function(R){var j=R.href,D=t.joinUrl(S,j);n.exchangeRule(k,R,"@import url("+D+");",E),O=!0}),O};var m=function(S,k,E){var A=S.indexOf(k);S.splice(A,1),E.forEach(function(M,O){S.splice(A+O,0,M)})},d=function(S,k,E,A){var M=k.href,O;return M=n.unquoteString(M),O=t.joinUrl(A.baseUrl,M),E.indexOf(O)>=0?(m(S,k,[]),Promise.resolve([])):(E.push(O),t.ajax(M,A).then(function(R){var j=n.rulesForCssText(R,A);return e.loadCSSImportsForRules(j,E,A).then(function(D){return e.adjustPathsOfCssResources(M,j,A),m(S,k,j),D.errors})},function(R){throw{resourceType:"stylesheet",url:R.url,msg:"Unable to load stylesheet "+R.url}}))};e.loadCSSImportsForRules=function(S,k,E){var A=h(S),M=[],O=!1;return Promise.all(A.map(function(R){return d(S,R,k,E).then(function(j){M=M.concat(j),O=!0},function(j){M.push(j)})})).then(function(){return{hasChanges:O,errors:M}})};var y=function(S,k){var E=r.parse(S),A=c(E),M=!1;return t.collectAndReportErrors(A.map(function(O){var R=E[O].url;return t.getDataURIForImageURL(R,k).then(function(j){E[O].url=j,M=!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:M,errors:O}})},w=function(S,k){var E=o(S),A=s(E),M=[],O=!1;return Promise.all(A.map(function(R){return y(R.value,k).then(function(j){j.hasChanges&&(a(R.rule,R.property,j.backgroundValue),O=!0),M=M.concat(j.errors)})})).then(function(){return{hasChanges:O,errors:M}})},x=function(S,k){var E=!1,A,M;try{A=i.parse(S)}catch{A=[]}return M=p(A),t.collectAndReportErrors(M.map(function(O){var R=A[O],j=R.format||"woff";return t.binaryAjax(R.url,k).then(function(D){var L=btoa(D);R.url="data:font/"+j+";base64,"+L,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=[],M=!1;return Promise.all(E.map(function(O){var R=O.style.getPropertyValue("src");return x(R,k).then(function(j){j.hasChanges&&(n.changeFontFaceRuleSrc(S,O,j.srcDeclarationValue,k),M=!0),A=A.concat(j.errors)})})).then(function(){return{hasChanges:M,errors:A}})};e.loadAndInlineCSSResourcesForRules=function(S,k){var E=!1,A=[];return Promise.all([w,b].map(function(M){return M(S,k).then(function(O){E=E||O.hasChanges,A=A.concat(O.errors)})})).then(function(){return{hasChanges:E,errors:A}})}})(dm)),dm}var s4;function EN(){return s4||(s4=1,(function(e){var t=ig(),n=bN(),r=wN(),i=SN(),a=_y(),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,S);return i.loadCSSImportsForRules(k,b,S).then(function(E){return i.loadAndInlineCSSResourcesForRules(k,S).then(function(A){var M=E.errors.concat(A.errors),O=E.hasChanges||A.hasChanges;return O&&(x=a.cssRulesToText(k)),{hasChanges:O,content:x,errors:M}})})},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)})},p=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=p(x),k=[],E=[],A;return A=t.clone(b),A.baseUrl=A.baseUrl||t.getDocumentBaseUrl(x),Promise.all(S.map(function(M){return c(M,A,E).then(function(O){k=k.concat(O)})})).then(function(){return k})};var m=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,b);return{content:S,cssRules:k}}).then(function(S){var k=i.adjustPathsOfCssResources(x,S.cssRules,b);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(M){return{content:M.content,errors:t.cloneArray(M.errors)}})},w=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=w(x),k=[];return Promise.all(S.map(function(E){return y(E,b).then(function(A){m(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})}})(um)),um}var kN=a0.exports,l4;function AN(){return l4||(l4=1,(function(e){(function(t,n){t===void 0&&window!==void 0&&(t=window),e.exports?e.exports=n(Jx(),vN(),yN(),EN()):t.rasterizeHTML=n(t.url,t.xmlserializer,t.sanedomparsererror,t.inlineresources)})(kN,function(t,n,r,i){var a=(function(y){var w={},x=[];w.joinUrl=function(k,E){return k?y.resolve(k,E):E},w.getConstantUniqueIdFor=function(k){return x.indexOf(k)<0&&x.push(k),x.indexOf(k)},w.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|OffscreenCanvas)\]/i)};return w.parseOptionalParameters=function(k){var E={canvas:null,options:{}};return k[0]==null||S(k[0])?(E.canvas=k[0]||null,E.options=w.clone(k[1])):E.options=w.clone(k[0]),E},w})(t),o=(function(y){var w={},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 w.baseUrlRespectingXhr=function(b,S){var k=function(){var E=new b;return x(E,"open",function(A,M){var O=A.shift(),R=A.shift(),j=y.joinUrl(S,R);return M.apply(this,[O,j].concat(A))}),E};return k},w.finishNotifyingXhr=function(b){var S=0,k=0,E=!1,A,M=new Promise(function(R){A=function(){var j=S-k;j<=0&&E&&R({totalCount:S})}}),O=function(){var R=new b;return x(R,"send",function(j,D){return S+=1,D.apply(this,arguments)}),R.addEventListener("load",function(){k+=1,A()}),R};return O.waitForRequestsToFinish=function(){return E=!0,A(),M},O},w})(a),s=(function(){var y={},w=function(O){return Array.prototype.slice.call(O)};y.addClassName=function(O,R){O.className+=" "+R},y.addClassNameRecursively=function(O,R){y.addClassName(O,R),O.parentNode!==O.ownerDocument&&y.addClassNameRecursively(O.parentNode,R)};var x=function(O,R){var j=O.parentStyleSheet,D=w(j.cssRules).indexOf(O);j.insertRule(R,D+1),j.deleteRule(D)},b=function(O,R){var j=O.cssText.replace(/^[^\{]+/,""),D=R+" "+j;x(O,D)},S=function(O){return w(O).reduce(function(R,j){return R+j.cssText},"")},k=function(O){O.textContent=S(O.sheet.cssRules)},E=function(O){var R=document.implementation.createHTMLDocument(""),j=document.createElement("style");j.textContent=O.textContent,R.body.appendChild(j),O.sheet=j.sheet},A=function(O){return"((?:^|[^.#:\\w])|(?=\\W))("+O.join("|")+")(?=\\W|$)"},M=function(O,R,j){var D=A(R);w(O.querySelectorAll("style")).forEach(function(L){typeof L.sheet>"u"&&E(L);var T=w(L.sheet.cssRules).filter(function($){return $.selectorText&&new RegExp(D,"i").test($.selectorText)});T.length&&(T.forEach(function($){var U=$.selectorText.replace(new RegExp(D,"gi"),function(te,se,ee){return se+j(ee)});U!==$.selectorText&&b($,U)}),k(L))})};return y.rewriteCssSelectorWith=function(O,R,j){M(O,[R],function(){return j})},y.lowercaseCssTypeSelectors=function(O,R){M(O,R,function(j){return j.toLowerCase()})},y.findHtmlOnlyNodeNames=function(O){var R=O.ownerDocument.createTreeWalker(O,NodeFilter.SHOW_ELEMENT),j={},D={},L;do L=R.currentNode.tagName.toLowerCase(),R.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?j[L]=!0:D[L]=!0;while(R.nextNode());return Object.keys(j).filter(function(T){return!D[T]})},y})(),u=(function(y){var w={},x=function(S){return Array.prototype.slice.call(S)},b={active:!0,hover:!0,focus:!1,target:!1};return w.fakeUserAction=function(S,k,E){var A=S.querySelector(k),M=":"+E,O="rasterizehtml"+E;A&&(b[E]?y.addClassNameRecursively(A,O):y.addClassName(A,O),y.rewriteCssSelectorWith(S,M,"."+O))},w.persistInputValues=function(S){var k=S.querySelectorAll("input"),E=S.querySelectorAll("textarea"),A=function(M){return M.type==="checkbox"||M.type==="radio"};x(k).filter(A).forEach(function(M){M.checked?M.setAttribute("checked",""):M.removeAttribute("checked")}),x(k).filter(function(M){return!A(M)}).forEach(function(M){M.setAttribute("value",M.value)}),x(E).forEach(function(M){M.textContent=M.value})},w.rewriteTagNameSelectorsToLowerCase=function(S){y.lowercaseCssTypeSelectors(S,y.findHtmlOnlyNodeNames(S))},w})(s),h=(function(y,w,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=w.finishNotifyingXhr(K),fe=w.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},M=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)}},R=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,we,Ce;return Q?(ue=R(ee,Q),we=ue.getBoundingClientRect(),Y=we.top,J=we.left,K=we.width,ie=we.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)},L=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=M(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(L(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 T=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,T(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 U=null,te=function(ee,Q){return Q==="none"||Q==="repeated"?((U===null||Q!=="repeated")&&(U=Date.now()),ee+"?_="+U):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(){var y={},w=function(R,j){return j?URL.createObjectURL(new Blob([R],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(R)},x=function(R){R instanceof Blob&&URL.revokeObjectURL(R)},b='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',S=function(R){return new Promise(function(j,D){var L=document.createElement("canvas"),T=new Image;T.onload=function(){var $=L.getContext("2d");try{$.drawImage(T,0,0),L.toDataURL("image/png"),j(!0)}catch{j(!1)}},T.onerror=D,T.src=R})},k=function(){var R=w(b,!0);return S(R).then(function(j){return x(R),j?!1:S(w(b,!1)).then(function(D){return D})},function(){return!1})},E=function(){return new Promise(function(R,j){k().then(function(D){R(!D)},function(){j()})})},A,M=function(){return A===void 0&&(A=E()),A},O=function(R){return M().then(function(j){return w(R,j)})};return y.renderSvg=function(R){return new Promise(function(j,D){var L,T,$=function(){T.onload=null,T.onerror=null},U=function(){L&&x(L)};T=new Image,T.onload=function(){$(),U(),j(T)},T.onerror=function(){U(),D()},O(R).then(function(te){L=te,T.src=L},D)})},y})(),p=(function(y,w,x,b){var S={},k=function(D,L){var T=L||1,$={width:D.width,height:D.height,"font-size":D.rootFontSize};return T!==1&&($.style="transform:scale("+T+"); transform-origin: 0 0;"),$},E=function(D){var L,T,$,U;L=Math.round(D.viewportWidth),T=Math.round(D.viewportHeight),$=-D.left,U=-D.top;var te={x:$,y:U,width:L,height:T};return te},A=function(D){var L=D.style||"";D.style=L+"float: left;"},M=function(D){D.externalResourcesRequired=!0},O=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},R=function(D){var L=Object.keys(D);return L.length?" "+L.map(function(T){return T+'="'+D[T]+'"'}).join(" "):""},j=function(D,L,T){var $=b.serializeToString(D);w.validateXHTML($);var U=E(L);return A(U),M(U),'<svg xmlns="http://www.w3.org/2000/svg"'+R(k(L,T))+">"+O()+"<foreignObject"+R(U)+">"+$+"</foreignObject></svg>"};return S.getSvgForDocument=function(D,L,T){return x.rewriteTagNameSelectorsToLowerCase(D),j(D,L,T)},S.drawDocumentAsSvg=function(D,L){return["hover","active","focus","target"].forEach(function(T){L[T]&&x.fakeUserAction(D,L[T],T)}),w.calculateDocumentContentSize(D,L).then(function(T){return S.getSvgForDocument(D,T,L.zoom)})},S})(a,h,u,n),m=(function(y,w,x,b,S,k){var E={},A=function(D){return{message:"Error rendering page",originalError:D}},M=function(D){return S.renderSvg(D).then(function(L){return{image:L,svg:D}},function(L){throw A(L)})},O=function(D,L){try{L.getContext("2d").drawImage(D,0,0)}catch(T){throw A(T)}},R=function(D,L,T){return b.drawDocumentAsSvg(D,T).then(M).then(function($){return L&&O($.image,L),$})},j=function(D,L){return w.executeJavascript(D,L).then(function(T){var $=T.document;return x.persistInputValues($),{document:$,errors:T.errors,cleanUp:T.cleanUp}})};return E.rasterize=function(D,L,T){var $;return $=y.clone(T),$.inlineScripts=T.executeJs===!0,k.inlineReferences(D,$).then(function(U){return T.executeJs?j(D,T).then(function(te){return{element:te.document.documentElement,errors:U.concat(te.errors),cleanUp:te.cleanUp}}):{element:D,errors:U,cleanUp:function(){}}}).then(function(U){return R(U.element,L,T).then(function(te){return U.cleanUp(),{image:te.image,svg:te.svg,errors:U.errors}})})},E})(a,h,u,p,c,i),d=(function(y,w,x){var b={},S=function(O,R){var j=300,D=200,L=O?O.width:j,T=O?O.height:D,$=R.width!==void 0?R.width:L,U=R.height!==void 0?R.height:T;return{width:$,height:U}},k=function(O){var R=S(O.canvas,O.options),j;return j=y.clone(O.options),j.width=R.width,j.height=R.height,j};b.drawDocument=function(){var O=arguments[0],R=Array.prototype.slice.call(arguments,1),j=y.parseOptionalParameters(R),D=O.documentElement?O.documentElement:O;return x.rasterize(D,j.canvas,k(j))};var E=function(O,R,j){var D=w.parseHTML(O);return b.drawDocument(D,R,j)};b.drawHTML=function(){var O=arguments[0],R=Array.prototype.slice.call(arguments,1),j=y.parseOptionalParameters(R);return E(O,j.canvas,j.options)};var A=function(O,R,j){var D=document.implementation.createHTMLDocument("");D.replaceChild(O.documentElement,D.documentElement);var L=j?y.clone(j):{};return j.baseUrl||(L.baseUrl=R),{document:D,options:L}},M=function(O,R,j){return w.loadDocument(O,j).then(function(D){var L=A(D,O,j);return b.drawDocument(L.document,R,L.options)})};return b.drawURL=function(){var O=arguments[0],R=Array.prototype.slice.call(arguments,1),j=y.parseOptionalParameters(R);return M(O,j.canvas,j.options)},b})(a,h,m);return d})})(a0)),a0.exports}var PN=AN();function ON(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=Ho(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 p=(c.match(/font-weight:\s*(\d+)/)||[])[1];if(p&&!a.has(p)||/font-style:\s*italic/.test(c)&&!o)return!1;const m=c.match(/unicode-range:\s*([^;]+);/);if(!m)return!0;const d=m[1].split(",").map(y=>{const[w,x=w]=y.replace("U+","").split("-").map(b=>parseInt(b,16));return[w,x]});return s.some(y=>d.some(([w,x])=>y>=w&&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
- `,CN=`
229
- <style>
230
- html, body {
231
- padding: 0;
232
- margin: 0;
233
- }
234
- ${Np}
235
- </style>
236
- `;let lf;const e7=()=>(lf||(lf=document.createElement("div"),lf.id="polotno-hidden-do-not-touch",lf.style.overflow="hidden",lf.style.position="relative",document.body.appendChild(lf),lf.innerHTML=`<style>#polotno-hidden-do-not-touch {${Np}}</style>`),lf);navigator.userAgent.includes("Firefox");function LN({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=e7();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 u4(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=e7();n.appendChild(t);const r=t.getBoundingClientRect();return n.removeChild(t),{width:r.width,height:r.height}}const NN={},vm={},ym=new Map;async function c4({html:e,width:t,height:n,fontFamily:r,padding:i,font:a,pixelRatio:o}){let s="";if(r!=="Arial"&&!a){const y=mO();s=await(async function(w,x){const b=`${w}|${x}`;if(ym.has(b))return ym.get(b);const S=`https://fonts.googleapis.com/css?family=${w}:${x}&display=swap`,k=await(await fetch(S)).text();return ym.set(b,k),k})(r,y)}if(a){const y=a.styles||(a.url?[{src:`url("${a.url}")`}]:(w=>{if(vm[w])return vm[w];const x=(function(S){const k=[];for(let E=0;E<document.styleSheets.length;E++){const A=document.styleSheets[E];try{const M=A.cssRules;if(M)for(let O=0;O<M.length;O++){const R=M[O];R instanceof CSSFontFaceRule&&R.style.fontFamily.replace(/['"]/g,"")===S&&k.push(R)}}catch(M){console.warn(`Could not access stylesheet: ${A.href}`,M)}}return k})(w),b=x.filter(S=>S.style.fontFamily.replace(/['"]/g,"")===w).map(S=>({src:S.style.getPropertyValue("src"),fontStyle:S.style.getPropertyValue("font-style")||"normal",fontWeight:S.style.getPropertyValue("font-weight")||"normal"}));return vm[w]=b,b})(r));s="",y.forEach(w=>{s+=`
237
- @font-face {
238
- font-family: '${r}';
239
- src: ${w.src};
240
- font-style: ${w.fontStyle||"normal"};
241
- font-weight: ${w.fontWeight||"normal"};
242
- }
243
- `})}let u="";s&&(u=ON(s,e)),e+=u+CN;const h=t+2*i,c=n+2*i,p=document.createElement("canvas"),m=await PN.drawHTML(`<div style="padding: ${i}px;" dir="auto">${e}</div>`,p,{width:h,height:c,cacheBucket:NN});yy(p,h*o,c*o);const d=p.getContext("2d");return d?.drawImage(m.image,0,0,h,c,0,0,p.width,p.height),p}let TN={data:""},RN=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||TN,MN=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,IN=/\/\*[^]*?\*\/|\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={},t7=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+t7(e[n]);return t}return e},jN=(e,t,n,r,i)=>{let a=t7(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=MN.exec(u.replace(IN,""));)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 Sy(e){let t=this||{},n=e.call?e(t.p):e;return jN(n.unshift?n.raw?((r,i,a)=>r.reduce((o,s,u)=>{let h=i[u];if(h&&h.call){let c=h(a),p=c&&c.props&&c.props.className||/^go/.test(c)&&c;h=p?"."+p: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,RN(t.target),t.g,t.o,t.k)}let n7,Pv,Ov;Sy.bind({g:1});Sy.bind({k:1});function DN(e,t,n,r){pf.p=t,n7=e,Pv=n,Ov=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:Pv&&Pv()},s),n.o=/ *go\d+/.test(u),s.className=Sy.apply(n,r)+(u?" "+u:""),t&&(s.ref=o);let h=e;return e[0]&&(h=s.as||e,delete s.as),Ov&&h[0]&&Ov(s),n7(h,s)}return t?t(i):i}}DN(oe.createElement);function r7(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 f4(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})}),i7=Od("div",oe.forwardRef)`
244
- .ql-editor {
245
- outline: none;
246
- }
247
- .ql-clipboard {
248
- pointer-events: none;
249
- opacity: 0;
250
- }
251
- ${Np}
252
- strong {
253
- font-weight: 700;
254
- }
255
- .ql-direction-rtl {
256
- direction: rtl;
257
- }
258
- `;let FN=["bold","color","font","italic","size","strike","underline","indent","list","direction"];const h4=(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()},BN=({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 Hx(c,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:FN}));var c;vc(()=>{Zf.editor.instance=h}),window.__polotnoQuill=h,h.on("text-change",()=>{h.getSelection()&&vc(()=>{Zf.currentFormat=h.getFormat(h.getSelection())}),setTimeout(()=>{var y;const w=(y=o.current)===null||y===void 0?void 0:y.childNodes[0];if(!w)return;const x=w.innerHTML;n(f4(x))},10)}),h4(h,e),i?UN(h,i):h.setSelection(0,0,"api"),h.on("selection-change",(y,w,x)=>{y&&vc(()=>{Zf.currentFormat=h.getFormat(h.getSelection())})}),o.current.childNodes[0].addEventListener("blur",y=>{const w=y.relatedTarget;if(w?.classList.contains("ql-clipboard"))return;(function(b){return!!b&&!!b.closest(".sketch-picker")})(w)||t()});const p=o.current.childNodes[0],m=y=>{var w,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),M=document.createElement("div");M.appendChild(A.cloneContents()),E=M.innerHTML}if((w=y.clipboardData)===null||w===void 0||w.setData("text/plain",S),E){const A='<!DOCTYPE html><html><head><meta charset="utf-8"></head><body><!--StartFragment--><div style="white-space: pre-wrap; word-wrap: break-word;">'+E+"</div><!--EndFragment--></body></html>";(x=y.clipboardData)===null||x===void 0||x.setData("text/html",A)}y.preventDefault()},d=y=>{m(y);const w=h.getSelection();w&&w.length>0&&h.deleteText(w.index,w.length)};return p.addEventListener("copy",m),p.addEventListener("cut",d),()=>{p.removeEventListener("copy",m),p.removeEventListener("cut",d),vc(()=>{Zf.editor.instance=null,Zf.currentFormat={}}),delete window.__polotnoQuill}},[]),oe.useEffect(()=>U6(()=>r.text,()=>{var h,c;const p=Zf.editor.instance;if(!p)return;const m=p.getSelection(),d=(c=(h=o.current)===null||h===void 0?void 0:h.childNodes)===null||c===void 0?void 0:c[0];f4(d?.innerHTML||"")===r.text||(h4(p,e),m&&(p.setSelection(m.index,m.length),vc(()=>{Zf.currentFormat=p.getFormat(p.getSelection())})))},{fireImmediately:!0}),[]),oe.useEffect(()=>{window.addEventListener("blur",t);const h=c=>{var p;!((p=o.current)===null||p===void 0)&&p.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=Dx(r);return oe.createElement(i7,{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 ${r7(r.shadowColor,(a=r.shadowOpacity)!==null&&a!==void 0?a:1)}`:void 0,caretColor:u}),dir:Ap(Ho(r.text))})};function zN(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 d4=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),qN=Jr(({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),p=t.selectedShapes.indexOf(e)>=0&&e.selectable,m=T0(p),d=e.fontSize/3,{textVerticalResizeEnabled:y}=Ir,w=Ir.autoDeleteEmptyText,x=T0(e.fontFamily),[b]=Fx(t,e.fontFamily),S=e._editModeEnabled;Up(r);const k=b?e.fontFamily:x!==e.fontFamily?x:"Arial",E=Wu(e).fill,A=o2(e,{fontFamily:k,color:E}),M=o2(e,{fontFamily:k,color:E,forEditor:!0});let{width:O,height:R}=(function(z,Y,J){return oe.useMemo(()=>u4(z),[z,Y.width,J])})(A,e,b);oe.useEffect(()=>{if(!b)return;if(!e.height)return void t.history.ignore(()=>{e.set({height:R})});const{textOverflow:z}=Ir;if(z!=="change-font-size"||o)z==="resize"&&(y&&e.height<R&&!o&&t.history.ignore(()=>{e.set({height:R})}),y||e.height===R||t.history.ignore(()=>{e.set({height:R})}));else{const Y=(J=>{let K=J.fontSize;for(let ie=1;ie<50;ie++){const fe=o2(Object.assign(Object.assign({},J.toJSON()),{fontSize:K}),{fontFamily:J.fontFamily}),{height:ue}=u4(fe);if(!(J.height&&ue>J.height||!Ir.textSplitAllowed&&!J.curveEnabled&&LN({html:fe})))break;K-=.5}return K})(e);Y!==e.fontSize?t.history.ignore(()=>{e.set({fontSize:Y})}):e.height!==R&&(y&&e.height<R?t.history.ignore(()=>{e.set({height:R})}):y||t.history.ignore(()=>{e.set({height:R})}))}});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 c4(Y),z.lastArgs=Object.assign({},Y)),z.lastResult;var J,K}},[]),D=oe.useRef(0),L=oe.useRef(null);oe.useEffect(()=>{o||S||(async()=>{D.current++;const z=D.current;let Y=dh(`text ${e.id} ${z}`);L.current&&L.current(),L.current=Y,h(!0);let J=null;const K=d4?5:1;for(let ie=0;ie<K;ie++){const fe=ie>0?j:c4;try{if(J=await fe({skipCache:ie>0,html:A,width:e.width||1,height:e.height||R||1,fontFamily:k,padding:d,pixelRatio:t._elementsPixelRatio,font:t.fonts.find(ue=>ue.fontFamily===k)||fy.find(ue=>ue.fontFamily===k)}),z!==D.current)return;if(d4&&zN(J)){await new Promise(ue=>setTimeout(ue,50*(ie+1)));continue}break}catch(ue){console.error(ue),Hp(`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,R,S,k,e.height,t._elementsPixelRatio,b]);const[T,$]=Av(u,300),[U]=Av(o,300,!0),te=U||T;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&&L.current&&(L.current(),L.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:Ho(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(()=>()=>{L.current&&L.current()},[]),oe.useEffect(()=>{m&&!p&&w&&Ho(e.text)===""&&e.removable&&!e.placeholder&&t.deleteElements([e.id])},[w,e.placeholder,e.removable,e.text,p,m]);let se=0;e.verticalAlign==="middle"&&(se=(e.height-R)/2),e.verticalAlign==="bottom"&&(se=e.height-R);const ee=Bx({fontLoaded:b,fontFamily:e.fontFamily,fontSize:e.fontSize,lineHeight:e.lineHeight}),Q=Tf(),re=ph(e.a.width,R,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&&p:e.draggable,preventDefault:!Q||p,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 we=J.scaleX(),Ce=J.width()*we,Ue=e.fontSize;let ze=Ce;if(Ce<Ue&&(ze=Ue,X.current&&J.position(X.current)),J.width(ze),J.scaleX(1),Ir.textVerticalResizeEnabled){const tt=Math.max(R,c.current);e.set({height:tt})}e.set({width:J.width(),x:J.x(),y:J.y()})}else if(fe){const we=Ir.textOverflow==="resize",Ce=typeof e.lineHeight=="number"?e.lineHeight:1;let Ue=we?R:Ce*e.fontSize;const ze=Math.max(Ue,z.target.height()*z.target.scaleY());J.scaleY(1),e.set({x:J.x(),y:J.y(),height:ze,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(Du,{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(fr,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,offsetY:-se},oe.createElement(P0,{divProps:{style:{pointerEvents:"none"}}},oe.createElement(i7,{dangerouslySetInnerHTML:{__html:A},style:{pointerEvents:"none",opacity:e.a.opacity,textShadow:e.shadowEnabled?`${e.shadowOffsetX}px ${e.shadowOffsetY}px ${e.shadowBlur}px ${r7(e.shadowColor,(n=e.shadowOpacity)!==null&&n!==void 0?n:1)}`:void 0}}))),S&&oe.createElement(fr,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,offsetY:-se},oe.createElement(P0,null,oe.createElement(BN,{html:M,element:e,onChange:z=>{const Y=jx({oldText:Ho(e.text),newText:Ho(z),element:e});e.set({text:z,fontSize:Y})},onBlur:z=>{e.toggleEditMode(!1),$(!0)},clickCoords:B.current}))))});function UN(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=Hx.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 Ey(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=Ey(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),p=Math.min(o.y,s.y,u.y,h.y),m=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:p,width:m-c,height:d-p,minX:c,minY:p,maxX:m,maxY:d}}function ag(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 HN(e){const t=Ey(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 $N(e,t,n){const r=Ey(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 GN(e,t){return $N(e,t,HN(e))}const rs={stroke:"rgb(0, 161, 255)",strokeWidth:1,dash:[4,6]},WN=({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 p4=({targetKonvaNodes:e,guideKonvaNode:t,distance:n,snapDirection:r})=>n<5;function Cv(e,t){var n=[],r=[];e.vertical.forEach(h=>{t.vertical.forEach(c=>{var p=Math.abs(h.offset-c.guide);p4({targetKonvaNodes:c.nodes,guideKonvaNode:h.node,distance:p,snapDirection:h.snap})&&n.push({lineGuide:h.offset,diff:p,snap:c.snap,offset:c.offset})})}),e.horizontal.forEach(h=>{t.horizontal.forEach(c=>{var p=Math.abs(h.offset-c.guide);p4({targetKonvaNodes:c.nodes,guideKonvaNode:h.node,distance:p,snapDirection:h.snap})&&r.push({lineGuide:h.offset,diff:p,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 a7=()=>{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 VN(e,t,n){const r=oe.useRef(null);WN(n);const i=c=>c.hasName("element")||c.hasName("page-background")||!r.current&&c.hasName("elements-area");function a(c){var p;const m=(p=e.current)===null||p===void 0?void 0:p.getStage(),d=[],y=[];return m.find(i).forEach(w=>{if(!(c.indexOf(w)>=0)){var x=w.getClientRect({skipShadow:!0,skipStroke:!0});d.push({offset:x.x,node:w,snap:"start"},{offset:x.x+x.width,node:w,snap:"end"},{offset:x.x+x.width/2,node:w,snap:"center"}),y.push({offset:x.y,node:w,snap:"start"},{offset:x.y+x.height,node:w,snap:"end"},{offset:x.y+x.height/2,node:w,snap:"center"})}}),{vertical:d,horizontal:y}}function o(c){var p;const m=(p=e.current)===null||p===void 0?void 0:p.getLayer(),d=m?.children.find(y=>y.name()==="line-guides");c.forEach(y=>{if(y.orientation==="H"){var w=new un.Line({x:-m.getStage().x(),y:-m.getStage().y(),points:[-6e3,y.lineGuide,6e3,y.lineGuide],stroke:rs.stroke,strokeWidth:rs.strokeWidth,name:"guid-line",dash:rs.dash});d?.add(w),m.batchDraw()}else y.orientation==="V"&&(w=new un.Line({x:-m.getStage().x(),y:-m.getStage().y(),points:[y.lineGuide,-6e3,y.lineGuide,6e3],stroke:rs.stroke,strokeWidth:rs.strokeWidth,name:"guid-line",dash:rs.dash}),d?.add(w))})}const s=c=>{const p=c.target.getLayer().children.find(k=>k.name()==="line-guides");p?.destroyChildren();var m=a(c.target.nodes()),d=(function(k){const E=k.__getNodeRect(),A=Cd(Object.assign(Object.assign({},E),{rotation:un.Util.radToDeg(E.rotation)})),M=k.getAbsolutePosition();return{vertical:[{guide:A.x,offset:M.x-A.x,snap:"start",nodes:k.nodes()},{guide:A.x+A.width/2,offset:M.x-A.x-A.width/2,snap:"center",nodes:k.nodes()},{guide:A.x+A.width,offset:M.x-A.x-A.width,snap:"end",nodes:k.nodes()}],horizontal:[{guide:A.y,offset:M.y-A.y,snap:"start",nodes:k.nodes()},{guide:A.y+A.height/2,offset:M.y-A.y-A.height/2,snap:"center",nodes:k.nodes()},{guide:A.y+A.height,offset:M.y-A.y-A.height,snap:"end",nodes:k.nodes()}]}})(c.target),y=Cv(m,d);if(!y.length)return;o(y);const w=c.target.getAbsolutePosition(),x=(c.target.nodes().map(k=>k.getAbsolutePosition()),Object.assign({},w));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-w.x,S=x.y-w.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,p,m)=>{var d;const y=e.current,w=y.getLayer().children.find(R=>R.name()==="line-guides");if(w?.destroyChildren(),y.getActiveAnchor()==="rotater")return p;const x=y.getActiveAnchor(),b=YN[x],S=(d=y.findOne(`.${b}`))===null||d===void 0?void 0:d.getAbsolutePosition();if(!S)return p;const k={x:c.x-S.x,y:c.y-S.y},E=(function(R,j){const D=m4(R,j)/m4(j,j);return{x:D*j.x,y:D*j.y}})({x:p.x-c.x,y:p.y-c.y},k);if(Math.sqrt(Math.pow(E.x,2)+Math.pow(E.y,2))>5)return p;const A={x:c.x+E.x,y:c.y+E.y};var M=Cv(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(!M.length||(o(M),m.ctrlKey||m.metaKey))return p;const O=[];if(M.forEach(R=>{const j=(function(D,L,T){if(T.orientation==="V"){const $=T.lineGuide;if(Math.abs(L.x-D.x)<1e-4)return null;const U=(L.y-D.y)/(L.x-D.x);return{x:$,y:U*$+(D.y-U*D.x)}}{const $=T.lineGuide;if(Math.abs(L.y-D.y)<1e-4)return null;const U=(L.y-D.y)/(L.x-D.x);return{x:($-D.y)/U+D.x,y:$}}})(A,S,{orientation:R.orientation,lineGuide:R.lineGuide});j&&O.push(j)}),O.length>0){let R=O[0],j=Math.sqrt(Math.pow(A.x-R.x,2)+Math.pow(A.y-R.y,2));if(O.forEach(D=>{const L=Math.sqrt(Math.pow(A.x-D.x,2)+Math.pow(A.y-D.y,2));L<j&&(j=L,R=D)}),j<10)return R}return A},h=c=>{if(!c.target)return;const p=c.target.getLayer(),m=p.children.find(d=>d.name()==="line-guides");m?.destroyChildren(),p.batchDraw()};oe.useEffect(()=>{e.current&&(e.current.anchorDragBoundFunc(u),e.current.on("dragstart",c=>{setTimeout(()=>{a7()})}),e.current.on("dragmove",s),e.current.on("dragend",h),e.current.on("transformend",h),e.current.on("transform",c=>{var p,m;c.evt.ctrlKey||c.evt.metaKey?(p=e.current)===null||p===void 0||p.rotationSnapTolerance(0):(m=e.current)===null||m===void 0||m.rotationSnapTolerance(5)}))},[])}function g4(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=Cv((function(y){var w;const x=(w=e.current)===null||w===void 0?void 0:w.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 w;const x=(w=e.current)===null||w===void 0?void 0:w.getLayer(),b=x?.children.find(S=>S.name()==="line-guides");y.forEach(S=>{if(S.orientation==="H"){var k=new un.Line({x:-x.getStage().x(),y:-x.getStage().y(),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({x:-x.getStage().x(),y:-x.getStage().y(),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(),p=Object.assign({},c);h.forEach(y=>{switch(y.snap){case"start":case"center":case"end":switch(y.orientation){case"V":p.x=y.lineGuide+y.offset;break;case"H":p.y=y.lineGuide+y.offset}}});const m=p.x-c.x,d=p.y-c.y;if(!o.evt.ctrlKey&&!o.evt.metaKey){const y=o.target.getAbsolutePosition();o.target.absolutePosition({x:y.x+m,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 m4(e,t){return e.x*t.x+e.y*t.y}const YN={"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 XN(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 v4(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 y4=(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()}}},b4=Jr(({element:e,type:t})=>{const n=Wu(e,e.a.color,"fill"),r=Wu(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(bc,Object.assign({points:[3*e.height,2*-e.height,0,0,3*e.height,2*e.height]},i)),t==="triangle"&&oe.createElement(bc,Object.assign({points:[3*e.height,2*-e.height,0,0,3*e.height,2*e.height],closed:!0},i)),t==="bar"&&oe.createElement(bc,Object.assign({points:[0,2*-e.height,0,2*e.height],closed:!0},i)),t==="square"&&oe.createElement(bc,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(UP,Object.assign({x:2*e.height,y:0,radius:2*e.height},i)))}),KN=Jr(({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}=XN(e);g4(r,[n],[s]),g4(i,[n],[s]);const p=Wu(e,e.a.color,"stroke");return oe.createElement(oe.Fragment,null,oe.createElement(bc,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(m=>m*e.a.height)},p,{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:m=>{e.set({x:m.target.x(),y:m.target.y()})},onDragEnd:m=>{e.set({x:m.target.x(),y:m.target.y()})},onTransform:m=>{const d=m.target.scaleX();m.target.scaleX(1),m.target.scaleY(1),e.set({height:e.height*d,width:e.width*d,x:m.target.x(),y:m.target.y(),rotation:m.target.rotation()})}})),oe.createElement(fr,{x:h.x,y:h.y,rotation:e.rotation,hideInExport:!e.showInExport,onClick:m=>{var d;return(d=n.current)===null||d===void 0?void 0:d.fire("click",m)},onTap:m=>{var d;return(d=n.current)===null||d===void 0?void 0:d.fire("tap",m)}},oe.createElement(b4,{element:e,type:e.startHead})),oe.createElement(fr,{x:c.x,y:c.y,rotation:e.rotation+180,onClick:m=>{var d;return(d=n.current)===null||d===void 0?void 0:d.fire("click",m)},onTap:m=>{var d;return(d=n.current)===null||d===void 0?void 0:d.fire("tap",m)}},oe.createElement(b4,{element:e,type:e.endHead})),s&&e.resizable&&oe.createElement(cy,{selector:".page-abs-container",enabled:!0},oe.createElement(fr,{visible:s},oe.createElement(Pr,Object.assign({x:h.x,y:h.y,ref:r,name:"line-anchor"},y4(t.scale,t),{onDragMove:m=>{const d=v4(m.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"},y4(t.scale,t),{onDragMove:m=>{const d=v4(h,m.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 o7=new window.Image;o7.src=Mf(`
259
- <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
260
- <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"/>
261
- <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"/>
262
- </svg>
263
- `);const s7=new window.Image;s7.src=Mf(`
264
- <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
265
- <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"/>
266
- <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"/>
267
- <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"/>
268
- <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"/>
269
- </svg>
270
- `);const l7=(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,p=t instanceof HTMLVideoElement?t.videoWidth:t?.width,m=t instanceof HTMLVideoElement?t.videoHeight:t?.height,d=n.x===0&&n.y===0&&n.width===p&&n.height===m,y=oe.useMemo(()=>{if(t&&p&&m)return d&&u===0&&!c?void 0:ud()},[t,u,c,d,p,m]),w=()=>{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,M;const O=ud(),R=k instanceof HTMLVideoElement?k.videoWidth:k.width,j=k instanceof HTMLVideoElement?k.videoHeight:k.height;O.width=R,O.height=j,(A=O.getContext("2d"))===null||A===void 0||A.drawImage(k,0,0,O.width,O.height);const D=(function(L,T,$,U,te,se,ee){for(var Q=new ImageData(T,$),re=new Int32Array(L.data.buffer),X=L.width,B=new Int32Array(Q.data.buffer),F=Q.width,z=T/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 we=0+Math.round(ue/z)+(0+Math.round(fe/Y))*X,Ce=0,Ue=0,ze=0,tt=0,ge=0;ge<K;ge++)for(var ut=0;ut<J;ut++){var ke=re[we+ut+ge*X];Ce+=ke<<24>>>24,Ue+=ke<<16>>>24,ze+=ke<<8>>>24,tt+=ke>>>24}Ce=Math.round(Ce/ie),Ue=Math.round(Ue/ie),ze=Math.round(ze/ie),tt=Math.round(tt/ie),B[ue+fe*F]=tt<<24|ze<<16|Ue<<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),(M=O.getContext("2d"))===null||M===void 0||M.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(()=>{w()},[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,w]},ZN=ud(),QN=Jr(({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(fr,{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(ly,{ref:n,x:e.width/2,y:e.height/2,fill:"white",outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270}))}),JN=Jr(({element:e})=>{const t=Math.max(10,Math.min(30,e.width/25));return oe.createElement(fr,{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 eT=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",p),c.addEventListener("error",m),c.crossOrigin=t,c.src=e,c.load(),function(){c.removeEventListener("canplay",p),c.removeEventListener("error",m)}}function p(){r.current="loaded",i.current=c,i.current.currentTime=0,o(Math.random()),i.current.removeEventListener("canplay",p)}function m(d){var y;const w=c.readyState===4,x=c.buffered&&c.buffered.length>0&&c.buffered.end(c.buffered.length-1)/c.duration*100>=100;if(w&&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 w4(e){return e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA}const x4=(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"&&Hp(o)},[e])},tT=Jr(({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,p]=eT(e.src,"anonymous"),[m,d]=oe.useState(!1),y=t.activePage===e.page;x4(p,e.src,e.id),c&&(c.playsInline=!0);const w=((ke,he,be)=>{const Le=oe.useMemo(()=>{var Me,ve;const{flipX:ye,flipY:xe}=ke,Ie=ke.type==="svg"||ke.src.indexOf("data:image/svg+xml")>=0||ke.src.indexOf(".svg")>=0,Te=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;if(!(ye||xe||Te&&Ie))return he;if(!he)return null;const Je=he instanceof HTMLVideoElement?he.videoWidth:he?.width,nt=he instanceof HTMLVideoElement?he.videoHeight:he?.height;if(!Je||!nt)return null;const st=ud();let at=1;ke.type==="svg"&&(at=Math.max(ke.width/Je*be,ke.height/nt*be)),st.width=Math.max(Je*at,1),st.height=Math.max(nt*at,1);let ct=ye?-st.width:0,Ct=xe?-st.height:0;return(Me=st.getContext("2d"))===null||Me===void 0||Me.scale(ye?-1:1,xe?-1:1),(ve=st.getContext("2d"))===null||ve===void 0||ve.drawImage(he,ct,Ct,st.width,st.height),st},[ke.flipX,ke.flipY,he,ke.width,ke.height,be]);return oe.useEffect(()=>()=>{Le&&Le.nodeName==="CANVAS"&&un.Util.releaseCanvas(Le)},[Le]),Le})(e,c,t._elementsPixelRatio),x=w||ZN;oe.useEffect(()=>{c&&t.history.ignore(()=>{e.set({duration:1e3*c.duration})})},[c]),oe.useEffect(()=>{var ke;if(!c)return;const he=t.animatedElementsIds,be=(!he.length||he.includes(e.id))&&t.isPlaying,Le=y&&(be||u);if(!Le)return void c.pause();Le&&(c.currentTime=e.startTime*c.duration,c.play());const Me=new un.Animation(()=>{z.current()},(ke=a.current)===null||ke===void 0?void 0:ke.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 ke=$u(()=>{var he,be;if(c){const Le=t.animatedElementsIds;if(Le.length&&!Le.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 xe=ye/1e3;xe!==c.currentTime&&(c.currentTime=xe),!w4(c)&&!t.isPlaying&&!b.current&&(b.current=dh(`video ${e.id}`))}z.current(),(be=(he=a.current)===null||he===void 0?void 0:he.getLayer())===null||be===void 0||be.batchDraw()}});return()=>{ke(),b.current&&(b.current(),b.current=null)}},[t,c]),oe.useEffect(()=>{if(!c)return;const ke=()=>{var be,Le;!w4(c)&&e.page._exportingOrRendering||b.current&&(z.current(),(Le=(be=a.current)===null||be===void 0?void 0:be.getLayer())===null||Le===void 0||Le.batchDraw(),b.current(),b.current=null)};let he;return e.page._exportingOrRendering&&(he=setInterval(ke,20)),c.addEventListener("timeupdate",ke),c.addEventListener("canplay",ke),()=>{clearInterval(he),c.removeEventListener("timeupdate",ke),c.removeEventListener("canplay",ke)}},[e.page._exportingOrRendering,c,e.id,dh]);let{cropX:S,cropY:k,cropWidth:E,cropHeight:A}=e;p!=="loaded"&&(S=k=0,E=A=1);const M=(O=x)instanceof HTMLVideoElement?O.videoWidth:O?.width||0;var O;const R=(ke=>ke instanceof HTMLVideoElement?ke.videoHeight:ke?.height||0)(x),j=M*E,D=R*A,L=e.width/e.height;let T,$;const U=j/D,te=e.type==="svg";te?(T=j,$=D):L>=U?(T=j,$=j/L):(T=D*L,$=D);const se={x:M*S,y:R*k,width:T,height:$},ee=(n=e.cornerRadius)!==null&&n!==void 0?n:0,[Q,re]=l7(e,x,se,t._elementsPixelRatio,ee,!0);let[X,B]=((ke,he,be,Le)=>{const Me=(Je=>{const[nt,st]=oe.useState(Je);return oe.useEffect(()=>{(async()=>{const at=await(async function(ct){if(!(ct.indexOf("data:image/svg+xml")>=0||ct.indexOf(".svg")>=0))return ct;const Ct=await Gp(ct),rn=my(Ct);return Mf(rn)})(Je);at!==nt&&st(at)})()},[Je]),nt})(ke.clipSrc||""),[ve,ye]=uy(Me,"anonymous"),xe=ke.clipSrc?ye:"loaded";x4(xe,ke.clipSrc,ke.id);const Ie=oe.useMemo(()=>{if(he&&ve)return ud()},[he,ve]);function Te(){var Je;if(!ve)return;const nt=he instanceof HTMLVideoElement?he.videoWidth:he?.width,st=he instanceof HTMLVideoElement?he.videoHeight:he?.height;if(!he||!nt||!st||!ve||!ve.width||!ve.height||!Ie)return;const at=ud(),ct=Math.max(ke.width/ve.width*be,ke.height/ve.height*be);at.width=ve.width*ct,at.height=ve.height*ct,(Je=at.getContext("2d"))===null||Je===void 0||Je.drawImage(ve,0,0,at.width,at.height),Ie.width=Math.max(nt,1),Ie.height=Math.max(st,1);const Ct=Ie.getContext("2d");Ct&&(Ct.save(),Ct.drawImage(at,0,0,nt,st),un.Util.releaseCanvas(at),Ct.globalCompositeOperation="source-in",Ct.drawImage(he,0,0,Ie.width,Ie.height),Ct.restore())}return oe.useLayoutEffect(()=>{Te()},[Ie,he,ve,ke.width,ke.height,be,...Le]),[ke.clipSrc&&ve?Ie:he,Te]})(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/T,e.height/$);oe.useEffect(()=>{var ke;if(!e._cropModeEnabled)return;const he=(ke=a.current)===null||ke===void 0?void 0:ke.getStage();function be(Me){e._cropModeEnabled&&Me.target!==o.current&&e.toggleCropMode(!1)}function Le(Me){e._cropModeEnabled&&Me.target.parentNode!==he.content&&e.toggleCropMode(!1)}return document.body.addEventListener("click",Le),he?.on("click",be),he?.on("tap",be),()=>{document.body.removeEventListener("click",Le),document.body.removeEventListener("touchstart",Le),he?.off("click",be),he?.off("click",be)}},[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 ke;r||e._cropModeEnabled?(ke=a.current)===null||ke===void 0||ke.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=ke=>{Math.round(ke.target.x())>0&&(ke.target.x(0),ke.target.scaleX(1)),Math.round(ke.target.y())>0&&(ke.target.y(0),ke.target.scaleY(1));const he=ke.target.width()*ke.target.scaleX(),be=ke.target.height()*ke.target.scaleY(),Le=Math.min(1,T/he),Me=Math.min(1,$/be),ve=1-Le,ye=Math.min(ve,Math.max(0,Math.round(-ke.target.x())/he)),xe=1-Me,Ie=Math.min(xe,Math.max(0,Math.round(-ke.target.y())/be));ke.target.setAttrs({x:-ye*M,y:-Ie*R,scaleX:1,scaleY:1}),e.set({cropX:ye,cropY:Ie,cropWidth:Le,cropHeight:Me})},ue=()=>{e.type!=="svg"&&e.contentEditable&&setTimeout(()=>{e.toggleCropMode(!0)})},we=p==="loading",Ce=p==="failed",Ue=!we&&!Ce,ze=oe.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),tt=Ue?e.a.opacity:0;Up(a,tt);const ge=e.selectable||t.role==="admin",ut=Tf();return oe.createElement(oe.Fragment,null,oe.createElement(fr,{onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1)},we&&oe.createElement(QN,{element:e}),Ce&&oe.createElement(JN,{element:e}),oe.createElement(Du,{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:ge,draggable:ut?e.draggable&&s:e.draggable,preventDefault:!ut||s,hideInExport:!e.showInExport,onDragMove:ke=>{e.set({x:ke.target.x(),y:ke.target.y()})},onDragEnd:ke=>{e.set({x:ke.target.x(),y:ke.target.y()})},onDblClick:ue,onDblTap:ue,onTransformStart:()=>{i(!0),ze.current={cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight}},onTransform:ke=>{var he;const be=ke.currentTarget,Le=Math.abs(be.scaleX()-1)<1e-7?1:be.scaleX(),Me=Math.abs(be.scaleY()-1)<1e-7?1:be.scaleY();be.scaleX(1),be.scaleY(1);const ve=(he=ke.target.getStage())===null||he===void 0?void 0:he.findOne("Transformer"),ye=1-T/M,xe=Math.min(ye,Math.max(0,e.cropX)),Ie=1-$/R,Te=Math.min(Ie,Math.max(0,e.cropY)),Je=ve.getActiveAnchor(),nt=!(Je.indexOf("middle")>=0||Je.indexOf("center")>=0),st=!nt&&Le<1&&ze.current.cropHeight>$/R;let at=nt?e.cropWidth:e.cropWidth*Le;st&&(at=e.cropWidth);const ct=!nt&&Me<1&&ze.current.cropWidth>T/M;let Ct=nt?e.cropHeight:e.cropHeight*Me;ct&&(Ct=e.cropHeight),te&&(at=e.cropWidth,Ct=e.cropHeight),e.set({cropX:xe,cropY:Te,x:be.x(),y:be.y(),width:be.width()*Le,height:be.height()*Me,rotation:ke.target.rotation(),cropWidth:Math.min(at,1-xe),cropHeight:Math.min(Ct,1-Te)})},onTransformEnd:ke=>{const he=ke.currentTarget;e.set({width:he.width(),height:he.height(),x:he.x(),y:he.y(),rotation:ke.target.rotation(),cropWidth:T/M,cropHeight:$/R}),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(Du,{image:u?(m||ut)&&s7:o7,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(cy,{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(Du,{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(fr,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,scaleX:Y,scaleY:Y},oe.createElement(Du,{image:x,ref:o,width:M,height:R,opacity:.4,draggable:!0,x:-e.cropX*M,y:-e.cropY*R,onDragMove:fe,onTransform:fe}),oe.createElement(kp,{ref:ie,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(ke,he)=>he.width<5||he.height<5?ke:he,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),oe.createElement(Pr,{width:T,height:$,ref:J,listening:!1,onTransform:ke=>{ke.target.x()<-e.cropX*M-1e-9&&(ke.target.x(-e.cropX*M),ke.target.scaleX(1)),ke.target.y()<-e.cropY*R-1e-9&&(ke.target.y(-e.cropY*R),ke.target.scaleY(1));const he=Math.min(1,Math.max(0,e.cropX+ke.target.x()/M)),be=Math.min(1,Math.max(0,ke.target.y()/R+e.cropY)),Le=ke.target.width()*ke.target.scaleX(),Me=ke.target.height()*ke.target.scaleY(),ve=Math.min(1-he,Le/M),ye=Math.min(1-be,Me/R),xe=ke.target.getAbsolutePosition(ke.target.getParent().getParent());ke.target.scale({x:1,y:1}),ke.target.position({x:0,y:0}),e.set({x:xe.x,y:xe.y,cropX:he,cropY:be,cropWidth:ve,cropHeight:ye,width:Math.min(Le*Y,M*(1-he)*Y),height:Math.min(Me*Y,R*(1-be)*Y)})}}),oe.createElement(kp,{ref:K,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(ke,he)=>he.width<5||he.height<5?ke:he,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2,visible:e.resizable})))))}),ky=({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`},nT=({width:e,height:t})=>`M ${e/2} 0 L ${e} ${t} L 0 ${t} Z`,rT=({width:e,height:t})=>`M 0 0 L ${e} 0 L 0 ${t} Z`,iT=({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 aT({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 p=c%2==0?a:s,m=n+(c%2==0?i:o)*Math.sin(c*h),d=r-p*Math.cos(c*h);c===0?u=`M ${m} ${d}`:u+=` L ${m} ${d}`}return u+" Z"}function oT({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 sT({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),p=r-h*Math.cos(u*s);u===0?o=`M ${c} ${p}`:o+=` L ${c} ${p}`}return o+" Z"}function lT({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),p=r-h*Math.cos(u*s);u===0?o=`M ${c} ${p}`:o+=` L ${c} ${p}`}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 uT({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 cT({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 fT={rect:ky,circle:iT,star:aT,triangle:nT,rightTriangle:rT,diamond:oT,pentagon:sT,hexagon:lT,speechBubble:uT,cross:cT,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 u7(e){return fT[e]||ky}function c7(e){const{subType:t}=e,n=u7(t);return n?(function(r,i){const{width:a,height:o,fill:s,stroke:u,strokeWidth:h,dash:c}=r,p=(c||[]).map(x=>x*h);let m=i(r),d=1,y=1;typeof m!="string"&&(d=m.scaleX,y=m.scaleY,m=m.path);const w=`clip-${r.id||Math.random()}`;return`
271
- <svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${o}">
272
- <defs>
273
- <clipPath id="${w}">
274
- <path d="${m}" />
275
- </clipPath>
276
- </defs>
277
-
278
- <!-- Path for the fill -->
279
- <path d="${m}" fill="${s}" transform="scale(${d}, ${y})"/>
280
-
281
- <!-- Path for the stroke, clipped by the star path -->
282
- <path d="${m}" fill="none" stroke="${u}" stroke-width="${2*h}" clip-path="url(#${w})" transform="scale(${d}, ${y})" stroke-dasharray="${p.join(" ")}"/>
283
- </svg>
284
- `})(e,n):(console.error(`Polotno error: Can not convert ${e.subType} figure to svg.`),ky(e))}const bm={},hT=Jr(({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=Wu(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=Wu(e,e.stroke,"stroke"),p=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(w=>w*o),opacity:e.animated("opacity"),hideInExport:!e.showInExport,listening:!1}),m=(d=e.subType,bm[d]||(bm[d]=(y=u7(d),Jr(({element:w,fillProps:x,strokeProps:b})=>{let S=y({width:w.a.width,height:w.a.height,cornerRadius:w.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:w.width,height:w.height,fill:"transparent"}),oe.createElement(Ep,Object.assign({},x,{ref:A,data:S,scaleX:k,scaleY:E})),oe.createElement(fr,{clipFunc:M=>{const O=A.current;if(O){var R=O.dataArray;M.beginPath();for(var j=0;j<R.length;j++){var D=R[j].command,L=R[j].points;switch(D){case"L":M.lineTo(L[0],L[1]);break;case"M":M.moveTo(L[0],L[1]);break;case"C":M.bezierCurveTo(L[0],L[1],L[2],L[3],L[4],L[5]);break;case"Q":M.quadraticCurveTo(L[0],L[1],L[2],L[3]);break;case"A":var T=L[0],$=L[1],U=L[2],te=L[3],se=L[4],ee=L[5],Q=L[6],re=L[7],X=U>te?U:te,B=U>te?1:U/te,F=U>te?te/U:1;M.translate(T,$),M.rotate(Q),M.scale(B,F),M.arc(0,0,X,se,se+ee,1-re),M.scale(1/B,1/F),M.rotate(-Q),M.translate(-T,-$);break;case"z":M.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(M=>M)}))))}))),bm[d]||fr);var d,y;return oe.createElement(oe.Fragment,null,oe.createElement(fr,{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:w=>{e.set({x:w.target.x(),y:w.target.y()})},onDragEnd:w=>{e.set({x:w.target.x(),y:w.target.y()})},onTransform:w=>{const x=w.target.scale();w.target.scaleX(1),w.target.scaleY(1),e.set({width:e.width*x.x,height:e.height*x.y,x:w.target.x(),y:w.target.y(),rotation:w.target.rotation()})}},oe.createElement(m,{element:e,fillProps:h,strokeProps:p})))});var uc={},wm={},cc={},_4;function f7(){if(_4)return cc;_4=1,Object.defineProperty(cc,"__esModule",{value:!0}),cc.loop=cc.conditional=cc.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};cc.parse=e;var t=function(i,a){return function(o,s,u,h){a(o,s,u)&&h(o,i,s,u)}};cc.conditional=t;var n=function(i,a){return function(o,s,u,h){for(var c=[],p=o.pos;a(o,s,u);){var m={};if(h(o,i,s,m),o.pos===p)break;p=o.pos,c.push(m)}return c}};return cc.loop=n,cc}var aa={},S4;function h7(){if(S4)return aa;S4=1,Object.defineProperty(aa,"__esModule",{value:!0}),aa.readBits=aa.readArray=aa.readUnsigned=aa.readString=aa.peekBytes=aa.readBytes=aa.peekByte=aa.readByte=aa.buildStream=void 0;var e=function(p){return{data:p,pos:0}};aa.buildStream=e;var t=function(){return function(p){return p.data[p.pos++]}};aa.readByte=t;var n=function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(m){return m.data[m.pos+p]}};aa.peekByte=n;var r=function(p){return function(m){return m.data.subarray(m.pos,m.pos+=p)}};aa.readBytes=r;var i=function(p){return function(m){return m.data.subarray(m.pos,m.pos+p)}};aa.peekBytes=i;var a=function(p){return function(m){return Array.from(r(p)(m)).map(function(d){return String.fromCharCode(d)}).join("")}};aa.readString=a;var o=function(p){return function(m){var d=r(2)(m);return p?(d[1]<<8)+d[0]:(d[0]<<8)+d[1]}};aa.readUnsigned=o;var s=function(p,m){return function(d,y,w){for(var x=typeof m=="function"?m(d,y,w):m,b=r(p),S=new Array(x),k=0;k<x;k++)S[k]=b(d);return S}};aa.readArray=s;var u=function(p,m,d){for(var y=0,w=0;w<d;w++)y+=p[m+w]&&Math.pow(2,d-w-1);return y},h=function(p){return function(m){for(var d=t()(m),y=new Array(8),w=0;w<8;w++)y[7-w]=!!(d&1<<w);return Object.keys(p).reduce(function(x,b){var S=p[b];return S.length?x[b]=u(y,S.index,S.length):x[b]=y[S.index],x},{})}};return aa.readBits=h,aa}var E4;function dT(){return E4||(E4=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=f7(),n=h7(),r={blocks:function(m){for(var d=0,y=[],w=m.data.length,x=0,b=(0,n.readByte)()(m);b!==d&&b;b=(0,n.readByte)()(m)){if(m.pos+b>=w){var S=w-m.pos;y.push((0,n.readBytes)(S)(m)),x+=S;break}y.push((0,n.readBytes)(b)(m)),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(p){var m=(0,n.peekBytes)(2)(p);return m[0]===33&&m[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(p,m,d){return Math.pow(2,d.descriptor.lct.size+1)})},function(p,m,d){return d.descriptor.lct.exists}),{data:[{minCodeSize:(0,n.readByte)()},r]}]},function(p){return(0,n.peekByte)()(p)===44}),o=(0,t.conditional)({text:[{codes:(0,n.readBytes)(2)},{blockSize:(0,n.readByte)()},{preData:function(m,d,y){return(0,n.readBytes)(y.text.blockSize)(m)}},r]},function(p){var m=(0,n.peekBytes)(2)(p);return m[0]===33&&m[1]===1}),s=(0,t.conditional)({application:[{codes:(0,n.readBytes)(2)},{blockSize:(0,n.readByte)()},{id:function(m,d,y){return(0,n.readString)(y.blockSize)(m)}},r]},function(p){var m=(0,n.peekBytes)(2)(p);return m[0]===33&&m[1]===255}),u=(0,t.conditional)({comment:[{codes:(0,n.readBytes)(2)},r]},function(p){var m=(0,n.peekBytes)(2)(p);return m[0]===33&&m[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(p,m){return Math.pow(2,m.lsd.gct.size+1)})},function(p,m){return m.lsd.gct.exists}),{frames:(0,t.loop)([i,s,u,a,o],function(p){var m=(0,n.peekByte)()(p);return m===33||m===44})}],c=h;e.default=c})(wm)),wm}var Yd={},k4;function pT(){if(k4)return Yd;k4=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 w=n.slice(y*r,(y+1)*r);i.splice.apply(i,[d*r,r].concat(w))},s=[0,4,2,1],u=[8,8,4,2],h=0,c=0;c<4;c++)for(var p=s[c];p<a;p+=u[c])o(p,h),h++;return i};return Yd.deinterlace=e,Yd}var Xd={},A4;function gT(){if(A4)return Xd;A4=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,p,m,d,y,O,w,x,M,b,R,j,L,D,S=new Array(i),k=new Array(a),E=new Array(a),A=new Array(a+1);for(b=n,h=1<<b,m=h+1,u=h+2,y=o,p=b+1,c=(1<<p)-1,w=0;w<h;w++)k[w]=0,E[w]=w;var M,O,R,j,D,L;for(M=O=R=j=D=L=0,x=0;x<s;){if(j===0){if(O<p){M+=r[L]<<O,O+=8,L++;continue}if(w=M&c,M>>=p,O-=p,w>u||w==m)break;if(w==h){p=b+1,c=(1<<p)-1,u=h+2,y=o;continue}if(y==o){A[j++]=E[w],y=w,R=w;continue}for(d=w,w==u&&(A[j++]=R,w=y);w>h;)A[j++]=E[w],w=k[w];R=E[w]&255,A[j++]=R,u<a&&(k[u]=y,E[u]=R,u++,(u&c)===0&&u<a&&(p++,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 P4;function mT(){if(P4)return uc;P4=1,Object.defineProperty(uc,"__esModule",{value:!0}),uc.decompressFrames=uc.decompressFrame=uc.parseGIF=void 0;var e=a(dT()),t=f7(),n=h7(),r=pT(),i=gT();function a(c){return c&&c.__esModule?c:{default:c}}var o=function(p){var m=new Uint8Array(p);return(0,t.parse)((0,n.buildStream)(m),e.default)};uc.parseGIF=o;var s=function(p){for(var m=p.pixels.length,d=new Uint8ClampedArray(m*4),y=0;y<m;y++){var w=y*4,x=p.pixels[y],b=p.colorTable[x]||[0,0,0];d[w]=b[0],d[w+1]=b[1],d[w+2]=b[2],d[w+3]=x!==p.transparentIndex?255:0}return d},u=function(p,m,d){if(!p.image){console.warn("gif frame does not have associated image.");return}var y=p.image,w=y.descriptor.width*y.descriptor.height,x=(0,i.lzw)(y.data.minCodeSize,y.data.blocks,w);y.descriptor.lct.interlaced&&(x=(0,r.deinterlace)(x,y.descriptor.width));var b={pixels:x,dims:{top:p.image.descriptor.top,left:p.image.descriptor.left,width:p.image.descriptor.width,height:p.image.descriptor.height}};return y.descriptor.lct&&y.descriptor.lct.exists?b.colorTable=y.lct:b.colorTable=m,p.gce&&(b.delay=(p.gce.delay||10)*10,b.disposalType=p.gce.extras.disposal,p.gce.extras.transparentColorGiven&&(b.transparentIndex=p.gce.transparentColorIndex)),d&&(b.patch=s(b)),b};uc.decompressFrame=u;var h=function(p,m){return p.frames.filter(function(d){return d.image}).map(function(d){return u(d,p.gct,m)})};return uc.decompressFrames=h,uc}var O4=mT();function xm(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 vT=Jr(({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(fr,{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(ly,{ref:n,x:e.width/2,y:e.height/2,fill:"white",outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270}))}),yT=Jr(({element:e})=>{const t=Math.max(10,Math.min(30,e.width/22));return oe.createElement(fr,{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}))}),bT=Jr(({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,p]=(function(j){const[D,L]=oe.useState([]),[T,$]=oe.useState(0),[U,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=O4.parseGIF(re),B=O4.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);L(Y),$(J),te("loaded")}catch(Q){console.error("Failed to load GIF:",Q),te("failed")}})()},[j]),[D,T,se,U]})(e.src);mp(p,e.src,e.id),oe.useEffect(()=>(s.current=document.createElement("canvas"),()=>{s.current&&un.Util.releaseCanvas(s.current)}),[]),oe.useEffect(()=>{if(p==="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");xm(u[0],s.current,D)}}},[c,p,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"),L=j.getContext("2d");L&&L.clearRect(0,0,j.width,j.height);let T=-1;xm(u[0],j,D),k(),T=0;const $=U=>{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})(U);te!==T&&(xm(u[te],j,D),k(),o.current.getLayer().draw(),T=te)};if(t.isPlaying||e.page._exportingOrRendering)return $u(()=>{$(t.currentTime-e.page.startTime)});{const U=window.setInterval(()=>{$(t.currentTime||performance.now())},16);return()=>{clearInterval(U)}}},[t.isPlaying,u,h,e.page._exportingOrRendering]),oe.useEffect(()=>{h&&t.history.ignore(()=>{e.set({duration:h})})},[h]);let{cropX:m,cropY:d,cropWidth:y,cropHeight:w}=e;p!=="loaded"&&(m=d=0,y=w=1);const x={x:c.width*m,y:c.height*d,width:c.width*y,height:c.height*w},b=(n=e.cornerRadius)!==null&&n!==void 0?n:0,[S,k]=l7(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,w,e._cropModeEnabled,c.width,c.height]);const E=p==="loading",A=p==="failed",M=E||A?0:e.a.opacity;Up(o,M);const O=e.selectable||t.role==="admin",R=Tf();return oe.createElement(oe.Fragment,null,E&&oe.createElement(vT,{element:e}),A&&oe.createElement(yT,{element:e}),oe.createElement(Du,{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:M,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:x,listening:O,draggable:R?e.draggable&&a:e.draggable,preventDefault:!R||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,L=Math.abs(D.scaleX()-1)<1e-7?1:D.scaleX(),T=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()*L,height:D.height()*T,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:M,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}))}),wT={stroke:"rgb(0, 161, 255)",strokeWidth:2},xT=Jr(({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},wT)));let Nl=(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 _T=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=wc(t);return{pages:c.pages,width:c.width,height:c.height,custom:c.custom,audios:c.audios}}function h(c){const p=t.pages.map(w=>w.id),m=c.pages.map(w=>w.id),d=!vp(p,m),y=!vp(t.custom,c.custom);d?kv(t.pages,c.pages):t.pages.forEach((w,x)=>{kv(w,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,p=!1,m=!1){m&&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 w=y!==o,x=!w;e.endTransaction(x),p||d||e.replaceState(),w||(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=IO(e,".."),!t)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");n=lx(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 q1(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 _m=null;function ST(){var e;return!((e=window.jspdf)===null||e===void 0)&&e.jsPDF?Promise.resolve(window.jspdf.jsPDF):_m||(_m=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)}),_m)}function ET(){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 kT({width:e,height:t}){return new(await ET())({workers:4,width:e,height:t,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
285
- (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]);
286
- `],{type:"application/javascript"}))})}const AT="https://api.polotno.com",PT=()=>AT+"/api",d7=Qn({value:!1}),p7=Qn({value:"v1"}),OT=()=>p7.value,CT=()=>d7.value,LT=qn(()=>{d7.value=!0});let op=typeof window<"u"?window.location.origin:"";const NT=typeof navigator<"u"&&navigator.userAgent.indexOf("Headless")>-1,TT=typeof navigator<"u"&&navigator.userAgent.indexOf("Electron")>-1;op==="file://"&&NT&&(op="headless"),op==="file://"&&TT&&(op="electron");const RT=`%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 MT=fetch;async function IT(e){for(let t=0;t<5;t++)try{const n=await MT(PT()+"/validate-key",{method:"POST",body:JSON.stringify({key:e,site:location.host,skdVersion:"2.34.1"})});if(vc(()=>{p7.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(RT,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),rx(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 jT(e,t){await IT(e)&&!t||LT()}const Sm=[112,72,89,115],DT=(()=>{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})(),C4=()=>typeof globalThis<"u"?globalThis.Buffer:void 0,L4=(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},FT=(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=C4();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=(m=>{const d=new Uint8Array(9),y=new DataView(d.buffer);y.setUint32(0,m,!1),y.setUint32(4,m,!1),d[8]=1;const w=new Uint8Array(8+d.length+4);L4(w,0,d.length),w.set(Sm,4),w.set(d,8);const x=new Uint8Array(4+d.length);return x.set(Sm,0),x.set(d,4),L4(w,8+d.length,(b=>{let S=4294967295;for(let k=0;k<b.length;k++)S=DT[255&(S^b[k])]^S>>>8;return(4294967295^S)>>>0})(x)),w})(Math.round(s/.0254)),h=((m,d)=>{let y=8;for(;y+8<=m.length;){const w=m[y]<<24|m[y+1]<<16|m[y+2]<<8|m[y+3],x=y+4,b=m.subarray(x,x+4),S=8+w+4;if(d.every((k,E)=>b[E]===k))return{offset:y,totalLength:S};y+=S}return null})(o,Sm);if(h){const m=new Uint8Array(o.length-h.totalLength+u.length);return m.set(o.slice(0,h.offset),0),m.set(u,h.offset),m.set(o.slice(h.offset+h.totalLength),h.offset+u.length),m}const c=16+(o[8]<<24|o[9]<<16|o[10]<<8|o[11])+4;if(c>o.length)return o;const p=new Uint8Array(o.length+u.length);return p.set(o.slice(0,c),0),p.set(u,c),p.set(o.slice(c),c+u.length),p})(i,n):((o,s)=>{const u=(p=>{let m=2;for(;m+4<p.length;){if(p[m]!==255)return-1;const d=p[m+1];if(d===216||d===217){m+=2;continue}const y=p[m+2]<<8|p[m+3];if(y<2)return-1;if(d===224&&p[m+4]===74&&p[m+5]===70&&p[m+6]===73&&p[m+7]===70&&p[m+8]===0)return m;const w=m+2+y;if(w<=m||w>p.length)return-1;m=w}return-1})(o);if(u>=0){const p=new Uint8Array(o),m=u+11;return p[m]=1,p[m+1]=s>>8&255,p[m+2]=255&s,p[m+3]=s>>8&255,p[m+4]=255&s,p}const h=(p=>{const m=new Uint8Array(18);return m[0]=255,m[1]=224,m[2]=0,m[3]=16,m[4]=74,m[5]=70,m[6]=73,m[7]=70,m[8]=0,m[9]=1,m[10]=1,m[11]=1,m[12]=p>>8&255,m[13]=255&p,m[14]=p>>8&255,m[15]=255&p,m})(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=C4();if(s)return s.from(o).toString("base64");throw new Error("No base64 encoder available")})(a)}`},og=({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}},N4=({px:e,precious:t=2,dpi:n=72,unit:r="px"})=>parseFloat(og({px:e,dpi:n,unit:r}).toFixed(t)),T4=({unitVal:e,dpi:t,unit:n})=>e/og({px:1,unit:n,dpi:t}),BT=e=>{const t=parseFloat(og(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 zT(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 qT(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 p,m;const d=u/h;return t.type==="svg"?(p=u,m=h):c>=d?(p=u,m=u/c):(p=h*c,m=h),a.drawImage(r,o*r.width,s*r.height,p,m,0,0,i.width,i.height),i.toDataURL("image/png")}function g7(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 m7(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=`
287
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
288
- <filter id="warm-filter" color-interpolation-filters="sRGB">
289
- <feColorMatrix type="matrix" values="
290
- ${i} 0 0 0 0
291
- 0 ${a} 0 0 0
292
- 0 0 ${o} 0 0
293
- 0 0 0 1 0" />
294
- </filter>
295
- </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=`
296
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
297
- <filter id="cold-filter" color-interpolation-filters="sRGB">
298
- <feColorMatrix type="matrix" values="
299
- ${i} 0 0 0 0
300
- 0 ${a} 0 0 0
301
- 0 0 ${o} 0 0
302
- 0 0 0 1 0" />
303
- </filter>
304
- </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=`
305
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
306
- <filter id="temperature-filter" color-interpolation-filters="sRGB">
307
- <feColorMatrix type="matrix" values="
308
- ${i} 0 0 0 0
309
- 0 ${a} 0 0 0
310
- 0 0 ${o} 0 0
311
- 0 0 0 1 0" />
312
- </filter>
313
- </svg>
314
- `,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=`
315
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
316
- <filter id="contrast-filter" color-interpolation-filters="sRGB">
317
- <feComponentTransfer>
318
- <feFuncR type="linear" slope="${i}" intercept="${a}" />
319
- <feFuncG type="linear" slope="${i}" intercept="${a}" />
320
- <feFuncB type="linear" slope="${i}" intercept="${a}" />
321
- </feComponentTransfer>
322
- </filter>
323
- </svg>
324
- `,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=`
325
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
326
- <filter id="shadows-filter" color-interpolation-filters="sRGB">
327
- <feComponentTransfer>
328
- <feFuncR type="gamma" amplitude="1" exponent="${i}" offset="0" />
329
- <feFuncG type="gamma" amplitude="1" exponent="${i}" offset="0" />
330
- <feFuncB type="gamma" amplitude="1" exponent="${i}" offset="0" />
331
- </feComponentTransfer>
332
- </filter>
333
- </svg>
334
- `,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,p=u*o,m=u*i,d=u*a+s,y=u*o,w=u*i,x=u*a,b=u*o+s;return n.filter="url(#vibrance-filter)",n.html=`
335
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
336
- <filter id="vibrance-filter" color-interpolation-filters="sRGB">
337
- <feColorMatrix type="matrix" values="
338
- ${h} ${c} ${p} 0 0
339
- ${m} ${d} ${y} 0 0
340
- ${w} ${x} ${b} 0 0
341
- 0 0 0 1 0" />
342
- </filter>
343
- </svg>
344
- `,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,p=s*.2126,m=s*.7152+o,d=s*.0722,y=s*.2126,w=s*.7152,x=s*.0722+o;return n.filter="url(#saturation-filter)",n.html=`
345
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
346
- <filter id="saturation-filter" color-interpolation-filters="sRGB">
347
- <feColorMatrix type="matrix" values="
348
- ${u} ${h} ${c} 0 0
349
- ${p} ${m} ${d} 0 0
350
- ${y} ${w} ${x} 0 0
351
- 0 0 0 1 0" />
352
- </filter>
353
- </svg>
354
- `,n}default:return null}}async function UT(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 HT=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 v7(e){return ua(e),e}const s0=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=vy(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 Jb(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,L=await Jb(D);a["mask-image"]=`url(${L})`,a["mask-size"]="100% 100%",a["mask-position"]="0 0",a["mask-repeat"]="no-repeat",a["-webkit-mask-image"]=`url(${L})`,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,p;const m=s/u,d=e.type==="svg"||e.stretchEnabled;d?(c=s,p=u):h>=m?(c=s,p=s/h):(c=u*h,p=u);const y=c/o.width,w=p/o.height,x=c/p>e.width/e.height?e.height/p:e.width/c,b=d?e.width/c:x,S=d?e.height/p:x,k=c*b/y,E=p*S/w;let A=e.cropX*b*o.width,M=e.cropY*S*o.height;e.flipX&&(A=(1-e.cropX-e.cropWidth)*b*o.width),e.flipY&&(M=(1-e.cropY-e.cropHeight)*S*o.height);const O=e.borderSize&&ua(e.borderColor),R=O?Math.max(0,e.cornerRadius-e.borderSize):e.cornerRadius,j=_r("div",{style:Object.assign(Object.assign({},a),{width:"100%",height:"100%",borderRadius:R+"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(M)+"px"})});return O?_r("div",{style:{width:"100%",height:"100%",borderRadius:e.cornerRadius+"px",background:v7(e.borderColor),padding:e.borderSize+"px",boxSizing:"border-box"}},j):j},R4=({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},$T={image:s0,svg:s0,text:async({element:e,page:t,store:n})=>{const r=ua(e.fill),i=ua(e.stroke);if(e.curveEnabled){const x=ph(e.width,e.height,e.curvePower,e.fontSize),b=Ho(e.text).replace(/\n/g," ");let S=`
355
- <svg xmlns="http://www.w3.org/2000/svg" width="${e.width}" height="${e.height}" style="display: block;">
356
- <defs>
357
- <path id="curve-${e.id}" d="${x}" fill="none" />`;if(r){const M=`curve-fill-grad-${e.id}`;S+=ad(e.fill,M)}if(i&&e.strokeWidth){const M=`curve-stroke-grad-${e.id}`;S+=ad(e.stroke,M)}S+=`</defs>
358
- <text
359
- font-family="'${e.fontFamily}'"
360
- font-size="${e.fontSize}"
361
- font-weight="${e.fontWeight}"
362
- font-style="${e.fontStyle}"
363
- fill="${r?`url(#curve-fill-grad-${e.id})`:e.fill}"
364
- text-anchor="middle"
365
- dominant-baseline="central"
366
- 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"`:""}>
367
- <textPath href="#curve-${e.id}" startOffset="50%">
368
- ${b}
369
- </textPath>
370
- </text>
371
- </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(`
372
- `).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}),M=_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,M))}const p=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}),m="el-"+e.id,d=h?{id:m}:{},y=`<style>#${m} {${Np}}</style>`,w=_r("div",Object.assign(Object.assign({style:p},d),{innerHTML:h?`${y}${c}`:c}));return _r("div",{style:{position:"relative",width:"100%",height:"100%"}},u,w)},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})`},R4({element:e,type:e.startHead})),_r("g",{transform:`translate(${e.width} ${e.height/2}) rotate(180)`},R4({element:e,type:e.endHead}))),figure:async({element:e,page:t,store:n,elementHook:r})=>{let i=c7(e);if(e.strokeWidth&&ua(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(ua(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=>y7({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 UT(e.src),h=u.width*o,c=u.height*s,p=e.width/e.height;let m,d;p>=h/c?(m=h,d=h/p):(m=c*p,d=c);const y=m/o,w=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(w*S)}px`,left:-Math.round(x*S)+"px",top:-Math.round(b*S)+"px",objectFit:"fill"},E=`video-${e.id}`,A=e.borderSize&&ua(e.borderColor),M=A?Math.max(0,e.cornerRadius-e.borderSize):e.cornerRadius,O=_r("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",borderRadius:M+"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 R=_r("div",{style:{width:"100%",height:"100%",borderRadius:e.cornerRadius+"px",background:v7(e.borderColor),padding:e.borderSize+"px",boxSizing:"border-box"}},O);return r&&r({dom:R,element:e})||R}return r&&r({dom:O,element:e})||O},gif:s0};async function y7({element:e,page:t,store:n,elementHook:r}){var i;let a=await $T[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,p]of Object.entries(e.filters)){const m=m7(il[c],p.intensity);m&&(s.push(m.filter),m.html&&u.push(m.html))}if(e.shadowEnabled){const c=(function(p,m){if(m===1)return p;const d=un.Util.colorToRGBA(p);return d?`rgba(${d.r}, ${d.g}, ${d.b}, ${d.a*m})`:p})(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 GT({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=>y7({element:d,page:o,store:s,elementHook:u}))),c=o.width==="auto"?s.width:o.width,p=o.height==="auto"?s.height:o.height;let m={};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),w=await s0({element:Object.assign({x:0,y:0,width:c,height:p,src:o.background,cornerRadius:0},g7({width:c,height:p},{width:d,height:y})),page:o,store:s});h.unshift(w)}else m=Object.assign(Object.assign({},m),{backgroundColor:o.background});return _r("div",{className:"page",id:o.id,style:Object.assign(Object.assign({},m),{width:c+"px",height:p+"px",overflow:"hidden",position:"relative"})},...h)})({page:a,store:e,elementHook:t}))),r=[];vi({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=>`
373
- @font-face {
374
- font-family: '${o.fontFamily}';
375
- src: ${u.src};
376
- font-style: ${u.fontStyle||"normal"};
377
- font-weight: ${u.fontWeight||"normal"};
378
- font-display: swap;
379
- }`).join(`
380
- `);return _r("style",{},s)}return _r("link",{href:tx(a),rel:"stylesheet"})});return _r("div",{className:"design"},...i,...n)}const b7=({dom:e})=>{if(typeof e=="string")return e;if(!e)return"";const t=e.props,{innerHTML:n}=t,r=HT(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=>b7({dom:a})).join("")}</${e.type}>`};async function WT({json:e,elementHook:t}){const n=await GT({json:e,elementHook:t});return b7({dom:n})}var VT=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 w7=(e,t)=>{if(e.children)for(const n of e.children){if(t(n)===!0)break;w7(n,t)}},en=(e,t,...n)=>({type:e,props:t,children:n||[]});function Jf(e,t){if(!ua(e))return null;const{stops:n,rotation:r}=qp(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:p})=>en("stop",{offset:100*c+"%","stop-color":p}));return en("linearGradient",{id:t,x1:100*a+"%",y1:100*o+"%",x2:100*s+"%",y2:100*u+"%"},...h)}const Em=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}},km=async({element:e,page:t,store:n})=>{let{src:r}=e;if(e.type==="svg"){const z=await Gp(r);r=vy(z,new Map(Object.entries(e.colorsReplace)))}else r=await Em(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 Em(e.clipSrc)),e.maskSrc&&(o=`mask-img-${e.id}`,s=await Em(e.maskSrc));const h=await Wp(r),c=h.width*e.cropWidth,p=h.height*e.cropHeight,m=e.width/e.height;let d,y;const w=c/p,x=typeof e.stretchEnabled=="boolean"&&e.stretchEnabled||e.type==="svg";x?(d=c,y=p):m>=w?(d=c,y=c/m):(d=p*m,y=p);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,M=d*E/b,O=y*A/S;let R=e.cropX*h.width*E,j=e.cropY*h.height*A;e.flipX&&(R=(1-e.cropX-e.cropWidth)*h.width*E),e.flipY&&(j=(1-e.cropY-e.cropHeight)*h.height*A);const D=`clip-${e.id}`,L=e.cornerRadius||0,T=r.replace(/&/g,"&amp;"),$={x:-R,y:-j,width:M,height:O,preserveAspectRatio:"none","clip-path":`url(#${D})`},U=[en("clipPath",{id:D},en("rect",{x:0,y:0,width:e.width,height:e.height,rx:L||void 0,ry:L||void 0}))];i&&a&&U.push(en("mask",{id:i,maskUnits:"userSpaceOnUse","mask-type":"alpha"},en("image",{href:a.replace(/&/g,"&amp;"),x:0,y:0,width:e.width,height:e.height,preserveAspectRatio:"none"}))),o&&U.push(en("mask",{id:o,maskUnits:"userSpaceOnUse","mask-type":"alpha"},en("image",Object.assign({href:T},$))));let te=T;const se={};o&&s&&(te=s.replace(/&/g,"&amp;"),se.mask=`url(#${o})`);const ee={};i&&(ee.mask=`url(#${i})`);const Q=e.borderSize||0,re=Q>0&&ua(e.borderColor),X=re?`border-grad-${e.id}`:null;if(re){const z=Jf(e.borderColor,X);z&&U.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,L-Q)||void 0,ry:Math.max(0,L-Q)||void 0}):null,F=en("g",{},en("defs",{},...U),en("image",Object.assign(Object.assign({href:te},$),se)),B);return en("g",ee,u?en("g",{transform:u},F):F)},M4=({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},YT={image:km,svg:km,text:async({element:e,page:t,store:n})=>{const r=ua(e.fill),i=ua(e.stroke);if(e.curveEnabled){const k=ph(e.width,e.height,e.curvePower,e.fontSize),E=`curve-path-${e.id}`,A=Ho(e.text).replace(/\n/g," "),M=e.backgroundPadding*(e.fontSize*e.lineHeight*.5),O=e.backgroundEnabled?en("rect",{x:-M,y:-M,width:e.width+2*M,height:e.height+2*M,fill:e.backgroundColor,opacity:e.backgroundOpacity,rx:e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5),ry:e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5)}):null,R=[en("path",{id:E,d:k,fill:"none"})],j=e.strokeWidth&&(i||r&&!i);if(r){const D=`curve-fill-grad-${e.id}`,L=Jf(e.fill,D);L&&R.push(L)}if(i&&e.strokeWidth){const D=`curve-stroke-grad-${e.id}`,L=Jf(e.stroke,D);L&&R.push(L)}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"},L=i?`url(#curve-stroke-grad-${e.id})`:e.stroke,T=en("text",Object.assign(Object.assign({},D),{fill:L,"stroke-width":e.strokeWidth,stroke:L}),en("textPath",{href:`#${E}`,startOffset:"50%",innerHTML:A})),$=r?`url(#curve-fill-grad-${e.id})`:e.fill,U=en("text",Object.assign(Object.assign({},D),{fill:$}),en("textPath",{href:`#${E}`,startOffset:"50%",innerHTML:A}));return en("g",{},O,en("defs",{},...R),T,U)}return en("g",{},O,en("defs",{},...R),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,M,O,R=0)=>{const j=document.createElement("canvas").getContext("2d");return j.font=`${O} ${M} ${E}px ${A}`,j.measureText(k).width+Math.max(0,(k?k.length:0)-1)*R*E},o=(k,E,A,M,O,R,j=0)=>{const D=[];return k.split(`
381
- `).forEach(L=>{const T=L.split(" ");let $="";for(let U=0;U<T.length;U++){const te=$+T[U]+" ";a(te,A,M,O,R,j)>E+.5&&U>0?(D.push($.trim()),$=T[U]+" "):$=te}D.push($.trim())}),D};let s=Ho(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,p=h.length*c;let m=u;e.verticalAlign==="middle"?m=(e.height-p)/2+u:e.verticalAlign==="bottom"&&(m=e.height-p+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})),w=e.backgroundPadding*(u*e.lineHeight*.5),x=e.backgroundEnabled?en("rect",{x:-w,y:-w,width:e.width+2*w,height:e.height+2*w,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:m,"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(R=>en("tspan",R.props,R.props.innerHTML))),M=r?`url(#text-fill-grad-${e.id})`:e.fill,O=en("text",Object.assign(Object.assign({},k),{fill:M}),...y.map(R=>en("tspan",R.props,R.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:m,"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})`},M4({element:e,type:e.startHead})),en("g",{transform:`translate(${e.width} ${e.height/2}) rotate(180)`},M4({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})(c7(e));const a=[];if(e.strokeWidth&&ua(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(ua(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=>x7({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:km};async function x7({element:e,page:t,store:n,elementHook:r}){var i;let a=await YT[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,p]of Object.entries(e.filters)){const m=m7(il[c],p.intensity);if(m&&(s.push(m.filter),m.html)){const d=m.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 I4(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 XT({json:e,elementHook:t,fontEmbedding:n="inline"}){const r=[];w7({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 p=s.find(m=>m.fontFamily===u);if(p){const m=await I4(p.url);return en("style",{},`@font-face { font-family: ${u}; src: url(${m}); }`)}{const m=`https://fonts.googleapis.com/css?family=${u}:bi,normal,i,b`;try{const d=await fetch(m),y=await d.text(),w=(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(!w?.length)throw new Error("No font URLs found");const x=await Promise.all(w.map(async b=>{const S=await I4(b),k=y.match(/font-style:\s*(.*?);/),E=y.match(/font-weight:\s*(.*?);/),A=k?k[1]:"normal",M=E?E[1]:"normal";return`@font-face {
382
- font-family: ${u};
383
- font-style: ${A};
384
- font-weight: ${M};
385
- src: url(${S});
386
- }`}));return en("style",{},x.join(`
387
- `))}catch(d){return console.error("Error embedding Google Font:",d),en("defs",{},en("style",{type:"text/css",innerHTML:`@import url('${m}');`.replace(/&/g,"&amp;")}))}}}))})(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=>x7({element:d,page:s,store:u,elementHook:h}))),p=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 m;if(p){const d=await Wp(s.background);m=await qT(s.background,Object.assign({width:u.width,height:u.height,x:0,y:0},g7({width:u.width,height:u.height},{width:d.width,height:d.height})))}return en("g",{className:"page",style:{}},p?en("image",{"xlink:href":m,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:p?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 _7=({dom:e,nestLevel:t=0})=>{if(typeof e=="string")return e;if(!e)return"";const n=e.props,{innerHTML:r}=n,i=VT(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||`
388
- `+e.children.map(s=>_7({dom:s,nestLevel:t+1})).join("")}${o}</${e.type}>
389
- `};async function KT({json:e,elementHook:t,fontEmbedding:n="inline"}){const r=await XT({json:e,elementHook:t,fontEmbedding:n});return _7({dom:r})}const yp=Dt.model("Page",{id:Dt.identifier,children:Dt.array(Dt.late(()=>L7)),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(wc(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=Nl(10),vi(o,s=>{s.id=Nl(10)})});const r=Object.assign(Object.assign(Object.assign({},n),{id:Nl(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=Ay[t.type];if(!r)return void console.error("Can not find model with type "+t.type);"children"in t&&Array.isArray(t.children)&&vi(t,o=>{o.id=o.id||Nl(10)});const i=e.children.reduce((o,s)=>{if(s.type==="group"){const u=s.children.reduce((h,c)=>{var p;const m=(p=c.name)===null||p===void 0?void 0:p.match(new RegExp(`${t.type}-(\\d+)`));if(m){const d=parseInt(m[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:Nl(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=M=>M.type==="image"&&M.x<1&&M.y<1&&M.width>=e.computedWidth-2&&M.height>=e.computedHeight-2;vi(e,M=>{M.type!=="group"&&(o(M)||a.push(M))});const s=a.length?ag(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,p=Math.max(0,h-c),m=Math.max(0,Math.min(s.y,e.computedHeight-s.y-s.height)),d=e.computedHeight*u,y=Math.max(0,m-d),w=e.computedWidth-2*p,x=e.computedHeight-2*y,b=t/w,S=n/x,k=Math.min(b,S),E=(t-w*k)/2-p*k,A=(n-x*k)/2-y*k;vi(e,M=>{M.type!=="group"&&(o(M)?M.set({x:M.x*k,y:M.y*k,width:M.width*b,height:M.height*S,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(M.set({x:E+M.x*k,y:A+M.y*k,width:M.width*k,height:M.height*k}),M.type==="text"?M.set({fontSize:M.fontSize*k}):M.type==="figure"&&M.set({strokeWidth:M.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})}})),j4=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({},wc(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};LO("ignore");const ZT=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(ZT),audios:Dt.array(j4),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(_T,{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 vi({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 vi({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 vi({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||(jT(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:Nl(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);s2(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:Nl(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=>{s2(r)}),e.selectedElementsIds=e.selectedElementsIds.filter(r=>e.getElementById(r))},on(t,n){if(t==="change"){let r=e.toJSON();return lx(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,_exportCanvases:u}={}){var h;const c=t||1;r=r||((h=e.pages[0])===null||h===void 0?void 0:h.id);const p=e.pages.find(U=>U.id===r);if(!p)throw new Error(`No page for export with id ${r}`);const m=e._elementsPixelRatio;c>e._elementsPixelRatio&&e.setElementsPixelRatio(c),s?p?.set({_forceMount:!0}):p?.set({_exporting:!0});const d=await zT(()=>{const U=un.stages.filter(te=>te.getAttr("pageId")===r);return U.length===0?null:U});if(!d)throw p?.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.`);d.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 y=d[0];await e.waitLoading({_skipTimeout:o});const w=y.findOne(".page-container");if(!w)throw e.setElementsPixelRatio(m),p?.set({_forceMount:!1,_exporting:!1}),new Error("Export is failed. Canvas was unmounted.");const x=y.position();y.position({x:0,y:0}),y.find("Transformer").forEach(U=>{U.setAttr("oldVisible",U.visible()),U.visible(!1)}),w.find(".page-background").forEach(U=>U.shadowEnabled(!1)),w.find(".page-background").forEach(U=>U.strokeEnabled(!1)),w.find(".highlighter").forEach(U=>U.visible(!1));const b=w.findOne(".page-background-group"),S=b.clip();b.clip({x:null,y:null,width:null,height:null});const k=w.findOne(".elements-container"),E=k.clip();k.clip({x:null,y:null,width:null,height:null});const A=w.find(U=>!U.visible()&&U.getAttr("editModeEnabled")&&!U.getAttr("hideInExport"));A.forEach(U=>{U.setAttr("oldVisible",U.visible()),U.show()});const M=w.find(U=>U.getAttr("hideInExport"));M.forEach(U=>{U.setAttr("oldVisible",U.visible()),U.hide()}),n&&w.find(".page-background").forEach(U=>U.hide());const O=a?p.bleed:0;let R=O;!e.bleedVisible&&a||(e.bleedVisible||a?e.bleedVisible&&a?R=0:e.bleedVisible&&!a&&(R=-p.bleed):R=0);const j=p.computedWidth+2*O,D=p.computedHeight+2*O,L=w.scale();w.scale({x:1,y:1});const T=kL(w,{x:w.x()-R,y:w.y()-R,width:j,height:D,pixelRatio:c,sceneCanvas:u?.sceneCanvas,bufferCanvas:u?.bufferCanvas});w.scale(L);const $=T._canvas;if(i==="image/jpeg"){const U=$.getContext("2d");U.save(),U.globalCompositeOperation="destination-over",U.fillStyle="white",U.fillRect(0,0,$.width,$.height),U.restore()}return n&&w.find(".page-background").forEach(U=>U.show()),M.forEach(U=>{U.visible(U.getAttr("oldVisible"))}),A.forEach(U=>{U.visible(U.getAttr("oldVisible"))}),w.find(".page-background").forEach(U=>U.shadowEnabled(!0)),w.find(".page-background").forEach(U=>U.strokeEnabled(!0)),y.find("Transformer").forEach(U=>{U.visible(U.getAttr("oldVisible"))}),w.find(".highlighter").forEach(U=>U.visible(!0)),b.clip(S),k.clip(E),y.position(x),p?.set({_exporting:!1,_forceMount:!1}),await Promise.resolve(),e.setElementsPixelRatio(m),$},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:FT(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];q1(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 ST(),h=k=>og({px:k,unit:i,dpi:n}),c=t.cropMarkSize||0,p=h(c),m=s[0]||{},d=t.includeBleed?m.bleed:0,y=h(m.computedWidth+2*d+2*p),w=h(m.computedHeight+2*d+2*p);var x=new u({unit:i,orientation:y>w?"landscape":"portrait",format:[y,w],compress:!0,putOnlyUsedFonts:!0});x.deletePage(1);const b=((k,E)=>{for(var A=[],M=0;M<k.length;M+=E)A.push(k.slice(M,M+E));return A})(s,r);let S=0;for(const k of b){const E=k.map(async A=>{const M=t.includeBleed?A.bleed:0,O=A.computedWidth+2*M+2*c,R=A.computedHeight+2*M+2*c,j=h(O),D=h(R);let L=0,T=a;for(;L<10;){L+=1,L===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:T}));if($.length>20)return t.onProgress&&t.onProgress(++S/o.length*.9),{url:$,width:j,height:D,widthPx:O,heightPx:R};T*=.8}});(await Promise.all(E)).forEach(({url:A,width:M,height:O,widthPx:R,heightPx:j})=>{x.addPage([M,O],M>O?"landscape":"portrait");const D=x.getCurrentPageInfo();var L;switch(i){case"pt":L=1;break;case"mm":L=72/25.4;break;case"cm":L=72/2.54;break;case"in":L=72;break;case"px":L=.75;break;case"pc":case"em":L=12;break;case"ex":L=6;break;default:throw"Invalid unit: "+i}if(D.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:M*L,topRightY:O*L},D.pageContext.artBox={bottomLeftX:h(c+d)*L,bottomLeftY:h(c+d)*L,topRightX:h(R-c-d)*L,topRightY:h(j-c-d)*L},D.pageContext.bleedBox={bottomLeftX:h(c+d)*L,bottomLeftY:h(c+d)*L,topRightX:h(R-c-d)*L,topRightY:h(j-c-d)*L},p){x.setLineWidth(h(1));const T=p+h(d);x.line(T,0,T,p),x.line(0,T,p,T),x.line(M-T,0,M-T,p),x.line(M,T,M-p,T),x.line(0,O-T,p,O-T),x.line(T,O,T,O-p),x.line(M,O-T,M-p,O-T),x.line(M-T,O,M-T,O-p)}x.addImage(A,p,p,M-2*p,O-2*p,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 kT({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 p of e.pages)if(u+=p.duration,p.set({_rendering:u>s}),u>s){h=p.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(p){h(p.target.result)},c.readAsDataURL(u)})(s,o)})})},async saveAsGIF(t={}){var{fileName:n}=t,r=Kd(t,["fileName"]);const i=await e.toGIFDataURL(r);q1(i,n||"polotno.gif")},async toHTML({elementHook:t}={elementHook:void 0}){const n=e.toJSON();return WT({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)));q1(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 KT({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)));q1(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 hO()},toJSON:()=>({width:e.width,height:e.height,fonts:wc(e.fonts),pages:wc(e.pages),audios:wc(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&&vi({children:i.pages},h=>{if(h.type==="text"){const p=h.letterSpacing*16;h.letterSpacing=p/h.fontSize}}),a<2&&vi({children:i.pages},h=>{h.filters&&Object.keys(h.filters).forEach(c=>{if(["warm","cold","natural"].includes(c))return;const p=h.filters[c];p&&typeof p.intensity=="number"&&(p.intensity=p.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({},wc(e));Object.assign(u,i),u.history=n?e.history.toJSON():{history:[],undoIdx:-1},kv(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=>s2(n))},addAudio(t){const n=j4.create(Object.assign({id:Nl(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)||fy.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"}))),yO(r)):vO(t),Promise.all(i.map(a=>gO(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 QT({key:e,showCredit:t}={key:"",showCredit:!1}){return lh.create({_forceShowCredit:t,_key:e})}const S7=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({},wc(e))})).actions(e=>({clone(t={},{skipSelect:n=!1}={}){const r=JSON.parse(JSON.stringify(e.toJSON()));return t.id=t.id||Nl(10),vi(r,i=>{i.id=Nl(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(){}})),D4={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}}},F4={right:{cropX:-1},left:{cropX:1},up:{cropY:1},down:{cropY:-1}},JT={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 GN({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,p=c<=1?c:2-c;for(let m in u){const d=u[m],y=h[m]-d;s[m]=d+p*y}return s},move:({dTime:e,element:t,animation:n})=>{var r;const i=D4[n.data.direction]||D4.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,p=t[s]+h-c;o[s]=c+e/n.duration*p}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),p=(h*s-c*u)/2,m=(h*u+c*s)/2,d={x:t.x+p,y:t.y+m,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 w in d){let x=d[w],b=y[w];if(n.type==="exit"){const k=x;x=b,b=k}const S=b-x;i[w]=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=F4[s]||F4.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 p=e/n.duration,m=c*(1-p),d=Math.sin(12*p)*m*.7+Math.sin(8*p)*m*.3;n.type==="exit"&&Math.max(t.cropWidth||1,t.cropHeight||1),n.type;const y=1-Math.pow(1-p,2),w=t.cropX||0,x=t.cropY||0,b=t.cropWidth||1,S=t.cropHeight||1,k=b,E=S;let A,M,O=0,R=0;if(u.cropX){const j=u.cropX>0?1-(w+b):w;O=Math.min(j,Math.abs(h))*u.cropX}if(u.cropY){const j=u.cropY>0?1-(x+S):x;R=Math.min(j,Math.abs(h))*u.cropY}return n.type==="enter"?(A=u.cropX?w+O*(1-y):w,M=u.cropY?x+R*(1-y):x):(A=u.cropX?w+O*y:w,M=u.cropY?x+R*y:x),o.cropX=Math.max(0,Math.min(1-k,A+d*k)),o.cropY=Math.max(0,Math.min(1-E,M+d*E)),o.cropWidth=k,o.cropHeight=E,o}},Am=({element:e,dTime:t,animation:n})=>{const r=JT[n.name];return r?r({element:e,dTime:t,animation:n}):(console.error("Can not find animation type: "+n.name),{})},eR=Dt.model("Animation",{delay:0,duration:500,enabled:!0,type:Dt.enumeration("Type",["enter","exit","loop"]),name:"none",data:Dt.frozen({})}),Pm=(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},tR=Dt.model("ShapeFilter",{intensity:1}),B4=["temperature","contrast","highlights","shadows","white","black","saturation","vibrance"],Vp=S7.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:Dt.array(eR),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,filters:Dt.map(tR),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=qn(i=>{Object.assign(t,i)}),r=qn(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(m=>m.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 m=a-s.delay,d=Am({element:e,animation:s,dTime:m}),y=Pm(e,d);r(y)}const c=e.animations.find(m=>m.type==="exit");if(!u&&!h&&c?.enabled&&a>=e.page.duration-c.duration-c.delay&&a<=e.page.duration-c.delay){const m=a-(e.page.duration-c.duration-c.delay),d=Am({element:e,animation:c,dTime:m}),y=Pm(e,d);r(y)}c?.enabled&&a>=e.page.duration-c.delay&&n({opacity:0});const p=e.animations.find(m=>m.type==="loop");if(p?.enabled){const m=Am({element:e,animation:p,dTime:a}),d=Pm(e,m);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){B4.includes(t)||e.filters.forEach((r,i)=>{B4.includes(i.toString())||e.filters.delete(i.toString())}),n==null?e.filters.delete(t):e.filters.set(t,{intensity:n})}})),E7=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()}})),sg=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)}}}}),k7=sg.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1}),A7=Vp.named("Line").props({type:"line",width:400,height:10,color:"black",dash:Dt.array(Dt.number),startHead:"",endHead:""}).actions(e=>({})),P7=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)}})),O7=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}),C7=sg.named("Gif").props({type:"gif",duration:0,keepRatio:!0});var nR=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 vi=(e,t)=>{if(e.children)for(const n of e.children){if(t(n)===!0)break;vi(n,t)}},rR=[...new Array(20)].map((e,t)=>Dt.late(()=>iR[t])),L7=Dt.union({dispatcher:e=>{const t=Ay[e.type];if(!t)throw new Error(`Unknown element type: "${e.type}"`);return t}},P7,E7,sg,A7,k7,O7,C7,Dt.late(()=>sd),...rR),sd=S7.named("Group").props({type:"group",children:Dt.array(L7)}).views(e=>({get draggable(){let t=!0;return vi(e,n=>{n.draggable||(t=!1)}),t},get resizable(){let t=!0;return vi(e,n=>{n.resizable||(t=!1)}),t},get contentEditable(){let t=!0;return vi(e,n=>{n.contentEditable||(t=!1)}),t},get styleEditable(){let t=!0;return vi(e,n=>{n.styleEditable||(t=!1)}),t},get locked(){let t=!0;return vi(e,n=>{n.locked||(t=!1)}),t}})).actions(e=>({set(t){var{draggable:n,contentEditable:r,styleEditable:i,resizable:a}=t,o=nR(t,["draggable","contentEditable","styleEditable","resizable"]);n!==void 0&&vi(e,s=>{s.set({draggable:n})}),r!==void 0&&vi(e,s=>{s.set({contentEditable:r})}),i!==void 0&&vi(e,s=>{s.set({styleEditable:i})}),a!==void 0&&vi(e,s=>{s.set({resizable:a})}),Object.assign(e,o)},addElement(t,{skipSelect:n=!1}={}){const r=Ay[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||Nl(10)});const i=r.create(Object.assign({id:Nl(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){vi(e,r=>{r.setAnimation(t,n)})}})),iR=[],Ay={svg:P7,text:E7,image:sg,group:sd,line:A7,video:k7,figure:O7,gif:C7},aR={text:pL,image:r3,svg:r3,line:KN,video:tT,figure:hT,group:Jr(e=>{const{element:t,store:n}=e,{children:r}=t,i=t.selectable||n.role==="admin";return oe.createElement(fr,{opacity:t.opacity,listening:i,hideInExport:!t.showInExport,id:t.id},r.map(a=>oe.createElement(N7,Object.assign({},e,{key:a.id,store:n,element:a}))))}),gif:bT},oR=(e,t)=>{const n=[];vi(e,c=>{c.type!=="group"&&n.push(c.a)});const r=[];n.forEach(c=>{const p=[{x:0,y:0},{x:0+c.width,y:0},{x:0+c.width,y:0+c.height},{x:0,y:0+c.height}],m=new un.Transform;m.translate(c.x,c.y),m.rotate(un.Util.degToRad(c.rotation)),p.forEach(d=>{const y=m.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 p=i.point(c);a=Math.min(a,p.x),o=Math.min(o,p.y),s=Math.max(s,p.x),u=Math.max(u,p.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}},N7=Jr(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=(p=>{const[m,d]=oe.useState(null);return oe.useEffect(()=>{const y=setTimeout(()=>{const w=p.page.id,x=un.stages.find(b=>b.getAttr("pageId")===w);x||console.error("No stage is found for element",p.id),d(x)});return()=>clearTimeout(y)},[p.id]),m})(n),h=u?.findOne("Transformer");oe.useEffect(()=>{if(u){const p=d=>{const y=d.target.findAncestor(".element",!0),w=r.getElementById(y?.id()),x=w?.top,b=x?.id;a(b===n.id)};u.on("mouseover",p);const m=()=>{a(!1)};return u.on("mouseleave",m),()=>{u.off("mouseover",p),u.off("mouseleave",m)}}},[u]);let c=aR[e.element.type];return e.element.type==="text"&&Ir.htmlRenderEnabled&&(c=qN),e.element.visible?c?oe.createElement(fr,{name:"element-container"},oe.createElement(c,Object.assign({},e)),i&&!o&&!s&&oe.createElement(xT,{element:n.type==="group"?{a:oR(n,h?.rotation()||0)}:n})):(console.error("Can not find component for "+e.element.type),null):null});function sR(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,p=c*c,m=p*c,d=.5*(2*a.x+(-i.x+o.x)*c+(2*i.x-5*a.x+4*o.x-s.x)*p+(-i.x+3*a.x-3*o.x+s.x)*m),y=.5*(2*a.y+(-i.y+o.y)*c+(2*i.y-5*a.y+4*o.y-s.y)*p+(-i.y+3*a.y-3*o.y+s.y)*m);n.push({x:d,y})}}return n.push(e[e.length-1]),n}function lR(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 uR(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 cR(e,t){if(e.length===0)throw new Error("Cannot create SVG from empty path");const n=sR(e),r=uR(n),i=t.strokeWidth,a=r.x-i,o=r.y-i,s=r.width+2*i,u=r.height+2*i,h=`
390
- <svg xmlns="http://www.w3.org/2000/svg" width="${s}" height="${u}" viewBox="0 0 ${s} ${u}">
391
- <path
392
- d="${lR(n.map(c=>({x:c.x-a,y:c.y-o})))}"
393
- stroke="${t.stroke}"
394
- stroke-width="${t.strokeWidth}"
395
- stroke-linecap="round"
396
- stroke-linejoin="round"
397
- fill="none"
398
- />
399
- </svg>
400
- `.trim();return{src:Mf(h),x:a,y:o,width:s,height:u}}const fR=Jr(({store:e,page:t,width:n,height:r,scale:i,xPadding:a,yPadding:o,bleed:s})=>{const[u,h]=oe.useState(!1),[c,p]=oe.useState([]),m=oe.useRef(null),d=e.tool==="draw",{strokeWidth:y,stroke:w,opacity:x,brushType:b}=e.toolOptions,S=oe.useCallback(M=>{if(!d||(h(!0),M.cancelBubble=!0,!M.target.getStage()))return;const O=m.current.getRelativePointerPosition();O&&p([{x:O.x,y:O.y}])},[d,i,a,o,s]),k=oe.useCallback(M=>{if(!d||!u||(M.cancelBubble=!0,!M.target.getStage()))return;const O=m.current.getRelativePointerPosition();O&&p(R=>[...R,{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 M=cR(c,{stroke:w,strokeWidth:y,smooth:!0}),O=e.selectedElementsIds.slice();e.history.transaction(()=>{t.addElement({type:"svg",x:M.x,y:M.y,width:M.width,height:M.height,src:M.src,opacity:x},{skipSelect:!0})}),e.selectElements(O)}catch(M){console.error("Error creating path SVG:",M)}p([])}},[d,u,c,w,y,x,t,e.history,e]),A=oe.useMemo(()=>c.flatMap(M=>[M.x,M.y]),[c]);return oe.useEffect(()=>{if(d&&m.current){const M=m.current.getStage();if(!M)return;const O=y*i;if(O>100||O<4)M.container().style.cursor="crosshair";else{const R=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}">
401
- <circle cx="${j}" cy="${j}" r="${R-1}" fill="${w}" opacity="${x}" stroke="white" stroke-width="1"/>
402
- <circle cx="${j}" cy="${j}" r="${R-1}" fill="none" stroke="black" stroke-width="1" opacity="0.3"/>
403
- </svg>`)}`;M.container().style.cursor=`url("${D}") ${j} ${j}, crosshair`}return()=>{M.container()&&(M.container().style.cursor="")}}},[d,w,y,x,i]),d?oe.createElement(fr,{ref:m,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(bc,{points:A,stroke:w,strokeWidth:y,lineCap:"round",lineJoin:"round",opacity:x,tension:.5,listening:!1})):null});function hR(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 T7=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 z4=un.DD._drag;window.removeEventListener("mousemove",z4),un.DD._drag=function(e){vc(()=>{z4.call(this,e)})},window.addEventListener("mousemove",un.DD._drag);const Lv=new un.Group,vf=20;Lv.add(new un.Rect({width:vf,height:vf,fill:"white"})),Lv.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 dR=Lv.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:dR,fillPatternScaleX:20/vf/2,fillPatternScaleY:20/vf/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},U1={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"]}},pR=e=>oe.createElement(Pr,Object.assign({},e,{preventDefault:!1})),gR=e=>{var{url:t}=e,n=T7(e,["url"]);const[r,i]=uy(t,"anonymous"),a=r?hR(r,{width:n.width,height:n.height},"center-middle"):{};return mp(i,t,"page background"),oe.createElement(Du,Object.assign({image:r},n,a))},mR=e=>{const t=Wu({fill:e.fill,a:{width:e.width,height:e.height}});return oe.createElement(Pr,Object.assign({},e,t))},vR=e=>{const{background:t,scale:n,borderColor:r}=e,i=T7(e,["background","scale","borderColor"]),a=oe.useMemo(()=>!!un.Util.colorToRGBA(t)||ua(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(mR,Object.assign({fill:t},i)):oe.createElement(gR,Object.assign({url:t},i)))},yR=Jr(({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 bR(e){let t=180*e/Math.PI;return t%=360,t>180?t-=360:t<-180&&(t+=360),Math.round(t)}const wR=Jr(({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),p=(r/2+70)*Math.sin(i-Math.PI/2),m=N4({unit:o.unit,dpi:o.dpi,px:n/o.scale,precious:o.unit==="px"?0:1})+" x "+N4({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(k0,{x:(h.minX+h.maxX)/2+c,y:(h.minY+h.maxY)/2+p,offsetX:14,offsetY:14,visible:a==="rotater"},oe.createElement(A0,{cornerRadius:5,fill:s||"rgb(0, 161, 255)"}),oe.createElement(Uu,{align:"center",verticalAlign:"middle",fill:u||"white",padding:8,text:bR(i).toString()+"°"})),oe.createElement(k0,{x:(h.minX+h.maxX)/2,y:h.maxY+20,visible:a!=="rotater"},oe.createElement(A0,{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:m})))}),xR=Jr(({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(N7,{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.")}})))}),_R=({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}}},SR=atob("UG9sb3RubyBmcmVlIGxpY2Vuc2UgbGltaXRhdGlvbiBleGNlZWRlZCAtIFBsZWFzZSB1cGdyYWRlIHlvdXIgYWNjb3VudC4="),q4=atob("cmVk"),ER=atob("djAuOS4y"),kR=e=>oe.createElement(oe.Fragment,null,oe.createElement(k0,{fill:q4,height:200},oe.createElement(A0,{fill:q4}),oe.createElement(Uu,Object.assign({},e,{fill:"white",text:SR,height:void 0,padding:10,fontSize:20})))),AR=Jr(({store:e,page:t,width:n,height:r,pageControlsEnabled:i,backColor:a,pageBorderColor:o,activePageBorderColor:s,components:u,bleedColor:h,altCloneEnabled:c,viewportSize:p,selectionRectFill:m,selectionRectStroke:d,selectionRectStrokeWidth:y,snapGuideStroke:w,snapGuideStrokeWidth:x,snapGuideDash:b,transformLabelFill:S,transformLabelTextFill:k,distanceGuideStroke:E,distanceLabelFill:A,distanceLabelTextFill:M,layout:O="vertical",tooltipSafeArea:R})=>{const j=e.bleedVisible?t.bleed:0,D=t.computedWidth+2*j,L=t.computedHeight+2*j,T=(n-D*e.scale)/2,$=(r-L*e.scale)/2,U=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=_R({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,xe,Ie;if(!U.current)return;const Te=U.current.getStage(),Je=e.selectedShapes.map(at=>at._cropModeEnabled?null:Te.findOne("#"+at.id)).filter(at=>at),nt=e.selectedElements.length===1,st=nt&&((ye=e.selectedElements[0])===null||ye===void 0?void 0:ye.type)||"many";U1[st]?(U.current.setAttrs(Object.assign(Object.assign({},gf),U1[st])),st!=="svg"&&st!=="image"&&st!=="gif"||e.selectedElements[0].keepRatio||U.current.setAttrs({enabledAnchors:gf.enabledAnchors}),st==="text"&&Ir.textVerticalResizeEnabled&&U.current.setAttrs({enabledAnchors:(xe=U1.text.enabledAnchors)===null||xe===void 0?void 0:xe.concat(["bottom-center"])}),st==="text"&&nt&&e.selectedElements[0].curveEnabled&&U.current.setAttrs({enabledAnchors:U1.many.enabledAnchors})):U.current.setAttrs(gf),J&&U.current.enabledAnchors([]),K&&U.current.rotateEnabled(!1),Je.find(at=>at?.isDragging())&&Je.forEach(at=>{at.isDragging()||at==null||at.startDrag()}),U.current.nodes(Je),a7(),(Ie=U.current.getLayer())===null||Ie===void 0||Ie.batchDraw()},[e.selectedShapes,z,J,ie,K,Y]);const fe=()=>{const ye=U.current;if(!ye)return;if(!ye.isTransforming())return void B({});if(!ye.nodes().length||!ye.isTransforming())return;const xe=ye.__getNodeRect(),Ie=ye?.getActiveAnchor(),Te=ye.getStage();B({anchor:Ie,x:xe.x-Te.x(),y:xe.y-Te.y(),rotation:xe.rotation,width:xe.width,height:xe.height})};oe.useEffect(()=>{var ye;(ye=U.current)===null||ye===void 0||ye.update(),fe()},[e.scale]);const ue=mE(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),we=oe.useRef(!1),Ce=Tf(),Ue=qn(ye=>{var xe,Ie,Te,Je;if(Ce)return;we.current=!1;const nt=ye.target.findAncestor(".elements-container"),st=ye.target.findAncestor("Transformer"),at=ye.target.findAncestor(".page-abs-container");if(nt||st||at)return;const ct=(xe=ye.target.getStage())===null||xe===void 0?void 0:xe.getPointerPosition();ct.x-=(Ie=ye.target.getStage())===null||Ie===void 0?void 0:Ie.x(),ct.y-=(Te=ye.target.getStage())===null||Te===void 0?void 0:Te.y(),ct&&(ue.visible=!0,ue.x1=ct.x,ue.y1=ct.y,ue.x2=ct.x,ue.y2=ct.y,((Je=ye.target.getStage())===null||Je===void 0?void 0:Je.getPointersPositions().length)>=2&&(ue.visible=!1))});(({stageRef:ye,containerRef:xe,viewportSize:Ie})=>{oe.useEffect(()=>{var Te;const Je=(Te=xe.current)===null||Te===void 0?void 0:Te.closest(".polotno-workspace-inner");function nt(){var st;if(!ye.current)return;const at=(st=xe.current)===null||st===void 0?void 0:st.getBoundingClientRect(),ct=Je?.getBoundingClientRect(),Ct=Math.max(0,ct.left-at.left-100),rn=Math.max(0,ct.top-at.top-100);ye.current.position({x:-Ct,y:-rn}),ye.current.container().style.transform=`translate(${Ct}px, ${rn}px)`}return nt(),Je.addEventListener("scroll",nt),()=>{Je.removeEventListener("scroll",nt)}},[Ie.width,Ie.height])})({stageRef:te,containerRef:se,viewportSize:p}),oe.useEffect(()=>{const ye=qn(Ie=>{var Te,Je,nt,st;if(!ue.visible)return;(Te=te.current)===null||Te===void 0||Te.setPointersPositions(Ie);let at=(Je=te.current)===null||Je===void 0?void 0:Je.getPointerPosition();at?(at.x-=(nt=te.current)===null||nt===void 0?void 0:nt.x(),at.y-=(st=te.current)===null||st===void 0?void 0:st.y()):at={x:ue.x2,y:ue.y2},ue.x2=at.x,ue.y2=at.y}),xe=qn(()=>{if(!ue.visible||!te.current)return;const Ie=te.current.findOne(".selection"),Te=Ie?Ie.getClientRect():{width:0,height:0,x:0,y:0};if(Te.width&&Te.height){const Je=[];te.current.find(".element").forEach(st=>{const at=st.getClientRect(),ct=e.getElementById(st.id()),Ct=ct?.draggable,rn=ct?.selectable;un.Util.haveIntersection(Te,at)&&Ct&&rn&&Je.push(ct.top.id)});const nt=[...new Set(Je)];e.selectElements(nt)}ue.visible=!1,we.current=!0});return window.addEventListener("mousemove",ye),window.addEventListener("touchmove",ye),window.addEventListener("mouseup",xe),window.addEventListener("touchend",xe),()=>{window.removeEventListener("mousemove",ye),window.removeEventListener("touchmove",ye),window.removeEventListener("mouseup",xe),window.removeEventListener("touchend",xe)}},[]);const ze=oe.useCallback(ye=>{if(!e.selectedElements[0]||ye&&e.selectedElementsIds.includes(ye))return;const xe=ag(e.selectedShapes),Ie=ye?e.getElementById(ye):{x:0,y:0,width:t.computedWidth,height:t.computedHeight,rotation:0},Te=Cd(Ie),Je=[];xe.minX>Te.maxX&&Je.push({distance:xe.minX-Te.maxX,box1:xe,box2:Te,points:[{x:xe.minX,y:xe.minY+xe.height/2},{x:Te.maxX,y:xe.minY+xe.height/2},{x:Te.maxX,y:Te.minY+Te.height/2}]}),xe.maxX<Te.minX&&Je.push({distance:Te.minX-xe.maxX,box1:xe,box2:Te,points:[{x:xe.maxX,y:xe.minY+xe.height/2},{x:Te.minX,y:xe.minY+xe.height/2},{x:Te.minX,y:Te.minY+Te.height/2}]}),xe.minY>Te.maxY&&Je.push({box1:xe,box2:Te,distance:xe.minY-Te.maxY,points:[{x:xe.minX+xe.width/2,y:xe.minY},{x:xe.minX+xe.width/2,y:Te.maxY},{x:Te.minX+Te.width/2,y:Te.maxY}]}),xe.maxY<Te.minY&&Je.push({box1:xe,box2:Te,distance:Te.minY-xe.maxY,points:[{x:xe.minX+xe.width/2,y:xe.maxY},{x:xe.minX+xe.width/2,y:Te.minY},{x:Te.minX+Te.width/2,y:Te.minY}]});const nt=xe.minX>=Te.minX&&xe.maxX<=Te.maxX&&xe.minY>=Te.minY&&xe.maxY<=Te.maxY;if(nt&&(Je.push({distance:xe.minX-Te.minX,box1:xe,box2:Te,points:[{x:xe.minX,y:xe.minY+xe.height/2},{x:Te.minX,y:xe.minY+xe.height/2},{x:Te.minX,y:Te.minY+Te.height/2}]}),Je.push({distance:Te.maxX-xe.maxX,box1:xe,box2:Te,points:[{x:xe.maxX,y:xe.minY+xe.height/2},{x:Te.maxX,y:xe.minY+xe.height/2},{x:Te.maxX,y:Te.minY+Te.height/2}]}),Je.push({box1:xe,box2:Te,distance:xe.minY-Te.minY,points:[{x:xe.minX+xe.width/2,y:xe.minY},{x:xe.minX+xe.width/2,y:Te.minY},{x:Te.minX+Te.width/2,y:Te.minY}]}),Je.push({box1:xe,box2:Te,distance:Te.maxY-xe.maxY,points:[{x:xe.minX+xe.width/2,y:xe.maxY},{x:xe.minX+xe.width/2,y:Te.maxY},{x:Te.minX+Te.width/2,y:Te.maxY}]})),Je.length===0&&!nt){const st=xe.minX<Te.maxX&&xe.maxX>Te.minX,at=xe.minY<Te.maxY&&xe.maxY>Te.minY;if(st&&at){const ct=(Math.max(xe.minY,Te.minY)+Math.min(xe.maxY,Te.maxY))/2,Ct=(Math.max(xe.minX,Te.minX)+Math.min(xe.maxX,Te.maxX))/2;xe.minX<Te.minX?Je.push({distance:Te.minX-xe.minX,box1:xe,box2:Te,points:[{x:xe.minX,y:ct},{x:Te.minX,y:ct},{x:Te.minX,y:ct}]}):Je.push({distance:xe.minX-Te.minX,box1:xe,box2:Te,points:[{x:xe.minX,y:ct},{x:Te.minX,y:ct},{x:Te.minX,y:ct}]}),xe.maxX>Te.maxX?Je.push({distance:xe.maxX-Te.maxX,box1:xe,box2:Te,points:[{x:Te.maxX,y:ct},{x:xe.maxX,y:ct},{x:Te.maxX,y:ct}]}):Je.push({distance:Te.maxX-xe.maxX,box1:xe,box2:Te,points:[{x:xe.maxX,y:ct},{x:Te.maxX,y:ct},{x:Te.maxX,y:ct}]}),xe.minY<Te.minY?Je.push({box1:xe,box2:Te,distance:Te.minY-xe.minY,points:[{x:Ct,y:xe.minY},{x:Ct,y:Te.minY},{x:Ct,y:Te.minY}]}):Je.push({box1:xe,box2:Te,distance:xe.minY-Te.minY,points:[{x:Ct,y:xe.minY},{x:Ct,y:Te.minY},{x:Ct,y:Te.minY}]}),xe.maxY>Te.maxY?Je.push({box1:xe,box2:Te,distance:xe.maxY-Te.maxY,points:[{x:Ct,y:Te.maxY},{x:Ct,y:xe.maxY},{x:Ct,y:Te.maxY}]}):Je.push({box1:xe,box2:Te,distance:Te.maxY-xe.maxY,points:[{x:Ct,y:xe.maxY},{x:Ct,y:Te.maxY},{x:Ct,y:Te.maxY}]})}}JSON.stringify(Q)!==JSON.stringify(Je)&&re(Je)},[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 xe;const Ie=(ye=se.current)===null||ye===void 0?void 0:ye.closest(".polotno-workspace-inner"),Te=()=>{tt.current=!0,clearTimeout(xe),xe=setTimeout(()=>{tt.current=!1},300)};return Ie.addEventListener("scroll",Te),()=>{clearTimeout(xe),Ie.removeEventListener("scroll",Te)}},[]);const ge=ye=>{if(e.activePage!==t&&t.select(),tt.current||we.current)return;const xe=ye.evt.ctrlKey||ye.evt.metaKey||ye.evt.shiftKey,Ie=ye.target.findAncestor(".elements-container"),Te=ye.target.findAncestor(".page-abs-container"),Je=ye.target.findAncestor("Transformer");if(!(xe||Ie||Je||Te||ue.visible))return void e.selectElements([]);const nt=ye.target.findAncestor(".element-container",!0),st=nt?.findOne(".element")||ye.target.findAncestor(".element",!0),at=e.getElementById(st?.id()),ct=at?.top,Ct=ct?.id,rn=e.selectedElementsIds.indexOf(Ct)>=0,Zt=ye.target.findAncestor(".page-container",!0);Ct&&xe&&!rn?e.selectElements(e.selectedElementsIds.concat([Ct])):Ct&&xe&&rn?e.selectElements(e.selectedElementsIds.filter(an=>an!==Ct)):!Ct||xe||rn?Zt?e.selectPages([t.id]):e.selectPages([]):e.selectElements([Ct])};VN(U,e,{stroke:w,strokeWidth:x,dash:b});const ut=e.activePage===t,ke=e._selectedPagesIds.includes(t.id),he=u?.PageControls,be=u?.Tooltip,Le=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 xe=te.current.getPointerPosition(),Ie=te.current.getAllIntersections(xe).map(Je=>Je.findAncestor(".element",!0)).filter(Boolean);[...new Set(Ie.reverse())].map(Je=>e.getElementById(Je.id()))[0]},style:{position:"relative",width:n+"px",height:r+"px",overflow:"hidden",flexShrink:0},className:"polotno-page-container"+(ut?" active-page":"")},oe.createElement($P,{ref:te,width:Math.min(n,p.width+200),height:Math.min(p.height+200,r),onClick:ge,onTap:ge,onContextMenu:ye=>{ye.evt.preventDefault();const xe=ye.target.findAncestor(".element",!0),Ie=e.getElementById(xe?.id()),Te=Ie?.top,Je=Te?.id;Je?e.selectedElementsIds.indexOf(Je)>=0||e.selectElements([Je]):e.selectElements([]),F.open({x:ye.evt.clientX,y:ye.evt.clientY})},onMouseDown:Ue,onMouseMove:ye=>{if(!e.distanceGuidesVisible&&!ye.evt.altKey)return void(Q&&re(null));const xe=ye.target.findAncestor(".element",!0),Ie=xe?.id();ze(Ie)},onDragStart:ye=>{var xe;const Ie=ye.target.findAncestor(".element",!0);if(Ie){const Te=e.getElementById(Ie?.id()),Je=Te?.top,nt=Je?.id;!(e.selectedElementsIds.indexOf(nt)>=0)&&nt&&(e.selectElements([nt]),ye.target.stopDrag(),ye.target.startDrag(ye),(xe=U.current)===null||xe===void 0||xe.startDrag(ye))}Q&&re(null)},pageId:t.id,style:{position:"absolute",overflow:"hidden",top:0,left:0}},oe.createElement(qP,null,oe.createElement(pR,{width:n,height:r,fill:a}),oe.createElement(fr,{x:T,y:$,scaleX:e.scale,scaleY:e.scale,name:"page-container"},oe.createElement(fr,{name:"page-container-2"},oe.createElement(fr,{name:"page-background-group",x:j,y:j},oe.createElement(vR,{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(fr,{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(xR,{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}),OT()===ER&&oe.createElement(kR,{name:"hit-detection",x:-Me/2-ve,y:-Me/2-ve,width:D+Me+2*ve,height:L+Me+2*ve}))),oe.createElement(bc,{name:"workspace-background",points:[0,0,n,0,n,r,0,r,0,0,T,$,T,r-$,n-T,r-$,n-T,$,T,$],listening:!1,closed:!0,fill:a}),oe.createElement(fr,{x:T,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:L+Me+2*ve,stroke:ke?s:o,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),oe.createElement(fr,{x:T+j*e.scale,y:$+j*e.scale,scaleX:e.scale,scaleY:e.scale,name:"page-abs-container"},oe.createElement(kp,{ref:U,onDragStart:ye=>{var xe;!((xe=ye.evt)===null||xe===void 0)&&xe.altKey&&c&&e.selectedElements.forEach(Ie=>{const Te=Ie.clone({},{skipSelect:!0}),Je=t.children.indexOf(Ie);t.setElementZIndex(Te.id,Je)}),e.history.startTransaction()},onDragEnd:()=>{e.history.endTransaction()},onTransformStart:()=>{e.history.startTransaction(),re(null)},boundBoxFunc:(ye,xe)=>{const Ie=Math.abs(xe.width)<1||Math.abs(xe.height)<1,Te=Math.abs(ye.width)<1||Math.abs(ye.height)<1;return Ie&&!Te?ye:xe},onTransform:ye=>{const xe=U.current.nodes(),Ie=xe[xe.length-1];ye.target===Ie&&setTimeout(()=>{fe()},0)},onTransformEnd:ye=>{B({}),e.history.endTransaction()},visible:!e.isPlaying}),Q&&Q.map(({points:ye,distance:xe,box1:Ie,box2:Te},Je)=>oe.createElement(fr,{name:"distances-container",hideInExport:!0,key:Je,listening:!1},oe.createElement(Pr,Object.assign({},Ie,{stroke:E,strokeWidth:1,strokeScaleEnabled:!1})),oe.createElement(Pr,Object.assign({},Te,{stroke:E,strokeWidth:1,strokeScaleEnabled:!1})),oe.createElement(bc,{points:[ye[0].x,ye[0].y,ye[1].x,ye[1].y],stroke:E,strokeWidth:1,strokeScaleEnabled:!1}),oe.createElement(bc,{points:[ye[1].x,ye[1].y,ye[2].x,ye[2].y],stroke:E,strokeWidth:1,strokeScaleEnabled:!1}),oe.createElement(k0,{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(A0,{cornerRadius:5,fill:A,pointerDirection:"down"}),oe.createElement(Uu,{align:"center",verticalAlign:"middle",fill:M,padding:5,text:BT({unit:e.unit,dpi:e.dpi,px:xe})})))),t._rendering&&oe.createElement(fr,null,oe.createElement(Pr,{width:D,height:L,fill:"rgba(255,255,255,0.9)"}),oe.createElement(Uu,{text:"Rendering...",fontSize:60,width:D,height:L,align:"center",verticalAlign:"middle"})),be&&oe.createElement(be,{components:u,store:e,page:t,stageRef:te,tooltipSafeArea:R}),Le&&oe.createElement(P0,null,oe.createElement(Le,Object.assign({components:u,store:e},F.props)))),oe.createElement(fR,{store:e,page:t,width:n,height:r,scale:e.scale,xPadding:T,yPadding:$,bleed:j}),oe.createElement(wR,Object.assign({},X,{store:e,tagFill:S,textFill:k})),oe.createElement(yR,{selection:ue,fill:m,stroke:d,strokeWidth:y}),CT()&&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(fr,{name:"line-guides"}))),ee&&he&&oe.createElement(he,{store:e,page:t,xPadding:T,yPadding:$,layout:O}))}),PR=Od("div",oe.forwardRef)`
404
- position: absolute;
405
- top: 0;
406
- left: 0;
407
- pointer-events: none;
408
- `,U4=Od("div",oe.forwardRef)`
409
- height: 14px;
410
- position: sticky;
411
- font-size: 8px;
412
- line-height: 14px;
413
- top: 0;
414
- left: 0;
415
- color: grey;
416
- border-bottom: 1px solid grey;
417
- background-color: #e8e8e8;
418
- overflow: hidden;
419
- `,H4=Od("div",oe.forwardRef)`
420
- left: 0;
421
- width: 14px;
422
- position: sticky;
423
- font-size: 8px;
424
- line-height: 14px;
425
- color: grey;
426
- border-right: 1px solid grey;
427
- background-color: #e8e8e8;
428
- overflow: hidden;
429
- `,$4=Od("div",oe.forwardRef)`
430
- position: absolute;
431
- border-left: 1px solid grey;
432
- padding-left: 2px;
433
- `,G4=Od("div",oe.forwardRef)`
434
- position: absolute;
435
- left: 14px;
436
- border-left: 1px solid grey;
437
- padding-left: 2px;
438
- transform: rotate(90deg);
439
- transform-origin: left top;
440
- overflow: hidden;
441
- `,OR=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4],CR=Jr(({store:e,width:t,height:n,layout:r="vertical"})=>{const i=oe.useRef(null);if(!e.activePage)return null;const a=r==="horizontal",o=e.activePage,s=(e.bleedVisible&&o.bleed,o.computedWidth*e.scale),u=o.computedHeight*e.scale,h=(t-s)/2,c=(n-u)/2,p=(m=b=>T4({unitVal:b,dpi:e.dpi,unit:e.unit})*e.scale,OR.find(b=>m(b)>30)||1e4);var m;const d=T4({unitVal:p,dpi:e.dpi,unit:e.unit})*e.scale,y=Math.round(s/d)+1,w=Math.round(u/d)+1,x=ag(e.selectedShapes);return oe.createElement(PR,{ref:i,className:"polotno-rulers",style:{display:"flex",flexDirection:"column"}},a?oe.createElement(oe.Fragment,null,oe.createElement("div",{style:{display:"flex",flexDirection:"row",position:"sticky",top:0,zIndex:1}},oe.createElement("div",{style:{width:"14px",height:"14px",flexShrink:0,backgroundColor:"#e8e8e8",borderRight:"1px solid grey",borderBottom:"1px solid grey",position:"sticky",left:0,zIndex:2}}),e.pages.map((b,S)=>{var k;const E=b.computedWidth*e.scale,A=(t-E)/2;return oe.createElement(U4,{key:b.id,style:{width:t+"px",flexShrink:0,position:"relative"},className:"polotno-x-ruler"},[...Array(y)].map((M,O)=>oe.createElement($4,{key:O,style:{left:A+O*d+"px",width:d+"px"}},e.unit==="px"||p>=1?Math.round(p*O):(p*O).toFixed(1))),((k=e.selectedShapes[0])===null||k===void 0?void 0:k.page)===b&&oe.createElement("div",{style:{position:"absolute",left:A+x.x*e.scale+"px",height:"14px",width:x.width*e.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))})),oe.createElement(H4,{style:{height:n+"px",position:"sticky",left:0,marginTop:"-14px"},className:"polotno-y-ruler"},[...Array(w)].map((b,S)=>oe.createElement(G4,{key:S,style:{top:c+S*d+"px",width:d+"px"}},e.unit==="px"||p>=1?Math.round(p*S):(p*S).toFixed(1))),!!e.selectedShapes.length&&oe.createElement("div",{style:{position:"absolute",top:c+x.y*e.scale+"px",width:"14px",height:x.height*e.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))):oe.createElement(oe.Fragment,null,oe.createElement(U4,{style:{width:t+"px"},className:"polotno-x-ruler"},[...Array(y)].map((b,S)=>oe.createElement($4,{key:S,style:{left:h+S*d+"px",width:d+"px"}},e.unit==="px"||p>=1?Math.round(p*S):(p*S).toFixed(1))),!!e.selectedShapes.length&&oe.createElement("div",{style:{position:"absolute",left:h+x.x*e.scale+"px",height:"14px",width:x.width*e.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),e.pages.map((b,S)=>{var k;const E=b.computedHeight*e.scale,A=(n-E)/2,M=S===0?14:0;return oe.createElement(H4,{key:b.id,style:{height:n-M+"px"},className:"polotno-y-ruler"},[...Array(w)].map((O,R)=>oe.createElement(G4,{key:R,style:{top:A+R*d-M+"px",width:d+"px"}},e.unit==="px"||p>=1?Math.round(p*R):(p*R).toFixed(1))),((k=e.selectedShapes[0])===null||k===void 0?void 0:k.page)===b&&oe.createElement("div",{style:{position:"absolute",top:A+x.y*e.scale-M+"px",width:"14px",height:x.height*e.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))})))}),LR=Jr(({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,p=n.currentTime;Math.abs(p-c)>.5&&c!==p&&(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 R7={data:[],pageId:""};const R0="polotno_clipboard",Py=(e,t)=>{R7={data:JSON.parse(JSON.stringify(e)),pageId:t};try{localStorage.setItem(R0,JSON.stringify(e)),localStorage.setItem(R0+"_page",t)}catch{}},NR=()=>{try{const e=localStorage.getItem(R0),t=localStorage.getItem(R0+"_page");if(e)return{data:JSON.parse(e),pageId:t}}catch{}return R7},TR=e=>{var t;e.selectedElements.length!==0&&Py(e.selectedElements.map(n=>n.toJSON()),(t=e.activePage)===null||t===void 0?void 0:t.id)},RR=e=>{var t;Py(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)},MR=e=>{e.history.transaction(()=>{var t,n;let r=0,i=0;const{data:a,pageId:o}=NR();if(o===((t=e.activePage)===null||t===void 0?void 0:t.id))r=e.width/20,i=e.height/20;else{const u=[];vi({children:a},c=>{c.type!=="group"&&u.push(c)});const h=ag(u);h.maxX>e.width&&(r=-h.minX),h.maxY>e.height&&(i=-h.minY)}const s=[];vi({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)}),Py(a,(n=e.activePage)===null||n===void 0?void 0:n.id),e.selectElements(s)})};function IR(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 $o=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=$o(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-$o(e).x,i=n-$o(e).y;e.children.forEach(a=>{const o=$o(a);Oh(a,o.x+r,o.y+i)})}};function jR(e){var t;let n=(t=e.activePage)===null||t===void 0?void 0:t.computedWidth;e.selectedElements.forEach(r=>{n=Math.min(n,$o(r).x)}),e.selectedElements.length===1&&(n=0),e.selectedElements.forEach(r=>{const i=$o(r);Oh(r,i.x-i.x+n,i.y)})}function DR(e){var t;let n=0;e.selectedElements.forEach(r=>{const i=$o(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=$o(r);Oh(r,n-i.width,i.y)})}function FR(e){var t;let n=(t=e.activePage)===null||t===void 0?void 0:t.computedHeight;e.selectedElements.forEach(r=>{n=Math.min(n,$o(r).y)}),e.selectedElements.length===1&&(n=0),e.selectedElements.forEach(r=>{const i=$o(r);Oh(r,i.x,i.y-i.y+n)})}function BR(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=$o(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=$o(o);Oh(o,s.x,a-s.height/2)})}function zR(e){var t;let n=0;e.selectedElements.forEach(r=>{const i=$o(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=$o(r);Oh(r,i.x,n-i.height)})}function qR(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=$o(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=$o(o);Oh(o,a-s.width/2,s.y)})}const Om="rgba(191, 191, 191, 100)";function UR(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 p=window.getSelection();if(p&&p.toString().length>0)return}const s=t.selectedElements.filter(p=>p.removable).map(p=>p.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 p=(a=t.activePage)===null||a===void 0?void 0:a.children.filter(d=>d.selectable),m=p?.map(d=>d.id)||[];t.selectElements(m)}if(u&&e.code==="KeyC"&&(e.preventDefault(),TR(t)),u&&e.code==="KeyX"&&(e.preventDefault(),RR(t)),u&&e.code==="KeyV"&&(e.preventDefault(),MR(t)),e.code==="ArrowDown"&&(e.preventDefault(),t.selectedShapes.forEach(p=>{p.draggable&&p.set({y:p.y+1})})),e.code==="ArrowUp"&&(e.preventDefault(),t.selectedShapes.forEach(p=>{p.draggable&&p.set({y:p.y-1})})),e.code==="ArrowLeft"&&(e.preventDefault(),t.selectedShapes.forEach(p=>{p.draggable&&p.set({x:p.x-1})})),e.code==="ArrowRight"&&(e.preventDefault(),t.selectedShapes.forEach(p=>{p.draggable&&p.set({x:p.x+1})})),u&&e.code==="KeyG"){e.preventDefault();const p=t.selectedElements[0];if(p&&p.type==="group"){const m=p;t.ungroupElements([m.id])}else t.groupElements(t.selectedElements.map(m=>m.id))}if(u&&e.code==="KeyD"&&(e.preventDefault(),IR(t.selectedElements,t)),e.code==="KeyT"&&!u){e.preventDefault();const p=30,m=t.width/2,d=t.width/2-m/2,y=t.height/2-p/2,w=2160,x=(t.width+t.height)/w;t.activePage.addElement({type:"text",x:d,y,width:m,fontSize:p*x,text:"Sample Text",fontFamily:"Roboto"})}if(e.code==="KeyR"&&!u){e.preventDefault();const p={type:"figure",x:t.width/4,y:t.height/4,width:300,height:300,fill:Om,stroke:"#0c0c0c",strokeWidth:0,subType:"rect"};t.activePage.addElement(p)}if(e.code==="KeyL"&&!u){e.preventDefault();const p=t.activePage.computedWidth/3,m={type:"line",x:t.activePage.computedWidth/2-p/2,y:t.activePage.computedHeight/2,width:p,color:Om};t.activePage.addElement(m)}if(e.code==="KeyO"&&!u){e.preventDefault(),e.preventDefault();const p={type:"figure",x:t.width/4,y:t.height/4,width:300,height:300,fill:Om,stroke:"#0c0c0c",strokeWidth:0,subType:"circle"};t.activePage.addElement(p)}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(),jR(t)),e.code==="KeyD"&&(e.preventDefault(),DR(t)),e.code==="KeyS"&&(e.preventDefault(),zR(t)),e.code==="KeyW"&&(e.preventDefault(),FR(t)),e.code==="KeyV"&&(e.preventDefault(),BR(t)),e.code==="KeyH"&&(e.preventDefault(),qR(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 Nv=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"}}),M0=e=>e&&typeof e=="object";function M7(e,t){Object.keys(t).forEach(n=>{const r=e[n],i=t[n];M0(i)&&M0(r)?M7(r,i):e[n]=i})}function I7(e,t,n=""){Object.keys(t).forEach(r=>{const i=t[r],a=n?`${n}.${r}`:r;M0(i)?M0(e[r])?I7(e[r],i,a):console.warn(`Missing nested translation object at '${a}'`):e[r]===void 0&&console.warn(`Missing translation '${a}'`)})}qn((e,{validate:t=!1}={})=>{t&&I7(e,Nv),M7(Nv,e)});const W4={},V4=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})(Nv,e);if(t!==void 0)return t;W4[e]||(W4[e]=!0,console.warn(`Missing translation '${e}'`));const n=e.split("."),r=n[n.length-1]||" ";return r.charAt(0).toUpperCase()+r.slice(1)},HR=({store:e})=>oe.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},oe.createElement("p",null,V4("workspace.noPages")),oe.createElement("button",{onClick:()=>{e.addPage()}},V4("workspace.addPage"))),$R=({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"}})),GR=[4,6],WR=Jr(({store:e,layout:t="vertical",pageControlsEnabled:n,backgroundColor:r,pageBorderColor:i,activePageBorderColor:a,bleedColor:o,snapGuideStroke:s,snapGuideStrokeWidth:u,snapGuideDash:h,selectionRectFill:c,selectionRectStroke:p,selectionRectStrokeWidth:m,transformLabelFill:d,transformLabelTextFill:y,distanceGuideStroke:w,distanceLabelFill:x,distanceLabelTextFill:b,components:S,onKeyDown:k,paddingX:E,paddingY:A,altCloneEnabled:M=!0,visiblePagesOffset:O,renderOnlyActivePage:R,tooltipSafeArea:j})=>{var D;const L=t==="horizontal",T=E??20,$=A??55,[U,te]=oe.useState({width:100,height:100}),se=oe.useRef(U),ee=oe.useRef(null),Q=oe.useRef(null),re=e.bleedVisible?Math.max(0,...e.pages.map(he=>he.bleed)):0,X=Math.max(...e.pages.map(he=>he.computedWidth)),B=Math.max(...e.pages.map(he=>he.computedHeight)),F=((D=e.activePage)===null||D===void 0?void 0:D.computedHeight)||0,z=X+2*re,Y=(R?F:B)+2*re,J=async({skipTimeout:he}={skipTimeout:!1})=>{if(he||await new Promise(st=>setTimeout(st,50)),ee.current===null)return;const be=ee.current.getBoundingClientRect();be.width!==0&&be.height!==0||(console.warn(`Polotno warning: <Workspace /> component can not automatically detect its size.
442
- Width or height of parent elements is equal 0.
443
- Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
444
- For simpler debugging here is the log of the parent element:`),console.log(ee.current));const Le=Q.current.clientWidth||be.width,Me={width:Le,height:be.height};(se.current.width!==Me.width||se.current.height!==Me.height)&&(te(Me),se.current=Me);const ve=(Le-2*T)/z,ye=e.pages.length>1?3.1:2,xe=(be.height-$*ye)/Y,Ie=e.pages.length>1?3.1:2,Te=(Le-T*Ie)/z,Je=(be.height-2*$)/Y,nt=e.pages.length?Math.max(Math.min(L?Te:ve,L?Je:xe),.01):1;e.scaleToFit!==nt&&(e.setScale(nt),e._setScaleToFit(nt))};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 he=ee.current;if(window.ResizeObserver){const be=new ResizeObserver(()=>{J({skipTimeout:!0})});return be.observe(he),()=>be.unobserve(he)}{const be=setInterval(()=>{J({skipTimeout:!0})},100);return()=>clearInterval(be)}},[z,Y]);const K=R?1:e.pages.length;let ie,fe;if(L){const he=z*e.scale*K;ie=Math.max(T,(U.width-he)/K/2),fe=Math.max($,(U.height-Y*e.scale)/2)}else{ie=Math.max(T,(U.width-z*e.scale)/2);const he=Y*e.scale*K;fe=Math.max($,(U.height-he)/K/2)}oe.useEffect(()=>{const he=be=>{(k||UR)(be,e)};return window.addEventListener("keydown",he),()=>window.removeEventListener("keydown",he)},[]),oe.useEffect(()=>{const he=Le=>{if(Le.ctrlKey||Le.metaKey){Le.preventDefault();const xe=Math.max(5,e.scaleToFit);let Ie=Math.min(.1,e.scaleToFit);L&&z>0&&Number.isFinite(z)&&(Ie=Math.max(Ie,300/z)),Ie=Math.max(Ie,.01);const Te=.03,Je=(Me=Le.deltaY<0?e.scale*(1+Te):e.scale/(1+Te),ve=Ie,ye=xe,Math.max(ve,Math.min(ye,Me)));return void e.setScale(Je)}var Me,ve,ye},be=Q.current;return be?.addEventListener("wheel",he),()=>be?.removeEventListener("wheel",he)},[L,z,e]);const ue=oe.useRef(!1);((he,be,Le,Me,ve,ye)=>{const xe=oe.useRef({width:be,height:Le}),Ie=oe.useRef({top:0,left:0}),Te=oe.useRef(!1),Je=oe.useRef(ve.pages.length);Te.current=Je.current!==ve.pages.length,Je.current=ve.pages.length,oe.useEffect(()=>{const nt=he.current,st=at=>{Ie.current={top:nt.scrollTop,left:nt.scrollLeft}};return nt.addEventListener("scroll",st),()=>{nt.removeEventListener("scroll",st)}},[]),oe.useLayoutEffect(()=>{if(!he.current||Te.current)return;const nt=he.current,st=(Ie.current.left+nt.offsetWidth/2)/xe.current.width,at=(Ie.current.top+nt.offsetHeight/2)/xe.current.height;ye.current=!0,nt.scrollLeft=st*be-nt.offsetWidth/2,nt.scrollTop=at*Le-nt.offsetHeight/2,xe.current={width:be,height:Le}},[Me,be,Le])})(Q,z*e.scale+2*ie,Y*e.scale+2*fe,e.scale,e,ue);const we=L?z*e.scale+2*ie:Y*e.scale+2*fe,{handleScroll:Ce}=((he,be,Le,Me,ve,ye,xe)=>{const Ie=oe.useRef(!1),Te=oe.useRef(null),Je=oe.useRef(!1),nt=xe==="horizontal";oe.useEffect(()=>{const at=he.current,ct=()=>{ve.current};return at.addEventListener("scroll",ct),()=>{at.removeEventListener("scroll",ct)}},[]);const st=Le.pages.indexOf(Le.activePage);return oe.useLayoutEffect(()=>{if(ye||!Le.activePage||!he.current||Ie.current)return;const at=he.current,ct=Le.pages.indexOf(Le.activePage)*be,Ct=nt?at.scrollLeft:at.scrollTop;let rn=()=>{};return(Math.abs(ct-Ct)>.5*be||Je.current)&&(Je.current=!0,rn=(({element:Zt,scrollTop:an,scrollLeft:We,duration:Be=300,onFinish:Wt=()=>{}})=>{const Et=an!==void 0,Nt=Et?Zt.scrollTop:Zt.scrollLeft,Tt=Et?an:We,on=Tt-Nt;let Ht=0,hn=!1;if(Be===0)return Et?Zt.scrollTop=Tt:Zt.scrollLeft=Tt,()=>{};const ui=()=>{if(hn)return;Ht+=20;const hr=Ur(Ht,Nt,on,Be);Et?Zt.scrollTop=hr:Zt.scrollLeft=hr,Ht<Be?setTimeout(ui,20):Wt()},Ur=(hr,dr,Qt,zi)=>(hr/=zi/2)<1?Qt/2*hr*hr+dr:-Qt/2*(--hr*(hr-2)-1)+dr;return ui(),()=>{hn=!0}})(Object.assign(Object.assign({element:at},nt?{scrollLeft:ct}:{scrollTop:ct}),{onFinish:()=>{Je.current=!1},duration:Le.isPlaying?0:300}))),rn},[Le.activePage,st,Le.isPlaying,ye,xe]),{handleScroll:at=>{if(ye||Je.current)return;Ie.current=!0,clearTimeout(Te.current),Te.current=setTimeout(()=>{Ie.current=!1},300);const ct=at.currentTarget.childNodes[0];if(!ct)return;const Ct=nt?ct.offsetWidth:ct.offsetHeight;if(!Ct)return;const rn=nt?at.currentTarget.scrollLeft:at.currentTarget.scrollTop,Zt=nt?Me.width:Me.height,an=Math.floor((rn+Zt/3)/Ct),We=Le.pages[an];We&&Le.activePage!==We&&We.select()}}})(Q,we,e,U,ue,R,t),Ue=U.width>=z*e.scale+2*ie,ze=U.height>=Y*e.scale+2*fe,tt=r||"rgba(232, 232, 232, 0.9)",ge=e.pages.indexOf(e.activePage),ut=S?.NoPages||HR,ke=O??Math.min(3,Math.max(1,Math.ceil(L?U.width/2/(z*e.scale):U.height/2/(Y*e.scale))));return oe.createElement("div",{ref:ee,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:tt,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:L?"row":"column",overflow:"auto",overflowX:L?"auto":Ue?"hidden":"auto",overflowY:L&&ze?"hidden":"auto"},className:"polotno-workspace-inner"},e.pages.map((he,be)=>{const Le=he===e.activePage;if(R&&!Le&&!he._exportingOrRendering&&!he._forceMount)return null;if(!(Math.abs(be-ge)<=ke||he._exportingOrRendering||he._forceMount))return oe.createElement("div",{key:he.id,style:{flexShrink:0}},oe.createElement($R,{width:z*e.scale+2*ie,height:Y*e.scale+2*fe,backgroundColor:tt,xPadding:ie,yPadding:fe}));const Me=oe.createElement(AR,{key:he.id,page:he,xPadding:ie,yPadding:fe,width:z*e.scale+2*ie,height:Y*e.scale+2*fe,store:e,pageControlsEnabled:n,backColor:tt,pageBorderColor:i||"lightgrey",activePageBorderColor:a||"rgb(0, 161, 255)",altCloneEnabled:M,bleedColor:o||"rgba(255, 0, 0, 0.1)",selectionRectFill:c,selectionRectStroke:p,selectionRectStrokeWidth:m,snapGuideStroke:s||"rgb(0, 161, 255)",snapGuideStrokeWidth:u||1,snapGuideDash:h||GR,transformLabelFill:d,transformLabelTextFill:y,distanceGuideStroke:w||"rgb(0, 161, 255)",distanceLabelFill:x||"rgb(0, 161, 255)",distanceLabelTextFill:b||"white",components:S,viewportSize:U,layout:t,tooltipSafeArea:j});return(he._exportingOrRendering||he._forceMount)&&!Le&&R?oe.createElement("div",{style:{display:"none",flexShrink:0},key:he.id},Me):Me}),e.rulesVisible&&oe.createElement(CR,{store:e,xPadding:ie,yPadding:fe,width:z*e.scale+2*ie,height:Y*e.scale+2*fe,layout:t}),e.pages.length===0&&oe.createElement(ut,{store:e}),e.audios.map(he=>oe.createElement(LR,{key:he.id,audio:he,store:e}))))});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 au=Uint8Array,ll=Uint16Array,Oy=Int32Array,Cy=new au([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]),Ly=new au([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]),Y4=new au([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),j7=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 Oy(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}},D7=j7(Cy,2),VR=D7.b,Tv=D7.r;VR[28]=258,Tv[258]=28;var YR=j7(Ly,0),X4=YR.r,Rv=new ll(32768);for(var yi=0;yi<32768;++yi){var uf=(yi&43690)>>1|(yi&21845)<<1;uf=(uf&52428)>>2|(uf&13107)<<2,uf=(uf&61680)>>4|(uf&3855)<<4,Rv[yi]=((uf&65280)>>8|(uf&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],p=o[e[i]-1]++<<c,m=p|(1<<c)-1;p<=m;++p)s[Rv[p]>>u]=h}else for(s=new ll(r),i=0;i<r;++i)e[i]&&(s[i]=Rv[o[e[i]-1]++]>>15-e[i]);return s}),mh=new au(288);for(var yi=0;yi<144;++yi)mh[yi]=8;for(var yi=144;yi<256;++yi)mh[yi]=9;for(var yi=256;yi<280;++yi)mh[yi]=7;for(var yi=280;yi<288;++yi)mh[yi]=8;var I0=new au(32);for(var yi=0;yi<32;++yi)I0[yi]=5;var XR=bp(mh,9,0),KR=bp(I0,5,0),F7=function(e){return(e+7)/8|0},ZR=function(e,t,n){return(n==null||n>e.length)&&(n=e.length),new au(e.subarray(t,n))},fc=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:z7,l:0};if(i==1){var o=new au(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(A,M){return A.f-M.f}),n.push({s:-1,f:25001});var s=n[0],u=n[1],h=0,c=1,p=2;for(n[0]={s:-1,f:s.f+u.f,l:s,r:u};c!=i-1;)s=n[n[h].f<n[p].f?h++:p++],u=n[h!=c&&n[h].f<n[p].f?h++:p++],n[c++]={s:-1,f:s.f+u.f,l:s,r:u};for(var m=a[0].s,r=1;r<i;++r)a[r].s>m&&(m=a[r].s);var d=new ll(m+1),y=Mv(n[c-1],d,0);if(y>t){var r=0,w=0,x=y-t,b=1<<x;for(a.sort(function(M,O){return d[O.s]-d[M.s]||M.f-O.f});r<i;++r){var S=a[r].s;if(d[S]>t)w+=b-(1<<y-d[S]),d[S]=t;else break}for(w>>=x;w>0;){var k=a[r].s;d[k]<t?w-=1<<t-d[k]++-1:++r}for(;r>=0&&w;--r){var E=a[r].s;d[E]==t&&(--d[E],++w)}y=t}return{t:new au(d),l:y}},Mv=function(e,t,n){return e.s==-1?Math.max(Mv(e.l,t,n+1),Mv(e.r,t,n+1)):t[e.s]=n},K4=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},B7=function(e,t,n){var r=n.length,i=F7(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},Z4=function(e,t,n,r,i,a,o,s,u,h,c){fc(t,c++,n),++i[256];for(var p=Cm(i,15),m=p.t,d=p.l,y=Cm(a,15),w=y.t,x=y.l,b=K4(m),S=b.c,k=b.n,E=K4(w),A=E.c,M=E.n,O=new ll(19),R=0;R<S.length;++R)++O[S[R]&31];for(var R=0;R<A.length;++R)++O[A[R]&31];for(var j=Cm(O,7),D=j.t,L=j.l,T=19;T>4&&!D[Y4[T-1]];--T);var $=h+5<<3,U=Qd(i,mh)+Qd(a,I0)+o,te=Qd(i,m)+Qd(a,w)+o+14+3*T+Qd(O,D)+2*O[16]+3*O[17]+7*O[18];if(u>=0&&$<=U&&$<=te)return B7(t,c,e.subarray(u,u+h));var se,ee,Q,re;if(fc(t,c,1+(te<U)),c+=2,te<U){se=bp(m,d,0),ee=m,Q=bp(w,x,0),re=w;var X=bp(D,L,0);fc(t,c,k-257),fc(t,c+5,M-1),fc(t,c+10,T-4),c+=14;for(var R=0;R<T;++R)fc(t,c+3*R,D[Y4[R]]);c+=3*T;for(var B=[S,A],F=0;F<2;++F)for(var z=B[F],R=0;R<z.length;++R){var Y=z[R]&31;fc(t,c,X[Y]),c+=D[Y],Y>15&&(fc(t,c,z[R]>>5&127),c+=z[R]>>12)}}else se=XR,ee=mh,Q=KR,re=I0;for(var R=0;R<s;++R){var J=r[R];if(J>255){var Y=J>>18&31;Zd(t,c,se[Y+257]),c+=ee[Y+257],Y>7&&(fc(t,c,J>>23&31),c+=Cy[Y]);var K=J&31;Zd(t,c,Q[K]),c+=re[K],K>3&&(Zd(t,c,J>>5&8191),c+=Ly[K])}else Zd(t,c,se[J]),c+=ee[J]}return Zd(t,c,se[256]),c+ee[256]},QR=new Oy([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),z7=new au(0),JR=function(e,t,n,r,i,a){var o=a.z||e.length,s=new au(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 p=QR[t-1],m=p>>13,d=p&8191,y=(1<<n)-1,w=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 Oy(25e3),A=new ll(288),M=new ll(32),O=0,R=0,j=a.i||0,D=0,L=a.w||0,T=0;j+2<o;++j){var $=k(j),U=j&32767,te=x[$];if(w[U]=te,x[$]=U,L<=j){var se=o-j;if((O>7e3||D>24576)&&(se>423||!h)){c=Z4(e,u,0,E,A,M,R,D,T,j-T,c),D=O=R=0,T=j;for(var ee=0;ee<286;++ee)A[ee]=0;for(var ee=0;ee<30;++ee)M[ee]=0}var Q=2,re=0,X=d,B=U-te&32767;if(se>2&&$==k(j-B))for(var F=Math.min(m,se)-1,z=Math.min(32767,j),Y=Math.min(258,se);B<=z&&--X&&U!=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=w[fe],we=fe-ue&32767;we>ie&&(ie=we,te=fe)}}}U=te,te=w[U],B+=U-te&32767}if(re){E[D++]=268435456|Tv[Q]<<18|X4[re];var Ce=Tv[Q]&31,Ue=X4[re]&31;R+=Cy[Ce]+Ly[Ue],++A[257+Ce],++M[Ue],L=j+Q,++O}else E[D++]=e[j],++A[e[j]]}}for(j=Math.max(j,L);j<o;++j)E[D++]=e[j],++A[e[j]];c=Z4(e,u,h,E,A,M,R,D,T,j-T,c),h||(a.r=c&7|u[c/8|0]<<3,c-=7,a.h=x,a.p=w,a.i=j,a.w=L)}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=B7(u,c+1,e.subarray(j,ze))}a.i=o}return ZR(s,0,r+F7(c)+i)},q7=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}}},eM=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),o=new au(a.length+e.length);o.set(a),o.set(e,a.length),e=o,i.w=a.length}return JR(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)},U7=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},tM=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=q7();i.p(t.dictionary),U7(e,2,i.d())}};function Iv(e,t){t||(t={});var n=q7();n.p(e);var r=eM(e,t,t.dictionary?6:2,4);return tM(r,t),U7(r,r.length-4,n.d()),r}var nM=typeof TextDecoder<"u"&&new TextDecoder,rM=0;try{nM.decode(z7,{stream:!0}),rM=1}catch{}function iM(e){if(Array.isArray(e))return e}function aM(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 Q4(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 oM(e,t){if(e){if(typeof e=="string")return Q4(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)?Q4(e,t):void 0}}function sM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
445
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J4(e,t){return iM(e)||aM(e,t)||oM(e,t)||sM()}function ew(e,t="utf8"){return new TextDecoder(t).decode(e)}const lM=new TextEncoder;function uM(e){return lM.encode(e)}const cM=1024*8,fM=(()=>{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 Ny{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(t=cM,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 Ny)&&(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===fM&&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 ew(this.readBytes(t))}decodeText(t=1,n="utf8"){return ew(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(uM(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 hM=3,dM=258,H7=29,pM=256,gM=pM+1+H7,$7=30,mM=512,vM=new Array((gM+2)*2);Ld(vM);const yM=new Array($7*2);Ld(yM);const bM=new Array(mM);Ld(bM);const wM=new Array(dM-hM+1);Ld(wM);const xM=new Array(H7);Ld(xM);const _M=new Array($7);Ld(_M);const SM=(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 jv=SM;const EM=()=>{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},kM=new Uint32Array(EM()),AM=(e,t,n,r)=>{const i=kM,a=r+n;e^=-1;for(let o=r;o<a;o++)e=e>>>8^i[(e^t[o])&255];return e^-1};var Mu=AM,Dv={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"},G7={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 PM=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var OM=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)PM(n,r)&&(e[r]=n[r])}}return e},CM=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},W7={assign:OM,flattenChunks:CM};let V7=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{V7=!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 LM=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 NM=(e,t)=>{if(t<65534&&e.subarray&&V7)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 TM=(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 NM(a,i)},RM=(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},Fv={string2buf:LM,buf2string:TM,utf8border:RM};function MM(){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 IM=MM;const H1=16209,jM=16191;var DM=function(t,n){let r,i,a,o,s,u,h,c,p,m,d,y,w,x,b,S,k,E,A,M,O,R,j,D;const L=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=L.dmax,h=L.wsize,c=L.whave,p=L.wnext,m=L.window,d=L.hold,y=L.bits,w=L.lencode,x=L.distcode,b=(1<<L.lenbits)-1,S=(1<<L.distbits)-1;e:do{y<15&&(d+=j[r++]<<y,y+=8,d+=j[r++]<<y,y+=8),k=w[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(M=k&65535,E&=15,y<E&&(d+=j[r++]<<y,y+=8,y<E&&(d+=j[r++]<<y,y+=8)),M+=d&(1<<E)-1,M>u){t.msg="invalid distance too far back",L.mode=H1;break e}if(d>>>=E,y-=E,E=a-o,M>E){if(E=M-E,E>c&&L.sane){t.msg="invalid distance too far back",L.mode=H1;break e}if(O=0,R=m,p===0){if(O+=h-E,E<A){A-=E;do D[a++]=m[O++];while(--E);O=a-M,R=D}}else if(p<E){if(O+=h+p-E,E-=p,E<A){A-=E;do D[a++]=m[O++];while(--E);if(O=0,p<A){E=p,A-=E;do D[a++]=m[O++];while(--E);O=a-M,R=D}}}else if(O+=p-E,E<A){A-=E;do D[a++]=m[O++];while(--E);O=a-M,R=D}for(;A>2;)D[a++]=R[O++],D[a++]=R[O++],D[a++]=R[O++],A-=3;A&&(D[a++]=R[O++],A>1&&(D[a++]=R[O++]))}else{O=a-M;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",L.mode=H1;break e}break}}else if((E&64)===0){k=w[(k&65535)+(d&(1<<E)-1)];continue t}else if(E&32){L.mode=jM;break e}else{t.msg="invalid literal/length code",L.mode=H1;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),L.hold=d,L.bits=y};const Kh=15,tw=852,nw=592,rw=0,Nm=1,iw=2,FM=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]),BM=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]),zM=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]),qM=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]),UM=(e,t,n,r,i,a,o,s)=>{const u=s.bits;let h=0,c=0,p=0,m=0,d=0,y=0,w=0,x=0,b=0,S=0,k,E,A,M,O,R=null,j;const D=new Uint16Array(Kh+1),L=new Uint16Array(Kh+1);let T=null,$,U,te;for(h=0;h<=Kh;h++)D[h]=0;for(c=0;c<r;c++)D[t[n+c]]++;for(d=u,m=Kh;m>=1&&D[m]===0;m--);if(d>m&&(d=m),m===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(p=1;p<m&&D[p]===0;p++);for(d<p&&(d=p),x=1,h=1;h<=Kh;h++)if(x<<=1,x-=D[h],x<0)return-1;if(x>0&&(e===rw||m!==1))return-1;for(L[1]=0,h=1;h<Kh;h++)L[h+1]=L[h]+D[h];for(c=0;c<r;c++)t[n+c]!==0&&(o[L[t[n+c]]++]=c);if(e===rw?(R=T=o,j=20):e===Nm?(R=FM,T=BM,j=257):(R=zM,T=qM,j=0),S=0,c=0,h=p,O=a,y=d,w=0,A=-1,b=1<<d,M=b-1,e===Nm&&b>tw||e===iw&&b>nw)return 1;for(;;){$=h-w,o[c]+1<j?(U=0,te=o[c]):o[c]>=j?(U=T[o[c]-j],te=R[o[c]-j]):(U=96,te=0),k=1<<h-w,E=1<<y,p=E;do E-=k,i[O+(S>>w)+E]=$<<24|U<<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===m)break;h=t[n+o[c]]}if(h>d&&(S&M)!==A){for(w===0&&(w=d),O+=p,y=h-w,x=1<<y;y+w<m&&(x-=D[y+w],!(x<=0));)y++,x<<=1;if(b+=1<<y,e===Nm&&b>tw||e===iw&&b>nw)return 1;A=S&M,i[A]=d<<24|y<<16|O-a|0}}return S!==0&&(i[O+S]=h-w<<24|64<<16|0),s.bits=d,0};var wp=UM;const HM=0,Y7=1,X7=2,{Z_FINISH:aw,Z_BLOCK:$M,Z_TREES:$1,Z_OK:vh,Z_STREAM_END:GM,Z_NEED_DICT:WM,Z_STREAM_ERROR:Tl,Z_DATA_ERROR:K7,Z_MEM_ERROR:Z7,Z_BUF_ERROR:VM,Z_DEFLATED:ow}=G7,lg=16180,sw=16181,lw=16182,uw=16183,cw=16184,fw=16185,hw=16186,dw=16187,pw=16188,gw=16189,j0=16190,hc=16191,Tm=16192,mw=16193,Rm=16194,vw=16195,yw=16196,bw=16197,ww=16198,G1=16199,W1=16200,xw=16201,_w=16202,Sw=16203,Ew=16204,kw=16205,Mm=16206,Aw=16207,Pw=16208,Ci=16209,Q7=16210,J7=16211,YM=852,XM=592,KM=15,ZM=KM,Ow=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function QM(){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<lg||t.mode>J7?1:0},e_=e=>{if(Ch(e))return Tl;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=lg,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(YM),t.distcode=t.distdyn=new Int32Array(XM),t.sane=1,t.back=-1,vh},t_=e=>{if(Ch(e))return Tl;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,e_(e)},n_=(e,t)=>{let n;if(Ch(e))return Tl;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Tl:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,t_(e))},r_=(e,t)=>{if(!e)return Tl;const n=new QM;e.state=n,n.strm=e,n.window=null,n.mode=lg;const r=n_(e,t);return r!==vh&&(e.state=null),r},JM=e=>r_(e,ZM);let Cw=!0,Im,jm;const eI=e=>{if(Cw){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(Y7,e.lens,0,288,Im,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;wp(X7,e.lens,0,32,jm,0,e.work,{bits:5}),Cw=!1}e.lencode=Im,e.lenbits=9,e.distcode=jm,e.distbits=5},i_=(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},tI=(e,t)=>{let n,r,i,a,o,s,u,h,c,p,m,d,y,w,x=0,b,S,k,E,A,M,O,R;const j=new Uint8Array(4);let D,L;const T=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 Tl;n=e.state,n.mode===hc&&(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,p=s,m=u,R=vh;e:for(;;)switch(n.mode){case lg: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=Mu(n.check,j,2,0),h=0,c=0,n.mode=sw;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)!==ow){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?gw:hc,h=0,c=0;break;case sw:for(;c<16;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}if(n.flags=h,(n.flags&255)!==ow){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=Mu(n.check,j,2,0)),h=0,c=0,n.mode=lw;case lw: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=Mu(n.check,j,4,0)),h=0,c=0,n.mode=uw;case uw: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=Mu(n.check,j,2,0)),h=0,c=0,n.mode=cw;case cw: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=Mu(n.check,j,2,0)),h=0,c=0}else n.head&&(n.head.extra=null);n.mode=fw;case fw: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=Mu(n.check,r,d,a)),s-=d,a+=d,n.length-=d),n.length))break e;n.length=0,n.mode=hw;case hw: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=Mu(n.check,r,d,a)),s-=d,a+=d,O)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=dw;case dw: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=Mu(n.check,r,d,a)),s-=d,a+=d,O)break e}else n.head&&(n.head.comment=null);n.mode=pw;case pw: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=hc;break;case gw:for(;c<32;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}e.adler=n.check=Ow(h),h=0,c=0,n.mode=j0;case j0: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,WM;e.adler=n.check=1,n.mode=hc;case hc:if(t===$M||t===$1)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=mw;break;case 1:if(eI(n),n.mode=G1,t===$1){h>>>=2,c-=2;break e}break;case 2:n.mode=yw;break;case 3:e.msg="invalid block type",n.mode=Ci}h>>>=2,c-=2;break;case mw: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===$1)break e;case Rm:n.mode=vw;case vw: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=hc;break;case yw: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=bw;case bw:for(;n.have<n.ncode;){for(;c<3;){if(s===0)break e;s--,h+=r[a++]<<c,c+=8}n.lens[T[n.have++]]=h&7,h>>>=3,c-=3}for(;n.have<19;)n.lens[T[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,D={bits:n.lenbits},R=wp(HM,n.lens,0,19,n.lencode,0,n.work,D),n.lenbits=D.bits,R){e.msg="invalid code lengths set",n.mode=Ci;break}n.have=0,n.mode=ww;case ww: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(L=b+2;c<L;){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(L=b+3;c<L;){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(L=b+7;c<L;){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},R=wp(Y7,n.lens,0,n.nlen,n.lencode,0,n.work,D),n.lenbits=D.bits,R){e.msg="invalid literal/lengths set",n.mode=Ci;break}if(n.distbits=6,n.distcode=n.distdyn,D={bits:n.distbits},R=wp(X7,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,D),n.distbits=D.bits,R){e.msg="invalid distances set",n.mode=Ci;break}if(n.mode=G1,t===$1)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,DM(e,m),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===hc&&(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,M=k;x=n.lencode[M+((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=kw;break}if(S&32){n.back=-1,n.mode=hc;break}if(S&64){e.msg="invalid literal/length code",n.mode=Ci;break}n.extra=S&15,n.mode=xw;case xw:if(n.extra){for(L=n.extra;c<L;){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=_w;case _w: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,M=k;x=n.distcode[M+((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=Sw;case Sw:if(n.extra){for(L=n.extra;c<L;){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=Ew;case Ew:if(u===0)break e;if(d=m-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),w=n.window}else w=i,y=o-n.offset,d=n.length;d>u&&(d=u),u-=d,n.length-=d;do i[o++]=w[y++];while(--d);n.length===0&&(n.mode=W1);break;case kw: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(m-=u,e.total_out+=m,n.total+=m,n.wrap&4&&m&&(e.adler=n.check=n.flags?Mu(n.check,i,m,o-m):jv(n.check,i,m,o-m)),m=u,n.wrap&4&&(n.flags?h:Ow(h))!==n.check){e.msg="incorrect data check",n.mode=Ci;break}h=0,c=0}n.mode=Aw;case Aw: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=Pw;case Pw:R=GM;break e;case Ci:R=K7;break e;case Q7:return Z7;case J7:default:return Tl}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||m!==e.avail_out&&n.mode<Ci&&(n.mode<Mm||t!==aw))&&i_(e,e.output,e.next_out,m-e.avail_out),p-=e.avail_in,m-=e.avail_out,e.total_in+=p,e.total_out+=m,n.total+=m,n.wrap&4&&m&&(e.adler=n.check=n.flags?Mu(n.check,i,m,e.next_out-m):jv(n.check,i,m,e.next_out-m)),e.data_type=n.bits+(n.last?64:0)+(n.mode===hc?128:0)+(n.mode===G1||n.mode===Rm?256:0),(p===0&&m===0||t===aw)&&R===vh&&(R=VM),R},nI=e=>{if(Ch(e))return Tl;let t=e.state;return t.window&&(t.window=null),e.state=null,vh},rI=(e,t)=>{if(Ch(e))return Tl;const n=e.state;return(n.wrap&2)===0?Tl:(n.head=t,t.done=!1,vh)},iI=(e,t)=>{const n=t.length;let r,i,a;return Ch(e)||(r=e.state,r.wrap!==0&&r.mode!==j0)?Tl:r.mode===j0&&(i=1,i=jv(i,t,n,0),i!==r.check)?K7:(a=i_(e,t,n,n),a?(r.mode=Q7,Z7):(r.havedict=1,vh))};var aI=t_,oI=n_,sI=e_,lI=JM,uI=r_,cI=tI,fI=nI,hI=rI,dI=iI,pI="pako inflate (from Nodeca project)",gc={inflateReset:aI,inflateReset2:oI,inflateResetKeep:sI,inflateInit:lI,inflateInit2:uI,inflate:cI,inflateEnd:fI,inflateGetHeader:hI,inflateSetDictionary:dI,inflateInfo:pI};function gI(){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 mI=gI;const a_=Object.prototype.toString,{Z_NO_FLUSH:vI,Z_FINISH:yI,Z_OK:Rp,Z_STREAM_END:Dm,Z_NEED_DICT:Fm,Z_STREAM_ERROR:bI,Z_DATA_ERROR:Lw,Z_MEM_ERROR:wI}=G7;function Yp(e){this.options=W7.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 IM,this.strm.avail_out=0;let n=gc.inflateInit2(this.strm,t.windowBits);if(n!==Rp)throw new Error(Dv[n]);if(this.header=new mI,gc.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Fv.string2buf(t.dictionary):a_.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=gc.inflateSetDictionary(this.strm,t.dictionary),n!==Rp)))throw new Error(Dv[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?yI:vI,a_.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=gc.inflate(n,o),a===Fm&&i&&(a=gc.inflateSetDictionary(n,i),a===Rp?a=gc.inflate(n,o):a===Lw&&(a=Fm));n.avail_in>0&&a===Dm&&n.state.wrap>0&&e[n.next_in]!==0;)gc.inflateReset(n),a=gc.inflate(n,o);switch(a){case bI:case Lw:case Fm:case wI: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=Fv.utf8border(n.output,n.next_out),h=n.next_out-u,c=Fv.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=gc.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=W7.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function xI(e,t){const n=new Yp(t);if(n.push(e),n.err)throw n.msg||Dv[n.err];return n.result}var _I=Yp,SI=xI,EI={Inflate:_I,inflate:SI};const{Inflate:kI,inflate:AI}=EI;var Nw=kI,PI=AI;const o_=[];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;o_[e]=t}const Tw=4294967295;function OI(e,t,n){let r=e;for(let i=0;i<n;i++)r=o_[(r^t[i])&255]^r>>>8;return r}function CI(e,t){return(OI(Tw,e,t)^Tw)>>>0}function Rw(e,t,n){const r=e.readUint32(),i=CI(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 s_(e,t,n){for(let r=0;r<n;r++)t[r]=e[r]}function l_(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 u_(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 c_(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 f_(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]+LI(t[a-i],n[a],n[a-i])&255}}function LI(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 NI(e,t,n,r,i,a){switch(e){case 0:s_(t,n,i);break;case 1:l_(t,n,i,a);break;case 2:u_(t,n,r,i);break;case 3:c_(t,n,r,i,a);break;case 4:f_(t,n,r,i,a);break;default:throw new Error(`Unsupported filter: ${e}`)}}const TI=new Uint16Array([255]),RI=new Uint8Array(TI.buffer),MI=RI[0]===255;function II(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 p=o[c],m=Math.ceil((n-p.x)/p.xStep),d=Math.ceil((r-p.y)/p.yStep);if(m<=0||d<=0)continue;const y=m*s,w=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);NI(b,S,k,w,y,s),w.set(k);for(let E=0;E<m;E++){const A=p.x+E*p.xStep,M=p.y+x*p.yStep;if(!(A>=n||M>=r))for(let O=0;O<s;O++)u[(M*n+A)*s+O]=k[E*s+O]}}}if(a===16){const c=new Uint16Array(u.buffer);if(MI)for(let p=0;p<c.length;p++)c[p]=jI(c[p]);return c}else return u}function jI(e){return(e&255)<<8|e>>8&255}const DI=new Uint16Array([255]),FI=new Uint8Array(DI.buffer),BI=FI[0]===255,zI=new Uint8Array(0);function Mw(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=zI,c=0,p,m;for(let d=0;d<r;d++){switch(p=t.subarray(c+1,c+1+s),m=u.subarray(d*s,(d+1)*s),t[c]){case 0:s_(p,m,s);break;case 1:l_(p,m,s,o);break;case 2:u_(p,m,h,s);break;case 3:c_(p,m,h,s,o);break;case 4:f_(p,m,h,s,o);break;default:throw new Error(`Unsupported filter: ${t[c]}`)}h=m,c+=s+1}if(a===16){const d=new Uint16Array(u.buffer);if(BI)for(let y=0;y<d.length;y++)d[y]=qI(d[y]);return d}else return u}function qI(e){return(e&255)<<8|e>>8&255}const l0=Uint8Array.of(137,80,78,71,13,10,26,10);function Iw(e){if(!UI(e.readBytes(l0.length)))throw new Error("wrong PNG signature")}function UI(e){if(e.length<l0.length)return!1;for(let t=0;t<l0.length;t++)if(e[t]!==l0[t])return!1;return!0}const HI="tEXt",$I=0,h_=new TextDecoder("latin1");function GI(e){if(VI(e),e.length===0||e.length>79)throw new Error("keyword length must be between 1 and 79")}const WI=/^[\u0000-\u00FF]*$/;function VI(e){if(!WI.test(e))throw new Error("invalid latin1 text")}function YI(e,t,n){const r=d_(t);e[r]=XI(t,n-r.length-1)}function d_(e){for(e.mark();e.readByte()!==$I;);const t=e.offset;e.reset();const n=h_.decode(e.readBytes(t-e.offset-1));return e.skip(1),GI(n),n}function XI(e,t){return h_.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},jw={UNKNOWN:-1,ADAPTIVE:0},zm={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},V1={NONE:0,BACKGROUND:1,PREVIOUS:2},qm={SOURCE:0,OVER:1};class KI extends Ny{_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 Nw,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=jw.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(Iw(this);!this._end;){const t=this.readUint32(),n=this.readChars(4);this.decodeChunk(t,n)}return this.decodeImage(),this._png}decodeApng(){for(Iw(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 HI:YI(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?Rw(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?Rw(this,t+4,n):this.skip(4)}decodeIHDR(){const t=this._png;t.width=this.readUint32(),t.height=this.readUint32(),t.depth=ZI(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=d_(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:PI(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=Mw({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 qm.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 qm.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,p=h%(this._png.channels-1)===0?1:n.data[u+h],m=Math.floor(c*p+(1-c)*t.data[s+h]);t.data[s+h]+=m}}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!==jw.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===zm.NO_INTERLACE)this._png.data=Mw({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=II({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:qm.SOURCE,data:t}),this._inflator=new Nw,this._writingDataChunks=!1}}function ZI(e){if(e!==1&&e!==2&&e!==4&&e!==8&&e!==16)throw new Error(`invalid bit depth: ${e}`);return e}var Dw;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.METRE=1]="METRE"})(Dw||(Dw={}));function QI(e,t){return new KI(e,t).decode()}var En=(function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this})();function Um(){En.console&&typeof En.console.log=="function"&&En.console.log.apply(En.console,arguments)}var Qr={log:Um,warn:function(e){En.console&&(typeof En.console.warn=="function"?En.console.warn.apply(En.console,arguments):Um.call(null,arguments))},error:function(e){En.console&&(typeof En.console.error=="function"?En.console.error.apply(En.console,arguments):Um(e))}};function Hm(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(){Qr.error("could not download file")},r.send()}function Fw(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?Fw(i.href)?Hm(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(Fw(e))Hm(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"&&(Qr.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 Hm(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 p_(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 u0=En.atob.bind(En),Bw=En.btoa.bind(En);function $m(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=qo(n,r=zo(r,i,a,n,t[12],20,-1926607734),i,a,t[5],4,-378558),a=qo(a,n,r,i,t[8],11,-2022574463),i=qo(i,a,n,r,t[11],16,1839030562),r=qo(r,i,a,n,t[14],23,-35309556),n=qo(n,r,i,a,t[1],4,-1530992060),a=qo(a,n,r,i,t[4],11,1272893353),i=qo(i,a,n,r,t[7],16,-155497632),r=qo(r,i,a,n,t[10],23,-1094730640),n=qo(n,r,i,a,t[13],4,681279174),a=qo(a,n,r,i,t[0],11,-358537222),i=qo(i,a,n,r,t[3],16,-722521979),r=qo(r,i,a,n,t[6],23,76029189),n=qo(n,r,i,a,t[9],4,-640364487),a=qo(a,n,r,i,t[12],11,-421815835),i=qo(i,a,n,r,t[15],16,530742520),n=Uo(n,r=qo(r,i,a,n,t[2],23,-995338651),i,a,t[0],6,-198630844),a=Uo(a,n,r,i,t[7],10,1126891415),i=Uo(i,a,n,r,t[14],15,-1416354905),r=Uo(r,i,a,n,t[5],21,-57434055),n=Uo(n,r,i,a,t[12],6,1700485571),a=Uo(a,n,r,i,t[3],10,-1894986606),i=Uo(i,a,n,r,t[10],15,-1051523),r=Uo(r,i,a,n,t[1],21,-2054922799),n=Uo(n,r,i,a,t[8],6,1873313359),a=Uo(a,n,r,i,t[15],10,-30611744),i=Uo(i,a,n,r,t[6],15,-1560198380),r=Uo(r,i,a,n,t[13],21,1309151649),n=Uo(n,r,i,a,t[4],6,-145523070),a=Uo(a,n,r,i,t[11],10,-1120210379),i=Uo(i,a,n,r,t[2],15,718787259),r=Uo(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 ug(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 ug(t&n|~t&r,e,t,i,a,o)}function zo(e,t,n,r,i,a,o){return ug(t&r|n&~r,e,t,i,a,o)}function qo(e,t,n,r,i,a,o){return ug(t^n^r,e,t,i,a,o)}function Uo(e,t,n,r,i,a,o){return ug(n^(t|~r),e,t,i,a,o)}function g_(e){var t,n=e.length,r=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)$m(r,JI(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($m(r,i),t=0;t<16;t++)i[t]=0;return i[14]=8*n,$m(r,i),r}function JI(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 zw="0123456789abcdef".split("");function ej(e){for(var t="",n=0;n<4;n++)t+=zw[e>>8*n+4&15]+zw[e>>8*n&15];return t}function tj(e){return String.fromCharCode(255&e,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function Bv(e){return g_(e).map(tj).join("")}var nj=(function(e){for(var t=0;t<e.length;t++)e[t]=ej(e[t]);return e.join("")})(g_("hello"))!="5d41402abc4b2a76b9719d911017c592";function yf(e,t){if(nj){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}return e+t&4294967295}function zv(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 p=t.length,m=0,d=0,y="";for(u=0;u<p;u++)d=(d+(c=s[m=(m+1)%256]))%256,s[m]=s[d],s[d]=c,o=s[(s[m]+s[d])%256],y+=String.fromCharCode(t.charCodeAt(u)^o);return y}var qw={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(qw.perm!==void 0)throw new Error("Invalid permission: "+s);i+=qw[s]}),this.padding="(¿N^NuŠAd\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=Bv(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=zv(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 Uw(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&&Qr.error("jsPDF PubSub Error",s.message,s)}o[1]&&i.push(a)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function D0(e){if(!(this instanceof D0))return new D0(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 m_(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,m_.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,m_.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 p=e.putOnlyUsedFonts||!1,m={},d={internal:{},__private__:{}};d.__private__.PubSub=Uw;var y="1.3",w=d.__private__.getPdfVersion=function(){return y};d.__private__.setPdfVersion=function(H){y=H};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(H){return x[H]};i=i||"a4";var S="compat",k="advanced",E=S;function A(){this.saveGraphicsState(),ge(new Qt(at,0,0,-at,0,_i()*at).toString()+" cm"),this.setFontSize(this.getFontSize()/at),h="n",E=k}function M(){this.restoreGraphicsState(),h="S",E=S}var O=d.__private__.combineFontStyleAndFontWeight=function(H,ce){if(H=="bold"&&ce=="normal"||H=="bold"&&ce==400||H=="normal"&&ce=="italic"||H=="bold"&&ce=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return ce&&(H=ce==400||ce==="normal"?H==="italic"?"italic":"normal":ce!=700&&ce!=="bold"||H!=="normal"?(ce==700?"bold":ce)+""+H:"bold"),H};d.advancedAPI=function(H){var ce=E===S;return ce&&A.call(this),typeof H!="function"||(H(this),ce&&M.call(this)),this},d.compatAPI=function(H){var ce=E===k;return ce&&M.call(this),typeof H!="function"||(H(this),ce&&A.call(this)),this},d.isAdvancedAPI=function(){return E===k};var R,j=function(H){if(E!==k)throw new Error(H+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},D=d.roundToPrecision=d.__private__.roundToPrecision=function(H,ce){var Oe=t||ce;if(isNaN(H)||isNaN(Oe))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return H.toFixed(Oe).replace(/0+$/,"")};R=d.hpf=d.__private__.hpf=typeof u=="number"?function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.hpf");return D(H,u)}:u==="smart"?function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.hpf");return D(H,H>-1&&H<1?16:5)}:function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.hpf");return D(H,16)};var L=d.f2=d.__private__.f2=function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.f2");return D(H,2)},T=d.__private__.f3=function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.f3");return D(H,3)},$=d.scale=d.__private__.scale=function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.scale");return E===S?H*at:E===k?H:void 0},U=function(H){return $((function(ce){return E===S?_i()-ce:E===k?ce:void 0})(H))};d.__private__.setPrecision=d.setPrecision=function(H){typeof parseInt(H,10)=="number"&&(t=parseInt(H,10))};var te,se="00000000000000000000000000000000",ee=d.__private__.getFileId=function(){return se},Q=d.__private__.setFileId=function(H){return se=H!==void 0&&/^[a-fA-F0-9]{32}$/.test(H)?H.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(H){return Q(H),this},d.getFileId=function(){return ee()};var re=d.__private__.convertDateToPDFDate=function(H){var ce=H.getTimezoneOffset(),Oe=ce<0?"+":"-",je=Math.floor(Math.abs(ce/60)),$e=Math.abs(ce%60),ht=[Oe,Y(je),"'",Y($e),"'"].join("");return["D:",H.getFullYear(),Y(H.getMonth()+1),Y(H.getDate()),Y(H.getHours()),Y(H.getMinutes()),Y(H.getSeconds()),ht].join("")},X=d.__private__.convertPDFDateToDate=function(H){var ce=parseInt(H.substr(2,4),10),Oe=parseInt(H.substr(6,2),10)-1,je=parseInt(H.substr(8,2),10),$e=parseInt(H.substr(10,2),10),ht=parseInt(H.substr(12,2),10),pt=parseInt(H.substr(14,2),10);return new Date(ce,Oe,je,$e,ht,pt,0)},B=d.__private__.setCreationDate=function(H){var ce;if(H===void 0&&(H=new Date),H instanceof Date)ce=re(H);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(H))throw new Error("Invalid argument passed to jsPDF.setCreationDate");ce=H}return te=ce},F=d.__private__.getCreationDate=function(H){var ce=te;return H==="jsDate"&&(ce=X(te)),ce};d.setCreationDate=function(H){return B(H),this},d.getCreationDate=function(H){return F(H)};var z,Y=d.__private__.padd2=function(H){return("0"+parseInt(H)).slice(-2)},J=d.__private__.padd2Hex=function(H){return("00"+(H=H.toString())).substr(H.length)},K=0,ie=[],fe=[],ue=0,we=[],Ce=[],Ue=!1,ze=fe;d.__private__.setCustomOutputDestination=function(H){Ue=!0,ze=H};var tt=function(H){Ue||(ze=H)};d.__private__.resetCustomOutputDestination=function(){Ue=!1,ze=fe};var ge=d.__private__.out=function(H){return H=H.toString(),ue+=H.length+1,ze.push(H),ze},ut=d.__private__.write=function(H){return ge(arguments.length===1?H.toString():Array.prototype.join.call(arguments," "))},ke=d.__private__.getArrayBuffer=function(H){for(var ce=H.length,Oe=new ArrayBuffer(ce),je=new Uint8Array(Oe);ce--;)je[ce]=H.charCodeAt(ce);return Oe},he=[["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 he};var be=e.fontSize||16;d.__private__.setFontSize=d.setFontSize=function(H){return be=E===k?H/at:H,this};var Le,Me=d.__private__.getFontSize=d.getFontSize=function(){return E===S?be:be*at},ve=e.R2L||!1;d.__private__.setR2L=d.setR2L=function(H){return ve=H,this},d.__private__.getR2L=d.getR2L=function(){return ve};var ye,xe=d.__private__.setZoomMode=function(H){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(H))Le=H;else if(isNaN(H)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(H)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+H+'" is not recognized.');Le=H}else Le=parseInt(H,10)};d.__private__.getZoomMode=function(){return Le};var Ie,Te=d.__private__.setPageMode=function(H){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(H)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+H+'" is not recognized.');ye=H};d.__private__.getPageMode=function(){return ye};var Je=d.__private__.setLayoutMode=function(H){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(H)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+H+'" is not recognized.');Ie=H};d.__private__.getLayoutMode=function(){return Ie},d.__private__.setDisplayMode=d.setDisplayMode=function(H,ce,Oe){return xe(H),Je(ce),Te(Oe),this};var nt={title:"",subject:"",author:"",keywords:"",creator:""};d.__private__.getDocumentProperty=function(H){if(Object.keys(nt).indexOf(H)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return nt[H]},d.__private__.getDocumentProperties=function(){return nt},d.__private__.setDocumentProperties=d.setProperties=d.setDocumentProperties=function(H){for(var ce in nt)nt.hasOwnProperty(ce)&&H[ce]&&(nt[ce]=H[ce]);return this},d.__private__.setDocumentProperty=function(H,ce){if(Object.keys(nt).indexOf(H)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return nt[H]=ce};var st,at,ct,Ct,rn,Zt={},an={},We=[],Be={},Wt={},Et={},Nt={},Tt=null,on=0,Ht=[],hn=new Uw(d),ui=e.hotfixes||[],Ur={},hr={},dr=[],Qt=function H(ce,Oe,je,$e,ht,pt){if(!(this instanceof H))return new H(ce,Oe,je,$e,ht,pt);isNaN(ce)&&(ce=1),isNaN(Oe)&&(Oe=0),isNaN(je)&&(je=0),isNaN($e)&&($e=1),isNaN(ht)&&(ht=0),isNaN(pt)&&(pt=0),this._matrix=[ce,Oe,je,$e,ht,pt]};Object.defineProperty(Qt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(H){this._matrix[0]=H}}),Object.defineProperty(Qt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(H){this._matrix[1]=H}}),Object.defineProperty(Qt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(H){this._matrix[2]=H}}),Object.defineProperty(Qt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(H){this._matrix[3]=H}}),Object.defineProperty(Qt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(H){this._matrix[4]=H}}),Object.defineProperty(Qt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(H){this._matrix[5]=H}}),Object.defineProperty(Qt.prototype,"a",{get:function(){return this._matrix[0]},set:function(H){this._matrix[0]=H}}),Object.defineProperty(Qt.prototype,"b",{get:function(){return this._matrix[1]},set:function(H){this._matrix[1]=H}}),Object.defineProperty(Qt.prototype,"c",{get:function(){return this._matrix[2]},set:function(H){this._matrix[2]=H}}),Object.defineProperty(Qt.prototype,"d",{get:function(){return this._matrix[3]},set:function(H){this._matrix[3]=H}}),Object.defineProperty(Qt.prototype,"e",{get:function(){return this._matrix[4]},set:function(H){this._matrix[4]=H}}),Object.defineProperty(Qt.prototype,"f",{get:function(){return this._matrix[5]},set:function(H){this._matrix[5]=H}}),Object.defineProperty(Qt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Qt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Qt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Qt.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),Qt.prototype.join=function(H){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(R).join(H)},Qt.prototype.multiply=function(H){var ce=H.sx*this.sx+H.shy*this.shx,Oe=H.sx*this.shy+H.shy*this.sy,je=H.shx*this.sx+H.sy*this.shx,$e=H.shx*this.shy+H.sy*this.sy,ht=H.tx*this.sx+H.ty*this.shx+this.tx,pt=H.tx*this.shy+H.ty*this.sy+this.ty;return new Qt(ce,Oe,je,$e,ht,pt)},Qt.prototype.decompose=function(){var H=this.sx,ce=this.shy,Oe=this.shx,je=this.sy,$e=this.tx,ht=this.ty,pt=Math.sqrt(H*H+ce*ce),Ft=(H/=pt)*Oe+(ce/=pt)*je;Oe-=H*Ft,je-=ce*Ft;var jt=Math.sqrt(Oe*Oe+je*je);return Ft/=jt,H*(je/=jt)<ce*(Oe/=jt)&&(H=-H,ce=-ce,Ft=-Ft,pt=-pt),{scale:new Qt(pt,0,0,jt,0,0),translate:new Qt(1,0,0,1,$e,ht),rotate:new Qt(H,ce,-ce,H,0,0),skew:new Qt(1,0,Ft,1,0,0)}},Qt.prototype.toString=function(H){return this.join(" ")},Qt.prototype.inversed=function(){var H=this.sx,ce=this.shy,Oe=this.shx,je=this.sy,$e=this.tx,ht=this.ty,pt=1/(H*je-ce*Oe),Ft=je*pt,jt=-ce*pt,mn=-Oe*pt,xn=H*pt;return new Qt(Ft,jt,mn,xn,-Ft*$e-mn*ht,-jt*$e-xn*ht)},Qt.prototype.applyToPoint=function(H){var ce=H.x*this.sx+H.y*this.shx+this.tx,Oe=H.x*this.shy+H.y*this.sy+this.ty;return new Ga(ce,Oe)},Qt.prototype.applyToRectangle=function(H){var ce=this.applyToPoint(H),Oe=this.applyToPoint(new Ga(H.x+H.w,H.y+H.h));return new gl(ce.x,ce.y,Oe.x-ce.x,Oe.y-ce.y)},Qt.prototype.clone=function(){var H=this.sx,ce=this.shy,Oe=this.shx,je=this.sy,$e=this.tx,ht=this.ty;return new Qt(H,ce,Oe,je,$e,ht)},d.Matrix=Qt;var zi=d.matrixMult=function(H,ce){return ce.multiply(H)},Fa=new Qt(1,0,0,1,0,0);d.unitMatrix=d.identityMatrix=Fa;var ti=function(H,ce){if(!Wt[H]){var Oe=(ce instanceof th?"Sh":"P")+(Object.keys(Be).length+1).toString(10);ce.id=Oe,Wt[H]=Oe,Be[Oe]=ce,hn.publish("addPattern",ce)}};d.ShadingPattern=th,d.TilingPattern=ld,d.addShadingPattern=function(H,ce){return j("addShadingPattern()"),ti(H,ce),this},d.beginTilingPattern=function(H){j("beginTilingPattern()"),fi(H.boundingBox[0],H.boundingBox[1],H.boundingBox[2]-H.boundingBox[0],H.boundingBox[3]-H.boundingBox[1],H.matrix)},d.endTilingPattern=function(H,ce){j("endTilingPattern()"),ce.stream=Ce[z].join(`
446
- `),ti(H,ce),hn.publish("endTilingPattern",ce),dr.pop().restore()};var Zi,$n=d.__private__.newObject=function(){var H=Or();return Dr(H,!0),H},Or=d.__private__.newObjectDeferred=function(){return K++,ie[K]=function(){return ue},K},Dr=function(H,ce){return ce=typeof ce=="boolean"&&ce,ie[H]=ue,ce&&ge(H+" 0 obj"),H},Ea=d.__private__.newAdditionalObject=function(){var H={objId:Or(),content:""};return we.push(H),H},Go=Or(),ka=Or(),io=d.__private__.decodeColorString=function(H){var ce=H.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 je="#",$e=0;$e<3;$e++)je+=("0"+Math.floor(255*parseFloat(ce[$e])).toString(16)).slice(-2);return je},ci=d.__private__.encodeColorString=function(H){var ce;typeof H=="string"&&(H={ch1:H});var Oe=H.ch1,je=H.ch2,$e=H.ch3,ht=H.ch4,pt=H.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof Oe=="string"&&Oe.charAt(0)!=="#"){var Ft=new p_(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,je=jt>>8&255,$e=255&jt}if(je===void 0||ht===void 0&&Oe===je&&je===$e)ce=typeof Oe=="string"?Oe+" "+pt[0]:H.precision===2?L(Oe/255)+" "+pt[0]:T(Oe/255)+" "+pt[0];else if(ht===void 0||jr(ht)==="object"){if(ht&&!isNaN(ht.a)&&ht.a===0)return["1.","1.","1.",pt[1]].join(" ");ce=typeof Oe=="string"?[Oe,je,$e,pt[1]].join(" "):H.precision===2?[L(Oe/255),L(je/255),L($e/255),pt[1]].join(" "):[T(Oe/255),T(je/255),T($e/255),pt[1]].join(" ")}else ce=typeof Oe=="string"?[Oe,je,$e,ht,pt[2]].join(" "):H.precision===2?[L(Oe),L(je),L($e),L(ht),pt[2]].join(" "):[T(Oe),T(je),T($e),T(ht),pt[2]].join(" ");return ce},Aa=d.__private__.getFilters=function(){return o},Pa=d.__private__.putStream=function(H){var ce=(H=H||{}).data||"",Oe=H.filters||Aa(),je=H.alreadyAppliedFilters||[],$e=H.addLength1||!1,ht=ce.length,pt=H.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=H.additionalKeyValues||[],xn=(jt=sn.API.processDataByFilters!==void 0?sn.API.processDataByFilters(ce,Oe):{data:ce,reverseChain:[]}).reverseChain+(Array.isArray(je)?je.join(" "):je.toString());if(jt.data.length!==0&&(mn.push({key:"Length",value:jt.data.length}),$e===!0&&mn.push({key:"Length1",value:ht})),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=[],di=0;di<jt.reverseChain.split("/").length-1;di+=1)Lr.push("null");Lr.push(mn[Dn].value),mn[Dn].value="["+Lr.join(" ")+"]"}}ge("<<");for(var sr=0;sr<mn.length;sr++)ge("/"+mn[sr].key+" "+mn[sr].value);ge(">>"),jt.data.length!==0&&(ge("stream"),ge(Ft(jt.data)),ge("endstream"))},Wo=d.__private__.putPage=function(H){var ce=H.number,Oe=H.data,je=H.objId,$e=H.contentsObjId;Dr(je,!0),ge("<</Type /Page"),ge("/Parent "+H.rootDictionaryObjId+" 0 R"),ge("/Resources "+H.resourceDictionaryObjId+" 0 R"),ge("/MediaBox ["+parseFloat(R(H.mediaBox.bottomLeftX))+" "+parseFloat(R(H.mediaBox.bottomLeftY))+" "+R(H.mediaBox.topRightX)+" "+R(H.mediaBox.topRightY)+"]"),H.cropBox!==null&&ge("/CropBox ["+R(H.cropBox.bottomLeftX)+" "+R(H.cropBox.bottomLeftY)+" "+R(H.cropBox.topRightX)+" "+R(H.cropBox.topRightY)+"]"),H.bleedBox!==null&&ge("/BleedBox ["+R(H.bleedBox.bottomLeftX)+" "+R(H.bleedBox.bottomLeftY)+" "+R(H.bleedBox.topRightX)+" "+R(H.bleedBox.topRightY)+"]"),H.trimBox!==null&&ge("/TrimBox ["+R(H.trimBox.bottomLeftX)+" "+R(H.trimBox.bottomLeftY)+" "+R(H.trimBox.topRightX)+" "+R(H.trimBox.topRightY)+"]"),H.artBox!==null&&ge("/ArtBox ["+R(H.artBox.bottomLeftX)+" "+R(H.artBox.bottomLeftY)+" "+R(H.artBox.topRightX)+" "+R(H.artBox.topRightY)+"]"),typeof H.userUnit=="number"&&H.userUnit!==1&&ge("/UserUnit "+H.userUnit),hn.publish("putPage",{objId:je,pageContext:Ht[ce],pageNumber:ce,page:Oe}),ge("/Contents "+$e+" 0 R"),ge(">>"),ge("endobj");var ht=Oe.join(`
447
- `);return E===k&&(ht+=`
448
- Q`),Dr($e,!0),Pa({data:ht,filters:Aa(),objectId:$e}),ge("endobj"),je},qi=d.__private__.putPages=function(){var H,ce,Oe=[];for(H=1;H<=on;H++)Ht[H].objId=Or(),Ht[H].contentsObjId=Or();for(H=1;H<=on;H++)Oe.push(Wo({number:H,data:Ce[H],objId:Ht[H].objId,contentsObjId:Ht[H].contentsObjId,mediaBox:Ht[H].mediaBox,cropBox:Ht[H].cropBox,bleedBox:Ht[H].bleedBox,trimBox:Ht[H].trimBox,artBox:Ht[H].artBox,userUnit:Ht[H].userUnit,rootDictionaryObjId:Go,resourceDictionaryObjId:ka}));Dr(Go,!0),ge("<</Type /Pages");var je="/Kids [";for(ce=0;ce<on;ce++)je+=Oe[ce]+" 0 R ";ge(je+"]"),ge("/Count "+on),ge(">>"),ge("endobj"),hn.publish("postPutPages")},ao=function(H){hn.publish("putFont",{font:H,out:ge,newObject:$n,putStream:Pa}),H.isAlreadyPutted!==!0&&(H.objectNumber=$n(),ge("<<"),ge("/Type /Font"),ge("/BaseFont /"+td(H.postScriptName)),ge("/Subtype /Type1"),typeof H.encoding=="string"&&ge("/Encoding /"+H.encoding),ge("/FirstChar 32"),ge("/LastChar 255"),ge(">>"),ge("endobj"))},Fs=function(H){H.objectNumber=$n();var ce=[];ce.push({key:"Type",value:"/XObject"}),ce.push({key:"Subtype",value:"/Form"}),ce.push({key:"BBox",value:"["+[R(H.x),R(H.y),R(H.x+H.width),R(H.y+H.height)].join(" ")+"]"}),ce.push({key:"Matrix",value:"["+H.matrix.toString()+"]"});var Oe=H.pages[1].join(`
449
- `);Pa({data:Oe,additionalKeyValues:ce,objectId:H.objectNumber}),ge("endobj")},as=function(H,ce){ce||(ce=21);var Oe=$n(),je=(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 di="",sr=0,Si=0;Si<mn.length;Si++){for(jt=mn[Si];jt>pt[sr+1].offset;)sr++;var kr=pt[sr].offset,Li=(jt-kr)/(pt[sr+1].offset-kr),qs=pt[sr].color,Ya=pt[sr+1].color;di+=J(Math.round((1-Li)*qs[0]+Li*Ya[0]).toString(16))+J(Math.round((1-Li)*qs[1]+Li*Ya[1]).toString(16))+J(Math.round((1-Li)*qs[2]+Li*Ya[2]).toString(16))}return di.trim()})(H.colors,ce),$e=[];$e.push({key:"FunctionType",value:"0"}),$e.push({key:"Domain",value:"[0.0 1.0]"}),$e.push({key:"Size",value:"["+ce+"]"}),$e.push({key:"BitsPerSample",value:"8"}),$e.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),$e.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Pa({data:je,additionalKeyValues:$e,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:Oe}),ge("endobj"),H.objectNumber=$n(),ge("<< /ShadingType "+H.type),ge("/ColorSpace /DeviceRGB");var ht="/Coords ["+R(parseFloat(H.coords[0]))+" "+R(parseFloat(H.coords[1]))+" ";H.type===2?ht+=R(parseFloat(H.coords[2]))+" "+R(parseFloat(H.coords[3])):ht+=R(parseFloat(H.coords[2]))+" "+R(parseFloat(H.coords[3]))+" "+R(parseFloat(H.coords[4]))+" "+R(parseFloat(H.coords[5])),ge(ht+="]"),H.matrix&&ge("/Matrix ["+H.matrix.toString()+"]"),ge("/Function "+Oe+" 0 R"),ge("/Extend [true true]"),ge(">>"),ge("endobj")},hu=function(H,ce){var Oe=Or(),je=$n();ce.push({resourcesOid:Oe,objectOid:je}),H.objectNumber=je;var $e=[];$e.push({key:"Type",value:"/Pattern"}),$e.push({key:"PatternType",value:"1"}),$e.push({key:"PaintType",value:"1"}),$e.push({key:"TilingType",value:"1"}),$e.push({key:"BBox",value:"["+H.boundingBox.map(R).join(" ")+"]"}),$e.push({key:"XStep",value:R(H.xStep)}),$e.push({key:"YStep",value:R(H.yStep)}),$e.push({key:"Resources",value:Oe+" 0 R"}),H.matrix&&$e.push({key:"Matrix",value:"["+H.matrix.toString()+"]"}),Pa({data:H.stream,additionalKeyValues:$e,objectId:H.objectNumber}),ge("endobj")},If=function(H){for(var ce in H.objectNumber=$n(),ge("<<"),H)switch(ce){case"opacity":ge("/ca "+L(H[ce]));break;case"stroke-opacity":ge("/CA "+L(H[ce]))}ge(">>"),ge("endobj")},Cr=function(H){Dr(H.resourcesOid,!0),ge("<<"),ge("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),(function(){for(var ce in ge("/Font <<"),Zt)Zt.hasOwnProperty(ce)&&(p===!1||p===!0&&m.hasOwnProperty(ce))&&ge("/"+ce+" "+Zt[ce].objectNumber+" 0 R");ge(">>")})(),(function(){if(Object.keys(Be).length>0){for(var ce in ge("/Shading <<"),Be)Be.hasOwnProperty(ce)&&Be[ce]instanceof th&&Be[ce].objectNumber>=0&&ge("/"+ce+" "+Be[ce].objectNumber+" 0 R");hn.publish("putShadingPatternDict"),ge(">>")}})(),(function(ce){if(Object.keys(Be).length>0){for(var Oe in ge("/Pattern <<"),Be)Be.hasOwnProperty(Oe)&&Be[Oe]instanceof d.TilingPattern&&Be[Oe].objectNumber>=0&&Be[Oe].objectNumber<ce&&ge("/"+Oe+" "+Be[Oe].objectNumber+" 0 R");hn.publish("putTilingPatternDict"),ge(">>")}})(H.objectOid),(function(){if(Object.keys(Et).length>0){var ce;for(ce in ge("/ExtGState <<"),Et)Et.hasOwnProperty(ce)&&Et[ce].objectNumber>=0&&ge("/"+ce+" "+Et[ce].objectNumber+" 0 R");hn.publish("putGStateDict"),ge(">>")}})(),(function(){for(var ce in ge("/XObject <<"),Ur)Ur.hasOwnProperty(ce)&&Ur[ce].objectNumber>=0&&ge("/"+ce+" "+Ur[ce].objectNumber+" 0 R");hn.publish("putXobjectDict"),ge(">>")})(),ge(">>"),ge("endobj")},du=function(H){an[H.fontName]=an[H.fontName]||{},an[H.fontName][H.fontStyle]=H.id},os=function(H,ce,Oe,je,$e){var ht={id:"F"+(Object.keys(Zt).length+1).toString(10),postScriptName:H,fontName:ce,fontStyle:Oe,encoding:je,isStandardFont:$e||!1,metadata:{}};return hn.publish("addFont",{font:ht,instance:this}),Zt[ht.id]=ht,du(ht),ht.id},Oa=d.__private__.pdfEscape=d.pdfEscape=function(H,ce){return(function(Oe,je){var $e,ht,pt,Ft,jt,mn,xn,Dn,Lr;if(pt=(je=je||{}).sourceEncoding||"Unicode",jt=je.outputEncoding,(je.autoencode||jt)&&Zt[st].metadata&&Zt[st].metadata[pt]&&Zt[st].metadata[pt].encoding&&(Ft=Zt[st].metadata[pt].encoding,!jt&&Zt[st].encoding&&(jt=Zt[st].encoding),!jt&&Ft.codePages&&(jt=Ft.codePages[0]),typeof jt=="string"&&(jt=Ft[jt]),jt)){for(xn=!1,mn=[],$e=0,ht=Oe.length;$e<ht;$e++)(Dn=jt[Oe.charCodeAt($e)])?mn.push(String.fromCharCode(Dn)):mn.push(Oe[$e]),mn[$e].charCodeAt(0)>>8&&(xn=!0);Oe=mn.join("")}for($e=Oe.length;xn===void 0&&$e!==0;)Oe.charCodeAt($e-1)>>8&&(xn=!0),$e--;if(!xn)return Oe;for(mn=je.noBOM?[]:[254,255],$e=0,ht=Oe.length;$e<ht;$e++){if((Lr=(Dn=Oe.charCodeAt($e))>>8)>>8)throw new Error("Character at position "+$e+" 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)})(H,ce).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},ss=d.__private__.beginPage=function(H){Ce[++on]=[],Ht[on]={objId:0,contentsObjId:0,userUnit:Number(s),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(H[0]),topRightY:Number(H[1])}},Po(on),tt(Ce[z])},Lc=function(H,ce){var Oe,je,$e;switch(n=ce||n,typeof H=="string"&&(Oe=b(H.toLowerCase()),Array.isArray(Oe)&&(je=Oe[0],$e=Oe[1])),Array.isArray(H)&&(je=H[0]*at,$e=H[1]*at),isNaN(je)&&(je=i[0],$e=i[1]),(je>14400||$e>14400)&&(Qr.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),je=Math.min(14400,je),$e=Math.min(14400,$e)),i=[je,$e],n.substr(0,1)){case"l":$e>je&&(i=[$e,je]);break;case"p":je>$e&&(i=[$e,je])}ss(i),cn(Ua),ge(Bs),La!==0&&ge(La+" J"),co!==0&&ge(co+" j"),hn.publish("addPage",{pageNumber:on})},hl=function(H){H>0&&H<=on&&(Ce.splice(H,1),Ht.splice(H,1),on--,z>on&&(z=on),this.setPage(z))},Po=function(H){H>0&&H<=on&&(z=H)},wi=d.__private__.getNumberOfPages=d.getNumberOfPages=function(){return Ce.length-1},pr=function(H,ce,Oe){var je,$e=void 0;return Oe=Oe||{},H=H!==void 0?H:Zt[st].fontName,ce=ce!==void 0?ce:Zt[st].fontStyle,je=H.toLowerCase(),an[je]!==void 0&&an[je][ce]!==void 0?$e=an[je][ce]:an[H]!==void 0&&an[H][ce]!==void 0?$e=an[H][ce]:Oe.disableWarning===!1&&Qr.warn("Unable to look up font label for font '"+H+"', '"+ce+"'. Refer to getFontList() for available fonts."),$e||Oe.noFallback||($e=an.times[ce])==null&&($e=an.times.normal),$e},wn=d.__private__.putInfo=function(){var H=$n(),ce=function(je){return je};for(var Oe in c!==null&&(ce=xi.encryptor(H,0)),ge("<<"),ge("/Producer ("+Oa(ce("jsPDF "+sn.version))+")"),nt)nt.hasOwnProperty(Oe)&&nt[Oe]&&ge("/"+Oe.substr(0,1).toUpperCase()+Oe.substr(1)+" ("+Oa(ce(nt[Oe]))+")");ge("/CreationDate ("+Oa(ce(te))+")"),ge(">>"),ge("endobj")},oo=d.__private__.putCatalog=function(H){var ce=(H=H||{}).rootDictionaryObjId||Go;switch($n(),ge("<<"),ge("/Type /Catalog"),ge("/Pages "+ce+" 0 R"),Le||(Le="fullwidth"),Le){case"fullwidth":ge("/OpenAction [3 0 R /FitH null]");break;case"fullheight":ge("/OpenAction [3 0 R /FitV null]");break;case"fullpage":ge("/OpenAction [3 0 R /Fit]");break;case"original":ge("/OpenAction [3 0 R /XYZ null null 1]");break;default:var Oe=""+Le;Oe.substr(Oe.length-1)==="%"&&(Le=parseInt(Le)/100),typeof Le=="number"&&ge("/OpenAction [3 0 R /XYZ null null "+L(Le)+"]")}switch(Ie||(Ie="continuous"),Ie){case"continuous":ge("/PageLayout /OneColumn");break;case"single":ge("/PageLayout /SinglePage");break;case"two":case"twoleft":ge("/PageLayout /TwoColumnLeft");break;case"tworight":ge("/PageLayout /TwoColumnRight")}ye&&ge("/PageMode /"+ye),hn.publish("putCatalog"),ge(">>"),ge("endobj")},Ui=d.__private__.putTrailer=function(){ge("trailer"),ge("<<"),ge("/Size "+(K+1)),ge("/Root "+K+" 0 R"),ge("/Info "+(K-1)+" 0 R"),c!==null&&ge("/Encrypt "+xi.oid+" 0 R"),ge("/ID [ <"+se+"> <"+se+"> ]"),ge(">>")},Gn=d.__private__.putHeader=function(){ge("%PDF-"+y),ge("%ºß¬à")},so=d.__private__.putXRef=function(){var H="0000000000";ge("xref"),ge("0 "+(K+1)),ge("0000000000 65535 f ");for(var ce=1;ce<=K;ce++)typeof ie[ce]=="function"?ge((H+ie[ce]()).slice(-10)+" 00000 n "):ie[ce]!==void 0?ge((H+ie[ce]).slice(-10)+" 00000 n "):ge("0000000000 00000 n ")},Hi=d.__private__.buildDocument=function(){var H;K=0,ue=0,fe=[],ie=[],we=[],Go=Or(),ka=Or(),tt(fe),hn.publish("buildDocument"),Gn(),qi(),(function(){hn.publish("putAdditionalObjects");for(var Oe=0;Oe<we.length;Oe++){var je=we[Oe];Dr(je.objId,!0),ge(je.content),ge("endobj")}hn.publish("postPutAdditionalObjects")})(),H=[],(function(){for(var Oe in Zt)Zt.hasOwnProperty(Oe)&&(p===!1||p===!0&&m.hasOwnProperty(Oe))&&ao(Zt[Oe])})(),(function(){var Oe;for(Oe in Et)Et.hasOwnProperty(Oe)&&If(Et[Oe])})(),(function(){for(var Oe in Ur)Ur.hasOwnProperty(Oe)&&Fs(Ur[Oe])})(),(function(Oe){var je;for(je in Be)Be.hasOwnProperty(je)&&(Be[je]instanceof th?as(Be[je]):Be[je]instanceof ld&&hu(Be[je],Oe))})(H),hn.publish("putResources"),H.forEach(Cr),Cr({resourcesOid:ka,objectOid:Number.MAX_SAFE_INTEGER}),hn.publish("postPutResources"),c!==null&&(xi.oid=$n(),ge("<<"),ge("/Filter /Standard"),ge("/V "+xi.v),ge("/R "+xi.r),ge("/U <"+xi.toHexString(xi.U)+">"),ge("/O <"+xi.toHexString(xi.O)+">"),ge("/P "+xi.P),ge(">>"),ge("endobj")),wn(),oo();var ce=ue;return so(),Ui(),ge("startxref"),ge(""+ce),ge("%%EOF"),tt(Ce[z]),fe.join(`
450
- `)},Hr=d.__private__.getBlob=function(H){return new Blob([ke(H)],{type:"application/pdf"})},ls=d.output=d.__private__.output=(Zi=function(H,ce){switch(typeof(ce=ce||{})=="string"?ce={filename:ce}:ce.filename=ce.filename||"generated.pdf",H){case void 0:return Hi();case"save":d.save(ce.filename);break;case"arraybuffer":return ke(Hi());case"blob":return Hr(Hi());case"bloburi":case"bloburl":if(En.URL!==void 0&&typeof En.URL.createObjectURL=="function")return En.URL&&En.URL.createObjectURL(Hr(Hi()))||void 0;Qr.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var Oe="",je=Hi();try{Oe=Bw(je)}catch{Oe=Bw(unescape(encodeURIComponent(je)))}return"data:application/pdf;filename="+ce.filename+";base64,"+Oe;case"pdfobjectnewwindow":if(Object.prototype.toString.call(En)==="[object Window]"){var $e="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",ht=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';ce.pdfObjectUrl&&($e=ce.pdfObjectUrl,ht="");var pt='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+$e+'"'+ht+'><\/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}},Zi.foo=function(){try{return Zi.apply(this,arguments)}catch(Oe){var H=Oe.stack||"";~H.indexOf(" at ")&&(H=H.split(" at ")[1]);var ce="Error in function "+H.split(`
451
- `)[0].split("<")[0]+": "+Oe.message;if(!En.console)throw new Error(ce);En.console.error(ce,Oe),En.alert&&alert(ce)}},Zi.foo.bar=Zi,Zi.foo),lo=function(H){return Array.isArray(ui)===!0&&ui.indexOf(H)>-1};switch(r){case"pt":at=1;break;case"mm":at=72/25.4;break;case"cm":at=72/2.54;break;case"in":at=72;break;case"px":at=lo("px_scaling")==1?.75:96/72;break;case"pc":case"em":at=12;break;case"ex":at=6;break;default:if(typeof r!="number")throw new Error("Invalid unit: "+r);at=r}var xi=null;B(),Q();var Ba=d.__private__.getPageInfo=d.getPageInfo=function(H){if(isNaN(H)||H%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Ht[H].objId,pageNumber:H,pageContext:Ht[H]}},pu=d.__private__.getPageInfoByObjId=function(H){if(isNaN(H)||H%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var ce in Ht)if(Ht[ce].objId===H)break;return Ba(ce)},Ca=d.__private__.getCurrentPageInfo=d.getCurrentPageInfo=function(){return{objId:Ht[z].objId,pageNumber:z,pageContext:Ht[z]}};d.addPage=function(){return Lc.apply(this,arguments),this},d.setPage=function(){return Po.apply(this,arguments),tt.call(this,Ce[z]),this},d.insertPage=function(H){return this.addPage(),this.movePage(z,H),this},d.movePage=function(H,ce){var Oe,je;if(H>ce){Oe=Ce[H],je=Ht[H];for(var $e=H;$e>ce;$e--)Ce[$e]=Ce[$e-1],Ht[$e]=Ht[$e-1];Ce[ce]=Oe,Ht[ce]=je,this.setPage(ce)}else if(H<ce){Oe=Ce[H],je=Ht[H];for(var ht=H;ht<ce;ht++)Ce[ht]=Ce[ht+1],Ht[ht]=Ht[ht+1];Ce[ce]=Oe,Ht[ce]=je,this.setPage(ce)}return this},d.deletePage=function(){return hl.apply(this,arguments),this},d.__private__.text=d.text=function(H,ce,Oe,je,$e){var ht,pt,Ft,jt,mn,xn,Dn,Lr,di,sr=(je=je||{}).scope||this;if(typeof H=="number"&&typeof ce=="number"&&(typeof Oe=="string"||Array.isArray(Oe))){var Si=Oe;Oe=ce,ce=H,H=Si}if(arguments[3]instanceof Qt==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),je={flags:Dn,angle:Ft,align:jt})):(j("The transform parameter of text() with a Matrix value"),di=$e),isNaN(ce)||isNaN(Oe)||H==null)throw new Error("Invalid arguments passed to jsPDF.text");if(H.length===0)return sr;var kr,Li="",qs=typeof je.lineHeightFactor=="number"?je.lineHeightFactor:qa,Ya=sr.internal.scaleFactor;function Us(Rn){return Rn=Rn.split(" ").join(Array(je.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 Hs(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 $s=!1,vl=!0;if(typeof H=="string")$s=!0;else if(Array.isArray(H)){var ho=H.concat();pt=[];for(var Gs,Ei=ho.length;Ei--;)(typeof(Gs=ho.shift())!="string"||Array.isArray(Gs)&&typeof Gs[0]!="string")&&(vl=!1);$s=vl}if($s===!1)throw new Error('Type of text must be string or Array. "'+H+'" is not recognized.');typeof H=="string"&&(H=H.match(/[\r?\n]/)?H.split(/\r\n|\r|\n/g):[H]);var hs=be/sr.internal.scaleFactor,Lo=hs*(qs-1);switch(je.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=je.maxWidth||0)>0&&(typeof H=="string"?H=sr.splitTextToSize(H,xn):Object.prototype.toString.call(H)==="[object Array]"&&(H=H.reduce(function(Rn,fn){return Rn.concat(sr.splitTextToSize(fn,xn))},[]))),ht={text:H,x:ce,y:Oe,options:je,mutex:{pdfEscape:Oa,activeFontKey:st,fonts:Zt,activeFontSize:be}},hn.publish("preProcessText",ht),H=ht.text,Ft=(je=ht.options).angle,di instanceof Qt==0&&Ft&&typeof Ft=="number"){Ft*=Math.PI/180,je.rotationDirection===0&&(Ft=-Ft),E===k&&(Ft=-Ft);var Dl=Math.cos(Ft),Fl=Math.sin(Ft);di=new Qt(Dl,Fl,-Fl,Dl,0,0)}else Ft&&Ft instanceof Qt&&(di=Ft);E!==k||di||(di=Fa),(mn=je.charSpace||$a)!==void 0&&(Li+=R($(mn))+` Tc
452
- `,this.setCharSpace(this.getCharSpace()||0)),(Lr=je.horizontalScale)!==void 0&&(Li+=R(100*Lr)+` Tz
453
- `),je.lang;var ha=-1,po=je.renderingMode!==void 0?je.renderingMode:je.stroke,No=sr.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
454
- `:Ws!==-1&&(Li+=`0 Tr
455
- `),ha!==-1&&(No.usedRenderingMode=ha),jt=je.align||"left";var Fr,Xa=be*qs,yl=sr.internal.pageSize.getWidth(),Bl=Zt[st];mn=je.charSpace||$a,xn=je.maxWidth||0,Dn=Object.assign({autoencode:!0,noBOM:!0},je.flags);var $i=[],Ni=function(Rn){return sr.getStringUnitWidth(Rn,{font:Bl,charSpace:mn,fontSize:be,doKerning:!1})*be/Ya};if(Object.prototype.toString.call(H)==="[object Array]"){var Na;pt=Vo(H),jt!=="left"&&(Fr=pt.map(Ni));var Ka,da=0;if(jt==="right"){ce-=Fr[0],H=[],Ei=pt.length;for(var Qi=0;Qi<Ei;Qi++)Qi===0?(Ka=uo(ce),Na=Er(Oe)):(Ka=$(da-Fr[Qi]),Na=-Xa),H.push([pt[Qi],Ka,Na]),da=Fr[Qi]}else if(jt==="center"){ce-=Fr[0]/2,H=[],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),H.push([pt[To],Ka,Na]),da=Fr[To]}else if(jt==="left"){H=[],Ei=pt.length;for(var ds=0;ds<Ei;ds++)H.push(pt[ds])}else if(jt==="justify"&&Bl.encoding==="Identity-H"){H=[],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)),pi=pt[ri].split(" ");H.push([pi[0]+" ",Ka,Na]),go=0;for(var Ta=1;Ta<pi.length;Ta++){var Ro=(Ni(pi[Ta-1]+" "+pi[Ta])-Ni(pi[Ta]))*Ya+Yo;Ta==pi.length-1?H.push([pi[Ta],Ro,0]):H.push([pi[Ta]+" ",Ro,0]),go-=Ro}}else H.push([pt[ri],Ka,Na]);H.push(["",go,0])}else{if(jt!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(H=[],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(R($(bl))):$i.push(0),H.push([pt[ri],Ka,Na])}}}(typeof je.R2L=="boolean"?je.R2L:ve)===!0&&(H=Hs(H,function(Rn,fn,Pn){return[Rn.split("").reverse().join(""),fn,Pn]})),ht={text:H,x:ce,y:Oe,options:je,mutex:{pdfEscape:Oa,activeFontKey:st,fonts:Zt,activeFontSize:be}},hn.publish("postProcessText",ht),H=ht.text,kr=ht.mutex.isHex||!1;var Xo=Zt[st].encoding;Xo!=="WinAnsiEncoding"&&Xo!=="StandardEncoding"||(H=Hs(H,function(Rn,fn,Pn){return[Us(Rn),fn,Pn]})),pt=Vo(H),H=[];for(var ps,gs,nr,ms=Array.isArray(pt[0])?1:0,vs="",Vs=function(Rn,fn,Pn){var Mn="";return Pn instanceof Qt?(Pn=typeof je.angle=="number"?zi(Pn,new Qt(1,0,0,1,Rn,fn)):zi(new Qt(1,0,0,1,Rn,fn),Pn),E===k&&(Pn=zi(new Qt(1,0,0,-1,0,0),Pn)),Mn=Pn.join(" ")+` Tm
456
- `):Mn=R(Rn)+" "+R(fn)+` Td
457
- `,Mn},Nr=0;Nr<pt.length;Nr++){switch(vs="",ms){case 1:nr=(kr?"<":"(")+pt[Nr][0]+(kr?">":")"),ps=parseFloat(pt[Nr][1]),gs=parseFloat(pt[Nr][2]);break;case 0:nr=(kr?"<":"(")+pt[Nr]+(kr?">":")"),ps=uo(ce),gs=Er(Oe)}$i!==void 0&&$i[Nr]!==void 0&&(vs=$i[Nr]+` Tw
458
- `),Nr===0?H.push(vs+Vs(ps,gs,di)+nr):ms===0?H.push(vs+nr):ms===1&&H.push(vs+Vs(ps,gs,di)+nr)}H=ms===0?H.join(` Tj
459
- T* `):H.join(` Tj
460
- `),H+=` Tj
461
- `;var ga=`BT
462
- /`;return ga+=st+" "+be+` Tf
463
- `,ga+=R(be*qs)+` TL
464
- `,ga+=Ha+`
465
- `,ga+=Li,ga+=H,ge(ga+="ET"),m[st]=!0,sr};var Ml=d.__private__.clip=d.clip=function(H){return ge(H==="evenodd"?"W*":"W"),this};d.clipEvenOdd=function(){return Ml("evenodd")},d.__private__.discardPath=d.discardPath=function(){return ge("n"),this};var us=d.__private__.isValidStyle=function(H){var ce=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(H)!==-1&&(ce=!0),ce};d.__private__.setDefaultPathOperation=d.setDefaultPathOperation=function(H){return us(H)&&(h=H),this};var gu=d.__private__.getStyle=d.getStyle=function(H){var ce=h;switch(H){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=H}return ce},jn=d.close=function(){return ge("h"),this};d.stroke=function(){return ge("S"),this},d.fill=function(H){return cs("f",H),this},d.fillEvenOdd=function(H){return cs("f*",H),this},d.fillStroke=function(H){return cs("B",H),this},d.fillStrokeEvenOdd=function(H){return cs("B*",H),this};var cs=function(H,ce){jr(ce)==="object"?Nc(ce,H):ge(H)},Oo=function(H){H===null||E===k&&H===void 0||(H=gu(H),ge(H))};function dl(H,ce,Oe,je,$e){var ht=new ld(ce||this.boundingBox,Oe||this.xStep,je||this.yStep,this.gState,$e||this.matrix);ht.stream=this.stream;var pt=H+"$$"+this.cloneIndex+++"$$";return ti(pt,ht),ht}var Nc=function(H,ce){var Oe=Wt[H.key],je=Be[Oe];if(je instanceof th)ge("q"),ge(Tc(ce)),je.gState&&d.setGState(je.gState),ge(H.matrix.toString()+" cm"),ge("/"+Oe+" sh"),ge("Q");else if(je instanceof ld){var $e=new Qt(1,0,0,-1,0,_i());H.matrix&&($e=$e.multiply(H.matrix||Fa),Oe=dl.call(je,H.key,H.boundingBox,H.xStep,H.yStep,$e).id),ge("q"),ge("/Pattern cs"),ge("/"+Oe+" scn"),je.gState&&d.setGState(je.gState),ge(ce),ge("Q")}},Tc=function(H){switch(H){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(H,ce){return ge(R($(H))+" "+R(U(ce))+" m"),this},Il=d.lineTo=function(H,ce){return ge(R($(H))+" "+R(U(ce))+" l"),this},ca=d.curveTo=function(H,ce,Oe,je,$e,ht){return ge([R($(H)),R(U(ce)),R($(Oe)),R(U(je)),R($($e)),R(U(ht)),"c"].join(" ")),this};d.__private__.line=d.line=function(H,ce,Oe,je,$e){if(isNaN(H)||isNaN(ce)||isNaN(Oe)||isNaN(je)||!us($e))throw new Error("Invalid arguments passed to jsPDF.line");return E===S?this.lines([[Oe-H,je-ce]],H,ce,[1,1],$e||"S"):this.lines([[Oe-H,je-ce]],H,ce,[1,1]).stroke()},d.__private__.lines=d.lines=function(H,ce,Oe,je,$e,ht){var pt,Ft,jt,mn,xn,Dn,Lr,di,sr,Si,kr,Li;if(typeof H=="number"&&(Li=Oe,Oe=ce,ce=H,H=Li),je=je||[1,1],ht=ht||!1,isNaN(ce)||isNaN(Oe)||!Array.isArray(H)||!Array.isArray(je)||!us($e)||typeof ht!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(pl(ce,Oe),pt=je[0],Ft=je[1],mn=H.length,Si=ce,kr=Oe,jt=0;jt<mn;jt++)(xn=H[jt]).length===2?(Si=xn[0]*pt+Si,kr=xn[1]*Ft+kr,Il(Si,kr)):(Dn=xn[0]*pt+Si,Lr=xn[1]*Ft+kr,di=xn[2]*pt+Si,sr=xn[3]*Ft+kr,Si=xn[4]*pt+Si,kr=xn[5]*Ft+kr,ca(Dn,Lr,di,sr,Si,kr));return ht&&jn(),Oo($e),this},d.path=function(H){for(var ce=0;ce<H.length;ce++){var Oe=H[ce],je=Oe.c;switch(Oe.op){case"m":pl(je[0],je[1]);break;case"l":Il(je[0],je[1]);break;case"c":ca.apply(this,je);break;case"h":jn()}}return this},d.__private__.rect=d.rect=function(H,ce,Oe,je,$e){if(isNaN(H)||isNaN(ce)||isNaN(Oe)||isNaN(je)||!us($e))throw new Error("Invalid arguments passed to jsPDF.rect");return E===S&&(je=-je),ge([R($(H)),R(U(ce)),R($(Oe)),R($(je)),"re"].join(" ")),Oo($e),this},d.__private__.triangle=d.triangle=function(H,ce,Oe,je,$e,ht,pt){if(isNaN(H)||isNaN(ce)||isNaN(Oe)||isNaN(je)||isNaN($e)||isNaN(ht)||!us(pt))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[Oe-H,je-ce],[$e-Oe,ht-je],[H-$e,ce-ht]],H,ce,[1,1],pt,!0),this},d.__private__.roundedRect=d.roundedRect=function(H,ce,Oe,je,$e,ht,pt){if(isNaN(H)||isNaN(ce)||isNaN(Oe)||isNaN(je)||isNaN($e)||isNaN(ht)||!us(pt))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var Ft=4/3*(Math.SQRT2-1);return $e=Math.min($e,.5*Oe),ht=Math.min(ht,.5*je),this.lines([[Oe-2*$e,0],[$e*Ft,0,$e,ht-ht*Ft,$e,ht],[0,je-2*ht],[0,ht*Ft,-$e*Ft,ht,-$e,ht],[2*$e-Oe,0],[-$e*Ft,0,-$e,-ht*Ft,-$e,-ht],[0,2*ht-je],[0,-ht*Ft,$e*Ft,-ht,$e,-ht]],H+$e,ce,[1,1],pt,!0),this},d.__private__.ellipse=d.ellipse=function(H,ce,Oe,je,$e){if(isNaN(H)||isNaN(ce)||isNaN(Oe)||isNaN(je)||!us($e))throw new Error("Invalid arguments passed to jsPDF.ellipse");var ht=4/3*(Math.SQRT2-1)*Oe,pt=4/3*(Math.SQRT2-1)*je;return pl(H+Oe,ce),ca(H+Oe,ce-pt,H+ht,ce-je,H,ce-je),ca(H-ht,ce-je,H-Oe,ce-pt,H-Oe,ce),ca(H-Oe,ce+pt,H-ht,ce+je,H,ce+je),ca(H+ht,ce+je,H+Oe,ce+pt,H+Oe,ce),Oo($e),this},d.__private__.circle=d.circle=function(H,ce,Oe,je){if(isNaN(H)||isNaN(ce)||isNaN(Oe)||!us(je))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(H,ce,Oe,Oe,je)},d.setFont=function(H,ce,Oe){return Oe&&(ce=O(ce,Oe)),st=pr(H,ce,{disableWarning:!1}),this};var za=d.__private__.getFont=d.getFont=function(){return Zt[pr.apply(d,arguments)]};d.__private__.getFontList=d.getFontList=function(){var H,ce,Oe={};for(H in an)if(an.hasOwnProperty(H))for(ce in Oe[H]=[],an[H])an[H].hasOwnProperty(ce)&&Oe[H].push(ce);return Oe},d.addFont=function(H,ce,Oe,je,$e){var ht=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&ht.indexOf(arguments[3])!==-1?$e=arguments[3]:arguments[3]&&ht.indexOf(arguments[3])==-1&&(Oe=O(Oe,je)),os.call(this,H,ce,Oe,$e=$e||"Identity-H")};var qa,Ua=e.lineWidth||.200025,Ln=d.__private__.getLineWidth=d.getLineWidth=function(){return Ua},cn=d.__private__.setLineWidth=d.setLineWidth=function(H){return Ua=H,ge(R($(H))+" w"),this};d.__private__.setLineDash=sn.API.setLineDash=sn.API.setLineDashPattern=function(H,ce){if(H=H||[],ce=ce||0,isNaN(ce)||!Array.isArray(H))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return H=H.map(function(Oe){return R($(Oe))}).join(" "),ce=R($(ce)),ge("["+H+"] "+ce+" d"),this};var Co=d.__private__.getLineHeight=d.getLineHeight=function(){return be*qa};d.__private__.getLineHeight=d.getLineHeight=function(){return be*qa};var Rc=d.__private__.setLineHeightFactor=d.setLineHeightFactor=function(H){return typeof(H=H||1.15)=="number"&&(qa=H),this},Mc=d.__private__.getLineHeightFactor=d.getLineHeightFactor=function(){return qa};Rc(e.lineHeight);var uo=d.__private__.getHorizontalCoordinate=function(H){return $(H)},Er=d.__private__.getVerticalCoordinate=function(H){return E===k?H:Ht[z].mediaBox.topRightY-Ht[z].mediaBox.bottomLeftY-$(H)},mu=d.__private__.getHorizontalCoordinateString=d.getHorizontalCoordinateString=function(H){return R(uo(H))},vu=d.__private__.getVerticalCoordinateString=d.getVerticalCoordinateString=function(H){return R(Er(H))},Bs=e.strokeColor||"0 G";d.__private__.getStrokeColor=d.getDrawColor=function(){return io(Bs)},d.__private__.setStrokeColor=d.setDrawColor=function(H,ce,Oe,je){return Bs=ci({ch1:H,ch2:ce,ch3:Oe,ch4:je,pdfColorType:"draw",precision:2}),ge(Bs),this};var Zu=e.fillColor||"0 g";d.__private__.getFillColor=d.getFillColor=function(){return io(Zu)},d.__private__.setFillColor=d.setFillColor=function(H,ce,Oe,je){return Zu=ci({ch1:H,ch2:ce,ch3:Oe,ch4:je,pdfColorType:"fill",precision:2}),ge(Zu),this};var Ha=e.textColor||"0 g",fa=d.__private__.getTextColor=d.getTextColor=function(){return io(Ha)};d.__private__.setTextColor=d.setTextColor=function(H,ce,Oe,je){return Ha=ci({ch1:H,ch2:ce,ch3:Oe,ch4:je,pdfColorType:"text",precision:3}),this};var $a=e.charSpace,yu=d.__private__.getCharSpace=d.getCharSpace=function(){return parseFloat($a||0)};d.__private__.setCharSpace=d.setCharSpace=function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return $a=H,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(H){var ce=d.CapJoinStyles[H];if(ce===void 0)throw new Error("Line cap style of '"+H+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return La=ce,ge(ce+" J"),this};var co=0;d.__private__.setLineJoin=d.setLineJoin=function(H){var ce=d.CapJoinStyles[H];if(ce===void 0)throw new Error("Line join style of '"+H+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return co=ce,ge(ce+" j"),this},d.__private__.setLineMiterLimit=d.__private__.setMiterLimit=d.setLineMiterLimit=d.setMiterLimit=function(H){if(H=H||0,isNaN(H))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return ge(R($(H))+" M"),this},d.GState=D0,d.setGState=function(H){(H=typeof H=="string"?Et[Nt[H]]:zs(null,H)).equals(Tt)||(ge("/"+H.id+" gs"),Tt=H)};var zs=function(H,ce){if(!H||!Nt[H]){var Oe=!1;for(var je in Et)if(Et.hasOwnProperty(je)&&Et[je].equals(ce)){Oe=!0;break}if(Oe)ce=Et[je];else{var $e="GS"+(Object.keys(Et).length+1).toString(10);Et[$e]=ce,ce.id=$e}return H&&(Nt[H]=ce.id),hn.publish("addGState",ce),ce}};d.addGState=function(H,ce){return zs(H,ce),this},d.saveGraphicsState=function(){return ge("q"),We.push({key:st,size:be,color:Ha}),this},d.restoreGraphicsState=function(){ge("Q");var H=We.pop();return st=H.key,be=H.size,Ha=H.color,Tt=null,this},d.setCurrentTransformationMatrix=function(H){return ge(H.toString()+" cm"),this},d.comment=function(H){return ge("#"+H),this};var Ga=function(H,ce){var Oe=H||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return Oe},set:function(ht){isNaN(ht)||(Oe=parseFloat(ht))}});var je=ce||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return je},set:function(ht){isNaN(ht)||(je=parseFloat(ht))}});var $e="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return $e},set:function(ht){$e=ht.toString()}}),this},gl=function(H,ce,Oe,je){Ga.call(this,H,ce),this.type="rect";var $e=Oe||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return $e},set:function(pt){isNaN(pt)||($e=parseFloat(pt))}});var ht=je||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return ht},set:function(pt){isNaN(pt)||(ht=parseFloat(pt))}}),this},jl=function(){this.page=on,this.currentPage=z,this.pages=Ce.slice(0),this.pagesContext=Ht.slice(0),this.x=ct,this.y=Ct,this.matrix=rn,this.width=fo(z),this.height=fs(z),this.outputDestination=ze,this.id="",this.objectNumber=-1};jl.prototype.restore=function(){on=this.page,z=this.currentPage,Ht=this.pagesContext,Ce=this.pages,ct=this.x,Ct=this.y,rn=this.matrix,ml(z,this.width),$r(z,this.height),ze=this.outputDestination};var fi=function(H,ce,Oe,je,$e){dr.push(new jl),on=z=0,Ce=[],ct=H,Ct=ce,rn=$e,ss([Oe,je])};for(var Wa in d.beginFormObject=function(H,ce,Oe,je,$e){return fi(H,ce,Oe,je,$e),this},d.endFormObject=function(H){return(function(ce){if(hr[ce])dr.pop().restore();else{var Oe=new jl,je="Xo"+(Object.keys(Ur).length+1).toString(10);Oe.id=je,hr[ce]=je,Ur[je]=Oe,hn.publish("addFormObject",Oe),dr.pop().restore()}})(H),this},d.doFormObject=function(H,ce){var Oe=Ur[hr[H]];return ge("q"),ge(ce.toString()+" cm"),ge("/"+Oe.id+" Do"),ge("Q"),this},d.getFormObject=function(H){var ce=Ur[hr[H]];return{x:ce.x,y:ce.y,width:ce.width,height:ce.height,matrix:ce.matrix}},d.save=function(H,ce){return H=H||"generated.pdf",(ce=ce||{}).returnPromise=ce.returnPromise||!1,ce.returnPromise===!1?(eh(Hr(Hi()),H),typeof eh.unload=="function"&&En.setTimeout&&setTimeout(eh.unload,911),this):new Promise(function(Oe,je){try{var $e=eh(Hr(Hi()),H);typeof eh.unload=="function"&&En.setTimeout&&setTimeout(eh.unload,911),Oe($e)}catch(ht){je(ht.message)}})},sn.API)sn.API.hasOwnProperty(Wa)&&(Wa==="events"&&sn.API.events.length?(function(H,ce){var Oe,je,$e;for($e=ce.length-1;$e!==-1;$e--)Oe=ce[$e][0],je=ce[$e][1],H.subscribe.apply(H,[Oe].concat(typeof je=="function"?[je]:je))})(hn,sn.API.events):d[Wa]=sn.API[Wa]);function fo(H){return Ht[H].mediaBox.topRightX-Ht[H].mediaBox.bottomLeftX}function ml(H,ce){Ht[H].mediaBox.topRightX=ce+Ht[H].mediaBox.bottomLeftX}function fs(H){return Ht[H].mediaBox.topRightY-Ht[H].mediaBox.bottomLeftY}function $r(H,ce){Ht[H].mediaBox.topRightY=ce+Ht[H].mediaBox.bottomLeftY}var hi=d.getPageWidth=function(H){return fo(H=H||z)/at},ni=d.setPageWidth=function(H,ce){ml(H,ce*at)},_i=d.getPageHeight=function(H){return fs(H=H||z)/at},Va=d.setPageHeight=function(H,ce){$r(H,ce*at)};return d.internal={pdfEscape:Oa,getStyle:gu,getFont:za,getFontSize:Me,getCharSpace:yu,getTextColor:fa,getLineHeight:Co,getLineHeightFactor:Mc,getLineWidth:Ln,write:ut,getHorizontalCoordinate:uo,getVerticalCoordinate:Er,getCoordinateString:mu,getVerticalCoordinateString:vu,collections:{},newObject:$n,newAdditionalObject:Ea,newObjectDeferred:Or,newObjectDeferredBegin:Dr,getFilters:Aa,putStream:Pa,events:hn,scaleFactor:at,pageSize:{getWidth:function(){return hi(z)},setWidth:function(H){ni(z,H)},getHeight:function(){return _i(z)},setHeight:function(H){Va(z,H)}},encryptionOptions:c,encryption:xi,getEncryptor:function(H){return c!==null?xi.encryptor(H,0):function(ce){return ce}},output:ls,getNumberOfPages:wi,get pages(){return Ce},out:ge,f2:L,f3:T,getPageInfo:Ba,getPageInfoByObjId:pu,getCurrentPageInfo:Ca,getPDFVersion:w,Point:Ga,Rectangle:gl,Matrix:Qt,hasHotfix:lo},Object.defineProperty(d.internal.pageSize,"width",{get:function(){return hi(z)},set:function(H){ni(z,H)},enumerable:!0,configurable:!0}),Object.defineProperty(d.internal.pageSize,"height",{get:function(){return _i(z)},set:function(H){Va(z,H)},enumerable:!0,configurable:!0}),(function(H){for(var ce=0,Oe=he.length;ce<Oe;ce++){var je=os.call(this,H[ce][0],H[ce][1],H[ce][2],he[ce][3],!0);p===!1&&(m[je]=!0);var $e=H[ce][0].split("-");du({id:je,fontName:$e[0],fontStyle:$e[1]||""})}hn.publish("addFonts",{fonts:Zt,dictionary:an})}).call(d,he),st="F1",Lc(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 zv(Bv(t).substr(0,5),e)},ed.prototype.encryptor=function(e,t){var n=Bv(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&t,t>>8&255)).substr(0,10);return function(r){return zv(n,r)}},D0.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 Ki=sn.API,Ty=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)},cf=function(e){return e.toFixed(5)};Ki.__acroform__={};var Ds=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},Hw=function(e){return e*Ty},Iu=function(e){var t=new y_,n=Kt.internal.getHeight(e)||0,r=Kt.internal.getWidth(e)||0;return t.BBox=[0,0,Number(Cn(r)),Number(Cn(n))],t},rj=Ki.__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},ij=Ki.__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)},aj=Ki.__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},oa=Ki.__acroform__.getBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return aj(e,t-1)},sa=Ki.__acroform__.setBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return rj(e,t-1)},la=Ki.__acroform__.clearBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return ij(e,t-1)},oj=Ki.__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))]},sj=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var t=[],n=e._V||e.DV,r=qv(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=Iu(e);return a.scope=e.scope,a.stream=t.join(`
466
- `),a}},qv=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(L){return L.split(`
467
- `)}):i.map(function(L){return[L]});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(L,T,$){if(L+1<i.length){var U=T+" "+i[L+1][0];return X1(U,e,$).width<=s-4}return!1};a++;e:for(;a>0;){t="",a--;var h,c,p=X1("3",e,a).height,m=e.multiline?o-a:(o-p)/2,d=m+=2,y=0,w=0,x=0;if(a<=0){t=`(...) Tj
468
- `,t+="% Width of Text: "+X1(t,e,a=12).width+", FieldWidth:"+s+`
469
- `;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((p+2)*(S+2)+2>o)continue e;b+=i[k][x],E=!0,w=k,k--}else{b=(b+=i[k][x]+" ").substr(b.length-1)==" "?b.substr(0,b.length-1):b;var A=parseInt(k),M=u(A,b,a),O=k>=i.length-1;if(M&&!O){b+=" ",x=0;continue}if(M||O){if(O)w=A;else if(e.multiline&&(p+2)*(S+2)+2>o)continue e}else{if(!e.multiline||(p+2)*(S+2)+2>o)continue e;w=A}}for(var R="",j=y;j<=w;j++){var D=i[j];if(e.multiline){if(j===w){R+=D[x]+" ",x=(x+1)%D.length;continue}if(j===y){R+=D[D.length-1]+" ";continue}}R+=D[0]+" "}switch(R=R.substr(R.length-1)==" "?R.substr(0,R.length-1):R,c=X1(R,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
470
- `,t+="("+Lh(R)+`) Tj
471
- `,t+=-Cn(h)+` 0 Td
472
- `,d=-(a+2),c=0,y=E?w:w+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}},lj={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},uj=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)},cj=function(e,t){if(t.scope=e,e.internal!==void 0&&(e.internal.acroformPlugin===void 0||e.internal.acroformPlugin.isInitialized===!1)){if(cu.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(lj)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");Ty=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new b_,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&&uj(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=oj(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=sj(s);u.push({key:"AP",value:"<</N "+c+">>"}),i.internal.acroformPlugin.xForms.push(c)}if(s.appearanceStreamContent){var p="";for(var m in s.appearanceStreamContent)if(s.appearanceStreamContent.hasOwnProperty(m)){var d=s.appearanceStreamContent[m];if(p+="/"+m+" ",p+="<<",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)),p+="/"+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)),p+="/"+o+" "+y,i.internal.acroformPlugin.xForms.indexOf(y)>=0||i.internal.acroformPlugin.xForms.push(y);p+=">>"}u.push({key:"AP",value:`<<
473
- `+p+">>"})}i.internal.putStream({additionalKeyValues:u,objectId:s.objId}),i.internal.out("endobj")}a&&(function(w,x){for(var b in w)if(w.hasOwnProperty(b)){var S=b,k=w[b];x.internal.newObjectDeferredBegin(k.objId,!0),jr(k)==="object"&&typeof k.putStream=="function"&&k.putStream(),delete w[S]}})(i.internal.acroformPlugin.xForms,i)})(n,e)}),e.internal.acroformPlugin.isInitialized=!0}},v_=Ki.__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))+")"},Fu=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})};Fu.prototype.toString=function(){return this.objId+" 0 R"},Fu.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},Fu.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:v_(i,this.objId,this.scope)}):i instanceof Fu?(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 y_=function(){Fu.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(y_,Fu);var b_=function(){Fu.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(b_,Fu);var cu=function e(){Fu.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!!oa(t,3)},set:function(b){b?this.F=sa(t,3):this.F=la(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 F0)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/Ty: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 p="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!p||this instanceof F0||this instanceof uh))return Gm(p,this.objId,this.scope)},set:function(b){b=b.toString(),p=b}});var m=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(m)return this instanceof ro==0?Gm(m,this.objId,this.scope):m},set:function(b){b=b.toString(),m=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(m.substr(1,m.length-1)):m},set:function(b){b=b.toString(),m=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,w=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return w},set:function(b){b=!!b,w=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!!oa(this.Ff,1)},set:function(b){b?this.Ff=sa(this.Ff,1):this.Ff=la(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!oa(this.Ff,2)},set:function(b){b?this.Ff=sa(this.Ff,2):this.Ff=la(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!oa(this.Ff,3)},set:function(b){b?this.Ff=sa(this.Ff,3):this.Ff=la(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(cu,Fu);var cd=function(){cu.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 v_(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!!oa(this.Ff,18)},set:function(n){n?this.Ff=sa(this.Ff,18):this.Ff=la(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!oa(this.Ff,19)},set:function(n){this.combo===!0&&(n?this.Ff=sa(this.Ff,19):this.Ff=la(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!oa(this.Ff,20)},set:function(n){n?(this.Ff=sa(this.Ff,20),t.sort()):this.Ff=la(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!oa(this.Ff,22)},set:function(n){n?this.Ff=sa(this.Ff,22):this.Ff=la(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!oa(this.Ff,23)},set:function(n){n?this.Ff=sa(this.Ff,23):this.Ff=la(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!oa(this.Ff,27)},set:function(n){n?this.Ff=sa(this.Ff,27):this.Ff=la(this.Ff,27)}}),this.hasAppearanceStream=!1};Ds(cd,cu);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 c0=function(){hd.call(this),this.edit=!0};Ds(c0,hd);var ro=function(){cu.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!oa(this.Ff,15)},set:function(n){n?this.Ff=sa(this.Ff,15):this.Ff=la(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!oa(this.Ff,16)},set:function(n){n?this.Ff=sa(this.Ff,16):this.Ff=la(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!oa(this.Ff,17)},set:function(n){n?this.Ff=sa(this.Ff,17):this.Ff=la(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!oa(this.Ff,26)},set:function(n){n?this.Ff=sa(this.Ff,26):this.Ff=la(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(`
474
- `)}},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,cu);var f0=function(){ro.call(this),this.pushButton=!0};Ds(f0,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 F0=function(){var e,t;cu.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(`
475
- `)},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(F0,cu),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 F0;return t.Parent=this,t.optionName=e,this.Kids.push(t),fj.call(this.scope,t),t};var h0=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(h0,ro);var uh=function(){cu.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!oa(this.Ff,13)},set:function(t){t?this.Ff=sa(this.Ff,13):this.Ff=la(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!oa(this.Ff,21)},set:function(t){t?this.Ff=sa(this.Ff,21):this.Ff=la(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!oa(this.Ff,23)},set:function(t){t?this.Ff=sa(this.Ff,23):this.Ff=la(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!oa(this.Ff,24)},set:function(t){t?this.Ff=sa(this.Ff,24):this.Ff=la(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!oa(this.Ff,25)},set:function(t){t?this.Ff=sa(this.Ff,25):this.Ff=la(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!oa(this.Ff,26)},set:function(t){t?this.Ff=sa(this.Ff,26):this.Ff=la(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,cu);var d0=function(){uh.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!oa(this.Ff,14)},set:function(e){e?this.Ff=sa(this.Ff,14):this.Ff=la(this.Ff,14)}}),this.password=!0};Ds(d0,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=Iu(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=qv(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(`
476
- `),t},YesNormal:function(e){var t=Iu(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=qv(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(`
477
- `),t},OffPushDown:function(e){var t=Iu(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(`
478
- `),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=Iu(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 "+cf(Kt.internal.getWidth(e)/2)+" "+cf(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(`
479
- `),t},YesPushDown:function(e){var t=Iu(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 "+cf(Kt.internal.getWidth(e)/2)+" "+cf(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 "+cf(Kt.internal.getWidth(e)/2)+" "+cf(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(`
480
- `),t},OffPushDown:function(e){var t=Iu(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 "+cf(Kt.internal.getWidth(e)/2)+" "+cf(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(`
481
- `),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=Iu(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(`
482
- `),t},YesPushDown:function(e){var t=Iu(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(`
483
- `),t},OffPushDown:function(e){var t=Iu(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(`
484
- `),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=Hw(e.Rect[2])),t},Kt.internal.getHeight=function(e){var t=0;return jr(e)==="object"&&(t=Hw(e.Rect[3])),t};var fj=Ki.addField=function(e){if(cj(this,e),!(e instanceof cu))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};Ki.AcroFormChoiceField=cd,Ki.AcroFormListBox=fd,Ki.AcroFormComboBox=hd,Ki.AcroFormEditBox=c0,Ki.AcroFormButton=ro,Ki.AcroFormPushButton=f0,Ki.AcroFormRadioButton=dd,Ki.AcroFormCheckBox=h0,Ki.AcroFormTextField=uh,Ki.AcroFormPasswordField=d0,Ki.AcroFormAppearance=Kt,Ki.AcroForm={ChoiceField:cd,ListBox:fd,ComboBox:hd,EditBox:c0,Button:ro,PushButton:f0,RadioButton:dd,CheckBox:h0,TextField:uh,PasswordField:d0,Appearance:Kt},sn.AcroForm={ChoiceField:cd,ListBox:fd,ComboBox:hd,EditBox:c0,Button:ro,PushButton:f0,RadioButton:dd,CheckBox:h0,TextField:uh,PasswordField:d0,Appearance:Kt};sn.AcroForm;function w_(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(L,T){var $,U,te,se,ee,Q=n;if((T=T||n)==="RGBA"||L.data!==void 0&&L.data instanceof Uint8ClampedArray&&"height"in L&&"width"in L)return"RGBA";if(M(L))for(ee in r)for(te=r[ee],$=0;$<te.length;$+=1){for(se=!0,U=0;U<te[$].length;U+=1)if(te[$][U]!==void 0&&te[$][U]!==L[U]){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,U=0;U<te[$].length;U+=1)if(te[$][U]!==void 0&&te[$][U]!==L.charCodeAt(U)){se=!1;break}if(se===!0){Q=ee;break}}return Q===n&&T!==n&&(Q=T),Q},a=function L(T){for(var $=this.internal.write,U=this.internal.putStream,te=(0,this.internal.getFilters)();te.indexOf("FlateEncode")!==-1;)te.splice(te.indexOf("FlateEncode"),1);T.objectId=this.internal.newObject();var se=[];if(se.push({key:"Type",value:"/XObject"}),se.push({key:"Subtype",value:"/Image"}),se.push({key:"Width",value:T.width}),se.push({key:"Height",value:T.height}),T.colorSpace===b.INDEXED?se.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(T.palette.length/3-1)+" "+("sMask"in T&&T.sMask!==void 0?T.objectId+2:T.objectId+1)+" 0 R]"}):(se.push({key:"ColorSpace",value:"/"+T.colorSpace}),T.colorSpace===b.DEVICE_CMYK&&se.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),se.push({key:"BitsPerComponent",value:T.bitsPerComponent}),"decodeParameters"in T&&T.decodeParameters!==void 0&&se.push({key:"DecodeParms",value:"<<"+T.decodeParameters+">>"}),"transparency"in T&&Array.isArray(T.transparency)&&T.transparency.length>0){for(var ee="",Q=0,re=T.transparency.length;Q<re;Q++)ee+=T.transparency[Q]+" "+T.transparency[Q]+" ";se.push({key:"Mask",value:"["+ee+"]"})}T.sMask!==void 0&&se.push({key:"SMask",value:T.objectId+1+" 0 R"});var X=T.filter!==void 0?["/"+T.filter]:void 0;if(U({data:T.data,additionalKeyValues:se,alreadyAppliedFilters:X,objectId:T.objectId}),$("endobj"),"sMask"in T&&T.sMask!==void 0){var B,F=(B=T.sMaskBitsPerComponent)!==null&&B!==void 0?B:T.bitsPerComponent,z={width:T.width,height:T.height,colorSpace:"DeviceGray",bitsPerComponent:F,data:T.sMask};"filter"in T&&(z.decodeParameters="/Predictor ".concat(T.predictor," /Colors 1 /BitsPerComponent ").concat(F," /Columns ").concat(T.width),z.filter=T.filter),L.call(this,z)}if(T.colorSpace===b.INDEXED){var Y=this.internal.newObject();U({data:R(new Uint8Array(T.palette)),objectId:Y}),$("endobj")}},o=function(){var L=this.internal.collections[t+"images"];for(var T in L)a.call(this,L[T])},s=function(){var L,T=this.internal.collections[t+"images"],$=this.internal.write;for(var U in T)$("/I"+(L=T[U]).index,L.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 L=this.internal.collections[t+"images"];return u.call(this),L},c=function(){return Object.keys(this.internal.collections[t+"images"]).length},p=function(L){return typeof e["process"+L.toUpperCase()]=="function"},m=function(L){return jr(L)==="object"&&L.nodeType===1},d=function(L,T){if(L.nodeName==="IMG"&&L.hasAttribute("src")){var $=""+L.getAttribute("src");if($.indexOf("data:image/")===0)return u0(unescape($).split("base64,").pop());var U=e.loadFile($,!0);if(U!==void 0)return U}if(L.nodeName==="CANVAS"){if(L.width===0||L.height===0)throw new Error("Given canvas must have data. Canvas width: "+L.width+", height: "+L.height);var te;switch(T){case"PNG":te="image/png";break;case"WEBP":te="image/webp";break;default:te="image/jpeg"}return u0(L.toDataURL(te,1).split("base64,").pop())}},y=function(L){var T=this.internal.collections[t+"images"];if(T){for(var $ in T)if(L===T[$].alias)return T[$]}},w=function(L,T,$){return L||T||(L=-96,T=-96),L<0&&(L=-1*$.width*72/L/this.internal.scaleFactor),T<0&&(T=-1*$.height*72/T/this.internal.scaleFactor),L===0&&(L=T*$.width/$.height),T===0&&(T=L*$.height/$.width),[L,T]},x=function(L,T,$,U,te,se){var ee=w.call(this,$,U,te),Q=this.internal.getCoordinateString,re=this.internal.getVerticalCoordinateString,X=h.call(this);if($=ee[0],U=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(L),re(T+U),"cm"].join(" ")),this.internal.write(Y.join(" ")),this.internal.write([Q($),"0","0",Q(U),"0","0","cm"].join(" "))):this.internal.write([Q($),"0","0",Q(U),Q(L),re(T+U),"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(L){var T,$,U=0;if(typeof L=="string")for($=L.length,T=0;T<$;T++)U=(U<<5)-U+L.charCodeAt(T),U|=0;else if(M(L))for($=L.byteLength/2,T=0;T<$;T++)U=(U<<5)-U+L[T],U|=0;return U},E=e.__addimage__.validateStringAsBase64=function(L){(L=L||"").toString().trim();var T=!0;return L.length===0&&(T=!1),L.length%4!=0&&(T=!1),/^[A-Za-z0-9+/]+$/.test(L.substr(0,L.length-2))===!1&&(T=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(L.substr(-2))===!1&&(T=!1),T},A=e.__addimage__.extractImageFromDataUrl=function(L){if(L==null||!(L=L.trim()).startsWith("data:"))return null;var T=L.indexOf(",");return T<0?null:L.substring(0,T).trim().endsWith("base64")?L.substring(T+1):null};e.__addimage__.isArrayBuffer=function(L){return L instanceof ArrayBuffer};var M=e.__addimage__.isArrayBufferView=function(L){return L instanceof Int8Array||L instanceof Uint8Array||L instanceof Uint8ClampedArray||L instanceof Int16Array||L instanceof Uint16Array||L instanceof Int32Array||L instanceof Uint32Array||L instanceof Float32Array||L instanceof Float64Array},O=e.__addimage__.binaryStringToUint8Array=function(L){for(var T=L.length,$=new Uint8Array(T),U=0;U<T;U++)$[U]=L.charCodeAt(U);return $},R=e.__addimage__.arrayBufferToBinaryString=function(L){for(var T="",$=M(L)?L:new Uint8Array(L),U=0;U<$.length;U+=8192)T+=String.fromCharCode.apply(null,$.subarray(U,U+8192));return T};e.addImage=function(){var L,T,$,U,te,se,ee,Q,re;if(typeof arguments[1]=="number"?(T=n,$=arguments[1],U=arguments[2],te=arguments[3],se=arguments[4],ee=arguments[5],Q=arguments[6],re=arguments[7]):(T=arguments[1],$=arguments[2],U=arguments[3],te=arguments[4],se=arguments[5],ee=arguments[6],Q=arguments[7],re=arguments[8]),jr(L=arguments[0])==="object"&&!m(L)&&"imageData"in L){var X=L;L=X.imageData,T=X.format||T||n,$=X.x||$||0,U=X.y||U||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(U))throw new Error("Invalid coordinates passed to jsPDF.addImage");u.call(this);var F=j.call(this,L,T,ee,Q);return x.call(this,$,U,te,se,F,re),this};var j=function(L,T,$,U){var te,se,ee;if(typeof L=="string"&&i(L)===n){L=unescape(L);var Q=D(L,!1);(Q!==""||(Q=e.loadFile(L,!0))!==void 0)&&(L=Q)}if(m(L)&&(L=d(L,T)),T=i(L,T),!p(T))throw new Error("addImage does not support files of type '"+T+"', please ensure that a plugin for '"+T+"' support is added.");if(((ee=$)==null||ee.length===0)&&($=(function(re){return typeof re=="string"||M(re)?k(re):M(re.data)?k(re.data):null})(L)),(te=y.call(this,$))||(L instanceof Uint8Array||T==="RGBA"||(se=L,L=O(L)),te=this["process"+T.toUpperCase()](L,c.call(this),$,(function(re){return re&&typeof re=="string"&&(re=re.toUpperCase()),re in e.image_compression?re:S.NONE})(U),se)),!te)throw new Error("An unknown error occurred whilst processing the image.");return te},D=e.__addimage__.convertBase64ToBinaryString=function(L,T){T=typeof T!="boolean"||T;var $,U="";if(typeof L=="string"){var te;$=(te=A(L))!==null&&te!==void 0?te:L;try{U=u0($)}catch(se){if(T)throw E($)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+se.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return U};e.getImageProperties=function(L){var T,$,U="";if(m(L)&&(L=d(L)),typeof L=="string"&&i(L)===n&&((U=D(L,!1))===""&&(U=e.loadFile(L)||""),L=U),$=i(L),!p($))throw new Error("addImage does not support files of type '"+$+"', please ensure that a plugin for '"+$+"' support is added.");if(L instanceof Uint8Array||(L=O(L)),!(T=this["process"+$.toUpperCase()](L)))throw new Error("An unknown error occurred whilst processing the image");return T.fileType=$,T}})(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,p=0;p<h.length&&!c;p++)switch((r=h[p]).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 m=0;m<h.length;m++){r=h[m];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 w=this.internal.newAdditionalObject(),x=this.internal.newAdditionalObject(),b=this.internal.getEncryptor(w.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))+") >>",w.content=a;var k=w.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(w.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 M=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+" "+M+" "+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(w){return t[w.charCodeAt(0)]!==void 0},o=e.__arabicParser__.isArabicLetter=function(w){return typeof w=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(w)},s=e.__arabicParser__.isArabicEndLetter=function(w){return o(w)&&a(w)&&t[w.charCodeAt(0)].length<=2},u=e.__arabicParser__.isArabicAlfLetter=function(w){return o(w)&&i.indexOf(w.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(w){return o(w)&&a(w)&&t[w.charCodeAt(0)].length>=1};var h=e.__arabicParser__.arabicLetterHasFinalForm=function(w){return o(w)&&a(w)&&t[w.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(w){return o(w)&&a(w)&&t[w.charCodeAt(0)].length>=3};var c=e.__arabicParser__.arabicLetterHasMedialForm=function(w){return o(w)&&a(w)&&t[w.charCodeAt(0)].length==4},p=e.__arabicParser__.resolveLigatures=function(w){var x=0,b=n,S="",k=0;for(x=0;x<w.length;x+=1)b[w.charCodeAt(x)]!==void 0?(k++,typeof(b=b[w.charCodeAt(x)])=="number"&&(S+=String.fromCharCode(b),b=n,k=0),x===w.length-1&&(b=n,S+=w.charAt(x-(k-1)),x-=k-1,k=0)):(b=n,S+=w.charAt(x-k),x-=k,k=0);return S};e.__arabicParser__.isArabicDiacritic=function(w){return w!==void 0&&r[w.charCodeAt(0)]!==void 0};var m=e.__arabicParser__.getCorrectForm=function(w,x,b){return o(w)?a(w)===!1?-1:!h(w)||!o(x)&&!o(b)||!o(b)&&s(x)||s(w)&&!o(x)||s(w)&&u(x)||s(w)&&s(x)?0:c(w)&&o(x)&&!s(x)&&o(b)&&h(b)?3:s(w)||!o(b)?1:2:-1},d=function(w){var x=0,b=0,S=0,k="",E="",A="",M=(w=w||"").split("\\s+"),O=[];for(x=0;x<M.length;x+=1){for(O.push(""),b=0;b<M[x].length;b+=1)k=M[x][b],E=M[x][b-1],A=M[x][b+1],o(k)?(S=m(k,E,A),O[x]+=S!==-1?String.fromCharCode(t[k.charCodeAt(0)][S]):k):O[x]+=k;O[x]=p(O[x])}return O.join(" ")},y=e.__arabicParser__.processArabic=e.processArabic=function(){var w,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])]);w=b}else w=d(x);return typeof arguments[0]=="string"?w:(arguments[0].text=w,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(w){u=w}});var h=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return h},set:function(w){h=w}});var c=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return c},set:function(w){c=w}});var p=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return p},set:function(w){p=w}});var m=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return m},set:function(w){m=w}});var d=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return d},set:function(w){d=w}});var y=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return y},set:function(w){y=w}}),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(),p=h.font||this.getFont(),m=h.scaleFactor||this.internal.scaleFactor,d=0,y=0,w=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<(w=this.getStringUnitWidth(u[S],{font:p})*c)&&(d=w);return d!==0&&(y=u.length),{w:d/=m,h:Math.max((y*c*this.getLineHeightFactor()-c*(this.getLineHeightFactor()-1))/m,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,p=this.internal.__cell__.margins||t,m=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+p.bottom>this.getPageHeight()?(this.cellAddPage(),u.y=p.top,d&&m&&(this.printHeaderRow(u.lineNumber,!0),u.y+=m[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,p,m){if(r.call(this),!c)throw new Error("No data for PDF table.");var d,y,w,x,b=[],S=[],k=[],E={},A={},M=[],O=[],R=(m=m||{}).autoSize||!1,j=m.printHeaders!==!1,D=m.css&&m.css["font-size"]!==void 0?16*m.css["font-size"]:m.fontSize||12,L=m.margins||Object.assign({width:this.getPageWidth()},t),T=typeof m.padding=="number"?m.padding:3,$=m.headerBackgroundColor||"#c8c8c8",U=m.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=j,this.internal.__cell__.margins=L,this.internal.__cell__.table_font_size=D,this.internal.__cell__.padding=T,this.internal.__cell__.headerBackgroundColor=$,this.internal.__cell__.headerTextColor=U,this.setFontSize(D),p==null)S=b=Object.keys(c[0]),k=b.map(function(){return"left"});else if(Array.isArray(p)&&jr(p[0])==="object")for(b=p.map(function(X){return X.name}),S=p.map(function(X){return X.prompt||X.name||""}),k=p.map(function(X){return X.align||"left"}),d=0;d<p.length;d+=1)A[p[d].name]=.7499990551181103*p[d].width;else Array.isArray(p)&&typeof p[0]=="string"&&(S=b=p,k=b.map(function(){return"left"}));if(R||Array.isArray(p)&&typeof p[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"),M.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"),w=0;w<y.length;w+=1)M.push(this.getTextDimensions(y[w],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);A[x]=Math.max.apply(null,M)+T+T,M=[]}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=p.reduce(function(X,B){return X[B.name]=B.align,X},{});for(d=0;d<c.length;d+=1){"rowStart"in m&&m.rowStart instanceof Function&&m.rowStart({row:d,data:c[d]},this);var Q=s.call(this,c[d],A);for(w=0;w<b.length;w+=1){var re=c[d][b[w]];"cellStart"in m&&m.cellStart instanceof Function&&m.cellStart({row:d,col:w,data:re},this),o.call(this,new a(u,h,A[b[w]],Q,re,d+2,ee[b[w]]))}}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,p=this.internal.__cell__.table_font_size,m=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*p/m+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 p=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new a(p[0],p[1],p[2],p[3],void 0,-1)}this.setFont(void 0,"bold");for(var m=[],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,m.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)}m.length>0&&this.setTableHeaderRow(m),this.setFont(void 0,"normal"),n=!1}})(sn.API);var x_={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},__=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],Uv=w_(__),S_=[100,200,300,400,500,600,700,800,900],hj=w_(S_);function Wm(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),n=(function(a){return x_[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 $w(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 dj={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},Gw={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function Ww(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function Vw(e){return e.trimLeft()}function pj(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 gj(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,Yw,Xw,Qh,Z1,Kw,Zw,Qw,Vm=["times"];function Jw(e,t,n,r,i){var a=4,o=t6;switch(i){case sn.API.image_compression.FAST:a=1,o=e6;break;case sn.API.image_compression.MEDIUM:a=6,o=n6;break;case sn.API.image_compression.SLOW:a=9,o=r6}e=(function(u,h,c,p){for(var m,d=u.length/h,y=new Uint8Array(u.length+d),w=[mj,e6,t6,n6,r6],x=0;x<d;x+=1){var b=x*h,S=u.subarray(b,b+h);if(p)y.set(p(S,c,m),b+x);else{for(var k=w.length,E=[],A=0;A<k;A+=1)E[A]=w[A](S,c,m);var M=yj(E.concat());y.set(E[M],b+x)}m=S}return y})(e,t,Math.ceil(n*r/8),o);var s=Iv(e,{level:a});return sn.API.__addimage__.arrayBufferToBinaryString(s)}function mj(e){var t=Array.apply([],e);return t.unshift(0),t}function e6(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 t6(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 n6(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 r6(e,t,n){var r=e.length,i=[];i[0]=4;for(var a=0;a<r;a+=1){var o=vj(e[a-t]||0,n&&n[a]||0,n&&n[a-t]||0);i[a+1]=e[a]-o+256&255}return i}function vj(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 yj(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 E_(e,i)>>a&o}function i6(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,p){if(c+1<h.byteLength)h.setUint16(c,p,!1);else{var m=p>>8&255;h.setUint8(c,m)}})(e,a,E_(e,a)&~(s<<o)&65535|u)}function E_(e,t){return t+1<e.byteLength?e.getUint16(t,!1):e.getUint8(t)<<8}function bj(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=[],p=0,m=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(!((L=e[t++])>=0))throw Error("Invalid block size");if(L===0)break;t+=L}break;case 249:if(e[t++]!==4||e[t+4]!==0)throw new Error("Invalid graphics extension block.");var w=e[t++];p=e[t++]|e[t++]<<8,m=e[t++],1&w||(m=null),d=w>>2&7,t++;break;case 254:for(;;){if(!((L=e[t++])>=0))throw Error("Invalid block size");if(L===0)break;t+=L}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,M=1<<1+(7&E),O=s,R=u,j=!1;E>>7&&(j=!0,O=t,R=M,t+=3*M);var D=t;for(t++;;){var L;if(!((L=e[t++])>=0))throw Error("Invalid block size");if(L===0)break;t+=L}c.push({x,y:b,width:S,height:k,has_local_palette:j,palette_offset:O,palette_size:R,data_offset:D,data_length:t-D,transparent_index:m,interlaced:!!A,delay:p,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(T){if(T<0||T>=c.length)throw new Error("Frame index out of range.");return c[T]},this.decodeAndBlitFrameBGRA=function(T,$){var U=this.frameInfo(T),te=U.width*U.height,se=new Uint8Array(te);a6(e,U.data_offset,se,te);var ee=U.palette_offset,Q=U.transparent_index;Q===null&&(Q=256);var re=U.width,X=n-re,B=re,F=4*(U.y*n+U.x),z=4*((U.y+U.height)*n+U.x),Y=F,J=4*X;U.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 we=e[ee+3*ue],Ce=e[ee+3*ue+1],Ue=e[ee+3*ue+2];$[Y++]=Ue,$[Y++]=Ce,$[Y++]=we,$[Y++]=255}--B}},this.decodeAndBlitFrameRGBA=function(T,$){var U=this.frameInfo(T),te=U.width*U.height,se=new Uint8Array(te);a6(e,U.data_offset,se,te);var ee=U.palette_offset,Q=U.transparent_index;Q===null&&(Q=256);var re=U.width,X=n-re,B=re,F=4*(U.y*n+U.x),z=4*((U.y+U.height)*n+U.x),Y=F,J=4*X;U.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 we=e[ee+3*ue],Ce=e[ee+3*ue+1],Ue=e[ee+3*ue+2];$[Y++]=we,$[Y++]=Ce,$[Y++]=Ue,$[Y++]=255}--B}}}function a6(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,p=0,m=0,d=e[t++],y=new Int32Array(4096),w=null;;){for(;c<16&&d!==0;)p|=e[t++]<<c,c+=8,d===1?d=e[t++]:--d;if(c<u)break;var x=p&h;if(p>>=u,c-=u,x!==a){if(x===o)break;for(var b=x<s?x:w,S=0,k=b;k>a;)k=y[k]>>8,++S;var E=k;if(m+S+(b!==x?1:0)>r)return void Qr.log("Warning, gif stream longer than expected.");n[m++]=E;var A=m+=S;for(b!==x&&(n[m++]=E),k=b;S--;)k=y[k],n[--A]=255&k,k>>=8;w!==null&&s<4096&&(y[s++]=w<<8|E,s>=h+1&&u<12&&(++u,h=h<<1|1)),w=x}else s=o+1,h=(1<<(u=i+1))-1,w=null}return m!==r&&Qr.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),p=new Array(65535),m=new Array(65535),d=new Array(64),y=new Array(64),w=[],x=0,b=7,S=new Array(64),k=new Array(64),E=new Array(64),A=new Array(256),M=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],R=[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],L=[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],T=[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],U=[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){w.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],we=(function(be,Le){var Me,ve,ye,xe,Ie,Te,Je,nt,st,at,ct=0;for(st=0;st<8;++st){Me=be[ct],ve=be[ct+1],ye=be[ct+2],xe=be[ct+3],Ie=be[ct+4],Te=be[ct+5],Je=be[ct+6];var Ct=Me+(nt=be[ct+7]),rn=Me-nt,Zt=ve+Je,an=ve-Je,We=ye+Te,Be=ye-Te,Wt=xe+Ie,Et=xe-Ie,Nt=Ct+Wt,Tt=Ct-Wt,on=Zt+We,Ht=Zt-We;be[ct]=Nt+on,be[ct+4]=Nt-on;var hn=.707106781*(Ht+Tt);be[ct+2]=Tt+hn,be[ct+6]=Tt-hn;var ui=.382683433*((Nt=Et+Be)-(Ht=an+rn)),Ur=.5411961*Nt+ui,hr=1.306562965*Ht+ui,dr=.707106781*(on=Be+an),Qt=rn+dr,zi=rn-dr;be[ct+5]=zi+Ur,be[ct+3]=zi-Ur,be[ct+1]=Qt+hr,be[ct+7]=Qt-hr,ct+=8}for(ct=0,st=0;st<8;++st){Me=be[ct],ve=be[ct+8],ye=be[ct+16],xe=be[ct+24],Ie=be[ct+32],Te=be[ct+40],Je=be[ct+48];var Fa=Me+(nt=be[ct+56]),ti=Me-nt,Zi=ve+Je,$n=ve-Je,Or=ye+Te,Dr=ye-Te,Ea=xe+Ie,Go=xe-Ie,ka=Fa+Ea,io=Fa-Ea,ci=Zi+Or,Aa=Zi-Or;be[ct]=ka+ci,be[ct+32]=ka-ci;var Pa=.707106781*(Aa+io);be[ct+16]=io+Pa,be[ct+48]=io-Pa;var Wo=.382683433*((ka=Go+Dr)-(Aa=$n+ti)),qi=.5411961*ka+Wo,ao=1.306562965*Aa+Wo,Fs=.707106781*(ci=Dr+$n),as=ti+Fs,hu=ti-Fs;be[ct+40]=hu+qi,be[ct+24]=hu-qi,be[ct+8]=as+ao,be[ct+56]=as-ao,ct++}for(st=0;st<64;++st)at=be[st]*Le[st],d[st]=at>0?at+.5|0:at-.5|0;return d})(F,z),Ce=0;Ce<64;++Ce)y[O[Ce]]=we[Ce];var Ue=y[0]-Y;Y=y[0],Ue==0?ee(J[0]):(ee(J[m[ie=32767+Ue]]),ee(p[ie]));for(var ze=63;ze>0&&y[ze]==0;)ze--;if(ze==0)return ee(fe),Y;for(var tt,ge=1;ge<=ze;){for(var ut=ge;y[ge]==0&&ge<=ze;)++ge;var ke=ge-ut;if(ke>=16){tt=ke>>4;for(var he=1;he<=tt;++he)ee(ue);ke&=15}ie=32767+y[ge],ee(K[(ke<<4)+m[ie]]),ee(p[ie]),ge++}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 we=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Ce=0,Ue=0;Ue<8;Ue++)for(var ze=0;ze<8;ze++)h[Ce]=1/(s[O[Ce]]*we[Ue]*we[ze]*8),c[Ce]=1/(u[O[Ce]]*we[Ue]*we[ze]*8),Ce++})(F<50?Math.floor(5e3/F):Math.floor(200-2*F)),a=F)}this.encode=function(F,z){z&&B(z),w=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(R[ve+1]);for(var ye=0;ye<=11;ye++)Q(j[ye]);Q(16);for(var xe=0;xe<16;xe++)Q(D[xe+1]);for(var Ie=0;Ie<=161;Ie++)Q(L[Ie]);Q(1);for(var Te=0;Te<16;Te++)Q(T[Te+1]);for(var Je=0;Je<=11;Je++)Q($[Je]);Q(17);for(var nt=0;nt<16;nt++)Q(U[nt+1]);for(var st=0;st<=161;st++)Q(te[st])})(),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,we,Ce,Ue,ze,tt,ge,ut=F.data,ke=F.width,he=F.height,be=4*ke,Le=0;Le<he;){for(ie=0;ie<be;){for(Ce=be*Le+ie,ze=-1,tt=0,ge=0;ge<64;ge++)Ue=Ce+(tt=ge>>3)*be+(ze=4*(7&ge)),Le+tt>=he&&(Ue-=be*(Le+1+tt-he)),ie+ze>=be&&(Ue-=ie+ze-be+4),fe=ut[Ue++],ue=ut[Ue++],we=ut[Ue++],S[ge]=(M[fe]+M[ue+256|0]+M[we+512|0]>>16)-128,k[ge]=(M[fe+768|0]+M[ue+1024|0]+M[we+1280|0]>>16)-128,E[ge]=(M[fe+1280|0]+M[ue+1536|0]+M[we+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}Le+=8}if(b>=0){var Me=[];Me[1]=b+1,Me[0]=(1<<b+1)-1,ee(Me)}return re(65497),new Uint8Array(w)},e=e||50,(function(){for(var F=String.fromCharCode,z=0;z<256;z++)A[z]=F(z)})(),t=se(R,j),n=se(T,$),r=se(D,L),i=se(U,te),(function(){for(var F=1,z=2,Y=1;Y<=15;Y++){for(var J=F;J<z;J++)m[32767+J]=Y,p[32767+J]=[],p[32767+J][1]=Y,p[32767+J][0]=J;for(var K=-(z-1);K<=-F;K++)m[32767+K]=Y,p[32767+K]=[],p[32767+K][1]=Y,p[32767+K][0]=z-1+K;F<<=1,z<<=1}})(),(function(){for(var F=0;F<256;F++)M[F]=19595*F,M[F+256|0]=38470*F,M[F+512|0]=7471*F+32768,M[F+768|0]=-11059*F,M[F+1024|0]=-21709*F,M[F+1280|0]=32768*F+8421375,M[F+1536|0]=-27439*F,M[F+1792|0]=-5329*F})(),B(e)}function eu(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 o6(e){function t(j){if(!j)throw Error("assert :P")}function n(j,D,L){for(var T=0;4>T;T++)if(j[D+T]!=L.charCodeAt(T))return!0;return!1}function r(j,D,L,T,$){for(var U=0;U<$;U++)j[D+U]=L[T+U]}function i(j,D,L,T){for(var $=0;$<T;$++)j[D+$]=L}function a(j){return new Int32Array(j)}function o(j,D){for(var L=[],T=0;T<j;T++)L.push(new D);return L}function s(j,D){var L=[];return(function T($,U,te){for(var se=te[U],ee=0;ee<se&&($.push(te.length>U+1?[]:new D),!(te.length<U+1));ee++)T($[ee],U+1,te)})(L,0,j),L}var u=function(){var j=this;function D(P,I){for(var V=1<<I-1>>>0;P&V;)V>>>=1;return V?(P&V-1)+V:P}function L(P,I,V,ne,le){t(!(ne%V));do P[I+(ne-=V)]=le;while(0<ne)}function T(P,I,V,ne,le){if(t(2328>=le),512>=le)var pe=a(512);else if((pe=a(le))==null)return 0;return(function(me,_e,Se,Pe,De,Qe){var Ae,He,Ze=_e,dt=1<<Se,Ye=a(16),ft=a(16);for(t(De!=0),t(Pe!=null),t(me!=null),t(0<Se),He=0;He<De;++He){if(15<Pe[He])return 0;++Ye[Pe[He]]}if(Ye[0]==De)return 0;for(ft[1]=0,Ae=1;15>Ae;++Ae){if(Ye[Ae]>1<<Ae)return 0;ft[Ae+1]=ft[Ae]+Ye[Ae]}for(He=0;He<De;++He)Ae=Pe[He],0<Pe[He]&&(Qe[ft[Ae]++]=He);if(ft[15]==1)return(Pe=new $).g=0,Pe.value=Qe[0],L(me,Ze,1,dt,Pe),dt;var qe,mt=-1,vt=dt-1,Yt=0,zt=1,vn=1,qt=1<<Se;for(He=0,Ae=1,De=2;Ae<=Se;++Ae,De<<=1){if(zt+=vn<<=1,0>(vn-=Ye[Ae]))return 0;for(;0<Ye[Ae];--Ye[Ae])(Pe=new $).g=Ae,Pe.value=Qe[He++],L(me,Ze+Yt,De,qt,Pe),Yt=D(Yt,Ae)}for(Ae=Se+1,De=2;15>=Ae;++Ae,De<<=1){if(zt+=vn<<=1,0>(vn-=Ye[Ae]))return 0;for(;0<Ye[Ae];--Ye[Ae]){if(Pe=new $,(Yt&vt)!=mt){for(Ze+=qt,qe=1<<(mt=Ae)-Se;15>mt&&!(0>=(qe-=Ye[mt]));)++mt,qe<<=1;dt+=qt=1<<(qe=mt-Se),me[_e+(mt=Yt&vt)].g=qe+Se,me[_e+mt].value=Ze-_e-mt}Pe.g=Ae-Se,Pe.value=Qe[He++],L(me,Ze+(Yt>>Se),De,qt,Pe),Yt=D(Yt,Ae)}}return zt!=2*ft[15]-1?0:dt})(P,I,V,ne,le,pe)}function $(){this.value=this.g=0}function U(){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,U)}function se(P,I,V,ne){t(P!=null),t(I!=null),t(2147483648>ne),P.Ca=254,P.I=0,P.b=-8,P.Ka=0,P.oa=I,P.pa=V,P.Jd=I,P.Yc=V+ne,P.Zc=4<=ne?V+ne-4+1:V,fe(P)}function ee(P,I){for(var V=0;0<I--;)V|=we(P,128)<<I;return V}function Q(P,I){var V=ee(P,I);return ue(P)?-V:V}function re(P,I,V,ne){var le,pe=0;for(t(P!=null),t(I!=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)pe+=I[V+le]<<8*le;P.Ra=pe,P.bb=ne,P.oa=I,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,I){if(t(0<=I),!P.h&&I<=Ka){var V=Y(P)&Na[I];return P.u+=I,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,I){P.u=I,P.h=J(P)}function ie(P){P.u>=Qi&&(t(P.u>=Qi),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 we(P,I){var V=P.Ca;0>P.b&&fe(P);var ne=P.b,le=V*I>>>8,pe=(P.I>>>ne>le)+0;for(pe?(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,pe}function Ce(P,I,V){P[I+0]=V>>24&255,P[I+1]=V>>16&255,P[I+2]=V>>8&255,P[I+3]=255&V}function Ue(P,I){return P[I+0]|P[I+1]<<8}function ze(P,I){return Ue(P,I)|P[I+2]<<16}function tt(P,I){return Ue(P,I)|Ue(P,I+2)<<16}function ge(P,I){var V=1<<I;return t(P!=null),t(0<I),P.X=a(V),P.X==null?0:(P.Mb=32-I,P.Xa=I,1)}function ut(P,I){t(P!=null),t(I!=null),t(P.Xa==I.Xa),r(I.X,0,P.X,0,1<<I.Xa)}function ke(){this.X=[],this.Xa=this.Mb=0}function he(P,I,V,ne){t(V!=null),t(ne!=null);var le=V[0],pe=ne[0];return le==0&&(le=(P*pe+I/2)/I),pe==0&&(pe=(I*le+P/2)/P),0>=le||0>=pe?0:(V[0]=le,ne[0]=pe,1)}function be(P,I){return P+(1<<I)-1>>>I}function Le(P,I){return((4278255360&P)+(4278255360&I)>>>0&4278255360)+((16711935&P)+(16711935&I)>>>0&16711935)>>>0}function Me(P,I){j[I]=function(V,ne,le,pe,me,_e,Se){var Pe;for(Pe=0;Pe<me;++Pe){var De=j[P](_e[Se+Pe-1],le,pe+Pe);_e[Se+Pe]=Le(V[ne+Pe],De)}}}function ve(){this.ud=this.hd=this.jd=0}function ye(P,I){return((4278124286&(P^I))>>>1)+(P&I)>>>0}function xe(P){return 0<=P&&256>P?P:0>P?0:255<P?255:void 0}function Ie(P,I){return xe(P+(P-I+.5>>1))}function Te(P,I,V){return Math.abs(I-V)-Math.abs(P-V)}function Je(P,I,V,ne,le,pe,me){for(ne=pe[me-1],V=0;V<le;++V)pe[me+V]=ne=Le(P[I+V],ne)}function nt(P,I,V,ne,le){var pe;for(pe=0;pe<V;++pe){var me=P[I+pe],_e=me>>8&255,Se=16711935&(Se=(Se=16711935&me)+((_e<<16)+_e));ne[le+pe]=(4278255360&me)+Se>>>0}}function st(P,I){I.jd=255&P,I.hd=P>>8&255,I.ud=P>>16&255}function at(P,I,V,ne,le,pe){var me;for(me=0;me<ne;++me){var _e=I[V+me],Se=_e>>>8,Pe=_e,De=255&(De=(De=_e>>>16)+((P.jd<<24>>24)*(Se<<24>>24)>>>5));Pe=255&(Pe=(Pe+=(P.hd<<24>>24)*(Se<<24>>24)>>>5)+((P.ud<<24>>24)*(De<<24>>24)>>>5)),le[pe+me]=(4278255360&_e)+(De<<16)+Pe}}function ct(P,I,V,ne,le){j[I]=function(pe,me,_e,Se,Pe,De,Qe,Ae,He){for(Se=Qe;Se<Ae;++Se)for(Qe=0;Qe<He;++Qe)Pe[De++]=le(_e[ne(pe[me++])])},j[P]=function(pe,me,_e,Se,Pe,De,Qe){var Ae=8>>pe.b,He=pe.Ea,Ze=pe.K[0],dt=pe.w;if(8>Ae)for(pe=(1<<pe.b)-1,dt=(1<<Ae)-1;me<_e;++me){var Ye,ft=0;for(Ye=0;Ye<He;++Ye)Ye&pe||(ft=ne(Se[Pe++])),De[Qe++]=le(Ze[ft&dt]),ft>>=Ae}else j["VP8LMapColor"+V](Se,Pe,Ze,dt,De,Qe,me,_e,He)}}function Ct(P,I,V,ne,le){for(V=I+V;I<V;){var pe=P[I++];ne[le++]=pe>>16&255,ne[le++]=pe>>8&255,ne[le++]=255&pe}}function rn(P,I,V,ne,le){for(V=I+V;I<V;){var pe=P[I++];ne[le++]=pe>>16&255,ne[le++]=pe>>8&255,ne[le++]=255&pe,ne[le++]=pe>>24&255}}function Zt(P,I,V,ne,le){for(V=I+V;I<V;){var pe=(me=P[I++])>>16&240|me>>12&15,me=240&me|me>>28&15;ne[le++]=pe,ne[le++]=me}}function an(P,I,V,ne,le){for(V=I+V;I<V;){var pe=(me=P[I++])>>16&248|me>>13&7,me=me>>5&224|me>>3&31;ne[le++]=pe,ne[le++]=me}}function We(P,I,V,ne,le){for(V=I+V;I<V;){var pe=P[I++];ne[le++]=255&pe,ne[le++]=pe>>8&255,ne[le++]=pe>>16&255}}function Be(P,I,V,ne,le,pe){if(pe==0)for(V=I+V;I<V;)Ce(ne,((pe=P[I++])[0]>>24|pe[1]>>8&65280|pe[2]<<8&16711680|pe[3]<<24)>>>0),le+=32;else r(ne,le,P,I,V)}function Wt(P,I){j[I][0]=j[P+"0"],j[I][1]=j[P+"1"],j[I][2]=j[P+"2"],j[I][3]=j[P+"3"],j[I][4]=j[P+"4"],j[I][5]=j[P+"5"],j[I][6]=j[P+"6"],j[I][7]=j[P+"7"],j[I][8]=j[P+"8"],j[I][9]=j[P+"9"],j[I][10]=j[P+"10"],j[I][11]=j[P+"11"],j[I][12]=j[P+"12"],j[I][13]=j[P+"13"],j[I][14]=j[P+"0"],j[I][15]=j[P+"0"]}function Et(P){return P==$l||P==Ks||P==xu||P==_u}function Nt(){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 on(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Nt,this.f.kb=new Tt,this.sd=null}function Ht(){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 ui(P){return alert("todo:WebPSamplerProcessPlane"),P.T}function Ur(P,I){var V=P.T,ne=I.ba.f.RGBA,le=ne.eb,pe=ne.fb+P.ka*ne.A,me=Ra[I.ba.S],_e=P.y,Se=P.O,Pe=P.f,De=P.N,Qe=P.ea,Ae=P.W,He=I.cc,Ze=I.dc,dt=I.Mc,Ye=I.Nc,ft=P.ka,qe=P.ka+P.T,mt=P.U,vt=mt+1>>1;for(ft==0?me(_e,Se,null,null,Pe,De,Qe,Ae,Pe,De,Qe,Ae,le,pe,null,null,mt):(me(I.ec,I.fc,_e,Se,He,Ze,dt,Ye,Pe,De,Qe,Ae,le,pe-ne.A,le,pe,mt),++V);ft+2<qe;ft+=2)He=Pe,Ze=De,dt=Qe,Ye=Ae,De+=P.Rc,Ae+=P.Rc,pe+=2*ne.A,me(_e,(Se+=2*P.fa)-P.fa,_e,Se,He,Ze,dt,Ye,Pe,De,Qe,Ae,le,pe-ne.A,le,pe,mt);return Se+=P.fa,P.j+qe<P.o?(r(I.ec,I.fc,_e,Se,mt),r(I.cc,I.dc,Pe,De,vt),r(I.Mc,I.Nc,Qe,Ae,vt),V--):1&qe||me(_e,Se,null,null,Pe,De,Qe,Ae,Pe,De,Qe,Ae,le,pe+ne.A,null,null,mt),V}function hr(P,I,V){var ne=P.F,le=[P.J];if(ne!=null){var pe=P.U,me=I.ba.S,_e=me==wu||me==xu;I=I.ba.f.RGBA;var Se=[0],Pe=P.ka;Se[0]=P.T,P.Kb&&(Pe==0?--Se[0]:(--Pe,le[0]-=P.width),P.j+P.ka+P.T==P.o&&(Se[0]=P.o-P.j-Pe));var De=I.eb;Pe=I.fb+Pe*I.A,P=zl(ne,le[0],P.width,pe,Se,De,Pe+(_e?0:3),I.A),t(V==Se),P&&Et(me)&&Ko(De,Pe,_e,pe,Se,I.A)}return 0}function dr(P){var I=P.ma,V=I.ba.S,ne=11>V,le=V==Qo||V==Hl||V==wu||V==gr||V==12||Et(V);if(I.memory=null,I.Ib=null,I.Jb=null,I.Nd=null,!yl(I.Oa,P,le?11:12))return 0;if(le&&Et(V)&&Vo(),P.da)alert("todo:use_scaling");else{if(ne){if(I.Ib=ui,P.Kb){if(V=P.U+1>>1,I.memory=a(P.U+2*V),I.memory==null)return 0;I.ec=I.memory,I.fc=0,I.cc=I.ec,I.dc=I.fc+P.U,I.Mc=I.cc,I.Nc=I.dc+V,I.Ib=Ur,Vo()}}else alert("todo:EmitYUV");le&&(I.Jb=hr,ne&&Ya())}if(ne&&!Wi){for(P=0;256>P;++P)va[P]=89858*(P-128)+Io>>bs,ya[P]=-22014*(P-128)+Io,Wl[P]=-45773*(P-128),_l[P]=113618*(P-128)+Io>>bs;for(P=rr;P<lr;++P)I=76283*(P-16)+Io>>bs,Au[P-rr]=wn(I,255),Bf[P-rr]=wn(I+8>>4,15);Wi=1}return 1}function Qt(P){var I=P.ma,V=P.U,ne=P.T;return t(!(1&P.ka)),0>=V||0>=ne?0:(V=I.Ib(P,I),I.Jb!=null&&I.Jb(P,I,V),I.Dc+=V,1)}function zi(P){P.ma.memory=null}function Fa(P,I,V,ne){return B(P,8)!=47?0:(I[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,I){if(4>P)return P+1;var V=P-2>>1;return(2+(1&P)<<V)+B(I,V)+1}function Zi(P,I){return 120<I?I-120:1<=(V=((V=Th[I-1])>>4)*P+(8-(15&V)))?V:1;var V}function $n(P,I,V){var ne=Y(V),le=P[I+=255&ne].g-8;return 0<le&&(K(V,V.u+8),ne=Y(V),I+=P[I].value,I+=ne&(1<<le)-1),K(V,V.u+P[I].g),P[I].value}function Or(P,I,V){return V.g+=P.g,V.value+=P.value<<I>>>0,t(8>=V.g),P.g}function Dr(P,I,V){var ne=P.xc;return t((I=ne==0?0:P.vc[P.md*(V>>ne)+(I>>ne)])<P.Wb),P.Ya[I]}function Ea(P,I,V,ne){var le=P.ab,pe=P.c*I,me=P.C;I=me+I;var _e=V,Se=ne;for(ne=P.Ta,V=P.Ua;0<le--;){var Pe=P.gc[le],De=me,Qe=I,Ae=_e,He=Se,Ze=(Se=ne,_e=V,Pe.Ea);switch(t(De<Qe),t(Qe<=Pe.nc),Pe.hc){case 2:ri(Ae,He,(Qe-De)*Ze,Se,_e);break;case 0:var dt=De,Ye=Qe,ft=Se,qe=_e,mt=(qt=Pe).Ea;dt==0&&(ds(Ae,He,null,null,1,ft,qe),Je(Ae,He+1,0,0,mt-1,ft,qe+1),He+=mt,qe+=mt,++dt);for(var vt=1<<qt.b,Yt=vt-1,zt=be(mt,qt.b),vn=qt.K,qt=qt.w+(dt>>qt.b)*zt;dt<Ye;){var Nn=vn,Gr=qt,_n=1;for(go(Ae,He,ft,qe-mt,1,ft,qe);_n<mt;){var Bt=(_n&~Yt)+vt;Bt>mt&&(Bt=mt),(0,pa[Nn[Gr++]>>8&15])(Ae,He+ +_n,ft,qe+_n-mt,Bt-_n,ft,qe+_n),_n=Bt}He+=mt,qe+=mt,++dt&Yt||(qt+=zt)}Qe!=Pe.nc&&r(Se,_e-Ze,Se,_e+(Qe-De-1)*Ze,Ze);break;case 1:for(Ze=Ae,Ye=He,mt=(Ae=Pe.Ea)-(qe=Ae&~(ft=(He=1<<Pe.b)-1)),dt=be(Ae,Pe.b),vt=Pe.K,Pe=Pe.w+(De>>Pe.b)*dt;De<Qe;){for(Yt=vt,zt=Pe,vn=new ve,qt=Ye+qe,Nn=Ye+Ae;Ye<qt;)st(Yt[zt++],vn),bl(vn,Ze,Ye,He,Se,_e),Ye+=He,_e+=He;Ye<Nn&&(st(Yt[zt++],vn),bl(vn,Ze,Ye,mt,Se,_e),Ye+=mt,_e+=mt),++De&ft||(Pe+=dt)}break;case 3:if(Ae==Se&&He==_e&&0<Pe.b){for(Ye=Se,Ae=Ze=_e+(Qe-De)*Ze-(qe=(Qe-De)*be(Pe.Ea,Pe.b)),He=Se,ft=_e,dt=[],qe=(mt=qe)-1;0<=qe;--qe)dt[qe]=He[ft+qe];for(qe=mt-1;0<=qe;--qe)Ye[Ae+qe]=dt[qe];Yo(Pe,De,Qe,Se,Ze,Se,_e)}else Yo(Pe,De,Qe,Ae,He,Se,_e)}_e=ne,Se=V}Se!=V&&r(ne,V,_e,Se,pe)}function Go(P,I){var V=P.V,ne=P.Ba+P.c*P.C,le=I-P.C;if(t(I<=P.l.o),t(16>=le),0<le){var pe=P.l,me=P.Ta,_e=P.Ua,Se=pe.width;if(Ea(P,le,V,ne),le=_e=[_e],t((V=P.C)<(ne=I)),t(pe.v<pe.va),ne>pe.o&&(ne=pe.o),V<pe.j){var Pe=pe.j-V;V=pe.j,le[0]+=Pe*Se}if(V>=ne?V=0:(le[0]+=4*pe.v,pe.ka=V-pe.j,pe.U=pe.va-pe.v,pe.T=ne-V,V=1),V){if(_e=_e[0],11>(V=P.ca).S){var De=V.f.RGBA,Qe=(ne=V.S,le=pe.U,pe=pe.T,Pe=De.eb,De.A),Ae=pe;for(De=De.fb+P.Ma*De.A;0<Ae--;){var He=me,Ze=_e,dt=le,Ye=Pe,ft=De;switch(ne){case Ul:Xo(He,Ze,dt,Ye,ft);break;case Qo:ps(He,Ze,dt,Ye,ft);break;case $l:ps(He,Ze,dt,Ye,ft),Ko(Ye,ft,0,dt,1,0);break;case jf:ms(He,Ze,dt,Ye,ft);break;case Hl:Be(He,Ze,dt,Ye,ft,1);break;case Ks:Be(He,Ze,dt,Ye,ft,1),Ko(Ye,ft,0,dt,1,0);break;case wu:Be(He,Ze,dt,Ye,ft,0);break;case xu:Be(He,Ze,dt,Ye,ft,0),Ko(Ye,ft,1,dt,1,0);break;case gr:gs(He,Ze,dt,Ye,ft);break;case _u:gs(He,Ze,dt,Ye,ft),Ju(Ye,ft,dt,1,0);break;case ec:nr(He,Ze,dt,Ye,ft);break;default:t(0)}_e+=Se,De+=Qe}P.Ma+=pe}else alert("todo:EmitRescaledRowsYUVA");t(P.Ma<=V.height)}}P.C=I,t(P.C<=P.i)}function ka(P){var I;if(0<P.ua)return 0;for(I=0;I<P.Wb;++I){var V=P.Ya[I].G,ne=P.Ya[I].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,I,V,ne,le,pe){if(P.Z!=0){var me=P.qd,_e=P.rd;for(t(ta[P.Z]!=null);I<V;++I)ta[P.Z](me,_e,ne,le,ne,le,pe),me=ne,_e=le,le+=pe;P.qd=me,P.rd=_e}}function ci(P,I){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(I<=P.l.o),I>ne){var le=P.l.width,pe=V.ca,me=V.tb+le*ne,_e=P.V,Se=P.Ba+P.c*ne,Pe=P.gc;t(P.ab==1),t(Pe[0].hc==3),Ta(Pe[0],ne,I,_e,Se,pe,me),io(V,ne,I,pe,me,le)}P.C=P.Ma=I}function Aa(P,I,V,ne,le,pe,me){var _e=P.$/ne,Se=P.$%ne,Pe=P.m,De=P.s,Qe=V+P.$,Ae=Qe;le=V+ne*le;var He=V+ne*pe,Ze=280+De.ua,dt=P.Pb?_e:16777216,Ye=0<De.ua?De.Wa:null,ft=De.wc,qe=Qe<He?Dr(De,Se,_e):null;t(P.C<pe),t(He<=le);var mt=!1;e:for(;;){for(;mt||Qe<He;){var vt=0;if(_e>=dt){var Yt=Qe-V;t((dt=P).Pb),dt.wd=dt.m,dt.xd=Yt,0<dt.s.ua&&ut(dt.s.Wa,dt.s.vb),dt=_e+tc}if(Se&ft||(qe=Dr(De,Se,_e)),t(qe!=null),qe.Qb&&(I[Qe]=qe.qb,mt=!0),!mt)if(ie(Pe),qe.jc){vt=Pe,Yt=I;var zt=Qe,vn=qe.pd[Y(vt)&Ni-1];t(qe.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=$n(qe.G[0],qe.H[0],Pe);if(Pe.h)break;if(mt||256>vt){if(!mt)if(qe.nd)I[Qe]=(qe.qb|vt<<8)>>>0;else{if(ie(Pe),mt=$n(qe.G[1],qe.H[1],Pe),ie(Pe),Yt=$n(qe.G[2],qe.H[2],Pe),zt=$n(qe.G[3],qe.H[3],Pe),Pe.h)break;I[Qe]=(zt<<24|mt<<16|vt<<8|Yt)>>>0}if(mt=!1,++Qe,++Se>=ne&&(Se=0,++_e,me!=null&&_e<=pe&&!(_e%16)&&me(P,_e),Ye!=null))for(;Ae<Qe;)vt=I[Ae++],Ye.X[(506832829*vt&4294967295)>>>Ye.Mb]=vt}else if(280>vt){if(vt=ti(vt-256,Pe),Yt=$n(qe.G[4],qe.H[4],Pe),ie(Pe),Yt=Zi(ne,Yt=ti(Yt,Pe)),Pe.h)break;if(Qe-V<Yt||le-Qe<vt)break e;for(zt=0;zt<vt;++zt)I[Qe+zt]=I[Qe+zt-Yt];for(Qe+=vt,Se+=vt;Se>=ne;)Se-=ne,++_e,me!=null&&_e<=pe&&!(_e%16)&&me(P,_e);if(t(Qe<=le),Se&ft&&(qe=Dr(De,Se,_e)),Ye!=null)for(;Ae<Qe;)vt=I[Ae++],Ye.X[(506832829*vt&4294967295)>>>Ye.Mb]=vt}else{if(!(vt<Ze))break e;for(mt=vt-280,t(Ye!=null);Ae<Qe;)vt=I[Ae++],Ye.X[(506832829*vt&4294967295)>>>Ye.Mb]=vt;vt=Qe,t(!(mt>>>(Yt=Ye).Xa)),I[vt]=Yt.X[mt],mt=!0}mt||t(Pe.h==J(Pe))}if(P.Pb&&Pe.h&&Qe<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,_e>pe?pe:_e),P.a=0,P.$=Qe-V}return 1}return P.a=3,0}function Pa(P){t(P!=null),P.vc=null,P.yc=null,P.Ya=null;var I=P.Wa;I!=null&&(I.X=null),P.vb=null,t(P!=null)}function Wo(){var P=new mn;return P==null?null:(P.a=0,P.xb=Eu,Wt("Predictor","VP8LPredictors"),Wt("Predictor","VP8LPredictors_C"),Wt("PredictorAdd","VP8LPredictorsAdd"),Wt("PredictorAdd","VP8LPredictorsAdd_C"),ri=nt,bl=at,Xo=Ct,ps=rn,gs=Zt,nr=an,ms=We,j.VP8LMapColor32b=pi,j.VP8LMapColor8b=Ro,P)}function qi(P,I,V,ne,le){var pe=1,me=[P],_e=[I],Se=ne.m,Pe=ne.s,De=null,Qe=0;e:for(;;){if(V)for(;pe&&B(Se,1);){var Ae=me,He=_e,Ze=ne,dt=1,Ye=Ze.m,ft=Ze.gc[Ze.ab],qe=B(Ye,2);if(Ze.Oc&1<<qe)pe=0;else{switch(Ze.Oc|=1<<qe,ft.hc=qe,ft.Ea=Ae[0],ft.nc=He[0],ft.K=[null],++Ze.ab,t(4>=Ze.ab),qe){case 0:case 1:ft.b=B(Ye,3)+2,dt=qi(be(ft.Ea,ft.b),be(ft.nc,ft.b),0,Ze,ft.K),ft.K=ft.K[0];break;case 3:var mt,vt=B(Ye,8)+1,Yt=16<vt?0:4<vt?1:2<vt?2:3;if(Ae[0]=be(ft.Ea,Yt),ft.b=Yt,mt=dt=qi(vt,1,0,Ze,ft.K)){var zt,vn=vt,qt=ft,Nn=1<<(8>>qt.b),Gr=a(Nn);if(Gr==null)mt=0;else{var _n=qt.K[0],Bt=qt.w;for(Gr[0]=qt.K[0][0],zt=1;zt<1*vn;++zt)Gr[zt]=Le(_n[Bt+zt],Gr[zt-1]);for(;zt<4*Nn;++zt)Gr[zt]=0;qt.K[0]=null,qt.K[0]=Gr,mt=1}}dt=mt;break;case 2:break;default:t(0)}pe=dt}}if(me=me[0],_e=_e[0],pe&&B(Se,1)&&!(pe=1<=(Qe=B(Se,4))&&11>=Qe)){ne.a=3;break e}var kt;if(kt=pe)t:{var Wr,$t,yn,Fn=ne,Ai=me,gi=_e,Wn=Qe,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=be(Ai,Rr),ir=be(gi,Rr),Ii=Mr*ir;if(!qi(Mr,ir,0,Fn,In))break n;for(In=In[0],Br.xc=Rr,Wr=0;Wr<Ii;++Wr){var Jn=In[Wr]>>8&65535;In[Wr]=Jn,Jn>=Yn&&(Yn=Jn+1)}}if(wr.h)break n;for($t=0;5>$t;++$t){var er=xl[$t];!$t&&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 Vr=a(Tr);if(ai==null||Vr==null||ii==null){Fn.a=1;break n}var wa=ii;for(Wr=yn=0;Wr<Yn;++Wr){var ar=ai[Wr],Vi=ar.G,Kn=ar.H,dn=0,Bn=1,On=0;for($t=0;5>$t;++$t){er=xl[$t],Vi[$t]=wa,Kn[$t]=yn,!$t&&0<Wn&&(er+=1<<Wn);i:{var zr,mi=er,Jo=Fn,mr=Vr,Pu=wa,Js=yn,vr=0,yo=Jo.m,Yl=B(yo,1);if(i(mr,0,0,mi),Yl){var xa=B(yo,1)+1,Ou=B(yo,1),Cu=B(yo,Ou==0?1:8);mr[Cu]=1,xa==2&&(mr[Cu=B(yo,8)]=1);var Yi=1}else{var ur=a(19),Yr=B(yo,4)+4;if(19<Yr){Jo.a=3;var Xr=0;break i}for(zr=0;zr<Yr;++zr)ur[Nd[zr]]=B(yo,3);var bo=void 0,jo=void 0,wo=Jo,Gc=ur,Kr=mi,Lu=mr,Sl=0,xo=wo.m,Ar=8,Oi=o(128,$);r:for(;T(Oi,0,7,Gc,19);){if(B(xo,1)){var _a=2+2*B(xo,3);if((bo=2+B(xo,_a))>Kr)break r}else bo=Kr;for(jo=0;jo<Kr&&bo--;){ie(xo);var na=Oi[0+(127&Y(xo))];K(xo,xo.u+na.g);var el=na.value;if(16>el)Lu[jo++]=el,el!=0&&(Ar=el);else{var Wc=el==16,ac=el-16,Fh=qc[ac],Ss=B(xo,Su[ac])+Fh;if(jo+Ss>Kr)break r;for(var zf=Wc?Ar:0;0<Ss--;)Lu[jo++]=zf}}Sl=1;break r}Sl||(wo.a=3),Yi=Sl}(Yi=Yi&&!yo.h)&&(vr=T(Pu,Js,8,mr,mi)),Yi&&vr!=0?Xr=vr:(Jo.a=3,Xr=0)}if(Xr==0)break n;if(Bn&&Nh[$t]==1&&(Bn=wa[yn].g==0),dn+=wa[yn].g,yn+=Xr,3>=$t){var Xl,Nu=Vr[0];for(Xl=1;Xl<er;++Xl)Vr[Xl]>Nu&&(Nu=Vr[Xl]);On+=Nu}}if(ar.nd=Bn,ar.Qb=0,Bn&&(ar.qb=(Vi[3][Kn[3]+0].value<<24|Vi[1][Kn[1]+0].value<<16|Vi[2][Kn[2]+0].value)>>>0,dn==0&&256>Vi[0][Kn[0]+0].value&&(ar.Qb=1,ar.qb+=Vi[0][Kn[0]+0].value<<8)),ar.jc=!ar.Qb&&6>On,ar.jc){var es,Ja=ar;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,kt=1;break t}kt=0}if(!(pe=kt)){ne.a=3;break e}if(0<Qe){if(Pe.ua=1<<Qe,!ge(Pe.Wa,Qe)){ne.a=1,pe=0;break e}}else Pe.ua=0;var Vc=ne,Yc=me,qf=_e,oc=Vc.s,As=oc.xc;if(Vc.c=Yc,Vc.i=qf,oc.md=be(Yc,As),oc.wc=As==0?-1:(1<<As)-1,V){ne.xb=Mo;break e}if((De=a(me*_e))==null){ne.a=1,pe=0;break e}pe=(pe=Aa(ne,De,0,me,_e,_e,null))&&!Se.h;break e}return pe?(le!=null?le[0]=De:(t(De==null),t(V)),ne.$=0,V||Pa(Pe)):Pa(Pe),pe}function ao(P,I){var V=P.c*P.i,ne=V+I+16*I;return t(P.c<=I),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+I,1)}function Fs(P,I){var V=P.C,ne=I-V,le=P.V,pe=P.Ba+P.c*V;for(t(I<=P.l.o);0<ne;){var me=16<ne?16:ne,_e=P.l.ma,Se=P.l.width,Pe=Se*me,De=_e.ca,Qe=_e.tb+Se*V,Ae=P.Ta,He=P.Ua;Ea(P,me,le,pe),Ic(Ae,He,De,Qe,Pe),io(_e,V,V+me,De,Qe,Se),ne-=me,le+=me*P.c,V+=me}t(V==I),P.C=P.Ma=I}function as(){this.ub=this.yd=this.td=this.Rb=0}function hu(){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 I(V,ne,le){for(var pe=le[ne],me=0;me<pe&&(V.push(le.length>ne+1?[]:0),!(le.length<ne+1));me++)I(V[me],ne+1,le)})(P,0,[3,11]),P})()}function du(){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 Lc(){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 hu,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,Lc),this.Pa=new du,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,I){return 0>P?0:P>I?I: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,Gl||(Gl=Hr)),P}function Gn(P,I,V){return P.a==0&&(P.a=I,P.sc=V,P.cb=0),0}function so(P,I,V){return 3<=V&&P[I+0]==157&&P[I+1]==1&&P[I+2]==42}function Hi(P,I){if(P==null)return 0;if(P.a=0,P.sc="OK",I==null)return Gn(P,2,"null VP8Io passed to VP8GetHeaders()");var V=I.data,ne=I.w,le=I.ha;if(4>le)return Gn(P,7,"Truncated header.");var pe=V[ne+0]|V[ne+1]<<8|V[ne+2]<<16,me=P.Od;if(me.Rb=!(1&pe),me.td=pe>>1&7,me.yd=pe>>4&1,me.ub=pe>>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 _e=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");_e.c=16383&(V[ne+4]<<8|V[ne+3]),_e.Td=V[ne+4]>>6,_e.i=16383&(V[ne+6]<<8|V[ne+5]),_e.Ud=V[ne+6]>>6,ne+=7,le-=7,P.za=_e.c+15>>4,P.Ub=_e.i+15>>4,I.width=_e.c,I.height=_e.i,I.Da=0,I.j=0,I.v=0,I.va=I.width,I.o=I.height,I.da=0,I.ib=I.width,I.hb=I.height,I.U=I.width,I.T=I.height,i((pe=P.Pa).jb,0,255,pe.jb.length),t((pe=P.Qa)!=null),pe.Cb=0,pe.Bb=0,pe.Fb=1,i(pe.Zb,0,0,pe.Zb.length),i(pe.Lb,0,0,pe.Lb)}if(me.ub>le)return Gn(P,7,"bad partition length");se(pe=P.m,V,ne,me.ub),ne+=me.ub,le-=me.ub,me.Rb&&(_e.Ld=ue(pe),_e.Kd=ue(pe)),_e=P.Qa;var Se,Pe=P.Pa;if(t(pe!=null),t(_e!=null),_e.Cb=ue(pe),_e.Cb){if(_e.Bb=ue(pe),ue(pe)){for(_e.Fb=ue(pe),Se=0;4>Se;++Se)_e.Zb[Se]=ue(pe)?Q(pe,7):0;for(Se=0;4>Se;++Se)_e.Lb[Se]=ue(pe)?Q(pe,6):0}if(_e.Bb)for(Se=0;3>Se;++Se)Pe.jb[Se]=ue(pe)?ee(pe,8):255}else _e.Bb=0;if(pe.Ka)return Gn(P,3,"cannot parse segment header");if((_e=P.ed).zd=ue(pe),_e.Tb=ee(pe,6),_e.wb=ee(pe,3),_e.Pc=ue(pe),_e.Pc&&ue(pe)){for(Pe=0;4>Pe;++Pe)ue(pe)&&(_e.vd[Pe]=Q(pe,6));for(Pe=0;4>Pe;++Pe)ue(pe)&&(_e.od[Pe]=Q(pe,6))}if(P.L=_e.Tb==0?0:_e.zd?1:2,pe.Ka)return Gn(P,3,"cannot parse filter header");var De=le;if(le=Se=ne,ne=Se+De,_e=De,P.Xb=(1<<ee(P.m,2))-1,De<3*(Pe=P.Xb))V=7;else{for(Se+=3*Pe,_e-=3*Pe,De=0;De<Pe;++De){var Qe=V[le+0]|V[le+1]<<8|V[le+2]<<16;Qe>_e&&(Qe=_e),se(P.Jc[+De],V,Se,Qe),Se+=Qe,_e-=Qe,le+=3}se(P.Jc[+Pe],V,Se,_e),V=Se<ne?0:5}if(V!=0)return Gn(P,V,"cannot parse partitions");for(V=ee(Se=P.m,7),le=ue(Se)?Q(Se,4):0,ne=ue(Se)?Q(Se,4):0,_e=ue(Se)?Q(Se,4):0,Pe=ue(Se)?Q(Se,4):0,Se=ue(Se)?Q(Se,4):0,De=P.Qa,Qe=0;4>Qe;++Qe){if(De.Cb){var Ae=De.Zb[Qe];De.Fb||(Ae+=V)}else{if(0<Qe){P.pb[Qe]=P.pb[0];continue}Ae=V}var He=P.pb[Qe];He.Sc[0]=Zs[wn(Ae+le,127)],He.Sc[1]=nc[wn(Ae+0,127)],He.Eb[0]=2*Zs[wn(Ae+ne,127)],He.Eb[1]=101581*nc[wn(Ae+_e,127)]>>16,8>He.Eb[1]&&(He.Eb[1]=8),He.Qc[0]=Zs[wn(Ae+Pe,117)],He.Qc[1]=nc[wn(Ae+Se,127)],He.lc=Ae+Se}if(!me.Rb)return Gn(P,4,"Not a key frame.");for(ue(pe),me=P.Pa,V=0;4>V;++V){for(le=0;8>le;++le)for(ne=0;3>ne;++ne)for(_e=0;11>_e;++_e)Pe=we(pe,Mh[V][le][ne][_e])?ee(pe,8):rc[V][le][ne][_e],me.Wc[V][le].Yb[ne][_e]=Pe;for(le=0;17>le;++le)me.Xc[V][le]=me.Wc[V][Hc[le]]}return P.kc=ue(pe),P.kc&&(P.Bd=ee(pe,8)),P.cb=1}function Hr(P,I,V,ne,le,pe,me){var _e=I[le].Yb[V];for(V=0;16>le;++le){if(!we(P,_e[V+0]))return le;for(;!we(P,_e[V+1]);)if(_e=I[++le].Yb[0],V=0,le==16)return 16;var Se=I[le+1].Yb;if(we(P,_e[V+2])){var Pe=P,De=0;if(we(Pe,(Ae=_e)[(Qe=V)+3]))if(we(Pe,Ae[Qe+6])){for(_e=0,Qe=2*(De=we(Pe,Ae[Qe+8]))+(Ae=we(Pe,Ae[Qe+9+De])),De=0,Ae=Ff[Qe];Ae[_e];++_e)De+=De+we(Pe,Ae[_e]);De+=3+(8<<Qe)}else we(Pe,Ae[Qe+7])?(De=7+2*we(Pe,165),De+=we(Pe,145)):De=5+we(Pe,159);else De=we(Pe,Ae[Qe+4])?3+we(Pe,Ae[Qe+5]):2;_e=Se[2]}else De=1,_e=Se[1];Se=me+vo[le],0>(Pe=P).b&&fe(Pe);var Qe,Ae=Pe.b,He=(Qe=Pe.Ca>>1)-(Pe.I>>Ae)>>31;--Pe.b,Pe.Ca+=He,Pe.Ca|=1,Pe.I-=(Qe+1&He)<<Ae,pe[Se]=((De^He)-He)*ne[(0<le)+0]}return 16}function ls(P){var I=P.rb[P.sb-1];I.la=0,I.Na=0,i(P.zc,0,0,P.zc.length),P.ja=0}function lo(P,I,V,ne,le){le=P[I+V+32*ne]+(le>>3),P[I+V+32*ne]=-256&le?0>le?0:255:le}function xi(P,I,V,ne,le,pe){lo(P,I,0,V,ne+le),lo(P,I,1,V,ne+pe),lo(P,I,2,V,ne-pe),lo(P,I,3,V,ne-le)}function Ba(P){return(20091*P>>16)+P}function pu(P,I,V,ne){var le,pe=0,me=a(16);for(le=0;4>le;++le){var _e=P[I+0]+P[I+8],Se=P[I+0]-P[I+8],Pe=(35468*P[I+4]>>16)-Ba(P[I+12]),De=Ba(P[I+4])+(35468*P[I+12]>>16);me[pe+0]=_e+De,me[pe+1]=Se+Pe,me[pe+2]=Se-Pe,me[pe+3]=_e-De,pe+=4,I++}for(le=pe=0;4>le;++le)_e=(P=me[pe+0]+4)+me[pe+8],Se=P-me[pe+8],Pe=(35468*me[pe+4]>>16)-Ba(me[pe+12]),lo(V,ne,0,0,_e+(De=Ba(me[pe+4])+(35468*me[pe+12]>>16))),lo(V,ne,1,0,Se+Pe),lo(V,ne,2,0,Se-Pe),lo(V,ne,3,0,_e-De),pe++,ne+=32}function Ca(P,I,V,ne){var le=P[I+0]+4,pe=35468*P[I+4]>>16,me=Ba(P[I+4]),_e=35468*P[I+1]>>16;xi(V,ne,0,le+me,P=Ba(P[I+1]),_e),xi(V,ne,1,le+pe,P,_e),xi(V,ne,2,le-pe,P,_e),xi(V,ne,3,le-me,P,_e)}function Ml(P,I,V,ne,le){pu(P,I,V,ne),le&&pu(P,I+16,V,ne+4)}function us(P,I,V,ne){Vs(P,I+0,V,ne,1),Vs(P,I+32,V,ne+128,1)}function gu(P,I,V,ne){var le;for(P=P[I+0]+4,le=0;4>le;++le)for(I=0;4>I;++I)lo(V,ne,I,le,P)}function jn(P,I,V,ne){P[I+0]&&Rn(P,I+0,V,ne),P[I+16]&&Rn(P,I+16,V,ne+4),P[I+32]&&Rn(P,I+32,V,ne+128),P[I+48]&&Rn(P,I+48,V,ne+128+4)}function cs(P,I,V,ne){var le,pe=a(16);for(le=0;4>le;++le){var me=P[I+0+le]+P[I+12+le],_e=P[I+4+le]+P[I+8+le],Se=P[I+4+le]-P[I+8+le],Pe=P[I+0+le]-P[I+12+le];pe[0+le]=me+_e,pe[8+le]=me-_e,pe[4+le]=Pe+Se,pe[12+le]=Pe-Se}for(le=0;4>le;++le)me=(P=pe[0+4*le]+3)+pe[3+4*le],_e=pe[1+4*le]+pe[2+4*le],Se=pe[1+4*le]-pe[2+4*le],Pe=P-pe[3+4*le],V[ne+0]=me+_e>>3,V[ne+16]=Pe+Se>>3,V[ne+32]=me-_e>>3,V[ne+48]=Pe-Se>>3,ne+=64}function Oo(P,I,V){var ne,le=I-32,pe=Ri,me=255-P[le-1];for(ne=0;ne<V;++ne){var _e,Se=pe,Pe=me+P[I-1];for(_e=0;_e<V;++_e)P[I+_e]=Se[Pe+P[le+_e]];I+=32}}function dl(P,I){Oo(P,I,4)}function Nc(P,I){Oo(P,I,8)}function Tc(P,I){Oo(P,I,16)}function pl(P,I){var V;for(V=0;16>V;++V)r(P,I+32*V,P,I-32,16)}function Il(P,I){var V;for(V=16;0<V;--V)i(P,I,P[I-1],16),I+=32}function ca(P,I,V){var ne;for(ne=0;16>ne;++ne)i(I,V+32*ne,P,16)}function za(P,I){var V,ne=16;for(V=0;16>V;++V)ne+=P[I-1+32*V]+P[I+V-32];ca(ne>>5,P,I)}function qa(P,I){var V,ne=8;for(V=0;16>V;++V)ne+=P[I-1+32*V];ca(ne>>4,P,I)}function Ua(P,I){var V,ne=8;for(V=0;16>V;++V)ne+=P[I+V-32];ca(ne>>4,P,I)}function Ln(P,I){ca(128,P,I)}function cn(P,I,V){return P+2*I+V+2>>2}function Co(P,I){var V,ne=I-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,I+32*V,ne,0,ne.length)}function Rc(P,I){var V=P[I-1],ne=P[I-1+32],le=P[I-1+64],pe=P[I-1+96];Ce(P,I+0,16843009*cn(P[I-1-32],V,ne)),Ce(P,I+32,16843009*cn(V,ne,le)),Ce(P,I+64,16843009*cn(ne,le,pe)),Ce(P,I+96,16843009*cn(le,pe,pe))}function Mc(P,I){var V,ne=4;for(V=0;4>V;++V)ne+=P[I+V-32]+P[I-1+32*V];for(ne>>=3,V=0;4>V;++V)i(P,I+32*V,ne,4)}function uo(P,I){var V=P[I-1+0],ne=P[I-1+32],le=P[I-1+64],pe=P[I-1-32],me=P[I+0-32],_e=P[I+1-32],Se=P[I+2-32],Pe=P[I+3-32];P[I+0+96]=cn(ne,le,P[I-1+96]),P[I+1+96]=P[I+0+64]=cn(V,ne,le),P[I+2+96]=P[I+1+64]=P[I+0+32]=cn(pe,V,ne),P[I+3+96]=P[I+2+64]=P[I+1+32]=P[I+0+0]=cn(me,pe,V),P[I+3+64]=P[I+2+32]=P[I+1+0]=cn(_e,me,pe),P[I+3+32]=P[I+2+0]=cn(Se,_e,me),P[I+3+0]=cn(Pe,Se,_e)}function Er(P,I){var V=P[I+1-32],ne=P[I+2-32],le=P[I+3-32],pe=P[I+4-32],me=P[I+5-32],_e=P[I+6-32],Se=P[I+7-32];P[I+0+0]=cn(P[I+0-32],V,ne),P[I+1+0]=P[I+0+32]=cn(V,ne,le),P[I+2+0]=P[I+1+32]=P[I+0+64]=cn(ne,le,pe),P[I+3+0]=P[I+2+32]=P[I+1+64]=P[I+0+96]=cn(le,pe,me),P[I+3+32]=P[I+2+64]=P[I+1+96]=cn(pe,me,_e),P[I+3+64]=P[I+2+96]=cn(me,_e,Se),P[I+3+96]=cn(_e,Se,Se)}function mu(P,I){var V=P[I-1+0],ne=P[I-1+32],le=P[I-1+64],pe=P[I-1-32],me=P[I+0-32],_e=P[I+1-32],Se=P[I+2-32],Pe=P[I+3-32];P[I+0+0]=P[I+1+64]=pe+me+1>>1,P[I+1+0]=P[I+2+64]=me+_e+1>>1,P[I+2+0]=P[I+3+64]=_e+Se+1>>1,P[I+3+0]=Se+Pe+1>>1,P[I+0+96]=cn(le,ne,V),P[I+0+64]=cn(ne,V,pe),P[I+0+32]=P[I+1+96]=cn(V,pe,me),P[I+1+32]=P[I+2+96]=cn(pe,me,_e),P[I+2+32]=P[I+3+96]=cn(me,_e,Se),P[I+3+32]=cn(_e,Se,Pe)}function vu(P,I){var V=P[I+0-32],ne=P[I+1-32],le=P[I+2-32],pe=P[I+3-32],me=P[I+4-32],_e=P[I+5-32],Se=P[I+6-32],Pe=P[I+7-32];P[I+0+0]=V+ne+1>>1,P[I+1+0]=P[I+0+64]=ne+le+1>>1,P[I+2+0]=P[I+1+64]=le+pe+1>>1,P[I+3+0]=P[I+2+64]=pe+me+1>>1,P[I+0+32]=cn(V,ne,le),P[I+1+32]=P[I+0+96]=cn(ne,le,pe),P[I+2+32]=P[I+1+96]=cn(le,pe,me),P[I+3+32]=P[I+2+96]=cn(pe,me,_e),P[I+3+64]=cn(me,_e,Se),P[I+3+96]=cn(_e,Se,Pe)}function Bs(P,I){var V=P[I-1+0],ne=P[I-1+32],le=P[I-1+64],pe=P[I-1+96];P[I+0+0]=V+ne+1>>1,P[I+2+0]=P[I+0+32]=ne+le+1>>1,P[I+2+32]=P[I+0+64]=le+pe+1>>1,P[I+1+0]=cn(V,ne,le),P[I+3+0]=P[I+1+32]=cn(ne,le,pe),P[I+3+32]=P[I+1+64]=cn(le,pe,pe),P[I+3+64]=P[I+2+64]=P[I+0+96]=P[I+1+96]=P[I+2+96]=P[I+3+96]=pe}function Zu(P,I){var V=P[I-1+0],ne=P[I-1+32],le=P[I-1+64],pe=P[I-1+96],me=P[I-1-32],_e=P[I+0-32],Se=P[I+1-32],Pe=P[I+2-32];P[I+0+0]=P[I+2+32]=V+me+1>>1,P[I+0+32]=P[I+2+64]=ne+V+1>>1,P[I+0+64]=P[I+2+96]=le+ne+1>>1,P[I+0+96]=pe+le+1>>1,P[I+3+0]=cn(_e,Se,Pe),P[I+2+0]=cn(me,_e,Se),P[I+1+0]=P[I+3+32]=cn(V,me,_e),P[I+1+32]=P[I+3+64]=cn(ne,V,me),P[I+1+64]=P[I+3+96]=cn(le,ne,V),P[I+1+96]=cn(pe,le,ne)}function Ha(P,I){var V;for(V=0;8>V;++V)r(P,I+32*V,P,I-32,8)}function fa(P,I){var V;for(V=0;8>V;++V)i(P,I,P[I-1],8),I+=32}function $a(P,I,V){var ne;for(ne=0;8>ne;++ne)i(I,V+32*ne,P,8)}function yu(P,I){var V,ne=8;for(V=0;8>V;++V)ne+=P[I+V-32]+P[I-1+32*V];$a(ne>>4,P,I)}function La(P,I){var V,ne=4;for(V=0;8>V;++V)ne+=P[I+V-32];$a(ne>>3,P,I)}function co(P,I){var V,ne=4;for(V=0;8>V;++V)ne+=P[I-1+32*V];$a(ne>>3,P,I)}function zs(P,I){$a(128,P,I)}function Ga(P,I,V){var ne=P[I-V],le=P[I+0],pe=3*(le-ne)+Zo[1020+P[I-2*V]-P[I+V]],me=ql[112+(pe+4>>3)];P[I-V]=Ri[255+ne+ql[112+(pe+3>>3)]],P[I+0]=Ri[255+le-me]}function gl(P,I,V,ne){var le=P[I+0],pe=P[I+V];return mo[255+P[I-2*V]-P[I-V]]>ne||mo[255+pe-le]>ne}function jl(P,I,V,ne){return 4*mo[255+P[I-V]-P[I+0]]+mo[255+P[I-2*V]-P[I+V]]<=ne}function fi(P,I,V,ne,le){var pe=P[I-3*V],me=P[I-2*V],_e=P[I-V],Se=P[I+0],Pe=P[I+V],De=P[I+2*V],Qe=P[I+3*V];return 4*mo[255+_e-Se]+mo[255+me-Pe]>ne?0:mo[255+P[I-4*V]-pe]<=le&&mo[255+pe-me]<=le&&mo[255+me-_e]<=le&&mo[255+Qe-De]<=le&&mo[255+De-Pe]<=le&&mo[255+Pe-Se]<=le}function Wa(P,I,V,ne){var le=2*ne+1;for(ne=0;16>ne;++ne)jl(P,I+ne,V,le)&&Ga(P,I+ne,V)}function fo(P,I,V,ne){var le=2*ne+1;for(ne=0;16>ne;++ne)jl(P,I+ne*V,1,le)&&Ga(P,I+ne*V,1)}function ml(P,I,V,ne){var le;for(le=3;0<le;--le)Wa(P,I+=4*V,V,ne)}function fs(P,I,V,ne){var le;for(le=3;0<le;--le)fo(P,I+=4,V,ne)}function $r(P,I,V,ne,le,pe,me,_e){for(pe=2*pe+1;0<le--;){if(fi(P,I,V,pe,me))if(gl(P,I,V,_e))Ga(P,I,V);else{var Se=P,Pe=I,De=V,Qe=Se[Pe-2*De],Ae=Se[Pe-De],He=Se[Pe+0],Ze=Se[Pe+De],dt=Se[Pe+2*De],Ye=27*(qe=Zo[1020+3*(He-Ae)+Zo[1020+Qe-Ze]])+63>>7,ft=18*qe+63>>7,qe=9*qe+63>>7;Se[Pe-3*De]=Ri[255+Se[Pe-3*De]+qe],Se[Pe-2*De]=Ri[255+Qe+ft],Se[Pe-De]=Ri[255+Ae+Ye],Se[Pe+0]=Ri[255+He-Ye],Se[Pe+De]=Ri[255+Ze-ft],Se[Pe+2*De]=Ri[255+dt-qe]}I+=ne}}function hi(P,I,V,ne,le,pe,me,_e){for(pe=2*pe+1;0<le--;){if(fi(P,I,V,pe,me))if(gl(P,I,V,_e))Ga(P,I,V);else{var Se=P,Pe=I,De=V,Qe=Se[Pe-De],Ae=Se[Pe+0],He=Se[Pe+De],Ze=ql[112+(4+(dt=3*(Ae-Qe))>>3)],dt=ql[112+(dt+3>>3)],Ye=Ze+1>>1;Se[Pe-2*De]=Ri[255+Se[Pe-2*De]+Ye],Se[Pe-De]=Ri[255+Qe+dt],Se[Pe+0]=Ri[255+Ae-Ze],Se[Pe+De]=Ri[255+He-Ye]}I+=ne}}function ni(P,I,V,ne,le,pe){$r(P,I,V,1,16,ne,le,pe)}function _i(P,I,V,ne,le,pe){$r(P,I,1,V,16,ne,le,pe)}function Va(P,I,V,ne,le,pe){var me;for(me=3;0<me;--me)hi(P,I+=4*V,V,1,16,ne,le,pe)}function H(P,I,V,ne,le,pe){var me;for(me=3;0<me;--me)hi(P,I+=4,1,V,16,ne,le,pe)}function ce(P,I,V,ne,le,pe,me,_e){$r(P,I,le,1,8,pe,me,_e),$r(V,ne,le,1,8,pe,me,_e)}function Oe(P,I,V,ne,le,pe,me,_e){$r(P,I,1,le,8,pe,me,_e),$r(V,ne,1,le,8,pe,me,_e)}function je(P,I,V,ne,le,pe,me,_e){hi(P,I+4*le,le,1,8,pe,me,_e),hi(V,ne+4*le,le,1,8,pe,me,_e)}function $e(P,I,V,ne,le,pe,me,_e){hi(P,I+4,1,le,8,pe,me,_e),hi(V,ne+4,1,le,8,pe,me,_e)}function ht(){this.ba=new on,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 ke,this.vb=new ke,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 on,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,I,V,ne,le,pe,me){for(P=P==null?0:P[I+0],I=0;I<me;++I)le[pe+I]=P+V[ne+I]&255,P=le[pe+I]}function Lr(P,I,V,ne,le,pe,me){var _e;if(P==null)Dn(null,null,V,ne,le,pe,me);else for(_e=0;_e<me;++_e)le[pe+_e]=P[I+_e]+V[ne+_e]&255}function di(P,I,V,ne,le,pe,me){if(P==null)Dn(null,null,V,ne,le,pe,me);else{var _e,Se=P[I+0],Pe=Se,De=Se;for(_e=0;_e<me;++_e)Pe=De+(Se=P[I+_e])-Pe,De=V[ne+_e]+(-256&Pe?0>Pe?0:255:Pe)&255,Pe=Se,le[pe+_e]=De}}function sr(P,I,V,ne){var le=I.width,pe=I.o;if(t(P!=null&&I!=null),0>V||0>=ne||V+ne>pe)return null;if(!P.Cc){if(P.ga==null){var me;if(P.ga=new xn,(me=P.ga==null)||(me=I.width*I.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 _e=P.Fa,Se=P.P,Pe=P.qc,De=P.mb,Qe=P.nb,Ae=Se+1,He=Pe-1,Ze=me.l;if(t(_e!=null&&De!=null&&I!=null),ta[0]=null,ta[1]=Dn,ta[2]=Lr,ta[3]=di,me.ca=De,me.tb=Qe,me.c=I.width,me.i=I.height,t(0<me.c&&0<me.i),1>=Pe)I=0;else if(me.$a=3&_e[Se+0],me.Z=_e[Se+0]>>2&3,me.Lc=_e[Se+0]>>4&3,Se=_e[Se+0]>>6&3,0>me.$a||1<me.$a||4<=me.Z||1<me.Lc||Se)I=0;else if(Ze.put=Qt,Ze.ac=dr,Ze.bc=zi,Ze.ma=me,Ze.width=I.width,Ze.height=I.height,Ze.Da=I.Da,Ze.v=I.v,Ze.va=I.va,Ze.j=I.j,Ze.o=I.o,me.$a)e:{t(me.$a==1),I=Wo();t:for(;;){if(I==null){I=0;break e}if(t(me!=null),me.mc=I,I.c=me.c,I.i=me.i,I.l=me.l,I.l.ma=me,I.l.width=me.c,I.l.height=me.i,I.a=0,re(I.m,_e,Ae,He),!qi(me.c,me.i,1,I,null)||(I.ab==1&&I.gc[0].hc==3&&ka(I.s)?(me.ic=1,_e=I.c*I.i,I.Ta=null,I.Ua=0,I.V=a(_e),I.Ba=0,I.V==null?(I.a=1,I=0):I=1):(me.ic=0,I=ao(I,me.c)),!I))break t;I=1;break e}me.mc=null,I=0}else I=He>=me.c*me.i;me=!I}if(me)return null;P.ga.Lc!=1?P.Ga=0:ne=pe-V}t(P.ga!=null),t(V+ne<=pe);e:{if(I=(_e=P.ga).c,pe=_e.l.o,_e.$a==0){if(Ae=P.rc,He=P.Vc,Ze=P.Fa,Se=P.P+1+V*I,Pe=P.mb,De=P.nb+V*I,t(Se<=P.P+P.qc),_e.Z!=0)for(t(ta[_e.Z]!=null),me=0;me<ne;++me)ta[_e.Z](Ae,He,Ze,Se,Pe,De,I),Ae=Pe,He=De,De+=I,Se+=I;else for(me=0;me<ne;++me)r(Pe,De,Ze,Se,I),Ae=Pe,He=De,De+=I,Se+=I;P.rc=Ae,P.Vc=He}else{if(t(_e.mc!=null),I=V+ne,t((me=_e.mc)!=null),t(I<=me.i),me.C>=I)I=1;else if(_e.ic||Ya(),_e.ic){_e=me.V,Ae=me.Ba,He=me.c;var dt=me.i,Ye=(Ze=1,Se=me.$/He,Pe=me.$%He,De=me.m,Qe=me.s,me.$),ft=He*dt,qe=He*I,mt=Qe.wc,vt=Ye<qe?Dr(Qe,Pe,Se):null;t(Ye<=ft),t(I<=dt),t(ka(Qe));t:for(;;){for(;!De.h&&Ye<qe;){if(Pe&mt||(vt=Dr(Qe,Pe,Se)),t(vt!=null),ie(De),256>(dt=$n(vt.G[0],vt.H[0],De)))_e[Ae+Ye]=dt,++Ye,++Pe>=He&&(Pe=0,++Se<=I&&!(Se%16)&&ci(me,Se));else{if(!(280>dt)){Ze=0;break t}dt=ti(dt-256,De);var Yt,zt=$n(vt.G[4],vt.H[4],De);if(ie(De),!(Ye>=(zt=Zi(He,zt=ti(zt,De)))&&ft-Ye>=dt)){Ze=0;break t}for(Yt=0;Yt<dt;++Yt)_e[Ae+Ye+Yt]=_e[Ae+Ye+Yt-zt];for(Ye+=dt,Pe+=dt;Pe>=He;)Pe-=He,++Se<=I&&!(Se%16)&&ci(me,Se);Ye<qe&&Pe&mt&&(vt=Dr(Qe,Pe,Se))}t(De.h==J(De))}ci(me,Se>I?I:Se);break t}!Ze||De.h&&Ye<ft?(Ze=0,me.a=De.h?5:3):me.$=Ye,I=Ze}else I=Aa(me,me.V,me.Ba,me.c,me.i,I,Fs);if(!I){ne=0;break e}}V+ne>=pe&&(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,I,V,ne,le,pe){for(;0<le--;){var me,_e=P,Se=I+(V?1:0),Pe=P,De=I+(V?0:3);for(me=0;me<ne;++me){var Qe=Pe[De+4*me];Qe!=255&&(Qe*=32897,_e[Se+4*me+0]=_e[Se+4*me+0]*Qe>>23,_e[Se+4*me+1]=_e[Se+4*me+1]*Qe>>23,_e[Se+4*me+2]=_e[Se+4*me+2]*Qe>>23)}I+=pe}}function kr(P,I,V,ne,le){for(;0<ne--;){var pe;for(pe=0;pe<V;++pe){var me=P[I+2*pe+0],_e=15&(Pe=P[I+2*pe+1]),Se=4369*_e,Pe=(240&Pe|Pe>>4)*Se>>16;P[I+2*pe+0]=(240&me|me>>4)*Se>>16&240|(15&me|me<<4)*Se>>16>>4&15,P[I+2*pe+1]=240&Pe|_e}I+=le}}function Li(P,I,V,ne,le,pe,me,_e){var Se,Pe,De=255;for(Pe=0;Pe<le;++Pe){for(Se=0;Se<ne;++Se){var Qe=P[I+Se];pe[me+4*Se]=Qe,De&=Qe}I+=V,me+=_e}return De!=255}function qs(P,I,V,ne,le){var pe;for(pe=0;pe<le;++pe)V[ne+pe]=P[I+pe]>>8}function Ya(){Ko=Si,Ju=kr,zl=Li,Ic=qs}function Us(P,I,V){j[P]=function(ne,le,pe,me,_e,Se,Pe,De,Qe,Ae,He,Ze,dt,Ye,ft,qe,mt){var vt,Yt=mt-1>>1,zt=_e[Se+0]|Pe[De+0]<<16,vn=Qe[Ae+0]|He[Ze+0]<<16;t(ne!=null);var qt=3*zt+vn+131074>>2;for(I(ne[le+0],255&qt,qt>>16,dt,Ye),pe!=null&&(qt=3*vn+zt+131074>>2,I(pe[me+0],255&qt,qt>>16,ft,qe)),vt=1;vt<=Yt;++vt){var Nn=_e[Se+vt]|Pe[De+vt]<<16,Gr=Qe[Ae+vt]|He[Ze+vt]<<16,_n=zt+Nn+vn+Gr+524296,Bt=_n+2*(Nn+vn)>>3;qt=Bt+zt>>1,zt=(_n=_n+2*(zt+Gr)>>3)+Nn>>1,I(ne[le+2*vt-1],255&qt,qt>>16,dt,Ye+(2*vt-1)*V),I(ne[le+2*vt-0],255&zt,zt>>16,dt,Ye+(2*vt-0)*V),pe!=null&&(qt=_n+vn>>1,zt=Bt+Gr>>1,I(pe[me+2*vt-1],255&qt,qt>>16,ft,qe+(2*vt-1)*V),I(pe[me+2*vt+0],255&zt,zt>>16,ft,qe+(2*vt+0)*V)),zt=Nn,vn=Gr}1&mt||(qt=3*zt+vn+131074>>2,I(ne[le+mt-1],255&qt,qt>>16,dt,Ye+(mt-1)*V),pe!=null&&(qt=3*vn+zt+131074>>2,I(pe[me+mt-1],255&qt,qt>>16,ft,qe+(mt-1)*V)))}}function Vo(){Ra[Ul]=Ih,Ra[Qo]=Qs,Ra[jf]=jh,Ra[Hl]=ku,Ra[wu]=ki,Ra[gr]=Mi,Ra[ec]=$c,Ra[$l]=Qs,Ra[Ks]=ku,Ra[xu]=ki,Ra[_u]=Mi}function Hs(P){return P&-16384?0>P?0:255:P>>ws}function $s(P,I){return Hs((19077*P>>8)+(26149*I>>8)-14234)}function vl(P,I,V){return Hs((19077*P>>8)-(6419*I>>8)-(13320*V>>8)+8708)}function ho(P,I){return Hs((19077*P>>8)+(33050*I>>8)-17685)}function Gs(P,I,V,ne,le){ne[le+0]=$s(P,V),ne[le+1]=vl(P,I,V),ne[le+2]=ho(P,I)}function Ei(P,I,V,ne,le){ne[le+0]=ho(P,I),ne[le+1]=vl(P,I,V),ne[le+2]=$s(P,V)}function hs(P,I,V,ne,le){var pe=vl(P,I,V);I=pe<<3&224|ho(P,I)>>3,ne[le+0]=248&$s(P,V)|pe>>5,ne[le+1]=I}function Lo(P,I,V,ne,le){var pe=240&ho(P,I)|15;ne[le+0]=240&$s(P,V)|vl(P,I,V)>>4,ne[le+1]=pe}function Dl(P,I,V,ne,le){ne[le+0]=255,Gs(P,I,V,ne,le+1)}function Fl(P,I,V,ne,le){Ei(P,I,V,ne,le),ne[le+3]=255}function ha(P,I,V,ne,le){Gs(P,I,V,ne,le),ne[le+3]=255}function po(P,I,V){j[P]=function(ne,le,pe,me,_e,Se,Pe,De,Qe){for(var Ae=De+(-2&Qe)*V;De!=Ae;)I(ne[le+0],pe[me+0],_e[Se+0],Pe,De),I(ne[le+1],pe[me+0],_e[Se+0],Pe,De+V),le+=2,++me,++Se,De+=2*V;1&Qe&&I(ne[le+0],pe[me+0],_e[Se+0],Pe,De)}}function No(P,I,V){return V==0?P==0?I==0?6:5:I==0?4:0:V}function Ws(P,I,V,ne,le){switch(P>>>30){case 3:Vs(I,V,ne,le,0);break;case 2:Nr(I,V,ne,le);break;case 1:Rn(I,V,ne,le)}}function Fr(P,I){var V,ne,le=I.M,pe=I.Nb,me=P.oc,_e=P.pc+40,Se=P.oc,Pe=P.pc+584,De=P.oc,Qe=P.pc+600;for(V=0;16>V;++V)me[_e+32*V-1]=129;for(V=0;8>V;++V)Se[Pe+32*V-1]=129,De[Qe+32*V-1]=129;for(0<le?me[_e-1-32]=Se[Pe-1-32]=De[Qe-1-32]=129:(i(me,_e-32-1,127,21),i(Se,Pe-32-1,127,9),i(De,Qe-32-1,127,9)),ne=0;ne<P.za;++ne){var Ae=I.ya[I.aa+ne];if(0<ne){for(V=-1;16>V;++V)r(me,_e+32*V-4,me,_e+32*V+12,4);for(V=-1;8>V;++V)r(Se,Pe+32*V-4,Se,Pe+32*V+4,4),r(De,Qe+32*V-4,De,Qe+32*V+4,4)}var He=P.Gd,Ze=P.Hd+ne,dt=Ae.ad,Ye=Ae.Hc;if(0<le&&(r(me,_e-32,He[Ze].y,0,16),r(Se,Pe-32,He[Ze].f,0,8),r(De,Qe-32,He[Ze].ea,0,8)),Ae.Za){var ft=me,qe=_e-32+16;for(0<le&&(ne>=P.za-1?i(ft,qe,He[Ze].y[15],4):r(ft,qe,He[Ze+1].y,0,4)),V=0;4>V;V++)ft[qe+128+V]=ft[qe+256+V]=ft[qe+384+V]=ft[qe+0+V];for(V=0;16>V;++V,Ye<<=2)ft=me,qe=_e+ic[V],ea[Ae.Ob[V]](ft,qe),Ws(Ye,dt,16*+V,ft,qe)}else if(ft=No(ne,le,Ae.Ob[0]),Ji[ft](me,_e),Ye!=0)for(V=0;16>V;++V,Ye<<=2)Ws(Ye,dt,16*+V,me,_e+ic[V]);for(V=Ae.Gc,ft=No(ne,le,Ae.Dd),ma[ft](Se,Pe),ma[ft](De,Qe),Ye=dt,ft=Se,qe=Pe,255&(Ae=0|V)&&(170&Ae?ga(Ye,256,ft,qe):fn(Ye,256,ft,qe)),Ae=De,Ye=Qe,255&(V>>=8)&&(170&V?ga(dt,320,Ae,Ye):fn(dt,320,Ae,Ye)),le<P.Ub-1&&(r(He[Ze].y,0,me,_e+480,16),r(He[Ze].f,0,Se,Pe+224,8),r(He[Ze].ea,0,De,Qe+224,8)),V=8*pe*P.B,He=P.sa,Ze=P.ta+16*ne+16*pe*P.R,dt=P.qa,Ae=P.ra+8*ne+V,Ye=P.Ha,ft=P.Ia+8*ne+V,V=0;16>V;++V)r(He,Ze+V*P.R,me,_e+32*V,16);for(V=0;8>V;++V)r(dt,Ae+V*P.B,Se,Pe+32*V,8),r(Ye,ft+V*P.B,De,Qe+32*V,8)}}function Xa(P,I,V,ne,le,pe,me,_e,Se){var Pe=[0],De=[0],Qe=0,Ae=Se!=null?Se.kd:0,He=Se??new pt;if(P==null||12>V)return 7;He.data=P,He.w=I,He.ha=V,I=[I],V=[V],He.gb=[He.gb];e:{var Ze=I,dt=V,Ye=He.gb;if(t(P!=null),t(dt!=null),t(Ye!=null),Ye[0]=0,12<=dt[0]&&!n(P,Ze[0],"RIFF")){if(n(P,Ze[0]+8,"WEBP")){Ye=3;break e}var ft=tt(P,Ze[0]+4);if(12>ft||4294967286<ft){Ye=3;break e}if(Ae&&ft>dt[0]-8){Ye=7;break e}Ye[0]=ft,Ze[0]+=12,dt[0]-=12}Ye=0}if(Ye!=0)return Ye;for(ft=0<He.gb[0],V=V[0];;){e:{var qe=P;dt=I,Ye=V;var mt=Pe,vt=De,Yt=Ze=[0];if((qt=Qe=[Qe])[0]=0,8>Ye[0])Ye=7;else{if(!n(qe,dt[0],"VP8X")){if(tt(qe,dt[0]+4)!=10){Ye=3;break e}if(18>Ye[0]){Ye=7;break e}var zt=tt(qe,dt[0]+8),vn=1+ze(qe,dt[0]+12);if(2147483648<=vn*(qe=1+ze(qe,dt[0]+15))){Ye=3;break e}Yt!=null&&(Yt[0]=zt),mt!=null&&(mt[0]=vn),vt!=null&&(vt[0]=qe),dt[0]+=18,Ye[0]-=18,qt[0]=1}Ye=0}}if(Qe=Qe[0],Ze=Ze[0],Ye!=0)return Ye;if(dt=!!(2&Ze),!ft&&Qe)return 3;if(pe!=null&&(pe[0]=!!(16&Ze)),me!=null&&(me[0]=dt),_e!=null&&(_e[0]=0),me=Pe[0],Ze=De[0],Qe&&dt&&Se==null){Ye=0;break}if(4>V){Ye=7;break}if(ft&&Qe||!ft&&!Qe&&!n(P,I[0],"ALPH")){V=[V],He.na=[He.na],He.P=[He.P],He.Sa=[He.Sa];e:{zt=P,Ye=I,ft=V;var qt=He.gb;mt=He.na,vt=He.P,Yt=He.Sa,vn=22,t(zt!=null),t(ft!=null),qe=Ye[0];var Nn=ft[0];for(t(mt!=null),t(Yt!=null),mt[0]=null,vt[0]=null,Yt[0]=0;;){if(Ye[0]=qe,ft[0]=Nn,8>Nn){Ye=7;break e}var Gr=tt(zt,qe+4);if(4294967286<Gr){Ye=3;break e}var _n=8+Gr+1&-2;if(vn+=_n,0<qt&&vn>qt){Ye=3;break e}if(!n(zt,qe,"VP8 ")||!n(zt,qe,"VP8L")){Ye=0;break e}if(Nn[0]<_n){Ye=7;break e}n(zt,qe,"ALPH")||(mt[0]=zt,vt[0]=qe+8,Yt[0]=Gr),qe+=_n,Nn-=_n}}if(V=V[0],He.na=He.na[0],He.P=He.P[0],He.Sa=He.Sa[0],Ye!=0)break}V=[V],He.Ja=[He.Ja],He.xa=[He.xa];e:if(qt=P,Ye=I,ft=V,mt=He.gb[0],vt=He.Ja,Yt=He.xa,zt=Ye[0],qe=!n(qt,zt,"VP8 "),vn=!n(qt,zt,"VP8L"),t(qt!=null),t(ft!=null),t(vt!=null),t(Yt!=null),8>ft[0])Ye=7;else{if(qe||vn){if(qt=tt(qt,zt+4),12<=mt&&qt>mt-12){Ye=3;break e}if(Ae&&qt>ft[0]-8){Ye=7;break e}vt[0]=qt,Ye[0]+=8,ft[0]-=8,Yt[0]=vn}else Yt[0]=5<=ft[0]&&qt[zt+0]==47&&!(qt[zt+4]>>5),vt[0]=ft[0];Ye=0}if(V=V[0],He.Ja=He.Ja[0],He.xa=He.xa[0],I=I[0],Ye!=0)break;if(4294967286<He.Ja)return 3;if(_e==null||dt||(_e[0]=He.xa?2:1),me=[me],Ze=[Ze],He.xa){if(5>V){Ye=7;break}_e=me,Ae=Ze,dt=pe,P==null||5>V?P=0:5<=V&&P[I+0]==47&&!(P[I+4]>>5)?(ft=[0],qt=[0],mt=[0],re(vt=new z,P,I,V),Fa(vt,ft,qt,mt)?(_e!=null&&(_e[0]=ft[0]),Ae!=null&&(Ae[0]=qt[0]),dt!=null&&(dt[0]=mt[0]),P=1):P=0):P=0}else{if(10>V){Ye=7;break}_e=Ze,P==null||10>V||!so(P,I+3,V-3)?P=0:(Ae=P[I+0]|P[I+1]<<8|P[I+2]<<16,dt=16383&(P[I+7]<<8|P[I+6]),P=16383&(P[I+9]<<8|P[I+8]),1&Ae||3<(Ae>>1&7)||!(Ae>>4&1)||Ae>>5>=He.Ja||!dt||!P?P=0:(me&&(me[0]=dt),_e&&(_e[0]=P),P=1))}if(!P||(me=me[0],Ze=Ze[0],Qe&&(Pe[0]!=me||De[0]!=Ze)))return 3;Se!=null&&(Se[0]=He,Se.offset=I-Se.w,t(4294967286>I-Se.w),t(Se.offset==Se.ha-V));break}return Ye==0||Ye==7&&Qe&&Se==null?(pe!=null&&(pe[0]|=He.na!=null&&0<He.na.length),ne!=null&&(ne[0]=me),le!=null&&(le[0]=Ze),0):Ye}function yl(P,I,V){var ne=I.width,le=I.height,pe=0,me=0,_e=ne,Se=le;if(I.Da=P!=null&&0<P.Da,I.Da&&(_e=P.cd,Se=P.bd,pe=P.v,me=P.j,11>V||(pe&=-2,me&=-2),0>pe||0>me||0>=_e||0>=Se||pe+_e>ne||me+Se>le))return 0;if(I.v=pe,I.j=me,I.va=pe+_e,I.o=me+Se,I.U=_e,I.T=Se,I.da=P!=null&&0<P.da,I.da){if(!he(_e,Se,V=[P.ib],pe=[P.hb]))return 0;I.ib=V[0],I.hb=pe[0]}return I.ob=P!=null&&P.ob,I.Kb=P==null||!P.Sd,I.da&&(I.ob=I.ib<3*ne/4&&I.hb<3*le/4,I.Kb=0),1}function Bl(P){if(P==null)return 2;if(11>P.S){var I=P.f.RGBA;I.fb+=(P.height-1)*I.A,I.A=-I.A}else I=P.f.kb,P=P.height,I.O+=(P-1)*I.fa,I.fa=-I.fa,I.N+=(P-1>>1)*I.Ab,I.Ab=-I.Ab,I.W+=(P-1>>1)*I.Db,I.Db=-I.Db,I.F!=null&&(I.J+=(P-1)*I.lb,I.lb=-I.lb);return 0}function $i(P,I,V,ne){if(ne==null||0>=P||0>=I)return 2;if(V!=null){if(V.Da){var le=V.cd,pe=V.bd,me=-2&V.v,_e=-2&V.j;if(0>me||0>_e||0>=le||0>=pe||me+le>P||_e+pe>I)return 2;P=le,I=pe}if(V.da){if(!he(P,I,le=[V.ib],pe=[V.hb]))return 2;P=le[0],I=pe[0]}}ne.width=P,ne.height=I;e:{var Se=ne.width,Pe=ne.height;if(P=ne.S,0>=Se||0>=Pe||!(P>=Ul&&13>P))P=2;else{if(0>=ne.Rd&&ne.sd==null){me=pe=le=I=0;var De=(_e=Se*Vl[P])*Pe;if(11>P||(pe=(Pe+1)/2*(I=(Se+1)/2),P==12&&(me=(le=Se)*Pe)),(Pe=a(De+2*pe+me))==null){P=1;break e}ne.sd=Pe,11>P?((Se=ne.f.RGBA).eb=Pe,Se.fb=0,Se.A=_e,Se.size=De):((Se=ne.f.kb).y=Pe,Se.O=0,Se.fa=_e,Se.Fd=De,Se.f=Pe,Se.N=0+De,Se.Ab=I,Se.Cd=pe,Se.ea=Pe,Se.W=0+De+pe,Se.Db=I,Se.Ed=pe,P==12&&(Se.F=Pe,Se.J=0+De+2*pe),Se.Tc=me,Se.lb=le)}if(I=1,le=ne.S,pe=ne.width,me=ne.height,le>=Ul&&13>le)if(11>le)P=ne.f.RGBA,I&=(_e=Math.abs(P.A))*(me-1)+pe<=P.size,I&=_e>=pe*Vl[le],I&=P.eb!=null;else{P=ne.f.kb,_e=(pe+1)/2,De=(me+1)/2,Se=Math.abs(P.fa),Pe=Math.abs(P.Ab);var Qe=Math.abs(P.Db),Ae=Math.abs(P.lb),He=Ae*(me-1)+pe;I&=Se*(me-1)+pe<=P.Fd,I&=Pe*(De-1)+_e<=P.Cd,I=(I&=Qe*(De-1)+_e<=P.Ed)&Se>=pe&Pe>=_e&Qe>=_e,I&=P.y!=null,I&=P.f!=null,I&=P.ea!=null,le==12&&(I&=Ae>=pe,I&=He<=P.Tc,I&=P.F!=null)}else I=0;P=I?0:2}}return P!=0||V!=null&&V.fd&&(P=Bl(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,Qi=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,I,V){return I[V+0]},j.Predictor3=function(P,I,V){return I[V+1]},j.Predictor4=function(P,I,V){return I[V-1]},j.Predictor5=function(P,I,V){return ye(ye(P,I[V+1]),I[V+0])},j.Predictor6=function(P,I,V){return ye(P,I[V-1])},j.Predictor7=function(P,I,V){return ye(P,I[V+0])},j.Predictor8=function(P,I,V){return ye(I[V-1],I[V+0])},j.Predictor9=function(P,I,V){return ye(I[V+0],I[V+1])},j.Predictor10=function(P,I,V){return ye(ye(P,I[V-1]),ye(I[V+0],I[V+1]))},j.Predictor11=function(P,I,V){var ne=I[V+0];return 0>=Te(ne>>24&255,P>>24&255,(I=I[V-1])>>24&255)+Te(ne>>16&255,P>>16&255,I>>16&255)+Te(ne>>8&255,P>>8&255,I>>8&255)+Te(255&ne,255&P,255&I)?ne:P},j.Predictor12=function(P,I,V){var ne=I[V+0];return(xe((P>>24&255)+(ne>>24&255)-((I=I[V-1])>>24&255))<<24|xe((P>>16&255)+(ne>>16&255)-(I>>16&255))<<16|xe((P>>8&255)+(ne>>8&255)-(I>>8&255))<<8|xe((255&P)+(255&ne)-(255&I)))>>>0},j.Predictor13=function(P,I,V){var ne=I[V-1];return(Ie((P=ye(P,I[V+0]))>>24&255,ne>>24&255)<<24|Ie(P>>16&255,ne>>16&255)<<16|Ie(P>>8&255,ne>>8&255)<<8|Ie(255&P,255&ne))>>>0};var ds=j.PredictorAdd0;j.PredictorAdd1=Je,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;ct("ColorIndexInverseTransform","MapARGB","32b",function(P){return P>>8&255},function(P){return P}),ct("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(P){return P},function(P){return P>>8&255});var ri,Yo=j.ColorIndexInverseTransform,pi=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,nr,ms,vs,Vs,Nr,ga,Rn,fn,Pn,Mn,Za,Ys,ys,Xs,Ti,wl,bu,Qu,Qa,Gi,Ko,Ju,zl,Ic,jc=a(511),Dc=a(2041),Fc=a(225),Bc=a(767),zc=0,Zo=Dc,ql=Fc,Ri=Bc,mo=jc,Ul=0,Qo=1,jf=2,Hl=3,wu=4,gr=5,ec=6,$l=7,Ks=8,xu=9,_u=10,Su=[2,3,7],qc=[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],tc=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],nc=[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],Gl=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],rc=[[[[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]]]],Hc=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Ji=[],ea=[],ma=[],Mo=1,Eu=2,ta=[],Ra=[];Us("UpsampleRgbLinePair",Gs,3),Us("UpsampleBgrLinePair",Ei,3),Us("UpsampleRgbaLinePair",ha,4),Us("UpsampleBgraLinePair",Fl,4),Us("UpsampleArgbLinePair",Dl,4),Us("UpsampleRgba4444LinePair",Lo,2),Us("UpsampleRgb565LinePair",hs,2);var Ih=j.UpsampleRgbLinePair,jh=j.UpsampleBgrLinePair,Qs=j.UpsampleRgbaLinePair,ku=j.UpsampleBgraLinePair,ki=j.UpsampleArgbLinePair,Mi=j.UpsampleRgba4444LinePair,$c=j.UpsampleRgb565LinePair,bs=16,Io=1<<bs-1,rr=-227,lr=482,ws=6,Wi=0,va=a(256),_l=a(256),Wl=a(256),ya=a(256),Au=a(lr-rr),Bf=a(lr-rr);po("YuvToRgbRow",Gs,3),po("YuvToBgrRow",Ei,3),po("YuvToRgbaRow",ha,4),po("YuvToBgraRow",Fl,4),po("YuvToArgbRow",Dl,4),po("YuvToRgba4444Row",Lo,2),po("YuvToRgb565Row",hs,2);var ic=[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,I,V,ne,le){var pe=Qo,me=new ht,_e=new on;me.ba=_e,_e.S=pe,_e.width=[_e.width],_e.height=[_e.height];var Se=_e.width,Pe=_e.height,De=new Ht;if(De==null||P==null)var Qe=2;else t(De!=null),Qe=Xa(P,I,V,De.width,De.height,De.Pd,De.Qd,De.format,null);if(Qe!=0?Se=0:(Se!=null&&(Se[0]=De.width[0]),Pe!=null&&(Pe[0]=De.height[0]),Se=1),Se){_e.width=_e.width[0],_e.height=_e.height[0],ne!=null&&(ne[0]=_e.width),le!=null&&(le[0]=_e.height);e:{if(ne=new oo,(le=new pt).data=P,le.w=I,le.ha=V,le.kd=1,I=[0],t(le!=null),((P=Xa(le.data,le.w,le.ha,null,null,null,I,null,le))==0||P==7)&&I[0]&&(P=4),(I=P)==0){if(t(me!=null),ne.data=le.data,ne.w=le.w+le.offset,ne.ha=le.ha-le.offset,ne.put=Qt,ne.ac=dr,ne.bc=zi,ne.ma=me,le.xa){if((P=Wo())==null){me=1;break e}if((function(Ae,He){var Ze=[0],dt=[0],Ye=[0];t:for(;;){if(Ae==null)return 0;if(He==null)return Ae.a=2,0;if(Ae.l=He,Ae.a=0,re(Ae.m,He.data,He.w,He.ha),!Fa(Ae.m,Ze,dt,Ye)){Ae.a=3;break t}if(Ae.xb=Eu,He.width=Ze[0],He.height=dt[0],!qi(Ze[0],dt[0],1,Ae,null))break t;return 1}return t(Ae.a!=0),0})(P,ne)){if(ne=(I=$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,Hl)){ne.a=2;break n}if(!ao(ne,V.width)||V.da)break n;if((V.da||Et(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&&!ge(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&&(I=P.a)}else I=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,Hi(P,ne)){if((I=$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<(Se=0>(Se=V.Md)?0:100<Se?255:255*Se/100)){for(Pe=De=0;4>Pe;++Pe)12>(Qe=le.pb[Pe]).lc&&(Qe.ia=Se*Dh[0>Qe.lc?0:Qe.lc]>>3),De|=Qe.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,He){if(Ae==null)return 0;if(He==null)return Gn(Ae,2,"NULL VP8Io parameter in VP8Decode().");if(!Ae.cb&&!Hi(Ae,He))return 0;if(t(Ae.cb),He.ac==null||He.ac(He)){He.ob&&(Ae.L=0);var Ze=xs[Ae.L];if(Ae.L==2?(Ae.yb=0,Ae.zb=0):(Ae.yb=He.v-Ze>>4,Ae.zb=He.j-Ze>>4,0>Ae.yb&&(Ae.yb=0),0>Ae.zb&&(Ae.zb=0)),Ae.Va=He.o+15+Ze>>4,Ae.Hb=He.va+15+Ze>>4,Ae.Hb>Ae.za&&(Ae.Hb=Ae.za),Ae.Va>Ae.Ub&&(Ae.Va=Ae.Ub),0<Ae.L){var dt=Ae.ed;for(Ze=0;4>Ze;++Ze){var Ye;if(Ae.Qa.Cb){var ft=Ae.Qa.Lb[Ze];Ae.Qa.Fb||(ft+=dt.Tb)}else ft=dt.Tb;for(Ye=0;1>=Ye;++Ye){var qe=Ae.gd[Ze][Ye],mt=ft;if(dt.Pc&&(mt+=dt.vd[0],Ye&&(mt+=dt.od[0])),0<(mt=0>mt?0:63<mt?63:mt)){var vt=mt;0<dt.wb&&(vt=4<dt.wb?vt>>2:vt>>1)>9-dt.wb&&(vt=9-dt.wb),1>vt&&(vt=1),qe.dd=vt,qe.tc=2*mt+vt,qe.ld=40<=mt?2:15<=mt?1:0}else qe.tc=0;qe.La=Ye}}}Ze=0}else Gn(Ae,6,"Frame setup failed"),Ze=Ae.a;if(Ze=Ze==0){if(Ze){Ae.$c=0,0<Ae.Aa||(Ae.Ic=_s);t:{Ze=Ae.Ic,dt=4*(vt=Ae.za);var Yt=32*vt,zt=vt+1,vn=0<Ae.L?vt*(0<Ae.Aa?2:1):0,qt=(Ae.Aa==2?2:1)*vt;if((qe=dt+832+(Ye=3*(16*Ze+xs[Ae.L])/2*Yt)+(ft=Ae.Fa!=null&&0<Ae.Fa.length?Ae.Kc.c*Ae.Kc.i:0))!=qe)Ze=0;else{if(qe>Ae.Vb){if(Ae.Vb=0,Ae.Ec=a(qe),Ae.Fc=0,Ae.Ec==null){Ze=Gn(Ae,1,"no memory during frame initialization.");break t}Ae.Vb=qe}qe=Ae.Ec,mt=Ae.Fc,Ae.Ac=qe,Ae.Bc=mt,mt+=dt,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=qe,Ae.pc=mt,mt+=832,Ae.ya=o(qt,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=qe,Ae.ta=mt+vt,Ae.qa=Ae.sa,Ae.ra=Ae.ta+16*Ze*Ae.R+Yt,Ae.Ha=Ae.qa,Ae.Ia=Ae.ra+8*Ze*Ae.B+Yt,Ae.$c=0,mt+=Ye,Ae.mb=ft?qe:null,Ae.nb=ft?mt:null,t(mt+ft<=Ae.Fc+Ae.Vb),ls(Ae),i(Ae.Ac,Ae.Bc,0,dt),Ze=1}}if(Ze){if(He.ka=0,He.y=Ae.sa,He.O=Ae.ta,He.f=Ae.qa,He.N=Ae.ra,He.ea=Ae.Ha,He.Vd=Ae.Ia,He.fa=Ae.R,He.Rc=Ae.B,He.F=null,He.J=0,!zc){for(Ze=-255;255>=Ze;++Ze)jc[255+Ze]=0>Ze?-Ze:Ze;for(Ze=-1020;1020>=Ze;++Ze)Dc[1020+Ze]=-128>Ze?-128:127<Ze?127:Ze;for(Ze=-112;112>=Ze;++Ze)Fc[112+Ze]=-16>Ze?-16:15<Ze?15:Ze;for(Ze=-255;510>=Ze;++Ze)Bc[255+Ze]=0>Ze?0:255<Ze?255:Ze;zc=1}vs=cs,Vs=Ml,ga=us,Rn=gu,fn=jn,Nr=Ca,Pn=ni,Mn=_i,Za=ce,Ys=Oe,ys=Va,Xs=H,Ti=je,wl=$e,bu=Wa,Qu=fo,Qa=ml,Gi=fs,ea[0]=Mc,ea[1]=dl,ea[2]=Co,ea[3]=Rc,ea[4]=uo,ea[5]=mu,ea[6]=Er,ea[7]=vu,ea[8]=Zu,ea[9]=Bs,Ji[0]=za,Ji[1]=Tc,Ji[2]=pl,Ji[3]=Il,Ji[4]=qa,Ji[5]=Ua,Ji[6]=Ln,ma[0]=yu,ma[1]=Nc,ma[2]=Ha,ma[3]=fa,ma[4]=co,ma[5]=La,ma[6]=zs,Ze=1}else Ze=0}Ze&&(Ze=(function(Nn,Gr){for(Nn.M=0;Nn.M<Nn.Va;++Nn.M){var _n,Bt=Nn.Jc[Nn.M&Nn.Xb],kt=Nn.m,Wr=Nn;for(_n=0;_n<Wr.za;++_n){var $t=kt,yn=Wr,Fn=yn.Ac,Ai=yn.Bc+4*_n,gi=yn.zc,Wn=yn.ya[yn.aa+_n];if(yn.Qa.Bb?Wn.$b=we($t,yn.Pa.jb[0])?2+we($t,yn.Pa.jb[2]):we($t,yn.Pa.jb[1]):Wn.$b=0,yn.kc&&(Wn.Ad=we($t,yn.Bd)),Wn.Za=!we($t,145)+0,Wn.Za){var Pi=Wn.Ob,wr=0;for(yn=0;4>yn;++yn){var Br,In=gi[0+yn];for(Br=0;4>Br;++Br){In=Rh[Fn[Ai+Br]][In];for(var Yn=Uc[we($t,In[0])];0<Yn;)Yn=Uc[2*Yn+we($t,In[Yn])];In=-Yn,Fn[Ai+Br]=In}r(Pi,wr,Fn,Ai,4),wr+=4,gi[0+yn]=In}}else In=we($t,156)?we($t,128)?1:3:we($t,163)?2:0,Wn.Ob[0]=In,i(Fn,Ai,In,4),i(gi,0,In,4);Wn.Dd=we($t,142)?we($t,114)?we($t,183)?1:3:2:0}if(Wr.m.Ka)return Gn(Nn,7,"Premature end-of-partition0 encountered.");for(;Nn.ja<Nn.za;++Nn.ja){if(Wr=Bt,$t=(kt=Nn).rb[kt.sb-1],Fn=kt.rb[kt.sb+kt.ja],_n=kt.ya[kt.aa+kt.ja],Ai=kt.kc?_n.Ad:0)$t.la=Fn.la=0,_n.Za||($t.Na=Fn.Na=0),_n.Hc=0,_n.Gc=0,_n.ia=0;else{var Tr,Xn;if($t=Fn,Fn=Wr,Ai=kt.Pa.Xc,gi=kt.ya[kt.aa+kt.ja],Wn=kt.pb[gi.$b],yn=gi.ad,Pi=0,wr=kt.rb[kt.sb-1],In=Br=0,i(yn,Pi,0,384),gi.Za)var Rr=0,Mr=Ai[3];else{Yn=a(16);var ir=$t.Na+wr.Na;if(ir=Gl(Fn,Ai[1],ir,Wn.Eb,0,Yn,0),$t.Na=wr.Na=(0<ir)+0,1<ir)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&$t.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=(ir=Gl(Fn,Mr,ir=ii+(1&Jn),Wn.Sc,Rr,yn,Pi))>Rr)<<7,Xn=Xn<<2|(3<ir?3:1<ir?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=$t.la>>4+Tr,er=wr.la>>4+Tr,Yn=0;2>Yn;++Yn){for(ii=1&er,Ii=0;2>Ii;++Ii)ir=ii+(1&Jn),Jn=Jn>>1|(ii=0<(ir=Gl(Fn,Ai[2],ir,Wn.Qc,0,yn,Pi)))<<3,Xn=Xn<<2|(3<ir?3:1<ir?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}$t.la=Mr,wr.la=Rr,gi.Hc=Br,gi.Gc=In,gi.ia=43690&In?0:Wn.ia,Ai=!(Br|In)}if(0<kt.L&&(kt.wa[kt.Y+kt.ja]=kt.gd[_n.$b][_n.Za],kt.wa[kt.Y+kt.ja].La|=!Ai),Wr.Ka)return Gn(Nn,7,"Premature end-of-file encountered.")}if(ls(Nn),kt=Gr,Wr=1,_n=(Bt=Nn).D,$t=0<Bt.L&&Bt.M>=Bt.zb&&Bt.M<=Bt.Va,Bt.Aa==0)t:{if(_n.M=Bt.M,_n.uc=$t,Fr(Bt,_n),Wr=1,_n=(Xn=Bt.D).Nb,$t=(In=xs[Bt.L])*Bt.R,Fn=In/2*Bt.B,Yn=16*_n*Bt.R,Ii=8*_n*Bt.B,Ai=Bt.sa,gi=Bt.ta-$t+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=(ir=Bt).D.M,t(ir.D.uc),Xn=ir.yb;Xn<ir.Hb;++Xn){Rr=Xn,Mr=ii;var ji=(ba=(On=ir).D).Nb;Tr=On.R;var ba=ba.wa[ba.Y+Rr],ai=On.sa,Vr=On.ta+16*ji*Tr+16*Rr,wa=ba.dd,ar=ba.tc;if(ar!=0)if(t(3<=ar),On.L==1)0<Rr&&Qu(ai,Vr,Tr,ar+4),ba.La&&Gi(ai,Vr,Tr,ar),0<Mr&&bu(ai,Vr,Tr,ar+4),ba.La&&Qa(ai,Vr,Tr,ar);else{var Vi=On.B,Kn=On.qa,dn=On.ra+8*ji*Vi+8*Rr,Bn=On.Ha,On=On.Ia+8*ji*Vi+8*Rr;ji=ba.ld,0<Rr&&(Mn(ai,Vr,Tr,ar+4,wa,ji),Ys(Kn,dn,Bn,On,Vi,ar+4,wa,ji)),ba.La&&(Xs(ai,Vr,Tr,ar,wa,ji),wl(Kn,dn,Bn,On,Vi,ar,wa,ji)),0<Mr&&(Pn(ai,Vr,Tr,ar+4,wa,ji),Za(Kn,dn,Bn,On,Vi,ar+4,wa,ji)),ba.La&&(ys(ai,Vr,Tr,ar,wa,ji),Ti(Kn,dn,Bn,On,Vi,ar,wa,ji))}}if(Bt.ia&&alert("todo:DitherRow"),kt.put!=null){if(Xn=16*Jn,Jn=16*(Jn+1),er?(kt.y=Bt.sa,kt.O=Bt.ta+Yn,kt.f=Bt.qa,kt.N=Bt.ra+Ii,kt.ea=Bt.Ha,kt.W=Bt.Ia+Ii):(Xn-=In,kt.y=Ai,kt.O=gi,kt.f=Wn,kt.N=yn,kt.ea=Pi,kt.W=wr),Br||(Jn-=In),Jn>kt.o&&(Jn=kt.o),kt.F=null,kt.J=null,Bt.Fa!=null&&0<Bt.Fa.length&&Xn<Jn&&(kt.J=sr(Bt,kt,Xn,Jn-Xn),kt.F=Bt.mb,kt.F==null&&kt.F.length==0)){Wr=Gn(Bt,3,"Could not decode alpha data.");break t}Xn<kt.j&&(In=kt.j-Xn,Xn=kt.j,t(!(1&In)),kt.O+=Bt.R*In,kt.N+=Bt.B*(In>>1),kt.W+=Bt.B*(In>>1),kt.F!=null&&(kt.J+=kt.width*In)),Xn<Jn&&(kt.O+=kt.v,kt.N+=kt.v>>1,kt.W+=kt.v>>1,kt.F!=null&&(kt.J+=kt.v),kt.ka=Xn-kt.j,kt.U=kt.va-kt.v,kt.T=Jn-Xn,Wr=kt.put(kt))}_n+1!=Bt.Ic||Br||(r(Bt.sa,Bt.ta-$t,Ai,gi+16*Bt.R,$t),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(!Wr)return Gn(Nn,6,"Output aborted.")}return 1})(Ae,He)),He.bc!=null&&He.bc(He),Ze&=1}return Ze?(Ae.cb=0,Ze):0})(P,ne)||(I=P.a)}}else I=P.a}I==0&&me.Oa!=null&&me.Oa.fd&&(I=Bl(me.ba))}me=I}pe=me!=0?null:11>pe?_e.f.RGBA.eb:_e.f.kb.y}else pe=null;return pe};var Vl=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function h(j,D){for(var L="",T=0;T<4;T++)L+=String.fromCharCode(j[D++]);return L}function c(j,D){return j[D+0]|j[D+1]<<8}function p(j,D){return(j[D+0]|j[D+1]<<8|j[D+2]<<16)>>>0}function m(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],w=[],x=new u,b=e,S=(function(j,D){var L={},T=0,$=!1,U=0,te=0;if(L.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(m(j,D+=4),D+=8;D<j.length;){var se=h(j,D),ee=m(j,D+=4);D+=4;var Q=ee+(1&ee);switch(se){case"VP8 ":case"VP8L":L.frames[T]===void 0&&(L.frames[T]={}),(B=L.frames[T]).src_off=$?te:D-8,B.src_size=U+ee+8,T++,$&&($=!1,U=0,te=0);break;case"VP8X":(B=L.header={}).feature_flags=j[D];var re=D+4;B.canvas_width=1+p(j,re),re+=3,B.canvas_height=1+p(j,re),re+=3;break;case"ALPH":$=!0,U=Q+8,te=D-8;break;case"ANIM":(B=L.header).bgcolor=m(j,D),re=D+4,B.loop_count=c(j,re),re+=2;break;case"ANMF":var X,B;(B=L.frames[T]={}).offset_x=2*p(j,D),D+=3,B.offset_y=2*p(j,D),D+=3,B.width=1+p(j,D),D+=3,B.height=1+p(j,D),D+=3,B.duration=p(j,D),D+=3,X=j[D++],B.dispose=1&X,B.blend=X>>1&1}se!="ANMF"&&(D+=Q)}return L}})(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 M=E[0],O=x.WebPDecodeRGBA(b,M.src_off,M.src_size,y,d);M.rgba=O,M.imgwidth=y[0],M.imgheight=d[0];for(var R=0;R<y[0]*d[0]*4;R++)w[R]=O[R];return this.width=y,this.height=d,this.data=w,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 p(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 p=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(ge){Y=!!ge}});var J=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return J},set:function(ge){J=!!ge}});var K=0;Object.defineProperty(this,"posX",{get:function(){return K},set:function(ge){isNaN(ge)||(K=ge)}});var ie=0;Object.defineProperty(this,"posY",{get:function(){return ie},set:function(ge){isNaN(ge)||(ie=ge)}}),Object.defineProperty(this,"margin",{get:function(){return h.margin},set:function(ge){var ut;typeof ge=="number"?ut=[ge,ge,ge,ge]:((ut=new Array(4))[0]=ge[0],ut[1]=ge.length>=2?ge[1]:ut[0],ut[2]=ge.length>=3?ge[2]:ut[0],ut[3]=ge.length>=4?ge[3]:ut[1]),h.margin=ut}});var fe=!1;Object.defineProperty(this,"autoPaging",{get:function(){return fe},set:function(ge){fe=ge}});var ue=0;Object.defineProperty(this,"lastBreak",{get:function(){return ue},set:function(ge){ue=ge}});var we=[];Object.defineProperty(this,"pageBreaks",{get:function(){return we},set:function(ge){we=ge}}),Object.defineProperty(this,"ctx",{get:function(){return h},set:function(ge){ge instanceof c&&(h=ge)}}),Object.defineProperty(this,"path",{get:function(){return h.path},set:function(ge){h.path=ge}});var Ce=[];Object.defineProperty(this,"ctxStack",{get:function(){return Ce},set:function(ge){Ce=ge}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(ge){var ut;ut=m(ge),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(ge){var ut=m(ge);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(ge){["butt","round","square"].indexOf(ge)!==-1&&(this.ctx.lineCap=ge,this.pdf.setLineCap(ge))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(ge){isNaN(ge)||(this.ctx.lineWidth=ge,this.pdf.setLineWidth(ge))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(ge){["bevel","round","miter"].indexOf(ge)!==-1&&(this.ctx.lineJoin=ge,this.pdf.setLineJoin(ge))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(ge){isNaN(ge)||(this.ctx.miterLimit=ge,this.pdf.setMiterLimit(ge))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(ge){this.ctx.textBaseline=ge}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(ge){["right","end","center","left","start"].indexOf(ge)!==-1&&(this.ctx.textAlign=ge)}});var Ue=null,ze=null,tt=null;Object.defineProperty(this,"fontFaces",{get:function(){return tt},set:function(ge){Ue=null,ze=null,tt=ge}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(ge){var ut;if(this.ctx.font=ge,(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(ge))!==null){var ke=ut[1];ut[2];var he=ut[3],be=ut[4];ut[5];var Le=ut[6],Me=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(be)[2];be=Math.floor(Me==="px"?parseFloat(be)*this.pdf.internal.scaleFactor:Me==="em"?parseFloat(be)*this.pdf.getFontSize():parseFloat(be)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(be);var ve=(function(ct){var Ct,rn,Zt=[],an=ct.trim();if(an==="")return Vm;if(an in Gw)return[Gw[an]];for(;an!=="";){switch(rn=null,Ct=(an=Vw(an)).charAt(0)){case'"':case"'":rn=pj(an.substring(1),Ct);break;default:rn=gj(an)}if(rn===null||(Zt.push(rn[0]),(an=Vw(rn[1]))!==""&&an.charAt(0)!==","))return Vm;an=an.replace(/^,/,"")}return Zt})(Le);if(this.fontFaces){var ye=(function(ct,Ct){var rn=ct.getFontList(),Zt=JSON.stringify(rn);if(Ue===null||ze!==Zt){var an=(function(We){var Be=[];return Object.keys(We).forEach(function(Wt){We[Wt].forEach(function(Et){var Nt=null;switch(Et){case"bold":Nt={family:Wt,weight:"bold"};break;case"italic":Nt={family:Wt,style:"italic"};break;case"bolditalic":Nt={family:Wt,weight:"bold",style:"italic"};break;case"":case"normal":Nt={family:Wt}}Nt!==null&&(Nt.ref={name:Wt,style:Et},Be.push(Nt))})}),Be})(rn);Ue=(function(We){for(var Be={},Wt=0;Wt<We.length;++Wt){var Et=Wm(We[Wt]),Nt=Et.family,Tt=Et.stretch,on=Et.style,Ht=Et.weight;Be[Nt]=Be[Nt]||{},Be[Nt][Tt]=Be[Nt][Tt]||{},Be[Nt][Tt][on]=Be[Nt][Tt][on]||{},Be[Nt][Tt][on][Ht]=Et}return Be})(an.concat(Ct)),ze=Zt}return Ue})(this.pdf,this.fontFaces),xe=ve.map(function(ct){return{family:ct,stretch:"normal",weight:he,style:ke}}),Ie=(function(ct,Ct,rn){for(var Zt=(rn=rn||{}).defaultFontFamily||"times",an=Object.assign({},dj,rn.genericFontFamilies||{}),We=null,Be=null,Wt=0;Wt<Ct.length;++Wt)if(an[(We=Wm(Ct[Wt])).family]&&(We.family=an[We.family]),ct.hasOwnProperty(We.family)){Be=ct[We.family];break}if(!(Be=Be||ct[Zt]))throw new Error("Could not find a font-family for the rule '"+Ww(We)+"' and default family '"+Zt+"'.");if(Be=(function(Et,Nt){if(Nt[Et])return Nt[Et];var Tt=Uv[Et],on=Tt<=Uv.normal?-1:1,Ht=$w(Nt,__,Tt,on);if(!Ht)throw new Error("Could not find a matching font-stretch value for "+Et);return Ht})(We.stretch,Be),Be=(function(Et,Nt){if(Nt[Et])return Nt[Et];for(var Tt=x_[Et],on=0;on<Tt.length;++on)if(Nt[Tt[on]])return Nt[Tt[on]];throw new Error("Could not find a matching font-style for "+Et)})(We.style,Be),!(Be=(function(Et,Nt){if(Nt[Et])return Nt[Et];if(Et===400&&Nt[500])return Nt[500];if(Et===500&&Nt[400])return Nt[400];var Tt=hj[Et],on=$w(Nt,S_,Tt,Et<400?-1:1);if(!on)throw new Error("Could not find a matching font-weight for value "+Et);return on})(We.weight,Be)))throw new Error("Failed to resolve a font for the rule '"+Ww(We)+"'.");return Be})(ye,xe);this.pdf.setFont(Ie.ref.name,Ie.ref.style)}else{var Te="";(he==="bold"||parseInt(he,10)>=700||ke==="bold")&&(Te="bold"),ke==="italic"&&(Te+="italic"),Te.length===0&&(Te="normal");for(var Je="",nt={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"},st=0;st<ve.length;st++){if(this.pdf.internal.getFont(ve[st],Te,{noFallback:!0,disableWarning:!0})!==void 0){Je=ve[st];break}if(Te==="bolditalic"&&this.pdf.internal.getFont(ve[st],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Je=ve[st],Te="bold";else if(this.pdf.internal.getFont(ve[st],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Je=ve[st],Te="normal";break}}if(Je===""){for(var at=0;at<ve.length;at++)if(nt[ve[at]]){Je=nt[ve[at]];break}}Je=Je===""?"Times":Je,this.pdf.setFont(Je,Te)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(ge){this.ctx.globalCompositeOperation=ge}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(ge){this.ctx.globalAlpha=ge}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(ge){this.ctx.lineDashOffset=ge,B.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(ge){this.ctx.lineDash=ge,B.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(ge){this.ctx.ignoreClearRect=!!ge}})};p.prototype.setLineDash=function(F){this.lineDash=F},p.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},p.prototype.fill=function(){E.call(this,"fill",!1)},p.prototype.stroke=function(){E.call(this,"stroke",!1)},p.prototype.beginPath=function(){this.path=[{type:"begin"}]},p.prototype.moveTo=function(F,z){if(isNaN(F)||isNaN(z))throw Qr.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)},p.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)},p.prototype.lineTo=function(F,z){if(isNaN(F)||isNaN(z))throw Qr.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)},p.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),E.call(this,null,!0)},p.prototype.quadraticCurveTo=function(F,z,Y,J){if(isNaN(Y)||isNaN(J)||isNaN(F)||isNaN(z))throw Qr.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)},p.prototype.bezierCurveTo=function(F,z,Y,J,K,ie){if(isNaN(K)||isNaN(ie)||isNaN(F)||isNaN(z)||isNaN(Y)||isNaN(J))throw Qr.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)),we=this.ctx.transform.applyToPoint(new o(Y,J));this.path.push({type:"bct",x1:ue.x,y1:ue.y,x2:we.x,y2:we.y,x:fe.x,y:fe.y}),this.ctx.lastPoint=new o(fe.x,fe.y)},p.prototype.arc=function(F,z,Y,J,K,ie){if(isNaN(F)||isNaN(z)||isNaN(Y)||isNaN(J)||isNaN(K))throw Qr.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)),we=this.ctx.transform.applyToPoint(new o(0,0));Y=Math.sqrt(Math.pow(ue.x-we.x,2)+Math.pow(ue.y-we.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})},p.prototype.arcTo=function(F,z,Y,J,K){throw new Error("arcTo not implemented.")},p.prototype.rect=function(F,z,Y,J){if(isNaN(F)||isNaN(z)||isNaN(Y)||isNaN(J))throw Qr.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)},p.prototype.fillRect=function(F,z,Y,J){if(isNaN(F)||isNaN(z)||isNaN(Y)||isNaN(J))throw Qr.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)}},p.prototype.strokeRect=function(F,z,Y,J){if(isNaN(F)||isNaN(z)||isNaN(Y)||isNaN(J))throw Qr.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())},p.prototype.clearRect=function(F,z,Y,J){if(isNaN(F)||isNaN(z)||isNaN(Y)||isNaN(J))throw Qr.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))},p.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}},p.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)},p.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var m=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 p_(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)};p.prototype.fillText=function(F,z,Y,J){if(isNaN(z)||isNaN(Y)||typeof F!="string")throw Qr.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;T.call(this,{text:F,x:z,y:Y,scale:ie,angle:K,align:this.textAlign,maxWidth:J})}},p.prototype.strokeText=function(F,z,Y,J){if(isNaN(z)||isNaN(Y)||typeof F!="string")throw Qr.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;T.call(this,{text:F,x:z,y:Y,scale:ie,renderingMode:"stroke",angle:K,align:this.textAlign,maxWidth:J})}},p.prototype.measureText=function(F){if(typeof F!="string")throw Qr.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})},p.prototype.scale=function(F,z){if(isNaN(F)||isNaN(z))throw Qr.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)},p.prototype.rotate=function(F){if(isNaN(F))throw Qr.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)},p.prototype.translate=function(F,z){if(isNaN(F)||isNaN(z))throw Qr.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)},p.prototype.transform=function(F,z,Y,J,K,ie){if(isNaN(F)||isNaN(z)||isNaN(Y)||isNaN(J)||isNaN(K)||isNaN(ie))throw Qr.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)},p.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 w=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};p.prototype.drawImage=function(F,z,Y,J,K,ie,fe,ue,we){var Ce=this.pdf.getImageProperties(F),Ue=1,ze=1,tt=1,ge=1;J!==void 0&&ue!==void 0&&(tt=ue/J,ge=we/K,Ue=Ce.width/J*ue/J,ze=Ce.height/K*we/K),ie===void 0&&(ie=z,fe=Y,z=0,Y=0),J!==void 0&&ue===void 0&&(ue=J,we=K),J===void 0&&ue===void 0&&(ue=Ce.width,we=Ce.height);var ut=this.ctx.transform.decompose(),ke=Q(ut.rotate.shx),he=new u,be=(he=(he=(he=he.multiply(ut.translate)).multiply(ut.skew)).multiply(ut.scale)).applyToRectangle(new s(ie-z*tt,fe-Y*ge,J*Ue,K*ze));if(this.autoPaging){for(var Le,Me=x.call(this,be),ve=[],ye=0;ye<Me.length;ye+=1)ve.indexOf(Me[ye])===-1&&ve.push(Me[ye]);k(ve);for(var xe=ve[0],Ie=ve[ve.length-1],Te=xe;Te<Ie+1;Te++){this.pdf.setPage(Te);var Je=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],nt=Te===1?this.posY+this.margin[0]:this.margin[0],st=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],at=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],ct=Te===1?0:st+(Te-2)*at;if(this.ctx.clip_path.length!==0){var Ct=this.path;Le=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=S(Le,this.posX+this.margin[3],-ct+nt+this.ctx.prevPageLastElemOffset),A.call(this,"fill",!0),this.path=Ct}var rn=JSON.parse(JSON.stringify(be));rn=S([rn],this.posX+this.margin[3],-ct+nt+this.ctx.prevPageLastElemOffset)[0];var Zt=(Te>xe||Te<Ie)&&w.call(this);Zt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Je,at,null).clip().discardPath()),this.pdf.addImage(F,"JPEG",rn.x,rn.y,rn.w,rn.h,null,null,ke),Zt&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(F,"JPEG",be.x,be.y,be.w,be.h,null,null,ke)};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 we,Ce,Ue=JSON.parse(JSON.stringify(this.path)),ze=JSON.parse(JSON.stringify(this.path)),tt=[],ge=0;ge<ze.length;ge++)if(ze[ge].x!==void 0)for(var ut=x.call(this,ze[ge]),ke=0;ke<ut.length;ke+=1)tt.indexOf(ut[ke])===-1&&tt.push(ut[ke]);for(var he=0;he<tt.length;he++)for(;this.pdf.internal.getNumberOfPages()<tt[he];)b.call(this);k(tt);for(var be=tt[0],Le=tt[tt.length-1],Me=be;Me<Le+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],xe=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ie=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],Te=Me===1?0:xe+(Me-2)*Ie;if(this.ctx.clip_path.length!==0){var Je=this.path;we=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=S(we,this.posX+this.margin[3],-Te+ye+this.ctx.prevPageLastElemOffset),A.call(this,F,!0),this.path=Je}if(Ce=JSON.parse(JSON.stringify(Ue)),this.path=S(Ce,this.posX+this.margin[3],-Te+ye+this.ctx.prevPageLastElemOffset),z===!1||Me===0){var nt=(Me>be||Me<Le)&&w.call(this);nt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ve,Ie,null).clip().discardPath()),A.call(this,F,z),nt&&this.pdf.restoreGraphicsState()}this.lineWidth=ie}this.path=Ue}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 we=K.length;if(ie[fe-1]&&!isNaN(ie[fe-1].x)&&(Y=[ue.x-ie[fe-1].x,ue.y-ie[fe-1].y],we>0)){for(;we>=0;we--)if(K[we-1].close!==!0&&K[we-1].begin!==!0){K[we-1].deltas.push(Y),K[we-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),Ue=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),ge=ue.x,ut=ue.y;Y=[Ce-ie[fe-1].x,Ue-ie[fe-1].y,ze-ie[fe-1].x,tt-ie[fe-1].y,ge-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 ke=!1,he=0;he<K.length;he++)if(K[he].arc)for(var be=K[he].abs,Le=0;Le<be.length;Le++){var Me=be[Le];Me.type==="arc"?R.call(this,Me.x,Me.y,Me.radius,Me.startAngle,Me.endAngle,Me.counterclockwise,void 0,z,!ke):$.call(this,Me.x,Me.y),ke=!0}else if(K[he].close===!0)this.pdf.internal.out("h"),ke=!1;else if(K[he].begin!==!0){var ve=K[he].start.x,ye=K[he].start.y;U.call(this,K[he].deltas,ve,ye),ke=!0}J&&j.call(this,J),z&&D.call(this)}},M=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)};p.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},p.prototype.createPattern=function(){return this.createLinearGradient()},p.prototype.createRadialGradient=function(){return this.createLinearGradient()};var R=function(F,z,Y,J,K,ie,fe,ue,we){for(var Ce=se.call(this,Y,J,K,ie),Ue=0;Ue<Ce.length;Ue++){var ze=Ce[Ue];Ue===0&&(we?L.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()},L=function(F,z){this.pdf.internal.out(n(F)+" "+r(z)+" m")},T=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=M.call(this,F.y),ue=O.call(this,fe)-ie.h,we=this.ctx.transform.applyToPoint(new o(F.x,fe));if(this.autoPaging){var Ce=this.ctx.transform.decompose(),Ue=new u;Ue=(Ue=(Ue=Ue.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=Ue.applyToRectangle(new s(F.x,ue,ie.w,ie.h)),ge=x.call(this,tt),ut=[],ke=0;ke<ge.length;ke+=1)ut.indexOf(ge[ke])===-1&&ut.push(ge[ke]);k(ut);for(var he=ut[0],be=ut[ut.length-1],Le=he;Le<be+1;Le++){this.pdf.setPage(Le);var Me=Le===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],xe=ye-this.margin[0],Ie=this.pdf.internal.pageSize.width-this.margin[1],Te=Ie-this.margin[3],Je=Le===1?0:ve+(Le-2)*xe;if(this.ctx.clip_path.length!==0){var nt=this.path;Y=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=S(Y,this.posX+this.margin[3],-1*Je+Me),A.call(this,"fill",!0),this.path=nt}var st=S([JSON.parse(JSON.stringify(tt))],this.posX+this.margin[3],-Je+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 at=this.autoPaging!=="text";if(at||st.y+st.h<=ye){if(at||st.y>=Me&&st.x<=Ie){var ct=at?F.text:this.pdf.splitTextToSize(F.text,F.maxWidth||Ie-st.x)[0],Ct=S([JSON.parse(JSON.stringify(ze))],this.posX+this.margin[3],-Je+Me+this.ctx.prevPageLastElemOffset)[0],rn=at&&(Le>he||Le<be)&&w.call(this);rn&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Te,xe,null).clip().discardPath()),this.pdf.text(ct,Ct.x,Ct.y,{angle:F.angle,align:z,renderingMode:F.renderingMode}),rn&&this.pdf.restoreGraphicsState()}}else st.y<ye&&(this.ctx.prevPageLastElemOffset+=ye-st.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,we.x+this.posX,we.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")},U=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=[],we=J?-1:1,Ce=z;fe>1e-5;){var Ue=Ce+we*Math.min(fe,ie);ue.push(ee.call(this,F,Ce,Ue)),fe-=Math.abs(Ue-Ce),Ce=Ue}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,we=fe*fe+ue*ue,Ce=we+fe*K+ue*ie,Ue=4/3*(Math.sqrt(2*we*Ce)-Ce)/(fe*ie-ue*K),ze=fe-Ue*ue,tt=ue+Ue*fe,ge=ze,ut=-tt,ke=J+z,he=Math.cos(ke),be=Math.sin(ke);return{x1:F*Math.cos(z),y1:F*Math.sin(z),x2:ze*he-tt*be,y2:ze*be+tt*he,x3:ge*he-ut*be,y3:ge*be+ut*he,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),we=K+.5*(Y-K),Ce=ie+.5*(J-ie),Ue=Math.min(F,K,fe,we),ze=Math.max(F,K,fe,we),tt=Math.min(z,ie,ue,Ce),ge=Math.max(z,ie,ue,Ce);return new s(Ue,tt,ze-Ue,ge-tt)},X=function(F,z,Y,J,K,ie,fe,ue){var we,Ce,Ue,ze,tt,ge,ut,ke,he,be,Le,Me,ve,ye,xe=Y-F,Ie=J-z,Te=K-Y,Je=ie-J,nt=fe-K,st=ue-ie;for(Ce=0;Ce<41;Ce++)he=(ut=(Ue=F+(we=Ce/40)*xe)+we*((tt=Y+we*Te)-Ue))+we*(tt+we*(K+we*nt-tt)-ut),be=(ke=(ze=z+we*Ie)+we*((ge=J+we*Je)-ze))+we*(ge+we*(ie+we*st-ge)-ke),Ce==0?(Le=he,Me=be,ve=he,ye=be):(Le=Math.min(Le,he),Me=Math.min(Me,be),ve=Math.max(ve,he),ye=Math.max(ye,be));return new s(Math.round(Le),Math.round(Me),Math.round(ve-Le),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,p,m,d,y,w,x;for(u=[],h=0,c=(o+=s="\0\0\0\0".slice(o.length%4||4)).length;c>h;h+=4)(p=(o.charCodeAt(h)<<24)+(o.charCodeAt(h+1)<<16)+(o.charCodeAt(h+2)<<8)+o.charCodeAt(h+3))!==0?(m=(p=((p=((p=((p=(p-(x=p%85))/85)-(w=p%85))/85)-(y=p%85))/85)-(d=p%85))/85)%85,u.push(m+33,d+33,y+33,w+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,p,m=String,d="length",y=255,w="charCodeAt",x="slice",b="replace";for(o[x](-2),o=o[x](0,-2)[b](/\s/g,"")[b]("z","!!!!!"),h=[],c=0,p=(o+=s="uuuuu"[x](o[d]%5||5))[d];p>c;c+=5)u=52200625*(o[w](c)-33)+614125*(o[w](c+1)-33)+7225*(o[w](c+2)-33)+85*(o[w](c+3)-33)+(o[w](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]),m.fromCharCode.apply(m,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=Iv(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 p=new XMLHttpRequest,m=0,d=function(y){var w=y.length,x=[],b=String.fromCharCode;for(m=0;m<w;m+=1)x.push(b(255&y.charCodeAt(m)));return x.join("")};if(p.open("GET",u,!h),p.overrideMimeType("text/plain; charset=x-user-defined"),h===!1&&(p.onload=function(){p.status===200?c(d(this.responseText)):c(void 0)}),p.send(null),h&&p.status===200)return d(p.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):Q1(()=>import("./html2canvas.esm-DXEQVQnt.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):Q1(()=>import("./purify.es-Bzr520pe.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),p=u.firstChild;p;p=p.nextSibling)h!==!0&&p.nodeType===1&&p.nodeName==="SCRIPT"||c.appendChild(s(p,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,p=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,m=Object.assign({async:!0,allowTaint:!0,scale:p,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 m.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],w=y.src.find(function(x){return x.format==="truetype"});w&&h.addFont(w.url,y.ref.name,y.ref.style)}return m.windowHeight=m.windowHeight||0,m.windowHeight=m.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):m.windowHeight,h.context2d.save(!0),u(this.prop.container,m)}).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,p){return h.updateProgress(null,null,1,[c]),Promise.prototype.then.call(this,function(m){return h.updateProgress(null,c),m}).then(c,p).then(function(m){return h.updateProgress(1),m})})},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 p=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?c:o.convert(Object.assign({},c),Promise.prototype),m=h.call(p,s,u);return o.convert(m,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 p,m=(""+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":p=1;break;case"mm":p=72/25.4;break;case"cm":p=72/2.54;break;case"in":p=72;break;case"px":p=.75;break;case"pc":case"em":p=12;break;case"ex":p=6;break;default:throw"Invalid unit: "+u}var y,w=0,x=0;if(d.hasOwnProperty(m))w=d[m][1]/p,x=d[m][0]/p;else try{w=h[1],x=h[0]}catch{throw new Error("Invalid format: "+h)}if(s==="p"||s==="portrait")s="p",x>w&&(y=x,x=w,w=y);else{if(s!=="l"&&s!=="landscape")throw"Invalid orientation: "+s;s="l",w>x&&(y=x,x=w,w=y)}return{width:x,height:w,unit:u,k:p,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 Xw=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"),Yw=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+Xw+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){K1!==void 0&&Yw!==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 p=n.internal.newObject();c.push(p);var m=n.internal.getPageInfo(a+1);n.internal.write("<< /D["+m.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
485
- `},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
486
- `+r.id+` 0 obj\r
487
- <<\r
488
- `},n.outline.objEnd=function(){this.ctx.val+=`>> \r
489
- endobj\r
490
- `},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(p){for(var m,d=256*p.charCodeAt(4)+p.charCodeAt(5),y=p.length,w={width:0,height:0,numcomponents:1},x=4;x<y;x+=2){if(x+=d,t.indexOf(p.charCodeAt(x+1))!==-1){m=256*p.charCodeAt(x+5)+p.charCodeAt(x+6),w={width:256*p.charCodeAt(x+7)+p.charCodeAt(x+8),height:m,numcomponents:p.charCodeAt(x+9)};break}d=256*p.charCodeAt(x+2)+p.charCodeAt(x+3)}return w})(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=QI(e,{checkCrc:!0}),o=a.width,s=a.height,u=a.channels,h=a.palette,c=a.depth;i=h&&u===1?(function(R){for(var j=R.width,D=R.height,L=R.data,T=R.palette,$=R.depth,U=!1,te=[],se=[],ee=void 0,Q=!1,re=0,X=0;X<T.length;X++){var B=J4(T[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){U=!0,se=void 0;var K=j*D;ee=new Uint8Array(K);for(var ie=new DataView(L.buffer),fe=0;fe<K;fe++){var ue=Ym(ie,fe,$),we=J4(T[ue],4)[3];ee[fe]=we}}else re===0&&(se=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:U?8:void 0,colorBytes:L,alphaBytes:ee,needSMask:U,palette:te,mask:se}})(a):u===2||u===4?(function(R){for(var j=R.data,D=R.width,L=R.height,T=R.channels,$=R.depth,U=T===2?"DeviceGray":"DeviceRGB",te=T-1,se=D*L,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*T,we=0;we<ee;we++)i6(J,Ym(Y,ue+we,$),fe*ee+we,$);var Ce=Ym(Y,ue+ee,$);Ce<(1<<$)-1&&(ie=!0),i6(K,Ce,1*fe,$)}return{colorSpace:U,colorsPerPixel:te,sMaskBitsPerComponent:ie?$:void 0,colorBytes:F,alphaBytes:z,needSMask:ie}})(a):(function(R){var j=R.data,D=R.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:D,colorsPerPixel:D==="DeviceGray"?1:3,colorBytes:j instanceof Uint16Array?(function(L){for(var T=L.length,$=new Uint8Array(2*T),U=new DataView($.buffer,$.byteOffset,$.byteLength),te=0;te<T;te++)U.setUint16(2*te,L[te],!1);return $})(j):j,needSMask:!1}})(a);var p,m,d,y=i,w=y.colorSpace,x=y.colorsPerPixel,b=y.sMaskBitsPerComponent,S=y.colorBytes,k=y.alphaBytes,E=y.needSMask,A=y.palette,M=y.mask,O=null;return r!==sn.API.image_compression.NONE&&typeof Iv=="function"?(O=(function(R){var j;switch(R){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),p=this.decode.FLATE_DECODE,m="/Predictor ".concat(O," /Colors ").concat(x," /BitsPerComponent ").concat(c," /Columns ").concat(o),e=Jw(S,Math.ceil(o*x*c/8),x,c,r),E&&(d=Jw(k,Math.ceil(o*b/8),1,b,r))):(p=void 0,m=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:p,decodeParameters:m,transparency:M,palette:A,sMask:d,predictor:O,width:o,height:s,bitsPerComponent:c,sMaskBitsPerComponent:b,colorSpace:w}}},(function(e){e.processGIF89A=function(t,n,r,i){var a=new bj(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),eu.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)},eu.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){Qr.log("bit decode error:"+n)}},eu.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)}},eu.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)}},eu.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)}},eu.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}},eu.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}},eu.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}},eu.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}},eu.prototype.getData=function(){return this.data},(function(e){e.processBMP=function(t,n,r,i){var a=new eu(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),o6.prototype.getData=function(){return this.data},(function(e){e.processWEBP=function(t,n,r,i){var a=new o6(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],p=r[h+1],m=r[h+2],d=r[h+3];a[s++]=c,a[s++]=p,a[s++]=m,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,p=t.doKerning!==!1,m=0,d=e.length,y=0,w=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):(m=p&&jr(h[r])==="object"&&!isNaN(parseInt(h[r][y],10))?h[r][y]/c:0,x.push((s[r]||w)/u+m)),y=r;return x},Kw=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)},Zw=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},Qw=function(e,t,n){n||(n={});var r,i,a,o,s,u,h,c=[],p=[c],m=n.textIndent||0,d=0,y=0,w=e.split(" "),x=Z1.apply(this,[" ",n])[0];if(u=n.lineIndent===-1?w[0].length+2:n.lineIndent||0){var b=Array(u).join(" "),S=[];w.map(function(E){(E=E.split(/\s*\n/)).length>1?S=S.concat(E.map(function(A,M){return(M&&A.length?`
491
- `:"")+A})):S.push(E[0])}),w=S,u=Kw.apply(this,[b,n])}for(a=0,o=w.length;a<o;a++){var k=0;if(r=w[a],u&&r[0]==`
492
- `&&(r=r.substr(1),k=1),m+d+(y=(i=Z1.apply(this,[r,n])).reduce(function(E,A){return E+A},0))>t||k){if(y>t){for(s=Zw.apply(this,[r,i,t-(m+d),t]),c.push(s.shift()),c=[s.pop()];s.length;)p.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];p.push(c),m=y+u,d=x}else c.push(r),m+=d+y,d=x}return h=u?function(E,A){return(A?b:"")+E.join(" ")}:function(E){return E.join(" ")},p.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 p=this.internal.getFont(c.fontName,c.fontStyle),m="Unicode";return p.metadata[m]?{widths:p.metadata[m].widths||{0:1},kerning:p.metadata[m].kerning||{}}:{font:p.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(Qw.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(m){return"0x"+parseInt(m,10).toString(16)},s=e.__fontmetrics__.compress=function(m){var d,y,w,x,b=["{"];for(var S in m){if(d=m[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?(w=o(d).slice(3),x="-"):(w=o(d).slice(2),x=""),w=x+w.slice(0,-1)+i[w.slice(-1)];else{if(jr(d)!=="object")throw new Error("Don't know what to do with value type "+jr(d)+".");w=s(d)}b.push(y+w)}return b.push("}"),b.join("")},u=e.__fontmetrics__.uncompress=function(m){if(typeof m!="string")throw new Error("Invalid argument passed to uncompress.");for(var d,y,w,x,b={},S=1,k=b,E=[],A="",M="",O=m.length-1,R=1;R<O;R+=1)(x=m[R])=="'"?d?(w=d.join(""),d=void 0):d=[]:d?d.push(x):x=="{"?(E.push([k,w]),k={},w=void 0):x=="}"?((y=E.pop())[0][y[1]]=k,w=void 0,k=y[0]):x=="-"?S=-1:w===void 0?r.hasOwnProperty(x)?(A+=r[x],w=parseInt(A,16)*S,S=1,A=""):A+=x:r.hasOwnProperty(x)?(M+=r[x],k[w]=parseInt(M,16)*S,S=1,w=void 0,M=""):M+=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}},p={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(m){var d=m.font,y=p.Unicode[d.postScriptName];y&&(d.metadata.Unicode={},d.metadata.Unicode.widths=y.widths,d.metadata.Unicode.kerning=y.kerning);var w=c.Unicode[d.postScriptName];w&&(d.metadata.Unicode.encoding=w,d.encoding=w.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(u0(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 Qr.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(i))throw Qr.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},p=this;return(En.canvg?Promise.resolve(En.canvg):Q1(()=>import("./index.es-PG9hAEth.js"),[],import.meta.url)).catch(function(m){return Promise.reject(new Error("Could not load canvg: "+m))}).then(function(m){return m.default?m.default:m}).then(function(m){return m.fromString(h,e,c)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(m){return m.render(c)}).then(function(){p.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,p=0;function m(y,w){var x,b=!1;for(x=0;x<y.length;x+=1)y[x]===w&&(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(p=0;p<d;p+=1)n[s[p]].value=n[s[p]].defaultValue,n[s[p]].explicitSet=!1}if(jr(e)==="object"){for(i in e)if(a=e[i],m(s,i)&&a!==void 0){if(n[i].type==="boolean"&&typeof a=="boolean")n[i].value=a;else if(n[i].type==="name"&&m(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,w=[];for(y in n)n[y].explicitSet===!0&&(n[y].type==="name"?w.push("/"+y+" /"+n[y].value):w.push("/"+y+" "+n[y].value));w.length!==0&&this.internal.write(`/ViewerPreferences
493
- <<
494
- `+w.join(`
495
- `)+`
496
- >>`)}),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=[""],p=0,m=a.length;p<m;++p){if(s=o.metadata.characterToGlyph(a.charCodeAt(p)),o.metadata.glyIdsUsed.push(s),o.metadata.toUnicode[s]=a.charCodeAt(p),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,p,m;for(c=`/CIDInit /ProcSet findresource begin
497
- 12 dict begin
498
- begincmap
499
- /CIDSystemInfo <<
500
- /Registry (Adobe)
501
- /Ordering (UCS)
502
- /Supplement 0
503
- >> def
504
- /CMapName /Adobe-Identity-UCS def
505
- /CMapType 2 def
506
- 1 begincodespacerange
507
- <0000><ffff>
508
- endcodespacerange`,u=[],p=0,m=(s=Object.keys(a).sort(function(d,y){return d-y})).length;p<m;p++)o=s[p],u.length>=100&&(c+=`
509
- `+u.length+` beginbfchar
510
- `+u.join(`
511
- `)+`
512
- 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+=`
513
- `+u.length+` beginbfchar
514
- `+u.join(`
515
- `)+`
516
- endbfchar
517
- `),c+`endcmap
518
- CMapName currentdict /CMap defineresource pop
519
- end
520
- 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 p=s.metadata.Unicode.widths,m=s.metadata.subset.encode(s.metadata.glyIdsUsed,1),d="",y=0;y<m.length;y++)d+=String.fromCharCode(m[y]);var w=h();c({data:d,addLength1:!0,objectId:w}),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 "+w+" 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(p)),u("/CIDToGIDMap /Identity"),u("/DW 1000"),u("/Subtype /CIDFontType2"),u("/CIDSystemInfo"),u("<<"),u("/Supplement 0"),u("/Registry (Adobe)"),u("/Ordering ("+s.encoding+")"),u(">>"),u(">>"),u("endobj"),s.objectNumber=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 p=s.metadata.rawData,m="",d=0;d<p.length;d++)m+=String.fromCharCode(p[d]);var y=h();c({data:m,addLength1:!0,objectId:y}),u("endobj");var w=h();c({data:r(s.metadata.toUnicode),addLength1:!0,objectId:w}),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 "+w+" 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||{},p=a.mutex||{},m=p.pdfEscape,d=p.activeFontKey,y=p.fonts,w=d,x="",b=0,S="",k=y[w].encoding;if(y[w].encoding!=="Identity-H")return{text:s,x:u,y:h,options:c,mutex:p};for(S=s,w=d,Array.isArray(s)&&(S=s[0]),b=0;b<S.length;b+=1)y[w].metadata.hasOwnProperty("cmap")&&(o=y[w].metadata.cmap.unicode.codeMap[S[b].charCodeAt(0)]),o||S[b].charCodeAt(0)<256&&y[w].metadata.hasOwnProperty("Unicode")?x+=S[b]:x+="";var E="";return parseInt(w.slice(1))<14||k==="WinAnsiEncoding"?E=m(x,w).split("").map(function(A){return A.charCodeAt(0).toString(16)}).join(""):k==="Identity-H"&&(E=n(x,y[w])),p.isHex=!0,{text:E,x:u,y:h,options:c,mutex:p}};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,p=t,m=[[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},w={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(L){var T=L.charCodeAt(),$=T>>8,U=w[$];return U!==void 0?p[256*U+(255&T)]:$===252||$===253?"AL":b.test($)?"L":$===8?"R":"N"},A=function(L){for(var T,$=0;$<L.length;$++){if((T=E(L.charAt($)))==="L")return!1;if(T==="R")return!0}return!1},M=function(L,T,$,U){var te,se,ee,Q,re=T[U];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":U<1||U+1>=T.length||(te=$[U-1])!=="EN"&&te!=="AN"||(se=T[U+1])!=="EN"&&se!=="AN"?re="N":S&&(se="AN"),re=se===te?se:"N";break;case"ES":re=(te=U>0?$[U-1]:"B")==="EN"&&U+1<T.length&&T[U+1]==="EN"?"EN":"N";break;case"ET":if(U>0&&$[U-1]==="EN"){re="EN";break}if(S){re="N";break}for(ee=U+1,Q=T.length;ee<Q&&T[ee]==="ET";)ee++;re=ee<Q&&T[ee]==="EN"?"EN":"N";break;case"NSM":if(o&&!s){for(Q=T.length,ee=U+1;ee<Q&&T[ee]==="NSM";)ee++;if(ee<Q){var X=L[U],B=X>=1425&&X<=2303||X===64286;if(te=T[ee],B&&(te==="R"||te==="AL")){re="R";break}}}re=U<1||(te=T[U-1])==="B"?"N":$[U-1];break;case"B":S=!1,i=!0,re=k;break;case"S":a=!0,re="N"}return re},O=function(L,T,$){var U=L.split("");return $&&R(U,$,{hiLevel:k}),U.reverse(),T&&T.reverse(),U.join("")},R=function(L,T,$){var U,te,se,ee,Q,re=-1,X=L.length,B=0,F=[],z=k?d:m,Y=[];for(S=!1,i=!1,a=!1,te=0;te<X;te++)Y[te]=E(L[te]);for(se=0;se<X;se++){if(Q=B,F[se]=M(L,Y,F,se),U=240&(B=z[Q][y[F[se]]]),B&=15,T[se]=ee=z[B][5],U>0)if(U===16){for(te=re;te<se;te++)T[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++)T[te]=ee;re=-1}Y[se]==="B"&&(T[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,T,X)},j=function(L,T,$,U,te){if(!(te.hiLevel<L)){if(L===1&&k===1&&!i)return T.reverse(),void($&&$.reverse());for(var se,ee,Q,re,X=T.length,B=0;B<X;){if(U[B]>=L){for(Q=B+1;Q<X&&U[Q]>=L;)Q++;for(re=B,ee=Q-1;re<ee;re++,ee--)se=T[re],T[re]=T[ee],T[ee]=se,$&&(se=$[re],$[re]=$[ee],$[ee]=se);B=Q}B++}}},D=function(L,T,$){var U=L.split(""),te={hiLevel:k};return $||($=[]),R(U,$,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])})(U,$,te),j(2,U,T,$,te),j(1,U,T,$,te),U.join("")};return this.__bidiEngine__.doBidiReorder=function(L,T,$){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))})(L,T),o||!u||h)if(o&&u&&s^h)k=s?1:0,L=O(L,T,$);else if(!o&&u&&h)k=s?1:0,L=D(L,T,$),L=O(L,T);else if(!o||s||u||h){if(o&&!u&&s^h)L=O(L,T),s?(k=0,L=D(L,T,$)):(k=1,L=D(L,T,$),L=O(L,T));else if(o&&s&&!u&&h)k=1,L=D(L,T,$),L=O(L,T);else if(!o&&!u&&s^h){var U=c;s?(k=1,L=D(L,T,$),k=0,c=!1,L=D(L,T,$),c=U):(k=0,L=D(L,T,$),L=O(L,T),k=1,c=!1,L=D(L,T,$),c=U,L=O(L,T))}}else k=0,L=D(L,T,$);else k=s?1:0,L=D(L,T,$);return L},this.__bidiEngine__.setOptions=function(L){L&&(o=L.isInputVisual,u=L.isOutputVisual,s=L.isInputRtl,h=L.isOutputRtl,c=L.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 Mj(this),this.registerTTF()}return e.open=function(t){return new e(t)},e.prototype.parse=function(){return this.directory=new wj(this.contents),this.head=new _j(this),this.name=new Pj(this),this.cmap=new k_(this),this.toUnicode={},this.hhea=new Sj(this),this.maxp=new Oj(this),this.hmtx=new Cj(this),this.post=new kj(this),this.os2=new Ej(this),this.loca=new Rj(this),this.glyf=new Lj(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 fu,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})(),wj=(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,p,m,d,y,w;for(w in d=Object.keys(n).length,u=Math.log(2),p=16*Math.floor(Math.log(d)/u),o=Math.floor(p/u),c=16*d-p,(i=new Ef).writeInt(this.scalarType),i.writeShort(d),i.writeShort(p),i.writeShort(o),i.writeShort(c),a=16*d,h=i.pos+a,s=null,y=[],n)for(m=n[w],i.writeString(w),i.writeInt(e(m)),i.writeInt(h),i.writeInt(m.length),y=y.concat(m),w==="head"&&(s=h),h+=m.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=A_.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})(),xj={}.hasOwnProperty,Ku=function(e,t){for(var n in t)xj.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};fu=(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 _j=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Ku(e,fu),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})(),s6=(function(){function e(t,n){var r,i,a,o,s,u,h,c,p,m,d,y,w,x,b,S,k;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=n+t.readInt(),p=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(),m=d/2,t.pos+=6,a=(function(){var E,A;for(A=[],u=E=0;0<=m?E<m:E>m;u=0<=m?++E:--E)A.push(t.readUInt16());return A})(),t.pos+=2,w=(function(){var E,A;for(A=[],u=E=0;0<=m?E<m:E>m;u=0<=m?++E:--E)A.push(t.readUInt16());return A})(),h=(function(){var E,A;for(A=[],u=E=0;0<=m?E<m:E>m;u=0<=m?++E:--E)A.push(t.readUInt16());return A})(),c=(function(){var E,A;for(A=[],u=E=0;0<=m?E<m:E>m;u=0<=m?++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=w[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)-(m-u)]||0)!==0&&(o+=h[u]),this.codeMap[r]=65535&o}t.pos=p}return e.encode=function(t,n){var r,i,a,o,s,u,h,c,p,m,d,y,w,x,b,S,k,E,A,M,O,R,j,D,L,T,$,U,te,se,ee,Q,re,X,B,F,z,Y,J,K,ie,fe,ue,we,Ce,Ue;switch(U=new Ef,o=Object.keys(t).sort(function(ze,tt){return ze-tt}),n){case"macroman":for(w=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]=++w),a[i]={old:t[i],new:S[t[i]]},x[i]=S[t[i]];return U.writeUInt16(1),U.writeUInt16(0),U.writeUInt32(12),U.writeUInt16(0),U.writeUInt16(262),U.writeUInt16(0),U.write(x),{charMap:a,subtable:U.data,maxGlyphID:w+1};case"unicode":for(T=[],p=[],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&&p.push(b),T.push(i),h=s),b=i;for(b&&p.push(b),p.push(65535),T.push(65535),D=2*(j=T.length),R=2*Math.pow(Math.log(j)/Math.LN2,2),m=Math.log(R/2)/Math.LN2,O=2*j-R,u=[],M=[],d=[],y=ee=0,B=T.length;ee<B;y=++ee){if(L=T[y],c=p[y],L===65535){u.push(0),M.push(0);break}if(L-($=r[L].new)>=32768)for(u.push(0),M.push(2*(d.length+j-y)),i=Q=L;L<=c?Q<=c:Q>=c;i=L<=c?++Q:--Q)d.push(r[i].new);else u.push($-L),M.push(0)}for(U.writeUInt16(3),U.writeUInt16(1),U.writeUInt32(12),U.writeUInt16(4),U.writeUInt16(16+8*j+2*d.length),U.writeUInt16(0),U.writeUInt16(D),U.writeUInt16(R),U.writeUInt16(m),U.writeUInt16(O),ie=0,F=p.length;ie<F;ie++)i=p[ie],U.writeUInt16(i);for(U.writeUInt16(0),fe=0,z=T.length;fe<z;fe++)i=T[fe],U.writeUInt16(i);for(we=0,Y=u.length;we<Y;we++)s=u[we],U.writeUInt16(s);for(Ce=0,J=M.length;Ce<J;Ce++)E=M[Ce],U.writeUInt16(E);for(Ue=0,K=d.length;Ue<K;Ue++)w=d[Ue],U.writeUInt16(w);return{charMap:r,subtable:U.data,maxGlyphID:k+1}}},e})(),k_=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Ku(e,fu),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 s6(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=s6.encode(t,n),(i=new Ef).writeUInt16(0),i.writeUInt16(1),r.table=i.data.concat(r.subtable),r},e})(),Sj=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Ku(e,fu),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})(),Ej=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Ku(e,fu),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})(),kj=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Ku(e,fu),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})(),Aj=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},Pj=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Ku(e,fu),e.prototype.tag="name",e.prototype.parse=function(t){var n,r,i,a,o,s,u,h,c,p,m;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,p=r.length;c<p;a=++c)i=r[a],t.pos=i.offset,h=t.readString(i.length),o=new Aj(h,i),u[m=i.nameID]==null&&(u[m]=[]),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})(),Oj=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Ku(e,fu),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})(),Cj=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Ku(e,fu),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,p,m;for(m=[],h=0,c=(p=this.metrics).length;h<c;h++)a=p[h],m.push(a.advance);return m}).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})(),A_=[].slice,Lj=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Ku(e,fu),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,p;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(),p=s.readShort(),u=s.readShort(),c=s.readShort(),this.cache[t]=o===-1?new Tj(s,h,p,u,c):new Nj(s,o,h,p,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})(),Nj=(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})(),Tj=(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(A_.call(this.raw.data)),t=0,r=this.glyphIDs.length;t<r;++t)n.pos=this.glyphOffsets[t];return n.data},e})(),Rj=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Ku(e,fu),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})(),Mj=(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,p,m,d,y,w,x,b;for(i in r=k_.encode(this.generateCmap(),"unicode"),o=this.glyphsFor(t),d={0:0},b=r.charMap)d[(u=b[i]).old]=u.new;for(y in m=r.maxGlyphID,o)y in d||(d[y]=m++);return c=(function(S){var k,E;for(k in E={},S)E[S[k]]=k;return E})(d),p=Object.keys(c).sort(function(S,k){return S-k}),w=(function(){var S,k,E;for(E=[],S=0,k=p.length;S<k;S++)s=p[S],E.push(c[s]);return E})(),a=this.font.glyf.encode(o,w,d),h=this.font.loca.encode(a.offsets,w),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(`
521
- `)}return""+n},t})();window.jspdf={jsPDF:sn};Pt.prototype._requestDraw=()=>{console.log("skipped render")};sO(!1);ix("change-font-size");const Ij=new URLSearchParams(location.search).get("key"),P_=QT({key:Ij});window.store=P_;let Km=null;window.loadVideoExportModule=async()=>(Km||(Km=Q1(()=>import("./index-BqbBn0Xx.js"),[],import.meta.url)),await Km);window.config={addGlobalFont:pO,setRichTextEnabled:_O,setTextVerticalResizeEnabled:xO,setTextOverflow:ix,onLoadError:dO,setAssetLoadTimeout:uO,setFontLoadTimeout:cO,unstable_setTextSplitAllowed:EO};const jj=u6.createRoot(document.getElementById("root"));jj.render(oe.createElement(WR,{visiblePagesOffset:0,renderOnlyActivePage:!0,store:P_,components:{PageControls:()=>null,Tooltip:()=>null}}));export{jr as _,p0 as a,Kj as c,yh as g};