@adaptive-ai/sdk 0.1.24 → 0.1.26

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,8 +1,8 @@
1
- import {useState,useEffect,useRef,useCallback}from'react';import {useMutation}from'@tanstack/react-query';import {identity}from'lodash';import {nanoid}from'nanoid';import Tt from'superjson';import {rpcClient,RpcError}from'typed-rpc';var Un=Object.create;var xt=Object.defineProperty;var Dn=Object.getOwnPropertyDescriptor;var Ln=Object.getOwnPropertyNames;var kn=Object.getPrototypeOf,Fn=Object.prototype.hasOwnProperty;var ot=(r,n)=>()=>(n||r((n={exports:{}}).exports,n),n.exports);var Nn=(r,n,b,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of Ln(n))!Fn.call(r,e)&&e!==b&&xt(r,e,{get:()=>n[e],enumerable:!(s=Dn(n,e))||s.enumerable});return r};var Mt=(r,n,b)=>(b=r!=null?Un(kn(r)):{},Nn(xt(b,"default",{value:r,enumerable:true}),r));var zt=ot((lt,ct)=>{(r=>{let n=(()=>{let R=0;return {escape:function(l){return l.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1")},isDataUrl:function(l){return l.search(/^(data:)/)!==-1},canvasToBlob:function(l){return l.toBlob?new Promise(function(w){l.toBlob(w);}):(w=>new Promise(function(E){var v=a(w.toDataURL().split(",")[1]),I=v.length,m=new Uint8Array(I);for(let g=0;g<I;g++)m[g]=v.charCodeAt(g);E(new Blob([m],{type:"image/png"}));}))(l)},resolveUrl:function(l,w){var E=globalThis.document.implementation.createHTMLDocument(),v=E.createElement("base"),I=(E.head.appendChild(v),E.createElement("a"));return E.body.appendChild(I),v.href=w,I.href=l,I.href},getAndEncode:function(l){let w=y.impl.urlCache.find(function(E){return E.url===l});return w||(w={url:l,promise:null},y.impl.urlCache.push(w)),w.promise===null&&(y.impl.options.cacheBust&&(l+=(/\?/.test(l)?"&":"?")+new Date().getTime()),w.promise=new Promise(function(E){let v=new XMLHttpRequest;function I(D){console.error(D),E("");}function m(){var D=y.impl.options.imagePlaceholder;D?E(D):I("Status:"+v.status+" while fetching resource: "+l);}if(v.timeout=y.impl.options.httpTimeout,v.onerror=m,v.ontimeout=m,v.onloadend=function(){if(v.readyState===XMLHttpRequest.DONE){var D=v.status;if(D===0&&l.toLowerCase().startsWith("file://")||200<=D&&D<=300&&v.response!==null){D=v.response,D instanceof Blob||I("Expected response to be a Blob, but got: "+typeof D);let P=new globalThis.FileReader;P.onloadend=function(){var x=P.result;E(x);};try{P.readAsDataURL(D);}catch(x){I("Failed to read the response as Data URL: "+x.toString());}}else m();}},0<y.impl.options.useCredentialsFilters.length&&(y.impl.options.useCredentials=0<y.impl.options.useCredentialsFilters.filter(D=>0<=l.search(D)).length),y.impl.options.useCredentials&&(v.withCredentials=true),y.impl.options.corsImg&&l.indexOf("http")===0&&l.indexOf(globalThis.window.location.origin)===-1){var g=(y.impl.options.corsImg.method||"GET").toUpperCase()==="POST"?"POST":"GET";v.open(g,(y.impl.options.corsImg.url||"").replace("#{cors}",l),true);let D=false,P=y.impl.options.corsImg.headers||{},x=(Object.keys(P).forEach(function(H){P[H].indexOf("application/json")!==-1&&(D=true),v.setRequestHeader(H,P[H]);}),(H=>{try{return JSON.parse(JSON.stringify(H))}catch(L){I("corsImg.data is missing or invalid:"+L.toString());}})(y.impl.options.corsImg.data||""));Object.keys(x).forEach(function(H){typeof x[H]=="string"&&(x[H]=x[H].replace("#{cors}",l));}),v.responseType="blob",v.send(D?JSON.stringify(x):x);}else v.open("GET",l,true),v.responseType="blob",v.send();})),w.promise},uid:function(){return "u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+R++},asArray:function(l){var w=[],E=l.length;for(let v=0;v<E;v++)w.push(l[v]);return w},escapeXhtml:function(l){return l.replace(/%/g,"%25").replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(l){return l!=="data:,"?new Promise(function(w,E){let v=globalThis.document.createElementNS("http://www.w3.org/2000/svg","svg"),I=new globalThis.Image;y.impl.options.useCredentials&&(I.crossOrigin="use-credentials"),I.onload=function(){globalThis.document.body.removeChild(v),globalThis.window&&globalThis.window.requestAnimationFrame?globalThis.window.requestAnimationFrame(function(){w(I);}):w(I);},I.onerror=m=>{globalThis.document.body.removeChild(v),E(m);},v.appendChild(I),I.src=l,globalThis.document.body.appendChild(v);}):Promise.resolve()},width:function(l){var w=_(l,"width");if(!isNaN(w))return w;var w=_(l,"border-left-width"),E=_(l,"border-right-width");return l.scrollWidth+w+E},height:function(l){var w=_(l,"height");if(!isNaN(w))return w;var w=_(l,"border-top-width"),E=_(l,"border-bottom-width");return l.scrollHeight+w+E},getWindow:u,isElement:d,isElementHostForOpenShadowRoot:function(l){return d(l)&&l.shadowRoot!==null},isShadowRoot:C,isInShadowRoot:f,isHTMLElement:function(l){return l instanceof u(l).HTMLElement},isHTMLCanvasElement:function(l){return l instanceof u(l).HTMLCanvasElement},isHTMLInputElement:function(l){return l instanceof u(l).HTMLInputElement},isHTMLImageElement:function(l){return l instanceof u(l).HTMLImageElement},isHTMLLinkElement:function(l){return l instanceof u(l).HTMLLinkElement},isHTMLScriptElement:function(l){return l instanceof u(l).HTMLScriptElement},isHTMLStyleElement:function(l){return l instanceof u(l).HTMLStyleElement},isHTMLTextAreaElement:function(l){return l instanceof u(l).HTMLTextAreaElement},isShadowSlotElement:function(l){return f(l)&&l instanceof u(l).HTMLSlotElement},isSVGElement:function(l){return l instanceof u(l).SVGElement},isSVGRectElement:function(l){return l instanceof u(l).SVGRectElement},isDimensionMissing:function(l){return isNaN(l)||l<=0}};function u(l){return l=l?l.ownerDocument:void 0,(l?l.defaultView:void 0)||globalThis.window||r}function C(l){return l instanceof u(l).ShadowRoot}function f(l){return l!=null&&l.getRootNode!==void 0&&C(l.getRootNode())}function d(l){return l instanceof u(l).Element}function _(l,w){if(l.nodeType===S){let E=i(l).getPropertyValue(w);if(E.slice(-2)==="px")return E=E.slice(0,-2),parseFloat(E)}return NaN}})(),b=(()=>{let R=/url\(\s*(["']?)((?:\\.|[^\\)])+)\1\s*\)/gm;return {inlineAll:function(_,l,w){return u(_)?Promise.resolve(_).then(C).then(function(E){let v=Promise.resolve(_);return E.forEach(function(I){v=v.then(function(m){return d(m,I,l,w)});}),v}):Promise.resolve(_)},shouldProcess:u,impl:{readUrls:C,inline:d,urlAsRegex:f}};function u(_){return _.search(R)!==-1}function C(_){for(var l,w=[];(l=R.exec(_))!==null;)w.push(l[2]);return w.filter(function(E){return !n.isDataUrl(E)})}function f(_){return new RegExp(`url\\((["']?)(${n.escape(_)})\\1\\)`,"gm")}function d(_,l,w,E){return Promise.resolve(l).then(function(v){return w?n.resolveUrl(v,w):v}).then(E||n.getAndEncode).then(function(v){var I=f(l);return _.replace(I,`url($1${v}$1)`)})}})(),s={resolveAll:function(){return e().then(function(R){return Promise.all(R.map(function(u){return u.resolve()}))}).then(function(R){return R.join(`
2
- `)})},impl:{readAll:e}};function e(){return Promise.resolve(n.asArray(globalThis.document.styleSheets)).then(function(u){let C=[];return u.forEach(function(f){var d=Object.getPrototypeOf(f);if(Object.prototype.hasOwnProperty.call(d,"cssRules"))try{n.asArray(f.cssRules||[]).forEach(C.push.bind(C));}catch(_){console.error("domtoimage: Error while reading CSS rules from: "+f.href,_.toString());}}),C}).then(function(u){return u.filter(function(C){return C.type===CSSRule.FONT_FACE_RULE}).filter(function(C){return b.shouldProcess(C.style.getPropertyValue("src"))})}).then(function(u){return u.map(R)});function R(u){return {resolve:function(){var C=(u.parentStyleSheet||{}).href;return b.inlineAll(u.cssText,C)},src:function(){return u.style.getPropertyValue("src")}}}}let t={inlineAll:function R(u){if(!n.isElement(u))return Promise.resolve(u);return C(u).then(function(){return n.isHTMLImageElement(u)?p(u).inline():Promise.all(n.asArray(u.childNodes).map(function(f){return R(f)}))});function C(f){let d=["background","background-image"],_=d.map(function(l){let w=f.style.getPropertyValue(l),E=f.style.getPropertyPriority(l);return w?b.inlineAll(w).then(function(v){f.style.setProperty(l,v,E);}):Promise.resolve()});return Promise.all(_).then(function(){return f})}},impl:{newImage:p}};function p(R){return {inline:function(u){return n.isDataUrl(R.src)?Promise.resolve():Promise.resolve(R.src).then(u||n.getAndEncode).then(function(C){return new Promise(function(f){R.onload=f,R.onerror=f,R.src=C;})})}}}let c={copyDefaultStyles:true,imagePlaceholder:void 0,cacheBust:false,useCredentials:false,useCredentialsFilters:[],httpTimeout:3e4,styleCaching:"strict",corsImg:void 0},y={toSvg:o,toPng:function(R,u){return h(R,u).then(function(C){return C.toDataURL()})},toJpeg:function(R,u){return h(R,u).then(function(C){return C.toDataURL("image/jpeg",(u?u.quality:void 0)||1)})},toBlob:function(R,u){return h(R,u).then(n.canvasToBlob)},toPixelData:function(R,u){return h(R,u).then(function(C){return C.getContext("2d").getImageData(0,0,n.width(R),n.height(R)).data})},toCanvas:h,impl:{fontFaces:s,images:t,util:n,inliner:b,urlCache:[],options:{},copyOptions:function(R){R.copyDefaultStyles===void 0?y.impl.options.copyDefaultStyles=c.copyDefaultStyles:y.impl.options.copyDefaultStyles=R.copyDefaultStyles,y.impl.options.imagePlaceholder=(R.imagePlaceholder===void 0?c:R).imagePlaceholder,y.impl.options.cacheBust=(R.cacheBust===void 0?c:R).cacheBust,y.impl.options.corsImg=(R.corsImg===void 0?c:R).corsImg,y.impl.options.useCredentials=(R.useCredentials===void 0?c:R).useCredentials,y.impl.options.useCredentialsFilters=(R.useCredentialsFilters===void 0?c:R).useCredentialsFilters,y.impl.options.httpTimeout=(R.httpTimeout===void 0?c:R).httpTimeout,y.impl.options.styleCaching=(R.styleCaching===void 0?c:R).styleCaching;}}},S=(typeof lt=="object"&&typeof ct=="object"?ct.exports=y:r.domtoimage=y,(globalThis.Node===void 0?void 0:globalThis.Node.ELEMENT_NODE)||1),i=(r===void 0?void 0:r.getComputedStyle)||(globalThis.window===void 0?void 0:globalThis.window.getComputedStyle)||globalThis.getComputedStyle,a=(r===void 0?void 0:r.atob)||(globalThis.window===void 0?void 0:globalThis.window.atob)||globalThis.atob;function o(R,u){y.impl.util.getWindow(R);let f=(u=u||{},y.impl.copyOptions(u),[]);return Promise.resolve(R).then(function(d){if(d.nodeType===S)return d;var _=d,l=globalThis.document.createElement("span");return _.replaceWith(l),l.append(d),f.push({child:_,wrapper:l}),l}).then(function(d){return (function _(l,w,E,v){let I=w.filter;if(l===A||n.isHTMLScriptElement(l)||n.isHTMLStyleElement(l)||n.isHTMLLinkElement(l)||E!==null&&I&&!I(l))return Promise.resolve();return Promise.resolve(l).then(m).then(g).then(function(L){return x(L,P(l))}).then(D).then(function(L){return H(L,l)});function m(L){return n.isHTMLCanvasElement(L)?n.makeImage(L.toDataURL()):L.cloneNode(false)}function g(L){return w.adjustClonedNode&&w.adjustClonedNode(l,L,false),Promise.resolve(L)}function D(L){return w.adjustClonedNode&&w.adjustClonedNode(l,L,true),Promise.resolve(L)}function P(L){return n.isElementHostForOpenShadowRoot(L)?L.shadowRoot:L}function x(L,V){let B=K(V),k=Promise.resolve();if(B.length!==0){let G=i(W(V));n.asArray(B).forEach(function(Q){k=k.then(function(){return _(Q,w,G).then(function(q){q&&L.appendChild(q);})});});}return k.then(function(){return L});function W(G){return n.isShadowRoot(G)?G.host:G}function K(G){if(n.isShadowSlotElement(G)){let Q=G.assignedNodes();if(Q&&0<Q.length)return Q}return G.childNodes}}function H(L,V){return !n.isElement(L)||n.isShadowSlotElement(V)?Promise.resolve(L):Promise.resolve().then(k).then(W).then(K).then(G).then(B).then(function(){return L});function B(){n.isHTMLImageElement(L)&&(L.removeAttribute("loading"),V.srcset||V.sizes)&&(L.removeAttribute("srcset"),L.removeAttribute("sizes"),L.src=V.currentSrc||V.src);}function k(){function Q(z,$){$.font=z.font,$.fontFamily=z.fontFamily,$.fontFeatureSettings=z.fontFeatureSettings,$.fontKerning=z.fontKerning,$.fontSize=z.fontSize,$.fontStretch=z.fontStretch,$.fontStyle=z.fontStyle,$.fontVariant=z.fontVariant,$.fontVariantCaps=z.fontVariantCaps,$.fontVariantEastAsian=z.fontVariantEastAsian,$.fontVariantLigatures=z.fontVariantLigatures,$.fontVariantNumeric=z.fontVariantNumeric,$.fontVariationSettings=z.fontVariationSettings,$.fontWeight=z.fontWeight;}function q(z,$){let ie=i(z);ie.cssText?($.style.cssText=ie.cssText,Q(ie,$.style)):(T(w,z,ie,E,$),E===null&&(["inset-block","inset-block-start","inset-block-end"].forEach(ae=>$.style.removeProperty(ae)),["left","right","top","bottom"].forEach(ae=>{$.style.getPropertyValue(ae)&&$.style.setProperty(ae,"0px");})));}q(V,L);}function W(){let Q=n.uid();function q(z){let $=i(V,z),ie=$.getPropertyValue("content");if(ie!==""&&ie!=="none"){let X=function(){let J=`.${Q}:`+z,ne=($.cssText?oe:j)();return globalThis.document.createTextNode(J+`{${ne}}`);function oe(){return `${$.cssText} content: ${ie};`}function j(){return n.asArray($).map(ee).join("; ")+";";function ee(Y){let le=$.getPropertyValue(Y),ge=$.getPropertyPriority(Y)?" !important":"";return Y+": "+le+ge}}};let Z=L.getAttribute("class")||"",te=(L.setAttribute("class",Z+" "+Q),globalThis.document.createElement("style"));te.appendChild(X()),L.appendChild(te);}}[":before",":after"].forEach(function(z){q(z);});}function K(){n.isHTMLTextAreaElement(V)&&(L.innerHTML=V.value),n.isHTMLInputElement(V)&&L.setAttribute("value",V.value);}function G(){n.isSVGElement(L)&&(L.setAttribute("xmlns","http://www.w3.org/2000/svg"),n.isSVGRectElement(L))&&["width","height"].forEach(function(Q){let q=L.getAttribute(Q);q&&L.style.setProperty(Q,q);});}}})(d,u,null)}).then(u.disableEmbedFonts?Promise.resolve(R):O).then(u.disableInlineImages?Promise.resolve(R):M).then(function(d){u.bgcolor&&(d.style.backgroundColor=u.bgcolor),u.width&&(d.style.width=u.width+"px"),u.height&&(d.style.height=u.height+"px"),u.style&&Object.keys(u.style).forEach(function(l){d.style[l]=u.style[l];});let _=null;return typeof u.onclone=="function"&&(_=u.onclone(d)),Promise.resolve(_).then(function(){return d})}).then(function(d){let _=u.width||n.width(R),l=u.height||n.height(R);return Promise.resolve(d).then(function(w){return w.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(w)}).then(n.escapeXhtml).then(function(w){var E=(n.isDimensionMissing(_)?' width="100%"':` width="${_}"`)+(n.isDimensionMissing(l)?' height="100%"':` height="${l}"`);return `<svg xmlns="http://www.w3.org/2000/svg"${(n.isDimensionMissing(_)?"":` width="${_}"`)+(n.isDimensionMissing(l)?"":` height="${l}"`)}><foreignObject${E}>${w}</foreignObject></svg>`}).then(function(w){return "data:image/svg+xml;charset=utf-8,"+w})}).then(function(d){for(;0<f.length;){var _=f.pop();_.wrapper.replaceWith(_.child);}return d}).then(function(d){return y.impl.urlCache=[],A&&(globalThis.document.body.removeChild(A),A=null),N&&clearTimeout(N),N=setTimeout(()=>{N=null,F={};},2e4),d})}function h(R,u){return o(R,u=u||{}).then(n.makeImage).then(function(C){var f=typeof u.scale!="number"?1:u.scale,d=((l,w)=>{let E=u.width||n.width(l),v=u.height||n.height(l);return n.isDimensionMissing(E)&&(E=n.isDimensionMissing(v)?300:2*v),n.isDimensionMissing(v)&&(v=E/2),(l=globalThis.document.createElement("canvas")).width=E*w,l.height=v*w,u.bgcolor&&((w=l.getContext("2d")).fillStyle=u.bgcolor,w.fillRect(0,0,l.width,l.height)),l})(R,f),_=d.getContext("2d");return _.msImageSmoothingEnabled=false,_.imageSmoothingEnabled=false,C&&(_.scale(f,f),_.drawImage(C,0,0)),d})}let A=null;function O(R){return s.resolveAll().then(function(u){var C;return u!==""&&(C=globalThis.document.createElement("style"),R.appendChild(C),C.appendChild(globalThis.document.createTextNode(u))),R})}function M(R){return t.inlineAll(R).then(function(){return R})}function T(R,u,C,f,d){let _=y.impl.options.copyDefaultStyles?((w,E)=>{var v,I=(D=>(w.styleCaching!=="relaxed"?D:D.filter((P,x,H)=>x===0||x===H.length-1)).join(">"))(E=(D=>{var P=[];do if(D.nodeType===S){var x=D.tagName;if(P.push(x),U.includes(x))break}while(D=D.parentNode);return P})(E));{if(F[I])return F[I];E=((D,P)=>{let x=D.body;do{var H=P.pop(),H=D.createElement(H);x.appendChild(H),x=H;}while(0<P.length);return x.textContent="\u200B",x})((v=(()=>{if(A)return A.contentWindow;P=globalThis.document.characterSet||"UTF-8",D=(D=globalThis.document.doctype)?(`<!DOCTYPE ${k(D.name)} ${k(D.publicId)} `+k(D.systemId)).trim()+">":"",(A=globalThis.document.createElement("iframe")).id="domtoimage-sandbox-"+n.uid(),A.style.top="-9999px",A.style.visibility="hidden",A.style.position="fixed",globalThis.document.body.appendChild(A);var D,P,x=A,H="domtoimage-sandbox";try{return x.contentWindow.document.write(D+`<html><head><meta charset='${P}'><title>${H}</title></head><body></body></html>`),x.contentWindow}catch{}var L=globalThis.document.createElement("meta");L.setAttribute("charset",P);try{var V=globalThis.document.implementation.createHTMLDocument(H),B=(V.head.appendChild(L),D+V.documentElement.outerHTML);return x.setAttribute("srcdoc",B),x.contentWindow}catch{}return x.contentDocument.head.appendChild(L),x.contentDocument.title=H,x.contentWindow;function k(W){var K;return W?((K=globalThis.document.createElement("div")).innerText=W,K.innerHTML):""}})()).document,E),v=((D,P)=>{let x={},H=D.getComputedStyle(P);return n.asArray(H).forEach(function(L){x[L]=L==="width"||L==="height"?"auto":H.getPropertyValue(L);}),x})(v,E);var m=E;do{var g=m.parentElement;g!==null&&g.removeChild(m),m=g;}while(m&&m.tagName!=="BODY");return F[I]=v}})(R,u):{},l=d.style;n.asArray(C).forEach(function(w){var E,v,I,m;R.filterStyles&&!R.filterStyles(u,w)||(v=C.getPropertyValue(w),I=_[w],E=f?f.getPropertyValue(w):void 0,l.getPropertyValue(w))||(v!==I||f&&v!==E)&&(I=C.getPropertyPriority(w),E=l,v=v,I=I,m=0<=["background-clip"].indexOf(w=w),I?(E.setProperty(w,v,I),m&&E.setProperty("-webkit-"+w,v,I)):(E.setProperty(w,v),m&&E.setProperty("-webkit-"+w,v)));});}let N=null,F={},U=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DETAILS","DIALOG","DD","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","SVG","TABLE","UL","math","svg","BODY","HEAD","HTML"];})(lt);});var Gt=ot(()=>{});var hn=ot((no,pn)=>{var vt=typeof Map=="function"&&Map.prototype,ut=Object.getOwnPropertyDescriptor&&vt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Je=vt&&ut&&typeof ut.get=="function"?ut.get:null,qt=vt&&Map.prototype.forEach,At=typeof Set=="function"&&Set.prototype,ft=Object.getOwnPropertyDescriptor&&At?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ze=At&&ft&&typeof ft.get=="function"?ft.get:null,Kt=At&&Set.prototype.forEach,qn=typeof WeakMap=="function"&&WeakMap.prototype,Ne=qn?WeakMap.prototype.has:null,Kn=typeof WeakSet=="function"&&WeakSet.prototype,Be=Kn?WeakSet.prototype.has:null,Yn=typeof WeakRef=="function"&&WeakRef.prototype,Yt=Yn?WeakRef.prototype.deref:null,Xn=Boolean.prototype.valueOf,Jn=Object.prototype.toString,Zn=Function.prototype.toString,jn=String.prototype.match,_t=String.prototype.slice,Ee=String.prototype.replace,er=String.prototype.toUpperCase,Xt=String.prototype.toLowerCase,an=RegExp.prototype.test,Jt=Array.prototype.concat,we=Array.prototype.join,tr=Array.prototype.slice,Zt=Math.floor,ht=typeof BigInt=="function"?BigInt.prototype.valueOf:null,dt=Object.getOwnPropertySymbols,gt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,De=typeof Symbol=="function"&&typeof Symbol.iterator=="object",He=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===De||true)?Symbol.toStringTag:null,sn=Object.prototype.propertyIsEnumerable,jt=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function en(r,n){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||an.call(/e/,n))return n;var b=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var s=r<0?-Zt(-r):Zt(r);if(s!==r){var e=String(s),t=_t.call(n,e.length+1);return Ee.call(e,b,"$&_")+"."+Ee.call(Ee.call(t,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ee.call(n,b,"$&_")}var mt=Gt(),tn=mt.custom,nn=un(tn)?tn:null,ln={__proto__:null,double:'"',single:"'"},nr={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};pn.exports=function r(n,b,s,e){var t=b||{};if(Ae(t,"quoteStyle")&&!Ae(ln,t.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ae(t,"maxStringLength")&&(typeof t.maxStringLength=="number"?t.maxStringLength<0&&t.maxStringLength!==1/0:t.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var p=Ae(t,"customInspect")?t.customInspect:true;if(typeof p!="boolean"&&p!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ae(t,"indent")&&t.indent!==null&&t.indent!==" "&&!(parseInt(t.indent,10)===t.indent&&t.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ae(t,"numericSeparator")&&typeof t.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=t.numericSeparator;if(typeof n>"u")return "undefined";if(n===null)return "null";if(typeof n=="boolean")return n?"true":"false";if(typeof n=="string")return dn(n,t);if(typeof n=="number"){if(n===0)return 1/0/n>0?"0":"-0";var y=String(n);return c?en(n,y):y}if(typeof n=="bigint"){var S=String(n)+"n";return c?en(n,S):S}var i=typeof t.depth>"u"?5:t.depth;if(typeof s>"u"&&(s=0),s>=i&&i>0&&typeof n=="object")return yt(n)?"[Array]":"[Object]";var a=Ar(t,s);if(typeof e>"u")e=[];else if(fn(e,n)>=0)return "[Circular]";function o(E,v,I){if(v&&(e=tr.call(e),e.push(v)),I){var m={depth:t.depth};return Ae(t,"quoteStyle")&&(m.quoteStyle=t.quoteStyle),r(E,m,s+1,e)}return r(E,t,s+1,e)}if(typeof n=="function"&&!rn(n)){var h=fr(n),A=Xe(n,o);return "[Function"+(h?": "+h:" (anonymous)")+"]"+(A.length>0?" { "+we.call(A,", ")+" }":"")}if(un(n)){var O=De?Ee.call(String(n),/^(Symbol\(.*\))_[^)]*$/,"$1"):gt.call(n);return typeof n=="object"&&!De?Fe(O):O}if(yr(n)){for(var M="<"+Xt.call(String(n.nodeName)),T=n.attributes||[],N=0;N<T.length;N++)M+=" "+T[N].name+"="+cn(rr(T[N].value),"double",t);return M+=">",n.childNodes&&n.childNodes.length&&(M+="..."),M+="</"+Xt.call(String(n.nodeName))+">",M}if(yt(n)){if(n.length===0)return "[]";var F=Xe(n,o);return a&&!vr(F)?"["+wt(F,a)+"]":"[ "+we.call(F,", ")+" ]"}if(ir(n)){var U=Xe(n,o);return !("cause"in Error.prototype)&&"cause"in n&&!sn.call(n,"cause")?"{ ["+String(n)+"] "+we.call(Jt.call("[cause]: "+o(n.cause),U),", ")+" }":U.length===0?"["+String(n)+"]":"{ ["+String(n)+"] "+we.call(U,", ")+" }"}if(typeof n=="object"&&p){if(nn&&typeof n[nn]=="function"&&mt)return mt(n,{depth:i-s});if(p!=="symbol"&&typeof n.inspect=="function")return n.inspect()}if(dr(n)){var R=[];return qt&&qt.call(n,function(E,v){R.push(o(v,n,true)+" => "+o(E,n));}),on("Map",Je.call(n),R,a)}if(gr(n)){var u=[];return Kt&&Kt.call(n,function(E){u.push(o(E,n));}),on("Set",Ze.call(n),u,a)}if(pr(n))return pt("WeakMap");if(mr(n))return pt("WeakSet");if(hr(n))return pt("WeakRef");if(sr(n))return Fe(o(Number(n)));if(cr(n))return Fe(o(ht.call(n)));if(lr(n))return Fe(Xn.call(n));if(ar(n))return Fe(o(String(n)));if(typeof globalThis.window<"u"&&n===globalThis.window)return "{ [object Window] }";if(typeof globalThis<"u"&&n===globalThis||typeof global<"u"&&n===global)return "{ [object globalThis] }";if(!or(n)&&!rn(n)){var C=Xe(n,o),f=jt?jt(n)===Object.prototype:n instanceof Object||n.constructor===Object,d=n instanceof Object?"":"null prototype",_=!f&&He&&Object(n)===n&&He in n?_t.call(Se(n),8,-1):d?"Object":"",l=f||typeof n.constructor!="function"?"":n.constructor.name?n.constructor.name+" ":"",w=l+(_||d?"["+we.call(Jt.call([],_||[],d||[]),": ")+"] ":"");return C.length===0?w+"{}":a?w+"{"+wt(C,a)+"}":w+"{ "+we.call(C,", ")+" }"}return String(n)};function cn(r,n,b){var s=b.quoteStyle||n,e=ln[s];return e+r+e}function rr(r){return Ee.call(String(r),/"/g,"&quot;")}function xe(r){return !He||!(typeof r=="object"&&(He in r||typeof r[He]<"u"))}function yt(r){return Se(r)==="[object Array]"&&xe(r)}function or(r){return Se(r)==="[object Date]"&&xe(r)}function rn(r){return Se(r)==="[object RegExp]"&&xe(r)}function ir(r){return Se(r)==="[object Error]"&&xe(r)}function ar(r){return Se(r)==="[object String]"&&xe(r)}function sr(r){return Se(r)==="[object Number]"&&xe(r)}function lr(r){return Se(r)==="[object Boolean]"&&xe(r)}function un(r){if(De)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return true;if(!r||typeof r!="object"||!gt)return false;try{return gt.call(r),!0}catch{}return false}function cr(r){if(!r||typeof r!="object"||!ht)return false;try{return ht.call(r),!0}catch{}return false}var ur=Object.prototype.hasOwnProperty||function(r){return r in this};function Ae(r,n){return ur.call(r,n)}function Se(r){return Jn.call(r)}function fr(r){if(r.name)return r.name;var n=jn.call(Zn.call(r),/^function\s*([\w$]+)/);return n?n[1]:null}function fn(r,n){if(r.indexOf)return r.indexOf(n);for(var b=0,s=r.length;b<s;b++)if(r[b]===n)return b;return -1}function dr(r){if(!Je||!r||typeof r!="object")return false;try{Je.call(r);try{Ze.call(r);}catch{return !0}return r instanceof Map}catch{}return false}function pr(r){if(!Ne||!r||typeof r!="object")return false;try{Ne.call(r,Ne);try{Be.call(r,Be);}catch{return !0}return r instanceof WeakMap}catch{}return false}function hr(r){if(!Yt||!r||typeof r!="object")return false;try{return Yt.call(r),!0}catch{}return false}function gr(r){if(!Ze||!r||typeof r!="object")return false;try{Ze.call(r);try{Je.call(r);}catch{return !0}return r instanceof Set}catch{}return false}function mr(r){if(!Be||!r||typeof r!="object")return false;try{Be.call(r,Be);try{Ne.call(r,Ne);}catch{return !0}return r instanceof WeakSet}catch{}return false}function yr(r){return !r||typeof r!="object"?false:typeof HTMLElement<"u"&&r instanceof HTMLElement?true:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function dn(r,n){if(r.length>n.maxStringLength){var b=r.length-n.maxStringLength,s="... "+b+" more character"+(b>1?"s":"");return dn(_t.call(r,0,n.maxStringLength),n)+s}var e=nr[n.quoteStyle||"single"];e.lastIndex=0;var t=Ee.call(Ee.call(r,e,"\\$1"),/[\x00-\x1f]/g,wr);return cn(t,"single",n)}function wr(r){var n=r.charCodeAt(0),b={8:"b",9:"t",10:"n",12:"f",13:"r"}[n];return b?"\\"+b:"\\x"+(n<16?"0":"")+er.call(n.toString(16))}function Fe(r){return "Object("+r+")"}function pt(r){return r+" { ? }"}function on(r,n,b,s){var e=s?wt(b,s):we.call(b,", ");return r+" ("+n+") {"+e+"}"}function vr(r){for(var n=0;n<r.length;n++)if(fn(r[n],`
3
- `)>=0)return false;return true}function Ar(r,n){var b;if(r.indent===" ")b=" ";else if(typeof r.indent=="number"&&r.indent>0)b=we.call(Array(r.indent+1)," ");else return null;return {base:b,prev:we.call(Array(n+1),b)}}function wt(r,n){if(r.length===0)return "";var b=`
1
+ import {useState,useEffect,useRef,useCallback}from'react';import {useMutation}from'@tanstack/react-query';import {identity}from'lodash';import {nanoid}from'nanoid';import Tt from'superjson';import {rpcClient,RpcError}from'typed-rpc';var Un=Object.create;var xt=Object.defineProperty;var Mn=Object.getOwnPropertyDescriptor;var Dn=Object.getOwnPropertyNames;var Ln=Object.getPrototypeOf,kn=Object.prototype.hasOwnProperty;var ot=(r,n)=>()=>(n||r((n={exports:{}}).exports,n),n.exports);var Fn=(r,n,b,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of Dn(n))!kn.call(r,e)&&e!==b&&xt(r,e,{get:()=>n[e],enumerable:!(s=Mn(n,e))||s.enumerable});return r};var Ut=(r,n,b)=>(b=r!=null?Un(Ln(r)):{},Fn(xt(b,"default",{value:r,enumerable:true}),r));var zt=ot((ct,lt)=>{(r=>{let n=(()=>{let R=0;return {escape:function(c){return c.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1")},isDataUrl:function(c){return c.search(/^(data:)/)!==-1},canvasToBlob:function(c){return c.toBlob?new Promise(function(v){c.toBlob(v);}):(v=>new Promise(function(E){var A=a(v.toDataURL().split(",")[1]),I=A.length,m=new Uint8Array(I);for(let g=0;g<I;g++)m[g]=A.charCodeAt(g);E(new Blob([m],{type:"image/png"}));}))(c)},resolveUrl:function(c,v){var E=globalThis.document.implementation.createHTMLDocument(),A=E.createElement("base"),I=(E.head.appendChild(A),E.createElement("a"));return E.body.appendChild(I),A.href=v,I.href=c,I.href},getAndEncode:function(c){let v=w.impl.urlCache.find(function(E){return E.url===c});return v||(v={url:c,promise:null},w.impl.urlCache.push(v)),v.promise===null&&(w.impl.options.cacheBust&&(c+=(/\?/.test(c)?"&":"?")+new Date().getTime()),v.promise=new Promise(function(E){let A=new XMLHttpRequest;function I(D){console.error(D),E("");}function m(){var D=w.impl.options.imagePlaceholder;D?E(D):I("Status:"+A.status+" while fetching resource: "+c);}if(A.timeout=w.impl.options.httpTimeout,A.onerror=m,A.ontimeout=m,A.onloadend=function(){if(A.readyState===XMLHttpRequest.DONE){var D=A.status;if(D===0&&c.toLowerCase().startsWith("file://")||200<=D&&D<=300&&A.response!==null){D=A.response,D instanceof Blob||I("Expected response to be a Blob, but got: "+typeof D);let P=new globalThis.FileReader;P.onloadend=function(){var x=P.result;E(x);};try{P.readAsDataURL(D);}catch(x){I("Failed to read the response as Data URL: "+x.toString());}}else m();}},0<w.impl.options.useCredentialsFilters.length&&(w.impl.options.useCredentials=0<w.impl.options.useCredentialsFilters.filter(D=>0<=c.search(D)).length),w.impl.options.useCredentials&&(A.withCredentials=true),w.impl.options.corsImg&&c.indexOf("http")===0&&c.indexOf(globalThis.window.location.origin)===-1){var g=(w.impl.options.corsImg.method||"GET").toUpperCase()==="POST"?"POST":"GET";A.open(g,(w.impl.options.corsImg.url||"").replace("#{cors}",c),true);let D=false,P=w.impl.options.corsImg.headers||{},x=(Object.keys(P).forEach(function(H){P[H].indexOf("application/json")!==-1&&(D=true),A.setRequestHeader(H,P[H]);}),(H=>{try{return JSON.parse(JSON.stringify(H))}catch(L){I("corsImg.data is missing or invalid:"+L.toString());}})(w.impl.options.corsImg.data||""));Object.keys(x).forEach(function(H){typeof x[H]=="string"&&(x[H]=x[H].replace("#{cors}",c));}),A.responseType="blob",A.send(D?JSON.stringify(x):x);}else A.open("GET",c,true),A.responseType="blob",A.send();})),v.promise},uid:function(){return "u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+R++},asArray:function(c){var v=[],E=c.length;for(let A=0;A<E;A++)v.push(c[A]);return v},escapeXhtml:function(c){return c.replace(/%/g,"%25").replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(c){return c!=="data:,"?new Promise(function(v,E){let A=globalThis.document.createElementNS("http://www.w3.org/2000/svg","svg"),I=new globalThis.Image;w.impl.options.useCredentials&&(I.crossOrigin="use-credentials"),I.onload=function(){globalThis.document.body.removeChild(A),globalThis.window&&globalThis.window.requestAnimationFrame?globalThis.window.requestAnimationFrame(function(){v(I);}):v(I);},I.onerror=m=>{globalThis.document.body.removeChild(A),E(m);},A.appendChild(I),I.src=c,globalThis.document.body.appendChild(A);}):Promise.resolve()},width:function(c){var v=_(c,"width");if(!isNaN(v))return v;var v=_(c,"border-left-width"),E=_(c,"border-right-width");return c.scrollWidth+v+E},height:function(c){var v=_(c,"height");if(!isNaN(v))return v;var v=_(c,"border-top-width"),E=_(c,"border-bottom-width");return c.scrollHeight+v+E},getWindow:h,isElement:f,isElementHostForOpenShadowRoot:function(c){return f(c)&&c.shadowRoot!==null},isShadowRoot:O,isInShadowRoot:d,isHTMLElement:function(c){return c instanceof h(c).HTMLElement},isHTMLCanvasElement:function(c){return c instanceof h(c).HTMLCanvasElement},isHTMLInputElement:function(c){return c instanceof h(c).HTMLInputElement},isHTMLImageElement:function(c){return c instanceof h(c).HTMLImageElement},isHTMLLinkElement:function(c){return c instanceof h(c).HTMLLinkElement},isHTMLScriptElement:function(c){return c instanceof h(c).HTMLScriptElement},isHTMLStyleElement:function(c){return c instanceof h(c).HTMLStyleElement},isHTMLTextAreaElement:function(c){return c instanceof h(c).HTMLTextAreaElement},isShadowSlotElement:function(c){return d(c)&&c instanceof h(c).HTMLSlotElement},isSVGElement:function(c){return c instanceof h(c).SVGElement},isSVGRectElement:function(c){return c instanceof h(c).SVGRectElement},isDimensionMissing:function(c){return isNaN(c)||c<=0}};function h(c){return c=c?c.ownerDocument:void 0,(c?c.defaultView:void 0)||globalThis.window||r}function O(c){return c instanceof h(c).ShadowRoot}function d(c){return c!=null&&c.getRootNode!==void 0&&O(c.getRootNode())}function f(c){return c instanceof h(c).Element}function _(c,v){if(c.nodeType===S){let E=i(c).getPropertyValue(v);if(E.slice(-2)==="px")return E=E.slice(0,-2),parseFloat(E)}return NaN}})(),b=(()=>{let R=/url\(\s*(["']?)((?:\\.|[^\\)])+)\1\s*\)/gm;return {inlineAll:function(_,c,v){return h(_)?Promise.resolve(_).then(O).then(function(E){let A=Promise.resolve(_);return E.forEach(function(I){A=A.then(function(m){return f(m,I,c,v)});}),A}):Promise.resolve(_)},shouldProcess:h,impl:{readUrls:O,inline:f,urlAsRegex:d}};function h(_){return _.search(R)!==-1}function O(_){for(var c,v=[];(c=R.exec(_))!==null;)v.push(c[2]);return v.filter(function(E){return !n.isDataUrl(E)})}function d(_){return new RegExp(`url\\((["']?)(${n.escape(_)})\\1\\)`,"gm")}function f(_,c,v,E){return Promise.resolve(c).then(function(A){return v?n.resolveUrl(A,v):A}).then(E||n.getAndEncode).then(function(A){var I=d(c);return _.replace(I,`url($1${A}$1)`)})}})(),s={resolveAll:function(){return e().then(function(R){return Promise.all(R.map(function(h){return h.resolve()}))}).then(function(R){return R.join(`
2
+ `)})},impl:{readAll:e}};function e(){return Promise.resolve(n.asArray(globalThis.document.styleSheets)).then(function(h){let O=[];return h.forEach(function(d){var f=Object.getPrototypeOf(d);if(Object.prototype.hasOwnProperty.call(f,"cssRules"))try{n.asArray(d.cssRules||[]).forEach(O.push.bind(O));}catch(_){console.error("domtoimage: Error while reading CSS rules from: "+d.href,_.toString());}}),O}).then(function(h){return h.filter(function(O){return O.type===CSSRule.FONT_FACE_RULE}).filter(function(O){return b.shouldProcess(O.style.getPropertyValue("src"))})}).then(function(h){return h.map(R)});function R(h){return {resolve:function(){var O=(h.parentStyleSheet||{}).href;return b.inlineAll(h.cssText,O)},src:function(){return h.style.getPropertyValue("src")}}}}let t={inlineAll:function R(h){if(!n.isElement(h))return Promise.resolve(h);return O(h).then(function(){return n.isHTMLImageElement(h)?p(h).inline():Promise.all(n.asArray(h.childNodes).map(function(d){return R(d)}))});function O(d){let f=["background","background-image"],_=f.map(function(c){let v=d.style.getPropertyValue(c),E=d.style.getPropertyPriority(c);return v?b.inlineAll(v).then(function(A){d.style.setProperty(c,A,E);}):Promise.resolve()});return Promise.all(_).then(function(){return d})}},impl:{newImage:p}};function p(R){return {inline:function(h){return n.isDataUrl(R.src)?Promise.resolve():Promise.resolve(R.src).then(h||n.getAndEncode).then(function(O){return new Promise(function(d){R.onload=d,R.onerror=d,R.src=O;})})}}}let u={copyDefaultStyles:true,imagePlaceholder:void 0,cacheBust:false,useCredentials:false,useCredentialsFilters:[],httpTimeout:3e4,styleCaching:"strict",corsImg:void 0},w={toSvg:o,toPng:function(R,h){return l(R,h).then(function(O){return O.toDataURL()})},toJpeg:function(R,h){return l(R,h).then(function(O){return O.toDataURL("image/jpeg",(h?h.quality:void 0)||1)})},toBlob:function(R,h){return l(R,h).then(n.canvasToBlob)},toPixelData:function(R,h){return l(R,h).then(function(O){return O.getContext("2d").getImageData(0,0,n.width(R),n.height(R)).data})},toCanvas:l,impl:{fontFaces:s,images:t,util:n,inliner:b,urlCache:[],options:{},copyOptions:function(R){R.copyDefaultStyles===void 0?w.impl.options.copyDefaultStyles=u.copyDefaultStyles:w.impl.options.copyDefaultStyles=R.copyDefaultStyles,w.impl.options.imagePlaceholder=(R.imagePlaceholder===void 0?u:R).imagePlaceholder,w.impl.options.cacheBust=(R.cacheBust===void 0?u:R).cacheBust,w.impl.options.corsImg=(R.corsImg===void 0?u:R).corsImg,w.impl.options.useCredentials=(R.useCredentials===void 0?u:R).useCredentials,w.impl.options.useCredentialsFilters=(R.useCredentialsFilters===void 0?u:R).useCredentialsFilters,w.impl.options.httpTimeout=(R.httpTimeout===void 0?u:R).httpTimeout,w.impl.options.styleCaching=(R.styleCaching===void 0?u:R).styleCaching;}}},S=(typeof ct=="object"&&typeof lt=="object"?lt.exports=w:r.domtoimage=w,(globalThis.Node===void 0?void 0:globalThis.Node.ELEMENT_NODE)||1),i=(r===void 0?void 0:r.getComputedStyle)||(globalThis.window===void 0?void 0:globalThis.window.getComputedStyle)||globalThis.getComputedStyle,a=(r===void 0?void 0:r.atob)||(globalThis.window===void 0?void 0:globalThis.window.atob)||globalThis.atob;function o(R,h){w.impl.util.getWindow(R);let d=(h=h||{},w.impl.copyOptions(h),[]);return Promise.resolve(R).then(function(f){if(f.nodeType===S)return f;var _=f,c=globalThis.document.createElement("span");return _.replaceWith(c),c.append(f),d.push({child:_,wrapper:c}),c}).then(function(f){return (function _(c,v,E,A){let I=v.filter;if(c===y||n.isHTMLScriptElement(c)||n.isHTMLStyleElement(c)||n.isHTMLLinkElement(c)||E!==null&&I&&!I(c))return Promise.resolve();return Promise.resolve(c).then(m).then(g).then(function(L){return x(L,P(c))}).then(D).then(function(L){return H(L,c)});function m(L){return n.isHTMLCanvasElement(L)?n.makeImage(L.toDataURL()):L.cloneNode(false)}function g(L){return v.adjustClonedNode&&v.adjustClonedNode(c,L,false),Promise.resolve(L)}function D(L){return v.adjustClonedNode&&v.adjustClonedNode(c,L,true),Promise.resolve(L)}function P(L){return n.isElementHostForOpenShadowRoot(L)?L.shadowRoot:L}function x(L,V){let B=K(V),k=Promise.resolve();if(B.length!==0){let G=i(W(V));n.asArray(B).forEach(function(Q){k=k.then(function(){return _(Q,v,G).then(function(q){q&&L.appendChild(q);})});});}return k.then(function(){return L});function W(G){return n.isShadowRoot(G)?G.host:G}function K(G){if(n.isShadowSlotElement(G)){let Q=G.assignedNodes();if(Q&&0<Q.length)return Q}return G.childNodes}}function H(L,V){return !n.isElement(L)||n.isShadowSlotElement(V)?Promise.resolve(L):Promise.resolve().then(k).then(W).then(K).then(G).then(B).then(function(){return L});function B(){n.isHTMLImageElement(L)&&(L.removeAttribute("loading"),V.srcset||V.sizes)&&(L.removeAttribute("srcset"),L.removeAttribute("sizes"),L.src=V.currentSrc||V.src);}function k(){function Q(z,$){$.font=z.font,$.fontFamily=z.fontFamily,$.fontFeatureSettings=z.fontFeatureSettings,$.fontKerning=z.fontKerning,$.fontSize=z.fontSize,$.fontStretch=z.fontStretch,$.fontStyle=z.fontStyle,$.fontVariant=z.fontVariant,$.fontVariantCaps=z.fontVariantCaps,$.fontVariantEastAsian=z.fontVariantEastAsian,$.fontVariantLigatures=z.fontVariantLigatures,$.fontVariantNumeric=z.fontVariantNumeric,$.fontVariationSettings=z.fontVariationSettings,$.fontWeight=z.fontWeight;}function q(z,$){let ie=i(z);ie.cssText?($.style.cssText=ie.cssText,Q(ie,$.style)):(T(v,z,ie,E,$),E===null&&(["inset-block","inset-block-start","inset-block-end"].forEach(ae=>$.style.removeProperty(ae)),["left","right","top","bottom"].forEach(ae=>{$.style.getPropertyValue(ae)&&$.style.setProperty(ae,"0px");})));}q(V,L);}function W(){let Q=n.uid();function q(z){let $=i(V,z),ie=$.getPropertyValue("content");if(ie!==""&&ie!=="none"){let X=function(){let J=`.${Q}:`+z,ne=($.cssText?oe:j)();return globalThis.document.createTextNode(J+`{${ne}}`);function oe(){return `${$.cssText} content: ${ie};`}function j(){return n.asArray($).map(ee).join("; ")+";";function ee(Y){let ce=$.getPropertyValue(Y),ge=$.getPropertyPriority(Y)?" !important":"";return Y+": "+ce+ge}}};let Z=L.getAttribute("class")||"",te=(L.setAttribute("class",Z+" "+Q),globalThis.document.createElement("style"));te.appendChild(X()),L.appendChild(te);}}[":before",":after"].forEach(function(z){q(z);});}function K(){n.isHTMLTextAreaElement(V)&&(L.innerHTML=V.value),n.isHTMLInputElement(V)&&L.setAttribute("value",V.value);}function G(){n.isSVGElement(L)&&(L.setAttribute("xmlns","http://www.w3.org/2000/svg"),n.isSVGRectElement(L))&&["width","height"].forEach(function(Q){let q=L.getAttribute(Q);q&&L.style.setProperty(Q,q);});}}})(f,h,null)}).then(h.disableEmbedFonts?Promise.resolve(R):C).then(h.disableInlineImages?Promise.resolve(R):U).then(function(f){h.bgcolor&&(f.style.backgroundColor=h.bgcolor),h.width&&(f.style.width=h.width+"px"),h.height&&(f.style.height=h.height+"px"),h.style&&Object.keys(h.style).forEach(function(c){f.style[c]=h.style[c];});let _=null;return typeof h.onclone=="function"&&(_=h.onclone(f)),Promise.resolve(_).then(function(){return f})}).then(function(f){let _=h.width||n.width(R),c=h.height||n.height(R);return Promise.resolve(f).then(function(v){return v.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(v)}).then(n.escapeXhtml).then(function(v){var E=(n.isDimensionMissing(_)?' width="100%"':` width="${_}"`)+(n.isDimensionMissing(c)?' height="100%"':` height="${c}"`);return `<svg xmlns="http://www.w3.org/2000/svg"${(n.isDimensionMissing(_)?"":` width="${_}"`)+(n.isDimensionMissing(c)?"":` height="${c}"`)}><foreignObject${E}>${v}</foreignObject></svg>`}).then(function(v){return "data:image/svg+xml;charset=utf-8,"+v})}).then(function(f){for(;0<d.length;){var _=d.pop();_.wrapper.replaceWith(_.child);}return f}).then(function(f){return w.impl.urlCache=[],y&&(globalThis.document.body.removeChild(y),y=null),N&&clearTimeout(N),N=setTimeout(()=>{N=null,F={};},2e4),f})}function l(R,h){return o(R,h=h||{}).then(n.makeImage).then(function(O){var d=typeof h.scale!="number"?1:h.scale,f=((c,v)=>{let E=h.width||n.width(c),A=h.height||n.height(c);return n.isDimensionMissing(E)&&(E=n.isDimensionMissing(A)?300:2*A),n.isDimensionMissing(A)&&(A=E/2),(c=globalThis.document.createElement("canvas")).width=E*v,c.height=A*v,h.bgcolor&&((v=c.getContext("2d")).fillStyle=h.bgcolor,v.fillRect(0,0,c.width,c.height)),c})(R,d),_=f.getContext("2d");return _.msImageSmoothingEnabled=false,_.imageSmoothingEnabled=false,O&&(_.scale(d,d),_.drawImage(O,0,0)),f})}let y=null;function C(R){return s.resolveAll().then(function(h){var O;return h!==""&&(O=globalThis.document.createElement("style"),R.appendChild(O),O.appendChild(globalThis.document.createTextNode(h))),R})}function U(R){return t.inlineAll(R).then(function(){return R})}function T(R,h,O,d,f){let _=w.impl.options.copyDefaultStyles?((v,E)=>{var A,I=(D=>(v.styleCaching!=="relaxed"?D:D.filter((P,x,H)=>x===0||x===H.length-1)).join(">"))(E=(D=>{var P=[];do if(D.nodeType===S){var x=D.tagName;if(P.push(x),M.includes(x))break}while(D=D.parentNode);return P})(E));{if(F[I])return F[I];E=((D,P)=>{let x=D.body;do{var H=P.pop(),H=D.createElement(H);x.appendChild(H),x=H;}while(0<P.length);return x.textContent="\u200B",x})((A=(()=>{if(y)return y.contentWindow;P=globalThis.document.characterSet||"UTF-8",D=(D=globalThis.document.doctype)?(`<!DOCTYPE ${k(D.name)} ${k(D.publicId)} `+k(D.systemId)).trim()+">":"",(y=globalThis.document.createElement("iframe")).id="domtoimage-sandbox-"+n.uid(),y.style.top="-9999px",y.style.visibility="hidden",y.style.position="fixed",globalThis.document.body.appendChild(y);var D,P,x=y,H="domtoimage-sandbox";try{return x.contentWindow.document.write(D+`<html><head><meta charset='${P}'><title>${H}</title></head><body></body></html>`),x.contentWindow}catch{}var L=globalThis.document.createElement("meta");L.setAttribute("charset",P);try{var V=globalThis.document.implementation.createHTMLDocument(H),B=(V.head.appendChild(L),D+V.documentElement.outerHTML);return x.setAttribute("srcdoc",B),x.contentWindow}catch{}return x.contentDocument.head.appendChild(L),x.contentDocument.title=H,x.contentWindow;function k(W){var K;return W?((K=globalThis.document.createElement("div")).innerText=W,K.innerHTML):""}})()).document,E),A=((D,P)=>{let x={},H=D.getComputedStyle(P);return n.asArray(H).forEach(function(L){x[L]=L==="width"||L==="height"?"auto":H.getPropertyValue(L);}),x})(A,E);var m=E;do{var g=m.parentElement;g!==null&&g.removeChild(m),m=g;}while(m&&m.tagName!=="BODY");return F[I]=A}})(R,h):{},c=f.style;n.asArray(O).forEach(function(v){var E,A,I,m;R.filterStyles&&!R.filterStyles(h,v)||(A=O.getPropertyValue(v),I=_[v],E=d?d.getPropertyValue(v):void 0,c.getPropertyValue(v))||(A!==I||d&&A!==E)&&(I=O.getPropertyPriority(v),E=c,A=A,I=I,m=0<=["background-clip"].indexOf(v=v),I?(E.setProperty(v,A,I),m&&E.setProperty("-webkit-"+v,A,I)):(E.setProperty(v,A),m&&E.setProperty("-webkit-"+v,A)));});}let N=null,F={},M=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DETAILS","DIALOG","DD","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","SVG","TABLE","UL","math","svg","BODY","HEAD","HTML"];})(ct);});var Gt=ot(()=>{});var hn=ot((to,pn)=>{var vt=typeof Map=="function"&&Map.prototype,ut=Object.getOwnPropertyDescriptor&&vt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Je=vt&&ut&&typeof ut.get=="function"?ut.get:null,qt=vt&&Map.prototype.forEach,At=typeof Set=="function"&&Set.prototype,ft=Object.getOwnPropertyDescriptor&&At?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ze=At&&ft&&typeof ft.get=="function"?ft.get:null,Kt=At&&Set.prototype.forEach,Gn=typeof WeakMap=="function"&&WeakMap.prototype,Ne=Gn?WeakMap.prototype.has:null,qn=typeof WeakSet=="function"&&WeakSet.prototype,Be=qn?WeakSet.prototype.has:null,Kn=typeof WeakRef=="function"&&WeakRef.prototype,Yt=Kn?WeakRef.prototype.deref:null,Yn=Boolean.prototype.valueOf,Xn=Object.prototype.toString,Jn=Function.prototype.toString,Zn=String.prototype.match,_t=String.prototype.slice,Ee=String.prototype.replace,jn=String.prototype.toUpperCase,Xt=String.prototype.toLowerCase,an=RegExp.prototype.test,Jt=Array.prototype.concat,we=Array.prototype.join,er=Array.prototype.slice,Zt=Math.floor,ht=typeof BigInt=="function"?BigInt.prototype.valueOf:null,dt=Object.getOwnPropertySymbols,gt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,De=typeof Symbol=="function"&&typeof Symbol.iterator=="object",He=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===De||true)?Symbol.toStringTag:null,sn=Object.prototype.propertyIsEnumerable,jt=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function en(r,n){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||an.call(/e/,n))return n;var b=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var s=r<0?-Zt(-r):Zt(r);if(s!==r){var e=String(s),t=_t.call(n,e.length+1);return Ee.call(e,b,"$&_")+"."+Ee.call(Ee.call(t,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ee.call(n,b,"$&_")}var mt=Gt(),tn=mt.custom,nn=un(tn)?tn:null,cn={__proto__:null,double:'"',single:"'"},tr={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};pn.exports=function r(n,b,s,e){var t=b||{};if(Ae(t,"quoteStyle")&&!Ae(cn,t.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ae(t,"maxStringLength")&&(typeof t.maxStringLength=="number"?t.maxStringLength<0&&t.maxStringLength!==1/0:t.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var p=Ae(t,"customInspect")?t.customInspect:true;if(typeof p!="boolean"&&p!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ae(t,"indent")&&t.indent!==null&&t.indent!==" "&&!(parseInt(t.indent,10)===t.indent&&t.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ae(t,"numericSeparator")&&typeof t.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=t.numericSeparator;if(typeof n>"u")return "undefined";if(n===null)return "null";if(typeof n=="boolean")return n?"true":"false";if(typeof n=="string")return dn(n,t);if(typeof n=="number"){if(n===0)return 1/0/n>0?"0":"-0";var w=String(n);return u?en(n,w):w}if(typeof n=="bigint"){var S=String(n)+"n";return u?en(n,S):S}var i=typeof t.depth>"u"?5:t.depth;if(typeof s>"u"&&(s=0),s>=i&&i>0&&typeof n=="object")return yt(n)?"[Array]":"[Object]";var a=vr(t,s);if(typeof e>"u")e=[];else if(fn(e,n)>=0)return "[Circular]";function o(E,A,I){if(A&&(e=er.call(e),e.push(A)),I){var m={depth:t.depth};return Ae(t,"quoteStyle")&&(m.quoteStyle=t.quoteStyle),r(E,m,s+1,e)}return r(E,t,s+1,e)}if(typeof n=="function"&&!rn(n)){var l=ur(n),y=Xe(n,o);return "[Function"+(l?": "+l:" (anonymous)")+"]"+(y.length>0?" { "+we.call(y,", ")+" }":"")}if(un(n)){var C=De?Ee.call(String(n),/^(Symbol\(.*\))_[^)]*$/,"$1"):gt.call(n);return typeof n=="object"&&!De?Fe(C):C}if(mr(n)){for(var U="<"+Xt.call(String(n.nodeName)),T=n.attributes||[],N=0;N<T.length;N++)U+=" "+T[N].name+"="+ln(nr(T[N].value),"double",t);return U+=">",n.childNodes&&n.childNodes.length&&(U+="..."),U+="</"+Xt.call(String(n.nodeName))+">",U}if(yt(n)){if(n.length===0)return "[]";var F=Xe(n,o);return a&&!wr(F)?"["+wt(F,a)+"]":"[ "+we.call(F,", ")+" ]"}if(or(n)){var M=Xe(n,o);return !("cause"in Error.prototype)&&"cause"in n&&!sn.call(n,"cause")?"{ ["+String(n)+"] "+we.call(Jt.call("[cause]: "+o(n.cause),M),", ")+" }":M.length===0?"["+String(n)+"]":"{ ["+String(n)+"] "+we.call(M,", ")+" }"}if(typeof n=="object"&&p){if(nn&&typeof n[nn]=="function"&&mt)return mt(n,{depth:i-s});if(p!=="symbol"&&typeof n.inspect=="function")return n.inspect()}if(fr(n)){var R=[];return qt&&qt.call(n,function(E,A){R.push(o(A,n,true)+" => "+o(E,n));}),on("Map",Je.call(n),R,a)}if(hr(n)){var h=[];return Kt&&Kt.call(n,function(E){h.push(o(E,n));}),on("Set",Ze.call(n),h,a)}if(dr(n))return pt("WeakMap");if(gr(n))return pt("WeakSet");if(pr(n))return pt("WeakRef");if(ar(n))return Fe(o(Number(n)));if(cr(n))return Fe(o(ht.call(n)));if(sr(n))return Fe(Yn.call(n));if(ir(n))return Fe(o(String(n)));if(typeof globalThis.window<"u"&&n===globalThis.window)return "{ [object Window] }";if(typeof globalThis<"u"&&n===globalThis||typeof global<"u"&&n===global)return "{ [object globalThis] }";if(!rr(n)&&!rn(n)){var O=Xe(n,o),d=jt?jt(n)===Object.prototype:n instanceof Object||n.constructor===Object,f=n instanceof Object?"":"null prototype",_=!d&&He&&Object(n)===n&&He in n?_t.call(Se(n),8,-1):f?"Object":"",c=d||typeof n.constructor!="function"?"":n.constructor.name?n.constructor.name+" ":"",v=c+(_||f?"["+we.call(Jt.call([],_||[],f||[]),": ")+"] ":"");return O.length===0?v+"{}":a?v+"{"+wt(O,a)+"}":v+"{ "+we.call(O,", ")+" }"}return String(n)};function ln(r,n,b){var s=b.quoteStyle||n,e=cn[s];return e+r+e}function nr(r){return Ee.call(String(r),/"/g,"&quot;")}function xe(r){return !He||!(typeof r=="object"&&(He in r||typeof r[He]<"u"))}function yt(r){return Se(r)==="[object Array]"&&xe(r)}function rr(r){return Se(r)==="[object Date]"&&xe(r)}function rn(r){return Se(r)==="[object RegExp]"&&xe(r)}function or(r){return Se(r)==="[object Error]"&&xe(r)}function ir(r){return Se(r)==="[object String]"&&xe(r)}function ar(r){return Se(r)==="[object Number]"&&xe(r)}function sr(r){return Se(r)==="[object Boolean]"&&xe(r)}function un(r){if(De)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return true;if(!r||typeof r!="object"||!gt)return false;try{return gt.call(r),!0}catch{}return false}function cr(r){if(!r||typeof r!="object"||!ht)return false;try{return ht.call(r),!0}catch{}return false}var lr=Object.prototype.hasOwnProperty||function(r){return r in this};function Ae(r,n){return lr.call(r,n)}function Se(r){return Xn.call(r)}function ur(r){if(r.name)return r.name;var n=Zn.call(Jn.call(r),/^function\s*([\w$]+)/);return n?n[1]:null}function fn(r,n){if(r.indexOf)return r.indexOf(n);for(var b=0,s=r.length;b<s;b++)if(r[b]===n)return b;return -1}function fr(r){if(!Je||!r||typeof r!="object")return false;try{Je.call(r);try{Ze.call(r);}catch{return !0}return r instanceof Map}catch{}return false}function dr(r){if(!Ne||!r||typeof r!="object")return false;try{Ne.call(r,Ne);try{Be.call(r,Be);}catch{return !0}return r instanceof WeakMap}catch{}return false}function pr(r){if(!Yt||!r||typeof r!="object")return false;try{return Yt.call(r),!0}catch{}return false}function hr(r){if(!Ze||!r||typeof r!="object")return false;try{Ze.call(r);try{Je.call(r);}catch{return !0}return r instanceof Set}catch{}return false}function gr(r){if(!Be||!r||typeof r!="object")return false;try{Be.call(r,Be);try{Ne.call(r,Ne);}catch{return !0}return r instanceof WeakSet}catch{}return false}function mr(r){return !r||typeof r!="object"?false:typeof HTMLElement<"u"&&r instanceof HTMLElement?true:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function dn(r,n){if(r.length>n.maxStringLength){var b=r.length-n.maxStringLength,s="... "+b+" more character"+(b>1?"s":"");return dn(_t.call(r,0,n.maxStringLength),n)+s}var e=tr[n.quoteStyle||"single"];e.lastIndex=0;var t=Ee.call(Ee.call(r,e,"\\$1"),/[\x00-\x1f]/g,yr);return ln(t,"single",n)}function yr(r){var n=r.charCodeAt(0),b={8:"b",9:"t",10:"n",12:"f",13:"r"}[n];return b?"\\"+b:"\\x"+(n<16?"0":"")+jn.call(n.toString(16))}function Fe(r){return "Object("+r+")"}function pt(r){return r+" { ? }"}function on(r,n,b,s){var e=s?wt(b,s):we.call(b,", ");return r+" ("+n+") {"+e+"}"}function wr(r){for(var n=0;n<r.length;n++)if(fn(r[n],`
3
+ `)>=0)return false;return true}function vr(r,n){var b;if(r.indent===" ")b=" ";else if(typeof r.indent=="number"&&r.indent>0)b=we.call(Array(r.indent+1)," ");else return null;return {base:b,prev:we.call(Array(n+1),b)}}function wt(r,n){if(r.length===0)return "";var b=`
4
4
  `+n.prev+n.base;return b+we.call(r,","+b)+`
5
- `+n.prev}function Xe(r,n){var b=yt(r),s=[];if(b){s.length=r.length;for(var e=0;e<r.length;e++)s[e]=Ae(r,e)?n(r[e],r):"";}var t=typeof dt=="function"?dt(r):[],p;if(De){p={};for(var c=0;c<t.length;c++)p["$"+t[c]]=t[c];}for(var y in r)Ae(r,y)&&(b&&String(Number(y))===y&&y<r.length||De&&p["$"+y]instanceof Symbol||(an.call(/[^\w$]/,y)?s.push(n(y,r)+": "+n(r[y],r)):s.push(y+": "+n(r[y],r))));if(typeof dt=="function")for(var S=0;S<t.length;S++)sn.call(r,t[S])&&s.push("["+n(t[S])+"]: "+n(r[t[S]],r));return s}});function Bn(r,n){return n.forEach((function(b){b&&typeof b!="string"&&!Array.isArray(b)&&Object.keys(b).forEach((function(s){if(s!=="default"&&!(s in r)){var e=Object.getOwnPropertyDescriptor(b,s);Object.defineProperty(r,s,e.get?e:{enumerable:true,get:function(){return b[s]}});}}));})),Object.freeze(r)}function Dt(r,n){return new Promise((function(b,s){let e;return Hn(r).then((function(t){try{return e=t,b(new Blob([n.slice(0,2),e,n.slice(2)],{type:"image/jpeg"}))}catch(p){return s(p)}}),s)}))}var Hn=r=>new Promise(((n,b)=>{let s=new globalThis.FileReader;s.addEventListener("load",(({target:{result:e}})=>{let t=new DataView(e),p=0;if(t.getUint16(p)!==65496)return b("not a valid JPEG");for(p+=2;;){let c=t.getUint16(p);if(c===65498)break;let y=t.getUint16(p+2);if(c===65505&&t.getUint32(p+4)===1165519206){let S=p+10,i;switch(t.getUint16(S)){case 18761:i=true;break;case 19789:i=false;break;default:return b("TIFF header contains invalid endian")}if(t.getUint16(S+2,i)!==42)return b("TIFF header contains invalid version");let a=t.getUint32(S+4,i),o=S+a+2+12*t.getUint16(S+a,i);for(let h=S+a+2;h<o;h+=12)if(t.getUint16(h,i)==274){if(t.getUint16(h+2,i)!==3)return b("Orientation data type is invalid");if(t.getUint32(h+4,i)!==1)return b("Orientation data count is invalid");t.setUint16(h+8,1,i);break}return n(e.slice(p,p+2+y))}p+=2+y;}return n(new Blob)})),s.readAsArrayBuffer(r);})),ze={},Vn={get exports(){return ze},set exports(r){ze=r;}};(function(r){var n,b,s={};Vn.exports=s,s.parse=function(e,t){for(var p=s.bin.readUshort,c=s.bin.readUint,y=0,S={},i=new Uint8Array(e),a=i.length-4;c(i,a)!=101010256;)a--;y=a,y+=4;var o=p(i,y+=4);p(i,y+=2);var h=c(i,y+=2),A=c(i,y+=4);y+=4,y=A;for(var O=0;O<o;O++){c(i,y),y+=4,y+=4,y+=4,c(i,y+=4),h=c(i,y+=4);var M=c(i,y+=4),T=p(i,y+=4),N=p(i,y+2),F=p(i,y+4);y+=6;var U=c(i,y+=8);y+=4,y+=T+N+F,s._readLocal(i,U,S,h,M,t);}return S},s._readLocal=function(e,t,p,c,y,S){var i=s.bin.readUshort,a=s.bin.readUint;a(e,t),i(e,t+=4),i(e,t+=2);var o=i(e,t+=2);a(e,t+=2),a(e,t+=4),t+=4;var h=i(e,t+=8),A=i(e,t+=2);t+=2;var O=s.bin.readUTF8(e,t,h);if(t+=h,t+=A,S)p[O]={size:y,csize:c};else {var M=new Uint8Array(e.buffer,t);if(o==0)p[O]=new Uint8Array(M.buffer.slice(t,t+c));else {if(o!=8)throw "unknown compression method: "+o;var T=new Uint8Array(y);s.inflateRaw(M,T),p[O]=T;}}},s.inflateRaw=function(e,t){return s.F.inflate(e,t)},s.inflate=function(e,t){return e[0],e[1],s.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),t)},s.deflate=function(e,t){t==null&&(t={level:6});var p=0,c=new Uint8Array(50+Math.floor(1.1*e.length));c[p]=120,c[p+1]=156,p+=2,p=s.F.deflateRaw(e,c,p,t.level);var y=s.adler(e,0,e.length);return c[p+0]=y>>>24&255,c[p+1]=y>>>16&255,c[p+2]=y>>>8&255,c[p+3]=y>>>0&255,new Uint8Array(c.buffer,0,p+4)},s.deflateRaw=function(e,t){t==null&&(t={level:6});var p=new Uint8Array(50+Math.floor(1.1*e.length)),c=s.F.deflateRaw(e,p,c,t.level);return new Uint8Array(p.buffer,0,c)},s.encode=function(e,t){t==null&&(t=false);var p=0,c=s.bin.writeUint,y=s.bin.writeUshort,S={};for(var i in e){var a=!s._noNeed(i)&&!t,o=e[i],h=s.crc.crc(o,0,o.length);S[i]={cpr:a,usize:o.length,crc:h,file:a?s.deflateRaw(o):o};}for(var i in S)p+=S[i].file.length+30+46+2*s.bin.sizeUTF8(i);p+=22;var A=new Uint8Array(p),O=0,M=[];for(var i in S){var T=S[i];M.push(O),O=s._writeHeader(A,O,i,T,0);}var N=0,F=O;for(var i in S)T=S[i],M.push(O),O=s._writeHeader(A,O,i,T,1,M[N++]);var U=O-F;return c(A,O,101010256),O+=4,y(A,O+=4,N),y(A,O+=2,N),c(A,O+=2,U),c(A,O+=4,F),O+=4,O+=2,A.buffer},s._noNeed=function(e){var t=e.split(".").pop().toLowerCase();return "png,jpg,jpeg,zip".indexOf(t)!=-1},s._writeHeader=function(e,t,p,c,y,S){var i=s.bin.writeUint,a=s.bin.writeUshort,o=c.file;return i(e,t,y==0?67324752:33639248),t+=4,y==1&&(t+=2),a(e,t,20),a(e,t+=2,0),a(e,t+=2,c.cpr?8:0),i(e,t+=2,0),i(e,t+=4,c.crc),i(e,t+=4,o.length),i(e,t+=4,c.usize),a(e,t+=4,s.bin.sizeUTF8(p)),a(e,t+=2,0),t+=2,y==1&&(t+=2,t+=2,i(e,t+=6,S),t+=4),t+=s.bin.writeUTF8(e,t,p),y==0&&(e.set(o,t),t+=o.length),t},s.crc={table:(function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var p=t,c=0;c<8;c++)1&p?p=3988292384^p>>>1:p>>>=1;e[t]=p;}return e})(),update:function(e,t,p,c){for(var y=0;y<c;y++)e=s.crc.table[255&(e^t[p+y])]^e>>>8;return e},crc:function(e,t,p){return 4294967295^s.crc.update(4294967295,e,t,p)}},s.adler=function(e,t,p){for(var c=1,y=0,S=t,i=t+p;S<i;){for(var a=Math.min(S+5552,i);S<a;)y+=c+=e[S++];c%=65521,y%=65521;}return y<<16|c},s.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,p){e[t]=255&p,e[t+1]=p>>8&255;},readUint:function(e,t){return 16777216*e[t+3]+(e[t+2]<<16|e[t+1]<<8|e[t])},writeUint:function(e,t,p){e[t]=255&p,e[t+1]=p>>8&255,e[t+2]=p>>16&255,e[t+3]=p>>24&255;},readASCII:function(e,t,p){for(var c="",y=0;y<p;y++)c+=String.fromCharCode(e[t+y]);return c},writeASCII:function(e,t,p){for(var c=0;c<p.length;c++)e[t+c]=p.charCodeAt(c);},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,p){for(var c,y="",S=0;S<p;S++)y+="%"+s.bin.pad(e[t+S].toString(16));try{c=decodeURIComponent(y);}catch{return s.bin.readASCII(e,t,p)}return c},writeUTF8:function(e,t,p){for(var c=p.length,y=0,S=0;S<c;S++){var i=p.charCodeAt(S);if((4294967168&i)==0)e[t+y]=i,y++;else if((4294965248&i)==0)e[t+y]=192|i>>6,e[t+y+1]=128|i>>0&63,y+=2;else if((4294901760&i)==0)e[t+y]=224|i>>12,e[t+y+1]=128|i>>6&63,e[t+y+2]=128|i>>0&63,y+=3;else {if((4292870144&i)!=0)throw "e";e[t+y]=240|i>>18,e[t+y+1]=128|i>>12&63,e[t+y+2]=128|i>>6&63,e[t+y+3]=128|i>>0&63,y+=4;}}return y},sizeUTF8:function(e){for(var t=e.length,p=0,c=0;c<t;c++){var y=e.charCodeAt(c);if((4294967168&y)==0)p++;else if((4294965248&y)==0)p+=2;else if((4294901760&y)==0)p+=3;else {if((4292870144&y)!=0)throw "e";p+=4;}}return p}},s.F={},s.F.deflateRaw=function(e,t,p,c){var y=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][c],S=s.F.U,i=s.F._goodIndex;s.F._hash;var a=s.F._putsE,o=0,h=p<<3,A=0,O=e.length;if(c==0){for(;o<O;)a(t,h,o+(l=Math.min(65535,O-o))==O?1:0),h=s.F._copyExact(e,o,l,t,h+8),o+=l;return h>>>3}var M=S.lits,T=S.strt,N=S.prev,F=0,U=0,R=0,u=0,C=0,f=0;for(O>2&&(T[f=s.F._hash(e,0)]=0),o=0;o<O;o++){if(C=f,o+1<O-2){f=s.F._hash(e,o+1);var d=o+1&32767;N[d]=T[f],T[f]=d;}if(A<=o){(F>14e3||U>26697)&&O-o>100&&(A<o&&(M[F]=o-A,F+=2,A=o),h=s.F._writeBlock(o==O-1||A==O?1:0,M,F,u,e,R,o-R,t,h),F=U=u=0,R=o);var _=0;o<O-2&&(_=s.F._bestMatch(e,o,N,C,Math.min(y[2],O-o),y[3]));var l=_>>>16,w=65535&_;if(_!=0){w=65535&_;var E=i(l=_>>>16,S.of0);S.lhst[257+E]++;var v=i(w,S.df0);S.dhst[v]++,u+=S.exb[E]+S.dxb[v],M[F]=l<<23|o-A,M[F+1]=w<<16|E<<8|v,F+=2,A=o+l;}else S.lhst[e[o]]++;U++;}}for(R==o&&e.length!=0||(A<o&&(M[F]=o-A,F+=2,A=o),h=s.F._writeBlock(1,M,F,u,e,R,o-R,t,h),F=0,U=0,F=U=u=0,R=o);(7&h)!=0;)h++;return h>>>3},s.F._bestMatch=function(e,t,p,c,y,S){var i=32767&t,a=p[i],o=i-a+32768&32767;if(a==i||c!=s.F._hash(e,t-o))return 0;for(var h=0,A=0,O=Math.min(32767,t);o<=O&&--S!=0&&a!=i;){if(h==0||e[t+h]==e[t+h-o]){var M=s.F._howLong(e,t,o);if(M>h){if(A=o,(h=M)>=y)break;o+2<M&&(M=o+2);for(var T=0,N=0;N<M-2;N++){var F=t-o+N+32768&32767,U=F-p[F]+32768&32767;U>T&&(T=U,a=F);}}}o+=(i=a)-(a=p[i])+32768&32767;}return h<<16|A},s.F._howLong=function(e,t,p){if(e[t]!=e[t-p]||e[t+1]!=e[t+1-p]||e[t+2]!=e[t+2-p])return 0;var c=t,y=Math.min(e.length,t+258);for(t+=3;t<y&&e[t]==e[t-p];)t++;return t-c},s.F._hash=function(e,t){return (e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},s.saved=0,s.F._writeBlock=function(e,t,p,c,y,S,i,a,o){var h,A,O,M,T,N,F,U,R,u=s.F.U,C=s.F._putsF,f=s.F._putsE;u.lhst[256]++,A=(h=s.F.getTrees())[0],O=h[1],M=h[2],T=h[3],N=h[4],F=h[5],U=h[6],R=h[7];var d=32+((o+3&7)==0?0:8-(o+3&7))+(i<<3),_=c+s.F.contSize(u.fltree,u.lhst)+s.F.contSize(u.fdtree,u.dhst),l=c+s.F.contSize(u.ltree,u.lhst)+s.F.contSize(u.dtree,u.dhst);l+=14+3*F+s.F.contSize(u.itree,u.ihst)+(2*u.ihst[16]+3*u.ihst[17]+7*u.ihst[18]);for(var w=0;w<286;w++)u.lhst[w]=0;for(w=0;w<30;w++)u.dhst[w]=0;for(w=0;w<19;w++)u.ihst[w]=0;var E=d<_&&d<l?0:_<l?1:2;if(C(a,o,e),C(a,o+1,E),o+=3,E==0){for(;(7&o)!=0;)o++;o=s.F._copyExact(y,S,i,a,o);}else {var v,I;if(E==1&&(v=u.fltree,I=u.fdtree),E==2){s.F.makeCodes(u.ltree,A),s.F.revCodes(u.ltree,A),s.F.makeCodes(u.dtree,O),s.F.revCodes(u.dtree,O),s.F.makeCodes(u.itree,M),s.F.revCodes(u.itree,M),v=u.ltree,I=u.dtree,f(a,o,T-257),f(a,o+=5,N-1),f(a,o+=5,F-4),o+=4;for(var m=0;m<F;m++)f(a,o+3*m,u.itree[1+(u.ordr[m]<<1)]);o+=3*F,o=s.F._codeTiny(U,u.itree,a,o),o=s.F._codeTiny(R,u.itree,a,o);}for(var g=S,D=0;D<p;D+=2){for(var P=t[D],x=P>>>23,H=g+(8388607&P);g<H;)o=s.F._writeLit(y[g++],v,a,o);if(x!=0){var L=t[D+1],V=L>>16,B=L>>8&255,k=255&L;f(a,o=s.F._writeLit(257+B,v,a,o),x-u.of0[B]),o+=u.exb[B],C(a,o=s.F._writeLit(k,I,a,o),V-u.df0[k]),o+=u.dxb[k],g+=x;}}o=s.F._writeLit(256,v,a,o);}return o},s.F._copyExact=function(e,t,p,c,y){var S=y>>>3;return c[S]=p,c[S+1]=p>>>8,c[S+2]=255-c[S],c[S+3]=255-c[S+1],S+=4,c.set(new Uint8Array(e.buffer,t,p),S),y+(p+4<<3)},s.F.getTrees=function(){for(var e=s.F.U,t=s.F._hufTree(e.lhst,e.ltree,15),p=s.F._hufTree(e.dhst,e.dtree,15),c=[],y=s.F._lenCodes(e.ltree,c),S=[],i=s.F._lenCodes(e.dtree,S),a=0;a<c.length;a+=2)e.ihst[c[a]]++;for(a=0;a<S.length;a+=2)e.ihst[S[a]]++;for(var o=s.F._hufTree(e.ihst,e.itree,7),h=19;h>4&&e.itree[1+(e.ordr[h-1]<<1)]==0;)h--;return [t,p,o,y,i,h,c,S]},s.F.getSecond=function(e){for(var t=[],p=0;p<e.length;p+=2)t.push(e[p+1]);return t},s.F.nonZero=function(e){for(var t="",p=0;p<e.length;p+=2)e[p+1]!=0&&(t+=(p>>1)+",");return t},s.F.contSize=function(e,t){for(var p=0,c=0;c<t.length;c++)p+=t[c]*e[1+(c<<1)];return p},s.F._codeTiny=function(e,t,p,c){for(var y=0;y<e.length;y+=2){var S=e[y],i=e[y+1];c=s.F._writeLit(S,t,p,c);var a=S==16?2:S==17?3:7;S>15&&(s.F._putsE(p,c,i,a),c+=a);}return c},s.F._lenCodes=function(e,t){for(var p=e.length;p!=2&&e[p-1]==0;)p-=2;for(var c=0;c<p;c+=2){var y=e[c+1],S=c+3<p?e[c+3]:-1,i=c+5<p?e[c+5]:-1,a=c==0?-1:e[c-1];if(y==0&&S==y&&i==y){for(var o=c+5;o+2<p&&e[o+2]==y;)o+=2;(h=Math.min(o+1-c>>>1,138))<11?t.push(17,h-3):t.push(18,h-11),c+=2*h-2;}else if(y==a&&S==y&&i==y){for(o=c+5;o+2<p&&e[o+2]==y;)o+=2;var h=Math.min(o+1-c>>>1,6);t.push(16,h-3),c+=2*h-2;}else t.push(y,0);}return p>>>1},s.F._hufTree=function(e,t,p){var c=[],y=e.length,S=t.length,i=0;for(i=0;i<S;i+=2)t[i]=0,t[i+1]=0;for(i=0;i<y;i++)e[i]!=0&&c.push({lit:i,f:e[i]});var a=c.length,o=c.slice(0);if(a==0)return 0;if(a==1){var h=c[0].lit;return o=h==0?1:0,t[1+(h<<1)]=1,t[1+(o<<1)]=1,1}c.sort((function(U,R){return U.f-R.f}));var A=c[0],O=c[1],M=0,T=1,N=2;for(c[0]={lit:-1,f:A.f+O.f,l:A,r:O,d:0};T!=a-1;)A=M!=T&&(N==a||c[M].f<c[N].f)?c[M++]:c[N++],O=M!=T&&(N==a||c[M].f<c[N].f)?c[M++]:c[N++],c[T++]={lit:-1,f:A.f+O.f,l:A,r:O};var F=s.F.setDepth(c[T-1],0);for(F>p&&(s.F.restrictDepth(o,p,F),F=p),i=0;i<a;i++)t[1+(o[i].lit<<1)]=o[i].d;return F},s.F.setDepth=function(e,t){return e.lit!=-1?(e.d=t,t):Math.max(s.F.setDepth(e.l,t+1),s.F.setDepth(e.r,t+1))},s.F.restrictDepth=function(e,t,p){var c=0,y=1<<p-t,S=0;for(e.sort((function(a,o){return o.d==a.d?a.f-o.f:o.d-a.d})),c=0;c<e.length&&e[c].d>t;c++){var i=e[c].d;e[c].d=t,S+=y-(1<<p-i);}for(S>>>=p-t;S>0;)(i=e[c].d)<t?(e[c].d++,S-=1<<t-i-1):c++;for(;c>=0;c--)e[c].d==t&&S<0&&(e[c].d--,S++);S!=0&&console.log("debt left");},s.F._goodIndex=function(e,t){var p=0;return t[16|p]<=e&&(p|=16),t[8|p]<=e&&(p|=8),t[4|p]<=e&&(p|=4),t[2|p]<=e&&(p|=2),t[1|p]<=e&&(p|=1),p},s.F._writeLit=function(e,t,p,c){return s.F._putsF(p,c,t[e<<1]),c+t[1+(e<<1)]},s.F.inflate=function(e,t){var p=Uint8Array;if(e[0]==3&&e[1]==0)return t||new p(0);var c=s.F,y=c._bitsF,S=c._bitsE,i=c._decodeTiny,a=c.makeCodes,o=c.codes2map,h=c._get17,A=c.U,O=t==null;O&&(t=new p(e.length>>>2<<3));for(var M,T,N=0,F=0,U=0,R=0,u=0,C=0,f=0,d=0,_=0;N==0;)if(N=y(e,_,1),F=y(e,_+1,2),_+=3,F!=0){if(O&&(t=s.F._check(t,d+(1<<17))),F==1&&(M=A.flmap,T=A.fdmap,C=511,f=31),F==2){U=S(e,_,5)+257,R=S(e,_+5,5)+1,u=S(e,_+10,4)+4,_+=14;for(var l=0;l<38;l+=2)A.itree[l]=0,A.itree[l+1]=0;var w=1;for(l=0;l<u;l++){var E=S(e,_+3*l,3);A.itree[1+(A.ordr[l]<<1)]=E,E>w&&(w=E);}_+=3*u,a(A.itree,w),o(A.itree,w,A.imap),M=A.lmap,T=A.dmap,_=i(A.imap,(1<<w)-1,U+R,e,_,A.ttree);var v=c._copyOut(A.ttree,0,U,A.ltree);C=(1<<v)-1;var I=c._copyOut(A.ttree,U,R,A.dtree);f=(1<<I)-1,a(A.ltree,v),o(A.ltree,v,M),a(A.dtree,I),o(A.dtree,I,T);}for(;;){var m=M[h(e,_)&C];_+=15&m;var g=m>>>4;if(!(g>>>8))t[d++]=g;else {if(g==256)break;var D=d+g-254;if(g>264){var P=A.ldef[g-257];D=d+(P>>>3)+S(e,_,7&P),_+=7&P;}var x=T[h(e,_)&f];_+=15&x;var H=x>>>4,L=A.ddef[H],V=(L>>>4)+y(e,_,15&L);for(_+=15&L,O&&(t=s.F._check(t,d+(1<<17)));d<D;)t[d]=t[d++-V],t[d]=t[d++-V],t[d]=t[d++-V],t[d]=t[d++-V];d=D;}}}else {(7&_)!=0&&(_+=8-(7&_));var B=4+(_>>>3),k=e[B-4]|e[B-3]<<8;O&&(t=s.F._check(t,d+k)),t.set(new p(e.buffer,e.byteOffset+B,k),d),_=B+k<<3,d+=k;}return t.length==d?t:t.slice(0,d)},s.F._check=function(e,t){var p=e.length;if(t<=p)return e;var c=new Uint8Array(Math.max(p<<1,t));return c.set(e,0),c},s.F._decodeTiny=function(e,t,p,c,y,S){for(var i=s.F._bitsE,a=s.F._get17,o=0;o<p;){var h=e[a(c,y)&t];y+=15&h;var A=h>>>4;if(A<=15)S[o]=A,o++;else {var O=0,M=0;A==16?(M=3+i(c,y,2),y+=2,O=S[o-1]):A==17?(M=3+i(c,y,3),y+=3):A==18&&(M=11+i(c,y,7),y+=7);for(var T=o+M;o<T;)S[o]=O,o++;}}return y},s.F._copyOut=function(e,t,p,c){for(var y=0,S=0,i=c.length>>>1;S<p;){var a=e[S+t];c[S<<1]=0,c[1+(S<<1)]=a,a>y&&(y=a),S++;}for(;S<i;)c[S<<1]=0,c[1+(S<<1)]=0,S++;return y},s.F.makeCodes=function(e,t){for(var p,c,y,S,i=s.F.U,a=e.length,o=i.bl_count,h=0;h<=t;h++)o[h]=0;for(h=1;h<a;h+=2)o[e[h]]++;var A=i.next_code;for(p=0,o[0]=0,c=1;c<=t;c++)p=p+o[c-1]<<1,A[c]=p;for(y=0;y<a;y+=2)(S=e[y+1])!=0&&(e[y]=A[S],A[S]++);},s.F.codes2map=function(e,t,p){for(var c=e.length,y=s.F.U.rev15,S=0;S<c;S+=2)if(e[S+1]!=0)for(var i=S>>1,a=e[S+1],o=i<<4|a,h=t-a,A=e[S]<<h,O=A+(1<<h);A!=O;)p[y[A]>>>15-t]=o,A++;},s.F.revCodes=function(e,t){for(var p=s.F.U.rev15,c=15-t,y=0;y<e.length;y+=2){var S=e[y]<<t-e[y+1];e[y]=p[S]>>>c;}},s.F._putsE=function(e,t,p){p<<=7&t;var c=t>>>3;e[c]|=p,e[c+1]|=p>>>8;},s.F._putsF=function(e,t,p){p<<=7&t;var c=t>>>3;e[c]|=p,e[c+1]|=p>>>8,e[c+2]|=p>>>16;},s.F._bitsE=function(e,t,p){return (e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<p)-1},s.F._bitsF=function(e,t,p){return (e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<p)-1},s.F._get17=function(e,t){return (e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},s.F._get25=function(e,t){return (e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},s.F.U=(n=Uint16Array,b=Uint32Array,{next_code:new n(16),bl_count:new n(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[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,999,999,999],exb:[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],ldef:new n(32),df0:[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,65535,65535],dxb:[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],ddef:new b(32),flmap:new n(512),fltree:[],fdmap:new n(32),fdtree:[],lmap:new n(32768),ltree:[],ttree:[],dmap:new n(32768),dtree:[],imap:new n(512),itree:[],rev15:new n(32768),lhst:new b(286),dhst:new b(30),ihst:new b(19),lits:new b(15e3),strt:new n(65536),prev:new n(32768)}),(function(){for(var e=s.F.U,t=0;t<32768;t++){var p=t;p=(4278255360&(p=(4042322160&(p=(3435973836&(p=(2863311530&p)>>>1|(1431655765&p)<<1))>>>2|(858993459&p)<<2))>>>4|(252645135&p)<<4))>>>8|(16711935&p)<<8,e.rev15[t]=(p>>>16|p<<16)>>>17;}function c(y,S,i){for(;S--!=0;)y.push(0,i);}for(t=0;t<32;t++)e.ldef[t]=e.of0[t]<<3|e.exb[t],e.ddef[t]=e.df0[t]<<4|e.dxb[t];c(e.fltree,144,8),c(e.fltree,112,9),c(e.fltree,24,7),c(e.fltree,8,8),s.F.makeCodes(e.fltree,9),s.F.codes2map(e.fltree,9,e.flmap),s.F.revCodes(e.fltree,9),c(e.fdtree,32,5),s.F.makeCodes(e.fdtree,5),s.F.codes2map(e.fdtree,5,e.fdmap),s.F.revCodes(e.fdtree,5),c(e.itree,19,0),c(e.ltree,286,0),c(e.dtree,30,0),c(e.ttree,320,0);})();})();var Wn=Bn({__proto__:null,default:ze},[ze]),he=(function(){var r={nextZero(i,a){for(;i[a]!=0;)a++;return a},readUshort:(i,a)=>i[a]<<8|i[a+1],writeUshort(i,a,o){i[a]=o>>8&255,i[a+1]=255&o;},readUint:(i,a)=>16777216*i[a]+(i[a+1]<<16|i[a+2]<<8|i[a+3]),writeUint(i,a,o){i[a]=o>>24&255,i[a+1]=o>>16&255,i[a+2]=o>>8&255,i[a+3]=255&o;},readASCII(i,a,o){let h="";for(let A=0;A<o;A++)h+=String.fromCharCode(i[a+A]);return h},writeASCII(i,a,o){for(let h=0;h<o.length;h++)i[a+h]=o.charCodeAt(h);},readBytes(i,a,o){let h=[];for(let A=0;A<o;A++)h.push(i[a+A]);return h},pad:i=>i.length<2?`0${i}`:i,readUTF8(i,a,o){let h,A="";for(let O=0;O<o;O++)A+=`%${r.pad(i[a+O].toString(16))}`;try{h=decodeURIComponent(A);}catch{return r.readASCII(i,a,o)}return h}};function n(i,a,o,h){let A=a*o,O=t(h),M=Math.ceil(a*O/8),T=new Uint8Array(4*A),N=new Uint32Array(T.buffer),{ctype:F}=h,{depth:U}=h,R=r.readUshort;if(F==6){let P=A<<2;if(U==8)for(var u=0;u<P;u+=4)T[u]=i[u],T[u+1]=i[u+1],T[u+2]=i[u+2],T[u+3]=i[u+3];if(U==16)for(u=0;u<P;u++)T[u]=i[u<<1];}else if(F==2){let P=h.tabs.tRNS;if(P==null){if(U==8)for(u=0;u<A;u++){var C=3*u;N[u]=255<<24|i[C+2]<<16|i[C+1]<<8|i[C];}if(U==16)for(u=0;u<A;u++)C=6*u,N[u]=255<<24|i[C+4]<<16|i[C+2]<<8|i[C];}else {var f=P[0];let x=P[1],H=P[2];if(U==8)for(u=0;u<A;u++){var d=u<<2;C=3*u,N[u]=255<<24|i[C+2]<<16|i[C+1]<<8|i[C],i[C]==f&&i[C+1]==x&&i[C+2]==H&&(T[d+3]=0);}if(U==16)for(u=0;u<A;u++)d=u<<2,C=6*u,N[u]=255<<24|i[C+4]<<16|i[C+2]<<8|i[C],R(i,C)==f&&R(i,C+2)==x&&R(i,C+4)==H&&(T[d+3]=0);}}else if(F==3){let P=h.tabs.PLTE,x=h.tabs.tRNS,H=x?x.length:0;if(U==1)for(var _=0;_<o;_++){var l=_*M,w=_*a;for(u=0;u<a;u++){d=w+u<<2;var E=3*(v=i[l+(u>>3)]>>7-((7&u)<<0)&1);T[d]=P[E],T[d+1]=P[E+1],T[d+2]=P[E+2],T[d+3]=v<H?x[v]:255;}}if(U==2)for(_=0;_<o;_++)for(l=_*M,w=_*a,u=0;u<a;u++)d=w+u<<2,E=3*(v=i[l+(u>>2)]>>6-((3&u)<<1)&3),T[d]=P[E],T[d+1]=P[E+1],T[d+2]=P[E+2],T[d+3]=v<H?x[v]:255;if(U==4)for(_=0;_<o;_++)for(l=_*M,w=_*a,u=0;u<a;u++)d=w+u<<2,E=3*(v=i[l+(u>>1)]>>4-((1&u)<<2)&15),T[d]=P[E],T[d+1]=P[E+1],T[d+2]=P[E+2],T[d+3]=v<H?x[v]:255;if(U==8)for(u=0;u<A;u++){var v;d=u<<2,E=3*(v=i[u]),T[d]=P[E],T[d+1]=P[E+1],T[d+2]=P[E+2],T[d+3]=v<H?x[v]:255;}}else if(F==4){if(U==8)for(u=0;u<A;u++){d=u<<2;var I=i[m=u<<1];T[d]=I,T[d+1]=I,T[d+2]=I,T[d+3]=i[m+1];}if(U==16)for(u=0;u<A;u++){var m;d=u<<2,I=i[m=u<<2],T[d]=I,T[d+1]=I,T[d+2]=I,T[d+3]=i[m+2];}}else if(F==0)for(f=h.tabs.tRNS?h.tabs.tRNS:-1,_=0;_<o;_++){let P=_*M,x=_*a;if(U==1)for(var g=0;g<a;g++){var D=(I=255*(i[P+(g>>>3)]>>>7-(7&g)&1))==255*f?0:255;N[x+g]=D<<24|I<<16|I<<8|I;}else if(U==2)for(g=0;g<a;g++)D=(I=85*(i[P+(g>>>2)]>>>6-((3&g)<<1)&3))==85*f?0:255,N[x+g]=D<<24|I<<16|I<<8|I;else if(U==4)for(g=0;g<a;g++)D=(I=17*(i[P+(g>>>1)]>>>4-((1&g)<<2)&15))==17*f?0:255,N[x+g]=D<<24|I<<16|I<<8|I;else if(U==8)for(g=0;g<a;g++)D=(I=i[P+g])==f?0:255,N[x+g]=D<<24|I<<16|I<<8|I;else if(U==16)for(g=0;g<a;g++)I=i[P+(g<<1)],D=R(i,P+(g<<1))==f?0:255,N[x+g]=D<<24|I<<16|I<<8|I;}return T}function b(i,a,o,h){let A=t(i),O=Math.ceil(o*A/8),M=new Uint8Array((O+1+i.interlace)*h);return a=i.tabs.CgBI?e(a,M):s(a,M),i.interlace==0?a=p(a,i,0,o,h):i.interlace==1&&(a=(function(N,F){let U=F.width,R=F.height,u=t(F),C=u>>3,f=Math.ceil(U*u/8),d=new Uint8Array(R*f),_=0,l=[0,0,4,0,2,0,1],w=[0,4,0,2,0,1,0],E=[8,8,8,4,4,2,2],v=[8,8,4,4,2,2,1],I=0;for(;I<7;){let g=E[I],D=v[I],P=0,x=0,H=l[I];for(;H<R;)H+=g,x++;let L=w[I];for(;L<U;)L+=D,P++;let V=Math.ceil(P*u/8);p(N,F,_,P,x);let B=0,k=l[I];for(;k<R;){let W=w[I],K=_+B*V<<3;for(;W<U;){var m;if(u==1&&(m=(m=N[K>>3])>>7-(7&K)&1,d[k*f+(W>>3)]|=m<<7-((7&W)<<0)),u==2&&(m=(m=N[K>>3])>>6-(7&K)&3,d[k*f+(W>>2)]|=m<<6-((3&W)<<1)),u==4&&(m=(m=N[K>>3])>>4-(7&K)&15,d[k*f+(W>>1)]|=m<<4-((1&W)<<2)),u>=8){let G=k*f+W*C;for(let Q=0;Q<C;Q++)d[G+Q]=N[(K>>3)+Q];}K+=u,W+=D;}B++,k+=g;}P*x!=0&&(_+=x*(1+V)),I+=1;}return d})(a,i)),a}function s(i,a){return e(new Uint8Array(i.buffer,2,i.length-6),a)}var e=(function(){let i={H:{}};return i.H.N=function(a,o){let h=Uint8Array,A,O,M=0,T=0,N=0,F=0,U=0,R=0,u=0,C=0,f=0;if(a[0]==3&&a[1]==0)return o||new h(0);let d=i.H,_=d.b,l=d.e,w=d.R,E=d.n,v=d.A,I=d.Z,m=d.m,g=o==null;for(g&&(o=new h(a.length>>>2<<5));M==0;)if(M=_(a,f,1),T=_(a,f+1,2),f+=3,T!=0){if(g&&(o=i.H.W(o,C+(1<<17))),T==1&&(A=m.J,O=m.h,R=511,u=31),T==2){N=l(a,f,5)+257,F=l(a,f+5,5)+1,U=l(a,f+10,4)+4,f+=14;let P=1;for(var D=0;D<38;D+=2)m.Q[D]=0,m.Q[D+1]=0;for(D=0;D<U;D++){let L=l(a,f+3*D,3);m.Q[1+(m.X[D]<<1)]=L,L>P&&(P=L);}f+=3*U,E(m.Q,P),v(m.Q,P,m.u),A=m.w,O=m.d,f=w(m.u,(1<<P)-1,N+F,a,f,m.v);let x=d.V(m.v,0,N,m.C);R=(1<<x)-1;let H=d.V(m.v,N,F,m.D);u=(1<<H)-1,E(m.C,x),v(m.C,x,A),E(m.D,H),v(m.D,H,O);}for(;;){let P=A[I(a,f)&R];f+=15&P;let x=P>>>4;if(!(x>>>8))o[C++]=x;else {if(x==256)break;{let H=C+x-254;if(x>264){let W=m.q[x-257];H=C+(W>>>3)+l(a,f,7&W),f+=7&W;}let L=O[I(a,f)&u];f+=15&L;let V=L>>>4,B=m.c[V],k=(B>>>4)+_(a,f,15&B);for(f+=15&B;C<H;)o[C]=o[C++-k],o[C]=o[C++-k],o[C]=o[C++-k],o[C]=o[C++-k];C=H;}}}}else {(7&f)!=0&&(f+=8-(7&f));let P=4+(f>>>3),x=a[P-4]|a[P-3]<<8;g&&(o=i.H.W(o,C+x)),o.set(new h(a.buffer,a.byteOffset+P,x),C),f=P+x<<3,C+=x;}return o.length==C?o:o.slice(0,C)},i.H.W=function(a,o){let h=a.length;if(o<=h)return a;let A=new Uint8Array(h<<1);return A.set(a,0),A},i.H.R=function(a,o,h,A,O,M){let T=i.H.e,N=i.H.Z,F=0;for(;F<h;){let U=a[N(A,O)&o];O+=15&U;let R=U>>>4;if(R<=15)M[F]=R,F++;else {let u=0,C=0;R==16?(C=3+T(A,O,2),O+=2,u=M[F-1]):R==17?(C=3+T(A,O,3),O+=3):R==18&&(C=11+T(A,O,7),O+=7);let f=F+C;for(;F<f;)M[F]=u,F++;}}return O},i.H.V=function(a,o,h,A){let O=0,M=0,T=A.length>>>1;for(;M<h;){let N=a[M+o];A[M<<1]=0,A[1+(M<<1)]=N,N>O&&(O=N),M++;}for(;M<T;)A[M<<1]=0,A[1+(M<<1)]=0,M++;return O},i.H.n=function(a,o){let h=i.H.m,A=a.length,O,M,T,N,F=h.j;for(var U=0;U<=o;U++)F[U]=0;for(U=1;U<A;U+=2)F[a[U]]++;let R=h.K;for(O=0,F[0]=0,M=1;M<=o;M++)O=O+F[M-1]<<1,R[M]=O;for(T=0;T<A;T+=2)N=a[T+1],N!=0&&(a[T]=R[N],R[N]++);},i.H.A=function(a,o,h){let A=a.length,O=i.H.m.r;for(let M=0;M<A;M+=2)if(a[M+1]!=0){let T=M>>1,N=a[M+1],F=T<<4|N,U=o-N,R=a[M]<<U,u=R+(1<<U);for(;R!=u;)h[O[R]>>>15-o]=F,R++;}},i.H.l=function(a,o){let h=i.H.m.r,A=15-o;for(let O=0;O<a.length;O+=2){let M=a[O]<<o-a[O+1];a[O]=h[M]>>>A;}},i.H.M=function(a,o,h){h<<=7&o;let A=o>>>3;a[A]|=h,a[A+1]|=h>>>8;},i.H.I=function(a,o,h){h<<=7&o;let A=o>>>3;a[A]|=h,a[A+1]|=h>>>8,a[A+2]|=h>>>16;},i.H.e=function(a,o,h){return (a[o>>>3]|a[1+(o>>>3)]<<8)>>>(7&o)&(1<<h)-1},i.H.b=function(a,o,h){return (a[o>>>3]|a[1+(o>>>3)]<<8|a[2+(o>>>3)]<<16)>>>(7&o)&(1<<h)-1},i.H.Z=function(a,o){return (a[o>>>3]|a[1+(o>>>3)]<<8|a[2+(o>>>3)]<<16)>>>(7&o)},i.H.i=function(a,o){return (a[o>>>3]|a[1+(o>>>3)]<<8|a[2+(o>>>3)]<<16|a[3+(o>>>3)]<<24)>>>(7&o)},i.H.m=(function(){let a=Uint16Array,o=Uint32Array;return {K:new a(16),j:new a(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[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,999,999,999],T:[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],q:new a(32),p:[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,65535,65535],z:[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],c:new o(32),J:new a(512),_:[],h:new a(32),$:[],w:new a(32768),C:[],v:[],d:new a(32768),D:[],u:new a(512),Q:[],r:new a(32768),s:new o(286),Y:new o(30),a:new o(19),t:new o(15e3),k:new a(65536),g:new a(32768)}})(),(function(){let a=i.H.m;for(var o=0;o<32768;o++){let A=o;A=(2863311530&A)>>>1|(1431655765&A)<<1,A=(3435973836&A)>>>2|(858993459&A)<<2,A=(4042322160&A)>>>4|(252645135&A)<<4,A=(4278255360&A)>>>8|(16711935&A)<<8,a.r[o]=(A>>>16|A<<16)>>>17;}function h(A,O,M){for(;O--!=0;)A.push(0,M);}for(o=0;o<32;o++)a.q[o]=a.S[o]<<3|a.T[o],a.c[o]=a.p[o]<<4|a.z[o];h(a._,144,8),h(a._,112,9),h(a._,24,7),h(a._,8,8),i.H.n(a._,9),i.H.A(a._,9,a.J),i.H.l(a._,9),h(a.$,32,5),i.H.n(a.$,5),i.H.A(a.$,5,a.h),i.H.l(a.$,5),h(a.Q,19,0),h(a.C,286,0),h(a.D,30,0),h(a.v,320,0);})(),i.H.N})();function t(i){return [1,null,3,1,2,null,4][i.ctype]*i.depth}function p(i,a,o,h,A){let O=t(a),M=Math.ceil(h*O/8),T,N;O=Math.ceil(O/8);let F=i[o],U=0;if(F>1&&(i[o]=[0,0,1][F-2]),F==3)for(U=O;U<M;U++)i[U+1]=i[U+1]+(i[U+1-O]>>>1)&255;for(let R=0;R<A;R++)if(T=o+R*M,N=T+R+1,F=i[N-1],U=0,F==0)for(;U<M;U++)i[T+U]=i[N+U];else if(F==1){for(;U<O;U++)i[T+U]=i[N+U];for(;U<M;U++)i[T+U]=i[N+U]+i[T+U-O];}else if(F==2)for(;U<M;U++)i[T+U]=i[N+U]+i[T+U-M];else if(F==3){for(;U<O;U++)i[T+U]=i[N+U]+(i[T+U-M]>>>1);for(;U<M;U++)i[T+U]=i[N+U]+(i[T+U-M]+i[T+U-O]>>>1);}else {for(;U<O;U++)i[T+U]=i[N+U]+c(0,i[T+U-M],0);for(;U<M;U++)i[T+U]=i[N+U]+c(i[T+U-O],i[T+U-M],i[T+U-O-M]);}return i}function c(i,a,o){let h=i+a-o,A=h-i,O=h-a,M=h-o;return A*A<=O*O&&A*A<=M*M?i:O*O<=M*M?a:o}function y(i,a,o){o.width=r.readUint(i,a),a+=4,o.height=r.readUint(i,a),a+=4,o.depth=i[a],a++,o.ctype=i[a],a++,o.compress=i[a],a++,o.filter=i[a],a++,o.interlace=i[a],a++;}function S(i,a,o,h,A,O,M,T,N){let F=Math.min(a,A),U=Math.min(o,O),R=0,u=0;for(let I=0;I<U;I++)for(let m=0;m<F;m++)if(M>=0&&T>=0?(R=I*a+m<<2,u=(T+I)*A+M+m<<2):(R=(-T+I)*a-M+m<<2,u=I*A+m<<2),N==0)h[u]=i[R],h[u+1]=i[R+1],h[u+2]=i[R+2],h[u+3]=i[R+3];else if(N==1){var C=i[R+3]*.00392156862745098,f=i[R]*C,d=i[R+1]*C,_=i[R+2]*C,l=h[u+3]*(1/255),w=h[u]*l,E=h[u+1]*l,v=h[u+2]*l;let g=1-C,D=C+l*g,P=D==0?0:1/D;h[u+3]=255*D,h[u+0]=(f+w*g)*P,h[u+1]=(d+E*g)*P,h[u+2]=(_+v*g)*P;}else if(N==2)C=i[R+3],f=i[R],d=i[R+1],_=i[R+2],l=h[u+3],w=h[u],E=h[u+1],v=h[u+2],C==l&&f==w&&d==E&&_==v?(h[u]=0,h[u+1]=0,h[u+2]=0,h[u+3]=0):(h[u]=f,h[u+1]=d,h[u+2]=_,h[u+3]=C);else if(N==3){if(C=i[R+3],f=i[R],d=i[R+1],_=i[R+2],l=h[u+3],w=h[u],E=h[u+1],v=h[u+2],C==l&&f==w&&d==E&&_==v)continue;if(C<220&&l>20)return false}return true}return {decode:function(a){let o=new Uint8Array(a),h=8,A=r,O=A.readUshort,M=A.readUint,T={tabs:{},frames:[]},N=new Uint8Array(o.length),F,U=0,R=0,u=[137,80,78,71,13,10,26,10];for(var C=0;C<8;C++)if(o[C]!=u[C])throw "The input is not a PNG file!";for(;h<o.length;){let I=A.readUint(o,h);h+=4;let m=A.readASCII(o,h,4);if(h+=4,m=="IHDR")y(o,h,T);else if(m=="iCCP"){for(var f=h;o[f]!=0;)f++;A.readASCII(o,h,f-h),o[f+1];let g=o.slice(f+2,h+I),D=null;try{D=s(g);}catch{D=e(g);}T.tabs[m]=D;}else if(m=="CgBI")T.tabs[m]=o.slice(h,h+4);else if(m=="IDAT"){for(C=0;C<I;C++)N[U+C]=o[h+C];U+=I;}else if(m=="acTL")T.tabs[m]={num_frames:M(o,h),num_plays:M(o,h+4)},F=new Uint8Array(o.length);else if(m=="fcTL"){R!=0&&((v=T.frames[T.frames.length-1]).data=b(T,F.slice(0,R),v.rect.width,v.rect.height),R=0);let g={x:M(o,h+12),y:M(o,h+16),width:M(o,h+4),height:M(o,h+8)},D=O(o,h+22);D=O(o,h+20)/(D==0?100:D);let P={rect:g,delay:Math.round(1e3*D),dispose:o[h+24],blend:o[h+25]};T.frames.push(P);}else if(m=="fdAT"){for(C=0;C<I-4;C++)F[R+C]=o[h+C+4];R+=I-4;}else if(m=="pHYs")T.tabs[m]=[A.readUint(o,h),A.readUint(o,h+4),o[h+8]];else if(m=="cHRM")for(T.tabs[m]=[],C=0;C<8;C++)T.tabs[m].push(A.readUint(o,h+4*C));else if(m=="tEXt"||m=="zTXt"){T.tabs[m]==null&&(T.tabs[m]={});var d=A.nextZero(o,h),_=A.readASCII(o,h,d-h),l=h+I-d-1;if(m=="tEXt")E=A.readASCII(o,d+1,l);else {var w=s(o.slice(d+2,d+2+l));E=A.readUTF8(w,0,w.length);}T.tabs[m][_]=E;}else if(m=="iTXt"){T.tabs[m]==null&&(T.tabs[m]={}),d=0,f=h,d=A.nextZero(o,f),_=A.readASCII(o,f,d-f);let g=o[f=d+1];var E;o[f+1],f+=2,d=A.nextZero(o,f),A.readASCII(o,f,d-f),f=d+1,d=A.nextZero(o,f),A.readUTF8(o,f,d-f),l=I-((f=d+1)-h),g==0?E=A.readUTF8(o,f,l):(w=s(o.slice(f,f+l)),E=A.readUTF8(w,0,w.length)),T.tabs[m][_]=E;}else if(m=="PLTE")T.tabs[m]=A.readBytes(o,h,I);else if(m=="hIST"){let g=T.tabs.PLTE.length/3;for(T.tabs[m]=[],C=0;C<g;C++)T.tabs[m].push(O(o,h+2*C));}else if(m=="tRNS")T.ctype==3?T.tabs[m]=A.readBytes(o,h,I):T.ctype==0?T.tabs[m]=O(o,h):T.ctype==2&&(T.tabs[m]=[O(o,h),O(o,h+2),O(o,h+4)]);else if(m=="gAMA")T.tabs[m]=A.readUint(o,h)/1e5;else if(m=="sRGB")T.tabs[m]=o[h];else if(m=="bKGD")T.ctype==0||T.ctype==4?T.tabs[m]=[O(o,h)]:T.ctype==2||T.ctype==6?T.tabs[m]=[O(o,h),O(o,h+2),O(o,h+4)]:T.ctype==3&&(T.tabs[m]=o[h]);else if(m=="IEND")break;h+=I,A.readUint(o,h),h+=4;}var v;return R!=0&&((v=T.frames[T.frames.length-1]).data=b(T,F.slice(0,R),v.rect.width,v.rect.height)),T.data=b(T,N,T.width,T.height),delete T.compress,delete T.interlace,delete T.filter,T},toRGBA8:function(a){let o=a.width,h=a.height;if(a.tabs.acTL==null)return [n(a.data,o,h,a).buffer];let A=[];a.frames[0].data==null&&(a.frames[0].data=a.data);let O=o*h*4,M=new Uint8Array(O),T=new Uint8Array(O),N=new Uint8Array(O);for(let U=0;U<a.frames.length;U++){let R=a.frames[U],u=R.rect.x,C=R.rect.y,f=R.rect.width,d=R.rect.height,_=n(R.data,f,d,a);if(U!=0)for(var F=0;F<O;F++)N[F]=M[F];if(R.blend==0?S(_,f,d,M,o,h,u,C,0):R.blend==1&&S(_,f,d,M,o,h,u,C,1),A.push(M.buffer.slice(0)),R.dispose!=0){if(R.dispose==1)S(T,f,d,M,o,h,u,C,0);else if(R.dispose==2)for(F=0;F<O;F++)M[F]=N[F];}}return A},_paeth:c,_copyTile:S,_bin:r}})();(function(){let{_copyTile:r}=he,{_bin:n}=he,b=he._paeth;var s={table:(function(){let f=new Uint32Array(256);for(let d=0;d<256;d++){let _=d;for(let l=0;l<8;l++)1&_?_=3988292384^_>>>1:_>>>=1;f[d]=_;}return f})(),update(f,d,_,l){for(let w=0;w<l;w++)f=s.table[255&(f^d[_+w])]^f>>>8;return f},crc:(f,d,_)=>4294967295^s.update(4294967295,f,d,_)};function e(f,d,_,l){d[_]+=f[0]*l>>4,d[_+1]+=f[1]*l>>4,d[_+2]+=f[2]*l>>4,d[_+3]+=f[3]*l>>4;}function t(f){return Math.max(0,Math.min(255,f))}function p(f,d){let _=f[0]-d[0],l=f[1]-d[1],w=f[2]-d[2],E=f[3]-d[3];return _*_+l*l+w*w+E*E}function c(f,d,_,l,w,E,v){v==null&&(v=1);let I=l.length,m=[];for(var g=0;g<I;g++){let k=l[g];m.push([k>>>0&255,k>>>8&255,k>>>16&255,k>>>24&255]);}for(g=0;g<I;g++){let k=4294967295;for(var D=0,P=0;P<I;P++){var x=p(m[g],m[P]);P!=g&&x<k&&(k=x,D=P);}}let H=new Uint32Array(w.buffer),L=new Int16Array(d*_*4),V=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(g=0;g<V.length;g++)V[g]=255*((V[g]+.5)/16-.5);for(let k=0;k<_;k++)for(let W=0;W<d;W++){var B;g=4*(k*d+W),v!=2?B=[t(f[g]+L[g]),t(f[g+1]+L[g+1]),t(f[g+2]+L[g+2]),t(f[g+3]+L[g+3])]:(x=V[4*(3&k)+(3&W)],B=[t(f[g]+x),t(f[g+1]+x),t(f[g+2]+x),t(f[g+3]+x)]),D=0;let K=16777215;for(P=0;P<I;P++){let q=p(B,m[P]);q<K&&(K=q,D=P);}let G=m[D],Q=[B[0]-G[0],B[1]-G[1],B[2]-G[2],B[3]-G[3]];v==1&&(W!=d-1&&e(Q,L,g+4,7),k!=_-1&&(W!=0&&e(Q,L,g+4*d-4,3),e(Q,L,g+4*d,5),W!=d-1&&e(Q,L,g+4*d+4,1))),E[g>>2]=D,H[g>>2]=l[D];}}function y(f,d,_,l,w){w==null&&(w={});let{crc:E}=s,v=n.writeUint,I=n.writeUshort,m=n.writeASCII,g=8,D=f.frames.length>1,P,x=false,H=33+(D?20:0);if(w.sRGB!=null&&(H+=13),w.pHYs!=null&&(H+=21),w.iCCP!=null&&(P=pako.deflate(w.iCCP),H+=21+P.length+4),f.ctype==3){for(var L=f.plte.length,V=0;V<L;V++)f.plte[V]>>>24!=255&&(x=true);H+=8+3*L+4+(x?8+1*L+4:0);}for(var B=0;B<f.frames.length;B++)D&&(H+=38),H+=(G=f.frames[B]).cimg.length+12,B!=0&&(H+=4);H+=12;let k=new Uint8Array(H),W=[137,80,78,71,13,10,26,10];for(V=0;V<8;V++)k[V]=W[V];if(v(k,g,13),g+=4,m(k,g,"IHDR"),g+=4,v(k,g,d),g+=4,v(k,g,_),g+=4,k[g]=f.depth,g++,k[g]=f.ctype,g++,k[g]=0,g++,k[g]=0,g++,k[g]=0,g++,v(k,g,E(k,g-17,17)),g+=4,w.sRGB!=null&&(v(k,g,1),g+=4,m(k,g,"sRGB"),g+=4,k[g]=w.sRGB,g++,v(k,g,E(k,g-5,5)),g+=4),w.iCCP!=null){let Q=13+P.length;v(k,g,Q),g+=4,m(k,g,"iCCP"),g+=4,m(k,g,"ICC profile"),g+=11,g+=2,k.set(P,g),g+=P.length,v(k,g,E(k,g-(Q+4),Q+4)),g+=4;}if(w.pHYs!=null&&(v(k,g,9),g+=4,m(k,g,"pHYs"),g+=4,v(k,g,w.pHYs[0]),g+=4,v(k,g,w.pHYs[1]),g+=4,k[g]=w.pHYs[2],g++,v(k,g,E(k,g-13,13)),g+=4),D&&(v(k,g,8),g+=4,m(k,g,"acTL"),g+=4,v(k,g,f.frames.length),g+=4,v(k,g,w.loop!=null?w.loop:0),g+=4,v(k,g,E(k,g-12,12)),g+=4),f.ctype==3){for(v(k,g,3*(L=f.plte.length)),g+=4,m(k,g,"PLTE"),g+=4,V=0;V<L;V++){let Q=3*V,q=f.plte[V],z=255&q,$=q>>>8&255,ie=q>>>16&255;k[g+Q+0]=z,k[g+Q+1]=$,k[g+Q+2]=ie;}if(g+=3*L,v(k,g,E(k,g-3*L-4,3*L+4)),g+=4,x){for(v(k,g,L),g+=4,m(k,g,"tRNS"),g+=4,V=0;V<L;V++)k[g+V]=f.plte[V]>>>24&255;g+=L,v(k,g,E(k,g-L-4,L+4)),g+=4;}}let K=0;for(B=0;B<f.frames.length;B++){var G=f.frames[B];D&&(v(k,g,26),g+=4,m(k,g,"fcTL"),g+=4,v(k,g,K++),g+=4,v(k,g,G.rect.width),g+=4,v(k,g,G.rect.height),g+=4,v(k,g,G.rect.x),g+=4,v(k,g,G.rect.y),g+=4,I(k,g,l[B]),g+=2,I(k,g,1e3),g+=2,k[g]=G.dispose,g++,k[g]=G.blend,g++,v(k,g,E(k,g-30,30)),g+=4);let Q=G.cimg;v(k,g,(L=Q.length)+(B==0?0:4)),g+=4;let q=g;m(k,g,B==0?"IDAT":"fdAT"),g+=4,B!=0&&(v(k,g,K++),g+=4),k.set(Q,g),g+=L,v(k,g,E(k,q,g-q)),g+=4;}return v(k,g,0),g+=4,m(k,g,"IEND"),g+=4,v(k,g,E(k,g-4,4)),g+=4,k.buffer}function S(f,d,_){for(let l=0;l<f.frames.length;l++){let w=f.frames[l];w.rect.width;let E=w.rect.height,v=new Uint8Array(E*w.bpl+E);w.cimg=h(w.img,E,w.bpp,w.bpl,v,d,_);}}function i(f,d,_,l,w){let E=w[0],v=w[1],I=w[2],m=w[3],g=w[4],D=w[5],P=6,x=8,H=255;for(var L=0;L<f.length;L++){let te=new Uint8Array(f[L]);for(var V=te.length,B=0;B<V;B+=4)H&=te[B+3];}let k=H!=255,W=(function(X,J,ne,oe,j,ue){let ee=[];for(var Y=0;Y<X.length;Y++){let ce=new Uint8Array(X[Y]),pe=new Uint32Array(ce.buffer);var le;let de=0,ve=0,me=J,Ie=ne,nt=oe?1:0;if(Y!=0){let xn=ue||oe||Y==1||ee[Y-2].dispose!=0?1:2,rt=0,Ot=1e9;for(let Le=0;Le<xn;Le++){var ge=new Uint8Array(X[Y-1-Le]);let Mn=new Uint32Array(X[Y-1-Le]),_e=J,be=ne,Me=-1,ke=-1;for(let Re=0;Re<ne;Re++)for(let Oe=0;Oe<J;Oe++)pe[se=Re*J+Oe]!=Mn[se]&&(Oe<_e&&(_e=Oe),Oe>Me&&(Me=Oe),Re<be&&(be=Re),Re>ke&&(ke=Re));Me==-1&&(_e=be=Me=ke=0),j&&((1&_e)==1&&_e--,(1&be)==1&&be--);let Pt=(Me-_e+1)*(ke-be+1);Pt<Ot&&(Ot=Pt,rt=Le,de=_e,ve=be,me=Me-_e+1,Ie=ke-be+1);}ge=new Uint8Array(X[Y-1-rt]),rt==1&&(ee[Y-1].dispose=2),le=new Uint8Array(me*Ie*4),r(ge,J,ne,le,me,Ie,-de,-ve,0),nt=r(ce,J,ne,le,me,Ie,-de,-ve,3)?1:0,nt==1?o(ce,J,ne,le,{x:de,y:ve,width:me,height:Ie}):r(ce,J,ne,le,me,Ie,-de,-ve,0);}else le=ce.slice(0);ee.push({rect:{x:de,y:ve,width:me,height:Ie},img:le,blend:nt,dispose:0});}if(oe)for(Y=0;Y<ee.length;Y++){if((Te=ee[Y]).blend==1)continue;let ce=Te.rect,pe=ee[Y-1].rect,de=Math.min(ce.x,pe.x),ve=Math.min(ce.y,pe.y),me={x:de,y:ve,width:Math.max(ce.x+ce.width,pe.x+pe.width)-de,height:Math.max(ce.y+ce.height,pe.y+pe.height)-ve};ee[Y-1].dispose=1,Y-1!=0&&a(X,J,ne,ee,Y-1,me,j),a(X,J,ne,ee,Y,me,j);}let $e=0;if(X.length!=1)for(var se=0;se<ee.length;se++){var Te;$e+=(Te=ee[se]).rect.width*Te.rect.height;}return ee})(f,d,_,E,v,I),K={},G=[],Q=[];if(l!=0){let te=[];for(B=0;B<W.length;B++)te.push(W[B].img.buffer);let X=(function(j){let ue=0;for(var ee=0;ee<j.length;ee++)ue+=j[ee].byteLength;let Y=new Uint8Array(ue),le=0;for(ee=0;ee<j.length;ee++){let ge=new Uint8Array(j[ee]),$e=ge.length;for(let se=0;se<$e;se+=4){let Te=ge[se],ce=ge[se+1],pe=ge[se+2],de=ge[se+3];de==0&&(Te=ce=pe=0),Y[le+se]=Te,Y[le+se+1]=ce,Y[le+se+2]=pe,Y[le+se+3]=de;}le+=$e;}return Y.buffer})(te),J=O(X,l);for(B=0;B<J.plte.length;B++)G.push(J.plte[B].est.rgba);let ne=0;for(B=0;B<W.length;B++){let oe=(z=W[B]).img.length;var q=new Uint8Array(J.inds.buffer,ne>>2,oe>>2);Q.push(q);let j=new Uint8Array(J.abuf,ne,oe);D&&c(z.img,z.rect.width,z.rect.height,G,j,q),z.img.set(j),ne+=oe;}}else for(L=0;L<W.length;L++){var z=W[L];let te=new Uint32Array(z.img.buffer);var $=z.rect.width;for(V=te.length,q=new Uint8Array(V),Q.push(q),B=0;B<V;B++){let X=te[B];if(B!=0&&X==te[B-1])q[B]=q[B-1];else if(B>$&&X==te[B-$])q[B]=q[B-$];else {let J=K[X];if(J==null&&(K[X]=J=G.length,G.push(X),G.length>=300))break;q[B]=J;}}}let ie=G.length;for(ie<=256&&g==0&&(x=ie<=2?1:ie<=4?2:ie<=16?4:8,x=Math.max(x,m)),L=0;L<W.length;L++){(z=W[L]).rect.x,z.rect.y,$=z.rect.width;let te=z.rect.height,X=z.img;new Uint32Array(X.buffer);let J=4*$,ne=4;if(ie<=256&&g==0){J=Math.ceil(x*$/8);var ae=new Uint8Array(J*te);let oe=Q[L];for(let j=0;j<te;j++){B=j*J;let ue=j*$;if(x==8)for(var Z=0;Z<$;Z++)ae[B+Z]=oe[ue+Z];else if(x==4)for(Z=0;Z<$;Z++)ae[B+(Z>>1)]|=oe[ue+Z]<<4-4*(1&Z);else if(x==2)for(Z=0;Z<$;Z++)ae[B+(Z>>2)]|=oe[ue+Z]<<6-2*(3&Z);else if(x==1)for(Z=0;Z<$;Z++)ae[B+(Z>>3)]|=oe[ue+Z]<<7-1*(7&Z);}X=ae,P=3,ne=1;}else if(k==0&&W.length==1){ae=new Uint8Array($*te*3);let oe=$*te;for(B=0;B<oe;B++){let j=3*B,ue=4*B;ae[j]=X[ue],ae[j+1]=X[ue+1],ae[j+2]=X[ue+2];}X=ae,P=2,ne=3,J=3*$;}z.img=X,z.bpl=J,z.bpp=ne;}return {ctype:P,depth:x,plte:G,frames:W}}function a(f,d,_,l,w,E,v){let I=Uint8Array,m=Uint32Array,g=new I(f[w-1]),D=new m(f[w-1]),P=w+1<f.length?new I(f[w+1]):null,x=new I(f[w]),H=new m(x.buffer),L=d,V=_,B=-1,k=-1;for(let K=0;K<E.height;K++)for(let G=0;G<E.width;G++){let Q=E.x+G,q=E.y+K,z=q*d+Q,$=H[z];$==0||l[w-1].dispose==0&&D[z]==$&&(P==null||P[4*z+3]!=0)||(Q<L&&(L=Q),Q>B&&(B=Q),q<V&&(V=q),q>k&&(k=q));}B==-1&&(L=V=B=k=0),v&&((1&L)==1&&L--,(1&V)==1&&V--),E={x:L,y:V,width:B-L+1,height:k-V+1};let W=l[w];W.rect=E,W.blend=1,W.img=new Uint8Array(E.width*E.height*4),l[w-1].dispose==0?(r(g,d,_,W.img,E.width,E.height,-E.x,-E.y,0),o(x,d,_,W.img,E)):r(x,d,_,W.img,E.width,E.height,-E.x,-E.y,0);}function o(f,d,_,l,w){r(f,d,_,l,w.width,w.height,-w.x,-w.y,2);}function h(f,d,_,l,w,E,v){let I=[],m,g=[0,1,2,3,4];E!=-1?g=[E]:(d*l>5e5||_==1)&&(g=[0]),v&&(m={level:0});let D=Wn;for(var P=0;P<g.length;P++){for(let L=0;L<d;L++)A(w,f,L,l,_,g[P]);I.push(D.deflate(w,m));}let x,H=1e9;for(P=0;P<I.length;P++)I[P].length<H&&(x=P,H=I[P].length);return I[x]}function A(f,d,_,l,w,E){let v=_*l,I=v+_;if(f[I]=E,I++,E==0)if(l<500)for(var m=0;m<l;m++)f[I+m]=d[v+m];else f.set(new Uint8Array(d.buffer,v,l),I);else if(E==1){for(m=0;m<w;m++)f[I+m]=d[v+m];for(m=w;m<l;m++)f[I+m]=d[v+m]-d[v+m-w]+256&255;}else if(_==0){for(m=0;m<w;m++)f[I+m]=d[v+m];if(E==2)for(m=w;m<l;m++)f[I+m]=d[v+m];if(E==3)for(m=w;m<l;m++)f[I+m]=d[v+m]-(d[v+m-w]>>1)+256&255;if(E==4)for(m=w;m<l;m++)f[I+m]=d[v+m]-b(d[v+m-w],0,0)+256&255;}else {if(E==2)for(m=0;m<l;m++)f[I+m]=d[v+m]+256-d[v+m-l]&255;if(E==3){for(m=0;m<w;m++)f[I+m]=d[v+m]+256-(d[v+m-l]>>1)&255;for(m=w;m<l;m++)f[I+m]=d[v+m]+256-(d[v+m-l]+d[v+m-w]>>1)&255;}if(E==4){for(m=0;m<w;m++)f[I+m]=d[v+m]+256-b(0,d[v+m-l],0)&255;for(m=w;m<l;m++)f[I+m]=d[v+m]+256-b(d[v+m-w],d[v+m-l],d[v+m-w-l])&255;}}}function O(f,d){let _=new Uint8Array(f),l=_.slice(0),w=new Uint32Array(l.buffer),E=M(l,d),v=E[0],I=E[1],m=_.length,g=new Uint8Array(m>>2),D;if(_.length<2e7)for(var P=0;P<m;P+=4)D=T(v,x=_[P]*(1/255),H=_[P+1]*(1/255),L=_[P+2]*(1/255),V=_[P+3]*(1/255)),g[P>>2]=D.ind,w[P>>2]=D.est.rgba;else for(P=0;P<m;P+=4){var x=_[P]*.00392156862745098,H=_[P+1]*(1/255),L=_[P+2]*(1/255),V=_[P+3]*(1/255);for(D=v;D.left;)D=N(D.est,x,H,L,V)<=0?D.left:D.right;g[P>>2]=D.ind,w[P>>2]=D.est.rgba;}return {abuf:l.buffer,inds:g,plte:I}}function M(f,d,_){_==null&&(_=1e-4);let l=new Uint32Array(f.buffer),w={i0:0,i1:f.length,bst:null,est:null,tdst:0,left:null,right:null};w.bst=R(f,w.i0,w.i1),w.est=u(w.bst);let E=[w];for(;E.length<d;){let I=0,m=0;for(var v=0;v<E.length;v++)E[v].est.L>I&&(I=E[v].est.L,m=v);if(I<_)break;let g=E[m],D=F(f,l,g.i0,g.i1,g.est.e,g.est.eMq255);if(g.i0>=D||g.i1<=D){g.est.L=0;continue}let P={i0:g.i0,i1:D,bst:null,est:null,tdst:0,left:null,right:null};P.bst=R(f,P.i0,P.i1),P.est=u(P.bst);let x={i0:D,i1:g.i1,bst:null,est:null,tdst:0,left:null,right:null};for(x.bst={R:[],m:[],N:g.bst.N-P.bst.N},v=0;v<16;v++)x.bst.R[v]=g.bst.R[v]-P.bst.R[v];for(v=0;v<4;v++)x.bst.m[v]=g.bst.m[v]-P.bst.m[v];x.est=u(x.bst),g.left=P,g.right=x,E[m]=P,E.push(x);}for(E.sort(((I,m)=>m.bst.N-I.bst.N)),v=0;v<E.length;v++)E[v].ind=v;return [w,E]}function T(f,d,_,l,w){if(f.left==null)return f.tdst=(function(P,x,H,L,V){let B=x-P[0],k=H-P[1],W=L-P[2],K=V-P[3];return B*B+k*k+W*W+K*K})(f.est.q,d,_,l,w),f;let E=N(f.est,d,_,l,w),v=f.left,I=f.right;E>0&&(v=f.right,I=f.left);let m=T(v,d,_,l,w);if(m.tdst<=E*E)return m;let g=T(I,d,_,l,w);return g.tdst<m.tdst?g:m}function N(f,d,_,l,w){let{e:E}=f;return E[0]*d+E[1]*_+E[2]*l+E[3]*w-f.eMq}function F(f,d,_,l,w,E){for(l-=4;_<l;){for(;U(f,_,w)<=E;)_+=4;for(;U(f,l,w)>E;)l-=4;if(_>=l)break;let v=d[_>>2];d[_>>2]=d[l>>2],d[l>>2]=v,_+=4,l-=4;}for(;U(f,_,w)>E;)_-=4;return _+4}function U(f,d,_){return f[d]*_[0]+f[d+1]*_[1]+f[d+2]*_[2]+f[d+3]*_[3]}function R(f,d,_){let l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],w=[0,0,0,0],E=_-d>>2;for(let v=d;v<_;v+=4){let I=f[v]*.00392156862745098,m=f[v+1]*(1/255),g=f[v+2]*(1/255),D=f[v+3]*(1/255);w[0]+=I,w[1]+=m,w[2]+=g,w[3]+=D,l[0]+=I*I,l[1]+=I*m,l[2]+=I*g,l[3]+=I*D,l[5]+=m*m,l[6]+=m*g,l[7]+=m*D,l[10]+=g*g,l[11]+=g*D,l[15]+=D*D;}return l[4]=l[1],l[8]=l[2],l[9]=l[6],l[12]=l[3],l[13]=l[7],l[14]=l[11],{R:l,m:w,N:E}}function u(f){let{R:d}=f,{m:_}=f,{N:l}=f,w=_[0],E=_[1],v=_[2],I=_[3],m=l==0?0:1/l,g=[d[0]-w*w*m,d[1]-w*E*m,d[2]-w*v*m,d[3]-w*I*m,d[4]-E*w*m,d[5]-E*E*m,d[6]-E*v*m,d[7]-E*I*m,d[8]-v*w*m,d[9]-v*E*m,d[10]-v*v*m,d[11]-v*I*m,d[12]-I*w*m,d[13]-I*E*m,d[14]-I*v*m,d[15]-I*I*m],D=g,P=C,x=[Math.random(),Math.random(),Math.random(),Math.random()],H=0,L=0;if(l!=0)for(let B=0;B<16&&(x=P.multVec(D,x),L=Math.sqrt(P.dot(x,x)),x=P.sml(1/L,x),!(B!=0&&Math.abs(L-H)<1e-9));B++)H=L;let V=[w*m,E*m,v*m,I*m];return {Cov:g,q:V,e:x,L:H,eMq255:P.dot(P.sml(255,V),x),eMq:P.dot(x,V),rgba:(Math.round(255*V[3])<<24|Math.round(255*V[2])<<16|Math.round(255*V[1])<<8|Math.round(255*V[0])<<0)>>>0}}var C={multVec:(f,d)=>[f[0]*d[0]+f[1]*d[1]+f[2]*d[2]+f[3]*d[3],f[4]*d[0]+f[5]*d[1]+f[6]*d[2]+f[7]*d[3],f[8]*d[0]+f[9]*d[1]+f[10]*d[2]+f[11]*d[3],f[12]*d[0]+f[13]*d[1]+f[14]*d[2]+f[15]*d[3]],dot:(f,d)=>f[0]*d[0]+f[1]*d[1]+f[2]*d[2]+f[3]*d[3],sml:(f,d)=>[f*d[0],f*d[1],f*d[2],f*d[3]]};he.encode=function(d,_,l,w,E,v,I){w==null&&(w=0),I==null&&(I=false);let m=i(d,_,l,w,[false,false,false,0,I,false]);return S(m,-1),y(m,_,l,E,v)},he.encodeLL=function(d,_,l,w,E,v,I,m){let g={ctype:0+(w==1?0:2)+(E==0?0:4),depth:v,frames:[]},D=(w+E)*v,P=D*_;for(let x=0;x<d.length;x++)g.frames.push({rect:{x:0,y:0,width:_,height:l},img:new Uint8Array(d[x]),blend:0,dispose:1,bpp:Math.ceil(D/8),bpl:Math.ceil(P/8)});return S(g,0,true),y(g,_,l,I,m)},he.encode.compress=i,he.encode.dither=c,he.quantize=O,he.quantize.getKDtree=M,he.quantize.getNearest=T;})();var Lt={toArrayBuffer(r,n){let b=r.width,s=r.height,e=b<<2,t=r.getContext("2d").getImageData(0,0,b,s),p=new Uint32Array(t.data.buffer),c=(32*b+31)/32<<2,y=c*s,S=122+y,i=new ArrayBuffer(S),a=new DataView(i),o=1<<20,h,A,O,M,T=o,N=0,F=0,U=0;function R(f){a.setUint16(F,f,true),F+=2;}function u(f){a.setUint32(F,f,true),F+=4;}function C(f){F+=f;}R(19778),u(S),C(4),u(122),u(108),u(b),u(-s>>>0),R(1),R(32),u(3),u(y),u(2835),u(2835),C(8),u(16711680),u(65280),u(255),u(4278190080),u(1466527264),(function f(){for(;N<s&&T>0;){for(M=122+N*c,h=0;h<e;)T--,A=p[U++],O=A>>>24,a.setUint32(M+h,A<<8|O),h+=4;N++;}U<p.length?(T=o,setTimeout(f,Lt._dly)):n(i);})();},toBlob(r,n){this.toArrayBuffer(r,(b=>{n(new Blob([b],{type:"image/bmp"}));}));},_dly:9},fe={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},$n={[fe.CHROME]:16384,[fe.FIREFOX]:11180,[fe.DESKTOP_SAFARI]:16384,[fe.IE]:8192,[fe.IOS]:4096,[fe.ETC]:8192},at=typeof globalThis.window<"u",kt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Ge=at&&globalThis.window.cordova&&globalThis.window.cordova.require&&globalThis.window.cordova.require("cordova/modulemapper"),Qn=(at||kt)&&(Ge&&Ge.getOriginalSymbol(globalThis.window,"File")||typeof File<"u"&&File),Ft=(at||kt)&&(Ge&&Ge.getOriginalSymbol(globalThis.window,"FileReader")||typeof globalThis.FileReader<"u"&&globalThis.FileReader);function st(r,n,b=Date.now()){return new Promise((s=>{let e=r.split(","),t=e[0].match(/:(.*?);/)[1],p=globalThis.atob(e[1]),c=p.length,y=new Uint8Array(c);for(;c--;)y[c]=p.charCodeAt(c);let S=new Blob([y],{type:t});S.name=n,S.lastModified=b,s(S);}))}function Nt(r){return new Promise(((n,b)=>{let s=new Ft;s.onload=()=>n(s.result),s.onerror=e=>b(e),s.readAsDataURL(r);}))}function Bt(r){return new Promise(((n,b)=>{let s=new globalThis.Image;s.onload=()=>n(s),s.onerror=e=>b(e),s.src=r;}))}function Pe(){if(Pe.cachedResult!==void 0)return Pe.cachedResult;let r=fe.ETC,{userAgent:n}=navigator;return /Chrom(e|ium)/i.test(n)?r=fe.CHROME:/iP(ad|od|hone)/i.test(n)&&/WebKit/i.test(n)?r=fe.IOS:/Safari/i.test(n)?r=fe.DESKTOP_SAFARI:/Firefox/i.test(n)?r=fe.FIREFOX:(/MSIE/i.test(n)||globalThis.document.documentMode)&&(r=fe.IE),Pe.cachedResult=r,Pe.cachedResult}function Ht(r,n){let b=Pe(),s=$n[b],e=r,t=n,p=e*t,c=e>t?t/e:e/t;for(;p>s*s;){let y=(s+e)/2,S=(s+t)/2;y<S?(t=S,e=S*c):(t=y*c,e=y),p=e*t;}return {width:e,height:t}}function Ye(r,n){let b,s;try{if(b=new OffscreenCanvas(r,n),s=b.getContext("2d"),s===null)throw new Error("getContext of OffscreenCanvas returns null")}catch{b=globalThis.document.createElement("canvas"),s=b.getContext("2d");}return b.width=r,b.height=n,[b,s]}function Vt(r,n){let{width:b,height:s}=Ht(r.width,r.height),[e,t]=Ye(b,s);return n&&/jpe?g/.test(n)&&(t.fillStyle="white",t.fillRect(0,0,e.width,e.height)),t.drawImage(r,0,0,e.width,e.height),e}function Qe(){return Qe.cachedResult!==void 0||(Qe.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&typeof globalThis.document<"u"&&"ontouchend"in globalThis.document),Qe.cachedResult}function qe(r,n={}){return new Promise((function(b,s){let e,t;var p=function(){try{return t=Vt(e,n.fileType||r.type),b([e,t])}catch(y){return s(y)}},c=function(y){try{var S=function(i){try{throw i}catch(a){return s(a)}};try{let i;return Nt(r).then((function(a){try{return i=a,Bt(i).then((function(o){try{return e=o,(function(){try{return p()}catch(h){return s(h)}})()}catch(h){return S(h)}}),S)}catch(o){return S(o)}}),S)}catch(i){S(i);}}catch(i){return s(i)}};try{if(Qe()||[fe.DESKTOP_SAFARI,fe.MOBILE_SAFARI].includes(Pe()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(r).then((function(y){try{return e=y,p()}catch{return c()}}),c)}catch{c();}}))}function Ke(r,n,b,s,e=1){return new Promise((function(t,p){let c;if(n==="image/png"){let a,o,h;return a=r.getContext("2d"),{data:o}=a.getImageData(0,0,r.width,r.height),h=he.encode([o.buffer],r.width,r.height,4096*e),c=new Blob([h],{type:n}),c.name=b,c.lastModified=s,y.call(this)}{let a=function(){return y.call(this)};if(n==="image/bmp")return new Promise((o=>Lt.toBlob(r,o))).then(function(o){try{return c=o,c.name=b,c.lastModified=s,a.call(this)}catch(h){return p(h)}}.bind(this),p);{let o=function(){return a.call(this)};if(typeof OffscreenCanvas=="function"&&r instanceof OffscreenCanvas)return r.convertToBlob({type:n,quality:e}).then(function(h){try{return c=h,c.name=b,c.lastModified=s,o.call(this)}catch(A){return p(A)}}.bind(this),p);{let h;return h=r.toDataURL(n,e),st(h,b,s).then(function(A){try{return c=A,o.call(this)}catch(O){return p(O)}}.bind(this),p)}}}function y(){return t(c)}}))}function ye(r){r.width=0,r.height=0;}function Ue(){return new Promise((function(r,n){let s,e,t,p;return Ue.cachedResult!==void 0?r(Ue.cachedResult):(st("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(c){try{return s=c,qe(s).then((function(y){try{return e=y[1],Ke(e,s.type,s.name,s.lastModified).then((function(S){try{return t=S,ye(e),qe(t).then((function(i){try{return p=i[0],Ue.cachedResult=p.width===1&&p.height===2,r(Ue.cachedResult)}catch(a){return n(a)}}),n)}catch(i){return n(i)}}),n)}catch(S){return n(S)}}),n)}catch(y){return n(y)}}),n))}))}function Wt(r){return new Promise(((n,b)=>{let s=new Ft;s.onload=e=>{let t=new DataView(e.target.result);if(t.getUint16(0,false)!=65496)return n(-2);let p=t.byteLength,c=2;for(;c<p;){if(t.getUint16(c+2,false)<=8)return n(-1);let y=t.getUint16(c,false);if(c+=2,y==65505){if(t.getUint32(c+=2,false)!=1165519206)return n(-1);let S=t.getUint16(c+=6,false)==18761;c+=t.getUint32(c+4,S);let i=t.getUint16(c,S);c+=2;for(let a=0;a<i;a++)if(t.getUint16(c+12*a,S)==274)return n(t.getUint16(c+12*a+8,S))}else {if((65280&y)!=65280)break;c+=t.getUint16(c,false);}}return n(-1)},s.onerror=e=>b(e),s.readAsArrayBuffer(r);}))}function $t(r,n){let{width:b}=r,{height:s}=r,{maxWidthOrHeight:e}=n,t,p=r;return isFinite(e)&&(b>e||s>e)&&([p,t]=Ye(b,s),b>s?(p.width=e,p.height=s/b*e):(p.width=b/s*e,p.height=e),t.drawImage(r,0,0,p.width,p.height),ye(r)),p}function Qt(r,n){let{width:b}=r,{height:s}=r,[e,t]=Ye(b,s);switch(n>4&&n<9?(e.width=s,e.height=b):(e.width=b,e.height=s),n){case 2:t.transform(-1,0,0,1,b,0);break;case 3:t.transform(-1,0,0,-1,b,s);break;case 4:t.transform(1,0,0,-1,0,s);break;case 5:t.transform(0,1,1,0,0,0);break;case 6:t.transform(0,1,-1,0,s,0);break;case 7:t.transform(0,-1,-1,0,s,b);break;case 8:t.transform(0,-1,1,0,0,b);}return t.drawImage(r,0,0,b,s),ye(r),e}function Ut(r,n,b=0){return new Promise((function(s,e){let t,p,c,y,S,i,a,o,h,A,O,M,T,N,F,U,R,u,C,f;function d(l=5){if(n.signal&&n.signal.aborted)throw n.signal.reason;t+=l,n.onProgress(Math.min(t,100));}function _(l){if(n.signal&&n.signal.aborted)throw n.signal.reason;t=Math.min(Math.max(l,t),100),n.onProgress(t);}return t=b,p=n.maxIteration||10,c=1024*n.maxSizeMB*1024,d(),qe(r,n).then(function(l){try{return [,y]=l,d(),S=$t(y,n),d(),new Promise((function(w,E){var v;if(!(v=n.exifOrientation))return Wt(r).then(function(m){try{return v=m,I.call(this)}catch(g){return E(g)}}.bind(this),E);function I(){return w(v)}return I.call(this)})).then(function(w){try{return i=w,d(),Ue().then(function(E){try{return a=E?S:Qt(S,i),d(),o=n.initialQuality||1,h=n.fileType||r.type,Ke(a,h,r.name,r.lastModified,o).then(function(v){try{{let D=function(){if(p--&&(F>c||F>T)){let x,H;return x=f?.95*C.width:C.width,H=f?.95*C.height:C.height,[R,u]=Ye(x,H),u.drawImage(C,0,0,x,H),o*=h==="image/png"?.85:.95,Ke(R,h,r.name,r.lastModified,o).then((function(L){try{return U=L,ye(C),C=R,F=U.size,_(Math.min(99,Math.floor((N-F)/(N-c)*100))),D}catch(V){return e(V)}}),e)}return [1]},P=function(){return ye(C),ye(R),ye(S),ye(a),ye(y),_(100),s(U)};var m=D,g=P;if(A=v,d(),O=A.size>c,M=A.size>r.size,!O&&!M)return _(100),s(A);var I;return T=r.size,N=A.size,F=N,C=a,f=!n.alwaysKeepResolution&&O,(I=function(x){for(;x;){if(x.then)return void x.then(I,e);try{if(x.pop){if(x.length)return x.pop()?P.call(this):x;x=D;}else x=x.call(this);}catch(H){return e(H)}}}.bind(this))(D)}}catch(D){return e(D)}}.bind(this),e)}catch(v){return e(v)}}.bind(this),e)}catch(E){return e(E)}}.bind(this),e)}catch(w){return e(w)}}.bind(this),e)}))}var zn=`
5
+ `+n.prev}function Xe(r,n){var b=yt(r),s=[];if(b){s.length=r.length;for(var e=0;e<r.length;e++)s[e]=Ae(r,e)?n(r[e],r):"";}var t=typeof dt=="function"?dt(r):[],p;if(De){p={};for(var u=0;u<t.length;u++)p["$"+t[u]]=t[u];}for(var w in r)Ae(r,w)&&(b&&String(Number(w))===w&&w<r.length||De&&p["$"+w]instanceof Symbol||(an.call(/[^\w$]/,w)?s.push(n(w,r)+": "+n(r[w],r)):s.push(w+": "+n(r[w],r))));if(typeof dt=="function")for(var S=0;S<t.length;S++)sn.call(r,t[S])&&s.push("["+n(t[S])+"]: "+n(r[t[S]],r));return s}});function Nn(r,n){return n.forEach((function(b){b&&typeof b!="string"&&!Array.isArray(b)&&Object.keys(b).forEach((function(s){if(s!=="default"&&!(s in r)){var e=Object.getOwnPropertyDescriptor(b,s);Object.defineProperty(r,s,e.get?e:{enumerable:true,get:function(){return b[s]}});}}));})),Object.freeze(r)}function Dt(r,n){return new Promise((function(b,s){let e;return Bn(r).then((function(t){try{return e=t,b(new Blob([n.slice(0,2),e,n.slice(2)],{type:"image/jpeg"}))}catch(p){return s(p)}}),s)}))}var Bn=r=>new Promise(((n,b)=>{let s=new globalThis.FileReader;s.addEventListener("load",(({target:{result:e}})=>{let t=new DataView(e),p=0;if(t.getUint16(p)!==65496)return b("not a valid JPEG");for(p+=2;;){let u=t.getUint16(p);if(u===65498)break;let w=t.getUint16(p+2);if(u===65505&&t.getUint32(p+4)===1165519206){let S=p+10,i;switch(t.getUint16(S)){case 18761:i=true;break;case 19789:i=false;break;default:return b("TIFF header contains invalid endian")}if(t.getUint16(S+2,i)!==42)return b("TIFF header contains invalid version");let a=t.getUint32(S+4,i),o=S+a+2+12*t.getUint16(S+a,i);for(let l=S+a+2;l<o;l+=12)if(t.getUint16(l,i)==274){if(t.getUint16(l+2,i)!==3)return b("Orientation data type is invalid");if(t.getUint32(l+4,i)!==1)return b("Orientation data count is invalid");t.setUint16(l+8,1,i);break}return n(e.slice(p,p+2+w))}p+=2+w;}return n(new Blob)})),s.readAsArrayBuffer(r);})),ze={},Hn={get exports(){return ze},set exports(r){ze=r;}};(function(r){var n,b,s={};Hn.exports=s,s.parse=function(e,t){for(var p=s.bin.readUshort,u=s.bin.readUint,w=0,S={},i=new Uint8Array(e),a=i.length-4;u(i,a)!=101010256;)a--;w=a,w+=4;var o=p(i,w+=4);p(i,w+=2);var l=u(i,w+=2),y=u(i,w+=4);w+=4,w=y;for(var C=0;C<o;C++){u(i,w),w+=4,w+=4,w+=4,u(i,w+=4),l=u(i,w+=4);var U=u(i,w+=4),T=p(i,w+=4),N=p(i,w+2),F=p(i,w+4);w+=6;var M=u(i,w+=8);w+=4,w+=T+N+F,s._readLocal(i,M,S,l,U,t);}return S},s._readLocal=function(e,t,p,u,w,S){var i=s.bin.readUshort,a=s.bin.readUint;a(e,t),i(e,t+=4),i(e,t+=2);var o=i(e,t+=2);a(e,t+=2),a(e,t+=4),t+=4;var l=i(e,t+=8),y=i(e,t+=2);t+=2;var C=s.bin.readUTF8(e,t,l);if(t+=l,t+=y,S)p[C]={size:w,csize:u};else {var U=new Uint8Array(e.buffer,t);if(o==0)p[C]=new Uint8Array(U.buffer.slice(t,t+u));else {if(o!=8)throw "unknown compression method: "+o;var T=new Uint8Array(w);s.inflateRaw(U,T),p[C]=T;}}},s.inflateRaw=function(e,t){return s.F.inflate(e,t)},s.inflate=function(e,t){return e[0],e[1],s.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),t)},s.deflate=function(e,t){t==null&&(t={level:6});var p=0,u=new Uint8Array(50+Math.floor(1.1*e.length));u[p]=120,u[p+1]=156,p+=2,p=s.F.deflateRaw(e,u,p,t.level);var w=s.adler(e,0,e.length);return u[p+0]=w>>>24&255,u[p+1]=w>>>16&255,u[p+2]=w>>>8&255,u[p+3]=w>>>0&255,new Uint8Array(u.buffer,0,p+4)},s.deflateRaw=function(e,t){t==null&&(t={level:6});var p=new Uint8Array(50+Math.floor(1.1*e.length)),u=s.F.deflateRaw(e,p,u,t.level);return new Uint8Array(p.buffer,0,u)},s.encode=function(e,t){t==null&&(t=false);var p=0,u=s.bin.writeUint,w=s.bin.writeUshort,S={};for(var i in e){var a=!s._noNeed(i)&&!t,o=e[i],l=s.crc.crc(o,0,o.length);S[i]={cpr:a,usize:o.length,crc:l,file:a?s.deflateRaw(o):o};}for(var i in S)p+=S[i].file.length+30+46+2*s.bin.sizeUTF8(i);p+=22;var y=new Uint8Array(p),C=0,U=[];for(var i in S){var T=S[i];U.push(C),C=s._writeHeader(y,C,i,T,0);}var N=0,F=C;for(var i in S)T=S[i],U.push(C),C=s._writeHeader(y,C,i,T,1,U[N++]);var M=C-F;return u(y,C,101010256),C+=4,w(y,C+=4,N),w(y,C+=2,N),u(y,C+=2,M),u(y,C+=4,F),C+=4,C+=2,y.buffer},s._noNeed=function(e){var t=e.split(".").pop().toLowerCase();return "png,jpg,jpeg,zip".indexOf(t)!=-1},s._writeHeader=function(e,t,p,u,w,S){var i=s.bin.writeUint,a=s.bin.writeUshort,o=u.file;return i(e,t,w==0?67324752:33639248),t+=4,w==1&&(t+=2),a(e,t,20),a(e,t+=2,0),a(e,t+=2,u.cpr?8:0),i(e,t+=2,0),i(e,t+=4,u.crc),i(e,t+=4,o.length),i(e,t+=4,u.usize),a(e,t+=4,s.bin.sizeUTF8(p)),a(e,t+=2,0),t+=2,w==1&&(t+=2,t+=2,i(e,t+=6,S),t+=4),t+=s.bin.writeUTF8(e,t,p),w==0&&(e.set(o,t),t+=o.length),t},s.crc={table:(function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var p=t,u=0;u<8;u++)1&p?p=3988292384^p>>>1:p>>>=1;e[t]=p;}return e})(),update:function(e,t,p,u){for(var w=0;w<u;w++)e=s.crc.table[255&(e^t[p+w])]^e>>>8;return e},crc:function(e,t,p){return 4294967295^s.crc.update(4294967295,e,t,p)}},s.adler=function(e,t,p){for(var u=1,w=0,S=t,i=t+p;S<i;){for(var a=Math.min(S+5552,i);S<a;)w+=u+=e[S++];u%=65521,w%=65521;}return w<<16|u},s.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,p){e[t]=255&p,e[t+1]=p>>8&255;},readUint:function(e,t){return 16777216*e[t+3]+(e[t+2]<<16|e[t+1]<<8|e[t])},writeUint:function(e,t,p){e[t]=255&p,e[t+1]=p>>8&255,e[t+2]=p>>16&255,e[t+3]=p>>24&255;},readASCII:function(e,t,p){for(var u="",w=0;w<p;w++)u+=String.fromCharCode(e[t+w]);return u},writeASCII:function(e,t,p){for(var u=0;u<p.length;u++)e[t+u]=p.charCodeAt(u);},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,p){for(var u,w="",S=0;S<p;S++)w+="%"+s.bin.pad(e[t+S].toString(16));try{u=decodeURIComponent(w);}catch{return s.bin.readASCII(e,t,p)}return u},writeUTF8:function(e,t,p){for(var u=p.length,w=0,S=0;S<u;S++){var i=p.charCodeAt(S);if((4294967168&i)==0)e[t+w]=i,w++;else if((4294965248&i)==0)e[t+w]=192|i>>6,e[t+w+1]=128|i>>0&63,w+=2;else if((4294901760&i)==0)e[t+w]=224|i>>12,e[t+w+1]=128|i>>6&63,e[t+w+2]=128|i>>0&63,w+=3;else {if((4292870144&i)!=0)throw "e";e[t+w]=240|i>>18,e[t+w+1]=128|i>>12&63,e[t+w+2]=128|i>>6&63,e[t+w+3]=128|i>>0&63,w+=4;}}return w},sizeUTF8:function(e){for(var t=e.length,p=0,u=0;u<t;u++){var w=e.charCodeAt(u);if((4294967168&w)==0)p++;else if((4294965248&w)==0)p+=2;else if((4294901760&w)==0)p+=3;else {if((4292870144&w)!=0)throw "e";p+=4;}}return p}},s.F={},s.F.deflateRaw=function(e,t,p,u){var w=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][u],S=s.F.U,i=s.F._goodIndex;s.F._hash;var a=s.F._putsE,o=0,l=p<<3,y=0,C=e.length;if(u==0){for(;o<C;)a(t,l,o+(c=Math.min(65535,C-o))==C?1:0),l=s.F._copyExact(e,o,c,t,l+8),o+=c;return l>>>3}var U=S.lits,T=S.strt,N=S.prev,F=0,M=0,R=0,h=0,O=0,d=0;for(C>2&&(T[d=s.F._hash(e,0)]=0),o=0;o<C;o++){if(O=d,o+1<C-2){d=s.F._hash(e,o+1);var f=o+1&32767;N[f]=T[d],T[d]=f;}if(y<=o){(F>14e3||M>26697)&&C-o>100&&(y<o&&(U[F]=o-y,F+=2,y=o),l=s.F._writeBlock(o==C-1||y==C?1:0,U,F,h,e,R,o-R,t,l),F=M=h=0,R=o);var _=0;o<C-2&&(_=s.F._bestMatch(e,o,N,O,Math.min(w[2],C-o),w[3]));var c=_>>>16,v=65535&_;if(_!=0){v=65535&_;var E=i(c=_>>>16,S.of0);S.lhst[257+E]++;var A=i(v,S.df0);S.dhst[A]++,h+=S.exb[E]+S.dxb[A],U[F]=c<<23|o-y,U[F+1]=v<<16|E<<8|A,F+=2,y=o+c;}else S.lhst[e[o]]++;M++;}}for(R==o&&e.length!=0||(y<o&&(U[F]=o-y,F+=2,y=o),l=s.F._writeBlock(1,U,F,h,e,R,o-R,t,l),F=0,M=0,F=M=h=0,R=o);(7&l)!=0;)l++;return l>>>3},s.F._bestMatch=function(e,t,p,u,w,S){var i=32767&t,a=p[i],o=i-a+32768&32767;if(a==i||u!=s.F._hash(e,t-o))return 0;for(var l=0,y=0,C=Math.min(32767,t);o<=C&&--S!=0&&a!=i;){if(l==0||e[t+l]==e[t+l-o]){var U=s.F._howLong(e,t,o);if(U>l){if(y=o,(l=U)>=w)break;o+2<U&&(U=o+2);for(var T=0,N=0;N<U-2;N++){var F=t-o+N+32768&32767,M=F-p[F]+32768&32767;M>T&&(T=M,a=F);}}}o+=(i=a)-(a=p[i])+32768&32767;}return l<<16|y},s.F._howLong=function(e,t,p){if(e[t]!=e[t-p]||e[t+1]!=e[t+1-p]||e[t+2]!=e[t+2-p])return 0;var u=t,w=Math.min(e.length,t+258);for(t+=3;t<w&&e[t]==e[t-p];)t++;return t-u},s.F._hash=function(e,t){return (e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},s.saved=0,s.F._writeBlock=function(e,t,p,u,w,S,i,a,o){var l,y,C,U,T,N,F,M,R,h=s.F.U,O=s.F._putsF,d=s.F._putsE;h.lhst[256]++,y=(l=s.F.getTrees())[0],C=l[1],U=l[2],T=l[3],N=l[4],F=l[5],M=l[6],R=l[7];var f=32+((o+3&7)==0?0:8-(o+3&7))+(i<<3),_=u+s.F.contSize(h.fltree,h.lhst)+s.F.contSize(h.fdtree,h.dhst),c=u+s.F.contSize(h.ltree,h.lhst)+s.F.contSize(h.dtree,h.dhst);c+=14+3*F+s.F.contSize(h.itree,h.ihst)+(2*h.ihst[16]+3*h.ihst[17]+7*h.ihst[18]);for(var v=0;v<286;v++)h.lhst[v]=0;for(v=0;v<30;v++)h.dhst[v]=0;for(v=0;v<19;v++)h.ihst[v]=0;var E=f<_&&f<c?0:_<c?1:2;if(O(a,o,e),O(a,o+1,E),o+=3,E==0){for(;(7&o)!=0;)o++;o=s.F._copyExact(w,S,i,a,o);}else {var A,I;if(E==1&&(A=h.fltree,I=h.fdtree),E==2){s.F.makeCodes(h.ltree,y),s.F.revCodes(h.ltree,y),s.F.makeCodes(h.dtree,C),s.F.revCodes(h.dtree,C),s.F.makeCodes(h.itree,U),s.F.revCodes(h.itree,U),A=h.ltree,I=h.dtree,d(a,o,T-257),d(a,o+=5,N-1),d(a,o+=5,F-4),o+=4;for(var m=0;m<F;m++)d(a,o+3*m,h.itree[1+(h.ordr[m]<<1)]);o+=3*F,o=s.F._codeTiny(M,h.itree,a,o),o=s.F._codeTiny(R,h.itree,a,o);}for(var g=S,D=0;D<p;D+=2){for(var P=t[D],x=P>>>23,H=g+(8388607&P);g<H;)o=s.F._writeLit(w[g++],A,a,o);if(x!=0){var L=t[D+1],V=L>>16,B=L>>8&255,k=255&L;d(a,o=s.F._writeLit(257+B,A,a,o),x-h.of0[B]),o+=h.exb[B],O(a,o=s.F._writeLit(k,I,a,o),V-h.df0[k]),o+=h.dxb[k],g+=x;}}o=s.F._writeLit(256,A,a,o);}return o},s.F._copyExact=function(e,t,p,u,w){var S=w>>>3;return u[S]=p,u[S+1]=p>>>8,u[S+2]=255-u[S],u[S+3]=255-u[S+1],S+=4,u.set(new Uint8Array(e.buffer,t,p),S),w+(p+4<<3)},s.F.getTrees=function(){for(var e=s.F.U,t=s.F._hufTree(e.lhst,e.ltree,15),p=s.F._hufTree(e.dhst,e.dtree,15),u=[],w=s.F._lenCodes(e.ltree,u),S=[],i=s.F._lenCodes(e.dtree,S),a=0;a<u.length;a+=2)e.ihst[u[a]]++;for(a=0;a<S.length;a+=2)e.ihst[S[a]]++;for(var o=s.F._hufTree(e.ihst,e.itree,7),l=19;l>4&&e.itree[1+(e.ordr[l-1]<<1)]==0;)l--;return [t,p,o,w,i,l,u,S]},s.F.getSecond=function(e){for(var t=[],p=0;p<e.length;p+=2)t.push(e[p+1]);return t},s.F.nonZero=function(e){for(var t="",p=0;p<e.length;p+=2)e[p+1]!=0&&(t+=(p>>1)+",");return t},s.F.contSize=function(e,t){for(var p=0,u=0;u<t.length;u++)p+=t[u]*e[1+(u<<1)];return p},s.F._codeTiny=function(e,t,p,u){for(var w=0;w<e.length;w+=2){var S=e[w],i=e[w+1];u=s.F._writeLit(S,t,p,u);var a=S==16?2:S==17?3:7;S>15&&(s.F._putsE(p,u,i,a),u+=a);}return u},s.F._lenCodes=function(e,t){for(var p=e.length;p!=2&&e[p-1]==0;)p-=2;for(var u=0;u<p;u+=2){var w=e[u+1],S=u+3<p?e[u+3]:-1,i=u+5<p?e[u+5]:-1,a=u==0?-1:e[u-1];if(w==0&&S==w&&i==w){for(var o=u+5;o+2<p&&e[o+2]==w;)o+=2;(l=Math.min(o+1-u>>>1,138))<11?t.push(17,l-3):t.push(18,l-11),u+=2*l-2;}else if(w==a&&S==w&&i==w){for(o=u+5;o+2<p&&e[o+2]==w;)o+=2;var l=Math.min(o+1-u>>>1,6);t.push(16,l-3),u+=2*l-2;}else t.push(w,0);}return p>>>1},s.F._hufTree=function(e,t,p){var u=[],w=e.length,S=t.length,i=0;for(i=0;i<S;i+=2)t[i]=0,t[i+1]=0;for(i=0;i<w;i++)e[i]!=0&&u.push({lit:i,f:e[i]});var a=u.length,o=u.slice(0);if(a==0)return 0;if(a==1){var l=u[0].lit;return o=l==0?1:0,t[1+(l<<1)]=1,t[1+(o<<1)]=1,1}u.sort((function(M,R){return M.f-R.f}));var y=u[0],C=u[1],U=0,T=1,N=2;for(u[0]={lit:-1,f:y.f+C.f,l:y,r:C,d:0};T!=a-1;)y=U!=T&&(N==a||u[U].f<u[N].f)?u[U++]:u[N++],C=U!=T&&(N==a||u[U].f<u[N].f)?u[U++]:u[N++],u[T++]={lit:-1,f:y.f+C.f,l:y,r:C};var F=s.F.setDepth(u[T-1],0);for(F>p&&(s.F.restrictDepth(o,p,F),F=p),i=0;i<a;i++)t[1+(o[i].lit<<1)]=o[i].d;return F},s.F.setDepth=function(e,t){return e.lit!=-1?(e.d=t,t):Math.max(s.F.setDepth(e.l,t+1),s.F.setDepth(e.r,t+1))},s.F.restrictDepth=function(e,t,p){var u=0,w=1<<p-t,S=0;for(e.sort((function(a,o){return o.d==a.d?a.f-o.f:o.d-a.d})),u=0;u<e.length&&e[u].d>t;u++){var i=e[u].d;e[u].d=t,S+=w-(1<<p-i);}for(S>>>=p-t;S>0;)(i=e[u].d)<t?(e[u].d++,S-=1<<t-i-1):u++;for(;u>=0;u--)e[u].d==t&&S<0&&(e[u].d--,S++);S!=0&&console.log("debt left");},s.F._goodIndex=function(e,t){var p=0;return t[16|p]<=e&&(p|=16),t[8|p]<=e&&(p|=8),t[4|p]<=e&&(p|=4),t[2|p]<=e&&(p|=2),t[1|p]<=e&&(p|=1),p},s.F._writeLit=function(e,t,p,u){return s.F._putsF(p,u,t[e<<1]),u+t[1+(e<<1)]},s.F.inflate=function(e,t){var p=Uint8Array;if(e[0]==3&&e[1]==0)return t||new p(0);var u=s.F,w=u._bitsF,S=u._bitsE,i=u._decodeTiny,a=u.makeCodes,o=u.codes2map,l=u._get17,y=u.U,C=t==null;C&&(t=new p(e.length>>>2<<3));for(var U,T,N=0,F=0,M=0,R=0,h=0,O=0,d=0,f=0,_=0;N==0;)if(N=w(e,_,1),F=w(e,_+1,2),_+=3,F!=0){if(C&&(t=s.F._check(t,f+(1<<17))),F==1&&(U=y.flmap,T=y.fdmap,O=511,d=31),F==2){M=S(e,_,5)+257,R=S(e,_+5,5)+1,h=S(e,_+10,4)+4,_+=14;for(var c=0;c<38;c+=2)y.itree[c]=0,y.itree[c+1]=0;var v=1;for(c=0;c<h;c++){var E=S(e,_+3*c,3);y.itree[1+(y.ordr[c]<<1)]=E,E>v&&(v=E);}_+=3*h,a(y.itree,v),o(y.itree,v,y.imap),U=y.lmap,T=y.dmap,_=i(y.imap,(1<<v)-1,M+R,e,_,y.ttree);var A=u._copyOut(y.ttree,0,M,y.ltree);O=(1<<A)-1;var I=u._copyOut(y.ttree,M,R,y.dtree);d=(1<<I)-1,a(y.ltree,A),o(y.ltree,A,U),a(y.dtree,I),o(y.dtree,I,T);}for(;;){var m=U[l(e,_)&O];_+=15&m;var g=m>>>4;if(!(g>>>8))t[f++]=g;else {if(g==256)break;var D=f+g-254;if(g>264){var P=y.ldef[g-257];D=f+(P>>>3)+S(e,_,7&P),_+=7&P;}var x=T[l(e,_)&d];_+=15&x;var H=x>>>4,L=y.ddef[H],V=(L>>>4)+w(e,_,15&L);for(_+=15&L,C&&(t=s.F._check(t,f+(1<<17)));f<D;)t[f]=t[f++-V],t[f]=t[f++-V],t[f]=t[f++-V],t[f]=t[f++-V];f=D;}}}else {(7&_)!=0&&(_+=8-(7&_));var B=4+(_>>>3),k=e[B-4]|e[B-3]<<8;C&&(t=s.F._check(t,f+k)),t.set(new p(e.buffer,e.byteOffset+B,k),f),_=B+k<<3,f+=k;}return t.length==f?t:t.slice(0,f)},s.F._check=function(e,t){var p=e.length;if(t<=p)return e;var u=new Uint8Array(Math.max(p<<1,t));return u.set(e,0),u},s.F._decodeTiny=function(e,t,p,u,w,S){for(var i=s.F._bitsE,a=s.F._get17,o=0;o<p;){var l=e[a(u,w)&t];w+=15&l;var y=l>>>4;if(y<=15)S[o]=y,o++;else {var C=0,U=0;y==16?(U=3+i(u,w,2),w+=2,C=S[o-1]):y==17?(U=3+i(u,w,3),w+=3):y==18&&(U=11+i(u,w,7),w+=7);for(var T=o+U;o<T;)S[o]=C,o++;}}return w},s.F._copyOut=function(e,t,p,u){for(var w=0,S=0,i=u.length>>>1;S<p;){var a=e[S+t];u[S<<1]=0,u[1+(S<<1)]=a,a>w&&(w=a),S++;}for(;S<i;)u[S<<1]=0,u[1+(S<<1)]=0,S++;return w},s.F.makeCodes=function(e,t){for(var p,u,w,S,i=s.F.U,a=e.length,o=i.bl_count,l=0;l<=t;l++)o[l]=0;for(l=1;l<a;l+=2)o[e[l]]++;var y=i.next_code;for(p=0,o[0]=0,u=1;u<=t;u++)p=p+o[u-1]<<1,y[u]=p;for(w=0;w<a;w+=2)(S=e[w+1])!=0&&(e[w]=y[S],y[S]++);},s.F.codes2map=function(e,t,p){for(var u=e.length,w=s.F.U.rev15,S=0;S<u;S+=2)if(e[S+1]!=0)for(var i=S>>1,a=e[S+1],o=i<<4|a,l=t-a,y=e[S]<<l,C=y+(1<<l);y!=C;)p[w[y]>>>15-t]=o,y++;},s.F.revCodes=function(e,t){for(var p=s.F.U.rev15,u=15-t,w=0;w<e.length;w+=2){var S=e[w]<<t-e[w+1];e[w]=p[S]>>>u;}},s.F._putsE=function(e,t,p){p<<=7&t;var u=t>>>3;e[u]|=p,e[u+1]|=p>>>8;},s.F._putsF=function(e,t,p){p<<=7&t;var u=t>>>3;e[u]|=p,e[u+1]|=p>>>8,e[u+2]|=p>>>16;},s.F._bitsE=function(e,t,p){return (e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<p)-1},s.F._bitsF=function(e,t,p){return (e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<p)-1},s.F._get17=function(e,t){return (e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},s.F._get25=function(e,t){return (e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},s.F.U=(n=Uint16Array,b=Uint32Array,{next_code:new n(16),bl_count:new n(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[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,999,999,999],exb:[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],ldef:new n(32),df0:[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,65535,65535],dxb:[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],ddef:new b(32),flmap:new n(512),fltree:[],fdmap:new n(32),fdtree:[],lmap:new n(32768),ltree:[],ttree:[],dmap:new n(32768),dtree:[],imap:new n(512),itree:[],rev15:new n(32768),lhst:new b(286),dhst:new b(30),ihst:new b(19),lits:new b(15e3),strt:new n(65536),prev:new n(32768)}),(function(){for(var e=s.F.U,t=0;t<32768;t++){var p=t;p=(4278255360&(p=(4042322160&(p=(3435973836&(p=(2863311530&p)>>>1|(1431655765&p)<<1))>>>2|(858993459&p)<<2))>>>4|(252645135&p)<<4))>>>8|(16711935&p)<<8,e.rev15[t]=(p>>>16|p<<16)>>>17;}function u(w,S,i){for(;S--!=0;)w.push(0,i);}for(t=0;t<32;t++)e.ldef[t]=e.of0[t]<<3|e.exb[t],e.ddef[t]=e.df0[t]<<4|e.dxb[t];u(e.fltree,144,8),u(e.fltree,112,9),u(e.fltree,24,7),u(e.fltree,8,8),s.F.makeCodes(e.fltree,9),s.F.codes2map(e.fltree,9,e.flmap),s.F.revCodes(e.fltree,9),u(e.fdtree,32,5),s.F.makeCodes(e.fdtree,5),s.F.codes2map(e.fdtree,5,e.fdmap),s.F.revCodes(e.fdtree,5),u(e.itree,19,0),u(e.ltree,286,0),u(e.dtree,30,0),u(e.ttree,320,0);})();})();var Vn=Nn({__proto__:null,default:ze},[ze]),he=(function(){var r={nextZero(i,a){for(;i[a]!=0;)a++;return a},readUshort:(i,a)=>i[a]<<8|i[a+1],writeUshort(i,a,o){i[a]=o>>8&255,i[a+1]=255&o;},readUint:(i,a)=>16777216*i[a]+(i[a+1]<<16|i[a+2]<<8|i[a+3]),writeUint(i,a,o){i[a]=o>>24&255,i[a+1]=o>>16&255,i[a+2]=o>>8&255,i[a+3]=255&o;},readASCII(i,a,o){let l="";for(let y=0;y<o;y++)l+=String.fromCharCode(i[a+y]);return l},writeASCII(i,a,o){for(let l=0;l<o.length;l++)i[a+l]=o.charCodeAt(l);},readBytes(i,a,o){let l=[];for(let y=0;y<o;y++)l.push(i[a+y]);return l},pad:i=>i.length<2?`0${i}`:i,readUTF8(i,a,o){let l,y="";for(let C=0;C<o;C++)y+=`%${r.pad(i[a+C].toString(16))}`;try{l=decodeURIComponent(y);}catch{return r.readASCII(i,a,o)}return l}};function n(i,a,o,l){let y=a*o,C=t(l),U=Math.ceil(a*C/8),T=new Uint8Array(4*y),N=new Uint32Array(T.buffer),{ctype:F}=l,{depth:M}=l,R=r.readUshort;if(F==6){let P=y<<2;if(M==8)for(var h=0;h<P;h+=4)T[h]=i[h],T[h+1]=i[h+1],T[h+2]=i[h+2],T[h+3]=i[h+3];if(M==16)for(h=0;h<P;h++)T[h]=i[h<<1];}else if(F==2){let P=l.tabs.tRNS;if(P==null){if(M==8)for(h=0;h<y;h++){var O=3*h;N[h]=255<<24|i[O+2]<<16|i[O+1]<<8|i[O];}if(M==16)for(h=0;h<y;h++)O=6*h,N[h]=255<<24|i[O+4]<<16|i[O+2]<<8|i[O];}else {var d=P[0];let x=P[1],H=P[2];if(M==8)for(h=0;h<y;h++){var f=h<<2;O=3*h,N[h]=255<<24|i[O+2]<<16|i[O+1]<<8|i[O],i[O]==d&&i[O+1]==x&&i[O+2]==H&&(T[f+3]=0);}if(M==16)for(h=0;h<y;h++)f=h<<2,O=6*h,N[h]=255<<24|i[O+4]<<16|i[O+2]<<8|i[O],R(i,O)==d&&R(i,O+2)==x&&R(i,O+4)==H&&(T[f+3]=0);}}else if(F==3){let P=l.tabs.PLTE,x=l.tabs.tRNS,H=x?x.length:0;if(M==1)for(var _=0;_<o;_++){var c=_*U,v=_*a;for(h=0;h<a;h++){f=v+h<<2;var E=3*(A=i[c+(h>>3)]>>7-((7&h)<<0)&1);T[f]=P[E],T[f+1]=P[E+1],T[f+2]=P[E+2],T[f+3]=A<H?x[A]:255;}}if(M==2)for(_=0;_<o;_++)for(c=_*U,v=_*a,h=0;h<a;h++)f=v+h<<2,E=3*(A=i[c+(h>>2)]>>6-((3&h)<<1)&3),T[f]=P[E],T[f+1]=P[E+1],T[f+2]=P[E+2],T[f+3]=A<H?x[A]:255;if(M==4)for(_=0;_<o;_++)for(c=_*U,v=_*a,h=0;h<a;h++)f=v+h<<2,E=3*(A=i[c+(h>>1)]>>4-((1&h)<<2)&15),T[f]=P[E],T[f+1]=P[E+1],T[f+2]=P[E+2],T[f+3]=A<H?x[A]:255;if(M==8)for(h=0;h<y;h++){var A;f=h<<2,E=3*(A=i[h]),T[f]=P[E],T[f+1]=P[E+1],T[f+2]=P[E+2],T[f+3]=A<H?x[A]:255;}}else if(F==4){if(M==8)for(h=0;h<y;h++){f=h<<2;var I=i[m=h<<1];T[f]=I,T[f+1]=I,T[f+2]=I,T[f+3]=i[m+1];}if(M==16)for(h=0;h<y;h++){var m;f=h<<2,I=i[m=h<<2],T[f]=I,T[f+1]=I,T[f+2]=I,T[f+3]=i[m+2];}}else if(F==0)for(d=l.tabs.tRNS?l.tabs.tRNS:-1,_=0;_<o;_++){let P=_*U,x=_*a;if(M==1)for(var g=0;g<a;g++){var D=(I=255*(i[P+(g>>>3)]>>>7-(7&g)&1))==255*d?0:255;N[x+g]=D<<24|I<<16|I<<8|I;}else if(M==2)for(g=0;g<a;g++)D=(I=85*(i[P+(g>>>2)]>>>6-((3&g)<<1)&3))==85*d?0:255,N[x+g]=D<<24|I<<16|I<<8|I;else if(M==4)for(g=0;g<a;g++)D=(I=17*(i[P+(g>>>1)]>>>4-((1&g)<<2)&15))==17*d?0:255,N[x+g]=D<<24|I<<16|I<<8|I;else if(M==8)for(g=0;g<a;g++)D=(I=i[P+g])==d?0:255,N[x+g]=D<<24|I<<16|I<<8|I;else if(M==16)for(g=0;g<a;g++)I=i[P+(g<<1)],D=R(i,P+(g<<1))==d?0:255,N[x+g]=D<<24|I<<16|I<<8|I;}return T}function b(i,a,o,l){let y=t(i),C=Math.ceil(o*y/8),U=new Uint8Array((C+1+i.interlace)*l);return a=i.tabs.CgBI?e(a,U):s(a,U),i.interlace==0?a=p(a,i,0,o,l):i.interlace==1&&(a=(function(N,F){let M=F.width,R=F.height,h=t(F),O=h>>3,d=Math.ceil(M*h/8),f=new Uint8Array(R*d),_=0,c=[0,0,4,0,2,0,1],v=[0,4,0,2,0,1,0],E=[8,8,8,4,4,2,2],A=[8,8,4,4,2,2,1],I=0;for(;I<7;){let g=E[I],D=A[I],P=0,x=0,H=c[I];for(;H<R;)H+=g,x++;let L=v[I];for(;L<M;)L+=D,P++;let V=Math.ceil(P*h/8);p(N,F,_,P,x);let B=0,k=c[I];for(;k<R;){let W=v[I],K=_+B*V<<3;for(;W<M;){var m;if(h==1&&(m=(m=N[K>>3])>>7-(7&K)&1,f[k*d+(W>>3)]|=m<<7-((7&W)<<0)),h==2&&(m=(m=N[K>>3])>>6-(7&K)&3,f[k*d+(W>>2)]|=m<<6-((3&W)<<1)),h==4&&(m=(m=N[K>>3])>>4-(7&K)&15,f[k*d+(W>>1)]|=m<<4-((1&W)<<2)),h>=8){let G=k*d+W*O;for(let Q=0;Q<O;Q++)f[G+Q]=N[(K>>3)+Q];}K+=h,W+=D;}B++,k+=g;}P*x!=0&&(_+=x*(1+V)),I+=1;}return f})(a,i)),a}function s(i,a){return e(new Uint8Array(i.buffer,2,i.length-6),a)}var e=(function(){let i={H:{}};return i.H.N=function(a,o){let l=Uint8Array,y,C,U=0,T=0,N=0,F=0,M=0,R=0,h=0,O=0,d=0;if(a[0]==3&&a[1]==0)return o||new l(0);let f=i.H,_=f.b,c=f.e,v=f.R,E=f.n,A=f.A,I=f.Z,m=f.m,g=o==null;for(g&&(o=new l(a.length>>>2<<5));U==0;)if(U=_(a,d,1),T=_(a,d+1,2),d+=3,T!=0){if(g&&(o=i.H.W(o,O+(1<<17))),T==1&&(y=m.J,C=m.h,R=511,h=31),T==2){N=c(a,d,5)+257,F=c(a,d+5,5)+1,M=c(a,d+10,4)+4,d+=14;let P=1;for(var D=0;D<38;D+=2)m.Q[D]=0,m.Q[D+1]=0;for(D=0;D<M;D++){let L=c(a,d+3*D,3);m.Q[1+(m.X[D]<<1)]=L,L>P&&(P=L);}d+=3*M,E(m.Q,P),A(m.Q,P,m.u),y=m.w,C=m.d,d=v(m.u,(1<<P)-1,N+F,a,d,m.v);let x=f.V(m.v,0,N,m.C);R=(1<<x)-1;let H=f.V(m.v,N,F,m.D);h=(1<<H)-1,E(m.C,x),A(m.C,x,y),E(m.D,H),A(m.D,H,C);}for(;;){let P=y[I(a,d)&R];d+=15&P;let x=P>>>4;if(!(x>>>8))o[O++]=x;else {if(x==256)break;{let H=O+x-254;if(x>264){let W=m.q[x-257];H=O+(W>>>3)+c(a,d,7&W),d+=7&W;}let L=C[I(a,d)&h];d+=15&L;let V=L>>>4,B=m.c[V],k=(B>>>4)+_(a,d,15&B);for(d+=15&B;O<H;)o[O]=o[O++-k],o[O]=o[O++-k],o[O]=o[O++-k],o[O]=o[O++-k];O=H;}}}}else {(7&d)!=0&&(d+=8-(7&d));let P=4+(d>>>3),x=a[P-4]|a[P-3]<<8;g&&(o=i.H.W(o,O+x)),o.set(new l(a.buffer,a.byteOffset+P,x),O),d=P+x<<3,O+=x;}return o.length==O?o:o.slice(0,O)},i.H.W=function(a,o){let l=a.length;if(o<=l)return a;let y=new Uint8Array(l<<1);return y.set(a,0),y},i.H.R=function(a,o,l,y,C,U){let T=i.H.e,N=i.H.Z,F=0;for(;F<l;){let M=a[N(y,C)&o];C+=15&M;let R=M>>>4;if(R<=15)U[F]=R,F++;else {let h=0,O=0;R==16?(O=3+T(y,C,2),C+=2,h=U[F-1]):R==17?(O=3+T(y,C,3),C+=3):R==18&&(O=11+T(y,C,7),C+=7);let d=F+O;for(;F<d;)U[F]=h,F++;}}return C},i.H.V=function(a,o,l,y){let C=0,U=0,T=y.length>>>1;for(;U<l;){let N=a[U+o];y[U<<1]=0,y[1+(U<<1)]=N,N>C&&(C=N),U++;}for(;U<T;)y[U<<1]=0,y[1+(U<<1)]=0,U++;return C},i.H.n=function(a,o){let l=i.H.m,y=a.length,C,U,T,N,F=l.j;for(var M=0;M<=o;M++)F[M]=0;for(M=1;M<y;M+=2)F[a[M]]++;let R=l.K;for(C=0,F[0]=0,U=1;U<=o;U++)C=C+F[U-1]<<1,R[U]=C;for(T=0;T<y;T+=2)N=a[T+1],N!=0&&(a[T]=R[N],R[N]++);},i.H.A=function(a,o,l){let y=a.length,C=i.H.m.r;for(let U=0;U<y;U+=2)if(a[U+1]!=0){let T=U>>1,N=a[U+1],F=T<<4|N,M=o-N,R=a[U]<<M,h=R+(1<<M);for(;R!=h;)l[C[R]>>>15-o]=F,R++;}},i.H.l=function(a,o){let l=i.H.m.r,y=15-o;for(let C=0;C<a.length;C+=2){let U=a[C]<<o-a[C+1];a[C]=l[U]>>>y;}},i.H.M=function(a,o,l){l<<=7&o;let y=o>>>3;a[y]|=l,a[y+1]|=l>>>8;},i.H.I=function(a,o,l){l<<=7&o;let y=o>>>3;a[y]|=l,a[y+1]|=l>>>8,a[y+2]|=l>>>16;},i.H.e=function(a,o,l){return (a[o>>>3]|a[1+(o>>>3)]<<8)>>>(7&o)&(1<<l)-1},i.H.b=function(a,o,l){return (a[o>>>3]|a[1+(o>>>3)]<<8|a[2+(o>>>3)]<<16)>>>(7&o)&(1<<l)-1},i.H.Z=function(a,o){return (a[o>>>3]|a[1+(o>>>3)]<<8|a[2+(o>>>3)]<<16)>>>(7&o)},i.H.i=function(a,o){return (a[o>>>3]|a[1+(o>>>3)]<<8|a[2+(o>>>3)]<<16|a[3+(o>>>3)]<<24)>>>(7&o)},i.H.m=(function(){let a=Uint16Array,o=Uint32Array;return {K:new a(16),j:new a(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[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,999,999,999],T:[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],q:new a(32),p:[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,65535,65535],z:[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],c:new o(32),J:new a(512),_:[],h:new a(32),$:[],w:new a(32768),C:[],v:[],d:new a(32768),D:[],u:new a(512),Q:[],r:new a(32768),s:new o(286),Y:new o(30),a:new o(19),t:new o(15e3),k:new a(65536),g:new a(32768)}})(),(function(){let a=i.H.m;for(var o=0;o<32768;o++){let y=o;y=(2863311530&y)>>>1|(1431655765&y)<<1,y=(3435973836&y)>>>2|(858993459&y)<<2,y=(4042322160&y)>>>4|(252645135&y)<<4,y=(4278255360&y)>>>8|(16711935&y)<<8,a.r[o]=(y>>>16|y<<16)>>>17;}function l(y,C,U){for(;C--!=0;)y.push(0,U);}for(o=0;o<32;o++)a.q[o]=a.S[o]<<3|a.T[o],a.c[o]=a.p[o]<<4|a.z[o];l(a._,144,8),l(a._,112,9),l(a._,24,7),l(a._,8,8),i.H.n(a._,9),i.H.A(a._,9,a.J),i.H.l(a._,9),l(a.$,32,5),i.H.n(a.$,5),i.H.A(a.$,5,a.h),i.H.l(a.$,5),l(a.Q,19,0),l(a.C,286,0),l(a.D,30,0),l(a.v,320,0);})(),i.H.N})();function t(i){return [1,null,3,1,2,null,4][i.ctype]*i.depth}function p(i,a,o,l,y){let C=t(a),U=Math.ceil(l*C/8),T,N;C=Math.ceil(C/8);let F=i[o],M=0;if(F>1&&(i[o]=[0,0,1][F-2]),F==3)for(M=C;M<U;M++)i[M+1]=i[M+1]+(i[M+1-C]>>>1)&255;for(let R=0;R<y;R++)if(T=o+R*U,N=T+R+1,F=i[N-1],M=0,F==0)for(;M<U;M++)i[T+M]=i[N+M];else if(F==1){for(;M<C;M++)i[T+M]=i[N+M];for(;M<U;M++)i[T+M]=i[N+M]+i[T+M-C];}else if(F==2)for(;M<U;M++)i[T+M]=i[N+M]+i[T+M-U];else if(F==3){for(;M<C;M++)i[T+M]=i[N+M]+(i[T+M-U]>>>1);for(;M<U;M++)i[T+M]=i[N+M]+(i[T+M-U]+i[T+M-C]>>>1);}else {for(;M<C;M++)i[T+M]=i[N+M]+u(0,i[T+M-U],0);for(;M<U;M++)i[T+M]=i[N+M]+u(i[T+M-C],i[T+M-U],i[T+M-C-U]);}return i}function u(i,a,o){let l=i+a-o,y=l-i,C=l-a,U=l-o;return y*y<=C*C&&y*y<=U*U?i:C*C<=U*U?a:o}function w(i,a,o){o.width=r.readUint(i,a),a+=4,o.height=r.readUint(i,a),a+=4,o.depth=i[a],a++,o.ctype=i[a],a++,o.compress=i[a],a++,o.filter=i[a],a++,o.interlace=i[a],a++;}function S(i,a,o,l,y,C,U,T,N){let F=Math.min(a,y),M=Math.min(o,C),R=0,h=0;for(let I=0;I<M;I++)for(let m=0;m<F;m++)if(U>=0&&T>=0?(R=I*a+m<<2,h=(T+I)*y+U+m<<2):(R=(-T+I)*a-U+m<<2,h=I*y+m<<2),N==0)l[h]=i[R],l[h+1]=i[R+1],l[h+2]=i[R+2],l[h+3]=i[R+3];else if(N==1){var O=i[R+3]*.00392156862745098,d=i[R]*O,f=i[R+1]*O,_=i[R+2]*O,c=l[h+3]*(1/255),v=l[h]*c,E=l[h+1]*c,A=l[h+2]*c;let g=1-O,D=O+c*g,P=D==0?0:1/D;l[h+3]=255*D,l[h+0]=(d+v*g)*P,l[h+1]=(f+E*g)*P,l[h+2]=(_+A*g)*P;}else if(N==2)O=i[R+3],d=i[R],f=i[R+1],_=i[R+2],c=l[h+3],v=l[h],E=l[h+1],A=l[h+2],O==c&&d==v&&f==E&&_==A?(l[h]=0,l[h+1]=0,l[h+2]=0,l[h+3]=0):(l[h]=d,l[h+1]=f,l[h+2]=_,l[h+3]=O);else if(N==3){if(O=i[R+3],d=i[R],f=i[R+1],_=i[R+2],c=l[h+3],v=l[h],E=l[h+1],A=l[h+2],O==c&&d==v&&f==E&&_==A)continue;if(O<220&&c>20)return false}return true}return {decode:function(a){let o=new Uint8Array(a),l=8,y=r,C=y.readUshort,U=y.readUint,T={tabs:{},frames:[]},N=new Uint8Array(o.length),F,M=0,R=0,h=[137,80,78,71,13,10,26,10];for(var O=0;O<8;O++)if(o[O]!=h[O])throw "The input is not a PNG file!";for(;l<o.length;){let I=y.readUint(o,l);l+=4;let m=y.readASCII(o,l,4);if(l+=4,m=="IHDR")w(o,l,T);else if(m=="iCCP"){for(var d=l;o[d]!=0;)d++;y.readASCII(o,l,d-l),o[d+1];let g=o.slice(d+2,l+I),D=null;try{D=s(g);}catch{D=e(g);}T.tabs[m]=D;}else if(m=="CgBI")T.tabs[m]=o.slice(l,l+4);else if(m=="IDAT"){for(O=0;O<I;O++)N[M+O]=o[l+O];M+=I;}else if(m=="acTL")T.tabs[m]={num_frames:U(o,l),num_plays:U(o,l+4)},F=new Uint8Array(o.length);else if(m=="fcTL"){R!=0&&((A=T.frames[T.frames.length-1]).data=b(T,F.slice(0,R),A.rect.width,A.rect.height),R=0);let g={x:U(o,l+12),y:U(o,l+16),width:U(o,l+4),height:U(o,l+8)},D=C(o,l+22);D=C(o,l+20)/(D==0?100:D);let P={rect:g,delay:Math.round(1e3*D),dispose:o[l+24],blend:o[l+25]};T.frames.push(P);}else if(m=="fdAT"){for(O=0;O<I-4;O++)F[R+O]=o[l+O+4];R+=I-4;}else if(m=="pHYs")T.tabs[m]=[y.readUint(o,l),y.readUint(o,l+4),o[l+8]];else if(m=="cHRM")for(T.tabs[m]=[],O=0;O<8;O++)T.tabs[m].push(y.readUint(o,l+4*O));else if(m=="tEXt"||m=="zTXt"){T.tabs[m]==null&&(T.tabs[m]={});var f=y.nextZero(o,l),_=y.readASCII(o,l,f-l),c=l+I-f-1;if(m=="tEXt")E=y.readASCII(o,f+1,c);else {var v=s(o.slice(f+2,f+2+c));E=y.readUTF8(v,0,v.length);}T.tabs[m][_]=E;}else if(m=="iTXt"){T.tabs[m]==null&&(T.tabs[m]={}),f=0,d=l,f=y.nextZero(o,d),_=y.readASCII(o,d,f-d);let g=o[d=f+1];var E;o[d+1],d+=2,f=y.nextZero(o,d),y.readASCII(o,d,f-d),d=f+1,f=y.nextZero(o,d),y.readUTF8(o,d,f-d),c=I-((d=f+1)-l),g==0?E=y.readUTF8(o,d,c):(v=s(o.slice(d,d+c)),E=y.readUTF8(v,0,v.length)),T.tabs[m][_]=E;}else if(m=="PLTE")T.tabs[m]=y.readBytes(o,l,I);else if(m=="hIST"){let g=T.tabs.PLTE.length/3;for(T.tabs[m]=[],O=0;O<g;O++)T.tabs[m].push(C(o,l+2*O));}else if(m=="tRNS")T.ctype==3?T.tabs[m]=y.readBytes(o,l,I):T.ctype==0?T.tabs[m]=C(o,l):T.ctype==2&&(T.tabs[m]=[C(o,l),C(o,l+2),C(o,l+4)]);else if(m=="gAMA")T.tabs[m]=y.readUint(o,l)/1e5;else if(m=="sRGB")T.tabs[m]=o[l];else if(m=="bKGD")T.ctype==0||T.ctype==4?T.tabs[m]=[C(o,l)]:T.ctype==2||T.ctype==6?T.tabs[m]=[C(o,l),C(o,l+2),C(o,l+4)]:T.ctype==3&&(T.tabs[m]=o[l]);else if(m=="IEND")break;l+=I,y.readUint(o,l),l+=4;}var A;return R!=0&&((A=T.frames[T.frames.length-1]).data=b(T,F.slice(0,R),A.rect.width,A.rect.height)),T.data=b(T,N,T.width,T.height),delete T.compress,delete T.interlace,delete T.filter,T},toRGBA8:function(a){let o=a.width,l=a.height;if(a.tabs.acTL==null)return [n(a.data,o,l,a).buffer];let y=[];a.frames[0].data==null&&(a.frames[0].data=a.data);let C=o*l*4,U=new Uint8Array(C),T=new Uint8Array(C),N=new Uint8Array(C);for(let M=0;M<a.frames.length;M++){let R=a.frames[M],h=R.rect.x,O=R.rect.y,d=R.rect.width,f=R.rect.height,_=n(R.data,d,f,a);if(M!=0)for(var F=0;F<C;F++)N[F]=U[F];if(R.blend==0?S(_,d,f,U,o,l,h,O,0):R.blend==1&&S(_,d,f,U,o,l,h,O,1),y.push(U.buffer.slice(0)),R.dispose!=0){if(R.dispose==1)S(T,d,f,U,o,l,h,O,0);else if(R.dispose==2)for(F=0;F<C;F++)U[F]=N[F];}}return y},_paeth:u,_copyTile:S,_bin:r}})();(function(){let{_copyTile:r}=he,{_bin:n}=he,b=he._paeth;var s={table:(function(){let d=new Uint32Array(256);for(let f=0;f<256;f++){let _=f;for(let c=0;c<8;c++)1&_?_=3988292384^_>>>1:_>>>=1;d[f]=_;}return d})(),update(d,f,_,c){for(let v=0;v<c;v++)d=s.table[255&(d^f[_+v])]^d>>>8;return d},crc:(d,f,_)=>4294967295^s.update(4294967295,d,f,_)};function e(d,f,_,c){f[_]+=d[0]*c>>4,f[_+1]+=d[1]*c>>4,f[_+2]+=d[2]*c>>4,f[_+3]+=d[3]*c>>4;}function t(d){return Math.max(0,Math.min(255,d))}function p(d,f){let _=d[0]-f[0],c=d[1]-f[1],v=d[2]-f[2],E=d[3]-f[3];return _*_+c*c+v*v+E*E}function u(d,f,_,c,v,E,A){A==null&&(A=1);let I=c.length,m=[];for(var g=0;g<I;g++){let k=c[g];m.push([k>>>0&255,k>>>8&255,k>>>16&255,k>>>24&255]);}for(g=0;g<I;g++){let k=4294967295;for(var D=0,P=0;P<I;P++){var x=p(m[g],m[P]);P!=g&&x<k&&(k=x,D=P);}}let H=new Uint32Array(v.buffer),L=new Int16Array(f*_*4),V=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(g=0;g<V.length;g++)V[g]=255*((V[g]+.5)/16-.5);for(let k=0;k<_;k++)for(let W=0;W<f;W++){var B;g=4*(k*f+W),A!=2?B=[t(d[g]+L[g]),t(d[g+1]+L[g+1]),t(d[g+2]+L[g+2]),t(d[g+3]+L[g+3])]:(x=V[4*(3&k)+(3&W)],B=[t(d[g]+x),t(d[g+1]+x),t(d[g+2]+x),t(d[g+3]+x)]),D=0;let K=16777215;for(P=0;P<I;P++){let q=p(B,m[P]);q<K&&(K=q,D=P);}let G=m[D],Q=[B[0]-G[0],B[1]-G[1],B[2]-G[2],B[3]-G[3]];A==1&&(W!=f-1&&e(Q,L,g+4,7),k!=_-1&&(W!=0&&e(Q,L,g+4*f-4,3),e(Q,L,g+4*f,5),W!=f-1&&e(Q,L,g+4*f+4,1))),E[g>>2]=D,H[g>>2]=c[D];}}function w(d,f,_,c,v){v==null&&(v={});let{crc:E}=s,A=n.writeUint,I=n.writeUshort,m=n.writeASCII,g=8,D=d.frames.length>1,P,x=false,H=33+(D?20:0);if(v.sRGB!=null&&(H+=13),v.pHYs!=null&&(H+=21),v.iCCP!=null&&(P=pako.deflate(v.iCCP),H+=21+P.length+4),d.ctype==3){for(var L=d.plte.length,V=0;V<L;V++)d.plte[V]>>>24!=255&&(x=true);H+=8+3*L+4+(x?8+1*L+4:0);}for(var B=0;B<d.frames.length;B++)D&&(H+=38),H+=(G=d.frames[B]).cimg.length+12,B!=0&&(H+=4);H+=12;let k=new Uint8Array(H),W=[137,80,78,71,13,10,26,10];for(V=0;V<8;V++)k[V]=W[V];if(A(k,g,13),g+=4,m(k,g,"IHDR"),g+=4,A(k,g,f),g+=4,A(k,g,_),g+=4,k[g]=d.depth,g++,k[g]=d.ctype,g++,k[g]=0,g++,k[g]=0,g++,k[g]=0,g++,A(k,g,E(k,g-17,17)),g+=4,v.sRGB!=null&&(A(k,g,1),g+=4,m(k,g,"sRGB"),g+=4,k[g]=v.sRGB,g++,A(k,g,E(k,g-5,5)),g+=4),v.iCCP!=null){let Q=13+P.length;A(k,g,Q),g+=4,m(k,g,"iCCP"),g+=4,m(k,g,"ICC profile"),g+=11,g+=2,k.set(P,g),g+=P.length,A(k,g,E(k,g-(Q+4),Q+4)),g+=4;}if(v.pHYs!=null&&(A(k,g,9),g+=4,m(k,g,"pHYs"),g+=4,A(k,g,v.pHYs[0]),g+=4,A(k,g,v.pHYs[1]),g+=4,k[g]=v.pHYs[2],g++,A(k,g,E(k,g-13,13)),g+=4),D&&(A(k,g,8),g+=4,m(k,g,"acTL"),g+=4,A(k,g,d.frames.length),g+=4,A(k,g,v.loop!=null?v.loop:0),g+=4,A(k,g,E(k,g-12,12)),g+=4),d.ctype==3){for(A(k,g,3*(L=d.plte.length)),g+=4,m(k,g,"PLTE"),g+=4,V=0;V<L;V++){let Q=3*V,q=d.plte[V],z=255&q,$=q>>>8&255,ie=q>>>16&255;k[g+Q+0]=z,k[g+Q+1]=$,k[g+Q+2]=ie;}if(g+=3*L,A(k,g,E(k,g-3*L-4,3*L+4)),g+=4,x){for(A(k,g,L),g+=4,m(k,g,"tRNS"),g+=4,V=0;V<L;V++)k[g+V]=d.plte[V]>>>24&255;g+=L,A(k,g,E(k,g-L-4,L+4)),g+=4;}}let K=0;for(B=0;B<d.frames.length;B++){var G=d.frames[B];D&&(A(k,g,26),g+=4,m(k,g,"fcTL"),g+=4,A(k,g,K++),g+=4,A(k,g,G.rect.width),g+=4,A(k,g,G.rect.height),g+=4,A(k,g,G.rect.x),g+=4,A(k,g,G.rect.y),g+=4,I(k,g,c[B]),g+=2,I(k,g,1e3),g+=2,k[g]=G.dispose,g++,k[g]=G.blend,g++,A(k,g,E(k,g-30,30)),g+=4);let Q=G.cimg;A(k,g,(L=Q.length)+(B==0?0:4)),g+=4;let q=g;m(k,g,B==0?"IDAT":"fdAT"),g+=4,B!=0&&(A(k,g,K++),g+=4),k.set(Q,g),g+=L,A(k,g,E(k,q,g-q)),g+=4;}return A(k,g,0),g+=4,m(k,g,"IEND"),g+=4,A(k,g,E(k,g-4,4)),g+=4,k.buffer}function S(d,f,_){for(let c=0;c<d.frames.length;c++){let v=d.frames[c];v.rect.width;let E=v.rect.height,A=new Uint8Array(E*v.bpl+E);v.cimg=l(v.img,E,v.bpp,v.bpl,A,f,_);}}function i(d,f,_,c,v){let E=v[0],A=v[1],I=v[2],m=v[3],g=v[4],D=v[5],P=6,x=8,H=255;for(var L=0;L<d.length;L++){let te=new Uint8Array(d[L]);for(var V=te.length,B=0;B<V;B+=4)H&=te[B+3];}let k=H!=255,W=(function(X,J,ne,oe,j,ue){let ee=[];for(var Y=0;Y<X.length;Y++){let le=new Uint8Array(X[Y]),pe=new Uint32Array(le.buffer);var ce;let de=0,ve=0,me=J,Ce=ne,nt=oe?1:0;if(Y!=0){let Pn=ue||oe||Y==1||ee[Y-2].dispose!=0?1:2,rt=0,Ot=1e9;for(let Le=0;Le<Pn;Le++){var ge=new Uint8Array(X[Y-1-Le]);let xn=new Uint32Array(X[Y-1-Le]),_e=J,be=ne,Ue=-1,ke=-1;for(let Re=0;Re<ne;Re++)for(let Oe=0;Oe<J;Oe++)pe[se=Re*J+Oe]!=xn[se]&&(Oe<_e&&(_e=Oe),Oe>Ue&&(Ue=Oe),Re<be&&(be=Re),Re>ke&&(ke=Re));Ue==-1&&(_e=be=Ue=ke=0),j&&((1&_e)==1&&_e--,(1&be)==1&&be--);let Pt=(Ue-_e+1)*(ke-be+1);Pt<Ot&&(Ot=Pt,rt=Le,de=_e,ve=be,me=Ue-_e+1,Ce=ke-be+1);}ge=new Uint8Array(X[Y-1-rt]),rt==1&&(ee[Y-1].dispose=2),ce=new Uint8Array(me*Ce*4),r(ge,J,ne,ce,me,Ce,-de,-ve,0),nt=r(le,J,ne,ce,me,Ce,-de,-ve,3)?1:0,nt==1?o(le,J,ne,ce,{x:de,y:ve,width:me,height:Ce}):r(le,J,ne,ce,me,Ce,-de,-ve,0);}else ce=le.slice(0);ee.push({rect:{x:de,y:ve,width:me,height:Ce},img:ce,blend:nt,dispose:0});}if(oe)for(Y=0;Y<ee.length;Y++){if((Te=ee[Y]).blend==1)continue;let le=Te.rect,pe=ee[Y-1].rect,de=Math.min(le.x,pe.x),ve=Math.min(le.y,pe.y),me={x:de,y:ve,width:Math.max(le.x+le.width,pe.x+pe.width)-de,height:Math.max(le.y+le.height,pe.y+pe.height)-ve};ee[Y-1].dispose=1,Y-1!=0&&a(X,J,ne,ee,Y-1,me,j),a(X,J,ne,ee,Y,me,j);}let $e=0;if(X.length!=1)for(var se=0;se<ee.length;se++){var Te;$e+=(Te=ee[se]).rect.width*Te.rect.height;}return ee})(d,f,_,E,A,I),K={},G=[],Q=[];if(c!=0){let te=[];for(B=0;B<W.length;B++)te.push(W[B].img.buffer);let X=(function(j){let ue=0;for(var ee=0;ee<j.length;ee++)ue+=j[ee].byteLength;let Y=new Uint8Array(ue),ce=0;for(ee=0;ee<j.length;ee++){let ge=new Uint8Array(j[ee]),$e=ge.length;for(let se=0;se<$e;se+=4){let Te=ge[se],le=ge[se+1],pe=ge[se+2],de=ge[se+3];de==0&&(Te=le=pe=0),Y[ce+se]=Te,Y[ce+se+1]=le,Y[ce+se+2]=pe,Y[ce+se+3]=de;}ce+=$e;}return Y.buffer})(te),J=C(X,c);for(B=0;B<J.plte.length;B++)G.push(J.plte[B].est.rgba);let ne=0;for(B=0;B<W.length;B++){let oe=(z=W[B]).img.length;var q=new Uint8Array(J.inds.buffer,ne>>2,oe>>2);Q.push(q);let j=new Uint8Array(J.abuf,ne,oe);D&&u(z.img,z.rect.width,z.rect.height,G,j,q),z.img.set(j),ne+=oe;}}else for(L=0;L<W.length;L++){var z=W[L];let te=new Uint32Array(z.img.buffer);var $=z.rect.width;for(V=te.length,q=new Uint8Array(V),Q.push(q),B=0;B<V;B++){let X=te[B];if(B!=0&&X==te[B-1])q[B]=q[B-1];else if(B>$&&X==te[B-$])q[B]=q[B-$];else {let J=K[X];if(J==null&&(K[X]=J=G.length,G.push(X),G.length>=300))break;q[B]=J;}}}let ie=G.length;for(ie<=256&&g==0&&(x=ie<=2?1:ie<=4?2:ie<=16?4:8,x=Math.max(x,m)),L=0;L<W.length;L++){(z=W[L]).rect.x,z.rect.y,$=z.rect.width;let te=z.rect.height,X=z.img;new Uint32Array(X.buffer);let J=4*$,ne=4;if(ie<=256&&g==0){J=Math.ceil(x*$/8);var ae=new Uint8Array(J*te);let oe=Q[L];for(let j=0;j<te;j++){B=j*J;let ue=j*$;if(x==8)for(var Z=0;Z<$;Z++)ae[B+Z]=oe[ue+Z];else if(x==4)for(Z=0;Z<$;Z++)ae[B+(Z>>1)]|=oe[ue+Z]<<4-4*(1&Z);else if(x==2)for(Z=0;Z<$;Z++)ae[B+(Z>>2)]|=oe[ue+Z]<<6-2*(3&Z);else if(x==1)for(Z=0;Z<$;Z++)ae[B+(Z>>3)]|=oe[ue+Z]<<7-1*(7&Z);}X=ae,P=3,ne=1;}else if(k==0&&W.length==1){ae=new Uint8Array($*te*3);let oe=$*te;for(B=0;B<oe;B++){let j=3*B,ue=4*B;ae[j]=X[ue],ae[j+1]=X[ue+1],ae[j+2]=X[ue+2];}X=ae,P=2,ne=3,J=3*$;}z.img=X,z.bpl=J,z.bpp=ne;}return {ctype:P,depth:x,plte:G,frames:W}}function a(d,f,_,c,v,E,A){let I=Uint8Array,m=Uint32Array,g=new I(d[v-1]),D=new m(d[v-1]),P=v+1<d.length?new I(d[v+1]):null,x=new I(d[v]),H=new m(x.buffer),L=f,V=_,B=-1,k=-1;for(let K=0;K<E.height;K++)for(let G=0;G<E.width;G++){let Q=E.x+G,q=E.y+K,z=q*f+Q,$=H[z];$==0||c[v-1].dispose==0&&D[z]==$&&(P==null||P[4*z+3]!=0)||(Q<L&&(L=Q),Q>B&&(B=Q),q<V&&(V=q),q>k&&(k=q));}B==-1&&(L=V=B=k=0),A&&((1&L)==1&&L--,(1&V)==1&&V--),E={x:L,y:V,width:B-L+1,height:k-V+1};let W=c[v];W.rect=E,W.blend=1,W.img=new Uint8Array(E.width*E.height*4),c[v-1].dispose==0?(r(g,f,_,W.img,E.width,E.height,-E.x,-E.y,0),o(x,f,_,W.img,E)):r(x,f,_,W.img,E.width,E.height,-E.x,-E.y,0);}function o(d,f,_,c,v){r(d,f,_,c,v.width,v.height,-v.x,-v.y,2);}function l(d,f,_,c,v,E,A){let I=[],m,g=[0,1,2,3,4];E!=-1?g=[E]:(f*c>5e5||_==1)&&(g=[0]),A&&(m={level:0});let D=Vn;for(var P=0;P<g.length;P++){for(let L=0;L<f;L++)y(v,d,L,c,_,g[P]);I.push(D.deflate(v,m));}let x,H=1e9;for(P=0;P<I.length;P++)I[P].length<H&&(x=P,H=I[P].length);return I[x]}function y(d,f,_,c,v,E){let A=_*c,I=A+_;if(d[I]=E,I++,E==0)if(c<500)for(var m=0;m<c;m++)d[I+m]=f[A+m];else d.set(new Uint8Array(f.buffer,A,c),I);else if(E==1){for(m=0;m<v;m++)d[I+m]=f[A+m];for(m=v;m<c;m++)d[I+m]=f[A+m]-f[A+m-v]+256&255;}else if(_==0){for(m=0;m<v;m++)d[I+m]=f[A+m];if(E==2)for(m=v;m<c;m++)d[I+m]=f[A+m];if(E==3)for(m=v;m<c;m++)d[I+m]=f[A+m]-(f[A+m-v]>>1)+256&255;if(E==4)for(m=v;m<c;m++)d[I+m]=f[A+m]-b(f[A+m-v],0,0)+256&255;}else {if(E==2)for(m=0;m<c;m++)d[I+m]=f[A+m]+256-f[A+m-c]&255;if(E==3){for(m=0;m<v;m++)d[I+m]=f[A+m]+256-(f[A+m-c]>>1)&255;for(m=v;m<c;m++)d[I+m]=f[A+m]+256-(f[A+m-c]+f[A+m-v]>>1)&255;}if(E==4){for(m=0;m<v;m++)d[I+m]=f[A+m]+256-b(0,f[A+m-c],0)&255;for(m=v;m<c;m++)d[I+m]=f[A+m]+256-b(f[A+m-v],f[A+m-c],f[A+m-v-c])&255;}}}function C(d,f){let _=new Uint8Array(d),c=_.slice(0),v=new Uint32Array(c.buffer),E=U(c,f),A=E[0],I=E[1],m=_.length,g=new Uint8Array(m>>2),D;if(_.length<2e7)for(var P=0;P<m;P+=4)D=T(A,x=_[P]*(1/255),H=_[P+1]*(1/255),L=_[P+2]*(1/255),V=_[P+3]*(1/255)),g[P>>2]=D.ind,v[P>>2]=D.est.rgba;else for(P=0;P<m;P+=4){var x=_[P]*.00392156862745098,H=_[P+1]*(1/255),L=_[P+2]*(1/255),V=_[P+3]*(1/255);for(D=A;D.left;)D=N(D.est,x,H,L,V)<=0?D.left:D.right;g[P>>2]=D.ind,v[P>>2]=D.est.rgba;}return {abuf:c.buffer,inds:g,plte:I}}function U(d,f,_){_==null&&(_=1e-4);let c=new Uint32Array(d.buffer),v={i0:0,i1:d.length,bst:null,est:null,tdst:0,left:null,right:null};v.bst=R(d,v.i0,v.i1),v.est=h(v.bst);let E=[v];for(;E.length<f;){let I=0,m=0;for(var A=0;A<E.length;A++)E[A].est.L>I&&(I=E[A].est.L,m=A);if(I<_)break;let g=E[m],D=F(d,c,g.i0,g.i1,g.est.e,g.est.eMq255);if(g.i0>=D||g.i1<=D){g.est.L=0;continue}let P={i0:g.i0,i1:D,bst:null,est:null,tdst:0,left:null,right:null};P.bst=R(d,P.i0,P.i1),P.est=h(P.bst);let x={i0:D,i1:g.i1,bst:null,est:null,tdst:0,left:null,right:null};for(x.bst={R:[],m:[],N:g.bst.N-P.bst.N},A=0;A<16;A++)x.bst.R[A]=g.bst.R[A]-P.bst.R[A];for(A=0;A<4;A++)x.bst.m[A]=g.bst.m[A]-P.bst.m[A];x.est=h(x.bst),g.left=P,g.right=x,E[m]=P,E.push(x);}for(E.sort(((I,m)=>m.bst.N-I.bst.N)),A=0;A<E.length;A++)E[A].ind=A;return [v,E]}function T(d,f,_,c,v){if(d.left==null)return d.tdst=(function(P,x,H,L,V){let B=x-P[0],k=H-P[1],W=L-P[2],K=V-P[3];return B*B+k*k+W*W+K*K})(d.est.q,f,_,c,v),d;let E=N(d.est,f,_,c,v),A=d.left,I=d.right;E>0&&(A=d.right,I=d.left);let m=T(A,f,_,c,v);if(m.tdst<=E*E)return m;let g=T(I,f,_,c,v);return g.tdst<m.tdst?g:m}function N(d,f,_,c,v){let{e:E}=d;return E[0]*f+E[1]*_+E[2]*c+E[3]*v-d.eMq}function F(d,f,_,c,v,E){for(c-=4;_<c;){for(;M(d,_,v)<=E;)_+=4;for(;M(d,c,v)>E;)c-=4;if(_>=c)break;let A=f[_>>2];f[_>>2]=f[c>>2],f[c>>2]=A,_+=4,c-=4;}for(;M(d,_,v)>E;)_-=4;return _+4}function M(d,f,_){return d[f]*_[0]+d[f+1]*_[1]+d[f+2]*_[2]+d[f+3]*_[3]}function R(d,f,_){let c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],v=[0,0,0,0],E=_-f>>2;for(let A=f;A<_;A+=4){let I=d[A]*.00392156862745098,m=d[A+1]*(1/255),g=d[A+2]*(1/255),D=d[A+3]*(1/255);v[0]+=I,v[1]+=m,v[2]+=g,v[3]+=D,c[0]+=I*I,c[1]+=I*m,c[2]+=I*g,c[3]+=I*D,c[5]+=m*m,c[6]+=m*g,c[7]+=m*D,c[10]+=g*g,c[11]+=g*D,c[15]+=D*D;}return c[4]=c[1],c[8]=c[2],c[9]=c[6],c[12]=c[3],c[13]=c[7],c[14]=c[11],{R:c,m:v,N:E}}function h(d){let{R:f}=d,{m:_}=d,{N:c}=d,v=_[0],E=_[1],A=_[2],I=_[3],m=c==0?0:1/c,g=[f[0]-v*v*m,f[1]-v*E*m,f[2]-v*A*m,f[3]-v*I*m,f[4]-E*v*m,f[5]-E*E*m,f[6]-E*A*m,f[7]-E*I*m,f[8]-A*v*m,f[9]-A*E*m,f[10]-A*A*m,f[11]-A*I*m,f[12]-I*v*m,f[13]-I*E*m,f[14]-I*A*m,f[15]-I*I*m],D=g,P=O,x=[Math.random(),Math.random(),Math.random(),Math.random()],H=0,L=0;if(c!=0)for(let B=0;B<16&&(x=P.multVec(D,x),L=Math.sqrt(P.dot(x,x)),x=P.sml(1/L,x),!(B!=0&&Math.abs(L-H)<1e-9));B++)H=L;let V=[v*m,E*m,A*m,I*m];return {Cov:g,q:V,e:x,L:H,eMq255:P.dot(P.sml(255,V),x),eMq:P.dot(x,V),rgba:(Math.round(255*V[3])<<24|Math.round(255*V[2])<<16|Math.round(255*V[1])<<8|Math.round(255*V[0])<<0)>>>0}}var O={multVec:(d,f)=>[d[0]*f[0]+d[1]*f[1]+d[2]*f[2]+d[3]*f[3],d[4]*f[0]+d[5]*f[1]+d[6]*f[2]+d[7]*f[3],d[8]*f[0]+d[9]*f[1]+d[10]*f[2]+d[11]*f[3],d[12]*f[0]+d[13]*f[1]+d[14]*f[2]+d[15]*f[3]],dot:(d,f)=>d[0]*f[0]+d[1]*f[1]+d[2]*f[2]+d[3]*f[3],sml:(d,f)=>[d*f[0],d*f[1],d*f[2],d*f[3]]};he.encode=function(f,_,c,v,E,A,I){v==null&&(v=0),I==null&&(I=false);let m=i(f,_,c,v,[false,false,false,0,I,false]);return S(m,-1),w(m,_,c,E,A)},he.encodeLL=function(f,_,c,v,E,A,I,m){let g={ctype:0+(v==1?0:2)+(E==0?0:4),depth:A,frames:[]},D=(v+E)*A,P=D*_;for(let x=0;x<f.length;x++)g.frames.push({rect:{x:0,y:0,width:_,height:c},img:new Uint8Array(f[x]),blend:0,dispose:1,bpp:Math.ceil(D/8),bpl:Math.ceil(P/8)});return S(g,0,true),w(g,_,c,I,m)},he.encode.compress=i,he.encode.dither=u,he.quantize=C,he.quantize.getKDtree=U,he.quantize.getNearest=T;})();var Lt={toArrayBuffer(r,n){let b=r.width,s=r.height,e=b<<2,t=r.getContext("2d").getImageData(0,0,b,s),p=new Uint32Array(t.data.buffer),u=(32*b+31)/32<<2,w=u*s,S=122+w,i=new ArrayBuffer(S),a=new DataView(i),o=1<<20,l,y,C,U,T=o,N=0,F=0,M=0;function R(d){a.setUint16(F,d,true),F+=2;}function h(d){a.setUint32(F,d,true),F+=4;}function O(d){F+=d;}R(19778),h(S),O(4),h(122),h(108),h(b),h(-s>>>0),R(1),R(32),h(3),h(w),h(2835),h(2835),O(8),h(16711680),h(65280),h(255),h(4278190080),h(1466527264),(function d(){for(;N<s&&T>0;){for(U=122+N*u,l=0;l<e;)T--,y=p[M++],C=y>>>24,a.setUint32(U+l,y<<8|C),l+=4;N++;}M<p.length?(T=o,setTimeout(d,Lt._dly)):n(i);})();},toBlob(r,n){this.toArrayBuffer(r,(b=>{n(new Blob([b],{type:"image/bmp"}));}));},_dly:9},fe={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},Wn={[fe.CHROME]:16384,[fe.FIREFOX]:11180,[fe.DESKTOP_SAFARI]:16384,[fe.IE]:8192,[fe.IOS]:4096,[fe.ETC]:8192},at=typeof globalThis.window<"u",kt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Ge=at&&globalThis.window.cordova&&globalThis.window.cordova.require&&globalThis.window.cordova.require("cordova/modulemapper"),$n=(at||kt)&&(Ge&&Ge.getOriginalSymbol(globalThis.window,"File")||typeof File<"u"&&File),Ft=(at||kt)&&(Ge&&Ge.getOriginalSymbol(globalThis.window,"FileReader")||typeof globalThis.FileReader<"u"&&globalThis.FileReader);function st(r,n,b=Date.now()){return new Promise((s=>{let e=r.split(","),t=e[0].match(/:(.*?);/)[1],p=globalThis.atob(e[1]),u=p.length,w=new Uint8Array(u);for(;u--;)w[u]=p.charCodeAt(u);let S=new Blob([w],{type:t});S.name=n,S.lastModified=b,s(S);}))}function Nt(r){return new Promise(((n,b)=>{let s=new Ft;s.onload=()=>n(s.result),s.onerror=e=>b(e),s.readAsDataURL(r);}))}function Bt(r){return new Promise(((n,b)=>{let s=new globalThis.Image;s.onload=()=>n(s),s.onerror=e=>b(e),s.src=r;}))}function Pe(){if(Pe.cachedResult!==void 0)return Pe.cachedResult;let r=fe.ETC,{userAgent:n}=navigator;return /Chrom(e|ium)/i.test(n)?r=fe.CHROME:/iP(ad|od|hone)/i.test(n)&&/WebKit/i.test(n)?r=fe.IOS:/Safari/i.test(n)?r=fe.DESKTOP_SAFARI:/Firefox/i.test(n)?r=fe.FIREFOX:(/MSIE/i.test(n)||globalThis.document.documentMode)&&(r=fe.IE),Pe.cachedResult=r,Pe.cachedResult}function Ht(r,n){let b=Pe(),s=Wn[b],e=r,t=n,p=e*t,u=e>t?t/e:e/t;for(;p>s*s;){let w=(s+e)/2,S=(s+t)/2;w<S?(t=S,e=S*u):(t=w*u,e=w),p=e*t;}return {width:e,height:t}}function Ye(r,n){let b,s;try{if(b=new OffscreenCanvas(r,n),s=b.getContext("2d"),s===null)throw new Error("getContext of OffscreenCanvas returns null")}catch{b=globalThis.document.createElement("canvas"),s=b.getContext("2d");}return b.width=r,b.height=n,[b,s]}function Vt(r,n){let{width:b,height:s}=Ht(r.width,r.height),[e,t]=Ye(b,s);return n&&/jpe?g/.test(n)&&(t.fillStyle="white",t.fillRect(0,0,e.width,e.height)),t.drawImage(r,0,0,e.width,e.height),e}function Qe(){return Qe.cachedResult!==void 0||(Qe.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&typeof globalThis.document<"u"&&"ontouchend"in globalThis.document),Qe.cachedResult}function qe(r,n={}){return new Promise((function(b,s){let e,t;var p=function(){try{return t=Vt(e,n.fileType||r.type),b([e,t])}catch(w){return s(w)}},u=function(w){try{var S=function(i){try{throw i}catch(a){return s(a)}};try{let i;return Nt(r).then((function(a){try{return i=a,Bt(i).then((function(o){try{return e=o,(function(){try{return p()}catch(l){return s(l)}})()}catch(l){return S(l)}}),S)}catch(o){return S(o)}}),S)}catch(i){S(i);}}catch(i){return s(i)}};try{if(Qe()||[fe.DESKTOP_SAFARI,fe.MOBILE_SAFARI].includes(Pe()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(r).then((function(w){try{return e=w,p()}catch{return u()}}),u)}catch{u();}}))}function Ke(r,n,b,s,e=1){return new Promise((function(t,p){let u;if(n==="image/png"){let a,o,l;return a=r.getContext("2d"),{data:o}=a.getImageData(0,0,r.width,r.height),l=he.encode([o.buffer],r.width,r.height,4096*e),u=new Blob([l],{type:n}),u.name=b,u.lastModified=s,w.call(this)}{let a=function(){return w.call(this)};if(n==="image/bmp")return new Promise((o=>Lt.toBlob(r,o))).then(function(o){try{return u=o,u.name=b,u.lastModified=s,a.call(this)}catch(l){return p(l)}}.bind(this),p);{let o=function(){return a.call(this)};if(typeof OffscreenCanvas=="function"&&r instanceof OffscreenCanvas)return r.convertToBlob({type:n,quality:e}).then(function(l){try{return u=l,u.name=b,u.lastModified=s,o.call(this)}catch(y){return p(y)}}.bind(this),p);{let l;return l=r.toDataURL(n,e),st(l,b,s).then(function(y){try{return u=y,o.call(this)}catch(C){return p(C)}}.bind(this),p)}}}function w(){return t(u)}}))}function ye(r){r.width=0,r.height=0;}function Me(){return new Promise((function(r,n){let s,e,t,p;return Me.cachedResult!==void 0?r(Me.cachedResult):(st("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(u){try{return s=u,qe(s).then((function(w){try{return e=w[1],Ke(e,s.type,s.name,s.lastModified).then((function(S){try{return t=S,ye(e),qe(t).then((function(i){try{return p=i[0],Me.cachedResult=p.width===1&&p.height===2,r(Me.cachedResult)}catch(a){return n(a)}}),n)}catch(i){return n(i)}}),n)}catch(S){return n(S)}}),n)}catch(w){return n(w)}}),n))}))}function Wt(r){return new Promise(((n,b)=>{let s=new Ft;s.onload=e=>{let t=new DataView(e.target.result);if(t.getUint16(0,false)!=65496)return n(-2);let p=t.byteLength,u=2;for(;u<p;){if(t.getUint16(u+2,false)<=8)return n(-1);let w=t.getUint16(u,false);if(u+=2,w==65505){if(t.getUint32(u+=2,false)!=1165519206)return n(-1);let S=t.getUint16(u+=6,false)==18761;u+=t.getUint32(u+4,S);let i=t.getUint16(u,S);u+=2;for(let a=0;a<i;a++)if(t.getUint16(u+12*a,S)==274)return n(t.getUint16(u+12*a+8,S))}else {if((65280&w)!=65280)break;u+=t.getUint16(u,false);}}return n(-1)},s.onerror=e=>b(e),s.readAsArrayBuffer(r);}))}function $t(r,n){let{width:b}=r,{height:s}=r,{maxWidthOrHeight:e}=n,t,p=r;return isFinite(e)&&(b>e||s>e)&&([p,t]=Ye(b,s),b>s?(p.width=e,p.height=s/b*e):(p.width=b/s*e,p.height=e),t.drawImage(r,0,0,p.width,p.height),ye(r)),p}function Qt(r,n){let{width:b}=r,{height:s}=r,[e,t]=Ye(b,s);switch(n>4&&n<9?(e.width=s,e.height=b):(e.width=b,e.height=s),n){case 2:t.transform(-1,0,0,1,b,0);break;case 3:t.transform(-1,0,0,-1,b,s);break;case 4:t.transform(1,0,0,-1,0,s);break;case 5:t.transform(0,1,1,0,0,0);break;case 6:t.transform(0,1,-1,0,s,0);break;case 7:t.transform(0,-1,-1,0,s,b);break;case 8:t.transform(0,-1,1,0,0,b);}return t.drawImage(r,0,0,b,s),ye(r),e}function Mt(r,n,b=0){return new Promise((function(s,e){let t,p,u,w,S,i,a,o,l,y,C,U,T,N,F,M,R,h,O,d;function f(c=5){if(n.signal&&n.signal.aborted)throw n.signal.reason;t+=c,n.onProgress(Math.min(t,100));}function _(c){if(n.signal&&n.signal.aborted)throw n.signal.reason;t=Math.min(Math.max(c,t),100),n.onProgress(t);}return t=b,p=n.maxIteration||10,u=1024*n.maxSizeMB*1024,f(),qe(r,n).then(function(c){try{return [,w]=c,f(),S=$t(w,n),f(),new Promise((function(v,E){var A;if(!(A=n.exifOrientation))return Wt(r).then(function(m){try{return A=m,I.call(this)}catch(g){return E(g)}}.bind(this),E);function I(){return v(A)}return I.call(this)})).then(function(v){try{return i=v,f(),Me().then(function(E){try{return a=E?S:Qt(S,i),f(),o=n.initialQuality||1,l=n.fileType||r.type,Ke(a,l,r.name,r.lastModified,o).then(function(A){try{{let D=function(){if(p--&&(F>u||F>T)){let x,H;return x=d?.95*O.width:O.width,H=d?.95*O.height:O.height,[R,h]=Ye(x,H),h.drawImage(O,0,0,x,H),o*=l==="image/png"?.85:.95,Ke(R,l,r.name,r.lastModified,o).then((function(L){try{return M=L,ye(O),O=R,F=M.size,_(Math.min(99,Math.floor((N-F)/(N-u)*100))),D}catch(V){return e(V)}}),e)}return [1]},P=function(){return ye(O),ye(R),ye(S),ye(a),ye(w),_(100),s(M)};var m=D,g=P;if(y=A,f(),C=y.size>u,U=y.size>r.size,!C&&!U)return _(100),s(y);var I;return T=r.size,N=y.size,F=N,O=a,d=!n.alwaysKeepResolution&&C,(I=function(x){for(;x;){if(x.then)return void x.then(I,e);try{if(x.pop){if(x.length)return x.pop()?P.call(this):x;x=D;}else x=x.call(this);}catch(H){return e(H)}}}.bind(this))(D)}}catch(D){return e(D)}}.bind(this),e)}catch(A){return e(A)}}.bind(this),e)}catch(E){return e(E)}}.bind(this),e)}catch(v){return e(v)}}.bind(this),e)}))}var Qn=`
6
6
  let scriptImported = false
7
7
  self.addEventListener('message', async (e) => {
8
8
  const { file, id, imageCompressionLibUrl, options } = e.data
@@ -21,7 +21,7 @@ self.addEventListener('message', async (e) => {
21
21
  self.postMessage({ error: e.message + '\\n' + e.stack, id })
22
22
  }
23
23
  })
24
- `,it;function Gn(r,n){return new Promise(((b,s)=>{it||(it=(function(p){let c=[];return c.push(p),URL.createObjectURL(new Blob(c))})(zn));let e=new Worker(it);e.addEventListener("message",(function(p){if(n.signal&&n.signal.aborted)e.terminate();else if(p.data.progress===void 0){if(p.data.error)return s(new Error(p.data.error)),void e.terminate();b(p.data.file),e.terminate();}else n.onProgress(p.data.progress);})),e.addEventListener("error",s),n.signal&&n.signal.addEventListener("abort",(()=>{s(n.signal.reason),e.terminate();})),e.postMessage({file:r,imageCompressionLibUrl:n.libURL,options:{...n,onProgress:void 0,signal:void 0}});}))}function re(r,n){return new Promise((function(b,s){let e,t,p,c,y,S;if(e={...n},p=0,{onProgress:c}=e,e.maxSizeMB=e.maxSizeMB||Number.POSITIVE_INFINITY,y=typeof e.useWebWorker!="boolean"||e.useWebWorker,delete e.useWebWorker,e.onProgress=h=>{p=h,typeof c=="function"&&c(p);},!(r instanceof Blob||r instanceof Qn))return s(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(r.type))return s(new Error("The file given is not an image"));if(S=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!y||typeof Worker!="function"||S)return Ut(r,e).then(function(h){try{return t=h,o.call(this)}catch(A){return s(A)}}.bind(this),s);var i=function(){try{return o.call(this)}catch(h){return s(h)}}.bind(this),a=function(h){try{return Ut(r,e).then((function(A){try{return t=A,i()}catch(O){return s(O)}}),s)}catch(A){return s(A)}};try{return e.libURL=e.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",Gn(r,e).then((function(h){try{return t=h,i()}catch{return a()}}),a)}catch{a();}function o(){try{t.name=r.name,t.lastModified=r.lastModified;}catch{}try{e.preserveExif&&r.type==="image/jpeg"&&(!e.fileType||e.fileType&&e.fileType===r.type)&&(t=Dt(r,t));}catch{}return b(t)}}))}re.getDataUrlFromFile=Nt,re.getFilefromDataUrl=st,re.loadImage=Bt,re.drawImageInCanvas=Vt,re.drawFileInCanvas=qe,re.canvasToFile=Ke,re.getExifOrientation=Wt,re.handleMaxWidthOrHeight=$t,re.followExifOrientation=Qt,re.cleanupCanvasMemory=ye,re.isAutoOrientationInBrowser=Ue,re.approximateBelowMaximumCanvasSizeOfBrowser=Ht,re.copyExifWithoutOrientation=Dt,re.getBrowserName=Pe,re.version="2.0.2";var In=Mt(zt()),Rn=Mt(hn());function Er(r){let n=globalThis.document.getElementById("__AUTH_DRAWER"),b=globalThis.document.querySelector(".__drawer_container"),s=globalThis.document.querySelector(".__auth_close_button");n&&s&&b?.classList.contains("__hidden")&&(b.classList.remove("__hidden"),n.src=r,n.onload=()=>{s.classList.remove("__hidden"),n.classList.remove("__hidden"),n.contentWindow?.focus();});}function gn(){if(globalThis.document.getElementById("__AUTH_DRAWER"))return;let r=globalThis.document.createElement("style");r.innerHTML=`
24
+ `,it;function zn(r,n){return new Promise(((b,s)=>{it||(it=(function(p){let u=[];return u.push(p),URL.createObjectURL(new Blob(u))})(Qn));let e=new Worker(it);e.addEventListener("message",(function(p){if(n.signal&&n.signal.aborted)e.terminate();else if(p.data.progress===void 0){if(p.data.error)return s(new Error(p.data.error)),void e.terminate();b(p.data.file),e.terminate();}else n.onProgress(p.data.progress);})),e.addEventListener("error",s),n.signal&&n.signal.addEventListener("abort",(()=>{s(n.signal.reason),e.terminate();})),e.postMessage({file:r,imageCompressionLibUrl:n.libURL,options:{...n,onProgress:void 0,signal:void 0}});}))}function re(r,n){return new Promise((function(b,s){let e,t,p,u,w,S;if(e={...n},p=0,{onProgress:u}=e,e.maxSizeMB=e.maxSizeMB||Number.POSITIVE_INFINITY,w=typeof e.useWebWorker!="boolean"||e.useWebWorker,delete e.useWebWorker,e.onProgress=l=>{p=l,typeof u=="function"&&u(p);},!(r instanceof Blob||r instanceof $n))return s(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(r.type))return s(new Error("The file given is not an image"));if(S=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!w||typeof Worker!="function"||S)return Mt(r,e).then(function(l){try{return t=l,o.call(this)}catch(y){return s(y)}}.bind(this),s);var i=function(){try{return o.call(this)}catch(l){return s(l)}}.bind(this),a=function(l){try{return Mt(r,e).then((function(y){try{return t=y,i()}catch(C){return s(C)}}),s)}catch(y){return s(y)}};try{return e.libURL=e.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",zn(r,e).then((function(l){try{return t=l,i()}catch{return a()}}),a)}catch{a();}function o(){try{t.name=r.name,t.lastModified=r.lastModified;}catch{}try{e.preserveExif&&r.type==="image/jpeg"&&(!e.fileType||e.fileType&&e.fileType===r.type)&&(t=Dt(r,t));}catch{}return b(t)}}))}re.getDataUrlFromFile=Nt,re.getFilefromDataUrl=st,re.loadImage=Bt,re.drawImageInCanvas=Vt,re.drawFileInCanvas=qe,re.canvasToFile=Ke,re.getExifOrientation=Wt,re.handleMaxWidthOrHeight=$t,re.followExifOrientation=Qt,re.cleanupCanvasMemory=ye,re.isAutoOrientationInBrowser=Me,re.approximateBelowMaximumCanvasSizeOfBrowser=Ht,re.copyExifWithoutOrientation=Dt,re.getBrowserName=Pe,re.version="2.0.2";var Cn=Ut(zt()),Rn=Ut(hn());function br(r){let n=globalThis.document.getElementById("__AUTH_DRAWER"),b=globalThis.document.querySelector(".__drawer_container"),s=globalThis.document.querySelector(".__auth_close_button");n&&s&&b?.classList.contains("__hidden")&&(b.classList.remove("__hidden"),n.src=r,n.onload=()=>{s.classList.remove("__hidden"),n.classList.remove("__hidden"),n.contentWindow?.focus();});}function gn(){if(globalThis.document.getElementById("__AUTH_DRAWER"))return;let r=globalThis.document.createElement("style");r.innerHTML=`
25
25
  .__button_container * {
26
26
  font-family: -apple-system,
27
27
  BlinkMacSystemFont,
@@ -226,23 +226,13 @@ self.addEventListener('message', async (e) => {
226
226
  max-width: 100%;
227
227
  }
228
228
  }
229
- `,globalThis.document.head.appendChild(r);let n=globalThis.document.createElement("div");n.className="__drawer_container __hidden";let b=globalThis.document.createElement("iframe");b.className="__drawer_frame __hidden",b.id="__AUTH_DRAWER",b.setAttribute("allow","fullscreen; camera; microphone; gyroscope; accelerometer; clipboard-write; clipboard-read; autoplay; geolocation; display-capture; picture-in-picture; payment; midi; bluetooth; web-share; screen-wake-lock; xr-spatial-tracking; encrypted-media; idle-detection; hid; serial; window-management"),b.loading="eager",b.referrerPolicy="unsafe-url",b.title="Login";let s=globalThis.document.createElement("div");s.setAttribute("alt","Close"),s.className="__auth_close_button",n.appendChild(b),n.appendChild(s),globalThis.document.body.appendChild(n);let e=globalThis.document.querySelector(".__auth_close_button"),t=new Map;function p(){n.classList.add("__hidden"),b.classList.add("__hidden"),t.forEach(({popup:S,cleanup:i})=>{i();try{S?.close();}catch{}});}let c=globalThis.document.createElement("iframe");c.style.display="none",c.id="__CONNECT_LISTENER",c.src=`${globalThis.window.__ROOT_URL__}/connect-listener`,globalThis.document.body.appendChild(c);let y=new Promise(S=>{globalThis.window.addEventListener("message",i=>{i.data?.type==="connect-listener:ready"&&(console.log("connect listener ready"),S());});});globalThis.window.__REQUEST_CONNECTION__=async S=>{let{connectId:i,provider:a,scope:o,mode:h,appId:A}=S;if(h!=="request_only"){await y;let u=await new Promise(C=>{let f=setTimeout(()=>{globalThis.window.removeEventListener("message",d),C({connections:[]});},3e3),d=_=>{let l=_.data;l?.type!=="connect:check:result"||l?.connectId!==i||(clearTimeout(f),globalThis.window.removeEventListener("message",d),C({connections:l.connections??[]}));};globalThis.window.addEventListener("message",d),c.contentWindow?.postMessage({type:"connect:check",connectId:i,provider:a,scope:o,appId:A},"*");});if(u.connections.length>0)return {status:"connected",connectId:i,connections:u.connections};if(h==="check_only")return {status:"error",connectId:i,error:"no_connections",errorDescription:"No existing connections found."}}let O=new URL("/connect",globalThis.window.__ROOT_URL__);O.searchParams.set("connectId",i),O.searchParams.set("provider",a),o&&O.searchParams.set("scope",o),h&&O.searchParams.set("mode",h),A&&O.searchParams.set("appId",A);let M=Math.min(720,Math.floor(globalThis.window.screen.availWidth*.9)),T=Math.min(800,Math.floor(globalThis.window.screen.availHeight*.9)),N=Math.floor(globalThis.window.screenX+(globalThis.window.outerWidth-M)/2),F=Math.floor(globalThis.window.screenY+(globalThis.window.outerHeight-T)/2),U=`popup=yes,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=${M},height=${T},left=${N},top=${F}`,R=h!=="check_only"?globalThis.window.open(O.toString(),`ac1_connect_${i}`,U):null;return new Promise(u=>{let C=()=>{globalThis.window.removeEventListener("message",f),globalThis.window.clearInterval(d),t.delete(i);},f=_=>{let l=_.data||{};if(l.type==="connect:result"&&l.connectId===i){C();try{R?.close();}catch{}l.status==="error"?u({status:"error",connectId:i,error:l.error,errorDescription:l.errorDescription}):u({status:"connected",connectId:i,connections:l.connections??[]});}},d=globalThis.window.setInterval(()=>{R?.closed&&(C(),u({status:"error",connectId:i,error:"popup_closed",errorDescription:"The connect window was closed before finishing."}));},250);t.set(i,{popup:R,cleanup:C}),globalThis.window.addEventListener("message",f);})},globalThis.window.addEventListener("message",S=>{!S.data||typeof S.data!="object"||S.data.type==="closeAuthDrawer"&&p();}),e?.addEventListener("click",p),n.addEventListener("click",S=>{S.target===n&&p();});}var bt=r=>{let{email:n,phoneNumber:b}=r??{},s=n??b,e=new URLSearchParams;r&&"redirectUri"in r&&r.redirectUri?e.set("returnTo",r.redirectUri):e.set("returnTo",globalThis.window.location.pathname+globalThis.window.location.search),s&&e.set("identity",s),e.set("stripped","true");let t=globalThis.window.__APP_ID__;Er(`${globalThis.window.__ROOT_URL__}/setup/${t}?${e.toString()}`);};function Sr(r={}){let[n,b]=useState({userId:void 0,status:"loading",signIn:bt,providers:[]});return useEffect(()=>{(async()=>{try{let t=await(await fetch("/api/session",{method:"POST",headers:{"Content-Type":"application/json","x-guest-api-internal":"session",...globalThis.window.__IS_TESTING__?{"x-is-testing":"true"}:{}}})).json()??{};b({userId:t.userId??null,status:"authenticated",signIn:bt,providers:t?.providers??[]});}catch{if(r.required){let t=encodeURIComponent(globalThis.window.location.pathname+globalThis.window.location.search),p=globalThis.window.__APP_ID__;globalThis.window.top?globalThis.window.top.location.href=`${globalThis.window.__ROOT_URL__}/setup/${p}?returnTo=${t}`:globalThis.window.location.href=`${globalThis.window.__ROOT_URL__}/setup/${p}?returnTo=${t}`;}else b({userId:null,status:"unauthenticated",signIn:bt,providers:[]});}})();},[r.required]),n}async function Cr(r){let n=`c_${Math.random().toString(36).slice(2)}_${Date.now()}`;return await globalThis.window.__REQUEST_CONNECTION__({connectId:n,provider:r.provider,scope:r.scope?.join(","),mode:r.mode??"get_or_request",appId:globalThis.window.__APP_ID__})}var mn=false,Ce=new Map,We=new Map;function Ve(r,n,b){let s=Ce.get(r),e=We.get(r);Ce.delete(r),We.delete(r),je.delete(r);try{localStorage.removeItem(`drive-picker:config:${r}`),localStorage.removeItem(`drive-picker:result:${r}`);}catch{}try{e?.close();}catch{}s?.({action:n,docs:b});}function Tr(){mn||(mn=true,globalThis.window.addEventListener("storage",r=>{if(!(!r.key?.startsWith("drive-picker:result:")||!r.newValue))try{let n=JSON.parse(r.newValue),b=r.key.replace("drive-picker:result:","");n.type==="drive-picker:result"?Ve(b,n.action,n.docs):n.type==="drive-picker:error"&&(console.error("Drive Picker error:",n.error),Ve(b,"cancel"));}catch{}}),globalThis.window.addEventListener("message",r=>{let n=r.data;if(typeof n=="string")try{n=JSON.parse(n);}catch{}if(n?.type==="FILE_PICKER_RESULT"){if(console.log("[SDK] Received FILE_PICKER_RESULT:",n),!Ct()){console.log("[SDK] Ignoring - not in mobile WebView");return}let{pickerId:e}=n,t=Ce.get(e);console.log("[SDK] pickerId:",e,"has callback:",!!t),console.log("[SDK] All stored pickerIds:",[...Ce.keys()]),t&&(console.log("[SDK] Invoking callback with action:",n.action),Ve(e,n.action,n.docs));return}if(!n?.type?.startsWith("drive-picker:"))return;let b=new URL(globalThis.window.__ROOT_URL__).origin;if(r.origin!==b)return;let{pickerId:s}=n;if(n.type==="drive-picker:ready"){let e=je.get(s),t=We.get(s);e&&t&&(je.delete(s),t.postMessage({type:"drive-picker:init",pickerId:s,connectionId:e.connectionToken,builderCalls:e.builderCalls},b));return}n.type==="drive-picker:result"?Ve(s,n.action,n.docs):n.type==="drive-picker:error"&&(console.error("Drive Picker error:",n.error),Ve(s,"cancel"));}));}function Ct(){return typeof globalThis.window.ReactNativeWebView<"u"}function Ir(r,n,b){globalThis.window.ReactNativeWebView.postMessage(JSON.stringify({type:"requestFilePicker",pickerId:r,connectionId:n,builderCalls:b}));}var je=new Map;function Rr(r,n,b){if(Ct())return Ir(r,n,b),null;let s={connectionToken:n,builderCalls:b};je.set(r,s);try{localStorage.setItem(`drive-picker:config:${r}`,JSON.stringify(s));}catch{}let e=Math.min(1024,Math.floor(globalThis.window.screen.availWidth*.9)),t=Math.min(680,Math.floor(globalThis.window.screen.availHeight*.9)),p=Math.floor(globalThis.window.screenX+(globalThis.window.outerWidth-e)/2),c=Math.floor(globalThis.window.screenY+(globalThis.window.outerHeight-t)/2),y=`popup=yes,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=${e},height=${t},left=${p},top=${c}`,S=new URLSearchParams({pickerId:r}),i=`${globalThis.window.__ROOT_URL__}/drive-picker?${S.toString()}`;return globalThis.window.open(i,`drive_picker_${r}`,y)}var yn={DOCS:"DOCS",DOCS_IMAGES:"DOCS_IMAGES",DOCS_IMAGES_AND_VIDEOS:"DOCS_IMAGES_AND_VIDEOS",DOCS_VIDEOS:"DOCS_VIDEOS",DOCUMENTS:"DOCUMENTS",DRAWINGS:"DRAWINGS",FOLDERS:"FOLDERS",FORMS:"FORMS",PDFS:"PDFS",PHOTOS:"PHOTOS",PRESENTATIONS:"PRESENTATIONS",RECENTLY_PICKED:"RECENTLY_PICKED",SPREADSHEETS:"SPREADSHEETS"},Or={MINE_ONLY:"MINE_ONLY",MULTISELECT_ENABLED:"MULTISELECT_ENABLED",NAV_HIDDEN:"NAV_HIDDEN",SIMPLE_UPLOAD_ENABLED:"SIMPLE_UPLOAD_ENABLED",SUPPORT_DRIVES:"SUPPORT_DRIVES"},Pr={PICKED:"picked",CANCEL:"cancel"},et=class{viewType;viewCalls=[];constructor(n){this.viewType=n??yn.DOCS;}setMimeTypes(n){return this.viewCalls.push(["setMimeTypes",[n]]),this}setIncludeFolders(n){return this.viewCalls.push(["setIncludeFolders",[n]]),this}setSelectFolderEnabled(n){return this.viewCalls.push(["setSelectFolderEnabled",[n]]),this}setParent(n){return this.viewCalls.push(["setParent",[n]]),this}setQuery(n){return this.viewCalls.push(["setQuery",[n]]),this}setFileIds(n){let b=Array.isArray(n)?n.join(","):n;return this.viewCalls.push(["setFileIds",[b]]),this}setOwnedByMe(n){return this.viewCalls.push(["setOwnedByMe",[n]]),this}setStarred(n){return this.viewCalls.push(["setStarred",[n]]),this}_toConfig(){return {type:this.viewType,calls:this.viewCalls.length>0?this.viewCalls:void 0}}},tt=class{viewCalls=[];setParent(n){return this.viewCalls.push(["setParent",[n]]),this}_toConfig(){return {type:"DocsUploadView",calls:this.viewCalls.length>0?this.viewCalls:void 0}}},Et=class{constructor(n,b,s){this.connectionToken=n;this.builderCalls=b;this.callback=s;}setVisible(n){if(n){Tr();let b=Math.random().toString(36).substring(2,15);this.callback&&Ce.set(b,this.callback);let s=Rr(b,this.connectionToken,this.builderCalls);if(Ct())return;if(!s){Ce.delete(b),console.error("Failed to open picker popup - popup may be blocked"),this.callback?.({action:"cancel"});return}We.set(b,s);let e=globalThis.window.setInterval(()=>{s.closed&&(globalThis.window.clearInterval(e),Ce.has(b)&&(Ce.delete(b),We.delete(b),this.callback?.({action:"cancel"})));},500);}}},St=class{connectionToken;calls=[];pickerCallback;constructor(n){return this.connectionToken=n,new Proxy(this,{get(b,s,e){return s==="setCallback"?t=>(b.pickerCallback=t,e):s==="build"?()=>b._build():s in b&&typeof b[s]!="function"?b[s]:(...t)=>{if(s==="addView"){let p=t[0];p instanceof et||p instanceof tt?b.calls.push([s,[p._toConfig()]]):b.calls.push([s,t]);}else b.calls.push([s,t]);return e}}})}_build(){return new Et(this.connectionToken,this.calls,this.pickerCallback)}setTitle(n){return this}setLocale(n){return this}enableFeature(n){return this}disableFeature(n){return this}addView(n){return this}hideTitleBar(){return this}setSize(n,b){return this}setMaxItems(n){return this}setSelectableMimeTypes(n){return this}setCallback(n){return this}build(){return this._build()}};function xr(r){return new et(r)}function Mr(){return new tt}async function vn({channelId:r,initialData:n,broadcastOnly:b,onUpdate:s}){let e=n,t=0,p=globalThis.window.__REALTIME_DOMAIN__;if(b)return {getData(){return e},setData(y){e=y,fetch(`https://${p}/${r}`,{method:"POST",body:Tt.stringify(e)}).catch(console.error),s?.(y);},destroy(){}};let c=new WebSocket(`wss://${p}/${r}`);return new Promise((y,S)=>{function i(A){try{let O=JSON.parse(A.data.toString());O?.id&&O.id>t?(e=Tt.parse(O.payload),s?.(e),t=O.id):console.error("Invalid message:",A.data);}catch{console.error("Error parsing message:",A.data);}}function a(A){h(),S(A);}function o(){y({getData(){return e},setData(A){e=A,s?.(A),c.send(Tt.stringify(A));},destroy:h});}function h(){c.removeEventListener("message",i),c.removeEventListener("error",a),c.removeEventListener("open",o),c.close();}c.addEventListener("message",i),c.addEventListener("error",a),c.addEventListener("open",o);})}function An(r,n){let b=useRef(null),[s,e]=useState(0);return useEffect(()=>((async()=>r&&(b.current=await vn({channelId:r,initialData:n,onUpdate:()=>{e(t=>t+1);}})))(),b.current?.destroy),[r,e]),[b.current?.getData(),b.current?.setData??identity]}function Br(r){let[n,b]=useState(null),[s]=An(n,void 0),e=r.mutationFn;if(!e)throw new Error("useRealtimeMutation requires a mutationFn option.");let t=useCallback(async c=>{let y=nanoid(32);return b(y),await e({...c,__channelId:y})},[r?.mutationFn]);return {...useMutation({...r,mutationFn:t}),data:s}}function _n(r){return r?.message?.startsWith("__MISSING AUTH FOR SCOPE")}function Sn(r){return r[0]}function Wr(r){let b=r?.message?.slice("__MISSING AUTH FOR SCOPE:".length+1).trim()??"",s=JSON.parse(atob(b.split(" ")?.[0])),e=s?.provider,t=s?.scope;return {provider:e,scope:t,isPopup:r?.message?.endsWith("--popup"),accountId:s?.accountId}}var $r=60,Qr=30*1e3,It=0,Cn=Date.now(),Rt=false;function zr(){return rpcClient({transport:async(r,n)=>{let b=Date.now();if(b-Cn>=Qr)Cn=b,It=0,Rt=false;else if(It>=$r)throw Rt||(globalThis.window.dispatchEvent(new Event("rate-limit-exceeded")),Rt=true),new RpcError("Rate limit exceeded",-32e3,{status:429});It++;let s="/api/"+r.method,e=r.params&&Sn(r.params)?.__channelId;e&&delete Sn(r.params)?.__channelId;let t=await fetch(s,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...e?{"x-channel-id":e}:{},...globalThis.window.__IS_TESTING__?{"x-is-testing":"true"}:{},"x-boxman-box-id":globalThis.window.__BOX_ID__},body:Tt.stringify(r),signal:n});if(!t.ok){let c=t.statusText,y=-32e3;try{let{message:S,code:i}=await t.json();S&&(c=S),i&&(y=i);}catch{}throw c.trim()===""&&(c=`Request failed with status: ${t.status}`),new RpcError(c,y,{status:t.status})}let p=Tt.deserialize(await t.json());if(_n(p.error)){let c=encodeURIComponent(globalThis.window.location.pathname+globalThis.window.location.search),y=Wr(p.error),S=[`returnTo=${c}`,y.provider?`&provider=${y.provider}`:"",y.scope?`&scope=${y.scope.join(",")}`:"",y.accountId?`&accountId=${y.accountId}`:""].filter(Boolean).join("&");if(y.isPopup){globalThis.window.__OPEN_AUTH_DRAWER__(`${globalThis.window.__ROOT_URL__}/setup/${globalThis.window.__APP_ID__}?${S}&stripped=true`);return}let i=globalThis.window.top??globalThis.window;return i.location.href=`${globalThis.window.__ROOT_URL__}/setup/${globalThis.window.__APP_ID__}?${S}`,null}return p}})}function bo(r){return new Promise(n=>{let b=new globalThis.FileReader;b.onload=()=>{n(b.result);},b.readAsDataURL(r);})}function Gr(){let r={...globalThis.window.console};function n(b,s){let e=(0, Rn.default)(s,{depth:5,maxStringLength:512,indent:2});fetch("/_logger",{method:"POST",body:`[console.${b.toLowerCase()}] ${e}`}).catch(()=>{});}globalThis.window.console.log=(...b)=>{n("LOG",b),r.log(...b);},globalThis.window.console.error=(...b)=>{n("ERROR",b),r.error(...b);},globalThis.window.console.info=(...b)=>{n("INFO",b),r.info(...b);},globalThis.window.console.warn=(...b)=>{n("WARN",b),r.warn(...b);};}var Tn=false;function On(r,n=globalThis.window.parent,b="*"){n?.postMessage({...r,source:"iframe"},{targetOrigin:b});}function qr(r){let n=r.toLowerCase();return n==="localhost"||n==="127.0.0.1"||n==="::1"||n==="local.acflare.com"||n.endsWith(".local")||n.endsWith(".local.acflare.com")}function Kr(){let r=new Set;r.add(globalThis.window.location.hostname);for(let n of [globalThis.window.__BASE_URL__,globalThis.window.__ROOT_URL__])if(n)try{r.add(new URL(n).hostname);}catch{}for(let n of r)if(qr(n))return true;return false}function Pn(r){if(r.source!==globalThis.window.parent)return false;if(globalThis.window.__IS_TESTING__)return true;let n=new Set;for(let b of [globalThis.window.__BASE_URL__,globalThis.window.__ROOT_URL__])if(b)try{n.add(new URL(b).origin);}catch{}return n.size===0?Kr()?(Tn||(Tn=true,console.warn("[sdk] No trusted parent origins could be derived from __BASE_URL__/__ROOT_URL__. Falling back to source-only parent validation in local development.")),true):false:n.has(r.origin)}function Yr(){globalThis.window.addEventListener("message",async r=>{if(!Pn(r))return;let{origin:n,source:b,data:s}=r,{type:e}=s;if(e==="screenshot"){let t=globalThis.window.getComputedStyle(globalThis.document.body).backgroundColor,p=await In.default.toPng(globalThis.document.body,{bgcolor:t,style:{transform:"translateY("+-globalThis.window.scrollY+"px)"},width:globalThis.window.innerWidth,height:globalThis.window.innerHeight,copyDefaultStyles:false}),c=await fetch(p).then(a=>a.blob()),y=await re(c,{maxSizeMB:4,maxWidthOrHeight:1920,useWebWorker:false}),i={type:"screenshot",payload:{screenshot:await re.getDataUrlFromFile(y)}};On(i,b,n);}});}function Xr(){let r=null,n=null,b=null,s="--guest-surface-color",e="--guest-app-bg";function t(u){return !u||u==="transparent"||u==="rgba(0, 0, 0, 0)"||u==="rgba(0,0,0,0)"}function p(u){let C=u;for(;C;){let f=getComputedStyle(C).backgroundColor;if(!t(f))return f;C=C.parentElement;}return null}function c(u){if(!u)return null;let C=getComputedStyle(u).backgroundColor;return t(C)?null:C}function y(u){let C=globalThis.document.getElementById("root"),f=u;for(;f;){let d=getComputedStyle(f).backgroundColor;if(!t(d))return d;if(f===C)break;f=f.parentElement;}return null}function S(){let u=getComputedStyle(globalThis.document.documentElement).getPropertyValue("--guest-top-inset"),C=Number.parseFloat(u);return Number.isFinite(C)?Math.max(0,C):0}function i(){let u=S(),C=Math.min(Math.max(Math.floor(u+1),1),Math.max(globalThis.window.innerHeight-1,1)),f=[Math.floor(globalThis.window.innerWidth/2),16,Math.max(globalThis.window.innerWidth-16,1)];for(let d of f){let _=Math.min(Math.max(d,1),Math.max(globalThis.window.innerWidth-1,1)),l=globalThis.document.elementFromPoint(_,C),w=p(l);if(w)return w}return null}function a(u){let C=u??globalThis.document.documentElement,f=getComputedStyle(C).getPropertyValue(e).trim();return f&&!t(f)?f:null}function o(u){let C=a(u);if(C)return C;let f=c(u);if(f)return f;let d=y(u);if(d)return d;let _=i();return _||(p(globalThis.document.body)??p(globalThis.document.documentElement))}function h(u){let C=o(u);!C||C===r||(r=C,globalThis.document.documentElement.style.setProperty(s,C),On({type:"surfaceColor",payload:{color:C}}));}let A=null;function O(){A===null&&(A=requestAnimationFrame(()=>{A=null,n&&h(n);}));}function M(u){n!==u&&(b?.disconnect(),n=u,h(u),b=new MutationObserver(()=>{O();}),b.observe(u,{childList:true,subtree:true,attributes:true,attributeFilter:["class","style"]}));}let T=globalThis.document.getElementById("root");if(!T)return;let N=()=>{let u=T.firstElementChild;if(!u){b?.disconnect(),n=null;return}M(u);};new MutationObserver(N).observe(T,{childList:true}),new MutationObserver(()=>{O();}).observe(globalThis.document.documentElement,{attributes:true,attributeFilter:["class","style"]}),globalThis.window.addEventListener("resize",()=>{O();}),N();let R=p(globalThis.document.body)??p(globalThis.document.documentElement);R&&globalThis.document.documentElement.style.setProperty(s,R);}function Jr(){let r="--guest-top-inset",n="--guest-bottom-inset",b="--guest-surface-color",s="__guest-inset-style",e=()=>{if(globalThis.document.getElementById(s))return;let c=globalThis.document.createElement("style");c.id=s,c.textContent=`
230
- #root::before {
231
- content: '';
232
- display: block;
233
- height: var(${r}, 0px);
234
- background-color: var(${b}, transparent);
235
- pointer-events: none;
229
+ `,globalThis.document.head.appendChild(r);let n=globalThis.document.createElement("div");n.className="__drawer_container __hidden";let b=globalThis.document.createElement("iframe");b.className="__drawer_frame __hidden",b.id="__AUTH_DRAWER",b.setAttribute("allow","fullscreen; camera; microphone; gyroscope; accelerometer; clipboard-write; clipboard-read; autoplay; geolocation; display-capture; picture-in-picture; payment; midi; bluetooth; web-share; screen-wake-lock; xr-spatial-tracking; encrypted-media; idle-detection; hid; serial; window-management"),b.loading="eager",b.referrerPolicy="unsafe-url",b.title="Login";let s=globalThis.document.createElement("div");s.setAttribute("alt","Close"),s.className="__auth_close_button",n.appendChild(b),n.appendChild(s),globalThis.document.body.appendChild(n);let e=globalThis.document.querySelector(".__auth_close_button"),t=new Map;function p(){n.classList.add("__hidden"),b.classList.add("__hidden"),t.forEach(({popup:S,cleanup:i})=>{i();try{S?.close();}catch{}});}let u=globalThis.document.createElement("iframe");u.style.display="none",u.id="__CONNECT_LISTENER",u.src=`${globalThis.window.__ROOT_URL__}/connect-listener`,globalThis.document.body.appendChild(u);let w=new Promise(S=>{globalThis.window.addEventListener("message",i=>{i.data?.type==="connect-listener:ready"&&(console.log("connect listener ready"),S());});});globalThis.window.__REQUEST_CONNECTION__=async S=>{let{connectId:i,provider:a,scope:o,mode:l,appId:y}=S;if(l!=="request_only"){await w;let h=await new Promise(O=>{let d=setTimeout(()=>{globalThis.window.removeEventListener("message",f),O({connections:[]});},3e3),f=_=>{let c=_.data;c?.type!=="connect:check:result"||c?.connectId!==i||(clearTimeout(d),globalThis.window.removeEventListener("message",f),O({connections:c.connections??[]}));};globalThis.window.addEventListener("message",f),u.contentWindow?.postMessage({type:"connect:check",connectId:i,provider:a,scope:o,appId:y},"*");});if(h.connections.length>0)return {status:"connected",connectId:i,connections:h.connections};if(l==="check_only")return {status:"error",connectId:i,error:"no_connections",errorDescription:"No existing connections found."}}let C=new URL("/connect",globalThis.window.__ROOT_URL__);C.searchParams.set("connectId",i),C.searchParams.set("provider",a),o&&C.searchParams.set("scope",o),l&&C.searchParams.set("mode",l),y&&C.searchParams.set("appId",y);let U=Math.min(720,Math.floor(globalThis.window.screen.availWidth*.9)),T=Math.min(800,Math.floor(globalThis.window.screen.availHeight*.9)),N=Math.floor(globalThis.window.screenX+(globalThis.window.outerWidth-U)/2),F=Math.floor(globalThis.window.screenY+(globalThis.window.outerHeight-T)/2),M=`popup=yes,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=${U},height=${T},left=${N},top=${F}`,R=l!=="check_only"?globalThis.window.open(C.toString(),`ac1_connect_${i}`,M):null;return new Promise(h=>{let O=()=>{globalThis.window.removeEventListener("message",d),globalThis.window.clearInterval(f),t.delete(i);},d=_=>{let c=_.data||{};if(c.type==="connect:result"&&c.connectId===i){O();try{R?.close();}catch{}c.status==="error"?h({status:"error",connectId:i,error:c.error,errorDescription:c.errorDescription}):h({status:"connected",connectId:i,connections:c.connections??[]});}},f=globalThis.window.setInterval(()=>{R?.closed&&(O(),h({status:"error",connectId:i,error:"popup_closed",errorDescription:"The connect window was closed before finishing."}));},250);t.set(i,{popup:R,cleanup:O}),globalThis.window.addEventListener("message",d);})},globalThis.window.addEventListener("message",S=>{!S.data||typeof S.data!="object"||S.data.type==="closeAuthDrawer"&&p();}),e?.addEventListener("click",p),n.addEventListener("click",S=>{S.target===n&&p();});}var bt=r=>{let{email:n,phoneNumber:b}=r??{},s=n??b,e=new URLSearchParams;r&&"redirectUri"in r&&r.redirectUri?e.set("returnTo",r.redirectUri):e.set("returnTo",globalThis.window.location.pathname+globalThis.window.location.search),s&&e.set("identity",s),e.set("stripped","true");let t=globalThis.window.__APP_ID__;br(`${globalThis.window.__ROOT_URL__}/setup/${t}?${e.toString()}`);};function Er(r={}){let[n,b]=useState({userId:void 0,status:"loading",signIn:bt,providers:[]});return useEffect(()=>{(async()=>{try{let t=await(await fetch("/api/session",{method:"POST",headers:{"Content-Type":"application/json","x-guest-api-internal":"session",...globalThis.window.__IS_TESTING__?{"x-is-testing":"true"}:{}}})).json()??{};b({userId:t.userId??null,status:"authenticated",signIn:bt,providers:t?.providers??[]});}catch{if(r.required){let t=encodeURIComponent(globalThis.window.location.pathname+globalThis.window.location.search),p=globalThis.window.__APP_ID__;globalThis.window.top?globalThis.window.top.location.href=`${globalThis.window.__ROOT_URL__}/setup/${p}?returnTo=${t}`:globalThis.window.location.href=`${globalThis.window.__ROOT_URL__}/setup/${p}?returnTo=${t}`;}else b({userId:null,status:"unauthenticated",signIn:bt,providers:[]});}})();},[r.required]),n}async function Sr(r){let n=`c_${Math.random().toString(36).slice(2)}_${Date.now()}`;return await globalThis.window.__REQUEST_CONNECTION__({connectId:n,provider:r.provider,scope:r.scope?.join(","),mode:r.mode??"get_or_request",appId:globalThis.window.__APP_ID__})}var mn=false,Ie=new Map,We=new Map;function Ve(r,n,b){let s=Ie.get(r),e=We.get(r);Ie.delete(r),We.delete(r),je.delete(r);try{localStorage.removeItem(`drive-picker:config:${r}`),localStorage.removeItem(`drive-picker:result:${r}`);}catch{}try{e?.close();}catch{}s?.({action:n,docs:b});}function Ir(){mn||(mn=true,globalThis.window.addEventListener("storage",r=>{if(!(!r.key?.startsWith("drive-picker:result:")||!r.newValue))try{let n=JSON.parse(r.newValue),b=r.key.replace("drive-picker:result:","");n.type==="drive-picker:result"?Ve(b,n.action,n.docs):n.type==="drive-picker:error"&&(console.error("Drive Picker error:",n.error),Ve(b,"cancel"));}catch{}}),globalThis.window.addEventListener("message",r=>{let n=r.data;if(typeof n=="string")try{n=JSON.parse(n);}catch{}if(n?.type==="FILE_PICKER_RESULT"){if(console.log("[SDK] Received FILE_PICKER_RESULT:",n),!It()){console.log("[SDK] Ignoring - not in mobile WebView");return}let{pickerId:e}=n,t=Ie.get(e);console.log("[SDK] pickerId:",e,"has callback:",!!t),console.log("[SDK] All stored pickerIds:",[...Ie.keys()]),t&&(console.log("[SDK] Invoking callback with action:",n.action),Ve(e,n.action,n.docs));return}if(!n?.type?.startsWith("drive-picker:"))return;let b=new URL(globalThis.window.__ROOT_URL__).origin;if(r.origin!==b)return;let{pickerId:s}=n;if(n.type==="drive-picker:ready"){let e=je.get(s),t=We.get(s);e&&t&&(je.delete(s),t.postMessage({type:"drive-picker:init",pickerId:s,connectionId:e.connectionToken,builderCalls:e.builderCalls},b));return}n.type==="drive-picker:result"?Ve(s,n.action,n.docs):n.type==="drive-picker:error"&&(console.error("Drive Picker error:",n.error),Ve(s,"cancel"));}));}function It(){return typeof globalThis.window.ReactNativeWebView<"u"}function Tr(r,n,b){globalThis.window.ReactNativeWebView.postMessage(JSON.stringify({type:"requestFilePicker",pickerId:r,connectionId:n,builderCalls:b}));}var je=new Map;function Cr(r,n,b){if(It())return Tr(r,n,b),null;let s={connectionToken:n,builderCalls:b};je.set(r,s);try{localStorage.setItem(`drive-picker:config:${r}`,JSON.stringify(s));}catch{}let e=Math.min(1024,Math.floor(globalThis.window.screen.availWidth*.9)),t=Math.min(680,Math.floor(globalThis.window.screen.availHeight*.9)),p=Math.floor(globalThis.window.screenX+(globalThis.window.outerWidth-e)/2),u=Math.floor(globalThis.window.screenY+(globalThis.window.outerHeight-t)/2),w=`popup=yes,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=${e},height=${t},left=${p},top=${u}`,S=new URLSearchParams({pickerId:r}),i=`${globalThis.window.__ROOT_URL__}/drive-picker?${S.toString()}`;return globalThis.window.open(i,`drive_picker_${r}`,w)}var yn={DOCS:"DOCS",DOCS_IMAGES:"DOCS_IMAGES",DOCS_IMAGES_AND_VIDEOS:"DOCS_IMAGES_AND_VIDEOS",DOCS_VIDEOS:"DOCS_VIDEOS",DOCUMENTS:"DOCUMENTS",DRAWINGS:"DRAWINGS",FOLDERS:"FOLDERS",FORMS:"FORMS",PDFS:"PDFS",PHOTOS:"PHOTOS",PRESENTATIONS:"PRESENTATIONS",RECENTLY_PICKED:"RECENTLY_PICKED",SPREADSHEETS:"SPREADSHEETS"},Rr={MINE_ONLY:"MINE_ONLY",MULTISELECT_ENABLED:"MULTISELECT_ENABLED",NAV_HIDDEN:"NAV_HIDDEN",SIMPLE_UPLOAD_ENABLED:"SIMPLE_UPLOAD_ENABLED",SUPPORT_DRIVES:"SUPPORT_DRIVES"},Or={PICKED:"picked",CANCEL:"cancel"},et=class{viewType;viewCalls=[];constructor(n){this.viewType=n??yn.DOCS;}setMimeTypes(n){return this.viewCalls.push(["setMimeTypes",[n]]),this}setIncludeFolders(n){return this.viewCalls.push(["setIncludeFolders",[n]]),this}setSelectFolderEnabled(n){return this.viewCalls.push(["setSelectFolderEnabled",[n]]),this}setParent(n){return this.viewCalls.push(["setParent",[n]]),this}setQuery(n){return this.viewCalls.push(["setQuery",[n]]),this}setFileIds(n){let b=Array.isArray(n)?n.join(","):n;return this.viewCalls.push(["setFileIds",[b]]),this}setOwnedByMe(n){return this.viewCalls.push(["setOwnedByMe",[n]]),this}setStarred(n){return this.viewCalls.push(["setStarred",[n]]),this}_toConfig(){return {type:this.viewType,calls:this.viewCalls.length>0?this.viewCalls:void 0}}},tt=class{viewCalls=[];setParent(n){return this.viewCalls.push(["setParent",[n]]),this}_toConfig(){return {type:"DocsUploadView",calls:this.viewCalls.length>0?this.viewCalls:void 0}}},Et=class{constructor(n,b,s){this.connectionToken=n;this.builderCalls=b;this.callback=s;}setVisible(n){if(n){Ir();let b=Math.random().toString(36).substring(2,15);this.callback&&Ie.set(b,this.callback);let s=Cr(b,this.connectionToken,this.builderCalls);if(It())return;if(!s){Ie.delete(b),console.error("Failed to open picker popup - popup may be blocked"),this.callback?.({action:"cancel"});return}We.set(b,s);let e=globalThis.window.setInterval(()=>{s.closed&&(globalThis.window.clearInterval(e),Ie.has(b)&&(Ie.delete(b),We.delete(b),this.callback?.({action:"cancel"})));},500);}}},St=class{connectionToken;calls=[];pickerCallback;constructor(n){return this.connectionToken=n,new Proxy(this,{get(b,s,e){return s==="setCallback"?t=>(b.pickerCallback=t,e):s==="build"?()=>b._build():s in b&&typeof b[s]!="function"?b[s]:(...t)=>{if(s==="addView"){let p=t[0];p instanceof et||p instanceof tt?b.calls.push([s,[p._toConfig()]]):b.calls.push([s,t]);}else b.calls.push([s,t]);return e}}})}_build(){return new Et(this.connectionToken,this.calls,this.pickerCallback)}setTitle(n){return this}setLocale(n){return this}enableFeature(n){return this}disableFeature(n){return this}addView(n){return this}hideTitleBar(){return this}setSize(n,b){return this}setMaxItems(n){return this}setSelectableMimeTypes(n){return this}setCallback(n){return this}build(){return this._build()}};function Pr(r){return new et(r)}function xr(){return new tt}async function vn({channelId:r,initialData:n,broadcastOnly:b,onUpdate:s}){let e=n,t=0,p=globalThis.window.__REALTIME_DOMAIN__;if(b)return {getData(){return e},setData(w){e=w,fetch(`https://${p}/${r}`,{method:"POST",body:Tt.stringify(e)}).catch(console.error),s?.(w);},destroy(){}};let u=new WebSocket(`wss://${p}/${r}`);return new Promise((w,S)=>{function i(y){try{let C=JSON.parse(y.data.toString());C?.id&&C.id>t?(e=Tt.parse(C.payload),s?.(e),t=C.id):console.error("Invalid message:",y.data);}catch{console.error("Error parsing message:",y.data);}}function a(y){l(),S(y);}function o(){w({getData(){return e},setData(y){e=y,s?.(y),u.send(Tt.stringify(y));},destroy:l});}function l(){u.removeEventListener("message",i),u.removeEventListener("error",a),u.removeEventListener("open",o),u.close();}u.addEventListener("message",i),u.addEventListener("error",a),u.addEventListener("open",o);})}function An(r,n){let b=useRef(null),[s,e]=useState(0);return useEffect(()=>((async()=>r&&(b.current=await vn({channelId:r,initialData:n,onUpdate:()=>{e(t=>t+1);}})))(),b.current?.destroy),[r,e]),[b.current?.getData(),b.current?.setData??identity]}function Nr(r){let[n,b]=useState(null),[s]=An(n,void 0),e=r.mutationFn;if(!e)throw new Error("useRealtimeMutation requires a mutationFn option.");let t=useCallback(async u=>{let w=nanoid(32);return b(w),await e({...u,__channelId:w})},[r?.mutationFn]);return {...useMutation({...r,mutationFn:t}),data:s}}function _n(r){return r?.message?.startsWith("__MISSING AUTH FOR SCOPE")}function Sn(r){return r[0]}function Vr(r){let b=r?.message?.slice("__MISSING AUTH FOR SCOPE:".length+1).trim()??"",s=JSON.parse(atob(b.split(" ")?.[0])),e=s?.provider,t=s?.scope;return {provider:e,scope:t,isPopup:r?.message?.endsWith("--popup"),accountId:s?.accountId}}var Wr=60,$r=30*1e3,Ct=0,In=Date.now(),Rt=false;function Qr(){return rpcClient({transport:async(r,n)=>{let b=Date.now();if(b-In>=$r)In=b,Ct=0,Rt=false;else if(Ct>=Wr)throw Rt||(globalThis.window.dispatchEvent(new Event("rate-limit-exceeded")),Rt=true),new RpcError("Rate limit exceeded",-32e3,{status:429});Ct++;let s="/api/"+r.method,e=r.params&&Sn(r.params)?.__channelId;e&&delete Sn(r.params)?.__channelId;let t=await fetch(s,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...e?{"x-channel-id":e}:{},...globalThis.window.__IS_TESTING__?{"x-is-testing":"true"}:{},"x-boxman-box-id":globalThis.window.__BOX_ID__},body:Tt.stringify(r),signal:n});if(!t.ok){let u=t.statusText,w=-32e3;try{let{message:S,code:i}=await t.json();S&&(u=S),i&&(w=i);}catch{}throw u.trim()===""&&(u=`Request failed with status: ${t.status}`),new RpcError(u,w,{status:t.status})}let p=Tt.deserialize(await t.json());if(_n(p.error)){let u=encodeURIComponent(globalThis.window.location.pathname+globalThis.window.location.search),w=Vr(p.error),S=[`returnTo=${u}`,w.provider?`&provider=${w.provider}`:"",w.scope?`&scope=${w.scope.join(",")}`:"",w.accountId?`&accountId=${w.accountId}`:""].filter(Boolean).join("&");if(w.isPopup){globalThis.window.__OPEN_AUTH_DRAWER__(`${globalThis.window.__ROOT_URL__}/setup/${globalThis.window.__APP_ID__}?${S}&stripped=true`);return}let i=globalThis.window.top??globalThis.window;return i.location.href=`${globalThis.window.__ROOT_URL__}/setup/${globalThis.window.__APP_ID__}?${S}`,null}return p}})}function _o(r){return new Promise(n=>{let b=new globalThis.FileReader;b.onload=()=>{n(b.result);},b.readAsDataURL(r);})}function zr(){let r={...globalThis.window.console};function n(b,s){let e=(0, Rn.default)(s,{depth:5,maxStringLength:512,indent:2});fetch("/_logger",{method:"POST",body:`[console.${b.toLowerCase()}] ${e}`}).catch(()=>{});}globalThis.window.console.log=(...b)=>{n("LOG",b),r.log(...b);},globalThis.window.console.error=(...b)=>{n("ERROR",b),r.error(...b);},globalThis.window.console.info=(...b)=>{n("INFO",b),r.info(...b);},globalThis.window.console.warn=(...b)=>{n("WARN",b),r.warn(...b);};}var Tn=false;function Gr(r,n=globalThis.window.parent,b="*"){n?.postMessage({...r,source:"iframe"},{targetOrigin:b});}function qr(r){let n=r.toLowerCase();return n==="localhost"||n==="127.0.0.1"||n==="::1"||n==="local.acflare.com"||n.endsWith(".local")||n.endsWith(".local.acflare.com")}function Kr(){let r=new Set;r.add(globalThis.window.location.hostname);for(let n of [globalThis.window.__BASE_URL__,globalThis.window.__ROOT_URL__])if(n)try{r.add(new URL(n).hostname);}catch{}for(let n of r)if(qr(n))return true;return false}function On(r){if(r.source!==globalThis.window.parent)return false;if(globalThis.window.__IS_TESTING__)return true;let n=new Set;for(let b of [globalThis.window.__BASE_URL__,globalThis.window.__ROOT_URL__])if(b)try{n.add(new URL(b).origin);}catch{}return n.size===0?Kr()?(Tn||(Tn=true,console.warn("[sdk] No trusted parent origins could be derived from __BASE_URL__/__ROOT_URL__. Falling back to source-only parent validation in local development.")),true):false:n.has(r.origin)}function Yr(){globalThis.window.addEventListener("message",async r=>{if(!On(r))return;let{origin:n,source:b,data:s}=r,{type:e}=s;if(e==="screenshot"){let t=globalThis.window.getComputedStyle(globalThis.document.body).backgroundColor,p=await Cn.default.toPng(globalThis.document.body,{bgcolor:t,style:{transform:"translateY("+-globalThis.window.scrollY+"px)"},width:globalThis.window.innerWidth,height:globalThis.window.innerHeight,copyDefaultStyles:false}),u=await fetch(p).then(a=>a.blob()),w=await re(u,{maxSizeMB:4,maxWidthOrHeight:1920,useWebWorker:false}),i={type:"screenshot",payload:{screenshot:await re.getDataUrlFromFile(w)}};Gr(i,b,n);}});}function Xr(){let r="--guest-top-inset",n="--guest-bottom-inset",b="__guest-inset-style",s="data-sdk-inset-host",e="__NATIVE_VIEWPORT_INSET__",t=null,p=()=>{if(globalThis.document.getElementById(b))return;let l=globalThis.document.createElement("style");l.id=b,l.textContent=`
230
+ #root > [${s}="true"] {
231
+ padding-top: var(${r}, 0px);
232
+ padding-bottom: var(${n}, 0px);
236
233
  }
237
- #root::after {
238
- content: '';
239
- display: block;
240
- height: var(${n}, 0px);
241
- background-color: var(${b}, transparent);
242
- pointer-events: none;
243
- }
244
- `,globalThis.document.head.appendChild(c);},t=c=>{let y=typeof c=="number"?c:typeof c=="string"?Number.parseFloat(c):Number.NaN;return Number.isFinite(y)?y:null},p=c=>{e();let y=t(c.top)??0;globalThis.document.documentElement.style.setProperty(r,`${Math.max(0,y)}px`);let S=t(c.bottom)??0;globalThis.document.documentElement.style.setProperty(n,`${Math.max(0,S)}px`);};globalThis.window.addEventListener("message",c=>{if(!Pn(c))return;let{data:y}=c;y?.type==="viewportInset"&&p(y?.payload??{});});}function Eo({appId:r,rootUrl:n,baseUrl:b,isTesting:s,realtimeDomain:e,boxId:t}){typeof globalThis.window>"u"||globalThis.window.__APP_ID__||(globalThis.window.__APP_ID__=r,globalThis.window.__ROOT_URL__=n,globalThis.window.__BASE_URL__=b,globalThis.window.__IS_TESTING__=s,globalThis.window.__REALTIME_DOMAIN__=e,globalThis.window.__BOX_ID__=t,Yr(),Gr(),gn(),Xr(),Jr(),globalThis.window.onerror=function(p){console.error("Global JS error:",p);},globalThis.window.onunhandledrejection=function(p){console.error("Unhandled promise rejection:",p.reason);});}function So(){return globalThis.window.__BASE_URL__}/*! Bundled license information:
234
+ `,globalThis.document.head.appendChild(l);},u=()=>{let y=globalThis.document.getElementById("root")?.firstElementChild??null;if(t&&t!==y&&t.removeAttribute(s),y){y.setAttribute(s,"true"),t=y;return}t=null;},w=globalThis.document.getElementById("root");w&&(u(),new MutationObserver(()=>{u();}).observe(w,{childList:true}));let S=l=>{let y=typeof l=="number"?l:typeof l=="string"?Number.parseFloat(l):Number.NaN;return Number.isFinite(y)?y:null},i=l=>{p();let y=S(l.top)??0;globalThis.document.documentElement.style.setProperty(r,`${Math.max(0,y)}px`);let C=S(l.bottom)??0;globalThis.document.documentElement.style.setProperty(n,`${Math.max(0,C)}px`);},a=l=>{if(!l)return null;if(typeof l=="string")try{let y=JSON.parse(l);return y&&typeof y=="object"?y:null}catch{return null}return typeof l=="object"?l:null};globalThis.window.addEventListener("message",l=>{let y=a(l.data);y?.type!=="viewportInset"||!(typeof globalThis.window.ReactNativeWebView<"u"&&y?.source==="native")&&!On(l)||i(y?.payload??{});});let o=globalThis.window[e]??null;o&&i(o);}function bo({appId:r,rootUrl:n,baseUrl:b,isTesting:s,realtimeDomain:e,boxId:t}){typeof globalThis.window>"u"||globalThis.window.__APP_ID__||(globalThis.window.__APP_ID__=r,globalThis.window.__ROOT_URL__=n,globalThis.window.__BASE_URL__=b,globalThis.window.__IS_TESTING__=s,globalThis.window.__REALTIME_DOMAIN__=e,globalThis.window.__BOX_ID__=t,Yr(),zr(),gn(),Xr(),globalThis.window.onerror=function(p){console.error("Global JS error:",p);},globalThis.window.onunhandledrejection=function(p){console.error("Unhandled promise rejection:",p.reason);});}function Eo(){return globalThis.window.__BASE_URL__}/*! Bundled license information:
245
235
 
246
236
  dom-to-image-more/dist/dom-to-image-more.min.js:
247
237
  (*! dom-to-image-more 23-10-2025 *)
248
- */export{Pr as Action,Mr as DocsUploadView,xr as DocsView,Or as Feature,St as PickerBuilder,yn as ViewId,zr as apiClient,Cr as connect,vn as connectToRealtimeStore,bo as encodeFileAsBase64DataURL,So as getBaseUrl,Eo as initializeClientEnvironment,Sr as useAuth,Br as useRealtimeMutation,An as useRealtimeStore};
238
+ */export{Or as Action,xr as DocsUploadView,Pr as DocsView,Rr as Feature,St as PickerBuilder,yn as ViewId,Qr as apiClient,Sr as connect,vn as connectToRealtimeStore,_o as encodeFileAsBase64DataURL,Eo as getBaseUrl,bo as initializeClientEnvironment,Er as useAuth,Nr as useRealtimeMutation,An as useRealtimeStore};
@@ -1627,19 +1627,19 @@ export declare const appConfigSchema: z.ZodObject<{
1627
1627
  isEnabled: boolean;
1628
1628
  description?: string | undefined;
1629
1629
  name?: string | undefined;
1630
+ timezone?: string | undefined;
1630
1631
  stopAt?: string | undefined;
1631
1632
  maxExecutions?: number | undefined;
1632
- timezone?: string | undefined;
1633
1633
  }, {
1634
1634
  slug: string;
1635
1635
  schedule: string;
1636
1636
  rpcEndpoint: string;
1637
1637
  description?: string | undefined;
1638
1638
  name?: string | undefined;
1639
+ timezone?: string | undefined;
1639
1640
  isEnabled?: boolean | undefined;
1640
1641
  stopAt?: string | undefined;
1641
1642
  maxExecutions?: number | undefined;
1642
- timezone?: string | undefined;
1643
1643
  }>, "many">;
1644
1644
  }, "strip", z.ZodTypeAny, {
1645
1645
  crons: {
@@ -1649,9 +1649,9 @@ export declare const appConfigSchema: z.ZodObject<{
1649
1649
  isEnabled: boolean;
1650
1650
  description?: string | undefined;
1651
1651
  name?: string | undefined;
1652
+ timezone?: string | undefined;
1652
1653
  stopAt?: string | undefined;
1653
1654
  maxExecutions?: number | undefined;
1654
- timezone?: string | undefined;
1655
1655
  }[];
1656
1656
  }, {
1657
1657
  crons: {
@@ -1660,10 +1660,10 @@ export declare const appConfigSchema: z.ZodObject<{
1660
1660
  rpcEndpoint: string;
1661
1661
  description?: string | undefined;
1662
1662
  name?: string | undefined;
1663
+ timezone?: string | undefined;
1663
1664
  isEnabled?: boolean | undefined;
1664
1665
  stopAt?: string | undefined;
1665
1666
  maxExecutions?: number | undefined;
1666
- timezone?: string | undefined;
1667
1667
  }[];
1668
1668
  }>;
1669
1669
  export type AppConfig = z.infer<typeof appConfigSchema>;
@@ -1728,10 +1728,12 @@ declare let client: {
1728
1728
  boxId: string;
1729
1729
  isDevelopment: boolean | null;
1730
1730
  appId?: string | null | undefined;
1731
+ appFolder?: string | null | undefined;
1731
1732
  rpcMethod?: string | null | undefined;
1732
1733
  requestId?: string | null | undefined;
1733
1734
  channelId?: string | null | undefined;
1734
1735
  platformUserId?: string | null | undefined;
1736
+ invocationTrigger?: "user" | "scheduled" | null | undefined;
1735
1737
  agent?: string | null | undefined;
1736
1738
  sessionId?: string | null | undefined;
1737
1739
  pushToken?: string | null | undefined;
@@ -1768,10 +1770,12 @@ declare let client: {
1768
1770
  type: "BOXMAN_REQUEST";
1769
1771
  appId: string | null | undefined;
1770
1772
  boxId: string;
1773
+ appFolder: string | null | undefined;
1771
1774
  rpcMethod: string | null | undefined;
1772
1775
  requestId: string | null | undefined;
1773
1776
  channelId: string | null | undefined;
1774
1777
  platformUserId: string | null | undefined;
1778
+ invocationTrigger: "user" | "scheduled" | null | undefined;
1775
1779
  isDevelopment: boolean | null;
1776
1780
  agent: string | null | undefined;
1777
1781
  sessionId: string | null | undefined;
@@ -1791,7 +1795,7 @@ declare let client: {
1791
1795
  _output_out: typeof _trpc_server.unsetMarker;
1792
1796
  }, {
1793
1797
  response: object;
1794
- status: "RUNNING" | "DONE";
1798
+ status: string;
1795
1799
  sessionId: string;
1796
1800
  }>>;
1797
1801
  };
@@ -1816,10 +1820,12 @@ declare let client: {
1816
1820
  boxId: string;
1817
1821
  isDevelopment: boolean | null;
1818
1822
  appId?: string | null | undefined;
1823
+ appFolder?: string | null | undefined;
1819
1824
  rpcMethod?: string | null | undefined;
1820
1825
  requestId?: string | null | undefined;
1821
1826
  channelId?: string | null | undefined;
1822
1827
  platformUserId?: string | null | undefined;
1828
+ invocationTrigger?: "user" | "scheduled" | null | undefined;
1823
1829
  agent?: string | null | undefined;
1824
1830
  sessionId?: string | null | undefined;
1825
1831
  pushToken?: string | null | undefined;
@@ -1856,10 +1862,12 @@ declare let client: {
1856
1862
  type: "BOXMAN_REQUEST";
1857
1863
  appId: string | null | undefined;
1858
1864
  boxId: string;
1865
+ appFolder: string | null | undefined;
1859
1866
  rpcMethod: string | null | undefined;
1860
1867
  requestId: string | null | undefined;
1861
1868
  channelId: string | null | undefined;
1862
1869
  platformUserId: string | null | undefined;
1870
+ invocationTrigger: "user" | "scheduled" | null | undefined;
1863
1871
  isDevelopment: boolean | null;
1864
1872
  agent: string | null | undefined;
1865
1873
  sessionId: string | null | undefined;
@@ -1899,10 +1907,12 @@ declare let client: {
1899
1907
  boxId: string;
1900
1908
  isDevelopment: boolean | null;
1901
1909
  appId?: string | null | undefined;
1910
+ appFolder?: string | null | undefined;
1902
1911
  rpcMethod?: string | null | undefined;
1903
1912
  requestId?: string | null | undefined;
1904
1913
  channelId?: string | null | undefined;
1905
1914
  platformUserId?: string | null | undefined;
1915
+ invocationTrigger?: "user" | "scheduled" | null | undefined;
1906
1916
  agent?: string | null | undefined;
1907
1917
  sessionId?: string | null | undefined;
1908
1918
  pushToken?: string | null | undefined;
@@ -1939,10 +1949,12 @@ declare let client: {
1939
1949
  type: "BOXMAN_REQUEST";
1940
1950
  appId: string | null | undefined;
1941
1951
  boxId: string;
1952
+ appFolder: string | null | undefined;
1942
1953
  rpcMethod: string | null | undefined;
1943
1954
  requestId: string | null | undefined;
1944
1955
  channelId: string | null | undefined;
1945
1956
  platformUserId: string | null | undefined;
1957
+ invocationTrigger: "user" | "scheduled" | null | undefined;
1946
1958
  isDevelopment: boolean | null;
1947
1959
  agent: string | null | undefined;
1948
1960
  sessionId: string | null | undefined;
@@ -1993,10 +2005,12 @@ declare let client: {
1993
2005
  boxId: string;
1994
2006
  isDevelopment: boolean | null;
1995
2007
  appId?: string | null | undefined;
2008
+ appFolder?: string | null | undefined;
1996
2009
  rpcMethod?: string | null | undefined;
1997
2010
  requestId?: string | null | undefined;
1998
2011
  channelId?: string | null | undefined;
1999
2012
  platformUserId?: string | null | undefined;
2013
+ invocationTrigger?: "user" | "scheduled" | null | undefined;
2000
2014
  agent?: string | null | undefined;
2001
2015
  sessionId?: string | null | undefined;
2002
2016
  pushToken?: string | null | undefined;
@@ -2033,10 +2047,12 @@ declare let client: {
2033
2047
  type: "BOXMAN_REQUEST";
2034
2048
  appId: string | null | undefined;
2035
2049
  boxId: string;
2050
+ appFolder: string | null | undefined;
2036
2051
  rpcMethod: string | null | undefined;
2037
2052
  requestId: string | null | undefined;
2038
2053
  channelId: string | null | undefined;
2039
2054
  platformUserId: string | null | undefined;
2055
+ invocationTrigger: "user" | "scheduled" | null | undefined;
2040
2056
  isDevelopment: boolean | null;
2041
2057
  agent: string | null | undefined;
2042
2058
  sessionId: string | null | undefined;
@@ -2079,10 +2095,12 @@ declare let client: {
2079
2095
  boxId: string;
2080
2096
  isDevelopment: boolean | null;
2081
2097
  appId?: string | null | undefined;
2098
+ appFolder?: string | null | undefined;
2082
2099
  rpcMethod?: string | null | undefined;
2083
2100
  requestId?: string | null | undefined;
2084
2101
  channelId?: string | null | undefined;
2085
2102
  platformUserId?: string | null | undefined;
2103
+ invocationTrigger?: "user" | "scheduled" | null | undefined;
2086
2104
  agent?: string | null | undefined;
2087
2105
  sessionId?: string | null | undefined;
2088
2106
  pushToken?: string | null | undefined;
@@ -2119,10 +2137,12 @@ declare let client: {
2119
2137
  type: "BOXMAN_REQUEST";
2120
2138
  appId: string | null | undefined;
2121
2139
  boxId: string;
2140
+ appFolder: string | null | undefined;
2122
2141
  rpcMethod: string | null | undefined;
2123
2142
  requestId: string | null | undefined;
2124
2143
  channelId: string | null | undefined;
2125
2144
  platformUserId: string | null | undefined;
2145
+ invocationTrigger: "user" | "scheduled" | null | undefined;
2126
2146
  isDevelopment: boolean | null;
2127
2147
  agent: string | null | undefined;
2128
2148
  sessionId: string | null | undefined;
@@ -2171,10 +2191,12 @@ declare let client: {
2171
2191
  boxId: string;
2172
2192
  isDevelopment: boolean | null;
2173
2193
  appId?: string | null | undefined;
2194
+ appFolder?: string | null | undefined;
2174
2195
  rpcMethod?: string | null | undefined;
2175
2196
  requestId?: string | null | undefined;
2176
2197
  channelId?: string | null | undefined;
2177
2198
  platformUserId?: string | null | undefined;
2199
+ invocationTrigger?: "user" | "scheduled" | null | undefined;
2178
2200
  agent?: string | null | undefined;
2179
2201
  sessionId?: string | null | undefined;
2180
2202
  pushToken?: string | null | undefined;
@@ -2211,10 +2233,12 @@ declare let client: {
2211
2233
  type: "BOXMAN_REQUEST";
2212
2234
  appId: string | null | undefined;
2213
2235
  boxId: string;
2236
+ appFolder: string | null | undefined;
2214
2237
  rpcMethod: string | null | undefined;
2215
2238
  requestId: string | null | undefined;
2216
2239
  channelId: string | null | undefined;
2217
2240
  platformUserId: string | null | undefined;
2241
+ invocationTrigger: "user" | "scheduled" | null | undefined;
2218
2242
  isDevelopment: boolean | null;
2219
2243
  agent: string | null | undefined;
2220
2244
  sessionId: string | null | undefined;
@@ -2266,10 +2290,12 @@ declare let client: {
2266
2290
  boxId: string;
2267
2291
  isDevelopment: boolean | null;
2268
2292
  appId?: string | null | undefined;
2293
+ appFolder?: string | null | undefined;
2269
2294
  rpcMethod?: string | null | undefined;
2270
2295
  requestId?: string | null | undefined;
2271
2296
  channelId?: string | null | undefined;
2272
2297
  platformUserId?: string | null | undefined;
2298
+ invocationTrigger?: "user" | "scheduled" | null | undefined;
2273
2299
  agent?: string | null | undefined;
2274
2300
  sessionId?: string | null | undefined;
2275
2301
  pushToken?: string | null | undefined;
@@ -2306,10 +2332,12 @@ declare let client: {
2306
2332
  type: "BOXMAN_REQUEST";
2307
2333
  appId: string | null | undefined;
2308
2334
  boxId: string;
2335
+ appFolder: string | null | undefined;
2309
2336
  rpcMethod: string | null | undefined;
2310
2337
  requestId: string | null | undefined;
2311
2338
  channelId: string | null | undefined;
2312
2339
  platformUserId: string | null | undefined;
2340
+ invocationTrigger: "user" | "scheduled" | null | undefined;
2313
2341
  isDevelopment: boolean | null;
2314
2342
  agent: string | null | undefined;
2315
2343
  sessionId: string | null | undefined;
@@ -2353,10 +2381,12 @@ declare let client: {
2353
2381
  boxId: string;
2354
2382
  isDevelopment: boolean | null;
2355
2383
  appId?: string | null | undefined;
2384
+ appFolder?: string | null | undefined;
2356
2385
  rpcMethod?: string | null | undefined;
2357
2386
  requestId?: string | null | undefined;
2358
2387
  channelId?: string | null | undefined;
2359
2388
  platformUserId?: string | null | undefined;
2389
+ invocationTrigger?: "user" | "scheduled" | null | undefined;
2360
2390
  agent?: string | null | undefined;
2361
2391
  sessionId?: string | null | undefined;
2362
2392
  pushToken?: string | null | undefined;
@@ -2393,10 +2423,12 @@ declare let client: {
2393
2423
  type: "BOXMAN_REQUEST";
2394
2424
  appId: string | null | undefined;
2395
2425
  boxId: string;
2426
+ appFolder: string | null | undefined;
2396
2427
  rpcMethod: string | null | undefined;
2397
2428
  requestId: string | null | undefined;
2398
2429
  channelId: string | null | undefined;
2399
2430
  platformUserId: string | null | undefined;
2431
+ invocationTrigger: "user" | "scheduled" | null | undefined;
2400
2432
  isDevelopment: boolean | null;
2401
2433
  agent: string | null | undefined;
2402
2434
  sessionId: string | null | undefined;
@@ -2441,10 +2473,12 @@ declare let client: {
2441
2473
  boxId: string;
2442
2474
  isDevelopment: boolean | null;
2443
2475
  appId?: string | null | undefined;
2476
+ appFolder?: string | null | undefined;
2444
2477
  rpcMethod?: string | null | undefined;
2445
2478
  requestId?: string | null | undefined;
2446
2479
  channelId?: string | null | undefined;
2447
2480
  platformUserId?: string | null | undefined;
2481
+ invocationTrigger?: "user" | "scheduled" | null | undefined;
2448
2482
  agent?: string | null | undefined;
2449
2483
  sessionId?: string | null | undefined;
2450
2484
  pushToken?: string | null | undefined;
@@ -2481,10 +2515,12 @@ declare let client: {
2481
2515
  type: "BOXMAN_REQUEST";
2482
2516
  appId: string | null | undefined;
2483
2517
  boxId: string;
2518
+ appFolder: string | null | undefined;
2484
2519
  rpcMethod: string | null | undefined;
2485
2520
  requestId: string | null | undefined;
2486
2521
  channelId: string | null | undefined;
2487
2522
  platformUserId: string | null | undefined;
2523
+ invocationTrigger: "user" | "scheduled" | null | undefined;
2488
2524
  isDevelopment: boolean | null;
2489
2525
  agent: string | null | undefined;
2490
2526
  sessionId: string | null | undefined;
@@ -2523,10 +2559,12 @@ declare let client: {
2523
2559
  boxId: string;
2524
2560
  isDevelopment: boolean | null;
2525
2561
  appId?: string | null | undefined;
2562
+ appFolder?: string | null | undefined;
2526
2563
  rpcMethod?: string | null | undefined;
2527
2564
  requestId?: string | null | undefined;
2528
2565
  channelId?: string | null | undefined;
2529
2566
  platformUserId?: string | null | undefined;
2567
+ invocationTrigger?: "user" | "scheduled" | null | undefined;
2530
2568
  agent?: string | null | undefined;
2531
2569
  sessionId?: string | null | undefined;
2532
2570
  pushToken?: string | null | undefined;
@@ -2563,10 +2601,12 @@ declare let client: {
2563
2601
  type: "BOXMAN_REQUEST";
2564
2602
  appId: string | null | undefined;
2565
2603
  boxId: string;
2604
+ appFolder: string | null | undefined;
2566
2605
  rpcMethod: string | null | undefined;
2567
2606
  requestId: string | null | undefined;
2568
2607
  channelId: string | null | undefined;
2569
2608
  platformUserId: string | null | undefined;
2609
+ invocationTrigger: "user" | "scheduled" | null | undefined;
2570
2610
  isDevelopment: boolean | null;
2571
2611
  agent: string | null | undefined;
2572
2612
  sessionId: string | null | undefined;
@@ -2633,10 +2673,12 @@ declare let client: {
2633
2673
  boxId: string;
2634
2674
  isDevelopment: boolean | null;
2635
2675
  appId?: string | null | undefined;
2676
+ appFolder?: string | null | undefined;
2636
2677
  rpcMethod?: string | null | undefined;
2637
2678
  requestId?: string | null | undefined;
2638
2679
  channelId?: string | null | undefined;
2639
2680
  platformUserId?: string | null | undefined;
2681
+ invocationTrigger?: "user" | "scheduled" | null | undefined;
2640
2682
  agent?: string | null | undefined;
2641
2683
  sessionId?: string | null | undefined;
2642
2684
  pushToken?: string | null | undefined;
@@ -2673,10 +2715,12 @@ declare let client: {
2673
2715
  type: "BOXMAN_REQUEST";
2674
2716
  appId: string | null | undefined;
2675
2717
  boxId: string;
2718
+ appFolder: string | null | undefined;
2676
2719
  rpcMethod: string | null | undefined;
2677
2720
  requestId: string | null | undefined;
2678
2721
  channelId: string | null | undefined;
2679
2722
  platformUserId: string | null | undefined;
2723
+ invocationTrigger: "user" | "scheduled" | null | undefined;
2680
2724
  isDevelopment: boolean | null;
2681
2725
  agent: string | null | undefined;
2682
2726
  sessionId: string | null | undefined;
@@ -2719,10 +2763,12 @@ declare let client: {
2719
2763
  boxId: string;
2720
2764
  isDevelopment: boolean | null;
2721
2765
  appId?: string | null | undefined;
2766
+ appFolder?: string | null | undefined;
2722
2767
  rpcMethod?: string | null | undefined;
2723
2768
  requestId?: string | null | undefined;
2724
2769
  channelId?: string | null | undefined;
2725
2770
  platformUserId?: string | null | undefined;
2771
+ invocationTrigger?: "user" | "scheduled" | null | undefined;
2726
2772
  agent?: string | null | undefined;
2727
2773
  sessionId?: string | null | undefined;
2728
2774
  pushToken?: string | null | undefined;
@@ -2759,10 +2805,12 @@ declare let client: {
2759
2805
  type: "BOXMAN_REQUEST";
2760
2806
  appId: string | null | undefined;
2761
2807
  boxId: string;
2808
+ appFolder: string | null | undefined;
2762
2809
  rpcMethod: string | null | undefined;
2763
2810
  requestId: string | null | undefined;
2764
2811
  channelId: string | null | undefined;
2765
2812
  platformUserId: string | null | undefined;
2813
+ invocationTrigger: "user" | "scheduled" | null | undefined;
2766
2814
  isDevelopment: boolean | null;
2767
2815
  agent: string | null | undefined;
2768
2816
  sessionId: string | null | undefined;
@@ -2805,10 +2853,12 @@ declare let client: {
2805
2853
  boxId: string;
2806
2854
  isDevelopment: boolean | null;
2807
2855
  appId?: string | null | undefined;
2856
+ appFolder?: string | null | undefined;
2808
2857
  rpcMethod?: string | null | undefined;
2809
2858
  requestId?: string | null | undefined;
2810
2859
  channelId?: string | null | undefined;
2811
2860
  platformUserId?: string | null | undefined;
2861
+ invocationTrigger?: "user" | "scheduled" | null | undefined;
2812
2862
  agent?: string | null | undefined;
2813
2863
  sessionId?: string | null | undefined;
2814
2864
  pushToken?: string | null | undefined;
@@ -2845,10 +2895,12 @@ declare let client: {
2845
2895
  type: "BOXMAN_REQUEST";
2846
2896
  appId: string | null | undefined;
2847
2897
  boxId: string;
2898
+ appFolder: string | null | undefined;
2848
2899
  rpcMethod: string | null | undefined;
2849
2900
  requestId: string | null | undefined;
2850
2901
  channelId: string | null | undefined;
2851
2902
  platformUserId: string | null | undefined;
2903
+ invocationTrigger: "user" | "scheduled" | null | undefined;
2852
2904
  isDevelopment: boolean | null;
2853
2905
  agent: string | null | undefined;
2854
2906
  sessionId: string | null | undefined;
@@ -2897,10 +2949,12 @@ declare let client: {
2897
2949
  boxId: string;
2898
2950
  isDevelopment: boolean | null;
2899
2951
  appId?: string | null | undefined;
2952
+ appFolder?: string | null | undefined;
2900
2953
  rpcMethod?: string | null | undefined;
2901
2954
  requestId?: string | null | undefined;
2902
2955
  channelId?: string | null | undefined;
2903
2956
  platformUserId?: string | null | undefined;
2957
+ invocationTrigger?: "user" | "scheduled" | null | undefined;
2904
2958
  agent?: string | null | undefined;
2905
2959
  sessionId?: string | null | undefined;
2906
2960
  pushToken?: string | null | undefined;
@@ -2937,10 +2991,12 @@ declare let client: {
2937
2991
  type: "BOXMAN_REQUEST";
2938
2992
  appId: string | null | undefined;
2939
2993
  boxId: string;
2994
+ appFolder: string | null | undefined;
2940
2995
  rpcMethod: string | null | undefined;
2941
2996
  requestId: string | null | undefined;
2942
2997
  channelId: string | null | undefined;
2943
2998
  platformUserId: string | null | undefined;
2999
+ invocationTrigger: "user" | "scheduled" | null | undefined;
2944
3000
  isDevelopment: boolean | null;
2945
3001
  agent: string | null | undefined;
2946
3002
  sessionId: string | null | undefined;
@@ -2993,10 +3049,12 @@ declare let client: {
2993
3049
  boxId: string;
2994
3050
  isDevelopment: boolean | null;
2995
3051
  appId?: string | null | undefined;
3052
+ appFolder?: string | null | undefined;
2996
3053
  rpcMethod?: string | null | undefined;
2997
3054
  requestId?: string | null | undefined;
2998
3055
  channelId?: string | null | undefined;
2999
3056
  platformUserId?: string | null | undefined;
3057
+ invocationTrigger?: "user" | "scheduled" | null | undefined;
3000
3058
  agent?: string | null | undefined;
3001
3059
  sessionId?: string | null | undefined;
3002
3060
  pushToken?: string | null | undefined;
@@ -3033,10 +3091,12 @@ declare let client: {
3033
3091
  type: "BOXMAN_REQUEST";
3034
3092
  appId: string | null | undefined;
3035
3093
  boxId: string;
3094
+ appFolder: string | null | undefined;
3036
3095
  rpcMethod: string | null | undefined;
3037
3096
  requestId: string | null | undefined;
3038
3097
  channelId: string | null | undefined;
3039
3098
  platformUserId: string | null | undefined;
3099
+ invocationTrigger: "user" | "scheduled" | null | undefined;
3040
3100
  isDevelopment: boolean | null;
3041
3101
  agent: string | null | undefined;
3042
3102
  sessionId: string | null | undefined;
@@ -3090,10 +3150,12 @@ declare let client: {
3090
3150
  boxId: string;
3091
3151
  isDevelopment: boolean | null;
3092
3152
  appId?: string | null | undefined;
3153
+ appFolder?: string | null | undefined;
3093
3154
  rpcMethod?: string | null | undefined;
3094
3155
  requestId?: string | null | undefined;
3095
3156
  channelId?: string | null | undefined;
3096
3157
  platformUserId?: string | null | undefined;
3158
+ invocationTrigger?: "user" | "scheduled" | null | undefined;
3097
3159
  agent?: string | null | undefined;
3098
3160
  sessionId?: string | null | undefined;
3099
3161
  pushToken?: string | null | undefined;
@@ -3130,10 +3192,12 @@ declare let client: {
3130
3192
  type: "BOXMAN_REQUEST";
3131
3193
  appId: string | null | undefined;
3132
3194
  boxId: string;
3195
+ appFolder: string | null | undefined;
3133
3196
  rpcMethod: string | null | undefined;
3134
3197
  requestId: string | null | undefined;
3135
3198
  channelId: string | null | undefined;
3136
3199
  platformUserId: string | null | undefined;
3200
+ invocationTrigger: "user" | "scheduled" | null | undefined;
3137
3201
  isDevelopment: boolean | null;
3138
3202
  agent: string | null | undefined;
3139
3203
  sessionId: string | null | undefined;
@@ -3168,10 +3232,12 @@ declare let client: {
3168
3232
  boxId: string;
3169
3233
  isDevelopment: boolean | null;
3170
3234
  appId?: string | null | undefined;
3235
+ appFolder?: string | null | undefined;
3171
3236
  rpcMethod?: string | null | undefined;
3172
3237
  requestId?: string | null | undefined;
3173
3238
  channelId?: string | null | undefined;
3174
3239
  platformUserId?: string | null | undefined;
3240
+ invocationTrigger?: "user" | "scheduled" | null | undefined;
3175
3241
  agent?: string | null | undefined;
3176
3242
  sessionId?: string | null | undefined;
3177
3243
  pushToken?: string | null | undefined;
@@ -3208,10 +3274,12 @@ declare let client: {
3208
3274
  type: "BOXMAN_REQUEST";
3209
3275
  appId: string | null | undefined;
3210
3276
  boxId: string;
3277
+ appFolder: string | null | undefined;
3211
3278
  rpcMethod: string | null | undefined;
3212
3279
  requestId: string | null | undefined;
3213
3280
  channelId: string | null | undefined;
3214
3281
  platformUserId: string | null | undefined;
3282
+ invocationTrigger: "user" | "scheduled" | null | undefined;
3215
3283
  isDevelopment: boolean | null;
3216
3284
  agent: string | null | undefined;
3217
3285
  sessionId: string | null | undefined;
@@ -3240,7 +3308,13 @@ export type MutationProxy<TClient> = {
3240
3308
  mutate: (...args: infer TArgs) => infer TReturn;
3241
3309
  } ? (args: TArgs[0]) => TReturn : never;
3242
3310
  };
3243
- export type MCP = MutationProxy<typeof client>;
3311
+ export type MCPBase = MutationProxy<typeof client>;
3312
+ export type PromptAgentStrictInput = Omit<Parameters<MCPBase["promptAgent"]>[0], "outputJsonSchema"> & {
3313
+ outputJsonSchema: object;
3314
+ };
3315
+ export type MCP = Omit<MCPBase, "promptAgent"> & {
3316
+ promptAgent: (args: PromptAgentStrictInput) => ReturnType<MCPBase["promptAgent"]>;
3317
+ };
3244
3318
  export declare const mcp: MCP;
3245
3319
  export declare function getRequestContext(): RequestContext | undefined;
3246
3320
  export declare function setRequestContext(context: Partial<RequestContext>): void;
@@ -1,2 +1,2 @@
1
- import {z as z$1}from'zod';import {createTRPCProxyClient,httpLink}from'@trpc/client';import {AsyncLocalStorage}from'async_hooks';import _ from'superjson';var W=z$1.object({slug:z$1.string(),name:z$1.string().optional(),schedule:z$1.string(),description:z$1.string().optional(),rpcEndpoint:z$1.string(),isEnabled:z$1.boolean().default(true),stopAt:z$1.string().datetime().optional(),maxExecutions:z$1.number().optional(),timezone:z$1.string().optional()}),J=z$1.object({crons:z$1.array(W)});function v(e){let r=Object.create(null);for(let t in e){let n=e[t];r[n]=t;}return r}var h={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,UNAUTHORIZED:-32001,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNPROCESSABLE_CONTENT:-32022,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};v(h);v(h);typeof window>"u"||"Deno"in window||globalThis.process?.env?.NODE_ENV==="test"||!!globalThis.process?.env?.JEST_WORKER_ID||!!globalThis.process?.env?.VITEST_WORKER_ID;var y=class e extends Error{static prefix="__MISSING AUTH FOR SCOPE";static jsonRpcCode=-32001;constructor({provider:r,scope:t,accountId:n,popup:o=false}){let s=btoa(JSON.stringify({provider:r,scope:t,accountId:n}));super(`${e.prefix}: ${s}${o?" --popup":" end"}`);}jsonRpcError(){return {code:e.jsonRpcCode,message:this.message}}static check(r){return r?.message?.startsWith(e.prefix)}};var G=createTRPCProxyClient({transformer:_,links:[]});function ze({baseUrl:e,realtimeDomain:r,guestServicesUrl:t}){globalThis.env||(globalThis.env={},globalThis.env.BASE_URL=e,globalThis.env.REALTIME_DOMAIN=r,globalThis.env.GUEST_SERVICES_URL=t,G=createTRPCProxyClient({transformer:_,links:[httpLink({url:t,transformer:_,headers:()=>{let n=A();if(!n)throw new Error("Missing request context");return {"x-request-id":n.requestId}}})]}),console.log("Adaptive SDK server environment initialized"));}var Q=new AsyncLocalStorage,me=new Proxy({},{get(e,r){return async t=>{if(globalThis.env===void 0)throw new Error("Adaptive SDK server environment is not initialized. Please call initializeServerEnvironment first.");let o=G[r];if(!o||typeof o.mutate!="function")throw new Error(`Property "${String(r)}" is not a mutation procedure`);return o.mutate(t)}}});function A(){return Q.getStore()}function Ke(e){let r=A();r&&Object.assign(r,e);}async function He(e,r){return Q.run(e,r)}function Ge(){return globalThis.env.BASE_URL}var N=null;function Qe(){return N}function We({channelId:e,onUpdate:r}){let t=new WebSocket(`wss://${globalThis.env.REALTIME_DOMAIN}/${e}`),n=-1;function o(s){r&&(N=Date.now());try{let i=JSON.parse(s.data.toString());if(i?.id&&i.id>n){let d=_.parse(i.payload);r?.(d),n=i.id;}}catch{}}return t.addEventListener("message",o),{destroy(){t.close(),t.removeEventListener("message",o);}}}async function z({channelId:e,data:r}){N=Date.now(),await fetch(`https://${globalThis.env.REALTIME_DOMAIN}/${e}`,{method:"POST",body:_.stringify(r)}).catch(console.error);}async function Je(){let e,r=A()?.channelId;if(!r)throw new Error("API's using `startRealtimeResponse` must be called via `useRealtimeMutation`.");return {next(t){e=t,z({channelId:r,data:t});},end(){return z({channelId:r,data:e}),e}}}function K(e){throw new y({provider:"AC1",popup:true})}async function Ze(e){let r=await me.getCurrentUser();if(r?.error==="SEED")throw new Error('Call to "getAuth" in seed function is not allowed. Seed functions should not depend on user data.');if(r.userId)return {userId:r.userId,status:"authenticated",signIn:K,providers:r.providers};if(e?.required)throw new y({provider:"AC1"});return {userId:null,status:"unauthenticated",signIn:K,providers:[]}}
1
+ import {z as z$1}from'zod';import {createTRPCProxyClient,httpLink}from'@trpc/client';import {AsyncLocalStorage}from'async_hooks';import _ from'superjson';var W=z$1.object({slug:z$1.string(),name:z$1.string().optional(),schedule:z$1.string(),description:z$1.string().optional(),rpcEndpoint:z$1.string(),isEnabled:z$1.boolean().default(true),stopAt:z$1.string().datetime().optional(),maxExecutions:z$1.number().optional(),timezone:z$1.string().optional()}),J=z$1.object({crons:z$1.array(W)});function P(e){let r=Object.create(null);for(let t in e){let n=e[t];r[n]=t;}return r}var w={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,UNAUTHORIZED:-32001,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNPROCESSABLE_CONTENT:-32022,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};P(w);P(w);typeof window>"u"||"Deno"in window||globalThis.process?.env?.NODE_ENV==="test"||!!globalThis.process?.env?.JEST_WORKER_ID||!!globalThis.process?.env?.VITEST_WORKER_ID;var y=class e extends Error{static prefix="__MISSING AUTH FOR SCOPE";static jsonRpcCode=-32001;constructor({provider:r,scope:t,accountId:n,popup:o=false}){let s=btoa(JSON.stringify({provider:r,scope:t,accountId:n}));super(`${e.prefix}: ${s}${o?" --popup":" end"}`);}jsonRpcError(){return {code:e.jsonRpcCode,message:this.message}}static check(r){return r?.message?.startsWith(e.prefix)}};var G=createTRPCProxyClient({transformer:_,links:[]});function ze({baseUrl:e,realtimeDomain:r,guestServicesUrl:t}){globalThis.env||(globalThis.env={},globalThis.env.BASE_URL=e,globalThis.env.REALTIME_DOMAIN=r,globalThis.env.GUEST_SERVICES_URL=t,G=createTRPCProxyClient({transformer:_,links:[httpLink({url:t,transformer:_,headers:()=>{let n=A();if(!n)throw new Error("Missing request context");return {"x-request-id":n.requestId}}})]}),console.log("Adaptive SDK server environment initialized"));}var Q=new AsyncLocalStorage,me=new Proxy({},{get(e,r){return async t=>{if(globalThis.env===void 0)throw new Error("Adaptive SDK server environment is not initialized. Please call initializeServerEnvironment first.");let o=G[r];if(!o||typeof o.mutate!="function")throw new Error(`Property "${String(r)}" is not a mutation procedure`);return o.mutate(t)}}});function A(){return Q.getStore()}function Ke(e){let r=A();r&&Object.assign(r,e);}async function He(e,r){return Q.run(e,r)}function Ge(){return globalThis.env.BASE_URL}var N=null;function Qe(){return N}function We({channelId:e,onUpdate:r}){let t=new WebSocket(`wss://${globalThis.env.REALTIME_DOMAIN}/${e}`),n=-1;function o(s){r&&(N=Date.now());try{let i=JSON.parse(s.data.toString());if(i?.id&&i.id>n){let d=_.parse(i.payload);r?.(d),n=i.id;}}catch{}}return t.addEventListener("message",o),{destroy(){t.close(),t.removeEventListener("message",o);}}}async function z({channelId:e,data:r}){N=Date.now(),await fetch(`https://${globalThis.env.REALTIME_DOMAIN}/${e}`,{method:"POST",body:_.stringify(r)}).catch(console.error);}async function Je(){let e,r=A()?.channelId;if(!r)throw new Error("API's using `startRealtimeResponse` must be called via `useRealtimeMutation`.");return {next(t){e=t,z({channelId:r,data:t});},end(){return z({channelId:r,data:e}),e}}}function K(e){throw new y({provider:"AC1",popup:true})}async function Ze(e){let r=await me.getCurrentUser();if(r?.error==="SEED")throw new Error('Call to "getAuth" in seed function is not allowed. Seed functions should not depend on user data.');if(r.userId)return {userId:r.userId,status:"authenticated",signIn:K,providers:r.providers};if(e?.required)throw new y({provider:"AC1"});return {userId:null,status:"unauthenticated",signIn:K,providers:[]}}
2
2
  export{J as appConfigSchema,Ze as getAuth,Ge as getBaseUrl,Qe as getLastStreamTime,We as getRealtimeStore,A as getRequestContext,ze as initializeServerEnvironment,me as mcp,He as runWithContext,z as setRealtimeStore,Ke as setRequestContext,Je as startRealtimeResponse};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptive-ai/sdk",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {